diff --git a/@overflow/infra/component/map/map.component.ts b/@overflow/infra/component/map/map.component.ts index 12a199b..555696a 100644 --- a/@overflow/infra/component/map/map.component.ts +++ b/@overflow/infra/component/map/map.component.ts @@ -12,7 +12,7 @@ import { ListSelector } from '../../store'; import { Target } from '@overflow/commons-typescript/model/target'; import { Infra, InfraHost, InfraService } from '@overflow/commons-typescript/model/infra'; import { Domain, DomainMember } from '@overflow/commons-typescript/model/domain'; -import { AuthContainerSelector } from '@overflow/shared/auth/store'; +import { AuthSelector } from '@overflow/shared/auth/store'; // import { sensorListSelector } from '@overflow/sensor/store'; @@ -66,7 +66,7 @@ export class MapComponent implements OnInit, AfterContentInit { ngAfterContentInit() { - this.listStore.select(AuthContainerSelector.selectDomainMember).subscribe( + this.listStore.select(AuthSelector.selectDomainMember).subscribe( (domainMember: DomainMember) => { // const pageParams: PageParams = { diff --git a/@overflow/member/component/member-profile.component.ts b/@overflow/member/component/member-profile.component.ts index 356666d..8a9da1e 100644 --- a/@overflow/member/component/member-profile.component.ts +++ b/@overflow/member/component/member-profile.component.ts @@ -4,10 +4,10 @@ import { AbstractControl, FormBuilder, FormGroup, Validators} from '@angular/for import { DomainMember } from '@overflow/commons-typescript/model/domain'; import { Observable, of } from 'rxjs'; import { Store } from '@ngrx/store'; -import { AuthContainerSelector } from '@overflow/shared/auth/store'; +import { AuthSelector } from '@overflow/shared/auth/store'; +import * as AuthStore from '@overflow/shared/auth/store/auth'; import { catchError, map, tap } from 'rxjs/operators'; import { MemberService } from '../service/member.service'; -import * as MemberEntityStore from '../store/entity/member'; @Component({ selector: 'of-member-profile', @@ -33,7 +33,7 @@ export class MemberProfileComponent implements OnInit, OnDestroy { } ngOnInit() { - this.store.select(AuthContainerSelector.selectDomainMember).subscribe( + this.store.select(AuthSelector.selectDomainMember).subscribe( (domainMember: DomainMember) => { this.domainMember = domainMember; } @@ -89,7 +89,7 @@ export class MemberProfileComponent implements OnInit, OnDestroy { this.pending$ = of(true); }), map((rmember: Member) => { - this.store.dispatch(new MemberEntityStore.ModifySuccess(rmember)); + this.store.dispatch(new AuthStore.ModifySuccess(rmember)); }), catchError(err => { this.error$ = of(err); diff --git a/@overflow/member/container/index.ts b/@overflow/member/container/index.ts deleted file mode 100644 index c95153a..0000000 --- a/@overflow/member/container/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { MemberSigninContainerComponent } from './member-signin-container.component'; -import { MemberTotpContainerComponent } from './member-totp-container.component'; - -export const CONTAINERS = [ - MemberSigninContainerComponent, - MemberTotpContainerComponent, -]; diff --git a/@overflow/member/container/member-signin-container.component.html b/@overflow/member/container/member-signin-container.component.html deleted file mode 100644 index ebdeef9..0000000 --- a/@overflow/member/container/member-signin-container.component.html +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/@overflow/member/container/member-signin-container.component.spec.ts b/@overflow/member/container/member-signin-container.component.spec.ts deleted file mode 100644 index 2c21f31..0000000 --- a/@overflow/member/container/member-signin-container.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MemberSigninContainerComponent } from './member-signin-container.component'; - -describe('MemberSigninContainerComponent', () => { - let component: MemberSigninContainerComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ MemberSigninContainerComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(MemberSigninContainerComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/@overflow/member/container/member-signin-container.component.ts b/@overflow/member/container/member-signin-container.component.ts deleted file mode 100644 index 96f2cc2..0000000 --- a/@overflow/member/container/member-signin-container.component.ts +++ /dev/null @@ -1,46 +0,0 @@ -import {Component, OnInit, Input, Output, EventEmitter} from '@angular/core'; -import { Store, select } from '@ngrx/store'; -import { Observable } from 'rxjs'; - -import { MemberSigninContainerSelector } from '../store'; - -import * as MemberEntityStore from '../store/entity/member'; -import { Member } from '@overflow/commons-typescript/model/member'; - -@Component({ - selector: 'of-member-signin-container', - templateUrl: './member-signin-container.component.html', -}) -export class MemberSigninContainerComponent implements OnInit { - @Input() returnURL: string; - - @Output() resetPassword = new EventEmitter(); - @Output() signup = new EventEmitter(); - - member$: Observable; - pending$: Observable; - error$: Observable; - - constructor( - private store: Store, - ) { - } - - ngOnInit() { - this.member$ = this.store.pipe(select(MemberSigninContainerSelector.selectMember)); - this.pending$ = this.store.pipe(select(MemberSigninContainerSelector.selectPending)); - this.error$ = this.store.pipe(select(MemberSigninContainerSelector.selectError)); - } - - onSignin(info: {email: string, password: string}) { - this.store.dispatch(new MemberEntityStore.Signin({...info, returnURL: this.returnURL})); - } - - onSignup() { - this.signup.emit(); - } - - onResetPassword() { - this.resetPassword.emit(); - } -} diff --git a/@overflow/member/container/member-totp-container.component.html b/@overflow/member/container/member-totp-container.component.html deleted file mode 100644 index 99b7d0b..0000000 --- a/@overflow/member/container/member-totp-container.component.html +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/@overflow/member/container/member-totp-container.component.spec.ts b/@overflow/member/container/member-totp-container.component.spec.ts deleted file mode 100644 index aa7bc4f..0000000 --- a/@overflow/member/container/member-totp-container.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MemberTotpContainerComponent } from './totp.component'; - -describe('TotpComponent', () => { - let component: MemberTotpContainerComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ MemberTotpContainerComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(MemberTotpContainerComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/@overflow/member/container/member-totp-container.component.ts b/@overflow/member/container/member-totp-container.component.ts deleted file mode 100644 index 68b60e3..0000000 --- a/@overflow/member/container/member-totp-container.component.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Store } from '@ngrx/store'; - -import { Member, MemberTotp } from '@overflow/commons-typescript/model/member'; -import { Observable } from 'rxjs'; -import { DomainMember } from '@overflow/commons-typescript/model/domain'; - -import * as TotpEntityStore from '../store/entity/member-totp'; -import { AuthContainerSelector } from '@overflow/shared/auth/store'; - -@Component({ - selector: 'of-member-totp-container', - templateUrl: './member-totp-container.component.html', -}) -export class MemberTotpContainerComponent implements OnInit { - domainMember$: Observable; - totp$: Observable; - lists = []; - - constructor( - private activatedRoute: ActivatedRoute, - private router: Router, - private store: Store, - ) { } - - ngOnInit() { - this.domainMember$ = this.store.select(AuthContainerSelector.selectDomainMember); - } - - regist(info: {member: Member, code: string, secretCode: string}) { - const secretCode = 'X6AWAK573M5372NM'; - - this.store.dispatch(new TotpEntityStore.Regist(info)); - } - - create(member: Member) { - this.store.dispatch(new TotpEntityStore.CreateTotp(member)); - } -} diff --git a/@overflow/member/member-store.module.ts b/@overflow/member/member-store.module.ts deleted file mode 100644 index 31cd1f3..0000000 --- a/@overflow/member/member-store.module.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { NgModule } from '@angular/core'; -import { StoreModule } from '@ngrx/store'; -import { EffectsModule } from '@ngrx/effects'; - -import { - REDUCERS, - EFFECTS, -} from './store'; - -import { MODULE } from './member.constant'; - -@NgModule({ - imports: [ - StoreModule.forFeature(MODULE.name, REDUCERS), - EffectsModule.forFeature(EFFECTS), - ], -}) -export class MemberStoreModule { } diff --git a/@overflow/member/member.module.ts b/@overflow/member/member.module.ts index 9b80c74..98b6a94 100644 --- a/@overflow/member/member.module.ts +++ b/@overflow/member/member.module.ts @@ -2,11 +2,9 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterModule } from '@angular/router'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MemberStoreModule } from './member-store.module'; import { MemberRESTModule } from './member-rest.module'; import { COMPONENTS } from './component'; -import { CONTAINERS } from './container'; import { SERVICES } from './service'; import { UIModule } from '@overflow/shared/ui/ui.module'; import { QRCodeModule } from 'angularx-qrcode'; @@ -18,7 +16,6 @@ import { RecaptchaModule } from 'angular-google-recaptcha'; RouterModule, FormsModule, ReactiveFormsModule, - MemberStoreModule, MemberRESTModule, UIModule, QRCodeModule, @@ -28,11 +25,9 @@ import { RecaptchaModule } from 'angular-google-recaptcha'; ], declarations: [ COMPONENTS, - CONTAINERS, ], exports: [ COMPONENTS, - CONTAINERS, ], providers: [ SERVICES, diff --git a/@overflow/member/store/container/modify/index.ts b/@overflow/member/store/container/modify/index.ts deleted file mode 100644 index 89ba010..0000000 --- a/@overflow/member/store/container/modify/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './member-modify.reducer'; -export * from './member-modify.state'; - diff --git a/@overflow/member/store/container/modify/member-modify.reducer.ts b/@overflow/member/store/container/modify/member-modify.reducer.ts deleted file mode 100644 index 5127632..0000000 --- a/@overflow/member/store/container/modify/member-modify.reducer.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { - Actions, - ActionType, -} from '../../entity/member/member.action'; - -import { - State, - initialState, -} from './member-modify.state'; - -export function reducer(state = initialState, action: Actions): State { - switch (action.type) { - case ActionType.Modify: { - return { - pending: true, - error: null, - }; - } - - case ActionType.ModifySuccess: { - return { - pending: false, - error: null, - }; - } - - case ActionType.ModifyFailure: { - return { - pending: false, - error: action.payload, - }; - } - - default: { - return state; - } - } -} diff --git a/@overflow/member/store/container/modify/member-modify.state.ts b/@overflow/member/store/container/modify/member-modify.state.ts deleted file mode 100644 index 7f8f259..0000000 --- a/@overflow/member/store/container/modify/member-modify.state.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Selector, createSelector } from '@ngrx/store'; - -import { RESTClientError } from '@loafer/ng-rest'; - -import { Member } from '@overflow/commons-typescript/model/member'; - -export interface State { - pending: boolean; - error: RESTClientError; -} - -export const initialState: State = { - pending: false, - error: null, -}; - - -export function getSelectors(selector: Selector) { - return { - selectPending: createSelector(selector, (state: State) => state.pending), - selectError: createSelector(selector, (state: State) => state.error), - }; -} diff --git a/@overflow/member/store/container/signin/index.ts b/@overflow/member/store/container/signin/index.ts deleted file mode 100644 index 8f0b4e6..0000000 --- a/@overflow/member/store/container/signin/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './member-signin.reducer'; -export * from './member-signin.state'; diff --git a/@overflow/member/store/container/signin/member-signin.reducer.ts b/@overflow/member/store/container/signin/member-signin.reducer.ts deleted file mode 100644 index 4893265..0000000 --- a/@overflow/member/store/container/signin/member-signin.reducer.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { - Actions as MemberActions, - ActionType as MemberActionType, -} from '../../entity/member/member.action'; - -import { - State, - initialState, -} from './member-signin.state'; - - -import { - Actions as AuthActions, - ActionType as AuthActionType, -} from '@overflow/shared/auth/store/container/auth'; - -export function reducer(state: State = initialState, action: MemberActions | AuthActions): State { - switch (action.type) { - case MemberActionType.Signin: { - return { - member: null, - pending: true, - error: null, - }; - } - - case AuthActionType.SigninSuccess: { - return { - member: action.payload.domainMember.member, - pending: false, - error: null, - }; - } - - case AuthActionType.SigninFailure: { - return { - member: null, - pending: false, - error: action.payload, - }; - } - - default: { - return state; - } - } -} diff --git a/@overflow/member/store/container/signin/member-signin.state.ts b/@overflow/member/store/container/signin/member-signin.state.ts deleted file mode 100644 index 4af3d3b..0000000 --- a/@overflow/member/store/container/signin/member-signin.state.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Selector, createSelector } from '@ngrx/store'; - -import { RESTClientError } from '@loafer/ng-rest'; -import { Member } from '@overflow/commons-typescript/model/member'; - -export interface State { - member: Member; - pending: boolean; - error: RESTClientError; -} - -export const initialState: State = { - member: null, - pending: false, - error: null, -}; - -export function getSelectors(selector: Selector) { - return { - selectMember: createSelector(selector, (state: State) => state.member), - selectPending: createSelector(selector, (state: State) => state.pending), - selectError: createSelector(selector, (state: State) => state.error), - }; -} diff --git a/@overflow/member/store/container/signout/index.ts b/@overflow/member/store/container/signout/index.ts deleted file mode 100644 index 855a01f..0000000 --- a/@overflow/member/store/container/signout/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './member-signout.reducer'; -export * from './member-signout.state'; diff --git a/@overflow/member/store/container/signout/member-signout.reducer.ts b/@overflow/member/store/container/signout/member-signout.reducer.ts deleted file mode 100644 index df5cdb3..0000000 --- a/@overflow/member/store/container/signout/member-signout.reducer.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { - Actions as MemberActions, - ActionType as MemberActionType, -} from '../../entity/member/member.action'; - -import { - State, - initialState, -} from './member-signout.state'; - -import { - Actions as AuthActions, - ActionType as AuthActionType, -} from '@overflow/shared/auth/store/container/auth'; - - -export function reducer(state = initialState, action: MemberActions | AuthActions): State { - switch (action.type) { - case MemberActionType.Signout: { - return { - pending: true, - error: null, - }; - } - - case AuthActionType.SignoutSuccess: { - return { - pending: false, - error: null, - }; - } - - case AuthActionType.SignoutFailure: { - return { - pending: false, - error: null, - }; - } - - default: { - return state; - } - } -} diff --git a/@overflow/member/store/container/signout/member-signout.state.ts b/@overflow/member/store/container/signout/member-signout.state.ts deleted file mode 100644 index 39f65af..0000000 --- a/@overflow/member/store/container/signout/member-signout.state.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Selector, createSelector } from '@ngrx/store'; - -import { RESTClientError } from '@loafer/ng-rest'; - -export interface State { - pending: boolean; - error: RESTClientError; -} - -export const initialState: State = { - pending: false, - error: null, -}; - -export function getSelectors(selector: Selector) { - return { - selectPending: createSelector(selector, (state: State) => state.pending), - selectError: createSelector(selector, (state: State) => state.error), - }; -} diff --git a/@overflow/member/store/container/totp/index.ts b/@overflow/member/store/container/totp/index.ts deleted file mode 100644 index a69f856..0000000 --- a/@overflow/member/store/container/totp/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './member-totp.reducer'; -export * from './member-totp.state'; - diff --git a/@overflow/member/store/container/totp/member-totp.reducer.ts b/@overflow/member/store/container/totp/member-totp.reducer.ts deleted file mode 100644 index 7df832b..0000000 --- a/@overflow/member/store/container/totp/member-totp.reducer.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { - Actions, - ActionType, -} from '../../entity/member-totp/member-totp.action'; - -import { - State, - initialState, -} from './member-totp.state'; - -export function reducer(state = initialState, action: Actions): State { - switch (action.type) { - case ActionType.CreateTotp: { - return { - secretKey: null, - sourceURI: null, - pending: true, - error: null, - }; - } - - case ActionType.CreateTotpSuccess: { - return { - secretKey: action.payload.key, - sourceURI: action.payload.uri, - pending: false, - error: null, - }; - } - - case ActionType.CreateTotpFailure: { - return { - secretKey: null, - sourceURI: null, - pending: false, - error: action.payload, - }; - } - - case ActionType.Regist: { - return { - secretKey: null, - sourceURI: null, - pending: true, - error: null, - }; - } - - case ActionType.RegistSuccess: { - return { - secretKey: null, - sourceURI: null, - pending: true, - error: null, - }; - } - - case ActionType.RegistFailure: { - return { - secretKey: null, - sourceURI: null, - pending: true, - error: action.payload, - }; - } - - case ActionType.CheckCodeForMember: { - return { - secretKey: null, - sourceURI: null, - pending: true, - error: null, - }; - } - - case ActionType.CheckCodeForMemberSuccess: { - return { - secretKey: null, - sourceURI: null, - pending: true, - error: null, - }; - } - - case ActionType.CheckCodeForMemberFailure: { - return { - secretKey: null, - sourceURI: null, - pending: true, - error: action.payload, - }; - } - default: { - return state; - } - } -} diff --git a/@overflow/member/store/container/totp/member-totp.state.ts b/@overflow/member/store/container/totp/member-totp.state.ts deleted file mode 100644 index 402b18e..0000000 --- a/@overflow/member/store/container/totp/member-totp.state.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Selector, createSelector } from '@ngrx/store'; -import { RPCClientError } from '@loafer/ng-rpc'; - -export interface State { - secretKey: string; - sourceURI: string; - pending: boolean; - error: RPCClientError; -} - -export const initialState: State = { - secretKey: null, - sourceURI: null, - pending: false, - error: null, -}; - -export function getSelectors(selector: Selector) { - return { - selectSecretKey: createSelector(selector, (state: State) => state.secretKey), - selectSourceURI: createSelector(selector, (state: State) => state.sourceURI), - selectPending: createSelector(selector, (state: State) => state.pending), - selectError: createSelector(selector, (state: State) => state.error), - }; -} diff --git a/@overflow/member/store/entity/member-totp/index.ts b/@overflow/member/store/entity/member-totp/index.ts deleted file mode 100644 index b027745..0000000 --- a/@overflow/member/store/entity/member-totp/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './member-totp.action'; -export * from './member-totp.effect'; diff --git a/@overflow/member/store/entity/member-totp/member-totp.action.ts b/@overflow/member/store/entity/member-totp/member-totp.action.ts deleted file mode 100644 index 9d0a888..0000000 --- a/@overflow/member/store/entity/member-totp/member-totp.action.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { Action } from '@ngrx/store'; - -import { RPCClientError } from '@loafer/ng-rpc'; - -import { Member } from '@overflow/commons-typescript/model/member'; - -export enum ActionType { - CreateTotp = '[member.member-totp] CreateTotp', - CreateTotpSuccess = '[member.member-totp] CreateTotpSuccess', - CreateTotpFailure = '[member.member-totp] CreateTotpFailure', - - Regist = '[member.member-totp] Regist', - RegistSuccess = '[member.member-totp] RegistSuccess', - RegistFailure = '[member.member-totp] RegistFailure', - - CheckCodeForMember = '[member.member-totp] CheckCodeForMember', - CheckCodeForMemberSuccess = '[member.member-totp] CheckCodeForMemberSuccess', - CheckCodeForMemberFailure = '[member.member-totp] CheckCodeForMemberFailure', -} - -export class CreateTotp implements Action { - readonly type = ActionType.CreateTotp; - - constructor(public payload: Member) {} -} - -export class CreateTotpSuccess implements Action { - readonly type = ActionType.CreateTotpSuccess; - - constructor(public payload: {key: string, uri: string}) {} -} - -export class CreateTotpFailure implements Action { - readonly type = ActionType.CreateTotpFailure; - - constructor(public payload: RPCClientError) {} -} - -// ---------------------------------------------------------------------------------------- - -export class Regist implements Action { - readonly type = ActionType.Regist; - - constructor(public payload: {member: Member, secretCode: string, code: string}) {} -} - -export class RegistSuccess implements Action { - readonly type = ActionType.RegistSuccess; -} - -export class RegistFailure implements Action { - readonly type = ActionType.RegistFailure; - - constructor(public payload: RPCClientError) {} -} - -// ---------------------------------------------------------------------------------------- - -export class CheckCodeForMember implements Action { - readonly type = ActionType.CheckCodeForMember; - - constructor(public payload: {member: Member, code: string}) {} -} - -export class CheckCodeForMemberSuccess implements Action { - readonly type = ActionType.CheckCodeForMemberSuccess; - - constructor(public payload: boolean) {} -} - -export class CheckCodeForMemberFailure implements Action { - readonly type = ActionType.CheckCodeForMemberFailure; - - constructor(public payload: RPCClientError) {} -} - -export type Actions = - | CreateTotp - | CreateTotpSuccess - | CreateTotpFailure - | Regist - | RegistSuccess - | RegistFailure - | CheckCodeForMember - | CheckCodeForMemberSuccess - | CheckCodeForMemberFailure - ; diff --git a/@overflow/member/store/entity/member-totp/member-totp.effect.spec.ts b/@overflow/member/store/entity/member-totp/member-totp.effect.spec.ts deleted file mode 100644 index a38e97f..0000000 --- a/@overflow/member/store/entity/member-totp/member-totp.effect.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { TestBed, inject } from '@angular/core/testing'; - -import { Effects } from './member-totp.effect'; - -describe('member-totp.Effects', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [Effects] - }); - }); - - it('should be created', inject([Effects], (effects: Effects) => { - expect(effects).toBeTruthy(); - })); -}); diff --git a/@overflow/member/store/entity/member-totp/member-totp.effect.ts b/@overflow/member/store/entity/member-totp/member-totp.effect.ts deleted file mode 100644 index d14445b..0000000 --- a/@overflow/member/store/entity/member-totp/member-totp.effect.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { Injectable } from '@angular/core'; - -import { Effect, Actions, ofType } from '@ngrx/effects'; -import { of } from 'rxjs/observable/of'; -import { catchError, exhaustMap, map } from 'rxjs/operators'; - -import { MemberTotpService } from '../../../service/member-totp.service'; - -import { - CreateTotp, - CreateTotpSuccess, - CreateTotpFailure, - - Regist, - RegistSuccess, - RegistFailure, - - CheckCodeForMember, - CheckCodeForMemberSuccess, - CheckCodeForMemberFailure, - - ActionType, -} from './member-totp.action'; -import {Member} from '@overflow/commons-typescript/model/member'; - -@Injectable() -export class Effects { - - constructor( - private actions$: Actions, - private memberTotpService: MemberTotpService, - ) { } - - @Effect() - createTotp$ = this.actions$.pipe( - ofType(ActionType.CreateTotp), - map(( action: CreateTotp ) => action.payload), - exhaustMap(( member: Member ) => - this.memberTotpService - .createTotp(member) - .pipe( - map((result: any) => { - return new CreateTotpSuccess({ key: result.secretKey, uri: result.sourceURI}); - }), - catchError(error => of(new CreateTotpFailure(error))) - ) - ) - ); - - @Effect() - regist$ = this.actions$.pipe( - ofType(ActionType.Regist), - map(( action: Regist ) => action.payload), - exhaustMap(( totpInfo: { member: Member, secretCode: string, code: string } ) => - this.memberTotpService - .regist(totpInfo.member, totpInfo.secretCode, totpInfo.code) - .pipe( - map(() => { - return new RegistSuccess(); - }), - catchError(error => of(new RegistFailure(error))) - ) - ) - ); - - @Effect() - checkCodeForMember$ = this.actions$.pipe( - ofType(ActionType.CheckCodeForMember), - map(( action: CheckCodeForMember ) => action.payload), - exhaustMap(( totpInfo: { member: Member, code: string } ) => - this.memberTotpService - .checkCodeForMember(totpInfo.member, totpInfo.code) - .pipe( - map((result: boolean) => { - return new CheckCodeForMemberSuccess(result); - }), - catchError(error => of(new CheckCodeForMemberFailure(error))) - ) - ) - ); -} diff --git a/@overflow/member/store/entity/member/index.ts b/@overflow/member/store/entity/member/index.ts deleted file mode 100644 index d9e4d73..0000000 --- a/@overflow/member/store/entity/member/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './member.action'; -export * from './member.effect'; - diff --git a/@overflow/member/store/entity/member/member.action.ts b/@overflow/member/store/entity/member/member.action.ts deleted file mode 100644 index 4a263b6..0000000 --- a/@overflow/member/store/entity/member/member.action.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Action } from '@ngrx/store'; -import { RESTClientError } from '@loafer/ng-rest'; -import { Member } from '@overflow/commons-typescript/model/member'; -import {EmailAuth} from '@overflow/commons-typescript/model/email/EmailAuth'; - -export enum ActionType { - Signin = '[member.member] Signin', - Signout = '[member.member] Signout', - - Modify = '[member.member] Modify', - ModifySuccess = '[member.member] ModifySuccess', - ModifyFailure = '[member.member] ModifyFailure', -} - -export class Signin implements Action { - readonly type = ActionType.Signin; - - constructor(public payload: { email: string, password: string, returnURL: string }) { } -} - -export class Signout implements Action { - readonly type = ActionType.Signout; -} - -export class Modify implements Action { - readonly type = ActionType.Modify; - - constructor(public payload: Member ) {} -} - -export class ModifySuccess implements Action { - readonly type = ActionType.ModifySuccess; - - constructor(public payload: Member) {} -} - -export class ModifyFailure implements Action { - readonly type = ActionType.ModifyFailure; - - constructor(public payload: RESTClientError) {} -} - -export type Actions = - | Signin - | Signout - | Modify - | ModifySuccess - | ModifyFailure - ; diff --git a/@overflow/member/store/entity/member/member.effect.spec.ts b/@overflow/member/store/entity/member/member.effect.spec.ts deleted file mode 100644 index 40fb94b..0000000 --- a/@overflow/member/store/entity/member/member.effect.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { TestBed, inject } from '@angular/core/testing'; - -import { Effects } from './member.effect'; - -describe('member-entity.Effects', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [Effects] - }); - }); - - it('should be created', inject([Effects], (effects: Effects) => { - expect(effects).toBeTruthy(); - })); -}); diff --git a/@overflow/member/store/entity/member/member.effect.ts b/@overflow/member/store/entity/member/member.effect.ts deleted file mode 100644 index 2e47f3f..0000000 --- a/@overflow/member/store/entity/member/member.effect.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Router } from '@angular/router'; - -import { Effect, Actions, ofType } from '@ngrx/effects'; -import { of } from 'rxjs'; -import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; - -import { Member } from '@overflow/commons-typescript/model/member'; -import { MemberService } from '../../../service/member.service'; - -import { - Signin, - Modify, - ModifySuccess, - ModifyFailure, - ActionType, -} from './member.action'; - -import { - SigninSuccess, - SigninFailure, - SigninCookieSuccess, - SigninCookieFailure, -} from '@overflow/shared/auth/store/container/auth'; -import { DomainMember } from '@overflow/commons-typescript/model/domain'; -import { EmailAuthService } from '../../../service/email-auth.service'; -import {EmailAuth} from '@overflow/commons-typescript/model/email/EmailAuth'; - - -@Injectable() -export class Effects { - - constructor( - private actions$: Actions, - private memberService: MemberService, - private emailAuthService: EmailAuthService, - private router: Router - ) { } - - @Effect() - signin$ = this.actions$.pipe( - ofType(ActionType.Signin), - map((action: Signin) => action.payload), - exhaustMap((signinInfo: { email: string, password: string, returnURL: string }) => - this.memberService - .signin(signinInfo.email, signinInfo.password) - .pipe( - map((result: { authToken: string, domainMember: DomainMember }) => { - return new SigninSuccess({ authToken: result.authToken, domainMember: result.domainMember, returnURL: signinInfo.returnURL }); - }), - catchError(error => of(new SigninFailure(error))) - ) - ) - ); - - @Effect() - modify$ = this.actions$.pipe( - ofType(ActionType.Modify), - map((action: Modify) => action.payload), - exhaustMap((member: Member) => - this.memberService - .modify(member) - .pipe( - map((newMember: Member) => { - return new ModifySuccess(newMember); - }), - catchError(error => of(new ModifyFailure(error))) - ) - ) - ); -} diff --git a/@overflow/member/store/index.ts b/@overflow/member/store/index.ts deleted file mode 100644 index 710b681..0000000 --- a/@overflow/member/store/index.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { - createSelector, - createFeatureSelector, -} from '@ngrx/store'; - -import { MODULE } from '../member.constant'; - -import * as MemberEntityStore from './entity/member'; -import * as MemberTOTPEntityStore from './entity/member-totp'; - -import * as MemberSigninContainerStore from './container/signin'; -import * as MemberModifyContainerStore from './container/modify'; -import * as MemberSignoutContainerStore from './container/signout'; - - -export interface State { - member_signin_container: MemberSigninContainerStore.State; - member_modify_container: MemberModifyContainerStore.State; - member_signout_container: MemberSignoutContainerStore.State; -} - -export const REDUCERS = { - member_signin_container: MemberSigninContainerStore.reducer, - member_modify_container: MemberModifyContainerStore.reducer, - member_signout_container: MemberSignoutContainerStore.reducer, -}; - -export const EFFECTS = [ - MemberEntityStore.Effects, - MemberTOTPEntityStore.Effects, -]; - -export const selectState = createFeatureSelector(MODULE.name); - -export const MemberSigninContainerSelector = MemberSigninContainerStore.getSelectors(createSelector( - selectState, - (state: State) => state.member_signin_container -)); - -export const MemberModifyContainerSelector = MemberModifyContainerStore.getSelectors(createSelector( - selectState, - (state: State) => state.member_modify_container -)); - -export const MemberSignoutContainerSelector = MemberSignoutContainerStore.getSelectors(createSelector( - selectState, - (state: State) => state.member_signout_container -)); diff --git a/@overflow/meta/meta-store.module.ts b/@overflow/meta/meta-store.module.ts deleted file mode 100644 index fc47af5..0000000 --- a/@overflow/meta/meta-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 './meta.constant'; - -@NgModule({ - imports: [ - StoreModule.forFeature(MODULE.name, REDUCERS), - EffectsModule.forFeature(EFFECTS), - ], -}) -export class MetaStoreModule { } diff --git a/@overflow/meta/meta.module.ts b/@overflow/meta/meta.module.ts index 9cf95ea..92ca13b 100644 --- a/@overflow/meta/meta.module.ts +++ b/@overflow/meta/meta.module.ts @@ -6,13 +6,10 @@ import { UIModule } from '@overflow/shared/ui/ui.module'; import { COMPONENTS } from './component'; import { SERVICES } from './service'; -import { MetaStoreModule } from './meta-store.module'; - @NgModule({ imports: [ CommonModule, UIModule, - MetaStoreModule, ], declarations: [ COMPONENTS, diff --git a/@overflow/meta/store/entity/meta-crawler-input-item/index.ts b/@overflow/meta/store/entity/meta-crawler-input-item/index.ts deleted file mode 100644 index 4a60349..0000000 --- a/@overflow/meta/store/entity/meta-crawler-input-item/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 89f9044..0000000 --- a/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.action.ts +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index c458427..0000000 --- a/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.effect.ts +++ /dev/null @@ -1,40 +0,0 @@ -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 { MetaCrawler, MetaCrawlerInputItem } from '@overflow/commons-typescript/model/meta'; - -import { MetaCrawlerInputItemService } from '../../../service/meta-crawler-input-item.service'; - -import { - ReadAllByMetaCrawler, - ReadAllByMetaCrawlerSuccess, - ReadAllByMetaCrawlerFailure, - ActionType, -} from './meta-crawler-input-item.action'; - -@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 deleted file mode 100644 index 67e58e6..0000000 --- a/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.reducer.ts +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 5e7c8fb..0000000 --- a/@overflow/meta/store/entity/meta-crawler-input-item/meta-crawler-input-item.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 9790c46..0000000 --- a/@overflow/meta/store/entity/meta-crawler/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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/store/entity/meta-crawler/meta-crawler.action.ts b/@overflow/meta/store/entity/meta-crawler/meta-crawler.action.ts deleted file mode 100644 index c3827e4..0000000 --- a/@overflow/meta/store/entity/meta-crawler/meta-crawler.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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.meta-crawler] ReadAll', - ReadAllSuccess = '[meta.meta-crawler] ReadAllSuccess', - ReadAllFailure = '[meta.meta-crawler] ReadAllFailure', -} - -export class ReadAll implements Action { - readonly type = ActionType.ReadAll; -} - -export class ReadAllSuccess implements Action { - readonly type = ActionType.ReadAllSuccess; - - constructor(public payload: MetaCrawler[]) {} -} - -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-crawler/meta-crawler.effect.ts b/@overflow/meta/store/entity/meta-crawler/meta-crawler.effect.ts deleted file mode 100644 index a5dc398..0000000 --- a/@overflow/meta/store/entity/meta-crawler/meta-crawler.effect.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Injectable } from '@angular/core'; -import { of } from 'rxjs'; -import { Effect, Actions, ofType } from '@ngrx/effects'; -import { catchError, exhaustMap, map, tap } 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 metaCrawlerService: MetaCrawlerService, - ) { } - - @Effect() - readAll$ = this.actions$.pipe( - ofType(ActionType.ReadAll), - exhaustMap(() => - 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 deleted file mode 100644 index 355eacd..0000000 --- a/@overflow/meta/store/entity/meta-crawler/meta-crawler.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 1e76af3..0000000 --- a/@overflow/meta/store/entity/meta-crawler/meta-crawler.state.ts +++ /dev/null @@ -1,20 +0,0 @@ -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 { - pending: boolean; -} -export const initialState: State = metaCrawlerEntityAdapter.getInitialState({ - pending: false, -}); - -export function getSelectors(selector: Selector) { - return { - ...metaCrawlerEntityAdapter.getSelectors(selector), - selectPending: createSelector(selector, (state: State) => state.pending), - }; -} diff --git a/@overflow/meta/store/entity/meta-history-type/index.ts b/@overflow/meta/store/entity/meta-history-type/index.ts deleted file mode 100644 index 3c85ad6..0000000 --- a/@overflow/meta/store/entity/meta-history-type/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 56a53e7..0000000 --- a/@overflow/meta/store/entity/meta-history-type/meta-history-type.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 902dcbb..0000000 --- a/@overflow/meta/store/entity/meta-history-type/meta-history-type.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaHistoryType } from '@overflow/commons-typescript/model/meta'; - -import { MetaHistoryTypeService } from '../../../service/meta-history-type.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-history-type.action'; - -@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 deleted file mode 100644 index 6fec85e..0000000 --- a/@overflow/meta/store/entity/meta-history-type/meta-history-type.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 084d12f..0000000 --- a/@overflow/meta/store/entity/meta-history-type/meta-history-type.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 39a836e..0000000 --- a/@overflow/meta/store/entity/meta-infra-type/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 92cba2d..0000000 --- a/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index b68e46f..0000000 --- a/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaInfraType } from '@overflow/commons-typescript/model/meta'; - -import { MetaInfraTypeService } from '../../../service/meta-infra-type.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-infra-type.action'; - -@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 deleted file mode 100644 index a67d6ff..0000000 --- a/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 01a9fb1..0000000 --- a/@overflow/meta/store/entity/meta-infra-type/meta-infra-type.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 5d91614..0000000 --- a/@overflow/meta/store/entity/meta-infra-vendor/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 09dc14e..0000000 --- a/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.action.ts +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100644 index fb1a401..0000000 --- a/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.effect.ts +++ /dev/null @@ -1,40 +0,0 @@ -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 { MetaInfraVendor, MetaInfraType } from '@overflow/commons-typescript/model/meta'; - -import { MetaInfraVendorService } from '../../../service/meta-infra-vendor.service'; - -import { - ReadAllByMetaInfraType, - ReadAllByMetaInfraTypeSuccess, - ReadAllByMetaInfraTypeFailure, - ActionType, -} from './meta-infra-vendor.action'; - -@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 deleted file mode 100644 index ac54da2..0000000 --- a/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.reducer.ts +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index a77d729..0000000 --- a/@overflow/meta/store/entity/meta-infra-vendor/meta-infra-vendor.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 7bf0e60..0000000 --- a/@overflow/meta/store/entity/meta-input-type/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 90e4e5c..0000000 --- a/@overflow/meta/store/entity/meta-input-type/meta-input-type.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 403d3cc..0000000 --- a/@overflow/meta/store/entity/meta-input-type/meta-input-type.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaInputType } from '@overflow/commons-typescript/model/meta'; - -import { MetaInputTypeService } from '../../../service/meta-input-type.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-input-type.action'; - -@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 deleted file mode 100644 index 60e3629..0000000 --- a/@overflow/meta/store/entity/meta-input-type/meta-input-type.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 7b663d7..0000000 --- a/@overflow/meta/store/entity/meta-input-type/meta-input-type.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 1b056a7..0000000 --- a/@overflow/meta/store/entity/meta-member-status/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 72746bd..0000000 --- a/@overflow/meta/store/entity/meta-member-status/meta-member-status.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 67ab95d..0000000 --- a/@overflow/meta/store/entity/meta-member-status/meta-member-status.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaMemberStatus } from '@overflow/commons-typescript/model/meta'; - -import { MetaMemberStatusService } from '../../../service/meta-member-status.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-member-status.action'; - -@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 deleted file mode 100644 index 36c833a..0000000 --- a/@overflow/meta/store/entity/meta-member-status/meta-member-status.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 2c0b755..0000000 --- a/@overflow/meta/store/entity/meta-member-status/meta-member-status.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index db6c511..0000000 --- a/@overflow/meta/store/entity/meta-noauth-probe-status/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 88ab8cc..0000000 --- a/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index a65b64c..0000000 --- a/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaNoAuthProbeStatus } from '@overflow/commons-typescript/model/meta'; - -import { MetaNoAuthProbeStatusService } from '../../../service/meta-noauth-probe-status.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-noauth-probe-status.action'; - -@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 deleted file mode 100644 index 9b1cf07..0000000 --- a/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 8653eb0..0000000 --- a/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 9fabcd4..0000000 --- a/@overflow/meta/store/entity/meta-probe-architecture/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 9367f6e..0000000 --- a/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index f32a036..0000000 --- a/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaProbeArchitecture } from '@overflow/commons-typescript/model/meta'; - -import { MetaProbeArchitectureService } from '../../../service/meta-probe-architecture.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-probe-architecture.action'; - -@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 deleted file mode 100644 index d03b6c3..0000000 --- a/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index f8585a6..0000000 --- a/@overflow/meta/store/entity/meta-probe-architecture/meta-probe-architecture.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index b1c45ee..0000000 --- a/@overflow/meta/store/entity/meta-probe-os/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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/store/entity/meta-probe-os/meta-probe-os.action.ts b/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.action.ts deleted file mode 100644 index 1b5f6d0..0000000 --- a/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Action } from '@ngrx/store'; - -import { RPCClientError } from '@loafer/ng-rpc'; -import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; -import { MetaProbeOs } from '@overflow/commons-typescript/model/meta'; - -export enum ActionType { - 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; -} - -export class ReadAllSuccess implements Action { - readonly type = ActionType.ReadAllSuccess; - - constructor(public payload: MetaProbeOs[]) {} -} - -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-os/meta-probe-os.effect.ts b/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.effect.ts deleted file mode 100644 index e714a73..0000000 --- a/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaProbeOs } from '@overflow/commons-typescript/model/meta'; - -import { MetaProbeOsService } from '../../../service/meta-probe-os.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-probe-os.action'; - -@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 deleted file mode 100644 index 645a839..0000000 --- a/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 4114e9f..0000000 --- a/@overflow/meta/store/entity/meta-probe-os/meta-probe-os.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 0cdb09a..0000000 --- a/@overflow/meta/store/entity/meta-probe-package/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index d3a1e4e..0000000 --- a/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.action.ts +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index f89c687..0000000 --- a/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.effect.ts +++ /dev/null @@ -1,40 +0,0 @@ -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 { MetaProbePackage, MetaProbeOs } from '@overflow/commons-typescript/model/meta'; - -import { MetaProbePackageService } from '../../../service/meta-probe-package.service'; - -import { - ReadAllByOs, - ReadAllByOsSuccess, - ReadAllByOsFailure, - ActionType, -} from './meta-probe-package.action'; - -@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 deleted file mode 100644 index b5d1bcd..0000000 --- a/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.reducer.ts +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index b1163e8..0000000 --- a/@overflow/meta/store/entity/meta-probe-package/meta-probe-package.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 499e062..0000000 --- a/@overflow/meta/store/entity/meta-probe-status/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index e2c4a66..0000000 --- a/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 0577f1d..0000000 --- a/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaProbeStatus } from '@overflow/commons-typescript/model/meta'; - -import { MetaProbeStatusService } from '../../../service/meta-probe-status.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-probe-status.action'; - -@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 deleted file mode 100644 index 9da3fc3..0000000 --- a/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index e9795a4..0000000 --- a/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 1edceef..0000000 --- a/@overflow/meta/store/entity/meta-probe-task-type/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 3dad7cc..0000000 --- a/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 0fd5b1b..0000000 --- a/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaProbeTaskType } from '@overflow/commons-typescript/model/meta'; - -import { MetaProbeTaskTypeService } from '../../../service/meta-probe-task-type.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-probe-task-type.action'; - -@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 deleted file mode 100644 index b22f458..0000000 --- a/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index ed0dcf4..0000000 --- a/@overflow/meta/store/entity/meta-probe-task-type/meta-probe-task-type.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index f48c38d..0000000 --- a/@overflow/meta/store/entity/meta-probe-version/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index a738bbd..0000000 --- a/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 665cc19..0000000 --- a/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaProbeVersion } from '@overflow/commons-typescript/model/meta'; - -import { MetaProbeVersionService } from '../../../service/meta-probe-version.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-probe-version.action'; - -@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 deleted file mode 100644 index f989ed3..0000000 --- a/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 96360b6..0000000 --- a/@overflow/meta/store/entity/meta-probe-version/meta-probe-version.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 951ec51..0000000 --- a/@overflow/meta/store/entity/meta-sensor-display-item/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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/store/entity/meta-sensor-display-item/meta-sensor-display-item.action.ts b/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.action.ts deleted file mode 100644 index cbc1399..0000000 --- a/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.action.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Action } from '@ngrx/store'; - -import { RPCClientError } from '@loafer/ng-rpc'; -import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; -import { MetaSensorDisplayItem, MetaCrawler } from '@overflow/commons-typescript/model/meta'; - -export enum ActionType { - 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) {} -} - -export class ReadAllByCrawlerSuccess implements Action { - readonly type = ActionType.ReadAllByCrawlerSuccess; - - constructor(public payload: MetaSensorDisplayItem[]) {} -} - -export class ReadAllByCrawlerFailure implements Action { - readonly type = ActionType.ReadAllByCrawlerFailure; - - constructor(public payload: RPCClientError) {} -} - -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 deleted file mode 100644 index 9acb291..0000000 --- a/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.effect.ts +++ /dev/null @@ -1,40 +0,0 @@ -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 { MetaSensorDisplayItem, MetaCrawler } from '@overflow/commons-typescript/model/meta'; - -import { MetaSensorDisplayItemService } from '../../../service/meta-sensor-display-item.service'; - -import { - ReadAllByCrawler, - ReadAllByCrawlerSuccess, - ReadAllByCrawlerFailure, - ActionType, -} from './meta-sensor-display-item.action'; - -@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 deleted file mode 100644 index 5f972cb..0000000 --- a/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.reducer.ts +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index f3c6c03..0000000 --- a/@overflow/meta/store/entity/meta-sensor-display-item/meta-sensor-display-item.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 0148f31..0000000 --- a/@overflow/meta/store/entity/meta-sensor-display-mapping/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index f24c5d8..0000000 --- a/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.action.ts +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index 1d464ca..0000000 --- a/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.effect.ts +++ /dev/null @@ -1,40 +0,0 @@ -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 { MetaSensorDisplayMapping, MetaSensorDisplayItem, MetaSensorItemKey } from '@overflow/commons-typescript/model/meta'; - -import { MetaSensorDisplayMappingService } from '../../../service/meta-sensor-display-mapping.service'; - -import { - ReadAllMetaSensorItemKeyByDisplayItem, - ReadAllMetaSensorItemKeyByDisplayItemSuccess, - ReadAllMetaSensorItemKeyByDisplayItemFailure, - ActionType, -} from './meta-sensor-display-mapping.action'; - -@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 deleted file mode 100644 index 72494ae..0000000 --- a/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.reducer.ts +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index b4de1ed..0000000 --- a/@overflow/meta/store/entity/meta-sensor-display-mapping/meta-sensor-display-mapping.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 970e773..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-key/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index c9680b9..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.action.ts +++ /dev/null @@ -1,59 +0,0 @@ -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 deleted file mode 100644 index bc92b64..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.effect.ts +++ /dev/null @@ -1,62 +0,0 @@ -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 { MetaSensorItemKey, MetaCrawler } from '@overflow/commons-typescript/model/meta'; - -import { MetaSensorItemKeyService } from '../../../service/meta-sensor-item-key.service'; - -import { - ReadAllByCrawler, - ReadAllByCrawlerSuccess, - ReadAllByCrawlerFailure, - - ReadAllMapByCrawler, - ReadAllMapByCrawlerSuccess, - ReadAllMapByCrawlerFailure, - - ActionType, -} from './meta-sensor-item-key.action'; - -@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 deleted file mode 100644 index 2c65152..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.reducer.ts +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index bf93e86..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-key/meta-sensor-item-key.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 480b480..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-type/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index e032983..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 76a1b63..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaSensorItemType } from '@overflow/commons-typescript/model/meta'; - -import { MetaSensorItemTypeService } from '../../../service/meta-sensor-item-type.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-sensor-item-type.action'; - -@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 deleted file mode 100644 index 633a1eb..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 182526e..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-type/meta-sensor-item-type.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 64dae2f..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-unit/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index c3319bd..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index ce5174d..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaSensorItemUnit } from '@overflow/commons-typescript/model/meta'; - -import { MetaSensorItemUnitService } from '../../../service/meta-sensor-item-unit.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-sensor-item-unit.action'; - -@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 deleted file mode 100644 index d9e4d59..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index da08427..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item-unit/meta-sensor-item-unit.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index face0fa..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index f2a0938..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 8c9de1b..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaSensorItem } from '@overflow/commons-typescript/model/meta'; - -import { MetaSensorItemService } from '../../../service/meta-sensor-item.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-sensor-item.action'; - -@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 deleted file mode 100644 index 7a9908b..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index d6c5f80..0000000 --- a/@overflow/meta/store/entity/meta-sensor-item/meta-sensor-item.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 40006b2..0000000 --- a/@overflow/meta/store/entity/meta-sensor-status/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 2289ea9..0000000 --- a/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 81d5fb2..0000000 --- a/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaSensorStatus } from '@overflow/commons-typescript/model/meta'; - -import { MetaSensorStatusService } from '../../../service/meta-sensor-status.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-sensor-status.action'; - -@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 deleted file mode 100644 index dcd8cd9..0000000 --- a/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 0d0eb0c..0000000 --- a/@overflow/meta/store/entity/meta-sensor-status/meta-sensor-status.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index f979e4f..0000000 --- a/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index a9e7c80..0000000 --- a/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.action.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index e5e89c8..0000000 --- a/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.effect.ts +++ /dev/null @@ -1,39 +0,0 @@ -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 { MetaVendorCrawlerSensorItem } from '@overflow/commons-typescript/model/meta'; - -import { MetaVendorCrawlerSensorItemService } from '../../../service/meta-vendor-crawler-sensor-item.service'; - -import { - ReadAll, - ReadAllSuccess, - ReadAllFailure, - ActionType, -} from './meta-vendor-crawler-sensor-item.action'; - -@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 deleted file mode 100644 index a6e1d6e..0000000 --- a/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.reducer.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 7ff39ae..0000000 --- a/@overflow/meta/store/entity/meta-vendor-crawler-sensor-item/meta-vendor-crawler-sensor-item.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 23d4e77..0000000 --- a/@overflow/meta/store/entity/meta-vendor-crawler/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index b4f9a44..0000000 --- a/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.action.ts +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index 143d09b..0000000 --- a/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.effect.ts +++ /dev/null @@ -1,40 +0,0 @@ -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 { MetaVendorCrawler, MetaInfraVendor } from '@overflow/commons-typescript/model/meta'; - -import { MetaVendorCrawlerService } from '../../../service/meta-vendor-crawler.service'; - -import { - ReadAllByInfraVendor, - ReadAllByInfraVendorSuccess, - ReadAllByInfraVendorFailure, - ActionType, -} from './meta-vendor-crawler.action'; - -@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 deleted file mode 100644 index 36cff66..0000000 --- a/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.reducer.ts +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index f5d8e88..0000000 --- a/@overflow/meta/store/entity/meta-vendor-crawler/meta-vendor-crawler.state.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 02c2621..0000000 --- a/@overflow/meta/store/index.ts +++ /dev/null @@ -1,184 +0,0 @@ -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 -)); - - diff --git a/@overflow/noauth-probe/component/noauth-probe-list.component.ts b/@overflow/noauth-probe/component/noauth-probe-list.component.ts index 32361ee..cdaef1b 100644 --- a/@overflow/noauth-probe/component/noauth-probe-list.component.ts +++ b/@overflow/noauth-probe/component/noauth-probe-list.component.ts @@ -5,7 +5,7 @@ import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; import { ConfirmationService, Message } from 'primeng/primeng'; import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; -import { AuthContainerSelector } from '@overflow/shared/auth/store'; +import { AuthSelector } from '@overflow/shared/auth/store'; import { DomainMember } from '@overflow/commons-typescript/model/domain'; import { NoAuthProbeService } from '../service/noauth-probe.service'; @@ -37,7 +37,7 @@ export class NoAuthProbeListComponent implements OnInit, OnDestroy { tap(() => { this.pending$ = of(true); }), - select(AuthContainerSelector.selectDomainMember), + select(AuthSelector.selectDomainMember), exhaustMap((domainMember: DomainMember) => this.noAuthProbeService.readAllByDomainID(domainMember.domain.id) .pipe( @@ -90,7 +90,7 @@ export class NoAuthProbeListComponent implements OnInit, OnDestroy { ).subscribe(); // this.noauthProbes$ = this.store.pipe( - // select(AuthContainerSelector.selectDomainMember), + // select(AuthSelector.selectDomainMember), // exhaustMap((domainMember: DomainMember) => // this.noAuthProbeService.readAllByDomainID(domainMember.domain.id) // .pipe( diff --git a/@overflow/notification/container/badge/badge-container.component.ts b/@overflow/notification/container/badge/badge-container.component.ts index 60408e4..783b2ed 100644 --- a/@overflow/notification/container/badge/badge-container.component.ts +++ b/@overflow/notification/container/badge/badge-container.component.ts @@ -5,7 +5,7 @@ import { Observable } from 'rxjs/Observable'; import { Domain, DomainMember } from '@overflow/commons-typescript/model/domain'; import * as NotificationEntityStore from '../../store/entity/notification'; import { NotificationEntitySelector } from '../../store/'; -import { AuthContainerSelector } from '@overflow/shared/auth/store'; +import { AuthSelector } from '@overflow/shared/auth/store'; import { PageParams } from '@overflow/commons-typescript/model/commons/PageParams'; import { Page } from '@overflow/commons-typescript/model/commons/Page'; import { Notification } from '@overflow/commons-typescript/model/notification'; @@ -37,7 +37,7 @@ export class NotificationBadgeContainerComponent implements OnInit, OnChanges { } getNotifications() { - this.store.select(AuthContainerSelector.selectDomainMember).subscribe( + this.store.select(AuthSelector.selectDomainMember).subscribe( (domainMember: DomainMember) => { const pageParams: PageParams = { pageNo: 0, diff --git a/@overflow/notification/container/list/list-container.component.ts b/@overflow/notification/container/list/list-container.component.ts index 75f8407..adf2f92 100644 --- a/@overflow/notification/container/list/list-container.component.ts +++ b/@overflow/notification/container/list/list-container.component.ts @@ -4,7 +4,7 @@ import { Store, select } from '@ngrx/store'; import { Observable } from 'rxjs/Observable'; import * as NotificationEntityStore from '../../store/entity/notification'; import { NotificationEntitySelector } from '../../store/'; -import { AuthContainerSelector } from '@overflow/shared/auth/store'; +import { AuthSelector } from '@overflow/shared/auth/store'; import { Member } from '@overflow/commons-typescript/model/member'; import { PageParams } from '@overflow/commons-typescript/model/commons/PageParams'; import { Page } from '@overflow/commons-typescript/model/commons/Page'; @@ -40,7 +40,7 @@ export class NotificationListContainerComponent implements OnInit { } getNotifications() { - this.store.select(AuthContainerSelector.selectDomainMember).subscribe( + this.store.select(AuthSelector.selectDomainMember).subscribe( (domainMember: DomainMember) => { const pageParams: PageParams = { pageNo: this.pageNo, @@ -54,7 +54,7 @@ export class NotificationListContainerComponent implements OnInit { } markAllasRead() { - this.store.select(AuthContainerSelector.selectDomainMember).subscribe( + this.store.select(AuthSelector.selectDomainMember).subscribe( (domainMember: DomainMember) => { const pageParams: PageParams = { pageNo: this.pageNo, diff --git a/@overflow/probe/component/probe-detail.component.ts b/@overflow/probe/component/probe-detail.component.ts index d945e94..6e7cddb 100644 --- a/@overflow/probe/component/probe-detail.component.ts +++ b/@overflow/probe/component/probe-detail.component.ts @@ -3,7 +3,7 @@ import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe'; import { Store, select } from '@ngrx/store'; import { Observable, of, Subscription } from 'rxjs'; import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; -import { AuthContainerSelector } from '@overflow/shared/auth/store'; +import { AuthSelector } from '@overflow/shared/auth/store'; import { DomainMember } from '@overflow/commons-typescript/model/domain'; import { ProbeHostService } from '../service/probe-host.service'; import { ProbeService } from '../service/probe.service'; diff --git a/@overflow/probe/component/probe-list.component.ts b/@overflow/probe/component/probe-list.component.ts index 1edf27f..2cb4b26 100644 --- a/@overflow/probe/component/probe-list.component.ts +++ b/@overflow/probe/component/probe-list.component.ts @@ -3,7 +3,7 @@ import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe'; import { Store, select } from '@ngrx/store'; import { Observable, of } from 'rxjs'; import { ProbeHostService } from '../service/probe-host.service'; -import { AuthContainerSelector } from '@overflow/shared/auth/store'; +import { AuthSelector } from '@overflow/shared/auth/store'; import { DomainMember } from '@overflow/commons-typescript/model/domain'; import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; @@ -29,7 +29,7 @@ export class ProbeListComponent implements OnInit { tap(() => { this.pending$ = of(true); }), - select(AuthContainerSelector.selectDomainMember), + select(AuthSelector.selectDomainMember), exhaustMap((domainMember: DomainMember) => this.probeHostService.readAllByDomainID(domainMember.domain.id) .pipe( diff --git a/@overflow/probe/component/probe-selector.component.ts b/@overflow/probe/component/probe-selector.component.ts index 1df5647..3f3a657 100644 --- a/@overflow/probe/component/probe-selector.component.ts +++ b/@overflow/probe/component/probe-selector.component.ts @@ -3,7 +3,7 @@ import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe'; import { Store, select } from '@ngrx/store'; import { Observable, of, Subscription } from 'rxjs'; import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; -import { AuthContainerSelector } from '@overflow/shared/auth/store'; +import { AuthSelector } from '@overflow/shared/auth/store'; import { DomainMember } from '@overflow/commons-typescript/model/domain'; import { ProbeHostService } from '../service/probe-host.service'; @@ -35,7 +35,7 @@ export class ProbeSelectorComponent implements OnInit, OnChanges { tap(() => { this.pending$ = of(true); }), - select(AuthContainerSelector.selectDomainMember), + select(AuthSelector.selectDomainMember), exhaustMap((domainMember: DomainMember) => this.probeHostService.readAllByDomainID(domainMember.domain.id) .pipe( diff --git a/@overflow/sensor/container/sensor-list-container.component.ts b/@overflow/sensor/container/sensor-list-container.component.ts index d39489c..524ce23 100644 --- a/@overflow/sensor/container/sensor-list-container.component.ts +++ b/@overflow/sensor/container/sensor-list-container.component.ts @@ -4,7 +4,7 @@ import { Store, select } from '@ngrx/store'; import { Sensor } from '@overflow/commons-typescript/model/sensor'; import * as SensorEntityStore from '../store/entity/sensor'; import { SensorListContainerSelector } from '../store'; -import { AuthContainerSelector } from '@overflow/shared/auth/store'; +import { AuthSelector } from '@overflow/shared/auth/store'; import { PageParams } from '@overflow/commons-typescript/model/commons/PageParams'; import { Page } from '@overflow/commons-typescript/model/commons/Page'; import { Target } from '@overflow/commons-typescript/model/target'; @@ -34,7 +34,7 @@ export class SensorListContainerComponent implements OnInit { } getSensors() { - this.store.select(AuthContainerSelector.selectDomainMember).subscribe( + this.store.select(AuthSelector.selectDomainMember).subscribe( (domainMember: DomainMember) => { const pageParams: PageParams = { pageNo: this.pageNo, diff --git a/@overflow/shared/auth/store/container/auth/auth.action.ts b/@overflow/shared/auth/store/auth/auth.action.ts similarity index 58% rename from @overflow/shared/auth/store/container/auth/auth.action.ts rename to @overflow/shared/auth/store/auth/auth.action.ts index d0a2b9e..02df26d 100644 --- a/@overflow/shared/auth/store/container/auth/auth.action.ts +++ b/@overflow/shared/auth/store/auth/auth.action.ts @@ -3,16 +3,16 @@ import { Action } from '@ngrx/store'; import { RESTClientError } from '@loafer/ng-rest'; import { DomainMember } from '@overflow/commons-typescript/model/domain'; +import { Member } from '@overflow/commons-typescript/model/member'; export enum ActionType { SigninSuccess = '[auth.auth] SigninSuccess', - SigninFailure = '[auth.auth] SigninFailure', SigninCookieSuccess = '[auth.auth] SigninCookieSuccess', - SigninCookieFailure = '[auth.auth] SigninCookieFailure', SignoutSuccess = '[auth.auth] SignoutSuccess', - SignoutFailure = '[auth.auth] SignoutFailure', + + ModifySuccess = '[auth.auth] ModifySuccess', } export class SigninSuccess implements Action { @@ -21,39 +21,26 @@ export class SigninSuccess implements Action { constructor(public payload: {authToken: string, domainMember: DomainMember, returnURL: string}) {} } -export class SigninFailure implements Action { - readonly type = ActionType.SigninFailure; - - constructor(public payload: RESTClientError) {} -} - export class SigninCookieSuccess implements Action { readonly type = ActionType.SigninCookieSuccess; constructor(public payload: {domainMember: DomainMember, returnURL: string}) {} } -export class SigninCookieFailure implements Action { - readonly type = ActionType.SigninCookieFailure; - - constructor(public payload: RESTClientError) {} -} - export class SignoutSuccess implements Action { readonly type = ActionType.SignoutSuccess; } -export class SignoutFailure implements Action { - readonly type = ActionType.SignoutFailure; +export class ModifySuccess implements Action { + readonly type = ActionType.ModifySuccess; - constructor(public payload: RESTClientError) {} + constructor(public payload: Member) {} } + export type Actions = | SigninSuccess - | SigninFailure | SigninCookieSuccess - | SigninCookieFailure | SignoutSuccess - | SignoutFailure + | ModifySuccess ; diff --git a/@overflow/shared/auth/store/container/auth/auth.reducer.ts b/@overflow/shared/auth/store/auth/auth.reducer.ts similarity index 71% rename from @overflow/shared/auth/store/container/auth/auth.reducer.ts rename to @overflow/shared/auth/store/auth/auth.reducer.ts index 2c9dd93..c5f6698 100644 --- a/@overflow/shared/auth/store/container/auth/auth.reducer.ts +++ b/@overflow/shared/auth/store/auth/auth.reducer.ts @@ -17,13 +17,6 @@ export function reducer(state: State = initialState, action: Actions): State { }; } - case ActionType.SigninFailure: { - return { - signined: false, - domainMember: null, - }; - } - case ActionType.SigninCookieSuccess: { return { signined: true, @@ -31,13 +24,6 @@ export function reducer(state: State = initialState, action: Actions): State { }; } - case ActionType.SigninCookieFailure: { - return { - signined: false, - domainMember: null, - }; - } - case ActionType.SignoutSuccess: { return { signined: false, @@ -45,7 +31,8 @@ export function reducer(state: State = initialState, action: Actions): State { }; } - case ActionType.SignoutFailure: { + case ActionType.ModifySuccess: { + state.domainMember.member = action.payload; return { ...state, }; diff --git a/@overflow/shared/auth/store/container/auth/auth.state.ts b/@overflow/shared/auth/store/auth/auth.state.ts similarity index 100% rename from @overflow/shared/auth/store/container/auth/auth.state.ts rename to @overflow/shared/auth/store/auth/auth.state.ts diff --git a/@overflow/shared/auth/store/container/auth/index.ts b/@overflow/shared/auth/store/auth/index.ts similarity index 100% rename from @overflow/shared/auth/store/container/auth/index.ts rename to @overflow/shared/auth/store/auth/index.ts diff --git a/@overflow/shared/auth/store/index.ts b/@overflow/shared/auth/store/index.ts index b6a1785..c17055c 100644 --- a/@overflow/shared/auth/store/index.ts +++ b/@overflow/shared/auth/store/index.ts @@ -5,14 +5,14 @@ import { import { MODULE } from '../auth.constant'; -import * as AuthContainerStore from './container/auth'; +import * as AuthStore from './auth'; export interface State { - auth_container: AuthContainerStore.State; + auth_container: AuthStore.State; } export const REDUCERS = { - auth_container: AuthContainerStore.reducer, + auth_container: AuthStore.reducer, }; export const EFFECTS = [ @@ -20,7 +20,7 @@ export const EFFECTS = [ export const selectState = createFeatureSelector(MODULE.name); -export const AuthContainerSelector = AuthContainerStore.getSelectors(createSelector( +export const AuthSelector = AuthStore.getSelectors(createSelector( selectState, (state: State) => state.auth_container )); diff --git a/src/app/commons/component/layout/profile/app.profile.component.ts b/src/app/commons/component/layout/profile/app.profile.component.ts index 014bbf2..6dc2c9d 100644 --- a/src/app/commons/component/layout/profile/app.profile.component.ts +++ b/src/app/commons/component/layout/profile/app.profile.component.ts @@ -5,7 +5,7 @@ import { select, Store } from '@ngrx/store'; import { Observable } from 'rxjs/Observable'; import { Member } from '@overflow/commons-typescript/model/member'; -import { AuthContainerSelector } from '@overflow/shared/auth/store'; +import { AuthSelector } from '@overflow/shared/auth/store'; import { AppComponent } from '../../../../app.component'; import { PagesComponent } from '../../../../pages/pages.component'; @@ -38,7 +38,7 @@ export class AppInlineProfileComponent implements OnInit { } ngOnInit() { - this.domainMember$ = this.store.select(AuthContainerSelector.selectDomainMember); + this.domainMember$ = this.store.select(AuthSelector.selectDomainMember); } onClick(event) { diff --git a/src/app/commons/guard/auth.guard.ts b/src/app/commons/guard/auth.guard.ts index a6b794c..e2ca697 100644 --- a/src/app/commons/guard/auth.guard.ts +++ b/src/app/commons/guard/auth.guard.ts @@ -12,9 +12,8 @@ import { Observable } from 'rxjs'; import { map, take } from 'rxjs/operators'; import { CookieService } from 'ngx-cookie-service'; -import { AuthContainerSelector } from '@overflow/shared/auth/store'; -import * as MemberEntityStore from '@overflow/member/store/entity/member'; -import * as SigninContaifnerStore from '../store/container/signin'; +import { AuthSelector } from '@overflow/shared/auth/store'; +import * as SigninContaifnerStore from '../store/signin'; @Injectable() export class AuthGuard implements CanActivate, CanActivateChild { @@ -26,7 +25,7 @@ export class AuthGuard implements CanActivate, CanActivateChild { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { return this.store.pipe( - select(AuthContainerSelector.selectSignined), + select(AuthSelector.selectSignined), map(signined => { if (!signined) { if (this.cookieService.check('authToken')) { @@ -48,7 +47,7 @@ export class AuthGuard implements CanActivate, CanActivateChild { canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { return this.store.pipe( - select(AuthContainerSelector.selectSignined), + select(AuthSelector.selectSignined), map(signined => { if (!signined) { if (this.cookieService.check('authToken')) { diff --git a/src/app/commons/store/index.ts b/src/app/commons/store/index.ts index 67a90b3..334fb14 100644 --- a/src/app/commons/store/index.ts +++ b/src/app/commons/store/index.ts @@ -1,6 +1,6 @@ import { ActionReducerMap } from '@ngrx/store'; -import * as SigninContainerStore from './container/signin'; +import * as SigninContainerStore from './signin'; export interface State { } diff --git a/src/app/commons/store/container/signin/app-signin.action.ts b/src/app/commons/store/signin/app-signin.action.ts similarity index 65% rename from src/app/commons/store/container/signin/app-signin.action.ts rename to src/app/commons/store/signin/app-signin.action.ts index 8804694..53700ba 100644 --- a/src/app/commons/store/container/signin/app-signin.action.ts +++ b/src/app/commons/store/signin/app-signin.action.ts @@ -1,8 +1,10 @@ import { Action } from '@ngrx/store'; +import { RESTClientError } from '@loafer/ng-rest'; export enum ActionType { SigninRedirect = '[app.signin] SigninRedirect', SigninCookie = '[app.signin] SigninCookie', + SigninCookieFailure = '[app.signin] SigninCookieFailure', } export class SigninRedirect implements Action { @@ -17,8 +19,15 @@ export class SigninCookie implements Action { constructor(public payload: { authToken: string, returnURL: string }) { } } +export class SigninCookieFailure implements Action { + readonly type = ActionType.SigninCookieFailure; + + constructor(public payload: RESTClientError) {} +} + export type Actions = | SigninRedirect | SigninCookie + | SigninCookieFailure ; diff --git a/src/app/commons/store/container/signin/app-signin.effect.spec.ts b/src/app/commons/store/signin/app-signin.effect.spec.ts similarity index 100% rename from src/app/commons/store/container/signin/app-signin.effect.spec.ts rename to src/app/commons/store/signin/app-signin.effect.spec.ts diff --git a/src/app/commons/store/container/signin/app-signin.effect.ts b/src/app/commons/store/signin/app-signin.effect.ts similarity index 96% rename from src/app/commons/store/container/signin/app-signin.effect.ts rename to src/app/commons/store/signin/app-signin.effect.ts index b91ae75..0bc20a0 100644 --- a/src/app/commons/store/container/signin/app-signin.effect.ts +++ b/src/app/commons/store/signin/app-signin.effect.ts @@ -11,17 +11,17 @@ import { RPCService } from '@loafer/ng-rpc'; import { SigninSuccess, SigninCookieSuccess, - SigninCookieFailure, ActionType as AuthActionType, -} from '@overflow/shared/auth/store/container/auth'; +} from '@overflow/shared/auth/store/auth'; import { SigninRedirect, SigninCookie, + SigninCookieFailure, ActionType, } from './app-signin.action'; -import { AuthService } from '../../../service/auth.service'; +import { AuthService } from '../../service/auth.service'; import { DomainMember } from '@overflow/commons-typescript/model/domain'; diff --git a/src/app/commons/store/container/signin/index.ts b/src/app/commons/store/signin/index.ts similarity index 100% rename from src/app/commons/store/container/signin/index.ts rename to src/app/commons/store/signin/index.ts