ing
This commit is contained in:
parent
0d1ddb8b93
commit
bcf00db2d7
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -43,4 +43,4 @@ testem.log
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
yarn.lock
|
yarn.lock
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
|
10
src/packages/noauth/noauth-probe-logger.module.ts
Normal file
10
src/packages/noauth/noauth-probe-logger.module.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { LoggerModule } from '@loafer/ng-logger';
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
LoggerModule.forFeature({}),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class NoAuthProbeLoggerModule { }
|
13
src/packages/noauth/noauth-probe-rpc.module.ts
Normal file
13
src/packages/noauth/noauth-probe-rpc.module.ts
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RPCModule } from '@loafer/ng-rpc';
|
||||||
|
|
||||||
|
import {
|
||||||
|
SUBSCRIBERS,
|
||||||
|
} from './subscriber';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RPCModule.forFeature({subscribers: SUBSCRIBERS}),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class NoAuthProbeRPCModule { }
|
|
@ -1,6 +1,8 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { NoAuthProbeStoreModule } from './noauth-probe-store.module';
|
import { NoAuthProbeStoreModule } from './noauth-probe-store.module';
|
||||||
|
import { NoAuthProbeRPCModule } from './noauth-probe-rpc.module';
|
||||||
|
import { NoAuthProbeLoggerModule } from './noauth-probe-logger.module';
|
||||||
import { COMPONENTS } from './component';
|
import { COMPONENTS } from './component';
|
||||||
import { SERVICES } from './service';
|
import { SERVICES } from './service';
|
||||||
import { PrimeNGModules } from '../commons/prime-ng/prime-ng.module';
|
import { PrimeNGModules } from '../commons/prime-ng/prime-ng.module';
|
||||||
|
@ -9,7 +11,9 @@ import { PrimeNGModules } from '../commons/prime-ng/prime-ng.module';
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
NoAuthProbeStoreModule,
|
NoAuthProbeStoreModule,
|
||||||
PrimeNGModules
|
NoAuthProbeRPCModule,
|
||||||
|
NoAuthProbeLoggerModule,
|
||||||
|
PrimeNGModules,
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
COMPONENTS,
|
COMPONENTS,
|
||||||
|
|
|
@ -18,6 +18,9 @@ export enum ActionType {
|
||||||
Deny = '[noauth-proboe.noauth-proboe] Deny',
|
Deny = '[noauth-proboe.noauth-proboe] Deny',
|
||||||
DenySuccess = '[noauth-proboe.noauth-proboe] DenySuccess',
|
DenySuccess = '[noauth-proboe.noauth-proboe] DenySuccess',
|
||||||
DenyFailure = '[noauth-proboe.noauth-proboe] DenyFailure',
|
DenyFailure = '[noauth-proboe.noauth-proboe] DenyFailure',
|
||||||
|
|
||||||
|
OnConnect = '[noauth-proboe.noauth-proboe] OnConnect',
|
||||||
|
OnDisconnect = '[noauth-proboe.noauth-proboe] OnDisconnect',
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ReadAllByDomain implements Action {
|
export class ReadAllByDomain implements Action {
|
||||||
|
@ -74,6 +77,18 @@ export class DenyFailure implements Action {
|
||||||
constructor(public payload: RPCClientError) {}
|
constructor(public payload: RPCClientError) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class OnConnect implements Action {
|
||||||
|
readonly type = ActionType.OnConnect;
|
||||||
|
|
||||||
|
constructor(public payload: NoAuthProbe) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class OnDisconnect implements Action {
|
||||||
|
readonly type = ActionType.OnDisconnect;
|
||||||
|
|
||||||
|
constructor(public payload: NoAuthProbe) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export type Actions =
|
export type Actions =
|
||||||
| ReadAllByDomain
|
| ReadAllByDomain
|
||||||
|
@ -85,4 +100,6 @@ export type Actions =
|
||||||
| Deny
|
| Deny
|
||||||
| DenySuccess
|
| DenySuccess
|
||||||
| DenyFailure
|
| DenyFailure
|
||||||
|
| OnConnect
|
||||||
|
| OnDisconnect
|
||||||
;
|
;
|
||||||
|
|
|
@ -96,7 +96,17 @@ export function reducer(state = initialState, action: Actions): State {
|
||||||
pending: false,
|
pending: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
case ActionType.OnConnect: {
|
||||||
|
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
case ActionType.OnDisconnect: {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
};
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
5
src/packages/noauth/subscriber/index.ts
Normal file
5
src/packages/noauth/subscriber/index.ts
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import { NoAuthProbeSubscriber } from './noauth-probe.subscriber';
|
||||||
|
|
||||||
|
export const SUBSCRIBERS = [
|
||||||
|
NoAuthProbeSubscriber,
|
||||||
|
];
|
35
src/packages/noauth/subscriber/noauth-probe.subscriber.ts
Normal file
35
src/packages/noauth/subscriber/noauth-probe.subscriber.ts
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Store, select } from '@ngrx/store';
|
||||||
|
|
||||||
|
import { RPCSubscriber } from '@loafer/ng-rpc/decorator';
|
||||||
|
import { LoggerService } from '@loafer/ng-logger/service';
|
||||||
|
|
||||||
|
import * as NoAuthProbeStore from '../store/noauth-probe';
|
||||||
|
|
||||||
|
import {
|
||||||
|
NoAuthProbe,
|
||||||
|
} from '@overflow/commons-typescript/model/noauth';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class NoAuthProbeSubscriber {
|
||||||
|
|
||||||
|
public constructor(
|
||||||
|
private store: Store<NoAuthProbeStore.State>,
|
||||||
|
private loggerService: LoggerService,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@RPCSubscriber({method: 'NoAuthProbeService.onConnect'})
|
||||||
|
public onConnect(noAuthProbe: NoAuthProbe): void {
|
||||||
|
this.loggerService.debug('NoAuthProbeService.onConnect noAuthProbe:', noAuthProbe);
|
||||||
|
|
||||||
|
this.store.dispatch(new NoAuthProbeStore.OnConnect(noAuthProbe));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RPCSubscriber({method: 'NoAuthProbeService.onDisconnect'})
|
||||||
|
public onDisconnect(noAuthProbe: NoAuthProbe): void {
|
||||||
|
this.loggerService.debug('NoAuthProbeService.onDisconnect noAuthProbe:', noAuthProbe);
|
||||||
|
|
||||||
|
this.store.dispatch(new NoAuthProbeStore.OnDisconnect(noAuthProbe));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user