@marinoscar/platform-api 0.1.0-next.21 → 0.1.0-next.23
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/CHANGELOG.md +28 -0
- package/dist/ai/features/ai-feature.registry.d.ts +7 -0
- package/dist/ai/features/ai-feature.registry.d.ts.map +1 -1
- package/dist/ai/features/ai-feature.registry.js +3 -0
- package/dist/ai/features/ai-feature.registry.js.map +1 -1
- package/dist/ai/keys/ai-key-resolver.service.d.ts +16 -0
- package/dist/ai/keys/ai-key-resolver.service.d.ts.map +1 -1
- package/dist/ai/keys/ai-key-resolver.service.js +44 -0
- package/dist/ai/keys/ai-key-resolver.service.js.map +1 -1
- package/dist/ai/keys/usable-models.service.d.ts +13 -1
- package/dist/ai/keys/usable-models.service.d.ts.map +1 -1
- package/dist/ai/keys/usable-models.service.js +37 -12
- package/dist/ai/keys/usable-models.service.js.map +1 -1
- package/dist/ai/runtime/ai-limits.service.d.ts +2 -1
- package/dist/ai/runtime/ai-limits.service.d.ts.map +1 -1
- package/dist/ai/runtime/ai-limits.service.js +7 -2
- package/dist/ai/runtime/ai-limits.service.js.map +1 -1
- package/dist/ai/runtime/ai-runtime.types.d.ts +46 -1
- package/dist/ai/runtime/ai-runtime.types.d.ts.map +1 -1
- package/dist/ai/runtime/ai-runtime.types.js.map +1 -1
- package/dist/ai/runtime/ai.service.d.ts +142 -5
- package/dist/ai/runtime/ai.service.d.ts.map +1 -1
- package/dist/ai/runtime/ai.service.js +353 -46
- package/dist/ai/runtime/ai.service.js.map +1 -1
- package/dist/ai/runtime/index.d.ts +1 -1
- package/dist/ai/runtime/index.d.ts.map +1 -1
- package/dist/ai/runtime/target-resolver.d.ts +2 -2
- package/dist/ai/runtime/target-resolver.d.ts.map +1 -1
- package/dist/ai/runtime/target-resolver.js +2 -1
- package/dist/ai/runtime/target-resolver.js.map +1 -1
- package/dist/ai/testing/conformance/ai-key-policy.suite.d.ts.map +1 -1
- package/dist/ai/testing/conformance/ai-key-policy.suite.js +54 -0
- package/dist/ai/testing/conformance/ai-key-policy.suite.js.map +1 -1
- package/dist/ai/testing/conformance/ai-secret-egress.suite.d.ts.map +1 -1
- package/dist/ai/testing/conformance/ai-secret-egress.suite.js +59 -0
- package/dist/ai/testing/conformance/ai-secret-egress.suite.js.map +1 -1
- package/dist/identity/device-auth/device-auth.service.d.ts +9 -2
- package/dist/identity/device-auth/device-auth.service.d.ts.map +1 -1
- package/dist/identity/device-auth/device-auth.service.js +44 -4
- package/dist/identity/device-auth/device-auth.service.js.map +1 -1
- package/dist/identity/device-auth/dto/device-code-request.dto.d.ts +12 -0
- package/dist/identity/device-auth/dto/device-code-request.dto.d.ts.map +1 -1
- package/dist/identity/identity.options.d.ts +25 -0
- package/dist/identity/identity.options.d.ts.map +1 -1
- package/dist/identity/identity.options.js +11 -0
- package/dist/identity/identity.options.js.map +1 -1
- package/dist/identity/index.d.ts +1 -1
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/nodes/current-node.decorator.d.ts +18 -0
- package/dist/nodes/current-node.decorator.d.ts.map +1 -0
- package/dist/nodes/current-node.decorator.js +28 -0
- package/dist/nodes/current-node.decorator.js.map +1 -0
- package/dist/nodes/index.d.ts +8 -0
- package/dist/nodes/index.d.ts.map +1 -1
- package/dist/nodes/index.js +21 -2
- package/dist/nodes/index.js.map +1 -1
- package/dist/nodes/node-ownership.d.ts +34 -0
- package/dist/nodes/node-ownership.d.ts.map +1 -0
- package/dist/nodes/node-ownership.js +92 -0
- package/dist/nodes/node-ownership.js.map +1 -0
- package/dist/nodes/node-route.decorator.d.ts +31 -0
- package/dist/nodes/node-route.decorator.d.ts.map +1 -0
- package/dist/nodes/node-route.decorator.js +54 -0
- package/dist/nodes/node-route.decorator.js.map +1 -0
- package/dist/nodes/node-route.guard.d.ts +22 -0
- package/dist/nodes/node-route.guard.d.ts.map +1 -0
- package/dist/nodes/node-route.guard.js +74 -0
- package/dist/nodes/node-route.guard.js.map +1 -0
- package/dist/nodes/node-route.module.d.ts +21 -0
- package/dist/nodes/node-route.module.d.ts.map +1 -0
- package/dist/nodes/node-route.module.js +99 -0
- package/dist/nodes/node-route.module.js.map +1 -0
- package/dist/nodes/node-route.options.d.ts +59 -0
- package/dist/nodes/node-route.options.d.ts.map +1 -0
- package/dist/nodes/node-route.options.js +29 -0
- package/dist/nodes/node-route.options.js.map +1 -0
- package/dist/nodes/node-route.paths.d.ts +47 -0
- package/dist/nodes/node-route.paths.d.ts.map +1 -0
- package/dist/nodes/node-route.paths.js +129 -0
- package/dist/nodes/node-route.paths.js.map +1 -0
- package/dist/nodes/nodes.service.d.ts.map +1 -1
- package/dist/nodes/nodes.service.js +3 -15
- package/dist/nodes/nodes.service.js.map +1 -1
- package/dist/nodes/testing/conformance.d.ts +86 -0
- package/dist/nodes/testing/conformance.d.ts.map +1 -0
- package/dist/nodes/testing/conformance.js +230 -0
- package/dist/nodes/testing/conformance.js.map +1 -0
- package/dist/nodes/testing/discover.d.ts +13 -0
- package/dist/nodes/testing/discover.d.ts.map +1 -0
- package/dist/nodes/testing/discover.js +42 -0
- package/dist/nodes/testing/discover.js.map +1 -0
- package/dist/nodes/testing/index.d.ts +3 -0
- package/dist/nodes/testing/index.d.ts.map +1 -0
- package/dist/nodes/testing/index.js +13 -0
- package/dist/nodes/testing/index.js.map +1 -0
- package/dist/notifications/channels/browser-notification.channel.d.ts +11 -0
- package/dist/notifications/channels/browser-notification.channel.d.ts.map +1 -1
- package/dist/notifications/channels/browser-notification.channel.js +71 -48
- package/dist/notifications/channels/browser-notification.channel.js.map +1 -1
- package/dist/notifications/data/notifications-db.d.ts +19 -0
- package/dist/notifications/data/notifications-db.d.ts.map +1 -1
- package/dist/notifications/dto/notification.dto.d.ts +4 -0
- package/dist/notifications/dto/notification.dto.d.ts.map +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/notification-inbox-writer.d.ts +112 -0
- package/dist/notifications/notification-inbox-writer.d.ts.map +1 -0
- package/dist/notifications/notification-inbox-writer.js +217 -0
- package/dist/notifications/notification-inbox-writer.js.map +1 -0
- package/dist/notifications/notification-store.service.d.ts +10 -0
- package/dist/notifications/notification-store.service.d.ts.map +1 -1
- package/dist/notifications/notification-store.service.js +55 -10
- package/dist/notifications/notification-store.service.js.map +1 -1
- package/dist/notifications/notification-stream.service.d.ts +8 -0
- package/dist/notifications/notification-stream.service.d.ts.map +1 -1
- package/dist/notifications/notification-stream.service.js.map +1 -1
- package/dist/notifications/notification.types.d.ts +74 -0
- package/dist/notifications/notification.types.d.ts.map +1 -1
- package/dist/notifications/notification.types.js.map +1 -1
- package/dist/notifications/notifications.controller.d.ts +1 -0
- package/dist/notifications/notifications.controller.d.ts.map +1 -1
- package/dist/notifications/notifications.controller.js +23 -0
- package/dist/notifications/notifications.controller.js.map +1 -1
- package/dist/notifications/notifications.service.d.ts +56 -1
- package/dist/notifications/notifications.service.d.ts.map +1 -1
- package/dist/notifications/notifications.service.js +122 -0
- package/dist/notifications/notifications.service.js.map +1 -1
- package/dist/notifications/registry/event.registry.d.ts +15 -0
- package/dist/notifications/registry/event.registry.d.ts.map +1 -1
- package/dist/notifications/registry/event.registry.js +3 -0
- package/dist/notifications/registry/event.registry.js.map +1 -1
- package/dist/notifications/retention/notification-inbox-purge.handler.d.ts.map +1 -1
- package/dist/notifications/retention/notification-inbox-purge.handler.js +16 -4
- package/dist/notifications/retention/notification-inbox-purge.handler.js.map +1 -1
- package/dist/notifications/testing/index.d.ts +2 -0
- package/dist/notifications/testing/index.d.ts.map +1 -1
- package/dist/notifications/testing/index.js +5 -1
- package/dist/notifications/testing/index.js.map +1 -1
- package/dist/storage/config/storage-config.service.d.ts +24 -0
- package/dist/storage/config/storage-config.service.d.ts.map +1 -1
- package/dist/storage/config/storage-config.service.js +31 -5
- package/dist/storage/config/storage-config.service.js.map +1 -1
- package/dist/storage/handlers/storage-cleanup.handler.d.ts +3 -1
- package/dist/storage/handlers/storage-cleanup.handler.d.ts.map +1 -1
- package/dist/storage/handlers/storage-cleanup.handler.js +10 -3
- package/dist/storage/handlers/storage-cleanup.handler.js.map +1 -1
- package/dist/storage/index.d.ts +5 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +12 -3
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/objects/dto/get-part-urls.dto.d.ts +26 -0
- package/dist/storage/objects/dto/get-part-urls.dto.d.ts.map +1 -0
- package/dist/storage/objects/dto/get-part-urls.dto.js +25 -0
- package/dist/storage/objects/dto/get-part-urls.dto.js.map +1 -0
- package/dist/storage/objects/dto/init-upload.dto.d.ts +2 -1
- package/dist/storage/objects/dto/init-upload.dto.d.ts.map +1 -1
- package/dist/storage/objects/objects.controller.d.ts +13 -1
- package/dist/storage/objects/objects.controller.d.ts.map +1 -1
- package/dist/storage/objects/objects.controller.js +88 -1
- package/dist/storage/objects/objects.controller.js.map +1 -1
- package/dist/storage/objects/objects.service.d.ts +46 -1
- package/dist/storage/objects/objects.service.d.ts.map +1 -1
- package/dist/storage/objects/objects.service.js +277 -23
- package/dist/storage/objects/objects.service.js.map +1 -1
- package/dist/storage/objects/part-body-parser.d.ts +30 -0
- package/dist/storage/objects/part-body-parser.d.ts.map +1 -0
- package/dist/storage/objects/part-body-parser.js +45 -0
- package/dist/storage/objects/part-body-parser.js.map +1 -0
- package/dist/storage/objects/part-body.d.ts +23 -0
- package/dist/storage/objects/part-body.d.ts.map +1 -0
- package/dist/storage/objects/part-body.js +48 -0
- package/dist/storage/objects/part-body.js.map +1 -0
- package/dist/storage/processing/object-processing.service.d.ts +4 -1
- package/dist/storage/processing/object-processing.service.d.ts.map +1 -1
- package/dist/storage/processing/object-processing.service.js +11 -3
- package/dist/storage/processing/object-processing.service.js.map +1 -1
- package/dist/storage/profile-image/avatar.service.d.ts +3 -1
- package/dist/storage/profile-image/avatar.service.d.ts.map +1 -1
- package/dist/storage/profile-image/avatar.service.js +8 -3
- package/dist/storage/profile-image/avatar.service.js.map +1 -1
- package/dist/storage/profile-image/profile-image.service.d.ts +4 -1
- package/dist/storage/profile-image/profile-image.service.d.ts.map +1 -1
- package/dist/storage/profile-image/profile-image.service.js +11 -5
- package/dist/storage/profile-image/profile-image.service.js.map +1 -1
- package/dist/storage/providers/index.d.ts +3 -1
- package/dist/storage/providers/index.d.ts.map +1 -1
- package/dist/storage/providers/index.js +8 -1
- package/dist/storage/providers/index.js.map +1 -1
- package/dist/storage/providers/resolving-storage.provider.d.ts +11 -0
- package/dist/storage/providers/resolving-storage.provider.d.ts.map +1 -1
- package/dist/storage/providers/resolving-storage.provider.js +13 -0
- package/dist/storage/providers/resolving-storage.provider.js.map +1 -1
- package/dist/storage/providers/s3/s3-storage.provider.d.ts +9 -1
- package/dist/storage/providers/s3/s3-storage.provider.d.ts.map +1 -1
- package/dist/storage/providers/s3/s3-storage.provider.js +37 -0
- package/dist/storage/providers/s3/s3-storage.provider.js.map +1 -1
- package/dist/storage/providers/storage-provider-router.d.ts +64 -0
- package/dist/storage/providers/storage-provider-router.d.ts.map +1 -0
- package/dist/storage/providers/storage-provider-router.js +161 -0
- package/dist/storage/providers/storage-provider-router.js.map +1 -0
- package/dist/storage/providers/storage-provider.interface.d.ts +34 -1
- package/dist/storage/providers/storage-provider.interface.d.ts.map +1 -1
- package/dist/storage/providers/storage-provider.interface.js.map +1 -1
- package/dist/storage/providers/storage-provider.types.d.ts +86 -0
- package/dist/storage/providers/storage-provider.types.d.ts.map +1 -1
- package/dist/storage/providers/storage-provider.types.js +78 -0
- package/dist/storage/providers/storage-provider.types.js.map +1 -1
- package/dist/storage/providers/storage-providers.module.d.ts.map +1 -1
- package/dist/storage/providers/storage-providers.module.js +3 -1
- package/dist/storage/providers/storage-providers.module.js.map +1 -1
- package/dist/storage/testing/conformance.d.ts +12 -0
- package/dist/storage/testing/conformance.d.ts.map +1 -1
- package/dist/storage/testing/conformance.js +112 -0
- package/dist/storage/testing/conformance.js.map +1 -1
- package/dist/storage/testing/driver-conformance.d.ts +13 -1
- package/dist/storage/testing/driver-conformance.d.ts.map +1 -1
- package/dist/storage/testing/driver-conformance.js +134 -0
- package/dist/storage/testing/driver-conformance.js.map +1 -1
- package/dist/storage/testing/index.d.ts +1 -1
- package/dist/storage/testing/index.d.ts.map +1 -1
- package/dist/storage/testing/index.js +2 -1
- package/dist/storage/testing/index.js.map +1 -1
- package/dist/telemetry/stack/dto/telemetry-stack.dto.d.ts +1 -1
- package/package.json +7 -3
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.discoverAppControllers = discoverAppControllers;
|
|
4
|
+
const constants_1 = require("@nestjs/common/constants");
|
|
5
|
+
const isDynamic = (value) => typeof value === 'object' && value !== null && 'module' in value;
|
|
6
|
+
const isForwardRef = (value) => typeof value === 'object' && value !== null && 'forwardRef' in value;
|
|
7
|
+
/**
|
|
8
|
+
* Every controller class reachable from `root` through module imports (static
|
|
9
|
+
* and dynamic), each once. A local copy of the identity suite's walk: a slice
|
|
10
|
+
* may not import another slice's internals, only its index.
|
|
11
|
+
*
|
|
12
|
+
* @param root - the app's root module.
|
|
13
|
+
* @returns the controllers, in discovery order.
|
|
14
|
+
*
|
|
15
|
+
* @stability experimental
|
|
16
|
+
*/
|
|
17
|
+
function discoverAppControllers(root) {
|
|
18
|
+
const seen = new Set();
|
|
19
|
+
const controllers = [];
|
|
20
|
+
const visit = (entry) => {
|
|
21
|
+
if (!entry || entry instanceof Promise)
|
|
22
|
+
return;
|
|
23
|
+
const resolved = isForwardRef(entry) ? entry.forwardRef() : entry;
|
|
24
|
+
if (seen.has(resolved))
|
|
25
|
+
return;
|
|
26
|
+
seen.add(resolved);
|
|
27
|
+
const moduleClass = isDynamic(resolved) ? resolved.module : resolved;
|
|
28
|
+
const staticImports = (Reflect.getMetadata(constants_1.MODULE_METADATA.IMPORTS, moduleClass) ?? []);
|
|
29
|
+
const staticControllers = (Reflect.getMetadata(constants_1.MODULE_METADATA.CONTROLLERS, moduleClass) ?? []);
|
|
30
|
+
const dynamicImports = (isDynamic(resolved) ? resolved.imports ?? [] : []);
|
|
31
|
+
const dynamicControllers = isDynamic(resolved) ? resolved.controllers ?? [] : [];
|
|
32
|
+
for (const controller of [...staticControllers, ...dynamicControllers]) {
|
|
33
|
+
if (!controllers.includes(controller))
|
|
34
|
+
controllers.push(controller);
|
|
35
|
+
}
|
|
36
|
+
for (const child of [...staticImports, ...dynamicImports])
|
|
37
|
+
visit(child);
|
|
38
|
+
};
|
|
39
|
+
visit(root);
|
|
40
|
+
return controllers;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=discover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../../src/nodes/testing/discover.ts"],"names":[],"mappings":";;AAkBA,wDAoBC;AArCD,wDAA2D;AAI3D,MAAM,SAAS,GAAG,CAAC,KAAc,EAA0B,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,QAAQ,IAAI,KAAK,CAAC;AAC/H,MAAM,YAAY,GAAG,CAAC,KAAc,EAA6B,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,YAAY,IAAI,KAAK,CAAC;AAEzI;;;;;;;;;GASG;AACH,SAAgB,sBAAsB,CAAC,IAAmC;IACxE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAW,CAAC;IAChC,MAAM,WAAW,GAAyB,EAAE,CAAC;IAC7C,MAAM,KAAK,GAAG,CAAC,KAA6B,EAAQ,EAAE;QACpD,IAAI,CAAC,KAAK,IAAI,KAAK,YAAY,OAAO;YAAE,OAAO;QAC/C,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAK,CAAC,UAAU,EAAiB,CAAC,CAAC,CAAC,KA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/nodes/testing/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// `@marinoscar/platform-api/nodes/testing`: the nodes slice's test seam, the
|
|
3
|
+
// `nodes` conformance suite (issue #1076). Importing this entry registers the
|
|
4
|
+
// suite with `runPlatformConformance` (@marinoscar/platform-api/testing). Never
|
|
5
|
+
// import it from production code. Documented in ../README.md.
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.nodesConformanceSuite = exports.discoverNodeAppRoutes = exports.checkNodeRouteOwnership = exports.checkNodeAppRoutes = void 0;
|
|
8
|
+
var conformance_1 = require("./conformance");
|
|
9
|
+
Object.defineProperty(exports, "checkNodeAppRoutes", { enumerable: true, get: function () { return conformance_1.checkNodeAppRoutes; } });
|
|
10
|
+
Object.defineProperty(exports, "checkNodeRouteOwnership", { enumerable: true, get: function () { return conformance_1.checkNodeRouteOwnership; } });
|
|
11
|
+
Object.defineProperty(exports, "discoverNodeAppRoutes", { enumerable: true, get: function () { return conformance_1.discoverNodeAppRoutes; } });
|
|
12
|
+
Object.defineProperty(exports, "nodesConformanceSuite", { enumerable: true, get: function () { return conformance_1.nodesConformanceSuite; } });
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nodes/testing/index.ts"],"names":[],"mappings":";AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,gFAAgF;AAChF,8DAA8D;;;AAE9D,6CAKuB;AAJrB,iHAAA,kBAAkB,OAAA;AAClB,sHAAA,uBAAuB,OAAA;AACvB,oHAAA,qBAAqB,OAAA;AACrB,oHAAA,qBAAqB,OAAA"}
|
|
@@ -13,6 +13,7 @@ export declare class BrowserNotificationChannel implements NotificationChannelSe
|
|
|
13
13
|
private readonly stream;
|
|
14
14
|
readonly channel: NotificationChannel;
|
|
15
15
|
private readonly logger;
|
|
16
|
+
private readonly writer;
|
|
16
17
|
constructor(prisma: NotificationsPrisma, stream: NotificationStreamService);
|
|
17
18
|
/**
|
|
18
19
|
* The "address" for this channel is the ACCOUNT ITSELF.
|
|
@@ -44,6 +45,16 @@ export declare class BrowserNotificationChannel implements NotificationChannelSe
|
|
|
44
45
|
* writes can never disagree about who was notified.
|
|
45
46
|
*/
|
|
46
47
|
deliver(context: NotificationDispatchContext, to: string): Promise<ChannelDeliveryResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Write a STATE or COUNTED row and nudge open tabs when it is news.
|
|
50
|
+
*
|
|
51
|
+
* Never throws. A refresh that changes nothing the user can see (`quiet`)
|
|
52
|
+
* writes the row but sends no frame. A frame never raises an OS toast for an
|
|
53
|
+
* `incremented` row: the user already has that row unread, and a toast per
|
|
54
|
+
* folded occurrence would be the 4 000 notifications the fold exists to
|
|
55
|
+
* prevent.
|
|
56
|
+
*/
|
|
57
|
+
private deliverFolded;
|
|
47
58
|
/**
|
|
48
59
|
* Render an event's untyped payload into what the user sees.
|
|
49
60
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-notification.channel.d.ts","sourceRoot":"","sources":["../../../src/notifications/channels/browser-notification.channel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"browser-notification.channel.d.ts","sourceRoot":"","sources":["../../../src/notifications/channels/browser-notification.channel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAGlE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAyD/B,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAY7B;;;;GAIG;AACH,qBACa,0BAA2B,YAAW,yBAAyB;IAQ/C,OAAO,CAAC,QAAQ,CAAC,MAAM;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM;IARzB,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAa;IAElD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+C;IAEtE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;gBAGL,MAAM,EAAE,mBAAmB,EACpD,MAAM,EAAE,yBAAyB;IAKpD;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,SAAS,EAAE,qBAAqB,GAAG,MAAM,GAAG,IAAI;IAI1D;;;;;;;;;;OAUG;IACG,OAAO,CACX,OAAO,EAAE,2BAA2B,EACpC,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,qBAAqB,CAAC;IAsDjC;;;;;;;;OAQG;YACW,aAAa;IA2D3B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,OAAO,CAAC,MAAM;CAqCf;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAWpE"}
|
|
@@ -19,6 +19,7 @@ const common_1 = require("@nestjs/common");
|
|
|
19
19
|
const index_1 = require("../../core/index");
|
|
20
20
|
const describe_thrown_1 = require("../describe-thrown");
|
|
21
21
|
const notification_policy_1 = require("../notification-policy");
|
|
22
|
+
const notification_inbox_writer_1 = require("../notification-inbox-writer");
|
|
22
23
|
const notification_stream_service_1 = require("../notification-stream.service");
|
|
23
24
|
const registry_1 = require("../registry");
|
|
24
25
|
// `EVENT_BROWSER_TEMPLATES` (a frozen snapshot of the binding registry) is gone from the
|
|
@@ -38,9 +39,11 @@ let BrowserNotificationChannel = BrowserNotificationChannel_1 = class BrowserNot
|
|
|
38
39
|
stream;
|
|
39
40
|
channel = 'browser';
|
|
40
41
|
logger = new common_1.Logger(BrowserNotificationChannel_1.name);
|
|
42
|
+
writer;
|
|
41
43
|
constructor(prisma, stream) {
|
|
42
44
|
this.prisma = prisma;
|
|
43
45
|
this.stream = stream;
|
|
46
|
+
this.writer = new notification_inbox_writer_1.NotificationInboxWriter(prisma);
|
|
44
47
|
}
|
|
45
48
|
/**
|
|
46
49
|
* The "address" for this channel is the ACCOUNT ITSELF.
|
|
@@ -75,15 +78,15 @@ let BrowserNotificationChannel = BrowserNotificationChannel_1 = class BrowserNot
|
|
|
75
78
|
*/
|
|
76
79
|
async deliver(context, to) {
|
|
77
80
|
const eventKey = context.event.key;
|
|
81
|
+
// STATE and COUNTED rows (issue #1077) are upserted under an advisory
|
|
82
|
+
// lock; the template runs inside the write, on the final total.
|
|
83
|
+
if (context.inbox) {
|
|
84
|
+
return this.deliverFolded(context, to, context.inbox);
|
|
85
|
+
}
|
|
78
86
|
const rendered = this.render(context);
|
|
79
87
|
if (!rendered.ok) {
|
|
80
88
|
return { success: false, error: rendered.error };
|
|
81
89
|
}
|
|
82
|
-
// Normalised ONCE, here, and the same values are used for the row and for
|
|
83
|
-
// the stream. Applying the cap and the link check twice would be two
|
|
84
|
-
// chances for a tab to be shown something the database does not hold — and
|
|
85
|
-
// the stream copy is the one a native toast renders, so a divergence is a
|
|
86
|
-
// user seeing text that no audit of the table can explain.
|
|
87
90
|
const title = truncate(rendered.content.title, MAX_TITLE_LENGTH);
|
|
88
91
|
const body = truncate(rendered.content.body, MAX_BODY_LENGTH);
|
|
89
92
|
const link = sanitizeLink(rendered.content.link);
|
|
@@ -95,27 +98,11 @@ let BrowserNotificationChannel = BrowserNotificationChannel_1 = class BrowserNot
|
|
|
95
98
|
});
|
|
96
99
|
}
|
|
97
100
|
catch (err) {
|
|
98
|
-
// The database IS the delivery for this channel. A failed INSERT is a
|
|
99
|
-
// genuinely failed notification — unlike a publish that reaches no
|
|
100
|
-
// subscriber — so it is reported as one and lands in
|
|
101
|
-
// `notification_deliveries.error`.
|
|
102
101
|
return {
|
|
103
102
|
success: false,
|
|
104
103
|
error: `Could not write the notification record: ${(0, describe_thrown_1.describeThrown)(err)}`,
|
|
105
104
|
};
|
|
106
105
|
}
|
|
107
|
-
// Published AFTER the row is committed, never before. A tab that receives
|
|
108
|
-
// the event immediately renders or refetches from the same store;
|
|
109
|
-
// publishing first opens a window in which the client is told about a
|
|
110
|
-
// notification a refetch cannot find, which reads to the user as a bell
|
|
111
|
-
// that flickers and loses an item.
|
|
112
|
-
//
|
|
113
|
-
// `publish` never throws and returns how many connections it reached. ZERO
|
|
114
|
-
// IS SUCCESS: the user simply has no tab open, which is the normal state
|
|
115
|
-
// of most accounts most of the time. Treating it as a failure would fill
|
|
116
|
-
// `notification_deliveries` with failed rows for notifications that were
|
|
117
|
-
// delivered perfectly well, and would bury the real failures that table
|
|
118
|
-
// exists to surface.
|
|
119
106
|
const delivered = this.stream.publish(to, {
|
|
120
107
|
id: notification.id,
|
|
121
108
|
eventKey,
|
|
@@ -123,36 +110,9 @@ let BrowserNotificationChannel = BrowserNotificationChannel_1 = class BrowserNot
|
|
|
123
110
|
body,
|
|
124
111
|
link,
|
|
125
112
|
createdAt: notification.createdAt.toISOString(),
|
|
126
|
-
// THE ADMIN POLICY, APPLIED TO THE TOAST AND ONLY TO THE TOAST (#226).
|
|
127
|
-
//
|
|
128
|
-
// Note where this sits: AFTER the row was written, and on an event that
|
|
129
|
-
// is published regardless of its value. That is the invariant of #226 in
|
|
130
|
-
// one line of code — an operator who mutes browser notifications mutes
|
|
131
|
-
// the OS bubble, never the durable record. `security.role_changed` is
|
|
132
|
-
// `mandatory: true` precisely so a privilege change is never silent, and
|
|
133
|
-
// a policy that could suppress its inbox row would defeat the flag from
|
|
134
|
-
// the admin page.
|
|
135
|
-
//
|
|
136
|
-
// Read from the dispatch context rather than re-queried, so this flag and
|
|
137
|
-
// the channel decision that produced the row come from one snapshot of
|
|
138
|
-
// the policy. Absent policy resolves to the permissive default; see
|
|
139
|
-
// notification-policy.ts.
|
|
140
113
|
toast: (0, notification_policy_1.isBrowserToastAllowed)(eventKey, context.policy),
|
|
141
|
-
// IS WEB PUSH PART OF THIS SAME DISPATCH? (#625)
|
|
142
|
-
//
|
|
143
|
-
// Read from the dispatcher's final channel list — policy, preferences
|
|
144
|
-
// and any per-dispatch narrowing already applied — so it describes THIS
|
|
145
|
-
// dispatch, mandatory events included. It says the push channel will be
|
|
146
|
-
// attempted, not that it succeeded or that this browser holds a
|
|
147
|
-
// subscription; the client combines it with its own subscription state
|
|
148
|
-
// to avoid a duplicate OS toast. Independent of `toast`.
|
|
149
114
|
pushed: context.channels.includes('push'),
|
|
150
115
|
});
|
|
151
|
-
// Event key and connection count only — no title, no body, no link. The
|
|
152
|
-
// rendered text is what the user was told and can name a role, an
|
|
153
|
-
// administrator or a resource; application logs are shipped, indexed and
|
|
154
|
-
// retained far more widely than the `notifications` table is. The content
|
|
155
|
-
// has exactly one home and this is not it.
|
|
156
116
|
this.logger.log(`Recorded '${eventKey}' for user ${to} (live to ${delivered} connection(s)).`);
|
|
157
117
|
// The row id is the message id. It is the one durable handle tying a
|
|
158
118
|
// `notification_deliveries` row to the `notifications` row it produced,
|
|
@@ -160,6 +120,69 @@ let BrowserNotificationChannel = BrowserNotificationChannel_1 = class BrowserNot
|
|
|
160
120
|
// see?" gets answered.
|
|
161
121
|
return { success: true, messageId: notification.id };
|
|
162
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Write a STATE or COUNTED row and nudge open tabs when it is news.
|
|
125
|
+
*
|
|
126
|
+
* Never throws. A refresh that changes nothing the user can see (`quiet`)
|
|
127
|
+
* writes the row but sends no frame. A frame never raises an OS toast for an
|
|
128
|
+
* `incremented` row: the user already has that row unread, and a toast per
|
|
129
|
+
* folded occurrence would be the 4 000 notifications the fold exists to
|
|
130
|
+
* prevent.
|
|
131
|
+
*/
|
|
132
|
+
async deliverFolded(context, to, mode) {
|
|
133
|
+
const eventKey = context.event.key;
|
|
134
|
+
const render = (data) => {
|
|
135
|
+
const rendered = this.render({ ...context, data });
|
|
136
|
+
if (!rendered.ok)
|
|
137
|
+
throw new Error(rendered.error);
|
|
138
|
+
return {
|
|
139
|
+
title: truncate(rendered.content.title, MAX_TITLE_LENGTH),
|
|
140
|
+
body: truncate(rendered.content.body, MAX_BODY_LENGTH),
|
|
141
|
+
link: sanitizeLink(rendered.content.link),
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
const data = (context.data ?? {});
|
|
145
|
+
let written;
|
|
146
|
+
try {
|
|
147
|
+
written =
|
|
148
|
+
mode.kind === 'state'
|
|
149
|
+
? await this.writer.upsertState(to, eventKey, mode, data, render)
|
|
150
|
+
: await this.writer.upsertCounted(to, eventKey, mode, data, render);
|
|
151
|
+
}
|
|
152
|
+
catch (err) {
|
|
153
|
+
return {
|
|
154
|
+
success: false,
|
|
155
|
+
error: `Could not write the notification record: ${(0, describe_thrown_1.describeThrown)(err)}`,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
if (!written.quiet) {
|
|
159
|
+
// Re-read nothing: the frame carries what the writer returned. Title and
|
|
160
|
+
// body come from a second pure render of the same total, so they match the row.
|
|
161
|
+
let content = null;
|
|
162
|
+
try {
|
|
163
|
+
content = render({ ...data, count: written.count });
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
content = null;
|
|
167
|
+
}
|
|
168
|
+
if (content) {
|
|
169
|
+
this.stream.publish(to, {
|
|
170
|
+
id: written.id,
|
|
171
|
+
eventKey,
|
|
172
|
+
...content,
|
|
173
|
+
createdAt: written.createdAt.toISOString(),
|
|
174
|
+
toast: written.reason !== 'incremented' && (0, notification_policy_1.isBrowserToastAllowed)(eventKey, context.policy),
|
|
175
|
+
pushed: context.channels.includes('push'),
|
|
176
|
+
count: written.count,
|
|
177
|
+
scopeId: written.scopeId,
|
|
178
|
+
updatedAt: written.updatedAt.toISOString(),
|
|
179
|
+
reason: written.reason,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
this.logger.log(`Recorded '${eventKey}' (${written.reason}, count ${written.count}) for user ${to}.`);
|
|
184
|
+
return { success: true, messageId: written.id };
|
|
185
|
+
}
|
|
163
186
|
/**
|
|
164
187
|
* Render an event's untyped payload into what the user sees.
|
|
165
188
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-notification.channel.js","sourceRoot":"","sources":["../../../src/notifications/channels/browser-notification.channel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"browser-notification.channel.js","sourceRoot":"","sources":["../../../src/notifications/channels/browser-notification.channel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoYA,oCAWC;AA/YD,2CAA4D;AAE5D,4CAAmD;AAEnD,wDAAoD;AAEpD,gEAA+D;AAC/D,4EAAiH;AACjH,gFAA2E;AAC3E,0CAA2D;AAoE3D,yFAAyF;AACzF,4EAA4E;AAC5E,4EAA4E;AAC5E,wEAAwE;AAGxE,2EAA2E;AAC3E,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B;;;;GAIG;AAEI,IAAM,0BAA0B,kCAAhC,MAAM,0BAA0B;IAQO;IACzB;IARV,OAAO,GAAwB,SAAS,CAAC;IAEjC,MAAM,GAAG,IAAI,eAAM,CAAC,4BAA0B,CAAC,IAAI,CAAC,CAAC;IAErD,MAAM,CAA0B;IAEjD,YAC4C,MAA2B,EACpD,MAAiC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AC;QAAE,OAAO,IAAI,CAAC;IAC1C,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAE3C,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,QAAQ,CAAC,KAAa,EAAE,GAAW;IAC1C,OAAO,KAAK,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC;AACrE,CAAC"}
|
|
@@ -91,6 +91,19 @@ export interface NotificationRow {
|
|
|
91
91
|
readAt: Date | null;
|
|
92
92
|
/** Creation time. */
|
|
93
93
|
createdAt: Date;
|
|
94
|
+
/**
|
|
95
|
+
* The payload of a STATE or COUNTED row (`count`, `countAtRead`, and what the
|
|
96
|
+
* producer passed); null for a plain `notify()` row.
|
|
97
|
+
*/
|
|
98
|
+
data: NotificationsJsonValue | null;
|
|
99
|
+
/** The scope (a group, an organization) a STATE or COUNTED row belongs to, or null. */
|
|
100
|
+
scopeId: string | null;
|
|
101
|
+
/** When the user dismissed it, or null. A dismissed row is not listed. */
|
|
102
|
+
dismissedAt: Date | null;
|
|
103
|
+
/** Last refresh: the rolling-window anchor of a COUNTED row. */
|
|
104
|
+
updatedAt: Date;
|
|
105
|
+
/** The fold key of a live STATE or COUNTED row; null for a plain row or a retired COUNTED row. */
|
|
106
|
+
dedupKey: string | null;
|
|
94
107
|
}
|
|
95
108
|
/**
|
|
96
109
|
* A `notification_deliveries` row: one channel attempt.
|
|
@@ -269,6 +282,12 @@ export interface NotificationsTx {
|
|
|
269
282
|
job: NotificationsForeignDelegate;
|
|
270
283
|
/** `organizations` (identity fragment): a broadcast's target must exist. */
|
|
271
284
|
organization: NotificationsForeignDelegate;
|
|
285
|
+
/**
|
|
286
|
+
* Prisma's tagged-template `$executeRaw`: the inbox's advisory lock
|
|
287
|
+
* (`pg_advisory_xact_lock`) and its read/dismiss updates, which must not run
|
|
288
|
+
* Prisma's `@updatedAt`. Resolves the number of rows touched.
|
|
289
|
+
*/
|
|
290
|
+
$executeRaw(query: TemplateStringsArray, ...values: unknown[]): Promise<number>;
|
|
272
291
|
}
|
|
273
292
|
/**
|
|
274
293
|
* The client the slice injects under `PLATFORM_PRISMA`: the app's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications-db.d.ts","sourceRoot":"","sources":["../../../src/notifications/data/notifications-db.ts"],"names":[],"mappings":"AAyBA;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEzC;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN,MAAM,GACN,OAAO,GACP;KAAG,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,sBAAsB;CAAE,GAC5C,sBAAsB,EAAE,GACxB,IAAI,CAAC;AAET;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG;IAAE,QAAQ,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,OAAO;CAAE,GAAG,SAAS,OAAO,EAAE,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAElI;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;CACf;AAID;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE;IAAE,QAAQ,EAAE,CAAC,IAAI,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,CAAC;CAI/E,CAAC;AAEZ;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,OAAO,0BAA0B,CAAC,CAAC;AAEtH;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE;IACxC,QAAQ,EAAE,CAAC,IAAI,OAAO,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,CAAC;CAQ5E,CAAC;AAEZ;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,OAAO,2BAA2B,CAAC,CAAC;AAIzH;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,sCAAsC;IACtC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;IACpB,qBAAqB;IACrB,SAAS,EAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"notifications-db.d.ts","sourceRoot":"","sources":["../../../src/notifications/data/notifications-db.ts"],"names":[],"mappings":"AAyBA;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEzC;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN,MAAM,GACN,OAAO,GACP;KAAG,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,sBAAsB;CAAE,GAC5C,sBAAsB,EAAE,GACxB,IAAI,CAAC;AAET;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG;IAAE,QAAQ,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC,E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,CAAC,CAAC,GAAG,OAAO,CAAC;SAAG,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAAE,CAAC,CAAC;CACrH"}
|
|
@@ -8,6 +8,10 @@ declare const NotificationDto_base: import("nestjs-zod").ZodDto<import("zod").Zo
|
|
|
8
8
|
link: import("zod").ZodNullable<import("zod").ZodString>;
|
|
9
9
|
readAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
|
|
10
10
|
createdAt: import("zod").ZodISODateTime;
|
|
11
|
+
count: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
|
|
12
|
+
scopeId: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
13
|
+
dismissedAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodISODateTime>>;
|
|
14
|
+
updatedAt: import("zod").ZodOptional<import("zod").ZodISODateTime>;
|
|
11
15
|
}, import("zod/v4/core").$strip>, false>;
|
|
12
16
|
/**
|
|
13
17
|
* One inbox row.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.dto.d.ts","sourceRoot":"","sources":["../../../src/notifications/dto/notification.dto.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,6CAA6C,CAAC;AACrD,YAAY,EACV,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,6CAA6C,CAAC
|
|
1
|
+
{"version":3,"file":"notification.dto.d.ts","sourceRoot":"","sources":["../../../src/notifications/dto/notification.dto.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,6CAA6C,CAAC;AACrD,YAAY,EACV,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,6CAA6C,CAAC;;;;;;;;;;;;;;AAErD;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,oBAAgC;CAAG;;;;;;AAExE;;;;;;GAMG;AACH,qBAAa,wBAAyB,SAAQ,6BAAyC;CAAG;;;;AAE1F;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,mBAA+B;CAAG"}
|
|
@@ -5,7 +5,7 @@ export type { NotificationsImport, NotificationsModuleOptions, ResolvedNotificat
|
|
|
5
5
|
export { NOOP_NOTIFICATIONS_METRICS, NOTIFICATIONS_EVENT_BUS, NOTIFICATIONS_METRICS, NOTIFICATION_RECIPIENT_HANDLES, NOTIFICATION_STREAM_BUS_CHANNEL, NOTIFICATION_STREAM_INLINE_LIMIT_BYTES, } from './ports';
|
|
6
6
|
export type { NotificationDeliveryOutcome, NotificationsEventBus, NotificationsEventBusMeta, NotificationsMetrics, RecipientHandleSource, } from './ports';
|
|
7
7
|
export { NotificationsService } from './notifications.service';
|
|
8
|
-
export type { ChannelDeliveryResult, NotificationChannelSender, NotificationDispatchContext, NotificationRecipient, NotifyNowResult, NotifyOptions, NotifyPermissionHoldersOptions, RecipientHandle, ResolvedRecipient, ResolveRecipientContext, } from './notification.types';
|
|
8
|
+
export type { ChannelDeliveryResult, NotificationChannelSender, NotificationDispatchContext, NotificationRecipient, NotifyNowResult, NotifyCountedOptions, NotifyOptions, NotifyStateOptions, NotifyPermissionHoldersOptions, RecipientHandle, ResolvedRecipient, ResolveRecipientContext, } from './notification.types';
|
|
9
9
|
export { EMAIL_TEMPLATE_NAME_PATTERN, ANDROID_APP_NOTIFICATION_CHANNEL, NOTIFICATION_CHANNEL_ID_PATTERN, NOTIFICATION_EVENT_KEY_MAX_LENGTH, NOTIFICATION_EVENT_KEY_PATTERN, PLATFORM_NOTIFICATION_CHANNELS, channelTemplateRegistry, collapseOverlappingChannels, criticalCapableChannels, describeNotificationChannels, emailTemplateRegistry, eventBrowserTemplateRegistry, eventEmailTemplateRegistry, isRegisteredNotificationChannel, listNotificationChannels, notificationChannelRegistry, notificationEventRegistry, findChannelTemplate, registerBrowserNotificationTemplate, registerChannelTemplate, registerEmailNotificationTemplate, registerEmailTemplates, registerNotification, registerNotificationChannel, registerNotificationChannels, registerNotificationEvent, registerNotifications, registerAndroidAppNotificationChannel, registerPlatformNotificationChannels, renderChannelPayload, } from './registry/index';
|
|
10
10
|
export type { ChannelPayload, ChannelTemplateBinding, ChannelTemplateContext, ChannelTemplateRender, EmailTemplateEntry, EventBrowserTemplateBinding, EventEmailTemplateBinding, NotificationChannel, NotificationChannelDef, NotificationEventDef, NotificationRegistration, } from './registry/index';
|
|
11
11
|
export { NotificationChannelSenderRegistry } from './registry/channel-sender.registry';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AACnG,YAAY,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,kCAAkC,GACnC,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,8BAA8B,EAC9B,+BAA+B,EAC/B,sCAAsC,GACvC,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,2BAA2B,EAC3B,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EACV,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,8BAA8B,EAC9B,eAAe,EACf,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,2BAA2B,EAC3B,gCA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AACtB,mHAAA,aAAa,OAAA;AAEf,sEAAoG;AAA3F,kIAAA,4BAA4B,OAAA;AAAE,yHAAA,mBAAmB,OAAA;AAC1D,yFAAqF;AAA5E,+HAAA,oBAAoB,OAAA;AAC7B,yFAAqF;AAA5E,+HAAA,oBAAoB,OAAA;AAE7B,+FAA+F;AAC/F,yEAIqC;AAHnC,mIAAA,sBAAsB,OAAA;AACtB,uIAAA,0BAA0B,OAAA;AAC1B,6HAAA,gBAAgB,OAAA;AAIlB,6FAA6F;AAC7F,4DAAkG;AAAzF,+HAAA,2BAA2B,OAAA;AAAE,8HAAA,0BAA0B,OAAA"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { NotificationsPrisma } from './data/notifications-db';
|
|
2
|
+
import type { InboxWrite } from './notification.types';
|
|
3
|
+
/**
|
|
4
|
+
* What a template produced, already length-capped and link-sanitised.
|
|
5
|
+
*
|
|
6
|
+
* @stability experimental
|
|
7
|
+
*/
|
|
8
|
+
export interface InboxContent {
|
|
9
|
+
/** The title. */
|
|
10
|
+
title: string;
|
|
11
|
+
/** The body. */
|
|
12
|
+
body: string;
|
|
13
|
+
/** A sanitised root-relative link, or null. */
|
|
14
|
+
link: string | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Why an inbox write changed what the user sees.
|
|
18
|
+
*
|
|
19
|
+
* @stability experimental
|
|
20
|
+
*/
|
|
21
|
+
export type InboxWriteReason = 'created' | 'incremented' | 'reunread';
|
|
22
|
+
/**
|
|
23
|
+
* The outcome of one STATE or COUNTED write.
|
|
24
|
+
*
|
|
25
|
+
* @stability experimental
|
|
26
|
+
*/
|
|
27
|
+
export interface InboxWriteResult {
|
|
28
|
+
/** The row's id. */
|
|
29
|
+
id: string;
|
|
30
|
+
/** When the row was first created. */
|
|
31
|
+
createdAt: Date;
|
|
32
|
+
/** When this write refreshed it. */
|
|
33
|
+
updatedAt: Date;
|
|
34
|
+
/** The row's `data.count` after the write. */
|
|
35
|
+
count: number;
|
|
36
|
+
/** The row's scope, or null. */
|
|
37
|
+
scopeId: string | null;
|
|
38
|
+
/** Why this is news: a new row, a row that grew, or a read row that is unread again. */
|
|
39
|
+
reason: InboxWriteReason;
|
|
40
|
+
/** True when the row did not change what the user sees (a STATE refresh with an unchanged count). */
|
|
41
|
+
quiet: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Renders the row from the final payload; may throw (the writer lets it propagate before writing).
|
|
45
|
+
*
|
|
46
|
+
* @stability experimental
|
|
47
|
+
*/
|
|
48
|
+
export type InboxRender = (data: Record<string, unknown>) => InboxContent;
|
|
49
|
+
/**
|
|
50
|
+
* Builds the dedup key of a STATE row: one per `(eventKey, scopeId)`.
|
|
51
|
+
*
|
|
52
|
+
* @stability experimental
|
|
53
|
+
*/
|
|
54
|
+
export declare function stateDedupKey(eventKey: string, scopeId: string | null): string;
|
|
55
|
+
/**
|
|
56
|
+
* Builds the dedup key of a COUNTED row: one per `(eventKey, scopeId, match)`.
|
|
57
|
+
* The match object is serialised with sorted keys, so `{a, b}` and `{b, a}`
|
|
58
|
+
* fold together.
|
|
59
|
+
*
|
|
60
|
+
* @stability experimental
|
|
61
|
+
*/
|
|
62
|
+
export declare function countedDedupKey(eventKey: string, scopeId: string | null, match: Readonly<Record<string, string | number | boolean>> | undefined): string;
|
|
63
|
+
/**
|
|
64
|
+
* Writes STATE and COUNTED inbox rows.
|
|
65
|
+
*
|
|
66
|
+
* Exported for an app's own unit tests (`@marinoscar/platform-api/notifications/testing`); not an extension point: reach it through `NotificationsService.notifyState` and `notifyCounted`.
|
|
67
|
+
*
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export declare class NotificationInboxWriter {
|
|
71
|
+
private readonly prisma;
|
|
72
|
+
constructor(prisma: NotificationsPrisma);
|
|
73
|
+
/**
|
|
74
|
+
* Upserts the single live STATE row, or returns null when `mode.count` is
|
|
75
|
+
* not positive (use {@link dismissLive} for that).
|
|
76
|
+
*
|
|
77
|
+
* The refresh replaces title, body, link and `data` wholesale, carrying
|
|
78
|
+
* `countAtRead` forward (replacing `data` would otherwise silently disable the
|
|
79
|
+
* re-unread rule until the row is next read). A READ row is re-marked unread
|
|
80
|
+
* only when `reunreadWhen` is `count-increased`, the new count exceeds a
|
|
81
|
+
* recorded `countAtRead`, and nothing else: never on a decrease, never on an
|
|
82
|
+
* equal count, never on a row with no `countAtRead` (absent means "already
|
|
83
|
+
* seen"; re-unreading on it would re-nag every legacy row on every refresh).
|
|
84
|
+
*/
|
|
85
|
+
upsertState(userId: string, eventKey: string, mode: Extract<InboxWrite, {
|
|
86
|
+
kind: 'state';
|
|
87
|
+
}>, data: Record<string, unknown>, render: InboxRender): Promise<InboxWriteResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Folds one occurrence into the live COUNTED row, or starts a new row.
|
|
90
|
+
*
|
|
91
|
+
* Inside the window (or with none) the live row's `data.count` grows by
|
|
92
|
+
* `increment`, its text is re-rendered with the new total, and `readAt` is
|
|
93
|
+
* cleared so continued activity re-badges the bell. Outside the window the
|
|
94
|
+
* old row is RETIRED (its `dedup_key` becomes `retired:<id>` so the key is free; it stays in
|
|
95
|
+
* the inbox as the record of that batch) and a fresh row starts at
|
|
96
|
+
* `increment`.
|
|
97
|
+
*/
|
|
98
|
+
upsertCounted(userId: string, eventKey: string, mode: Extract<InboxWrite, {
|
|
99
|
+
kind: 'counted';
|
|
100
|
+
}>, data: Record<string, unknown>, render: InboxRender, now?: Date): Promise<InboxWriteResult>;
|
|
101
|
+
/**
|
|
102
|
+
* Dismisses the live row of `dedupKey` (a STATE row whose count drained to
|
|
103
|
+
* zero). Dismissal implies read. Returns whether a row was dismissed.
|
|
104
|
+
*/
|
|
105
|
+
dismissLive(userId: string, dedupKey: string): Promise<boolean>;
|
|
106
|
+
/** Runs `work` in a transaction holding the advisory lock of `(userId, dedupKey)`. */
|
|
107
|
+
private locked;
|
|
108
|
+
/** One retry on a unique violation: the winner's row exists now, so the retry folds into it. */
|
|
109
|
+
private withRetry;
|
|
110
|
+
private findLive;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=notification-inbox-writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-inbox-writer.d.ts","sourceRoot":"","sources":["../../src/notifications/notification-inbox-writer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,mBAAmB,EAEpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAuDvD;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;AAEtE;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,sCAAsC;IACtC,SAAS,EAAE,IAAI,CAAC;IAChB,oCAAoC;IACpC,SAAS,EAAE,IAAI,CAAC;IAChB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,wFAAwF;IACxF,MAAM,EAAE,gBAAgB,CAAC;IACzB,qGAAqG;IACrG,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,YAAY,CAAC;AAQ1E;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAE9E;AAED;;;;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