ing
This commit is contained in:
parent
60d2775dfa
commit
10e14d5edb
|
@ -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 { }
|
|
@ -1,3 +0,0 @@
|
|||
export const MODULE = {
|
||||
name: 'metaCrawlerInputItem'
|
||||
};
|
|
@ -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 { }
|
|
@ -1,5 +0,0 @@
|
|||
import { MetaCrawlerInputItemService } from './crawler-input-item.service';
|
||||
|
||||
export const SERVICES = [
|
||||
MetaCrawlerInputItemService,
|
||||
];
|
|
@ -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<State>(MODULE.name);
|
||||
|
||||
export const ReadCrawlerInputItemSelector = new StateSelector<ListStore.State>(createSelector(
|
||||
selectState,
|
||||
(state: State) => state.list
|
||||
));
|
|
@ -1,4 +0,0 @@
|
|||
export * from './list.action';
|
||||
export * from './list.effect';
|
||||
export * from './list.reducer';
|
||||
export * from './list.state';
|
|
@ -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();
|
||||
}));
|
||||
});
|
|
@ -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<Action> = 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));
|
||||
});
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
};
|
|
@ -1,5 +0,0 @@
|
|||
import { MetaCrawlerService } from './crawler.service';
|
||||
|
||||
export const SERVICES = [
|
||||
MetaCrawlerService,
|
||||
];
|
|
@ -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<State>(MODULE.name);
|
||||
|
||||
export const ReadAllCrawlerSelector = new StateSelector<ListStore.State>(createSelector(
|
||||
selectCrawlerState,
|
||||
(state: State) => state.crawlers
|
||||
));
|
|
@ -1,4 +0,0 @@
|
|||
export * from './list.action';
|
||||
export * from './list.effect';
|
||||
export * from './list.reducer';
|
||||
export * from './list.state';
|
|
@ -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();
|
||||
}));
|
||||
});
|
|
@ -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<Action> = 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));
|
||||
});
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
};
|
|
@ -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 { }
|
|
@ -1,3 +1,3 @@
|
|||
export const MODULE = {
|
||||
name: 'metaCrawler'
|
||||
name: 'meta'
|
||||
};
|
|
@ -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 { }
|
|
@ -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 { }
|
|
@ -1,3 +0,0 @@
|
|||
export const MODULE = {
|
||||
name: 'metaSensorDisplayItem'
|
||||
};
|
|
@ -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 { }
|
|
@ -1,5 +0,0 @@
|
|||
import { MetaSensorDisplayItemService } from './sensor-display-item.service';
|
||||
|
||||
export const SERVICES = [
|
||||
MetaSensorDisplayItemService,
|
||||
];
|
|
@ -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<State>(MODULE.name);
|
||||
|
||||
export const ReadAllSensorDisplayItemByCrawlerSelector = new StateSelector<ListStore.State>(createSelector(
|
||||
selectState,
|
||||
(state: State) => state.list
|
||||
));
|
|
@ -1,4 +0,0 @@
|
|||
export * from './list.action';
|
||||
export * from './list.effect';
|
||||
export * from './list.reducer';
|
||||
export * from './list.state';
|
|
@ -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();
|
||||
}));
|
||||
});
|
|
@ -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<Action> = 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));
|
||||
});
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
};
|
51
@overflow/meta/service/index.ts
Normal file
51
@overflow/meta/service/index.ts
Normal file
|
@ -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,
|
||||
];
|
|
@ -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';
|
|
@ -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()
|
18
@overflow/meta/service/meta-history-type.service.ts
Normal file
18
@overflow/meta/service/meta-history-type.service.ts
Normal file
|
@ -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<MetaHistoryType[]> {
|
||||
return this.rpcService.call('MetaHistoryTypeService.readAll');
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-infra-type.service.ts
Normal file
18
@overflow/meta/service/meta-infra-type.service.ts
Normal file
|
@ -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<MetaInfraType[]> {
|
||||
return this.rpcService.call('MetaInfraTypeService.readAll');
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-infra-vendor.service.ts
Normal file
18
@overflow/meta/service/meta-infra-vendor.service.ts
Normal file
|
@ -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<MetaInfraVendor[]> {
|
||||
return this.rpcService.call('MetaInfraVendorService.readAllByMetaInfraType', infraType);
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-input-type.service.ts
Normal file
18
@overflow/meta/service/meta-input-type.service.ts
Normal file
|
@ -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<MetaInputType[]> {
|
||||
return this.rpcService.call('MetaInputTypeService.readAll');
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-member-status.service.ts
Normal file
18
@overflow/meta/service/meta-member-status.service.ts
Normal file
|
@ -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<MetaMemberStatus[]> {
|
||||
return this.rpcService.call('MetaMemberStatusService.readAll');
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-noauth-probe-status.service.ts
Normal file
18
@overflow/meta/service/meta-noauth-probe-status.service.ts
Normal file
|
@ -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<MetaNoAuthProbeStatus[]> {
|
||||
return this.rpcService.call('MetaNoAuthProbeStatusService.readAll');
|
||||
}
|
||||
}
|
14
@overflow/meta/service/meta-notification.service.ts
Normal file
14
@overflow/meta/service/meta-notification.service.ts
Normal file
|
@ -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,
|
||||
) {
|
||||
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-probe-architecture.service.ts
Normal file
18
@overflow/meta/service/meta-probe-architecture.service.ts
Normal file
|
@ -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<MetaProbeArchitecture[]> {
|
||||
return this.rpcService.call('MetaProbeArchitectureService.readAll');
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-probe-os.service.ts
Normal file
18
@overflow/meta/service/meta-probe-os.service.ts
Normal file
|
@ -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<MetaProbeOs[]> {
|
||||
return this.rpcService.call('MetaProbeOsService.readAll');
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-probe-package.service.ts
Normal file
18
@overflow/meta/service/meta-probe-package.service.ts
Normal file
|
@ -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<MetaProbePackage[]> {
|
||||
return this.rpcService.call('MetaProbePackageService.readAllByOs', metaProbeOs);
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-probe-status.service.ts
Normal file
18
@overflow/meta/service/meta-probe-status.service.ts
Normal file
|
@ -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<MetaProbeStatus[]> {
|
||||
return this.rpcService.call('MetaProbeStatusService.readAll');
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-probe-task-type.service.ts
Normal file
18
@overflow/meta/service/meta-probe-task-type.service.ts
Normal file
|
@ -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<MetaProbeTaskType[]> {
|
||||
return this.rpcService.call('MetaProbeTaskTypeService.readAll');
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-probe-version.service.ts
Normal file
18
@overflow/meta/service/meta-probe-version.service.ts
Normal file
|
@ -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<MetaProbeVersion[]> {
|
||||
return this.rpcService.call('MetaProbeVersionService.readAll');
|
||||
}
|
||||
}
|
|
@ -17,7 +17,7 @@ export class MetaSensorDisplayItemService {
|
|||
|
||||
}
|
||||
|
||||
public readAllByMetaCrawler(c: MetaCrawler): Observable<MetaSensorDisplayItem[]> {
|
||||
public readAllByCrawler(c: MetaCrawler): Observable<MetaSensorDisplayItem[]> {
|
||||
return this.rpcService.call('MetaSensorDisplayItemService.readAllByCrawler', c);
|
||||
}
|
||||
}
|
|
@ -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<MetaSensorItemKey[]> {
|
||||
return this.rpcService.call('MetaSensorDisplayMappingService.readAllMetaSensorItemKeyByDisplayItem', displayItem);
|
||||
}
|
||||
}
|
21
@overflow/meta/service/meta-sensor-item-key.service.ts
Normal file
21
@overflow/meta/service/meta-sensor-item-key.service.ts
Normal file
|
@ -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<MetaSensorItemKey[]> {
|
||||
return this.rpcService.call('MetaSensorItemKeyService.readAllByCrawler', metaCrawler);
|
||||
}
|
||||
public readAllMapByCrawler(metaCrawler: MetaCrawler): Observable<Map<number, MetaSensorItemKey>> {
|
||||
return this.rpcService.call('MetaSensorItemKeyService.readAllMapByCrawler', metaCrawler);
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-sensor-item-type.service.ts
Normal file
18
@overflow/meta/service/meta-sensor-item-type.service.ts
Normal file
|
@ -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<MetaSensorItemType[]> {
|
||||
return this.rpcService.call('MetaSensorItemTypeService.readAll');
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-sensor-item-unit.service.ts
Normal file
18
@overflow/meta/service/meta-sensor-item-unit.service.ts
Normal file
|
@ -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<MetaSensorItemUnit[]> {
|
||||
return this.rpcService.call('MetaSensorItemUnitService.readAll');
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-sensor-item.service.ts
Normal file
18
@overflow/meta/service/meta-sensor-item.service.ts
Normal file
|
@ -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<MetaSensorItem[]> {
|
||||
return this.rpcService.call('MetaSensorItemService.readAll');
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-sensor-status.service.ts
Normal file
18
@overflow/meta/service/meta-sensor-status.service.ts
Normal file
|
@ -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<MetaSensorStatus[]> {
|
||||
return this.rpcService.call('MetaSensorStatusService.readAll');
|
||||
}
|
||||
}
|
|
@ -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<MetaVendorCrawlerSensorItem[]> {
|
||||
return this.rpcService.call('MetaVendorCrawlerSensorItemService.readAll');
|
||||
}
|
||||
}
|
18
@overflow/meta/service/meta-vendor-crawler.service.ts
Normal file
18
@overflow/meta/service/meta-vendor-crawler.service.ts
Normal file
|
@ -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<MetaVendorCrawler[]> {
|
||||
return this.rpcService.call('MetaVendorCrawlerService.readAllByInfraVendor', infraVendor);
|
||||
}
|
||||
}
|
|
@ -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';
|
|
@ -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
|
||||
;
|
|
@ -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)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<MetaCrawlerInputItem, RPCClientError>();
|
||||
export interface State extends EntityState<MetaCrawlerInputItem, RPCClientError> {
|
||||
}
|
||||
export const initialState: State = metaCrawlerInputItemEntityAdapter.getInitialState({
|
||||
});
|
||||
|
||||
export function getSelectors(selector: Selector<any, State>) {
|
||||
return {
|
||||
...metaCrawlerInputItemEntityAdapter.getSelectors(selector),
|
||||
};
|
||||
}
|
4
@overflow/meta/store/entity/meta-crawler/index.ts
Normal file
4
@overflow/meta/store/entity/meta-crawler/index.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
export * from './meta-crawler.action';
|
||||
export * from './meta-crawler.effect';
|
||||
export * from './meta-crawler.reducer';
|
||||
export * from './meta-crawler.state';
|
|
@ -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
|
||||
|
||||
;
|
|
@ -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<any>,
|
||||
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)))
|
||||
);
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<MetaCrawler, RPCClientError>();
|
||||
export interface State extends EntityState<MetaCrawler, RPCClientError> {
|
||||
}
|
||||
export const initialState: State = metaCrawlerEntityAdapter.getInitialState({
|
||||
});
|
||||
|
||||
export function getSelectors(selector: Selector<any, State>) {
|
||||
return {
|
||||
...metaCrawlerEntityAdapter.getSelectors(selector),
|
||||
};
|
||||
}
|
4
@overflow/meta/store/entity/meta-history-type/index.ts
Normal file
4
@overflow/meta/store/entity/meta-history-type/index.ts
Normal file
|
@ -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';
|
|
@ -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
|
||||
;
|
|
@ -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)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<MetaHistoryType, RPCClientError>();
|
||||
export interface State extends EntityState<MetaHistoryType, RPCClientError> {
|
||||
}
|
||||
export const initialState: State = metaHistoryTypeEntityAdapter.getInitialState({
|
||||
});
|
||||
|
||||
export function getSelectors(selector: Selector<any, State>) {
|
||||
return {
|
||||
...metaHistoryTypeEntityAdapter.getSelectors(selector),
|
||||
};
|
||||
}
|
4
@overflow/meta/store/entity/meta-infra-type/index.ts
Normal file
4
@overflow/meta/store/entity/meta-infra-type/index.ts
Normal file
|
@ -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';
|
|
@ -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
|
||||
;
|
|
@ -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)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<MetaInfraType, RPCClientError>();
|
||||
export interface State extends EntityState<MetaInfraType, RPCClientError> {
|
||||
}
|
||||
export const initialState: State = metaInfraTypeEntityAdapter.getInitialState({
|
||||
});
|
||||
|
||||
export function getSelectors(selector: Selector<any, State>) {
|
||||
return {
|
||||
...metaInfraTypeEntityAdapter.getSelectors(selector),
|
||||
};
|
||||
}
|
4
@overflow/meta/store/entity/meta-infra-vendor/index.ts
Normal file
4
@overflow/meta/store/entity/meta-infra-vendor/index.ts
Normal file
|
@ -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';
|
|
@ -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
|
||||
;
|
|
@ -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)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<MetaInfraVendor, RPCClientError>();
|
||||
export interface State extends EntityState<MetaInfraVendor, RPCClientError> {
|
||||
}
|
||||
export const initialState: State = metaCrawlerEntityAdapter.getInitialState({
|
||||
});
|
||||
|
||||
export function getSelectors(selector: Selector<any, State>) {
|
||||
return {
|
||||
...metaCrawlerEntityAdapter.getSelectors(selector),
|
||||
};
|
||||
}
|
4
@overflow/meta/store/entity/meta-input-type/index.ts
Normal file
4
@overflow/meta/store/entity/meta-input-type/index.ts
Normal file
|
@ -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';
|
|
@ -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
|
||||
;
|
|
@ -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)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<MetaInputType, RPCClientError>();
|
||||
export interface State extends EntityState<MetaInputType, RPCClientError> {
|
||||
}
|
||||
export const initialState: State = metaInputTypeEntityAdapter.getInitialState({
|
||||
});
|
||||
|
||||
export function getSelectors(selector: Selector<any, State>) {
|
||||
return {
|
||||
...metaInputTypeEntityAdapter.getSelectors(selector),
|
||||
};
|
||||
}
|
4
@overflow/meta/store/entity/meta-member-status/index.ts
Normal file
4
@overflow/meta/store/entity/meta-member-status/index.ts
Normal file
|
@ -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';
|
|
@ -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
|
||||
;
|
|
@ -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)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<MetaMemberStatus, RPCClientError>();
|
||||
export interface State extends EntityState<MetaMemberStatus, RPCClientError> {
|
||||
}
|
||||
export const initialState: State = metaMemberStatusEntityAdapter.getInitialState({
|
||||
});
|
||||
|
||||
export function getSelectors(selector: Selector<any, State>) {
|
||||
return {
|
||||
...metaMemberStatusEntityAdapter.getSelectors(selector),
|
||||
};
|
||||
}
|
|
@ -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';
|
|
@ -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
|
||||
;
|
|
@ -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)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<MetaNoAuthProbeStatus, RPCClientError>();
|
||||
export interface State extends EntityState<MetaNoAuthProbeStatus, RPCClientError> {
|
||||
}
|
||||
export const initialState: State = metaNoAuthProbeStatusEntityAdapter.getInitialState({
|
||||
});
|
||||
|
||||
export function getSelectors(selector: Selector<any, State>) {
|
||||
return {
|
||||
...metaNoAuthProbeStatusEntityAdapter.getSelectors(selector),
|
||||
};
|
||||
}
|
|
@ -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';
|
|
@ -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
|
||||
;
|
|
@ -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)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<MetaProbeArchitecture, RPCClientError>();
|
||||
export interface State extends EntityState<MetaProbeArchitecture, RPCClientError> {
|
||||
}
|
||||
export const initialState: State = metaProbeArchitectureEntityAdapter.getInitialState({
|
||||
});
|
||||
|
||||
export function getSelectors(selector: Selector<any, State>) {
|
||||
return {
|
||||
...metaProbeArchitectureEntityAdapter.getSelectors(selector),
|
||||
};
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user