@mbc-cqrs-serverless/core 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -37
- package/dist/app.module.js +0 -2
- package/dist/app.module.js.map +1 -1
- package/dist/commands/command.event.handler.js +2 -8
- package/dist/commands/command.event.handler.js.map +1 -1
- package/dist/commands/command.service.js +9 -35
- package/dist/commands/command.service.js.map +1 -1
- package/dist/context/invoke.d.ts +0 -1
- package/dist/context/invoke.js +1 -1
- package/dist/context/invoke.js.map +1 -1
- package/dist/context/user.d.ts +0 -4
- package/dist/context/user.js +0 -50
- package/dist/context/user.js.map +1 -1
- package/dist/decorators/constants.d.ts +0 -2
- package/dist/decorators/constants.js +1 -3
- package/dist/decorators/constants.js.map +1 -1
- package/dist/decorators/data-sync-handler.decorator.d.ts +0 -19
- package/dist/decorators/data-sync-handler.decorator.js +0 -19
- package/dist/decorators/data-sync-handler.decorator.js.map +1 -1
- package/dist/decorators/index.d.ts +0 -2
- package/dist/decorators/index.js +0 -2
- package/dist/decorators/index.js.map +1 -1
- package/dist/env.validation.d.ts +0 -19
- package/dist/env.validation.js +1 -22
- package/dist/env.validation.js.map +1 -1
- package/dist/guard/roles.guard.d.ts +1 -11
- package/dist/guard/roles.guard.js +8 -44
- package/dist/guard/roles.guard.js.map +1 -1
- package/dist/helpers/serializer.d.ts +2 -1
- package/dist/helpers/serializer.js +7 -34
- package/dist/helpers/serializer.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/command-module-options.interface.d.ts +1 -11
- package/dist/notifications/appsync.service.d.ts +2 -3
- package/dist/notifications/appsync.service.js +12 -20
- package/dist/notifications/appsync.service.js.map +1 -1
- package/dist/notifications/event/notification.event.handler.d.ts +5 -13
- package/dist/notifications/event/notification.event.handler.js +7 -31
- package/dist/notifications/event/notification.event.handler.js.map +1 -1
- package/dist/notifications/index.d.ts +0 -3
- package/dist/notifications/index.js +0 -3
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/notification.module.js +2 -12
- package/dist/notifications/notification.module.js.map +1 -1
- package/dist/services/explorer.service.d.ts +0 -5
- package/dist/services/explorer.service.js +1 -12
- package/dist/services/explorer.service.js.map +1 -1
- package/package.json +4 -4
- package/dist/auth/auth.module.d.ts +0 -2
- package/dist/auth/auth.module.js +0 -30
- package/dist/auth/auth.module.js.map +0 -1
- package/dist/auth/authz-bootstrap.service.d.ts +0 -11
- package/dist/auth/authz-bootstrap.service.js +0 -47
- package/dist/auth/authz-bootstrap.service.js.map +0 -1
- package/dist/auth/group-role-resolver.interface.d.ts +0 -13
- package/dist/auth/group-role-resolver.interface.js +0 -3
- package/dist/auth/group-role-resolver.interface.js.map +0 -1
- package/dist/auth/group-role-resolver.registry.d.ts +0 -6
- package/dist/auth/group-role-resolver.registry.js +0 -26
- package/dist/auth/group-role-resolver.registry.js.map +0 -1
- package/dist/auth/index.d.ts +0 -4
- package/dist/auth/index.js +0 -21
- package/dist/auth/index.js.map +0 -1
- package/dist/decorators/group-role-resolver.decorator.d.ts +0 -9
- package/dist/decorators/group-role-resolver.decorator.js +0 -17
- package/dist/decorators/group-role-resolver.decorator.js.map +0 -1
- package/dist/decorators/notification-transport.decorator.d.ts +0 -6
- package/dist/decorators/notification-transport.decorator.js +0 -14
- package/dist/decorators/notification-transport.decorator.js.map +0 -1
- package/dist/notification-env.validation.d.ts +0 -8
- package/dist/notification-env.validation.js +0 -36
- package/dist/notification-env.validation.js.map +0 -1
- package/dist/notifications/appsync-events.service.d.ts +0 -44
- package/dist/notifications/appsync-events.service.js +0 -147
- package/dist/notifications/appsync-events.service.js.map +0 -1
- package/dist/notifications/enums/index.d.ts +0 -1
- package/dist/notifications/enums/index.js +0 -18
- package/dist/notifications/enums/index.js.map +0 -1
- package/dist/notifications/enums/notification-transport.enum.d.ts +0 -4
- package/dist/notifications/enums/notification-transport.enum.js +0 -9
- package/dist/notifications/enums/notification-transport.enum.js.map +0 -1
- package/dist/notifications/interfaces/index.d.ts +0 -1
- package/dist/notifications/interfaces/index.js +0 -18
- package/dist/notifications/interfaces/index.js.map +0 -1
- package/dist/notifications/interfaces/notification-transport.interface.d.ts +0 -7
- package/dist/notifications/interfaces/notification-transport.interface.js +0 -5
- package/dist/notifications/interfaces/notification-transport.interface.js.map +0 -1
- package/dist/services/mocks/group-role-resolver.mock.d.ts +0 -4
- package/dist/services/mocks/group-role-resolver.mock.js +0 -20
- package/dist/services/mocks/group-role-resolver.mock.js.map +0 -1
package/dist/auth/auth.module.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.AuthModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const roles_guard_1 = require("../guard/roles.guard");
|
|
12
|
-
const explorer_service_1 = require("../services/explorer.service");
|
|
13
|
-
const authz_bootstrap_service_1 = require("./authz-bootstrap.service");
|
|
14
|
-
const group_role_resolver_registry_1 = require("./group-role-resolver.registry");
|
|
15
|
-
let AuthModule = class AuthModule {
|
|
16
|
-
};
|
|
17
|
-
exports.AuthModule = AuthModule;
|
|
18
|
-
exports.AuthModule = AuthModule = __decorate([
|
|
19
|
-
(0, common_1.Global)(),
|
|
20
|
-
(0, common_1.Module)({
|
|
21
|
-
providers: [
|
|
22
|
-
explorer_service_1.ExplorerService,
|
|
23
|
-
group_role_resolver_registry_1.GroupRoleResolverRegistry,
|
|
24
|
-
authz_bootstrap_service_1.AuthzBootstrapService,
|
|
25
|
-
roles_guard_1.RolesGuard,
|
|
26
|
-
],
|
|
27
|
-
exports: [group_role_resolver_registry_1.GroupRoleResolverRegistry, roles_guard_1.RolesGuard, explorer_service_1.ExplorerService],
|
|
28
|
-
})
|
|
29
|
-
], AuthModule);
|
|
30
|
-
//# sourceMappingURL=auth.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA+C;AAE/C,sDAAiD;AACjD,mEAA8D;AAC9D,uEAAiE;AACjE,iFAA0E;AAYnE,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAVtB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,kCAAe;YACf,wDAAyB;YACzB,+CAAqB;YACrB,wBAAU;SACX;QACD,OAAO,EAAE,CAAC,wDAAyB,EAAE,wBAAU,EAAE,kCAAe,CAAC;KAClE,CAAC;GACW,UAAU,CAAG"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { OnApplicationBootstrap } from '@nestjs/common';
|
|
2
|
-
import { ModuleRef } from '@nestjs/core';
|
|
3
|
-
import { ExplorerService } from '../services/explorer.service';
|
|
4
|
-
import { GroupRoleResolverRegistry } from './group-role-resolver.registry';
|
|
5
|
-
export declare class AuthzBootstrapService implements OnApplicationBootstrap {
|
|
6
|
-
private readonly explorerService;
|
|
7
|
-
private readonly moduleRef;
|
|
8
|
-
private readonly registry;
|
|
9
|
-
constructor(explorerService: ExplorerService, moduleRef: ModuleRef, registry: GroupRoleResolverRegistry);
|
|
10
|
-
onApplicationBootstrap(): void;
|
|
11
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AuthzBootstrapService = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const core_1 = require("@nestjs/core");
|
|
15
|
-
const explorer_service_1 = require("../services/explorer.service");
|
|
16
|
-
const group_role_resolver_registry_1 = require("./group-role-resolver.registry");
|
|
17
|
-
let AuthzBootstrapService = class AuthzBootstrapService {
|
|
18
|
-
constructor(explorerService, moduleRef, registry) {
|
|
19
|
-
this.explorerService = explorerService;
|
|
20
|
-
this.moduleRef = moduleRef;
|
|
21
|
-
this.registry = registry;
|
|
22
|
-
}
|
|
23
|
-
onApplicationBootstrap() {
|
|
24
|
-
const types = this.explorerService.exploreGroupRoleResolvers();
|
|
25
|
-
if (types.length > 1) {
|
|
26
|
-
throw new Error('Only one @GroupRoleResolver() is allowed per application');
|
|
27
|
-
}
|
|
28
|
-
if (types.length === 0) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const instance = this.moduleRef.get(types[0], {
|
|
32
|
-
strict: false,
|
|
33
|
-
});
|
|
34
|
-
if (!instance) {
|
|
35
|
-
throw new Error(`GroupRoleResolver ${types[0].name} was discovered but could not be resolved from DI`);
|
|
36
|
-
}
|
|
37
|
-
this.registry.set(instance);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.AuthzBootstrapService = AuthzBootstrapService;
|
|
41
|
-
exports.AuthzBootstrapService = AuthzBootstrapService = __decorate([
|
|
42
|
-
(0, common_1.Injectable)(),
|
|
43
|
-
__metadata("design:paramtypes", [explorer_service_1.ExplorerService,
|
|
44
|
-
core_1.ModuleRef,
|
|
45
|
-
group_role_resolver_registry_1.GroupRoleResolverRegistry])
|
|
46
|
-
], AuthzBootstrapService);
|
|
47
|
-
//# sourceMappingURL=authz-bootstrap.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authz-bootstrap.service.js","sourceRoot":"","sources":["../../src/auth/authz-bootstrap.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAmE;AACnE,uCAAwC;AAExC,mEAA8D;AAE9D,iFAA0E;AAGnE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,YACmB,eAAgC,EAChC,SAAoB,EACpB,QAAmC;QAFnC,oBAAe,GAAf,eAAe,CAAiB;QAChC,cAAS,GAAT,SAAS,CAAW;QACpB,aAAQ,GAAR,QAAQ,CAA2B;IACnD,CAAC;IAEJ,sBAAsB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,yBAAyB,EAAE,CAAA;QAE9D,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAA;QACH,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAM;QACR,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAqB,KAAK,CAAC,CAAC,CAAC,EAAE;YAChE,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CACb,qBAAqB,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,mDAAmD,CACtF,CAAA;QACH,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAC7B,CAAC;CACF,CAAA;AAhCY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAGyB,kCAAe;QACrB,gBAAS;QACV,wDAAyB;GAJ3C,qBAAqB,CAgCjC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { JwtClaims } from '../context/invoke';
|
|
2
|
-
export interface TenantGroupMembership {
|
|
3
|
-
tenant: string;
|
|
4
|
-
groups: string[];
|
|
5
|
-
}
|
|
6
|
-
export interface ResolveGroupRolesInput {
|
|
7
|
-
tenantCode: string;
|
|
8
|
-
groupIds: string[];
|
|
9
|
-
claims?: JwtClaims;
|
|
10
|
-
}
|
|
11
|
-
export interface IGroupRoleResolver {
|
|
12
|
-
resolveRoles(input: ResolveGroupRolesInput): Promise<string[]>;
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"group-role-resolver.interface.js","sourceRoot":"","sources":["../../src/auth/group-role-resolver.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.GroupRoleResolverRegistry = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
let GroupRoleResolverRegistry = class GroupRoleResolverRegistry {
|
|
12
|
-
set(resolver) {
|
|
13
|
-
if (this.resolver) {
|
|
14
|
-
throw new Error('Only one @GroupRoleResolver() is allowed per application');
|
|
15
|
-
}
|
|
16
|
-
this.resolver = resolver;
|
|
17
|
-
}
|
|
18
|
-
get() {
|
|
19
|
-
return this.resolver;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
exports.GroupRoleResolverRegistry = GroupRoleResolverRegistry;
|
|
23
|
-
exports.GroupRoleResolverRegistry = GroupRoleResolverRegistry = __decorate([
|
|
24
|
-
(0, common_1.Injectable)()
|
|
25
|
-
], GroupRoleResolverRegistry);
|
|
26
|
-
//# sourceMappingURL=group-role-resolver.registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"group-role-resolver.registry.js","sourceRoot":"","sources":["../../src/auth/group-role-resolver.registry.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA2C;AAKpC,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAGpC,GAAG,CAAC,QAA4B;QAC9B,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAA;QACH,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAED,GAAG;QACD,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;CACF,CAAA;AAfY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,mBAAU,GAAE;GACA,yBAAyB,CAerC"}
|
package/dist/auth/index.d.ts
DELETED
package/dist/auth/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./auth.module"), exports);
|
|
18
|
-
__exportStar(require("./authz-bootstrap.service"), exports);
|
|
19
|
-
__exportStar(require("./group-role-resolver.interface"), exports);
|
|
20
|
-
__exportStar(require("./group-role-resolver.registry"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/dist/auth/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B;AAC7B,4DAAyC;AACzC,kEAA+C;AAC/C,iEAA8C"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Marks a class as the application's `IGroupRoleResolver` (exactly one per app).
|
|
3
|
-
* Discovered at bootstrap and registered in `GroupRoleResolverRegistry`.
|
|
4
|
-
*
|
|
5
|
-
* Applies `@Injectable()` with default (singleton) scope. Do **not** add `@Injectable()`
|
|
6
|
-
* on the same class — a second decorator can override scope (e.g. `REQUEST`) and break
|
|
7
|
-
* bootstrap, which resolves one instance at application startup.
|
|
8
|
-
*/
|
|
9
|
-
export declare function GroupRoleResolver(): ClassDecorator;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GroupRoleResolver = GroupRoleResolver;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
/**
|
|
7
|
-
* Marks a class as the application's `IGroupRoleResolver` (exactly one per app).
|
|
8
|
-
* Discovered at bootstrap and registered in `GroupRoleResolverRegistry`.
|
|
9
|
-
*
|
|
10
|
-
* Applies `@Injectable()` with default (singleton) scope. Do **not** add `@Injectable()`
|
|
11
|
-
* on the same class — a second decorator can override scope (e.g. `REQUEST`) and break
|
|
12
|
-
* bootstrap, which resolves one instance at application startup.
|
|
13
|
-
*/
|
|
14
|
-
function GroupRoleResolver() {
|
|
15
|
-
return (0, common_1.applyDecorators)((0, common_1.SetMetadata)(constants_1.GROUP_ROLE_RESOLVER_METADATA, true), (0, common_1.Injectable)());
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=group-role-resolver.decorator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"group-role-resolver.decorator.js","sourceRoot":"","sources":["../../src/decorators/group-role-resolver.decorator.ts"],"names":[],"mappings":";;AAYA,8CAKC;AAjBD,2CAAyE;AAEzE,2CAA0D;AAE1D;;;;;;;GAOG;AACH,SAAgB,iBAAiB;IAC/B,OAAO,IAAA,wBAAe,EACpB,IAAA,oBAAW,EAAC,wCAA4B,EAAE,IAAI,CAAC,EAC/C,IAAA,mBAAU,GAAE,CACK,CAAA;AACrB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Decorator to register a class as a Notification Transport.
|
|
3
|
-
* Automatically marks the class as an @Injectable() provider.
|
|
4
|
-
* @param name The unique identifier for this transport (e.g., 'pusher', 'appsync-event')
|
|
5
|
-
*/
|
|
6
|
-
export declare function NotificationTransport(name: string): ClassDecorator;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotificationTransport = NotificationTransport;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
/**
|
|
7
|
-
* Decorator to register a class as a Notification Transport.
|
|
8
|
-
* Automatically marks the class as an @Injectable() provider.
|
|
9
|
-
* @param name The unique identifier for this transport (e.g., 'pusher', 'appsync-event')
|
|
10
|
-
*/
|
|
11
|
-
function NotificationTransport(name) {
|
|
12
|
-
return (0, common_1.applyDecorators)((0, common_1.SetMetadata)(constants_1.NOTIFICATION_TRANSPORT_METADATA, name), (0, common_1.Injectable)());
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=notification-transport.decorator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification-transport.decorator.js","sourceRoot":"","sources":["../../src/decorators/notification-transport.decorator.ts"],"names":[],"mappings":";;AASA,sDAKC;AAdD,2CAAyE;AAEzE,2CAA6D;AAE7D;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,IAAY;IAChD,OAAO,IAAA,wBAAe,EACpB,IAAA,oBAAW,EAAC,2CAA+B,EAAE,IAAI,CAAC,EAClD,IAAA,mBAAU,GAAE,CACK,CAAA;AACrB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** Built-in transports and their required endpoint environment variables. */
|
|
2
|
-
export declare const BUILTIN_NOTIFICATION_TRANSPORT_ENV: Record<string, string>;
|
|
3
|
-
/**
|
|
4
|
-
* Parses NOTIFICATION_TRANSPORTS the same way as NotificationEventHandler.
|
|
5
|
-
* Defaults to appsync-graphql when unset or empty.
|
|
6
|
-
*/
|
|
7
|
-
export declare function parseNotificationTransports(raw: string | undefined): string[];
|
|
8
|
-
export declare function validateBuiltinNotificationTransportEnv(config: Record<string, unknown>): void;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BUILTIN_NOTIFICATION_TRANSPORT_ENV = void 0;
|
|
4
|
-
exports.parseNotificationTransports = parseNotificationTransports;
|
|
5
|
-
exports.validateBuiltinNotificationTransportEnv = validateBuiltinNotificationTransportEnv;
|
|
6
|
-
const enums_1 = require("./notifications/enums");
|
|
7
|
-
/** Built-in transports and their required endpoint environment variables. */
|
|
8
|
-
exports.BUILTIN_NOTIFICATION_TRANSPORT_ENV = {
|
|
9
|
-
[enums_1.NotificationTransports.APPSYNC_GRAPHQL]: 'APPSYNC_ENDPOINT',
|
|
10
|
-
[enums_1.NotificationTransports.APPSYNC_EVENT]: 'APPSYNC_EVENTS_ENDPOINT',
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Parses NOTIFICATION_TRANSPORTS the same way as NotificationEventHandler.
|
|
14
|
-
* Defaults to appsync-graphql when unset or empty.
|
|
15
|
-
*/
|
|
16
|
-
function parseNotificationTransports(raw) {
|
|
17
|
-
const names = (raw ?? '')
|
|
18
|
-
.split(',')
|
|
19
|
-
.map((s) => s.trim())
|
|
20
|
-
.filter(Boolean);
|
|
21
|
-
return names.length > 0 ? names : [enums_1.NotificationTransports.APPSYNC_GRAPHQL];
|
|
22
|
-
}
|
|
23
|
-
function validateBuiltinNotificationTransportEnv(config) {
|
|
24
|
-
const active = parseNotificationTransports(config.NOTIFICATION_TRANSPORTS);
|
|
25
|
-
for (const name of active) {
|
|
26
|
-
const envKey = exports.BUILTIN_NOTIFICATION_TRANSPORT_ENV[name];
|
|
27
|
-
if (!envKey) {
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
const value = config[envKey];
|
|
31
|
-
if (typeof value !== 'string' || !value.trim()) {
|
|
32
|
-
throw new Error(`Notification transport "${name}" is enabled (NOTIFICATION_TRANSPORTS) but ${envKey} is not set.`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=notification-env.validation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification-env.validation.js","sourceRoot":"","sources":["../src/notification-env.validation.ts"],"names":[],"mappings":";;;AAYA,kEAMC;AAED,0FAoBC;AAxCD,iDAA8D;AAE9D,6EAA6E;AAChE,QAAA,kCAAkC,GAA2B;IACxE,CAAC,8BAAsB,CAAC,eAAe,CAAC,EAAE,kBAAkB;IAC5D,CAAC,8BAAsB,CAAC,aAAa,CAAC,EAAE,yBAAyB;CAClE,CAAA;AAED;;;GAGG;AACH,SAAgB,2BAA2B,CAAC,GAAuB;IACjE,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC;SACtB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC,CAAA;IAClB,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,8BAAsB,CAAC,eAAe,CAAC,CAAA;AAC5E,CAAC;AAED,SAAgB,uCAAuC,CACrD,MAA+B;IAE/B,MAAM,MAAM,GAAG,2BAA2B,CACxC,MAAM,CAAC,uBAA6C,CACrD,CAAA;IAED,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,0CAAkC,CAAC,IAAI,CAAC,CAAA;QACvD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,SAAQ;QACV,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;QAC5B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;YAC/C,MAAM,IAAI,KAAK,CACb,2BAA2B,IAAI,8CAA8C,MAAM,cAAc,CAClG,CAAA;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ConfigService } from '@nestjs/config';
|
|
2
|
-
import { INotification } from '../interfaces';
|
|
3
|
-
import { INotificationTransport } from './interfaces';
|
|
4
|
-
export declare class AppSyncEventsService implements INotificationTransport {
|
|
5
|
-
private readonly config;
|
|
6
|
-
private readonly logger;
|
|
7
|
-
private readonly url;
|
|
8
|
-
private readonly namespace;
|
|
9
|
-
private readonly signer;
|
|
10
|
-
constructor(config: ConfigService);
|
|
11
|
-
/**
|
|
12
|
-
* Publish INotification to an AppSync Events channel via IAM SigV4.
|
|
13
|
-
*
|
|
14
|
-
* Channel structure (max 5 segments, seg 1 = namespace):
|
|
15
|
-
* /{namespace}/{tenantCode}/{action}/{sanitizedId}
|
|
16
|
-
*
|
|
17
|
-
* Client subscription options (wildcard /* catches all sub-channels):
|
|
18
|
-
* /{namespace}/{tenantCode}/* — all events for tenant
|
|
19
|
-
* /{namespace}/{tenantCode}/{action}/* — filtered by action
|
|
20
|
-
* /{namespace}/{tenantCode}/{action}/{id} — specific command
|
|
21
|
-
*
|
|
22
|
-
* Requires: Lambda execution role must have appsync:EventPublish permission.
|
|
23
|
-
*/
|
|
24
|
-
sendMessage(notification: INotification): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Resolves the most specific channel path for a notification.
|
|
27
|
-
* Non-alphanumeric characters (e.g. #, @) are sanitized to dashes
|
|
28
|
-
* since AppSync Events channel segments only allow [a-zA-Z0-9-].
|
|
29
|
-
*/
|
|
30
|
-
resolveChannel(notification: INotification): string;
|
|
31
|
-
/**
|
|
32
|
-
* Formats a string to comply with AppSync Events API channel segment rules:
|
|
33
|
-
* 1. Only alphanumeric characters and dashes.
|
|
34
|
-
* 2. Cannot start or end with a dash.
|
|
35
|
-
* 3. Maximum length of 50 characters.
|
|
36
|
-
*/
|
|
37
|
-
private sanitizeSegment;
|
|
38
|
-
private postToChannel;
|
|
39
|
-
/**
|
|
40
|
-
* Builds and signs an HttpRequest for the given channel and notification.
|
|
41
|
-
* Separating signing from the fetch call makes each step independently testable.
|
|
42
|
-
*/
|
|
43
|
-
private signRequest;
|
|
44
|
-
}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
var AppSyncEventsService_1;
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.AppSyncEventsService = void 0;
|
|
17
|
-
const node_crypto_1 = require("node:crypto");
|
|
18
|
-
const sha256_js_1 = require("@aws-crypto/sha256-js");
|
|
19
|
-
const credential_provider_node_1 = require("@aws-sdk/credential-provider-node");
|
|
20
|
-
const common_1 = require("@nestjs/common");
|
|
21
|
-
const config_1 = require("@nestjs/config");
|
|
22
|
-
const protocol_http_1 = require("@smithy/protocol-http");
|
|
23
|
-
const signature_v4_1 = require("@smithy/signature-v4");
|
|
24
|
-
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
25
|
-
const decorators_1 = require("../decorators");
|
|
26
|
-
const enums_1 = require("./enums");
|
|
27
|
-
/** Default headers required for AppSync Events API requests */
|
|
28
|
-
const DEFAULT_HEADERS = {
|
|
29
|
-
accept: 'application/json, text/javascript',
|
|
30
|
-
'content-encoding': 'amz-1.0',
|
|
31
|
-
'content-type': 'application/json; charset=UTF-8',
|
|
32
|
-
};
|
|
33
|
-
let AppSyncEventsService = AppSyncEventsService_1 = class AppSyncEventsService {
|
|
34
|
-
constructor(config) {
|
|
35
|
-
this.config = config;
|
|
36
|
-
this.logger = new common_1.Logger(AppSyncEventsService_1.name);
|
|
37
|
-
const endpoint = config.get('APPSYNC_EVENTS_ENDPOINT');
|
|
38
|
-
this.namespace = config.get('APPSYNC_EVENTS_NAMESPACE') ?? 'default';
|
|
39
|
-
if (endpoint) {
|
|
40
|
-
this.url = new URL(endpoint);
|
|
41
|
-
// Region is parsed from the hostname automatically:
|
|
42
|
-
// <id>.appsync-api.<region>.amazonaws.com → region
|
|
43
|
-
// Falls back to AWS_REGION env var (always set in Lambda runtime).
|
|
44
|
-
const match = this.url.hostname.match(/\w+\.appsync-api\.([\w-]+)\.amazonaws\.com/);
|
|
45
|
-
const region = match?.[1] ?? process.env.AWS_REGION ?? 'ap-northeast-1';
|
|
46
|
-
this.signer = new signature_v4_1.SignatureV4({
|
|
47
|
-
credentials: (0, credential_provider_node_1.defaultProvider)(),
|
|
48
|
-
service: 'appsync',
|
|
49
|
-
region,
|
|
50
|
-
sha256: sha256_js_1.Sha256,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Publish INotification to an AppSync Events channel via IAM SigV4.
|
|
56
|
-
*
|
|
57
|
-
* Channel structure (max 5 segments, seg 1 = namespace):
|
|
58
|
-
* /{namespace}/{tenantCode}/{action}/{sanitizedId}
|
|
59
|
-
*
|
|
60
|
-
* Client subscription options (wildcard /* catches all sub-channels):
|
|
61
|
-
* /{namespace}/{tenantCode}/* — all events for tenant
|
|
62
|
-
* /{namespace}/{tenantCode}/{action}/* — filtered by action
|
|
63
|
-
* /{namespace}/{tenantCode}/{action}/{id} — specific command
|
|
64
|
-
*
|
|
65
|
-
* Requires: Lambda execution role must have appsync:EventPublish permission.
|
|
66
|
-
*/
|
|
67
|
-
async sendMessage(notification) {
|
|
68
|
-
if (!this.url || !this.signer) {
|
|
69
|
-
this.logger.warn('APPSYNC_EVENTS_ENDPOINT not set, skipping');
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const channel = this.resolveChannel(notification);
|
|
73
|
-
this.logger.debug(`sendMessage:: channel=${channel}`);
|
|
74
|
-
await this.postToChannel(channel, notification);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Resolves the most specific channel path for a notification.
|
|
78
|
-
* Non-alphanumeric characters (e.g. #, @) are sanitized to dashes
|
|
79
|
-
* since AppSync Events channel segments only allow [a-zA-Z0-9-].
|
|
80
|
-
*/
|
|
81
|
-
resolveChannel(notification) {
|
|
82
|
-
const namespace = this.sanitizeSegment(this.namespace);
|
|
83
|
-
const tenantCode = this.sanitizeSegment(notification.tenantCode);
|
|
84
|
-
const action = this.sanitizeSegment(notification.action);
|
|
85
|
-
const id = this.sanitizeSegment(notification.id);
|
|
86
|
-
return `/${namespace}/${tenantCode}/${action}/${id}`;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Formats a string to comply with AppSync Events API channel segment rules:
|
|
90
|
-
* 1. Only alphanumeric characters and dashes.
|
|
91
|
-
* 2. Cannot start or end with a dash.
|
|
92
|
-
* 3. Maximum length of 50 characters.
|
|
93
|
-
*/
|
|
94
|
-
sanitizeSegment(segment) {
|
|
95
|
-
if (!segment)
|
|
96
|
-
return 'none';
|
|
97
|
-
// Replace any non-alphanumeric character (like _, %, =) with a dash
|
|
98
|
-
let s = segment.replace(/[^a-zA-Z0-9]/g, '-');
|
|
99
|
-
// Truncate to AWS's strict 50 character limit
|
|
100
|
-
s = s.substring(0, 50);
|
|
101
|
-
// Strip out any dashes from the very beginning or end
|
|
102
|
-
s = s.replace(/^-+|-+$/g, '');
|
|
103
|
-
// Fallback if the string became empty after trimming
|
|
104
|
-
return s || 'none';
|
|
105
|
-
}
|
|
106
|
-
async postToChannel(channel, notification) {
|
|
107
|
-
const signedReq = await this.signRequest(channel, notification);
|
|
108
|
-
const res = await (0, node_fetch_1.default)(this.url.toString(), {
|
|
109
|
-
method: signedReq.method,
|
|
110
|
-
headers: signedReq.headers,
|
|
111
|
-
body: signedReq.body,
|
|
112
|
-
});
|
|
113
|
-
if (!res.ok) {
|
|
114
|
-
const text = await res.text();
|
|
115
|
-
throw new Error(`AppSync Events publish failed [${res.status}] on channel ${channel}: ${text}`);
|
|
116
|
-
}
|
|
117
|
-
this.logger.debug(`sendMessage:: published successfully to ${channel}`);
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Builds and signs an HttpRequest for the given channel and notification.
|
|
121
|
-
* Separating signing from the fetch call makes each step independently testable.
|
|
122
|
-
*/
|
|
123
|
-
async signRequest(channel, notification) {
|
|
124
|
-
const body = JSON.stringify({
|
|
125
|
-
id: (0, node_crypto_1.randomUUID)(),
|
|
126
|
-
channel,
|
|
127
|
-
events: [JSON.stringify(notification)],
|
|
128
|
-
});
|
|
129
|
-
const httpRequest = new protocol_http_1.HttpRequest({
|
|
130
|
-
method: 'POST',
|
|
131
|
-
headers: {
|
|
132
|
-
...DEFAULT_HEADERS,
|
|
133
|
-
host: this.url.hostname,
|
|
134
|
-
},
|
|
135
|
-
body,
|
|
136
|
-
hostname: this.url.hostname,
|
|
137
|
-
path: this.url.pathname,
|
|
138
|
-
});
|
|
139
|
-
return this.signer.sign(httpRequest);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
exports.AppSyncEventsService = AppSyncEventsService;
|
|
143
|
-
exports.AppSyncEventsService = AppSyncEventsService = AppSyncEventsService_1 = __decorate([
|
|
144
|
-
(0, decorators_1.NotificationTransport)(enums_1.NotificationTransports.APPSYNC_EVENT),
|
|
145
|
-
__metadata("design:paramtypes", [config_1.ConfigService])
|
|
146
|
-
], AppSyncEventsService);
|
|
147
|
-
//# sourceMappingURL=appsync-events.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"appsync-events.service.js","sourceRoot":"","sources":["../../src/notifications/appsync-events.service.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './notification-transport.enum';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./notification-transport.enum"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/notifications/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA6C"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotificationTransports = void 0;
|
|
4
|
-
var NotificationTransports;
|
|
5
|
-
(function (NotificationTransports) {
|
|
6
|
-
NotificationTransports["APPSYNC_GRAPHQL"] = "appsync-graphql";
|
|
7
|
-
NotificationTransports["APPSYNC_EVENT"] = "appsync-event";
|
|
8
|
-
})(NotificationTransports || (exports.NotificationTransports = NotificationTransports = {}));
|
|
9
|
-
//# sourceMappingURL=notification-transport.enum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification-transport.enum.js","sourceRoot":"","sources":["../../../src/notifications/enums/notification-transport.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,6DAAmC,CAAA;IACnC,yDAA+B,CAAA;AACjC,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './notification-transport.interface';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./notification-transport.interface"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/notifications/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAkD"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { INotification } from '../../interfaces';
|
|
2
|
-
export declare const NOTIFICATION_TRANSPORT = "NOTIFICATION_TRANSPORT";
|
|
3
|
-
export interface INotificationTransport {
|
|
4
|
-
name?: string;
|
|
5
|
-
sendMessage(notification: INotification): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
export type NotificationTransportMap = Map<string, INotificationTransport>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification-transport.interface.js","sourceRoot":"","sources":["../../../src/notifications/interfaces/notification-transport.interface.ts"],"names":[],"mappings":";;;AAEa,QAAA,sBAAsB,GAAG,wBAAwB,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.MockGroupRoleResolver = void 0;
|
|
10
|
-
const decorators_1 = require("../../decorators");
|
|
11
|
-
let MockGroupRoleResolver = class MockGroupRoleResolver {
|
|
12
|
-
async resolveRoles() {
|
|
13
|
-
return [];
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
exports.MockGroupRoleResolver = MockGroupRoleResolver;
|
|
17
|
-
exports.MockGroupRoleResolver = MockGroupRoleResolver = __decorate([
|
|
18
|
-
(0, decorators_1.GroupRoleResolver)()
|
|
19
|
-
], MockGroupRoleResolver);
|
|
20
|
-
//# sourceMappingURL=group-role-resolver.mock.js.map
|