@dudousxd/nestjs-notifications-preferences 0.3.0 → 0.4.0
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NotifiableRef } from '@dudousxd/nestjs-notifications-core';
|
|
2
|
-
import { type Type } from '@nestjs/common';
|
|
2
|
+
import { type CanActivate, type Type } from '@nestjs/common';
|
|
3
3
|
/** Options for {@link createPreferenceCenterController}. */
|
|
4
4
|
export interface PreferenceCenterControllerOptions {
|
|
5
5
|
/**
|
|
@@ -9,6 +9,10 @@ export interface PreferenceCenterControllerOptions {
|
|
|
9
9
|
resolveRef: (req: any) => NotifiableRef | Promise<NotifiableRef>;
|
|
10
10
|
/** Optional resolver for the tenant scope (multi-tenant apps). May be async. */
|
|
11
11
|
resolveTenant?: (req: any) => string | undefined | Promise<string | undefined>;
|
|
12
|
+
/** Controller base path. Default `'preferences'`. */
|
|
13
|
+
path?: string;
|
|
14
|
+
/** Guards to protect the endpoints with (e.g. your auth guard). Applied via `@UseGuards`. */
|
|
15
|
+
guards?: Array<Type<CanActivate> | CanActivate>;
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* Builds a `@Controller('preferences')` exposing the preference-center backend that a UI (e.g.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preference-center.controller.d.ts","sourceRoot":"","sources":["../src/preference-center.controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,
|
|
1
|
+
{"version":3,"file":"preference-center.controller.d.ts","sourceRoot":"","sources":["../src/preference-center.controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAEL,KAAK,WAAW,EAMhB,KAAK,IAAI,EAEV,MAAM,gBAAgB,CAAC;AAQxB,4DAA4D;AAC5D,MAAM,WAAW,iCAAiC;IAChD;;;OAGG;IACH,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACjE,gFAAgF;IAChF,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/E,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6FAA6F;IAC7F,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,CAAC;CACjD;AAYD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,iCAAiC,GACzC,IAAI,CAAC,OAAO,CAAC,CAgDf"}
|
|
@@ -93,9 +93,12 @@ function createPreferenceCenterController(options) {
|
|
|
93
93
|
__metadata("design:returntype", Promise)
|
|
94
94
|
], PreferenceCenterController.prototype, "setDigest", null);
|
|
95
95
|
PreferenceCenterController = __decorate([
|
|
96
|
-
(0, common_1.Controller)('preferences'),
|
|
96
|
+
(0, common_1.Controller)(options.path ?? 'preferences'),
|
|
97
97
|
__metadata("design:paramtypes", [preference_center_service_1.PreferenceCenterService])
|
|
98
98
|
], PreferenceCenterController);
|
|
99
|
+
if (options.guards && options.guards.length > 0) {
|
|
100
|
+
(0, common_1.UseGuards)(...options.guards)(PreferenceCenterController);
|
|
101
|
+
}
|
|
99
102
|
return PreferenceCenterController;
|
|
100
103
|
}
|
|
101
104
|
//# sourceMappingURL=preference-center.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preference-center.controller.js","sourceRoot":"","sources":["../src/preference-center.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"preference-center.controller.js","sourceRoot":"","sources":["../src/preference-center.controller.ts"],"names":[],"mappings":";;;;;;;;;;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
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Per-user, per-tenant channel preferences for nestjs-notifications — opt-out muting enforced via the core PreferenceGate",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Davide Carvalho",
|