diff --git a/@overflow/meta/crawler-input-item/crawler-input-store.module.ts b/@overflow/meta/crawler-input-item/crawler-input-store.module.ts deleted file mode 100644 index 588d1a1..0000000 --- a/@overflow/meta/crawler-input-item/crawler-input-store.module.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { NgModule } from '@angular/core'; -import { StoreModule } from '@ngrx/store'; -import { StoreDevtoolsModule } from '@ngrx/store-devtools'; -import { - StoreRouterConnectingModule, - RouterStateSerializer, -} from '@ngrx/router-store'; -import { EffectsModule } from '@ngrx/effects'; -import { combineReducers, ActionReducer, ActionReducerMap, MetaReducer } from '@ngrx/store'; - -import { - REDUCERS, - EFFECTS, -} from './store'; - -import { MODULE } from './crawler-input.constant'; - -@NgModule({ - imports: [ - StoreModule.forFeature(MODULE.name, REDUCERS), - EffectsModule.forFeature(EFFECTS), - ], -}) -export class MetaCrawlerInputItemStoreModule { } diff --git a/@overflow/meta/crawler-input-item/crawler-input.constant.ts b/@overflow/meta/crawler-input-item/crawler-input.constant.ts deleted file mode 100644 index 54329f5..0000000 --- a/@overflow/meta/crawler-input-item/crawler-input.constant.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const MODULE = { - name: 'metaCrawlerInputItem' -}; diff --git a/@overflow/meta/crawler-input-item/crawler-input.module.ts b/@overflow/meta/crawler-input-item/crawler-input.module.ts deleted file mode 100644 index 5f327dc..0000000 --- a/@overflow/meta/crawler-input-item/crawler-input.module.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { } from './crawler.module'; - -import { SERVICES } from './service'; -import { MetaCrawlerInputItemStoreModule } from './crawler-input-store.module'; - -@NgModule({ - imports: [ - CommonModule, - MetaCrawlerInputItemStoreModule - ], - declarations: [ - ], - exports: [ - ], - providers: [ - SERVICES, - ] -}) -export class MetaCrawlerInputItemModule { } diff --git a/@overflow/meta/crawler-input-item/service/index.ts b/@overflow/meta/crawler-input-item/service/index.ts deleted file mode 100644 index 2d26125..0000000 --- a/@overflow/meta/crawler-input-item/service/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { MetaCrawlerInputItemService } from './crawler-input-item.service'; - -export const SERVICES = [ - MetaCrawlerInputItemService, -]; diff --git a/@overflow/meta/crawler-input-item/store/index.ts b/@overflow/meta/crawler-input-item/store/index.ts deleted file mode 100644 index 95d0b9e..0000000 --- a/@overflow/meta/crawler-input-item/store/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { - createSelector, - createFeatureSelector, - ActionReducerMap, -} from '@ngrx/store'; - -import { StateSelector } from '@overflow/core/ngrx/store'; - - -import * as ListStore from './list'; -import { MODULE } from '../crawler-input.constant'; - -export interface State { - list: ListStore.State; -} - -export const REDUCERS = { - list: ListStore.reducer, -}; - -export const EFFECTS = [ - ListStore.Effects, -]; - -export const selectState = createFeatureSelector(MODULE.name); - -export const ReadCrawlerInputItemSelector = new StateSelector(createSelector( - selectState, - (state: State) => state.list -)); diff --git a/@overflow/meta/crawler-input-item/store/list/index.ts b/@overflow/meta/crawler-input-item/store/list/index.ts deleted file mode 100644 index 7fd86e0..0000000 --- a/@overflow/meta/crawler-input-item/store/list/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './list.action'; -export * from './list.effect'; -export * from './list.reducer'; -export * from './list.state'; diff --git a/@overflow/meta/crawler-input-item/store/list/list.effect.spec.ts b/@overflow/meta/crawler-input-item/store/list/list.effect.spec.ts deleted file mode 100644 index d8f6227..0000000 --- a/@overflow/meta/crawler-input-item/store/list/list.effect.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { TestBed, inject } from '@angular/core/testing'; - -import { Effects } from './list.effect'; - -describe('List.Effects', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [Effects] - }); - }); - - it('should be created', inject([Effects], (effects: Effects) => { - expect(effects).toBeTruthy(); - })); -}); diff --git a/@overflow/meta/crawler-input-item/store/list/list.effect.ts b/@overflow/meta/crawler-input-item/store/list/list.effect.ts deleted file mode 100644 index 510062c..0000000 --- a/@overflow/meta/crawler-input-item/store/list/list.effect.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Router } from '@angular/router'; - -import { Effect, Actions, ofType } from '@ngrx/effects'; -import { Action } from '@ngrx/store'; - -import { Observable } from 'rxjs/Observable'; -import { of } from 'rxjs/observable/of'; - -import 'rxjs/add/operator/catch'; -import 'rxjs/add/operator/do'; -import 'rxjs/add/operator/exhaustMap'; -import 'rxjs/add/operator/switchMap'; -import 'rxjs/add/operator/map'; -import 'rxjs/add/operator/take'; - -import { RPCClientError } from '@loafer/ng-rpc'; - -import { DomainMember } from '@overflow/commons-typescript/model/domain'; - - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './list.action'; -import { MetaCrawlerInputItemService } from '../../service/crawler-input-item.service'; - -@Injectable() -export class Effects { - - constructor( - private actions$: Actions, - private service: MetaCrawlerInputItemService, - private router: Router - ) { } - - @Effect() - readAll$: Observable = this.actions$ - .ofType(ActionType.ReadAll) - .map((action: ReadAll) => action.payload) - .switchMap(payload => this.service.readAllByMetaCrawler(payload)) - .map(list => { - return new ReadAllSuccess(list); - }) - .catch((error: RPCClientError) => { - return of(new ReadAllFailure(error)); - }); - -} diff --git a/@overflow/meta/crawler-input-item/store/list/list.reducer.ts b/@overflow/meta/crawler-input-item/store/list/list.reducer.ts deleted file mode 100644 index ecb84ec..0000000 --- a/@overflow/meta/crawler-input-item/store/list/list.reducer.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { - Actions, - ActionType, -} from './list.action'; - -import { - State, - initialState, -} from './list.state'; - -export function reducer(state = initialState, action: Actions): State { - switch (action.type) { - case ActionType.ReadAll: { - return { - ...state, - error: null, - pending: true, - }; - } - - case ActionType.ReadAllSuccess: { - return { - ...state, - error: null, - pending: false, - inputs: action.payload - }; - } - - case ActionType.ReadAllFailure: { - return { - ...state, - error: action.payload, - pending: false, - inputs: null, - }; - } - - default: { - return state; - } - } -} diff --git a/@overflow/meta/crawler-input-item/store/list/list.state.ts b/@overflow/meta/crawler-input-item/store/list/list.state.ts deleted file mode 100644 index 6e73474..0000000 --- a/@overflow/meta/crawler-input-item/store/list/list.state.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { RPCClientError } from '@loafer/ng-rpc'; -import { MetaCrawlerInputItem } from '@overflow/commons-typescript/model/meta'; - - -export interface State { - error: RPCClientError | null; - pending: boolean; - inputs: MetaCrawlerInputItem[] | null; -} - -export const initialState: State = { - error: null, - pending: false, - inputs: null, -}; diff --git a/@overflow/meta/crawler/service/index.ts b/@overflow/meta/crawler/service/index.ts deleted file mode 100644 index e4f7b70..0000000 --- a/@overflow/meta/crawler/service/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { MetaCrawlerService } from './crawler.service'; - -export const SERVICES = [ - MetaCrawlerService, -]; diff --git a/@overflow/meta/crawler/store/index.ts b/@overflow/meta/crawler/store/index.ts deleted file mode 100644 index 868ef2f..0000000 --- a/@overflow/meta/crawler/store/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { - createSelector, - createFeatureSelector, - ActionReducerMap, -} from '@ngrx/store'; - -import { StateSelector } from '@overflow/core/ngrx/store'; - -import { MODULE } from '../crawler.constant'; - -import * as ListStore from './list'; - -export interface State { - crawlers: ListStore.State; -} - -export const REDUCERS = { - crawlers: ListStore.reducer, -}; - -export const EFFECTS = [ - ListStore.Effects, -]; - -export const selectCrawlerState = createFeatureSelector(MODULE.name); - -export const ReadAllCrawlerSelector = new StateSelector(createSelector( - selectCrawlerState, - (state: State) => state.crawlers -)); diff --git a/@overflow/meta/crawler/store/list/index.ts b/@overflow/meta/crawler/store/list/index.ts deleted file mode 100644 index 7fd86e0..0000000 --- a/@overflow/meta/crawler/store/list/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './list.action'; -export * from './list.effect'; -export * from './list.reducer'; -export * from './list.state'; diff --git a/@overflow/meta/crawler/store/list/list.effect.spec.ts b/@overflow/meta/crawler/store/list/list.effect.spec.ts deleted file mode 100644 index d8f6227..0000000 --- a/@overflow/meta/crawler/store/list/list.effect.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { TestBed, inject } from '@angular/core/testing'; - -import { Effects } from './list.effect'; - -describe('List.Effects', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [Effects] - }); - }); - - it('should be created', inject([Effects], (effects: Effects) => { - expect(effects).toBeTruthy(); - })); -}); diff --git a/@overflow/meta/crawler/store/list/list.effect.ts b/@overflow/meta/crawler/store/list/list.effect.ts deleted file mode 100644 index 2534c4e..0000000 --- a/@overflow/meta/crawler/store/list/list.effect.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Router } from '@angular/router'; - -import { Effect, Actions, ofType } from '@ngrx/effects'; -import { Action } from '@ngrx/store'; - -import { Observable } from 'rxjs/Observable'; -import { of } from 'rxjs/observable/of'; - -import 'rxjs/add/operator/catch'; -import 'rxjs/add/operator/do'; -import 'rxjs/add/operator/exhaustMap'; -import 'rxjs/add/operator/switchMap'; -import 'rxjs/add/operator/map'; -import 'rxjs/add/operator/take'; - -import { RPCClientError } from '@loafer/ng-rpc'; - -import { DomainMember } from '@overflow/commons-typescript/model/domain'; - - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './list.action'; -import { MetaCrawlerService } from '../../service/crawler.service'; - -@Injectable() -export class Effects { - - constructor( - private actions$: Actions, - private crawlerService: MetaCrawlerService, - private router: Router - ) { } - - @Effect() - readAll$: Observable = this.actions$ - .ofType(ActionType.ReadAll) - .map((action: ReadAll) => action) - .switchMap(payload => this.crawlerService.readAll()) - .map(list => { - return new ReadAllSuccess(list); - }) - .catch((error: RPCClientError) => { - return of(new ReadAllFailure(error)); - }); - -} diff --git a/@overflow/meta/crawler/store/list/list.reducer.ts b/@overflow/meta/crawler/store/list/list.reducer.ts deleted file mode 100644 index 42e1225..0000000 --- a/@overflow/meta/crawler/store/list/list.reducer.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { - Actions, - ActionType, -} from './list.action'; - -import { - State, - initialState, -} from './list.state'; - -export function reducer(state = initialState, action: Actions): State { - switch (action.type) { - case ActionType.ReadAll: { - return { - ...state, - error: null, - pending: true, - }; - } - - case ActionType.ReadAllSuccess: { - return { - ...state, - error: null, - pending: false, - metaCrawlerList: action.payload - }; - } - - case ActionType.ReadAllFailure: { - return { - ...state, - error: action.payload, - pending: false, - metaCrawlerList: null, - }; - } - - default: { - return state; - } - } -} diff --git a/@overflow/meta/crawler/store/list/list.state.ts b/@overflow/meta/crawler/store/list/list.state.ts deleted file mode 100644 index bc9bd75..0000000 --- a/@overflow/meta/crawler/store/list/list.state.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { RPCClientError } from '@loafer/ng-rpc'; -import { MetaCrawler } from '@overflow/commons-typescript/model/meta'; - - -export interface State { - error: RPCClientError | null; - pending: boolean; - metaCrawlerList: MetaCrawler[] | null; -} - -export const initialState: State = { - error: null, - pending: false, - metaCrawlerList: null, -}; diff --git a/@overflow/meta/crawler/crawler-store.module.ts b/@overflow/meta/meta-store.module.ts similarity index 86% rename from @overflow/meta/crawler/crawler-store.module.ts rename to @overflow/meta/meta-store.module.ts index f47c903..fc47af5 100644 --- a/@overflow/meta/crawler/crawler-store.module.ts +++ b/@overflow/meta/meta-store.module.ts @@ -13,7 +13,7 @@ import { EFFECTS, } from './store'; -import { MODULE } from './crawler.constant'; +import { MODULE } from './meta.constant'; @NgModule({ imports: [ @@ -21,4 +21,4 @@ import { MODULE } from './crawler.constant'; EffectsModule.forFeature(EFFECTS), ], }) -export class MetaCrawlerStoreModule { } +export class MetaStoreModule { } diff --git a/@overflow/meta/crawler/crawler.constant.ts b/@overflow/meta/meta.constant.ts similarity index 55% rename from @overflow/meta/crawler/crawler.constant.ts rename to @overflow/meta/meta.constant.ts index 5edb6c9..487eb76 100644 --- a/@overflow/meta/crawler/crawler.constant.ts +++ b/@overflow/meta/meta.constant.ts @@ -1,3 +1,3 @@ export const MODULE = { - name: 'metaCrawler' + name: 'meta' }; diff --git a/@overflow/meta/crawler/crawler.module.ts b/@overflow/meta/meta.module.ts similarity index 69% rename from @overflow/meta/crawler/crawler.module.ts rename to @overflow/meta/meta.module.ts index 39510da..829dc19 100644 --- a/@overflow/meta/crawler/crawler.module.ts +++ b/@overflow/meta/meta.module.ts @@ -4,12 +4,12 @@ import { CommonModule } from '@angular/common'; import { } from './crawler.module'; import { SERVICES } from './service'; -import { MetaCrawlerStoreModule } from './crawler-store.module'; +import { MetaStoreModule } from './meta-store.module'; @NgModule({ imports: [ CommonModule, - MetaCrawlerStoreModule + MetaStoreModule, ], declarations: [ ], @@ -19,4 +19,4 @@ import { MetaCrawlerStoreModule } from './crawler-store.module'; SERVICES, ] }) -export class MetaCrawlerModule { } +export class MetaModule { } diff --git a/@overflow/meta/sensor-display-item/sensor-display-item-store.module.ts b/@overflow/meta/sensor-display-item/sensor-display-item-store.module.ts deleted file mode 100644 index f9ea191..0000000 --- a/@overflow/meta/sensor-display-item/sensor-display-item-store.module.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { NgModule } from '@angular/core'; -import { StoreModule } from '@ngrx/store'; -import { StoreDevtoolsModule } from '@ngrx/store-devtools'; -import { - StoreRouterConnectingModule, - RouterStateSerializer, -} from '@ngrx/router-store'; -import { EffectsModule } from '@ngrx/effects'; -import { combineReducers, ActionReducer, ActionReducerMap, MetaReducer } from '@ngrx/store'; - -import { - REDUCERS, - EFFECTS, -} from './store'; - -import { MODULE } from './sensor-display-item.constant'; - -@NgModule({ - imports: [ - StoreModule.forFeature(MODULE.name, REDUCERS), - EffectsModule.forFeature(EFFECTS), - ], -}) -export class MetaSensorDisplayItemStoreModule { } diff --git a/@overflow/meta/sensor-display-item/sensor-display-item.constant.ts b/@overflow/meta/sensor-display-item/sensor-display-item.constant.ts deleted file mode 100644 index d49d9cb..0000000 --- a/@overflow/meta/sensor-display-item/sensor-display-item.constant.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const MODULE = { - name: 'metaSensorDisplayItem' -}; diff --git a/@overflow/meta/sensor-display-item/sensor-display-item.module.ts b/@overflow/meta/sensor-display-item/sensor-display-item.module.ts deleted file mode 100644 index 5fc6e27..0000000 --- a/@overflow/meta/sensor-display-item/sensor-display-item.module.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { } from './crawler.module'; - -import { SERVICES } from './service'; -import { MetaSensorDisplayItemStoreModule } from './sensor-display-item-store.module'; - -@NgModule({ - imports: [ - CommonModule, - MetaSensorDisplayItemStoreModule - ], - declarations: [ - ], - exports: [ - ], - providers: [ - SERVICES, - ] -}) -export class MetaSensorDisplayItemModule { } diff --git a/@overflow/meta/sensor-display-item/service/index.ts b/@overflow/meta/sensor-display-item/service/index.ts deleted file mode 100644 index db97bf7..0000000 --- a/@overflow/meta/sensor-display-item/service/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { MetaSensorDisplayItemService } from './sensor-display-item.service'; - -export const SERVICES = [ - MetaSensorDisplayItemService, -]; diff --git a/@overflow/meta/sensor-display-item/store/index.ts b/@overflow/meta/sensor-display-item/store/index.ts deleted file mode 100644 index cba42c2..0000000 --- a/@overflow/meta/sensor-display-item/store/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { - createSelector, - createFeatureSelector, - ActionReducerMap, -} from '@ngrx/store'; - -import { StateSelector } from '@overflow/core/ngrx/store'; - - -import * as ListStore from './list'; -import { MODULE } from '../sensor-display-item.constant'; - -export interface State { - list: ListStore.State; -} - -export const REDUCERS = { - list: ListStore.reducer, -}; - -export const EFFECTS = [ - ListStore.Effects, -]; - -export const selectState = createFeatureSelector(MODULE.name); - -export const ReadAllSensorDisplayItemByCrawlerSelector = new StateSelector(createSelector( - selectState, - (state: State) => state.list -)); diff --git a/@overflow/meta/sensor-display-item/store/list/index.ts b/@overflow/meta/sensor-display-item/store/list/index.ts deleted file mode 100644 index 7fd86e0..0000000 --- a/@overflow/meta/sensor-display-item/store/list/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './list.action'; -export * from './list.effect'; -export * from './list.reducer'; -export * from './list.state'; diff --git a/@overflow/meta/sensor-display-item/store/list/list.effect.spec.ts b/@overflow/meta/sensor-display-item/store/list/list.effect.spec.ts deleted file mode 100644 index d8f6227..0000000 --- a/@overflow/meta/sensor-display-item/store/list/list.effect.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { TestBed, inject } from '@angular/core/testing'; - -import { Effects } from './list.effect'; - -describe('List.Effects', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [Effects] - }); - }); - - it('should be created', inject([Effects], (effects: Effects) => { - expect(effects).toBeTruthy(); - })); -}); diff --git a/@overflow/meta/sensor-display-item/store/list/list.effect.ts b/@overflow/meta/sensor-display-item/store/list/list.effect.ts deleted file mode 100644 index 03de2d4..0000000 --- a/@overflow/meta/sensor-display-item/store/list/list.effect.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Router } from '@angular/router'; - -import { Effect, Actions, ofType } from '@ngrx/effects'; -import { Action } from '@ngrx/store'; - -import { Observable } from 'rxjs/Observable'; -import { of } from 'rxjs/observable/of'; - -import 'rxjs/add/operator/catch'; -import 'rxjs/add/operator/do'; -import 'rxjs/add/operator/exhaustMap'; -import 'rxjs/add/operator/switchMap'; -import 'rxjs/add/operator/map'; -import 'rxjs/add/operator/take'; - -import { RPCClientError } from '@loafer/ng-rpc'; - -import { DomainMember } from '@overflow/commons-typescript/model/domain'; - -import { - ReadAllByCrawler, - ReadAllByCrawlerSuccess, - ReadAllByCrawlerFailure, - ActionType, -} from './list.action'; -import { MetaSensorDisplayItem } from '@overflow/commons-typescript/model/meta'; -import { MetaSensorDisplayItemService } from '../../service/sensor-display-item.service'; - -@Injectable() -export class Effects { - - constructor( - private actions$: Actions, - private service: MetaSensorDisplayItemService, - private router: Router - ) { } - - @Effect() - readAllByCrawler$: Observable = this.actions$ - .ofType(ActionType.ReadAllByCrawler) - .map((action: ReadAllByCrawler) => action.payload) - .switchMap(payload => this.service.readAllByMetaCrawler(payload)) - .map(list => { - return new ReadAllByCrawlerSuccess(list); - }) - .catch((error: RPCClientError) => { - return of(new ReadAllByCrawlerFailure(error)); - }); - -} diff --git a/@overflow/meta/sensor-display-item/store/list/list.reducer.ts b/@overflow/meta/sensor-display-item/store/list/list.reducer.ts deleted file mode 100644 index 31c0616..0000000 --- a/@overflow/meta/sensor-display-item/store/list/list.reducer.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { - Actions, - ActionType, -} from './list.action'; - -import { - State, - initialState, -} from './list.state'; - -export function reducer(state = initialState, action: Actions): State { - switch (action.type) { - case ActionType.ReadAllByCrawler: { - return { - ...state, - error: null, - pending: true, - }; - } - - case ActionType.ReadAllByCrawlerSuccess: { - return { - ...state, - error: null, - pending: false, - list: action.payload - }; - } - - case ActionType.ReadAllByCrawlerFailure: { - return { - ...state, - error: action.payload, - pending: false, - list: null, - }; - } - - default: { - return state; - } - } -} diff --git a/@overflow/meta/sensor-display-item/store/list/list.state.ts b/@overflow/meta/sensor-display-item/store/list/list.state.ts deleted file mode 100644 index 031ae91..0000000 --- a/@overflow/meta/sensor-display-item/store/list/list.state.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { RPCClientError } from '@loafer/ng-rpc'; -import { MetaSensorDisplayItem } from '@overflow/commons-typescript/model/meta'; - - -export interface State { - error: RPCClientError | null; - pending: boolean; - list: MetaSensorDisplayItem[] | null; -} - -export const initialState: State = { - error: null, - pending: false, - list: null, -}; diff --git a/@overflow/meta/service/index.ts b/@overflow/meta/service/index.ts new file mode 100644 index 0000000..76f95b2 --- /dev/null +++ b/@overflow/meta/service/index.ts @@ -0,0 +1,51 @@ +import { MetaCrawlerService } from './meta-crawler.service'; +import { MetaCrawlerInputItemService } from './meta-crawler-input-item.service'; +import { MetaHistoryTypeService } from './meta-history-type.service'; +import { MetaInfraTypeService } from './meta-infra-type.service'; +import { MetaInfraVendorService } from './meta-infra-vendor.service'; +import { MetaInputTypeService } from './meta-input-type.service'; +import { MetaMemberStatusService } from './meta-member-status.service'; +import { MetaNoAuthProbeStatusService } from './meta-noauth-probe-status.service'; +import { MetaNotificationService } from './meta-notification.service'; +import { MetaProbeArchitectureService } from './meta-probe-architecture.service'; +import { MetaProbeOsService } from './meta-probe-os.service'; +import { MetaProbePackageService } from './meta-probe-package.service'; +import { MetaProbeStatusService } from './meta-probe-status.service'; +import { MetaProbeTaskTypeService } from './meta-probe-task-type.service'; +import { MetaProbeVersionService } from './meta-probe-version.service'; +import { MetaSensorDisplayItemService } from './meta-sensor-display-item.service'; +import { MetaSensorDisplayMappingService } from './meta-sensor-display-mapping.service'; +import { MetaSensorItemService } from './meta-sensor-item.service'; +import { MetaSensorItemKeyService } from './meta-sensor-item-key.service'; +import { MetaSensorItemTypeService } from './meta-sensor-item-type.service'; +import { MetaSensorItemUnitService } from './meta-sensor-item-unit.service'; +import { MetaSensorStatusService } from './meta-sensor-status.service'; +import { MetaVendorCrawlerService } from './meta-vendor-crawler.service'; +import { MetaVendorCrawlerSensorItemService } from './meta-vendor-crawler-sensor-item.service'; + +export const SERVICES = [ + MetaCrawlerService, + MetaCrawlerInputItemService, + MetaHistoryTypeService, + MetaInfraTypeService, + MetaInfraVendorService, + MetaInputTypeService, + MetaMemberStatusService, + MetaNoAuthProbeStatusService, + MetaNotificationService, + MetaProbeArchitectureService, + MetaProbeOsService, + MetaProbePackageService, + MetaProbeStatusService, + MetaProbeTaskTypeService, + MetaProbeVersionService, + MetaSensorDisplayItemService, + MetaSensorDisplayMappingService, + MetaSensorItemService, + MetaSensorItemKeyService, + MetaSensorItemTypeService, + MetaSensorItemUnitService, + MetaSensorStatusService, + MetaVendorCrawlerService, + MetaVendorCrawlerSensorItemService, +]; diff --git a/@overflow/meta/crawler-input-item/service/crawler-input-item.service.ts b/@overflow/meta/service/meta-crawler-input-item.service.ts similarity index 94% rename from @overflow/meta/crawler-input-item/service/crawler-input-item.service.ts rename to @overflow/meta/service/meta-crawler-input-item.service.ts index 4f76096..cbc0872 100644 --- a/@overflow/meta/crawler-input-item/service/crawler-input-item.service.ts +++ b/@overflow/meta/service/meta-crawler-input-item.service.ts @@ -1,8 +1,5 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/Observable'; - -import 'rxjs/add/operator/map'; - import { RPCService } from '@loafer/ng-rpc'; import { MetaCrawlerInputItem } from '@overflow/commons-typescript/model/meta'; import { MetaCrawler } from '@overflow/commons-typescript/model/meta'; diff --git a/@overflow/meta/crawler/service/crawler.service.ts b/@overflow/meta/service/meta-crawler.service.ts similarity index 92% rename from @overflow/meta/crawler/service/crawler.service.ts rename to @overflow/meta/service/meta-crawler.service.ts index 72a6550..bf3d0bd 100644 --- a/@overflow/meta/crawler/service/crawler.service.ts +++ b/@overflow/meta/service/meta-crawler.service.ts @@ -1,10 +1,6 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/Observable'; - -import 'rxjs/add/operator/map'; - import { RPCService } from '@loafer/ng-rpc'; - import { MetaCrawler } from '@overflow/commons-typescript/model/meta'; @Injectable() diff --git a/@overflow/meta/service/meta-history-type.service.ts b/@overflow/meta/service/meta-history-type.service.ts new file mode 100644 index 0000000..63ae8c9 --- /dev/null +++ b/@overflow/meta/service/meta-history-type.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaHistoryType } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaHistoryTypeService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaHistoryTypeService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-infra-type.service.ts b/@overflow/meta/service/meta-infra-type.service.ts new file mode 100644 index 0000000..2ae1809 --- /dev/null +++ b/@overflow/meta/service/meta-infra-type.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaInfraType } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaInfraTypeService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaInfraTypeService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-infra-vendor.service.ts b/@overflow/meta/service/meta-infra-vendor.service.ts new file mode 100644 index 0000000..c92b60b --- /dev/null +++ b/@overflow/meta/service/meta-infra-vendor.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaInfraType, MetaInfraVendor } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaInfraVendorService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAllByMetaInfraType(infraType: MetaInfraType): Observable { + return this.rpcService.call('MetaInfraVendorService.readAllByMetaInfraType', infraType); + } +} diff --git a/@overflow/meta/service/meta-input-type.service.ts b/@overflow/meta/service/meta-input-type.service.ts new file mode 100644 index 0000000..10b5ca8 --- /dev/null +++ b/@overflow/meta/service/meta-input-type.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaInputType } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaInputTypeService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaInputTypeService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-member-status.service.ts b/@overflow/meta/service/meta-member-status.service.ts new file mode 100644 index 0000000..30c6a15 --- /dev/null +++ b/@overflow/meta/service/meta-member-status.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaMemberStatus } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaMemberStatusService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaMemberStatusService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-noauth-probe-status.service.ts b/@overflow/meta/service/meta-noauth-probe-status.service.ts new file mode 100644 index 0000000..d6caf67 --- /dev/null +++ b/@overflow/meta/service/meta-noauth-probe-status.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaNoAuthProbeStatus } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaNoAuthProbeStatusService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaNoAuthProbeStatusService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-notification.service.ts b/@overflow/meta/service/meta-notification.service.ts new file mode 100644 index 0000000..4fba504 --- /dev/null +++ b/@overflow/meta/service/meta-notification.service.ts @@ -0,0 +1,14 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaCrawler, MetaNotification } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaNotificationService { + + public constructor( + private rpcService: RPCService, + ) { + + } +} diff --git a/@overflow/meta/service/meta-probe-architecture.service.ts b/@overflow/meta/service/meta-probe-architecture.service.ts new file mode 100644 index 0000000..4d43e16 --- /dev/null +++ b/@overflow/meta/service/meta-probe-architecture.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaProbeArchitecture } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaProbeArchitectureService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaProbeArchitectureService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-probe-os.service.ts b/@overflow/meta/service/meta-probe-os.service.ts new file mode 100644 index 0000000..0f30608 --- /dev/null +++ b/@overflow/meta/service/meta-probe-os.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaProbeOs } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaProbeOsService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaProbeOsService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-probe-package.service.ts b/@overflow/meta/service/meta-probe-package.service.ts new file mode 100644 index 0000000..24a96a0 --- /dev/null +++ b/@overflow/meta/service/meta-probe-package.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaProbeOs, MetaProbePackage } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaProbePackageService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAllByOs(metaProbeOs: MetaProbeOs): Observable { + return this.rpcService.call('MetaProbePackageService.readAllByOs', metaProbeOs); + } +} diff --git a/@overflow/meta/service/meta-probe-status.service.ts b/@overflow/meta/service/meta-probe-status.service.ts new file mode 100644 index 0000000..0057464 --- /dev/null +++ b/@overflow/meta/service/meta-probe-status.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaProbeStatus } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaProbeStatusService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaProbeStatusService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-probe-task-type.service.ts b/@overflow/meta/service/meta-probe-task-type.service.ts new file mode 100644 index 0000000..64233a0 --- /dev/null +++ b/@overflow/meta/service/meta-probe-task-type.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaProbeTaskType } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaProbeTaskTypeService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaProbeTaskTypeService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-probe-version.service.ts b/@overflow/meta/service/meta-probe-version.service.ts new file mode 100644 index 0000000..b1a639a --- /dev/null +++ b/@overflow/meta/service/meta-probe-version.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaProbeVersion } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaProbeVersionService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaProbeVersionService.readAll'); + } +} diff --git a/@overflow/meta/sensor-display-item/service/sensor-display-item.service.ts b/@overflow/meta/service/meta-sensor-display-item.service.ts similarity index 86% rename from @overflow/meta/sensor-display-item/service/sensor-display-item.service.ts rename to @overflow/meta/service/meta-sensor-display-item.service.ts index 46cac3a..069db45 100644 --- a/@overflow/meta/sensor-display-item/service/sensor-display-item.service.ts +++ b/@overflow/meta/service/meta-sensor-display-item.service.ts @@ -17,7 +17,7 @@ export class MetaSensorDisplayItemService { } - public readAllByMetaCrawler(c: MetaCrawler): Observable { + public readAllByCrawler(c: MetaCrawler): Observable { return this.rpcService.call('MetaSensorDisplayItemService.readAllByCrawler', c); } } diff --git a/@overflow/meta/service/meta-sensor-display-mapping.service.ts b/@overflow/meta/service/meta-sensor-display-mapping.service.ts new file mode 100644 index 0000000..432f3ba --- /dev/null +++ b/@overflow/meta/service/meta-sensor-display-mapping.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaSensorDisplayItem, MetaSensorItemKey } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaSensorDisplayMappingService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAllMetaSensorItemKeyByDisplayItem(displayItem: MetaSensorDisplayItem): Observable { + return this.rpcService.call('MetaSensorDisplayMappingService.readAllMetaSensorItemKeyByDisplayItem', displayItem); + } +} diff --git a/@overflow/meta/service/meta-sensor-item-key.service.ts b/@overflow/meta/service/meta-sensor-item-key.service.ts new file mode 100644 index 0000000..47c9047 --- /dev/null +++ b/@overflow/meta/service/meta-sensor-item-key.service.ts @@ -0,0 +1,21 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaCrawler, MetaSensorItemKey } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaSensorItemKeyService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAllByCrawler(metaCrawler: MetaCrawler): Observable { + return this.rpcService.call('MetaSensorItemKeyService.readAllByCrawler', metaCrawler); + } + public readAllMapByCrawler(metaCrawler: MetaCrawler): Observable> { + return this.rpcService.call('MetaSensorItemKeyService.readAllMapByCrawler', metaCrawler); + } +} diff --git a/@overflow/meta/service/meta-sensor-item-type.service.ts b/@overflow/meta/service/meta-sensor-item-type.service.ts new file mode 100644 index 0000000..c2226c9 --- /dev/null +++ b/@overflow/meta/service/meta-sensor-item-type.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaSensorItemType } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaSensorItemTypeService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaSensorItemTypeService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-sensor-item-unit.service.ts b/@overflow/meta/service/meta-sensor-item-unit.service.ts new file mode 100644 index 0000000..aa4b521 --- /dev/null +++ b/@overflow/meta/service/meta-sensor-item-unit.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaCrawler, MetaSensorItemUnit } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaSensorItemUnitService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaSensorItemUnitService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-sensor-item.service.ts b/@overflow/meta/service/meta-sensor-item.service.ts new file mode 100644 index 0000000..e07fe19 --- /dev/null +++ b/@overflow/meta/service/meta-sensor-item.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaSensorItem } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaSensorItemService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaSensorItemService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-sensor-status.service.ts b/@overflow/meta/service/meta-sensor-status.service.ts new file mode 100644 index 0000000..cb7479e --- /dev/null +++ b/@overflow/meta/service/meta-sensor-status.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaSensorStatus } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaSensorStatusService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaSensorStatusService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-vendor-crawler-sensor-item.service.ts b/@overflow/meta/service/meta-vendor-crawler-sensor-item.service.ts new file mode 100644 index 0000000..9ed1b9b --- /dev/null +++ b/@overflow/meta/service/meta-vendor-crawler-sensor-item.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaVendorCrawlerSensorItem } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaVendorCrawlerSensorItemService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAll(): Observable { + return this.rpcService.call('MetaVendorCrawlerSensorItemService.readAll'); + } +} diff --git a/@overflow/meta/service/meta-vendor-crawler.service.ts b/@overflow/meta/service/meta-vendor-crawler.service.ts new file mode 100644 index 0000000..0a14d3f --- /dev/null +++ b/@overflow/meta/service/meta-vendor-crawler.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { RPCService } from '@loafer/ng-rpc'; +import { MetaInfraVendor, MetaVendorCrawler } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class MetaVendorCrawlerService { + + public constructor( + private rpcService: RPCService, + ) { + + } + + public readAllByInfraVendor(infraVendor: MetaInfraVendor): Observable { + return this.rpcService.call('MetaVendorCrawlerService.readAllByInfraVendor', infraVendor); + } +} diff --git a/@overflow/meta/store/entity/meta-crawler-input-item/index.ts b/@overflow/meta/store/entity/meta-crawler-input-item/index.ts new file mode 100644 index 0000000..4a60349 --- /dev/null +++ b/@overflow/meta/store/entity/meta-crawler-input-item/index.ts @@ -0,0 +1,4 @@ +export * from './meta-crawler-input-item.action'; +export * from './meta-crawler-input-item.effect'; +export * from './meta-crawler-input-item.reducer'; +export * from './meta-crawler-input-item.state'; diff --git a/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.action.ts b/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.action.ts new file mode 100644 index 0000000..89f9044 --- /dev/null +++ b/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.action.ts @@ -0,0 +1,34 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaCrawler, MetaCrawlerInputItem } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAllByMetaCrawler = '[meta.meta-crawler-input-item] ReadAllByMetaCrawler', + ReadAllByMetaCrawlerSuccess = '[meta.meta-crawler-input-item] ReadAllByMetaCrawlerSuccess', + ReadAllByMetaCrawlerFailure = '[meta.meta-crawler-input-item] ReadAllByMetaCrawlerFailure', +} + +export class ReadAllByMetaCrawler implements Action { + readonly type = ActionType.ReadAllByMetaCrawler; + constructor(public payload: MetaCrawler) {} +} + +export class ReadAllByMetaCrawlerSuccess implements Action { + readonly type = ActionType.ReadAllByMetaCrawlerSuccess; + + constructor(public payload: MetaCrawlerInputItem[]) {} +} + +export class ReadAllByMetaCrawlerFailure implements Action { + readonly type = ActionType.ReadAllByMetaCrawlerFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAllByMetaCrawler + | ReadAllByMetaCrawlerSuccess + | ReadAllByMetaCrawlerFailure +; diff --git a/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.effect.ts b/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.effect.ts new file mode 100644 index 0000000..575a190 --- /dev/null +++ b/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.effect.ts @@ -0,0 +1,39 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaCrawlerInputItemService } from '../../../service/meta-crawler-input-item.service'; + +import { + ReadAllByMetaCrawler, + ReadAllByMetaCrawlerSuccess, + ReadAllByMetaCrawlerFailure, + ActionType, +} from './meta-crawler-input-item.action'; +import { MetaCrawler, MetaCrawlerInputItem } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaCrawlerInputItemService: MetaCrawlerInputItemService, + ) { } + + @Effect() + readAllByMetaCrawler$ = this.actions$.pipe( + ofType(ActionType.ReadAllByMetaCrawler), + map((action: ReadAllByMetaCrawler) => action.payload), + exhaustMap((metaCrawler: MetaCrawler) => + this.metaCrawlerInputItemService + .readAllByMetaCrawler(metaCrawler) + .pipe( + map((result: MetaCrawlerInputItem[]) => { + return new ReadAllByMetaCrawlerSuccess(result); + }), + catchError(error => of(new ReadAllByMetaCrawlerFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.reducer.ts b/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.reducer.ts new file mode 100644 index 0000000..67e58e6 --- /dev/null +++ b/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.reducer.ts @@ -0,0 +1,15 @@ +import { ActionType, Actions } from './meta-crawler-input-item.action'; +import { + State, + initialState, + metaCrawlerInputItemEntityAdapter, +} from './meta-crawler-input-item.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.state.ts b/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.state.ts new file mode 100644 index 0000000..5e7c8fb --- /dev/null +++ b/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaCrawler, MetaCrawlerInputItem } from '@overflow/commons-typescript/model/meta'; + +export const metaCrawlerInputItemEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaCrawlerInputItemEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaCrawlerInputItemEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-crawler/index.ts b/@overflow/meta/store/entity/meta-crawler/index.ts new file mode 100644 index 0000000..9790c46 --- /dev/null +++ b/@overflow/meta/store/entity/meta-crawler/index.ts @@ -0,0 +1,4 @@ +export * from './meta-crawler.action'; +export * from './meta-crawler.effect'; +export * from './meta-crawler.reducer'; +export * from './meta-crawler.state'; diff --git a/@overflow/meta/crawler/store/list/list.action.ts b/@overflow/meta/store/entity/meta-crawler/meta-crawler.action.ts similarity index 73% rename from @overflow/meta/crawler/store/list/list.action.ts rename to @overflow/meta/store/entity/meta-crawler/meta-crawler.action.ts index 8ff4a17..c3827e4 100644 --- a/@overflow/meta/crawler/store/list/list.action.ts +++ b/@overflow/meta/store/entity/meta-crawler/meta-crawler.action.ts @@ -1,19 +1,17 @@ import { Action } from '@ngrx/store'; import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; import { MetaCrawler } from '@overflow/commons-typescript/model/meta'; - export enum ActionType { - ReadAll = '[meta.crawler-readall] ReadAll', - ReadAllSuccess = '[meta.crawler-readall] ReadAllSuccess', - ReadAllFailure = '[meta.crawler-readall] ReadAllFailure', + ReadAll = '[meta.meta-crawler] ReadAll', + ReadAllSuccess = '[meta.meta-crawler] ReadAllSuccess', + ReadAllFailure = '[meta.meta-crawler] ReadAllFailure', } export class ReadAll implements Action { readonly type = ActionType.ReadAll; - - constructor() {} } export class ReadAllSuccess implements Action { @@ -32,5 +30,4 @@ export type Actions = | ReadAll | ReadAllSuccess | ReadAllFailure - ; diff --git a/@overflow/meta/store/entity/meta-crawler/meta-crawler.effect.ts b/@overflow/meta/store/entity/meta-crawler/meta-crawler.effect.ts new file mode 100644 index 0000000..3378f1c --- /dev/null +++ b/@overflow/meta/store/entity/meta-crawler/meta-crawler.effect.ts @@ -0,0 +1,51 @@ +import { Injectable } from '@angular/core'; +import { Store } from '@ngrx/store'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of, Observable } from 'rxjs'; +import { catchError, exhaustMap, map, tap, withLatestFrom } from 'rxjs/operators'; + +import { MetaCrawler } from '@overflow/commons-typescript/model/meta'; + +import { MetaCrawlerService } from '../../../service/meta-crawler.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-crawler.action'; + +import { + MetaCrawlerEntitySelector, +} from '../../'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private store$: Store, + private metaCrawlerService: MetaCrawlerService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + withLatestFrom(this.store$.select(MetaCrawlerEntitySelector.selectAll)), + exhaustMap(([action, results]) => { + if (0 < results.length) { + return of(new ReadAllSuccess(results)); + } + + return this.metaCrawlerService + .readAll() + .pipe( + map((result: MetaCrawler[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ); + } + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-crawler/meta-crawler.reducer.ts b/@overflow/meta/store/entity/meta-crawler/meta-crawler.reducer.ts new file mode 100644 index 0000000..355eacd --- /dev/null +++ b/@overflow/meta/store/entity/meta-crawler/meta-crawler.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-crawler.action'; +import { + State, + initialState, + metaCrawlerEntityAdapter, +} from './meta-crawler.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaCrawlerEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaCrawlerEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-crawler/meta-crawler.state.ts b/@overflow/meta/store/entity/meta-crawler/meta-crawler.state.ts new file mode 100644 index 0000000..e04b78e --- /dev/null +++ b/@overflow/meta/store/entity/meta-crawler/meta-crawler.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaCrawler } from '@overflow/commons-typescript/model/meta'; + +export const metaCrawlerEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaCrawlerEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaCrawlerEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-history-type/index.ts b/@overflow/meta/store/entity/meta-history-type/index.ts new file mode 100644 index 0000000..3c85ad6 --- /dev/null +++ b/@overflow/meta/store/entity/meta-history-type/index.ts @@ -0,0 +1,4 @@ +export * from './meta-history-type.action'; +export * from './meta-history-type.effect'; +export * from './meta-history-type.reducer'; +export * from './meta-history-type.state'; diff --git a/@overflow/meta/store/entity/meta-history-type/meta-history-type.action.ts b/@overflow/meta/store/entity/meta-history-type/meta-history-type.action.ts new file mode 100644 index 0000000..56a53e7 --- /dev/null +++ b/@overflow/meta/store/entity/meta-history-type/meta-history-type.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaHistoryType } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-history-type] ReadAll', + ReadAllSuccess = '[meta.meta-history-type] ReadAllSuccess', + ReadAllFailure = '[meta.meta-history-type] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaHistoryType[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-history-type/meta-history-type.effect.ts b/@overflow/meta/store/entity/meta-history-type/meta-history-type.effect.ts new file mode 100644 index 0000000..89c7589 --- /dev/null +++ b/@overflow/meta/store/entity/meta-history-type/meta-history-type.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaHistoryTypeService } from '../../../service/meta-history-type.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-history-type.action'; +import { MetaHistoryType } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaHistoryTypeService: MetaHistoryTypeService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaHistoryTypeService + .readAll() + .pipe( + map((result: MetaHistoryType[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-history-type/meta-history-type.reducer.ts b/@overflow/meta/store/entity/meta-history-type/meta-history-type.reducer.ts new file mode 100644 index 0000000..6fec85e --- /dev/null +++ b/@overflow/meta/store/entity/meta-history-type/meta-history-type.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-history-type.action'; +import { + State, + initialState, + metaHistoryTypeEntityAdapter, +} from './meta-history-type.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaHistoryTypeEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaHistoryTypeEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-history-type/meta-history-type.state.ts b/@overflow/meta/store/entity/meta-history-type/meta-history-type.state.ts new file mode 100644 index 0000000..084d12f --- /dev/null +++ b/@overflow/meta/store/entity/meta-history-type/meta-history-type.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaHistoryType } from '@overflow/commons-typescript/model/meta'; + +export const metaHistoryTypeEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaHistoryTypeEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaHistoryTypeEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-infra-type/index.ts b/@overflow/meta/store/entity/meta-infra-type/index.ts new file mode 100644 index 0000000..39a836e --- /dev/null +++ b/@overflow/meta/store/entity/meta-infra-type/index.ts @@ -0,0 +1,4 @@ +export * from './meta-infra-type.action'; +export * from './meta-infra-type.effect'; +export * from './meta-infra-type.reducer'; +export * from './meta-infra-type.state'; diff --git a/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.action.ts b/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.action.ts new file mode 100644 index 0000000..92cba2d --- /dev/null +++ b/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaInfraType } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-infra-type] ReadAll', + ReadAllSuccess = '[meta.meta-infra-type] ReadAllSuccess', + ReadAllFailure = '[meta.meta-infra-type] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaInfraType[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.effect.ts b/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.effect.ts new file mode 100644 index 0000000..0a9ed99 --- /dev/null +++ b/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaInfraTypeService } from '../../../service/meta-infra-type.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-infra-type.action'; +import { MetaInfraType } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaInfraTypeService: MetaInfraTypeService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaInfraTypeService + .readAll() + .pipe( + map((result: MetaInfraType[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.reducer.ts b/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.reducer.ts new file mode 100644 index 0000000..a67d6ff --- /dev/null +++ b/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-infra-type.action'; +import { + State, + initialState, + metaInfraTypeEntityAdapter, +} from './meta-infra-type.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaInfraTypeEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaInfraTypeEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.state.ts b/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.state.ts new file mode 100644 index 0000000..01a9fb1 --- /dev/null +++ b/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaInfraType } from '@overflow/commons-typescript/model/meta'; + +export const metaInfraTypeEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaInfraTypeEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaInfraTypeEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-infra-vendor/index.ts b/@overflow/meta/store/entity/meta-infra-vendor/index.ts new file mode 100644 index 0000000..5d91614 --- /dev/null +++ b/@overflow/meta/store/entity/meta-infra-vendor/index.ts @@ -0,0 +1,4 @@ +export * from './meta-infra-vendor.action'; +export * from './meta-infra-vendor.effect'; +export * from './meta-infra-vendor.reducer'; +export * from './meta-infra-vendor.state'; diff --git a/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.action.ts b/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.action.ts new file mode 100644 index 0000000..09dc14e --- /dev/null +++ b/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.action.ts @@ -0,0 +1,35 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaInfraVendor, MetaInfraType } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAllByMetaInfraType = '[meta.meta-infra-vendor] ReadAllByMetaInfraType', + ReadAllByMetaInfraTypeSuccess = '[meta.meta-infra-vendor] ReadAllByMetaInfraTypeSuccess', + ReadAllByMetaInfraTypeFailure = '[meta.meta-infra-vendor] ReadAllByMetaInfraTypeFailure', +} + +export class ReadAllByMetaInfraType implements Action { + readonly type = ActionType.ReadAllByMetaInfraType; + + constructor(public payload: MetaInfraType) {} +} + +export class ReadAllByMetaInfraTypeSuccess implements Action { + readonly type = ActionType.ReadAllByMetaInfraTypeSuccess; + + constructor(public payload: MetaInfraVendor[]) {} +} + +export class ReadAllByMetaInfraTypeFailure implements Action { + readonly type = ActionType.ReadAllByMetaInfraTypeFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAllByMetaInfraType + | ReadAllByMetaInfraTypeSuccess + | ReadAllByMetaInfraTypeFailure +; diff --git a/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.effect.ts b/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.effect.ts new file mode 100644 index 0000000..1f646de --- /dev/null +++ b/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.effect.ts @@ -0,0 +1,39 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaInfraVendorService } from '../../../service/meta-infra-vendor.service'; + +import { + ReadAllByMetaInfraType, + ReadAllByMetaInfraTypeSuccess, + ReadAllByMetaInfraTypeFailure, + ActionType, +} from './meta-infra-vendor.action'; +import { MetaInfraVendor, MetaInfraType } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaInfraVendorService: MetaInfraVendorService, + ) { } + + @Effect() + readAllByMetaInfraType$ = this.actions$.pipe( + ofType(ActionType.ReadAllByMetaInfraType), + map((action: ReadAllByMetaInfraType) => action.payload), + exhaustMap((metaInfraType: MetaInfraType) => + this.metaInfraVendorService + .readAllByMetaInfraType(metaInfraType) + .pipe( + map((result: MetaInfraVendor[]) => { + return new ReadAllByMetaInfraTypeSuccess(result); + }), + catchError(error => of(new ReadAllByMetaInfraTypeFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.reducer.ts b/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.reducer.ts new file mode 100644 index 0000000..ac54da2 --- /dev/null +++ b/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.reducer.ts @@ -0,0 +1,15 @@ +import { ActionType, Actions } from './meta-infra-vendor.action'; +import { + State, + initialState, + metaCrawlerEntityAdapter, +} from './meta-infra-vendor.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.state.ts b/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.state.ts new file mode 100644 index 0000000..a77d729 --- /dev/null +++ b/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaInfraVendor } from '@overflow/commons-typescript/model/meta'; + +export const metaCrawlerEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaCrawlerEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaCrawlerEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-input-type/index.ts b/@overflow/meta/store/entity/meta-input-type/index.ts new file mode 100644 index 0000000..7bf0e60 --- /dev/null +++ b/@overflow/meta/store/entity/meta-input-type/index.ts @@ -0,0 +1,4 @@ +export * from './meta-input-type.action'; +export * from './meta-input-type.effect'; +export * from './meta-input-type.reducer'; +export * from './meta-input-type.state'; diff --git a/@overflow/meta/store/entity/meta-input-type/meta-input-type.action.ts b/@overflow/meta/store/entity/meta-input-type/meta-input-type.action.ts new file mode 100644 index 0000000..90e4e5c --- /dev/null +++ b/@overflow/meta/store/entity/meta-input-type/meta-input-type.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaInputType } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-input-type] ReadAll', + ReadAllSuccess = '[meta.meta-input-type] ReadAllSuccess', + ReadAllFailure = '[meta.meta-input-type] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaInputType[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-input-type/meta-input-type.effect.ts b/@overflow/meta/store/entity/meta-input-type/meta-input-type.effect.ts new file mode 100644 index 0000000..7ed6364 --- /dev/null +++ b/@overflow/meta/store/entity/meta-input-type/meta-input-type.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaInputTypeService } from '../../../service/meta-input-type.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-input-type.action'; +import { MetaInputType } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaInputTypeService: MetaInputTypeService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaInputTypeService + .readAll() + .pipe( + map((result: MetaInputType[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-input-type/meta-input-type.reducer.ts b/@overflow/meta/store/entity/meta-input-type/meta-input-type.reducer.ts new file mode 100644 index 0000000..60e3629 --- /dev/null +++ b/@overflow/meta/store/entity/meta-input-type/meta-input-type.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-input-type.action'; +import { + State, + initialState, + metaInputTypeEntityAdapter, +} from './meta-input-type.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaInputTypeEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaInputTypeEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-input-type/meta-input-type.state.ts b/@overflow/meta/store/entity/meta-input-type/meta-input-type.state.ts new file mode 100644 index 0000000..7b663d7 --- /dev/null +++ b/@overflow/meta/store/entity/meta-input-type/meta-input-type.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaInputType } from '@overflow/commons-typescript/model/meta'; + +export const metaInputTypeEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaInputTypeEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaInputTypeEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-member-status/index.ts b/@overflow/meta/store/entity/meta-member-status/index.ts new file mode 100644 index 0000000..1b056a7 --- /dev/null +++ b/@overflow/meta/store/entity/meta-member-status/index.ts @@ -0,0 +1,4 @@ +export * from './meta-member-status.action'; +export * from './meta-member-status.effect'; +export * from './meta-member-status.reducer'; +export * from './meta-member-status.state'; diff --git a/@overflow/meta/store/entity/meta-member-status/meta-member-status.action.ts b/@overflow/meta/store/entity/meta-member-status/meta-member-status.action.ts new file mode 100644 index 0000000..72746bd --- /dev/null +++ b/@overflow/meta/store/entity/meta-member-status/meta-member-status.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaMemberStatus } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-member-status] ReadAll', + ReadAllSuccess = '[meta.meta-member-status] ReadAllSuccess', + ReadAllFailure = '[meta.meta-member-status] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaMemberStatus[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-member-status/meta-member-status.effect.ts b/@overflow/meta/store/entity/meta-member-status/meta-member-status.effect.ts new file mode 100644 index 0000000..698e5fa --- /dev/null +++ b/@overflow/meta/store/entity/meta-member-status/meta-member-status.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaMemberStatusService } from '../../../service/meta-member-status.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-member-status.action'; +import { MetaMemberStatus } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaMemberStatusService: MetaMemberStatusService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaMemberStatusService + .readAll() + .pipe( + map((result: MetaMemberStatus[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-member-status/meta-member-status.reducer.ts b/@overflow/meta/store/entity/meta-member-status/meta-member-status.reducer.ts new file mode 100644 index 0000000..36c833a --- /dev/null +++ b/@overflow/meta/store/entity/meta-member-status/meta-member-status.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-member-status.action'; +import { + State, + initialState, + metaMemberStatusEntityAdapter, +} from './meta-member-status.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaMemberStatusEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaMemberStatusEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-member-status/meta-member-status.state.ts b/@overflow/meta/store/entity/meta-member-status/meta-member-status.state.ts new file mode 100644 index 0000000..2c0b755 --- /dev/null +++ b/@overflow/meta/store/entity/meta-member-status/meta-member-status.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaMemberStatus } from '@overflow/commons-typescript/model/meta'; + +export const metaMemberStatusEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaMemberStatusEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaMemberStatusEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-noauth-probe-status/index.ts b/@overflow/meta/store/entity/meta-noauth-probe-status/index.ts new file mode 100644 index 0000000..db6c511 --- /dev/null +++ b/@overflow/meta/store/entity/meta-noauth-probe-status/index.ts @@ -0,0 +1,4 @@ +export * from './meta-noauth-probe-status.action'; +export * from './meta-noauth-probe-status.effect'; +export * from './meta-noauth-probe-status.reducer'; +export * from './meta-noauth-probe-status.state'; diff --git a/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.action.ts b/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.action.ts new file mode 100644 index 0000000..88ab8cc --- /dev/null +++ b/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaNoAuthProbeStatus } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-noauth-probe-status] ReadAll', + ReadAllSuccess = '[meta.meta-noauth-probe-status] ReadAllSuccess', + ReadAllFailure = '[meta.meta-noauth-probe-status] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaNoAuthProbeStatus[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.effect.ts b/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.effect.ts new file mode 100644 index 0000000..0e7c115 --- /dev/null +++ b/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaNoAuthProbeStatusService } from '../../../service/meta-noauth-probe-status.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-noauth-probe-status.action'; +import { MetaNoAuthProbeStatus } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaNoAuthProbeStatusService: MetaNoAuthProbeStatusService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaNoAuthProbeStatusService + .readAll() + .pipe( + map((result: MetaNoAuthProbeStatus[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.reducer.ts b/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.reducer.ts new file mode 100644 index 0000000..9b1cf07 --- /dev/null +++ b/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-noauth-probe-status.action'; +import { + State, + initialState, + metaNoAuthProbeStatusEntityAdapter, +} from './meta-noauth-probe-status.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaNoAuthProbeStatusEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaNoAuthProbeStatusEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.state.ts b/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.state.ts new file mode 100644 index 0000000..8653eb0 --- /dev/null +++ b/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaNoAuthProbeStatus } from '@overflow/commons-typescript/model/meta'; + +export const metaNoAuthProbeStatusEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaNoAuthProbeStatusEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaNoAuthProbeStatusEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-probe-architecture/index.ts b/@overflow/meta/store/entity/meta-probe-architecture/index.ts new file mode 100644 index 0000000..9fabcd4 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-architecture/index.ts @@ -0,0 +1,4 @@ +export * from './meta-probe-architecture.action'; +export * from './meta-probe-architecture.effect'; +export * from './meta-probe-architecture.reducer'; +export * from './meta-probe-architecture.state'; diff --git a/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.action.ts b/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.action.ts new file mode 100644 index 0000000..9367f6e --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaProbeArchitecture } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-probe-architecture] ReadAll', + ReadAllSuccess = '[meta.meta-probe-architecture] ReadAllSuccess', + ReadAllFailure = '[meta.meta-probe-architecture] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaProbeArchitecture[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.effect.ts b/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.effect.ts new file mode 100644 index 0000000..36f847f --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaProbeArchitectureService } from '../../../service/meta-probe-architecture.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-probe-architecture.action'; +import { MetaProbeArchitecture } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaProbeArchitectureService: MetaProbeArchitectureService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaProbeArchitectureService + .readAll() + .pipe( + map((result: MetaProbeArchitecture[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.reducer.ts b/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.reducer.ts new file mode 100644 index 0000000..d03b6c3 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-probe-architecture.action'; +import { + State, + initialState, + metaProbeArchitectureEntityAdapter, +} from './meta-probe-architecture.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaProbeArchitectureEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaProbeArchitectureEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.state.ts b/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.state.ts new file mode 100644 index 0000000..f8585a6 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaProbeArchitecture } from '@overflow/commons-typescript/model/meta'; + +export const metaProbeArchitectureEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaProbeArchitectureEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaProbeArchitectureEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-probe-os/index.ts b/@overflow/meta/store/entity/meta-probe-os/index.ts new file mode 100644 index 0000000..b1c45ee --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-os/index.ts @@ -0,0 +1,4 @@ +export * from './meta-probe-os.action'; +export * from './meta-probe-os.effect'; +export * from './meta-probe-os.reducer'; +export * from './meta-probe-os.state'; diff --git a/@overflow/meta/crawler-input-item/store/list/list.action.ts b/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.action.ts similarity index 55% rename from @overflow/meta/crawler-input-item/store/list/list.action.ts rename to @overflow/meta/store/entity/meta-probe-os/meta-probe-os.action.ts index 43b6b6e..1b5f6d0 100644 --- a/@overflow/meta/crawler-input-item/store/list/list.action.ts +++ b/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.action.ts @@ -1,26 +1,23 @@ import { Action } from '@ngrx/store'; import { RPCClientError } from '@loafer/ng-rpc'; -import { MetaCrawler } from '@overflow/commons-typescript/model/meta'; -import { MetaCrawlerInputItem } from '@overflow/commons-typescript/model/meta'; - +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaProbeOs } from '@overflow/commons-typescript/model/meta'; export enum ActionType { - ReadAll = '[meta.crawler-input-list] ReadAll', - ReadAllSuccess = '[meta.crawler-input-list] ReadAllSuccess', - ReadAllFailure = '[meta.crawler-input-list] ReadAllFailure', + ReadAll = '[meta.meta-probe-os] ReadAll', + ReadAllSuccess = '[meta.meta-probe-os] ReadAllSuccess', + ReadAllFailure = '[meta.meta-probe-os] ReadAllFailure', } export class ReadAll implements Action { readonly type = ActionType.ReadAll; - - constructor(public payload: MetaCrawler) {} } export class ReadAllSuccess implements Action { readonly type = ActionType.ReadAllSuccess; - constructor(public payload: MetaCrawlerInputItem[]) {} + constructor(public payload: MetaProbeOs[]) {} } export class ReadAllFailure implements Action { @@ -33,5 +30,4 @@ export type Actions = | ReadAll | ReadAllSuccess | ReadAllFailure - ; diff --git a/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.effect.ts b/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.effect.ts new file mode 100644 index 0000000..aa8103e --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaProbeOsService } from '../../../service/meta-probe-os.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-probe-os.action'; +import { MetaProbeOs } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaProbeOsService: MetaProbeOsService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaProbeOsService + .readAll() + .pipe( + map((result: MetaProbeOs[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.reducer.ts b/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.reducer.ts new file mode 100644 index 0000000..645a839 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-probe-os.action'; +import { + State, + initialState, + metaProbeOsEntityAdapter, +} from './meta-probe-os.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaProbeOsEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaProbeOsEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.state.ts b/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.state.ts new file mode 100644 index 0000000..4114e9f --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaProbeOs } from '@overflow/commons-typescript/model/meta'; + +export const metaProbeOsEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaProbeOsEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaProbeOsEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-probe-package/index.ts b/@overflow/meta/store/entity/meta-probe-package/index.ts new file mode 100644 index 0000000..0cdb09a --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-package/index.ts @@ -0,0 +1,4 @@ +export * from './meta-probe-package.action'; +export * from './meta-probe-package.effect'; +export * from './meta-probe-package.reducer'; +export * from './meta-probe-package.state'; diff --git a/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.action.ts b/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.action.ts new file mode 100644 index 0000000..d3a1e4e --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.action.ts @@ -0,0 +1,34 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaProbePackage, MetaProbeOs } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAllByOs = '[meta.meta-probe-package] ReadAllByOs', + ReadAllByOsSuccess = '[meta.meta-probe-package] ReadAllByOsSuccess', + ReadAllByOsFailure = '[meta.meta-probe-package] ReadAllByOsFailure', +} + +export class ReadAllByOs implements Action { + readonly type = ActionType.ReadAllByOs; + constructor(public payload: MetaProbeOs) {} +} + +export class ReadAllByOsSuccess implements Action { + readonly type = ActionType.ReadAllByOsSuccess; + + constructor(public payload: MetaProbePackage[]) {} +} + +export class ReadAllByOsFailure implements Action { + readonly type = ActionType.ReadAllByOsFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAllByOs + | ReadAllByOsSuccess + | ReadAllByOsFailure +; diff --git a/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.effect.ts b/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.effect.ts new file mode 100644 index 0000000..eeff54f --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.effect.ts @@ -0,0 +1,39 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaProbePackageService } from '../../../service/meta-probe-package.service'; + +import { + ReadAllByOs, + ReadAllByOsSuccess, + ReadAllByOsFailure, + ActionType, +} from './meta-probe-package.action'; +import { MetaProbePackage, MetaProbeOs } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaProbePackageService: MetaProbePackageService, + ) { } + + @Effect() + readAllByOs$ = this.actions$.pipe( + ofType(ActionType.ReadAllByOs), + map((action: ReadAllByOs) => action.payload), + exhaustMap((metaProbeOs: MetaProbeOs) => + this.metaProbePackageService + .readAllByOs(metaProbeOs) + .pipe( + map((result: MetaProbePackage[]) => { + return new ReadAllByOsSuccess(result); + }), + catchError(error => of(new ReadAllByOsFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.reducer.ts b/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.reducer.ts new file mode 100644 index 0000000..b5d1bcd --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.reducer.ts @@ -0,0 +1,15 @@ +import { ActionType, Actions } from './meta-probe-package.action'; +import { + State, + initialState, + metaProbePackageEntityAdapter, +} from './meta-probe-package.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.state.ts b/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.state.ts new file mode 100644 index 0000000..b1163e8 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaProbePackage } from '@overflow/commons-typescript/model/meta'; + +export const metaProbePackageEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaProbePackageEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaProbePackageEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-probe-status/index.ts b/@overflow/meta/store/entity/meta-probe-status/index.ts new file mode 100644 index 0000000..499e062 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-status/index.ts @@ -0,0 +1,4 @@ +export * from './meta-probe-status.action'; +export * from './meta-probe-status.effect'; +export * from './meta-probe-status.reducer'; +export * from './meta-probe-status.state'; diff --git a/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.action.ts b/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.action.ts new file mode 100644 index 0000000..e2c4a66 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaProbeStatus } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-probe-status] ReadAll', + ReadAllSuccess = '[meta.meta-probe-status] ReadAllSuccess', + ReadAllFailure = '[meta.meta-probe-status] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaProbeStatus[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.effect.ts b/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.effect.ts new file mode 100644 index 0000000..4d520ed --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaProbeStatusService } from '../../../service/meta-probe-status.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-probe-status.action'; +import { MetaProbeStatus } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaProbeStatusService: MetaProbeStatusService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaProbeStatusService + .readAll() + .pipe( + map((result: MetaProbeStatus[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.reducer.ts b/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.reducer.ts new file mode 100644 index 0000000..9da3fc3 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-probe-status.action'; +import { + State, + initialState, + metaProbeStatusEntityAdapter, +} from './meta-probe-status.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaProbeStatusEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaProbeStatusEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.state.ts b/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.state.ts new file mode 100644 index 0000000..e9795a4 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaProbeStatus } from '@overflow/commons-typescript/model/meta'; + +export const metaProbeStatusEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaProbeStatusEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaProbeStatusEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-probe-task-type/index.ts b/@overflow/meta/store/entity/meta-probe-task-type/index.ts new file mode 100644 index 0000000..1edceef --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-task-type/index.ts @@ -0,0 +1,4 @@ +export * from './meta-probe-task-type.action'; +export * from './meta-probe-task-type.effect'; +export * from './meta-probe-task-type.reducer'; +export * from './meta-probe-task-type.state'; diff --git a/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.action.ts b/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.action.ts new file mode 100644 index 0000000..3dad7cc --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaProbeTaskType } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-probe-task-type] ReadAll', + ReadAllSuccess = '[meta.meta-probe-task-type] ReadAllSuccess', + ReadAllFailure = '[meta.meta-probe-task-type] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaProbeTaskType[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.effect.ts b/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.effect.ts new file mode 100644 index 0000000..ab0d2ff --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaProbeTaskTypeService } from '../../../service/meta-probe-task-type.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-probe-task-type.action'; +import { MetaProbeTaskType } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaProbeTaskTypeService: MetaProbeTaskTypeService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaProbeTaskTypeService + .readAll() + .pipe( + map((result: MetaProbeTaskType[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.reducer.ts b/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.reducer.ts new file mode 100644 index 0000000..b22f458 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-probe-task-type.action'; +import { + State, + initialState, + metaProbeTaskTypeEntityAdapter, +} from './meta-probe-task-type.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaProbeTaskTypeEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaProbeTaskTypeEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.state.ts b/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.state.ts new file mode 100644 index 0000000..ed0dcf4 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaProbeTaskType } from '@overflow/commons-typescript/model/meta'; + +export const metaProbeTaskTypeEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaProbeTaskTypeEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaProbeTaskTypeEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-probe-version/index.ts b/@overflow/meta/store/entity/meta-probe-version/index.ts new file mode 100644 index 0000000..f48c38d --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-version/index.ts @@ -0,0 +1,4 @@ +export * from './meta-probe-version.action'; +export * from './meta-probe-version.effect'; +export * from './meta-probe-version.reducer'; +export * from './meta-probe-version.state'; diff --git a/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.action.ts b/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.action.ts new file mode 100644 index 0000000..a738bbd --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaProbeVersion } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-probe-version] ReadAll', + ReadAllSuccess = '[meta.meta-probe-version] ReadAllSuccess', + ReadAllFailure = '[meta.meta-probe-version] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaProbeVersion[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.effect.ts b/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.effect.ts new file mode 100644 index 0000000..5024c05 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaProbeVersionService } from '../../../service/meta-probe-version.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-probe-version.action'; +import { MetaProbeVersion } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaProbeVersionService: MetaProbeVersionService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaProbeVersionService + .readAll() + .pipe( + map((result: MetaProbeVersion[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.reducer.ts b/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.reducer.ts new file mode 100644 index 0000000..f989ed3 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-probe-version.action'; +import { + State, + initialState, + metaProbeVersionEntityAdapter, +} from './meta-probe-version.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaProbeVersionEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaProbeVersionEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.state.ts b/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.state.ts new file mode 100644 index 0000000..96360b6 --- /dev/null +++ b/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaProbeVersion } from '@overflow/commons-typescript/model/meta'; + +export const metaProbeVersionEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaProbeVersionEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaProbeVersionEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-sensor-display-item/index.ts b/@overflow/meta/store/entity/meta-sensor-display-item/index.ts new file mode 100644 index 0000000..951ec51 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-display-item/index.ts @@ -0,0 +1,4 @@ +export * from './meta-sensor-display-item.action'; +export * from './meta-sensor-display-item.effect'; +export * from './meta-sensor-display-item.reducer'; +export * from './meta-sensor-display-item.state'; diff --git a/@overflow/meta/sensor-display-item/store/list/list.action.ts b/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.action.ts similarity index 62% rename from @overflow/meta/sensor-display-item/store/list/list.action.ts rename to @overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.action.ts index a23c62b..cbc1399 100644 --- a/@overflow/meta/sensor-display-item/store/list/list.action.ts +++ b/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.action.ts @@ -1,19 +1,17 @@ import { Action } from '@ngrx/store'; import { RPCClientError } from '@loafer/ng-rpc'; -import { MetaCrawler } from '@overflow/commons-typescript/model/meta'; -import { MetaSensorDisplayItem } from '@overflow/commons-typescript/model/meta'; - +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaSensorDisplayItem, MetaCrawler } from '@overflow/commons-typescript/model/meta'; export enum ActionType { - ReadAllByCrawler = '[meta.sensor-display-item] ReadAllByCrawler', - ReadAllByCrawlerSuccess = '[meta.sensor-display-item] ReadAllByCrawlerSuccess', - ReadAllByCrawlerFailure = '[meta.sensor-display-item] ReadAllByCrawlerFailure', + ReadAllByCrawler = '[meta.meta-sensor-display-item] ReadAllByCrawler', + ReadAllByCrawlerSuccess = '[meta.meta-sensor-display-item] ReadAllByCrawlerSuccess', + ReadAllByCrawlerFailure = '[meta.meta-sensor-display-item] ReadAllByCrawlerFailure', } export class ReadAllByCrawler implements Action { readonly type = ActionType.ReadAllByCrawler; - constructor(public payload: MetaCrawler) {} } @@ -33,5 +31,4 @@ export type Actions = | ReadAllByCrawler | ReadAllByCrawlerSuccess | ReadAllByCrawlerFailure - ; diff --git a/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.effect.ts b/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.effect.ts new file mode 100644 index 0000000..24a11cf --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.effect.ts @@ -0,0 +1,39 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaSensorDisplayItemService } from '../../../service/meta-sensor-display-item.service'; + +import { + ReadAllByCrawler, + ReadAllByCrawlerSuccess, + ReadAllByCrawlerFailure, + ActionType, +} from './meta-sensor-display-item.action'; +import { MetaSensorDisplayItem, MetaCrawler } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaSensorDisplayItemService: MetaSensorDisplayItemService, + ) { } + + @Effect() + readAllByCrawler$ = this.actions$.pipe( + ofType(ActionType.ReadAllByCrawler), + map((action: ReadAllByCrawler) => action.payload), + exhaustMap((metaCrawler: MetaCrawler) => + this.metaSensorDisplayItemService + .readAllByCrawler(metaCrawler) + .pipe( + map((result: MetaSensorDisplayItem[]) => { + return new ReadAllByCrawlerSuccess(result); + }), + catchError(error => of(new ReadAllByCrawlerFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.reducer.ts b/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.reducer.ts new file mode 100644 index 0000000..5f972cb --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.reducer.ts @@ -0,0 +1,14 @@ +import { ActionType, Actions } from './meta-sensor-display-item.action'; +import { + State, + initialState, + metaSensorDisplayItemEntityAdapter, +} from './meta-sensor-display-item.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.state.ts b/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.state.ts new file mode 100644 index 0000000..f3c6c03 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaSensorDisplayItem } from '@overflow/commons-typescript/model/meta'; + +export const metaSensorDisplayItemEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaSensorDisplayItemEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaSensorDisplayItemEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-sensor-display-mapping/index.ts b/@overflow/meta/store/entity/meta-sensor-display-mapping/index.ts new file mode 100644 index 0000000..0148f31 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-display-mapping/index.ts @@ -0,0 +1,4 @@ +export * from './meta-sensor-display-mapping.action'; +export * from './meta-sensor-display-mapping.effect'; +export * from './meta-sensor-display-mapping.reducer'; +export * from './meta-sensor-display-mapping.state'; diff --git a/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.action.ts b/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.action.ts new file mode 100644 index 0000000..f24c5d8 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.action.ts @@ -0,0 +1,34 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaSensorDisplayItem, MetaSensorItemKey } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAllMetaSensorItemKeyByDisplayItem = '[meta.meta-sensor-display-mapping] ReadAllMetaSensorItemKeyByDisplayItem', + ReadAllMetaSensorItemKeyByDisplayItemSuccess = '[meta.meta-sensor-display-mapping] ReadAllMetaSensorItemKeyByDisplayItemSuccess', + ReadAllMetaSensorItemKeyByDisplayItemFailure = '[meta.meta-sensor-display-mapping] ReadAllMetaSensorItemKeyByDisplayItemFailure', +} + +export class ReadAllMetaSensorItemKeyByDisplayItem implements Action { + readonly type = ActionType.ReadAllMetaSensorItemKeyByDisplayItem; + constructor(public payload: MetaSensorDisplayItem) {} +} + +export class ReadAllMetaSensorItemKeyByDisplayItemSuccess implements Action { + readonly type = ActionType.ReadAllMetaSensorItemKeyByDisplayItemSuccess; + + constructor(public payload: MetaSensorItemKey[]) {} +} + +export class ReadAllMetaSensorItemKeyByDisplayItemFailure implements Action { + readonly type = ActionType.ReadAllMetaSensorItemKeyByDisplayItemFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAllMetaSensorItemKeyByDisplayItem + | ReadAllMetaSensorItemKeyByDisplayItemSuccess + | ReadAllMetaSensorItemKeyByDisplayItemFailure +; diff --git a/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.effect.ts b/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.effect.ts new file mode 100644 index 0000000..105db4e --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.effect.ts @@ -0,0 +1,39 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaSensorDisplayMappingService } from '../../../service/meta-sensor-display-mapping.service'; + +import { + ReadAllMetaSensorItemKeyByDisplayItem, + ReadAllMetaSensorItemKeyByDisplayItemSuccess, + ReadAllMetaSensorItemKeyByDisplayItemFailure, + ActionType, +} from './meta-sensor-display-mapping.action'; +import { MetaSensorDisplayMapping, MetaSensorDisplayItem, MetaSensorItemKey } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaSensorDisplayMappingService: MetaSensorDisplayMappingService, + ) { } + + @Effect() + readAllMetaSensorItemKeyByDisplayItem$ = this.actions$.pipe( + ofType(ActionType.ReadAllMetaSensorItemKeyByDisplayItem), + map((action: ReadAllMetaSensorItemKeyByDisplayItem) => action.payload), + exhaustMap((metaSensorDisplayItem: MetaSensorDisplayItem) => + this.metaSensorDisplayMappingService + .readAllMetaSensorItemKeyByDisplayItem(metaSensorDisplayItem) + .pipe( + map((result: MetaSensorItemKey[]) => { + return new ReadAllMetaSensorItemKeyByDisplayItemSuccess(result); + }), + catchError(error => of(new ReadAllMetaSensorItemKeyByDisplayItemFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.reducer.ts b/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.reducer.ts new file mode 100644 index 0000000..72494ae --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.reducer.ts @@ -0,0 +1,15 @@ +import { ActionType, Actions } from './meta-sensor-display-mapping.action'; +import { + State, + initialState, + metaCrawlerEntityAdapter, +} from './meta-sensor-display-mapping.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.state.ts b/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.state.ts new file mode 100644 index 0000000..b4de1ed --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaSensorDisplayMapping } from '@overflow/commons-typescript/model/meta'; + +export const metaCrawlerEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaCrawlerEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaCrawlerEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-sensor-item-key/index.ts b/@overflow/meta/store/entity/meta-sensor-item-key/index.ts new file mode 100644 index 0000000..970e773 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-key/index.ts @@ -0,0 +1,4 @@ +export * from './meta-sensor-item-key.action'; +export * from './meta-sensor-item-key.effect'; +export * from './meta-sensor-item-key.reducer'; +export * from './meta-sensor-item-key.state'; diff --git a/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.action.ts b/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.action.ts new file mode 100644 index 0000000..c9680b9 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.action.ts @@ -0,0 +1,59 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaSensorItemKey, MetaCrawler } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAllByCrawler = '[meta.meta-sensor-item-key] ReadAllByCrawler', + ReadAllByCrawlerSuccess = '[meta.meta-sensor-item-key] ReadAllByCrawlerSuccess', + ReadAllByCrawlerFailure = '[meta.meta-sensor-item-key] ReadAllByCrawlerFailure', + + ReadAllMapByCrawler = '[meta.meta-sensor-item-key] ReadAllMapByCrawler', + ReadAllMapByCrawlerSuccess = '[meta.meta-sensor-item-key] ReadAllMapByCrawlerSuccess', + ReadAllMapByCrawlerFailure = '[meta.meta-sensor-item-key] ReadAllMapByCrawlerFailure', +} + +export class ReadAllByCrawler implements Action { + readonly type = ActionType.ReadAllByCrawler; + constructor(public payload: MetaCrawler) {} +} + +export class ReadAllByCrawlerSuccess implements Action { + readonly type = ActionType.ReadAllByCrawlerSuccess; + + constructor(public payload: MetaSensorItemKey[]) {} +} + +export class ReadAllByCrawlerFailure implements Action { + readonly type = ActionType.ReadAllByCrawlerFailure; + + constructor(public payload: RPCClientError) {} +} + +export class ReadAllMapByCrawler implements Action { + readonly type = ActionType.ReadAllMapByCrawler; + constructor(public payload: MetaCrawler) {} +} + +export class ReadAllMapByCrawlerSuccess implements Action { + readonly type = ActionType.ReadAllMapByCrawlerSuccess; + + constructor(public payload: Map) {} +} + +export class ReadAllMapByCrawlerFailure implements Action { + readonly type = ActionType.ReadAllMapByCrawlerFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = +| ReadAllByCrawler +| ReadAllByCrawlerSuccess +| ReadAllByCrawlerFailure + +| ReadAllMapByCrawler +| ReadAllMapByCrawlerSuccess +| ReadAllMapByCrawlerFailure +; diff --git a/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.effect.ts b/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.effect.ts new file mode 100644 index 0000000..15d470c --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.effect.ts @@ -0,0 +1,61 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaSensorItemKeyService } from '../../../service/meta-sensor-item-key.service'; + +import { + ReadAllByCrawler, + ReadAllByCrawlerSuccess, + ReadAllByCrawlerFailure, + + ReadAllMapByCrawler, + ReadAllMapByCrawlerSuccess, + ReadAllMapByCrawlerFailure, + + ActionType, +} from './meta-sensor-item-key.action'; +import { MetaSensorItemKey, MetaCrawler } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaSensorItemKeyService: MetaSensorItemKeyService, + ) { } + + @Effect() + readAllByCrawler$ = this.actions$.pipe( + ofType(ActionType.ReadAllByCrawler), + map((action: ReadAllByCrawler) => action.payload), + exhaustMap((metaCrawler: MetaCrawler) => + this.metaSensorItemKeyService + .readAllByCrawler(metaCrawler) + .pipe( + map((result: MetaSensorItemKey[]) => { + return new ReadAllByCrawlerSuccess(result); + }), + catchError(error => of(new ReadAllByCrawlerFailure(error))) + ) + ) + ); + + @Effect() + readAllMapByCrawler$ = this.actions$.pipe( + ofType(ActionType.ReadAllMapByCrawler), + map((action: ReadAllMapByCrawler) => action.payload), + exhaustMap((metaCrawler: MetaCrawler) => + this.metaSensorItemKeyService + .readAllMapByCrawler(metaCrawler) + .pipe( + map((result: Map) => { + return new ReadAllMapByCrawlerSuccess(result); + }), + catchError(error => of(new ReadAllMapByCrawlerFailure(error))) + ) + ) + ); + +} diff --git a/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.reducer.ts b/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.reducer.ts new file mode 100644 index 0000000..2c65152 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.reducer.ts @@ -0,0 +1,15 @@ +import { ActionType, Actions } from './meta-sensor-item-key.action'; +import { + State, + initialState, + metaSensorItemKeyEntityAdapter, +} from './meta-sensor-item-key.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.state.ts b/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.state.ts new file mode 100644 index 0000000..bf93e86 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaSensorItemKey } from '@overflow/commons-typescript/model/meta'; + +export const metaSensorItemKeyEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaSensorItemKeyEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaSensorItemKeyEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-sensor-item-type/index.ts b/@overflow/meta/store/entity/meta-sensor-item-type/index.ts new file mode 100644 index 0000000..480b480 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-type/index.ts @@ -0,0 +1,4 @@ +export * from './meta-sensor-item-type.action'; +export * from './meta-sensor-item-type.effect'; +export * from './meta-sensor-item-type.reducer'; +export * from './meta-sensor-item-type.state'; diff --git a/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.action.ts b/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.action.ts new file mode 100644 index 0000000..e032983 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaSensorItemType } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-sensor-item-type] ReadAll', + ReadAllSuccess = '[meta.meta-sensor-item-type] ReadAllSuccess', + ReadAllFailure = '[meta.meta-sensor-item-type] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaSensorItemType[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.effect.ts b/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.effect.ts new file mode 100644 index 0000000..56681ba --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaSensorItemTypeService } from '../../../service/meta-sensor-item-type.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-sensor-item-type.action'; +import { MetaSensorItemType } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaSensorItemTypeService: MetaSensorItemTypeService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaSensorItemTypeService + .readAll() + .pipe( + map((result: MetaSensorItemType[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.reducer.ts b/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.reducer.ts new file mode 100644 index 0000000..633a1eb --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-sensor-item-type.action'; +import { + State, + initialState, + metaSensorItemTypeEntityAdapter, +} from './meta-sensor-item-type.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaSensorItemTypeEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaSensorItemTypeEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.state.ts b/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.state.ts new file mode 100644 index 0000000..182526e --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaSensorItemType } from '@overflow/commons-typescript/model/meta'; + +export const metaSensorItemTypeEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaSensorItemTypeEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaSensorItemTypeEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-sensor-item-unit/index.ts b/@overflow/meta/store/entity/meta-sensor-item-unit/index.ts new file mode 100644 index 0000000..64dae2f --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-unit/index.ts @@ -0,0 +1,4 @@ +export * from './meta-sensor-item-unit.action'; +export * from './meta-sensor-item-unit.effect'; +export * from './meta-sensor-item-unit.reducer'; +export * from './meta-sensor-item-unit.state'; diff --git a/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.action.ts b/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.action.ts new file mode 100644 index 0000000..c3319bd --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaSensorItemUnit } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-sensor-item-unit] ReadAll', + ReadAllSuccess = '[meta.meta-sensor-item-unit] ReadAllSuccess', + ReadAllFailure = '[meta.meta-sensor-item-unit] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaSensorItemUnit[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.effect.ts b/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.effect.ts new file mode 100644 index 0000000..86a28b4 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaSensorItemUnitService } from '../../../service/meta-sensor-item-unit.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-sensor-item-unit.action'; +import { MetaSensorItemUnit } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaSensorItemUnitService: MetaSensorItemUnitService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaSensorItemUnitService + .readAll() + .pipe( + map((result: MetaSensorItemUnit[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.reducer.ts b/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.reducer.ts new file mode 100644 index 0000000..d9e4d59 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-sensor-item-unit.action'; +import { + State, + initialState, + metaSensorItemUnitEntityAdapter, +} from './meta-sensor-item-unit.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaSensorItemUnitEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaSensorItemUnitEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.state.ts b/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.state.ts new file mode 100644 index 0000000..da08427 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaSensorItemUnit } from '@overflow/commons-typescript/model/meta'; + +export const metaSensorItemUnitEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaSensorItemUnitEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaSensorItemUnitEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-sensor-item/index.ts b/@overflow/meta/store/entity/meta-sensor-item/index.ts new file mode 100644 index 0000000..face0fa --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item/index.ts @@ -0,0 +1,4 @@ +export * from './meta-sensor-item.action'; +export * from './meta-sensor-item.effect'; +export * from './meta-sensor-item.reducer'; +export * from './meta-sensor-item.state'; diff --git a/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.action.ts b/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.action.ts new file mode 100644 index 0000000..f2a0938 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaSensorItem } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-sensor-item] ReadAll', + ReadAllSuccess = '[meta.meta-sensor-item] ReadAllSuccess', + ReadAllFailure = '[meta.meta-sensor-item] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaSensorItem[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.effect.ts b/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.effect.ts new file mode 100644 index 0000000..c992981 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaSensorItemService } from '../../../service/meta-sensor-item.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-sensor-item.action'; +import { MetaSensorItem } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaSensorItemService: MetaSensorItemService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaSensorItemService + .readAll() + .pipe( + map((result: MetaSensorItem[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.reducer.ts b/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.reducer.ts new file mode 100644 index 0000000..7a9908b --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-sensor-item.action'; +import { + State, + initialState, + metaSensorItemEntityAdapter, +} from './meta-sensor-item.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaSensorItemEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaSensorItemEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.state.ts b/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.state.ts new file mode 100644 index 0000000..d6c5f80 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaSensorItem } from '@overflow/commons-typescript/model/meta'; + +export const metaSensorItemEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaSensorItemEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaSensorItemEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-sensor-status/index.ts b/@overflow/meta/store/entity/meta-sensor-status/index.ts new file mode 100644 index 0000000..40006b2 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-status/index.ts @@ -0,0 +1,4 @@ +export * from './meta-sensor-status.action'; +export * from './meta-sensor-status.effect'; +export * from './meta-sensor-status.reducer'; +export * from './meta-sensor-status.state'; diff --git a/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.action.ts b/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.action.ts new file mode 100644 index 0000000..2289ea9 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaSensorStatus } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-sensor-status] ReadAll', + ReadAllSuccess = '[meta.meta-sensor-status] ReadAllSuccess', + ReadAllFailure = '[meta.meta-sensor-status] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaSensorStatus[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.effect.ts b/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.effect.ts new file mode 100644 index 0000000..13db19c --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaSensorStatusService } from '../../../service/meta-sensor-status.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-sensor-status.action'; +import { MetaSensorStatus } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaSensorStatusService: MetaSensorStatusService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaSensorStatusService + .readAll() + .pipe( + map((result: MetaSensorStatus[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.reducer.ts b/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.reducer.ts new file mode 100644 index 0000000..dcd8cd9 --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-sensor-status.action'; +import { + State, + initialState, + metaSensorStatusEntityAdapter, +} from './meta-sensor-status.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaSensorStatusEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaSensorStatusEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.state.ts b/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.state.ts new file mode 100644 index 0000000..0d0eb0c --- /dev/null +++ b/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaSensorStatus } from '@overflow/commons-typescript/model/meta'; + +export const metaSensorStatusEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaSensorStatusEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaSensorStatusEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/index.ts b/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/index.ts new file mode 100644 index 0000000..f979e4f --- /dev/null +++ b/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/index.ts @@ -0,0 +1,4 @@ +export * from './meta-vendor-crawler-sensor-item.action'; +export * from './meta-vendor-crawler-sensor-item.effect'; +export * from './meta-vendor-crawler-sensor-item.reducer'; +export * from './meta-vendor-crawler-sensor-item.state'; diff --git a/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.action.ts b/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.action.ts new file mode 100644 index 0000000..a9e7c80 --- /dev/null +++ b/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.action.ts @@ -0,0 +1,33 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaVendorCrawlerSensorItem } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAll = '[meta.meta-vendor-crawler-sensor-item] ReadAll', + ReadAllSuccess = '[meta.meta-vendor-crawler-sensor-item] ReadAllSuccess', + ReadAllFailure = '[meta.meta-vendor-crawler-sensor-item] ReadAllFailure', +} + +export class ReadAll implements Action { + readonly type = ActionType.ReadAll; +} + +export class ReadAllSuccess implements Action { + readonly type = ActionType.ReadAllSuccess; + + constructor(public payload: MetaVendorCrawlerSensorItem[]) {} +} + +export class ReadAllFailure implements Action { + readonly type = ActionType.ReadAllFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAll + | ReadAllSuccess + | ReadAllFailure +; diff --git a/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.effect.ts b/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.effect.ts new file mode 100644 index 0000000..1ad7f27 --- /dev/null +++ b/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.effect.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaVendorCrawlerSensorItemService } from '../../../service/meta-vendor-crawler-sensor-item.service'; + +import { + ReadAll, + ReadAllSuccess, + ReadAllFailure, + ActionType, +} from './meta-vendor-crawler-sensor-item.action'; +import { MetaVendorCrawlerSensorItem } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaVendorCrawlerSensorItemService: MetaVendorCrawlerSensorItemService, + ) { } + + @Effect() + readAll$ = this.actions$.pipe( + ofType(ActionType.ReadAll), + exhaustMap(() => + this.metaVendorCrawlerSensorItemService + .readAll() + .pipe( + map((result: MetaVendorCrawlerSensorItem[]) => { + return new ReadAllSuccess(result); + }), + catchError(error => of(new ReadAllFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.reducer.ts b/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.reducer.ts new file mode 100644 index 0000000..a6e1d6e --- /dev/null +++ b/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.reducer.ts @@ -0,0 +1,26 @@ +import { ActionType, Actions } from './meta-vendor-crawler-sensor-item.action'; +import { + State, + initialState, + metaVendorCrawlerSensorItemEntityAdapter, +} from './meta-vendor-crawler-sensor-item.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + case ActionType.ReadAll: { + return { + ...state, + }; + } + case ActionType.ReadAllSuccess: { + return metaVendorCrawlerSensorItemEntityAdapter.setAll(action.payload, state); + } + case ActionType.ReadAllFailure: { + return metaVendorCrawlerSensorItemEntityAdapter.setError(action.payload, state); + } + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.state.ts b/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.state.ts new file mode 100644 index 0000000..7ff39ae --- /dev/null +++ b/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaVendorCrawlerSensorItem } from '@overflow/commons-typescript/model/meta'; + +export const metaVendorCrawlerSensorItemEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaVendorCrawlerSensorItemEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaVendorCrawlerSensorItemEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/entity/meta-vendor-crawler/index.ts b/@overflow/meta/store/entity/meta-vendor-crawler/index.ts new file mode 100644 index 0000000..23d4e77 --- /dev/null +++ b/@overflow/meta/store/entity/meta-vendor-crawler/index.ts @@ -0,0 +1,4 @@ +export * from './meta-vendor-crawler.action'; +export * from './meta-vendor-crawler.effect'; +export * from './meta-vendor-crawler.reducer'; +export * from './meta-vendor-crawler.state'; diff --git a/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.action.ts b/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.action.ts new file mode 100644 index 0000000..b4f9a44 --- /dev/null +++ b/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.action.ts @@ -0,0 +1,34 @@ +import { Action } from '@ngrx/store'; + +import { RPCClientError } from '@loafer/ng-rpc'; +import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; +import { MetaVendorCrawler, MetaInfraVendor } from '@overflow/commons-typescript/model/meta'; + +export enum ActionType { + ReadAllByInfraVendor = '[meta.meta-vendor-crawler] ReadAllByInfraVendor', + ReadAllByInfraVendorSuccess = '[meta.meta-vendor-crawler] ReadAllByInfraVendorSuccess', + ReadAllByInfraVendorFailure = '[meta.meta-vendor-crawler] ReadAllByInfraVendorFailure', +} + +export class ReadAllByInfraVendor implements Action { + readonly type = ActionType.ReadAllByInfraVendor; + constructor(public payload: MetaInfraVendor) {} +} + +export class ReadAllByInfraVendorSuccess implements Action { + readonly type = ActionType.ReadAllByInfraVendorSuccess; + + constructor(public payload: MetaVendorCrawler[]) {} +} + +export class ReadAllByInfraVendorFailure implements Action { + readonly type = ActionType.ReadAllByInfraVendorFailure; + + constructor(public payload: RPCClientError) {} +} + +export type Actions = + | ReadAllByInfraVendor + | ReadAllByInfraVendorSuccess + | ReadAllByInfraVendorFailure +; diff --git a/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.effect.ts b/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.effect.ts new file mode 100644 index 0000000..3300b1c --- /dev/null +++ b/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.effect.ts @@ -0,0 +1,39 @@ +import { Injectable } from '@angular/core'; +import { Effect, Actions, ofType } from '@ngrx/effects'; +import { of } from 'rxjs'; +import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; + +import { MetaVendorCrawlerService } from '../../../service/meta-vendor-crawler.service'; + +import { + ReadAllByInfraVendor, + ReadAllByInfraVendorSuccess, + ReadAllByInfraVendorFailure, + ActionType, +} from './meta-vendor-crawler.action'; +import { MetaVendorCrawler, MetaInfraVendor } from '@overflow/commons-typescript/model/meta'; + +@Injectable() +export class Effects { + + constructor( + private actions$: Actions, + private metaVendorCrawlerService: MetaVendorCrawlerService, + ) { } + + @Effect() + readAllByInfraVendor$ = this.actions$.pipe( + ofType(ActionType.ReadAllByInfraVendor), + map((action: ReadAllByInfraVendor) => action.payload), + exhaustMap((metaInfraVendor: MetaInfraVendor) => + this.metaVendorCrawlerService + .readAllByInfraVendor(metaInfraVendor) + .pipe( + map((result: MetaVendorCrawler[]) => { + return new ReadAllByInfraVendorSuccess(result); + }), + catchError(error => of(new ReadAllByInfraVendorFailure(error))) + ) + ) + ); +} diff --git a/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.reducer.ts b/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.reducer.ts new file mode 100644 index 0000000..36cff66 --- /dev/null +++ b/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.reducer.ts @@ -0,0 +1,15 @@ +import { ActionType, Actions } from './meta-vendor-crawler.action'; +import { + State, + initialState, + metaVendorCrawlerEntityAdapter, +} from './meta-vendor-crawler.state'; + +export function reducer(state: State = initialState, action: Actions): State { + switch (action.type) { + + default: { + return state; + } + } +} diff --git a/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.state.ts b/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.state.ts new file mode 100644 index 0000000..f5d8e88 --- /dev/null +++ b/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.state.ts @@ -0,0 +1,17 @@ +import { RPCClientError } from '@loafer/ng-rpc'; + +import { Selector, createSelector } from '@ngrx/store'; +import { createEntityAdapter, EntityState } from '@loafer/ng-entity'; +import { MetaVendorCrawler } from '@overflow/commons-typescript/model/meta'; + +export const metaVendorCrawlerEntityAdapter = createEntityAdapter(); +export interface State extends EntityState { +} +export const initialState: State = metaVendorCrawlerEntityAdapter.getInitialState({ +}); + +export function getSelectors(selector: Selector) { + return { + ...metaVendorCrawlerEntityAdapter.getSelectors(selector), + }; +} diff --git a/@overflow/meta/store/index.ts b/@overflow/meta/store/index.ts new file mode 100644 index 0000000..02c2621 --- /dev/null +++ b/@overflow/meta/store/index.ts @@ -0,0 +1,184 @@ +import { + createSelector, + createFeatureSelector, +} from '@ngrx/store'; + +import { MODULE } from '../meta.constant'; + +import * as MetaCrawlerEntityStore from './entity/meta-crawler'; +import * as MetaCrawlerInputItemEntityStore from './entity/meta-crawler-input-item'; +import * as MetaHistoryTypeEntityStore from './entity/meta-history-type'; +import * as MetaInfraTypeEntityStore from './entity/meta-infra-type'; +import * as MetaInfraVendorEntityStore from './entity/meta-infra-vendor'; +import * as MetaInputTypeEntityStore from './entity/meta-input-type'; +import * as MetaMemberStatusEntityStore from './entity/meta-member-status'; +import * as MetaNoAuthProbeStatusEntityStore from './entity/meta-noauth-probe-status'; +import * as MetaProbeArchitectureEntityStore from './entity/meta-probe-architecture'; +import * as MetaProbeOsEntityStore from './entity/meta-probe-os'; +import * as MetaProbePackageEntityStore from './entity/meta-probe-package'; +import * as MetaProbeStatusEntityStore from './entity/meta-probe-status'; +import * as MetaProbeTaskTypeEntityStore from './entity/meta-probe-task-type'; +import * as MetaProbeVersionEntityStore from './entity/meta-probe-version'; +import * as MetaSensorDisplayItemEntityStore from './entity/meta-sensor-display-item'; +import * as MetaSensorDisplayMappingEntityStore from './entity/meta-sensor-display-mapping'; +import * as MetaSensorItemEntityStore from './entity/meta-sensor-item'; +import * as MetaSensorItemKeyEntityStore from './entity/meta-sensor-item-key'; +import * as MetaSensorItemTypeEntityStore from './entity/meta-sensor-item-type'; +import * as MetaSensorItemUnitEntityStore from './entity/meta-sensor-item-unit'; +import * as MetaSensorStatusEntityStore from './entity/meta-sensor-status'; +import * as MetaVendorCrawlerEntityStore from './entity/meta-vendor-crawler'; +import * as MetaVendorCrawlerSensorItemEntityStore from './entity/meta-vendor-crawler-sensor-item'; + +export interface State { + meta_crawler_entity: MetaCrawlerEntityStore.State; + meta_crawler_input_item_entity: MetaCrawlerInputItemEntityStore.State; + meta_history_type_entity: MetaHistoryTypeEntityStore.State; + meta_infra_type_entity: MetaInfraTypeEntityStore.State; + meta_infra_vendor_entity: MetaInfraVendorEntityStore.State; + meta_input_type_entity: MetaInputTypeEntityStore.State; + meta_member_status_entity: MetaMemberStatusEntityStore.State; + meta_noauth_probe_status_entity: MetaNoAuthProbeStatusEntityStore.State; + meta_probe_architecture_entity: MetaProbeArchitectureEntityStore.State; + meta_probe_os_entity: MetaProbeOsEntityStore.State; + meta_probe_package_entity: MetaProbePackageEntityStore.State; + meta_probe_status_entity: MetaProbeStatusEntityStore.State; + meta_probe_task_type_entity: MetaProbeTaskTypeEntityStore.State; + meta_probe_version_entity: MetaProbeVersionEntityStore.State; + meta_sensor_display_item_entity: MetaSensorDisplayItemEntityStore.State; + meta_sensor_display_mapping_entity: MetaSensorDisplayMappingEntityStore.State; + meta_sensor_item_entity: MetaSensorItemEntityStore.State; + meta_sensor_item_key_entity: MetaSensorItemKeyEntityStore.State; + meta_sensor_item_type_entity: MetaSensorItemTypeEntityStore.State; + meta_sensor_item_unit_entity: MetaSensorItemUnitEntityStore.State; + meta_sensor_status_entity: MetaSensorStatusEntityStore.State; + meta_vendor_crawler_entity: MetaVendorCrawlerEntityStore.State; + meta_vendor_crawler_sensor_item_entity: MetaVendorCrawlerSensorItemEntityStore.State; +} + +export const REDUCERS = { + meta_crawler_entity: MetaCrawlerEntityStore.reducer, + meta_crawler_input_item_entity: MetaCrawlerInputItemEntityStore.reducer, + meta_history_type_entity: MetaHistoryTypeEntityStore.reducer, + meta_infra_type_entity: MetaInfraTypeEntityStore.reducer, + meta_infra_vendor_entity: MetaInfraVendorEntityStore.reducer, + meta_input_type_entity: MetaInputTypeEntityStore.reducer, + meta_member_status_entity: MetaMemberStatusEntityStore.reducer, + meta_noauth_probe_status_entity: MetaNoAuthProbeStatusEntityStore.reducer, + meta_probe_architecture_entity: MetaProbeArchitectureEntityStore.reducer, + meta_probe_os_entity: MetaProbeOsEntityStore.reducer, + meta_probe_package_entity: MetaProbePackageEntityStore.reducer, + meta_probe_status_entity: MetaProbeStatusEntityStore.reducer, + meta_probe_task_type_entity: MetaProbeTaskTypeEntityStore.reducer, + meta_probe_version_entity: MetaProbeVersionEntityStore.reducer, + meta_sensor_display_item_entity: MetaSensorDisplayItemEntityStore.reducer, + meta_sensor_display_mapping_entity: MetaSensorDisplayMappingEntityStore.reducer, + meta_sensor_item_entity: MetaSensorItemEntityStore.reducer, + meta_sensor_item_key_entity: MetaSensorItemKeyEntityStore.reducer, + meta_sensor_item_type_entity: MetaSensorItemTypeEntityStore.reducer, + meta_sensor_item_unit_entity: MetaSensorItemUnitEntityStore.reducer, + meta_sensor_status_entity: MetaSensorStatusEntityStore.reducer, + meta_vendor_crawler_entity: MetaVendorCrawlerEntityStore.reducer, + meta_vendor_crawler_sensor_item_entity: MetaVendorCrawlerSensorItemEntityStore.reducer, +}; + +export const EFFECTS = [ + MetaCrawlerEntityStore.Effects, + MetaCrawlerInputItemEntityStore.Effects, + MetaHistoryTypeEntityStore.Effects, + MetaInfraTypeEntityStore.Effects, + MetaInfraVendorEntityStore.Effects, + MetaInputTypeEntityStore.Effects, + MetaMemberStatusEntityStore.Effects, + MetaNoAuthProbeStatusEntityStore.Effects, + MetaProbeArchitectureEntityStore.Effects, + MetaProbeOsEntityStore.Effects, + MetaProbePackageEntityStore.Effects, + MetaProbeStatusEntityStore.Effects, + MetaProbeTaskTypeEntityStore.Effects, + MetaProbeVersionEntityStore.Effects, + MetaSensorDisplayItemEntityStore.Effects, + MetaSensorDisplayMappingEntityStore.Effects, + MetaSensorItemEntityStore.Effects, + MetaSensorItemKeyEntityStore.Effects, + MetaSensorItemTypeEntityStore.Effects, + MetaSensorItemUnitEntityStore.Effects, + MetaSensorStatusEntityStore.Effects, + MetaVendorCrawlerEntityStore.Effects, + MetaVendorCrawlerSensorItemEntityStore.Effects, +]; + +export const selectState = createFeatureSelector(MODULE.name); + + + +export const MetaCrawlerEntitySelector = MetaCrawlerEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_crawler_entity +)); +export const MetaCrawlerInputItemEntitySelector = MetaCrawlerInputItemEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_crawler_input_item_entity +)); +export const MetaHistoryTypeEntitySelector = MetaHistoryTypeEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_history_type_entity +)); +export const MetaInfraTypeEntitySelector = MetaInfraTypeEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_infra_type_entity +)); +export const MetaInfraVendorEntitySelector = MetaInfraVendorEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_infra_vendor_entity +)); +export const MetaInputTypeEntitySelector = MetaInputTypeEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_input_type_entity +)); +export const MetaMemberStatusEntitySelector = MetaMemberStatusEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_member_status_entity +)); +export const MetaNoAuthProbeStatusEntitySelector = MetaNoAuthProbeStatusEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_noauth_probe_status_entity +)); +export const MetaProbeArchitectureEntitySelector = MetaProbeArchitectureEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_probe_architecture_entity +)); +export const MetaProbeOsEntitySelector = MetaProbeOsEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_probe_os_entity +)); +export const MetaProbePackageEntitySelector = MetaProbePackageEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_probe_package_entity +)); +export const MetaProbeStatusEntitySelector = MetaProbeStatusEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_probe_status_entity +)); +export const MetaProbeTaskTypeEntitySelector = MetaProbeTaskTypeEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_probe_task_type_entity +)); +export const MetaProbeVersionEntitySelector = MetaProbeVersionEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_probe_version_entity +)); +export const MetaSensorDisplayItemEntitySelector = MetaSensorDisplayItemEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_sensor_display_item_entity +)); +export const MetaSensorDisplayMappingEntitySelector = MetaSensorDisplayMappingEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_sensor_display_mapping_entity +)); +export const MetaSensorItemEntitySelector = MetaSensorItemEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_sensor_item_entity +)); +export const MetaSensorItemKeyEntitySelector = MetaSensorItemKeyEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_sensor_item_key_entity +)); +export const MetaSensorItemTypeEntitySelector = MetaSensorItemTypeEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_sensor_item_type_entity +)); +export const MetaSensorItemUnitEntitySelector = MetaSensorItemUnitEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_sensor_item_unit_entity +)); +export const MetaSensorStatusEntitySelector = MetaSensorStatusEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_sensor_status_entity +)); +export const MetaVendorCrawlerEntitySelector = MetaVendorCrawlerEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_vendor_crawler_entity +)); +export const MetaVendorCrawlerSensorItemEntitySelector = MetaVendorCrawlerSensorItemEntityStore.getSelectors(createSelector( + selectState, (state: State) => state.meta_vendor_crawler_sensor_item_entity +)); + +