@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.
Files changed (63) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/identity/auth/decorators/current-user.decorator.d.ts +30 -5
  3. package/dist/identity/auth/decorators/current-user.decorator.d.ts.map +1 -1
  4. package/dist/identity/auth/decorators/current-user.decorator.js +31 -6
  5. package/dist/identity/auth/decorators/current-user.decorator.js.map +1 -1
  6. package/dist/notifications/dto/notification.dto.d.ts +24 -2
  7. package/dist/notifications/dto/notification.dto.d.ts.map +1 -1
  8. package/dist/notifications/dto/notification.dto.js +19 -1
  9. package/dist/notifications/dto/notification.dto.js.map +1 -1
  10. package/dist/notifications/index.d.ts +3 -2
  11. package/dist/notifications/index.d.ts.map +1 -1
  12. package/dist/notifications/index.js +9 -2
  13. package/dist/notifications/index.js.map +1 -1
  14. package/dist/notifications/notification-dismissal.d.ts +49 -0
  15. package/dist/notifications/notification-dismissal.d.ts.map +1 -0
  16. package/dist/notifications/notification-dismissal.js +109 -0
  17. package/dist/notifications/notification-dismissal.js.map +1 -0
  18. package/dist/notifications/notification-store.service.d.ts +12 -0
  19. package/dist/notifications/notification-store.service.d.ts.map +1 -1
  20. package/dist/notifications/notification-store.service.js +32 -6
  21. package/dist/notifications/notification-store.service.js.map +1 -1
  22. package/dist/notifications/notification-stream.service.d.ts +42 -1
  23. package/dist/notifications/notification-stream.service.d.ts.map +1 -1
  24. package/dist/notifications/notification-stream.service.js +97 -4
  25. package/dist/notifications/notification-stream.service.js.map +1 -1
  26. package/dist/notifications/notifications.controller.d.ts +2 -1
  27. package/dist/notifications/notifications.controller.d.ts.map +1 -1
  28. package/dist/notifications/notifications.controller.js +44 -3
  29. package/dist/notifications/notifications.controller.js.map +1 -1
  30. package/dist/notifications/notifications.system-settings.d.ts +13 -0
  31. package/dist/notifications/notifications.system-settings.d.ts.map +1 -1
  32. package/dist/notifications/notifications.system-settings.js +10 -0
  33. package/dist/notifications/notifications.system-settings.js.map +1 -1
  34. package/dist/notifications/notifications.user-settings.d.ts +8 -0
  35. package/dist/notifications/notifications.user-settings.d.ts.map +1 -1
  36. package/dist/notifications/notifications.user-settings.js +11 -0
  37. package/dist/notifications/notifications.user-settings.js.map +1 -1
  38. package/dist/settings/data/settings-db.d.ts +28 -0
  39. package/dist/settings/data/settings-db.d.ts.map +1 -1
  40. package/dist/settings/index.d.ts +2 -1
  41. package/dist/settings/index.d.ts.map +1 -1
  42. package/dist/settings/index.js.map +1 -1
  43. package/dist/settings/registry/system-settings-namespace.d.ts +9 -0
  44. package/dist/settings/registry/system-settings-namespace.d.ts.map +1 -1
  45. package/dist/settings/registry/system-settings-namespace.js +2 -0
  46. package/dist/settings/registry/system-settings-namespace.js.map +1 -1
  47. package/dist/settings/registry/user-settings-namespace.d.ts +9 -0
  48. package/dist/settings/registry/user-settings-namespace.d.ts.map +1 -1
  49. package/dist/settings/registry/user-settings-namespace.js +3 -0
  50. package/dist/settings/registry/user-settings-namespace.js.map +1 -1
  51. package/dist/settings/system-settings/system-settings.service.d.ts +7 -0
  52. package/dist/settings/system-settings/system-settings.service.d.ts.map +1 -1
  53. package/dist/settings/system-settings/system-settings.service.js +22 -4
  54. package/dist/settings/system-settings/system-settings.service.js.map +1 -1
  55. package/dist/settings/user-settings/user-settings.service.d.ts +9 -0
  56. package/dist/settings/user-settings/user-settings.service.d.ts.map +1 -1
  57. package/dist/settings/user-settings/user-settings.service.js +24 -4
  58. package/dist/settings/user-settings/user-settings.service.js.map +1 -1
  59. package/dist/settings/write-hooks.d.ts +53 -0
  60. package/dist/settings/write-hooks.d.ts.map +1 -0
  61. package/dist/settings/write-hooks.js +55 -0
  62. package/dist/settings/write-hooks.js.map +1 -0
  63. 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-h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ANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marinoscar/platform-api",
3
- "version": "0.1.0-next.24",
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.24",
236
- "@marinoscar/platform-contract": "0.1.0-next.24",
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",