@marinoscar/platform-api 0.1.0-next.24 → 0.1.0-next.26
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 +26 -0
- package/dist/identity/auth/decorators/current-user.decorator.d.ts +30 -5
- package/dist/identity/auth/decorators/current-user.decorator.d.ts.map +1 -1
- package/dist/identity/auth/decorators/current-user.decorator.js +31 -6
- package/dist/identity/auth/decorators/current-user.decorator.js.map +1 -1
- package/dist/notifications/dto/notification.dto.d.ts +24 -2
- package/dist/notifications/dto/notification.dto.d.ts.map +1 -1
- package/dist/notifications/dto/notification.dto.js +19 -1
- package/dist/notifications/dto/notification.dto.js.map +1 -1
- package/dist/notifications/index.d.ts +3 -2
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +9 -2
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/notification-dismissal.d.ts +49 -0
- package/dist/notifications/notification-dismissal.d.ts.map +1 -0
- package/dist/notifications/notification-dismissal.js +109 -0
- package/dist/notifications/notification-dismissal.js.map +1 -0
- package/dist/notifications/notification-store.service.d.ts +12 -0
- package/dist/notifications/notification-store.service.d.ts.map +1 -1
- package/dist/notifications/notification-store.service.js +32 -6
- package/dist/notifications/notification-store.service.js.map +1 -1
- package/dist/notifications/notification-stream.service.d.ts +42 -1
- package/dist/notifications/notification-stream.service.d.ts.map +1 -1
- package/dist/notifications/notification-stream.service.js +97 -4
- package/dist/notifications/notification-stream.service.js.map +1 -1
- package/dist/notifications/notifications.controller.d.ts +2 -1
- package/dist/notifications/notifications.controller.d.ts.map +1 -1
- package/dist/notifications/notifications.controller.js +44 -3
- package/dist/notifications/notifications.controller.js.map +1 -1
- package/dist/notifications/notifications.system-settings.d.ts +13 -0
- package/dist/notifications/notifications.system-settings.d.ts.map +1 -1
- package/dist/notifications/notifications.system-settings.js +10 -0
- package/dist/notifications/notifications.system-settings.js.map +1 -1
- package/dist/notifications/notifications.user-settings.d.ts +8 -0
- package/dist/notifications/notifications.user-settings.d.ts.map +1 -1
- package/dist/notifications/notifications.user-settings.js +11 -0
- package/dist/notifications/notifications.user-settings.js.map +1 -1
- package/dist/settings/data/settings-db.d.ts +28 -0
- package/dist/settings/data/settings-db.d.ts.map +1 -1
- package/dist/settings/index.d.ts +2 -1
- package/dist/settings/index.d.ts.map +1 -1
- package/dist/settings/index.js.map +1 -1
- package/dist/settings/registry/system-settings-namespace.d.ts +9 -0
- package/dist/settings/registry/system-settings-namespace.d.ts.map +1 -1
- package/dist/settings/registry/system-settings-namespace.js +2 -0
- package/dist/settings/registry/system-settings-namespace.js.map +1 -1
- package/dist/settings/registry/user-settings-namespace.d.ts +9 -0
- package/dist/settings/registry/user-settings-namespace.d.ts.map +1 -1
- package/dist/settings/registry/user-settings-namespace.js +3 -0
- package/dist/settings/registry/user-settings-namespace.js.map +1 -1
- package/dist/settings/system-settings/system-settings.service.d.ts +7 -0
- package/dist/settings/system-settings/system-settings.service.d.ts.map +1 -1
- package/dist/settings/system-settings/system-settings.service.js +22 -4
- package/dist/settings/system-settings/system-settings.service.js.map +1 -1
- package/dist/settings/user-settings/user-settings.service.d.ts +9 -0
- package/dist/settings/user-settings/user-settings.service.d.ts.map +1 -1
- package/dist/settings/user-settings/user-settings.service.js +24 -4
- package/dist/settings/user-settings/user-settings.service.js.map +1 -1
- package/dist/settings/write-hooks.d.ts +53 -0
- package/dist/settings/write-hooks.d.ts.map +1 -0
- package/dist/settings/write-hooks.js +55 -0
- package/dist/settings/write-hooks.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-hooks.d.ts","sourceRoot":"","sources":["../../src/settings/write-hooks.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,OAAO;IAC/C;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0FAA0F;IAC1F,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;IAClC,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC;CAC/B;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEjH,4DAA4D;AAC5D,UAAU,eAAe;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;CAC7C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,SAAS,eAAe,EAAE,EACtC,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,GAAG,QAAQ,EACxB,MAAM,EAAE,MAAM,GACb,KAAK,CAAC,CAAC,EAAE,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAU1C"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// Settings write hooks (issues #1090, #1105)
|
|
4
|
+
// =============================================================================
|
|
5
|
+
//
|
|
6
|
+
// A namespace declaration may carry an `onWrite` hook: work that must commit
|
|
7
|
+
// or roll back WITH the settings write. The first user is dismiss-on-disable
|
|
8
|
+
// (turning a notification event off dismisses its live inbox rows); the seam is
|
|
9
|
+
// general, so a slice that must keep another table consistent with a settings
|
|
10
|
+
// change does the same.
|
|
11
|
+
//
|
|
12
|
+
// WHERE THE HOOK LIVES. On the namespace declaration (`UserSettingsNamespace`,
|
|
13
|
+
// `SystemSettingsNamespace`), not in a registry of its own: a hook belongs to
|
|
14
|
+
// the namespace whose change it reacts to, it is registered exactly when the
|
|
15
|
+
// namespace is, and "registration order" is the namespace registry's order.
|
|
16
|
+
// Extending a namespace (`extendUserSettingsNamespace`,
|
|
17
|
+
// `extendSystemSettingsNamespace`) keeps the base's hook.
|
|
18
|
+
//
|
|
19
|
+
// WHEN IT RUNS. Inside the transaction that writes the row, after the row is
|
|
20
|
+
// written and before commit, once per namespace whose value CHANGED (deep
|
|
21
|
+
// equality of the stored namespace before and after). A write that does not
|
|
22
|
+
// change a namespace never runs its hook, and a write with no hook to run is
|
|
23
|
+
// the plain, transaction-free write it always was.
|
|
24
|
+
//
|
|
25
|
+
// A hook that throws rolls the whole settings write back.
|
|
26
|
+
// =============================================================================
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.pendingWriteHooks = pendingWriteHooks;
|
|
29
|
+
const node_util_1 = require("node:util");
|
|
30
|
+
/**
|
|
31
|
+
* The hooks to run for a write: one per namespace that has an `onWrite` and
|
|
32
|
+
* whose value differs between `before` and `after`, in the order given.
|
|
33
|
+
*
|
|
34
|
+
* @param namespaces - the namespaces, in registration order.
|
|
35
|
+
* @param before - the settings document before the write.
|
|
36
|
+
* @param after - the settings document after the write.
|
|
37
|
+
* @param scope - which settings were written.
|
|
38
|
+
* @param userId - the user (user scope) or the acting administrator (system scope).
|
|
39
|
+
* @returns runnable steps; empty when no hooked namespace changed.
|
|
40
|
+
*
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
function pendingWriteHooks(namespaces, before, after, scope, userId) {
|
|
44
|
+
const was = (before ?? {});
|
|
45
|
+
const now = (after ?? {});
|
|
46
|
+
const steps = [];
|
|
47
|
+
for (const ns of namespaces) {
|
|
48
|
+
const hook = ns.onWrite;
|
|
49
|
+
if (!hook || (0, node_util_1.isDeepStrictEqual)(was[ns.key], now[ns.key]))
|
|
50
|
+
continue;
|
|
51
|
+
steps.push((tx) => hook(tx, { userId, scope, before: was[ns.key], after: now[ns.key] }));
|
|
52
|
+
}
|
|
53
|
+
return steps;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=write-hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-hooks.js","sourceRoot":"","sources":["../../src/settings/write-hooks.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,6CAA6C;AAC7C,gFAAgF;AAChF,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,gFAAgF;AAChF,8EAA8E;AAC9E,wBAAwB;AACxB,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,wDAAwD;AACxD,0DAA0D;AAC1D,EAAE;AACF,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,mDAAmD;AACnD,EAAE;AACF,0DAA0D;AAC1D,gFAAgF;;AA0DhF,8CAgBC;AAxED,yCAA8C;AA2C9C;;;;;;;;;;;;GAYG;AACH,SAAgB,iBAAiB,CAC/B,UAAsC,EACtC,MAAe,EACf,KAAc,EACd,KAAwB,EACxB,MAAc;IAEd,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,EAAE,CAA4B,CAAC;IACtD,MAAM,GAAG,GAAG,CAAC,KAAK,IAAI,EAAE,CAA4B,CAAC;IACrD,MAAM,KAAK,GAA6C,EAAE,CAAC;IAC3D,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,EAAE,CAAC,OAAwC,CAAC;QACzD,IAAI,CAAC,IAAI,IAAI,IAAA,6BAAiB,EAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;YAAE,SAAS;QACnE,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marinoscar/platform-api",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.26",
|
|
4
4
|
"description": "NestJS dynamic modules of the platform (CommonJS, built with tsc for decorator metadata).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -232,8 +232,8 @@
|
|
|
232
232
|
"@aws-sdk/lib-storage": "^3.975.0",
|
|
233
233
|
"@aws-sdk/s3-request-presigner": "^3.975.0",
|
|
234
234
|
"@google/genai": "^2.24.0",
|
|
235
|
-
"@marinoscar/platform-ai-providers": "0.1.0-next.
|
|
236
|
-
"@marinoscar/platform-contract": "0.1.0-next.
|
|
235
|
+
"@marinoscar/platform-ai-providers": "0.1.0-next.26",
|
|
236
|
+
"@marinoscar/platform-contract": "0.1.0-next.26",
|
|
237
237
|
"@opentelemetry/auto-instrumentations-node": "^0.79.0",
|
|
238
238
|
"@opentelemetry/core": "^2.10.0",
|
|
239
239
|
"@opentelemetry/exporter-logs-otlp-http": "^0.221.0",
|