@futdevpro/nts-dynamo 1.15.362 → 1.15.364

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 (49) hide show
  1. package/build/_modules/notifications/_models/notification-mongo-collection.interface.d.ts +21 -0
  2. package/build/_modules/notifications/_models/notification-mongo-collection.interface.d.ts.map +1 -0
  3. package/build/_modules/notifications/_models/notification-mongo-collection.interface.js +3 -0
  4. package/build/_modules/notifications/_models/notification-mongo-collection.interface.js.map +1 -0
  5. package/build/_modules/notifications/_models/notification-publisher.interface.d.ts +32 -0
  6. package/build/_modules/notifications/_models/notification-publisher.interface.d.ts.map +1 -0
  7. package/build/_modules/notifications/_models/notification-publisher.interface.js +3 -0
  8. package/build/_modules/notifications/_models/notification-publisher.interface.js.map +1 -0
  9. package/build/_modules/notifications/_models/notification-store.interface.d.ts +35 -0
  10. package/build/_modules/notifications/_models/notification-store.interface.d.ts.map +1 -0
  11. package/build/_modules/notifications/_models/notification-store.interface.js +3 -0
  12. package/build/_modules/notifications/_models/notification-store.interface.js.map +1 -0
  13. package/build/_modules/notifications/_models/notification.interface.d.ts +59 -0
  14. package/build/_modules/notifications/_models/notification.interface.d.ts.map +1 -0
  15. package/build/_modules/notifications/_models/notification.interface.js +3 -0
  16. package/build/_modules/notifications/_models/notification.interface.js.map +1 -0
  17. package/build/_modules/notifications/get-notifications-routing-module.util.d.ts +18 -0
  18. package/build/_modules/notifications/get-notifications-routing-module.util.d.ts.map +1 -0
  19. package/build/_modules/notifications/get-notifications-routing-module.util.js +26 -0
  20. package/build/_modules/notifications/get-notifications-routing-module.util.js.map +1 -0
  21. package/build/_modules/notifications/index.d.ts +15 -0
  22. package/build/_modules/notifications/index.d.ts.map +1 -0
  23. package/build/_modules/notifications/index.js +18 -0
  24. package/build/_modules/notifications/index.js.map +1 -0
  25. package/build/_modules/notifications/notification-in-memory.store.d.ts +30 -0
  26. package/build/_modules/notifications/notification-in-memory.store.d.ts.map +1 -0
  27. package/build/_modules/notifications/notification-in-memory.store.js +68 -0
  28. package/build/_modules/notifications/notification-in-memory.store.js.map +1 -0
  29. package/build/_modules/notifications/notification-mongo.store.d.ts +51 -0
  30. package/build/_modules/notifications/notification-mongo.store.d.ts.map +1 -0
  31. package/build/_modules/notifications/notification-mongo.store.js +136 -0
  32. package/build/_modules/notifications/notification-mongo.store.js.map +1 -0
  33. package/build/_modules/notifications/notification.service.d.ts +67 -0
  34. package/build/_modules/notifications/notification.service.d.ts.map +1 -0
  35. package/build/_modules/notifications/notification.service.js +271 -0
  36. package/build/_modules/notifications/notification.service.js.map +1 -0
  37. package/build/_modules/notifications/notifications.controller.d.ts +31 -0
  38. package/build/_modules/notifications/notifications.controller.d.ts.map +1 -0
  39. package/build/_modules/notifications/notifications.controller.js +118 -0
  40. package/build/_modules/notifications/notifications.controller.js.map +1 -0
  41. package/build/_modules/server/errors/errors-sink.util.d.ts +2 -0
  42. package/build/_modules/server/errors/errors-sink.util.d.ts.map +1 -1
  43. package/build/_modules/server/errors/errors-sink.util.js +8 -0
  44. package/build/_modules/server/errors/errors-sink.util.js.map +1 -1
  45. package/build/_modules/server/server-status/server-status.control-service.d.ts +8 -0
  46. package/build/_modules/server/server-status/server-status.control-service.d.ts.map +1 -1
  47. package/build/_modules/server/server-status/server-status.control-service.js +12 -4
  48. package/build/_modules/server/server-status/server-status.control-service.js.map +1 -1
  49. package/package.json +10 -1
@@ -0,0 +1,67 @@
1
+ import { DyNTS_Notification_Interface, DyNTS_NotificationCreate_Interface, DyNTS_NotificationPage_Interface, DyNTS_NotificationReadResult_Interface } from './_models/notification.interface';
2
+ import { DyNTS_NotificationPublisher_Type } from './_models/notification-publisher.interface';
3
+ import { DyNTS_NotificationStore_Interface } from './_models/notification-store.interface';
4
+ /** BFR-OLDLIGHTSITE-001 — the notification service settings. */
5
+ export interface DyNTS_Notification_Settings_Interface {
6
+ store: DyNTS_NotificationStore_Interface;
7
+ /** Pushes every change to the account's devices (e.g. a socket room). Optional, best effort. */
8
+ publisher?: DyNTS_NotificationPublisher_Type;
9
+ /** When given, `create` accepts ONLY these event types (a typo in a producer is a 400, not a silent new type). */
10
+ eventTypes?: string[];
11
+ /** A test seam (default: `() => new Date()`). */
12
+ now?: () => Date;
13
+ }
14
+ /**
15
+ * BFR-OLDLIGHTSITE-001 — a persisted, per-account notification service: create · list · unread count ·
16
+ * mark read · mark all read, with an optional push publisher.
17
+ *
18
+ * @description
19
+ * - **The read state never jumps back.** A read only ever turns unread → read, the FIRST read's time is kept, and
20
+ * nothing clears it; `markAllRead` takes an `upTo` watermark, so a notification that arrived AFTER the user looked
21
+ * at the list is not marked read by a late "mark all" from another device.
22
+ * - **Idempotent.** A repeated `markRead` / `markAllRead` changes nothing (`updated: 0`); a producer that retries
23
+ * `create` with the same `dedupeKey` gets the same notification back.
24
+ * - **A stable retry contract for clients.** 400 `DyNTS-NTF-IN0` = the request is wrong, do not retry; 401
25
+ * `DyNTS-NTF-AU0` = no account; 503 `DyNTS-NTF-ST0` = the store failed, retry with backoff (every operation is
26
+ * idempotent, so a retry is always safe).
27
+ */
28
+ export declare class DyNTS_Notification_Service {
29
+ private readonly store;
30
+ private readonly publisher?;
31
+ private readonly eventTypes?;
32
+ private readonly now;
33
+ /** Keeps the store and the optional publisher; `eventTypes` restricts `create`. */
34
+ constructor(settings: DyNTS_Notification_Settings_Interface);
35
+ /** Stores a notification for one account (idempotent with `dedupeKey`) and publishes it. */
36
+ create(input: DyNTS_NotificationCreate_Interface): Promise<DyNTS_Notification_Interface>;
37
+ /** One page, newest first; `before` is the `nextCursor` of the previous page. */
38
+ listForAccount(accountId: string, options?: {
39
+ limit?: number;
40
+ before?: string | null;
41
+ unreadOnly?: boolean;
42
+ }): Promise<DyNTS_NotificationPage_Interface>;
43
+ unreadCount(accountId: string): Promise<number>;
44
+ /** Marks the given notifications read (the account's own only; an already read one is left as it is). */
45
+ markRead(accountId: string, ids: string[]): Promise<DyNTS_NotificationReadResult_Interface>;
46
+ /**
47
+ * Marks every unread notification created at or before `upTo` read. Pass the time the user SAW the list (default:
48
+ * now), so a notification that arrived later stays unread.
49
+ */
50
+ markAllRead(accountId: string, upTo?: Date | string | null): Promise<DyNTS_NotificationReadResult_Interface>;
51
+ /** The opaque paging cursor of a record. */
52
+ static cursorOf(record: DyNTS_Notification_Interface): string;
53
+ private static parseCursor;
54
+ private static limitOf;
55
+ private validateCreate;
56
+ private validateAccount;
57
+ private validateIds;
58
+ private static isQueryParams;
59
+ private static isSmallJsonObject;
60
+ private invalid;
61
+ private static invalidStatic;
62
+ /** A store call; a failure becomes a retryable 503 (every operation is idempotent). */
63
+ private call;
64
+ /** Best effort: a failing publisher (or its unread count) is logged, never thrown. */
65
+ private publish;
66
+ }
67
+ //# sourceMappingURL=notification.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.service.d.ts","sourceRoot":"","sources":["../../../src/_modules/notifications/notification.service.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,4BAA4B,EAAE,kCAAkC,EAChE,gCAAgC,EAAE,sCAAsC,EACzE,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACyB,gCAAgC,EAC/D,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAC+B,iCAAiC,EACtE,MAAM,wCAAwC,CAAC;AAIhD,gEAAgE;AAChE,MAAM,WAAW,qCAAqC;IACpD,KAAK,EAAE,iCAAiC,CAAC;IACzC,gGAAgG;IAChG,SAAS,CAAC,EAAE,gCAAgC,CAAC;IAC7C,kHAAkH;IAClH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoC;IAC1D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAmC;IAC9D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAA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
+ exports.DyNTS_Notification_Service = void 0;
4
+ const crypto_1 = require("crypto");
5
+ const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
6
+ const global_settings_const_1 = require("../../_collections/global-settings.const");
7
+ const secret_redaction_util_1 = require("../../_collections/secret-redaction.util");
8
+ const KINDS = ['info', 'success', 'warning', 'error'];
9
+ /**
10
+ * BFR-OLDLIGHTSITE-001 — a persisted, per-account notification service: create · list · unread count ·
11
+ * mark read · mark all read, with an optional push publisher.
12
+ *
13
+ * @description
14
+ * - **The read state never jumps back.** A read only ever turns unread → read, the FIRST read's time is kept, and
15
+ * nothing clears it; `markAllRead` takes an `upTo` watermark, so a notification that arrived AFTER the user looked
16
+ * at the list is not marked read by a late "mark all" from another device.
17
+ * - **Idempotent.** A repeated `markRead` / `markAllRead` changes nothing (`updated: 0`); a producer that retries
18
+ * `create` with the same `dedupeKey` gets the same notification back.
19
+ * - **A stable retry contract for clients.** 400 `DyNTS-NTF-IN0` = the request is wrong, do not retry; 401
20
+ * `DyNTS-NTF-AU0` = no account; 503 `DyNTS-NTF-ST0` = the store failed, retry with backoff (every operation is
21
+ * idempotent, so a retry is always safe).
22
+ */
23
+ class DyNTS_Notification_Service {
24
+ store;
25
+ publisher;
26
+ eventTypes;
27
+ now;
28
+ /** Keeps the store and the optional publisher; `eventTypes` restricts `create`. */
29
+ constructor(settings) {
30
+ if (!settings?.store) {
31
+ throw new Error('DYNTS_NOTIFICATION_SERVICE_STORE_MISSING');
32
+ }
33
+ this.store = settings.store;
34
+ this.publisher = settings.publisher;
35
+ this.eventTypes = settings.eventTypes ? new Set(settings.eventTypes) : undefined;
36
+ this.now = settings.now ?? (() => new Date());
37
+ }
38
+ /** Stores a notification for one account (idempotent with `dedupeKey`) and publishes it. */
39
+ async create(input) {
40
+ const notification = this.validateCreate(input);
41
+ const stored = await this.call('create', () => this.store.insert(notification));
42
+ // a deduplicated retry returns the existing record — it was published the first time
43
+ if (stored._id === notification._id) {
44
+ await this.publish(async () => ({
45
+ kind: 'created', accountId: stored.accountId, notification: stored,
46
+ unreadCount: await this.store.countUnread(stored.accountId),
47
+ }));
48
+ }
49
+ return stored;
50
+ }
51
+ /** One page, newest first; `before` is the `nextCursor` of the previous page. */
52
+ async listForAccount(accountId, options = {}) {
53
+ const account = this.validateAccount(accountId);
54
+ const limit = DyNTS_Notification_Service.limitOf(options.limit);
55
+ const before = options.before
56
+ ? DyNTS_Notification_Service.parseCursor(options.before)
57
+ : undefined;
58
+ // one extra item tells whether an older page exists
59
+ const items = await this.call('list', () => this.store.list({
60
+ accountId: account, limit: limit + 1, before: before, unreadOnly: !!options.unreadOnly,
61
+ }));
62
+ const page = items.slice(0, limit);
63
+ const last = page[page.length - 1];
64
+ return {
65
+ items: page,
66
+ nextCursor: items.length > limit && last ? DyNTS_Notification_Service.cursorOf(last) : null,
67
+ unreadCount: await this.unreadCount(account),
68
+ };
69
+ }
70
+ async unreadCount(accountId) {
71
+ const account = this.validateAccount(accountId);
72
+ return this.call('count', () => this.store.countUnread(account));
73
+ }
74
+ /** Marks the given notifications read (the account's own only; an already read one is left as it is). */
75
+ async markRead(accountId, ids) {
76
+ const account = this.validateAccount(accountId);
77
+ const wanted = this.validateIds(ids);
78
+ const at = this.now();
79
+ const existing = await this.call('read', () => this.store.existingIds(account, wanted));
80
+ const updated = existing.length
81
+ ? await this.call('read', () => this.store.markSeen({ accountId: account, at: at, ids: existing }))
82
+ : 0;
83
+ const unreadCount = await this.unreadCount(account);
84
+ if (updated) {
85
+ await this.publish(() => ({
86
+ kind: 'read', accountId: account, ids: existing, seen: at, unreadCount: unreadCount,
87
+ }));
88
+ }
89
+ return {
90
+ updated: updated,
91
+ notFound: wanted.filter((id) => !existing.includes(id)),
92
+ unreadCount: unreadCount,
93
+ };
94
+ }
95
+ /**
96
+ * Marks every unread notification created at or before `upTo` read. Pass the time the user SAW the list (default:
97
+ * now), so a notification that arrived later stays unread.
98
+ */
99
+ async markAllRead(accountId, upTo) {
100
+ const account = this.validateAccount(accountId);
101
+ const at = this.now();
102
+ const requested = upTo === undefined || upTo === null ? at : new Date(upTo);
103
+ if (Number.isNaN(requested.getTime())) {
104
+ throw this.invalid(['upTo must be a date']);
105
+ }
106
+ // never later than this request: a fast client clock must not reach notifications created meanwhile
107
+ const watermark = requested.getTime() > at.getTime() ? at : requested;
108
+ const updated = await this.call('read-all', () => (this.store.markSeen({ accountId: account, at: at, upTo: watermark })));
109
+ const unreadCount = await this.unreadCount(account);
110
+ if (updated) {
111
+ await this.publish(() => ({
112
+ kind: 'read-all', accountId: account, upTo: watermark, seen: at, unreadCount: unreadCount,
113
+ }));
114
+ }
115
+ return { updated: updated, notFound: [], unreadCount: unreadCount };
116
+ }
117
+ /** The opaque paging cursor of a record. */
118
+ static cursorOf(record) {
119
+ return Buffer.from(`${record.__created.toISOString()}|${record._id}`).toString('base64url');
120
+ }
121
+ static parseCursor(cursor) {
122
+ const [iso, id] = Buffer.from(String(cursor), 'base64url').toString('utf8').split('|');
123
+ const created = new Date(iso);
124
+ if (!id || Number.isNaN(created.getTime())) {
125
+ throw DyNTS_Notification_Service.invalidStatic(['before is not a valid cursor']);
126
+ }
127
+ return { created: created, id: id };
128
+ }
129
+ static limitOf(limit) {
130
+ const value = Math.floor(Number(limit ?? 20));
131
+ return Number.isFinite(value) ? Math.min(100, Math.max(1, value)) : 20;
132
+ }
133
+ validateCreate(input) {
134
+ const problems = [];
135
+ const text = (value, max) => typeof value === 'string' && value.trim().length > 0
136
+ && value.length <= max;
137
+ const eventType = String(input?.eventType ?? '');
138
+ if (!text(input?.accountId, 200)) {
139
+ problems.push('accountId is required (at most 200 characters)');
140
+ }
141
+ if (!/^[a-z0-9][a-z0-9._-]{0,99}$/.test(eventType)) {
142
+ problems.push('eventType must be a lowercase identifier (a-z, 0-9, . _ -), at most 100 characters');
143
+ }
144
+ else if (this.eventTypes && !this.eventTypes.has(eventType)) {
145
+ problems.push(`eventType ${eventType} is not one of the configured event types`);
146
+ }
147
+ if (!text(input?.title, 200)) {
148
+ problems.push('title is required (at most 200 characters)');
149
+ }
150
+ if (input?.message !== undefined && (typeof input.message !== 'string' || input.message.length > 4000)) {
151
+ problems.push('message must be a string of at most 4000 characters');
152
+ }
153
+ if (input?.type !== undefined && !KINDS.includes(input.type)) {
154
+ problems.push(`type must be one of ${KINDS.join(', ')}`);
155
+ }
156
+ if (input?.routerLink !== undefined
157
+ && (typeof input.routerLink !== 'string' || !/^\/(?!\/)/.test(input.routerLink)
158
+ || input.routerLink.length > 2000)) {
159
+ // an app route only: an absolute, protocol-relative or `javascript:` link would turn a notification into a lure
160
+ problems.push('routerLink must be an app-internal path starting with a single /');
161
+ }
162
+ if (input?.queryParams !== undefined && !DyNTS_Notification_Service.isQueryParams(input.queryParams)) {
163
+ problems.push('queryParams must be an object of at most 20 string or number values');
164
+ }
165
+ if (input?.payload !== undefined && !DyNTS_Notification_Service.isSmallJsonObject(input.payload)) {
166
+ problems.push('payload must be a JSON object of at most 16 KB');
167
+ }
168
+ if (input?.dedupeKey !== undefined && !text(input.dedupeKey, 200)) {
169
+ problems.push('dedupeKey must be a non-empty string of at most 200 characters');
170
+ }
171
+ if (problems.length) {
172
+ throw this.invalid(problems);
173
+ }
174
+ return {
175
+ _id: (0, crypto_1.randomUUID)(),
176
+ accountId: input.accountId.trim(),
177
+ eventType: eventType,
178
+ title: input.title.trim(),
179
+ message: input.message,
180
+ type: input.type ?? 'info',
181
+ routerLink: input.routerLink,
182
+ queryParams: input.queryParams ? { ...input.queryParams } : undefined,
183
+ payload: input.payload ? JSON.parse(JSON.stringify(input.payload)) : undefined,
184
+ dedupeKey: input.dedupeKey,
185
+ seen: null,
186
+ __created: this.now(),
187
+ };
188
+ }
189
+ validateAccount(accountId) {
190
+ if (typeof accountId !== 'string' || !accountId.trim() || accountId.length > 200) {
191
+ throw new fsm_dynamo_1.DyFM_Error({
192
+ status: 401,
193
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-NTF-AU0`,
194
+ message: 'Notifications: no account on the request.',
195
+ userMessage: 'Please sign in to see your notifications.',
196
+ });
197
+ }
198
+ return accountId.trim();
199
+ }
200
+ validateIds(ids) {
201
+ if (!Array.isArray(ids) || !ids.length || ids.length > 500
202
+ || ids.some((id) => typeof id !== 'string' || !id || id.length > 200)) {
203
+ throw this.invalid(['ids must be 1–500 non-empty strings']);
204
+ }
205
+ return [...new Set(ids)];
206
+ }
207
+ static isQueryParams(value) {
208
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
209
+ return false;
210
+ }
211
+ const entries = Object.entries(value);
212
+ return entries.length <= 20 && entries.every(([, item]) => (typeof item === 'string' || (typeof item === 'number' && Number.isFinite(item))));
213
+ }
214
+ static isSmallJsonObject(value) {
215
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
216
+ return false;
217
+ }
218
+ try {
219
+ return Buffer.byteLength(JSON.stringify(value), 'utf8') <= 16 * 1024;
220
+ }
221
+ catch {
222
+ return false;
223
+ }
224
+ }
225
+ invalid(problems) {
226
+ return DyNTS_Notification_Service.invalidStatic(problems);
227
+ }
228
+ static invalidStatic(problems) {
229
+ return new fsm_dynamo_1.DyFM_Error({
230
+ status: 400,
231
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-NTF-IN0`,
232
+ message: `Notification request rejected: ${problems.join('; ')}`,
233
+ userMessage: 'The notification request is invalid.',
234
+ additionalContent: { problems: problems },
235
+ });
236
+ }
237
+ /** A store call; a failure becomes a retryable 503 (every operation is idempotent). */
238
+ async call(operation, run) {
239
+ try {
240
+ return await run();
241
+ }
242
+ catch (error) {
243
+ if (error instanceof fsm_dynamo_1.DyFM_Error) {
244
+ throw error;
245
+ }
246
+ throw new fsm_dynamo_1.DyFM_Error({
247
+ status: 503,
248
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-NTF-ST0`,
249
+ message: `Notification store ${operation} failed: `
250
+ + secret_redaction_util_1.DyNTS_SecretRedaction_Util.redactText(fsm_dynamo_1.DyFM_Error.getErrorMessage(error)),
251
+ userMessage: 'Notifications are not available at the moment. Please try again.',
252
+ error: secret_redaction_util_1.DyNTS_SecretRedaction_Util.redactErrorForLog(error),
253
+ additionalContent: { operation: operation, retryable: true },
254
+ });
255
+ }
256
+ }
257
+ /** Best effort: a failing publisher (or its unread count) is logged, never thrown. */
258
+ async publish(build) {
259
+ if (!this.publisher) {
260
+ return;
261
+ }
262
+ try {
263
+ await this.publisher(await build());
264
+ }
265
+ catch (error) {
266
+ fsm_dynamo_1.DyFM_Log.warn(`[DyNTS notifications] the push failed (the stored state is intact): ${fsm_dynamo_1.DyFM_Error.getErrorMessage(error)}`);
267
+ }
268
+ }
269
+ }
270
+ exports.DyNTS_Notification_Service = DyNTS_Notification_Service;
271
+ //# sourceMappingURL=notification.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.service.js","sourceRoot":"","sources":["../../../src/_modules/notifications/notification.service.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAEpC,sDAA6D;AAE7D,oFAAiF;AACjF,oFAAsF;AAYtF,MAAM,KAAK,GAAkC,CAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAE,CAAC;AAavF;;;;;;;;;;;;;GAaG;AACH,MAAa,0BAA0B;IACpB,KAAK,CAAoC;IACzC,SAAS,CAAoC;IAC7C,UAAU,CAAe;IACzB,GAAG,CAAa;IAEjC,mFAAmF;IACnF,YAAY,QAA+C;QACzD,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC9D,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,GAAG,CAAS,QAAQ,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C;QACrB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IAAI,KAAK,YAAY,uBAAU,EAAE,CAAC;gBAChC,MAAM,KAAK,CAAC;YACd,CAAC;YAED,MAAM,IAAI,uBAAU,CAAC;gBACnB,MAAM,EAAE,GAAG;gBACX,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,gBAAgB;gBACvE,OAAO,EAAE,sBAAsB,SAAS,WAAW;sBAC/C,kDAA0B,CAAC,UAAU,CAAC,uBAAU,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;gBAC5E,WAAW,EAAE,kEAAkE;gBAC/E,KAAK,EAAE,kDAA0B,CAAC,iBAAiB,CAAC,KAAK,CAAC;gBAC1D,iBAAiB,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE;aAC7D,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,sFAAsF;IAC9E,KAAK,CAAC,OAAO,CACnB,KAAiF;QAEjF,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,qBAAQ,CAAC,IAAI,CACX,uEAAuE,uBAAU,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAC3G,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AA5SD,gEA4SC"}
@@ -0,0 +1,31 @@
1
+ import { Request, Response } from 'express';
2
+ import { DyNTS_Controller } from '../../_services/route/controller.service';
3
+ import { DyNTS_Notification_Service } from './notification.service';
4
+ /** BFR-OLDLIGHTSITE-001 — the notification routes' configuration. */
5
+ export interface DyNTS_NotificationsController_Config {
6
+ service: DyNTS_Notification_Service;
7
+ /** REQUIRED: every route is per account, so it must be authenticated. */
8
+ authPreProcess: (req: Request, res: Response) => Promise<void>;
9
+ /** The account of the request (default: the auth service's issuer — `fdp-issuer-is-account-id`). */
10
+ resolveAccountId?: (req: Request) => string | undefined;
11
+ }
12
+ /**
13
+ * BFR-OLDLIGHTSITE-001 — the account's own notifications over HTTP (creating one is a server-side call of the
14
+ * service, never a route):
15
+ *
16
+ * - `GET /list?limit=20&before=<cursor>&unreadOnly=true` → `{ items, nextCursor, unreadCount }`
17
+ * - `GET /unread-count` → `{ unreadCount }`
18
+ * - `POST /read` `{ ids: string[] }` → `{ updated, notFound, unreadCount }`
19
+ * - `POST /read-all` `{ upTo?: ISO date }` → `{ updated, notFound: [], unreadCount }`
20
+ */
21
+ export declare class DyNTS_Notifications_Controller extends DyNTS_Controller {
22
+ private static config;
23
+ static configure(config: DyNTS_NotificationsController_Config): void;
24
+ static getInstance(): DyNTS_Notifications_Controller;
25
+ /** The current configuration — read on EVERY request, so a reconfiguration never leaves a stale service or auth. */
26
+ static requireConfig(): DyNTS_NotificationsController_Config;
27
+ setupEndpoints(): void;
28
+ /** The request's account — a missing one is a 401 (never an "empty account" read). */
29
+ static accountOf(req: Request): string;
30
+ }
31
+ //# sourceMappingURL=notifications.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.controller.d.ts","sourceRoot":"","sources":["../../../src/_modules/notifications/notifications.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAO5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEpE,qEAAqE;AACrE,MAAM,WAAW,oCAAoC;IACnD,OAAO,EAAE,0BAA0B,CAAC;IACpC,yEAAyE;IACzE,cAAc,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,oGAAoG;IACpG,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,CAAC;CACzD;AAED;;;;;;;;GAQG;AACH,qBAAa,8BAA+B,SAAQ,gBAAgB;IAClE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAqD;IAE1E,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,oCAAoC,GAAG,IAAI;IAOpE,MAAM,CAAC,WAAW,IAAI,8BAA8B;IAIpD,oHAAoH;IACpH,MAAM,CAAC,aAAa,IAAI,oCAAoC;IAY5D,cAAc,IAAI,IAAI;IA8DtB,sFAAsF;IACtF,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;CAuBvC"}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyNTS_Notifications_Controller = void 0;
4
+ const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
5
+ const global_settings_const_1 = require("../../_collections/global-settings.const");
6
+ const endpoint_params_control_model_1 = require("../../_models/control-models/endpoint-params.control-model");
7
+ const global_service_1 = require("../../_services/core/global.service");
8
+ const controller_service_1 = require("../../_services/route/controller.service");
9
+ /**
10
+ * BFR-OLDLIGHTSITE-001 — the account's own notifications over HTTP (creating one is a server-side call of the
11
+ * service, never a route):
12
+ *
13
+ * - `GET /list?limit=20&before=<cursor>&unreadOnly=true` → `{ items, nextCursor, unreadCount }`
14
+ * - `GET /unread-count` → `{ unreadCount }`
15
+ * - `POST /read` `{ ids: string[] }` → `{ updated, notFound, unreadCount }`
16
+ * - `POST /read-all` `{ upTo?: ISO date }` → `{ updated, notFound: [], unreadCount }`
17
+ */
18
+ class DyNTS_Notifications_Controller extends controller_service_1.DyNTS_Controller {
19
+ static config = null;
20
+ static configure(config) {
21
+ if (!config?.service || typeof config.authPreProcess !== 'function') {
22
+ throw new Error('DYNTS_NOTIFICATIONS_CONTROLLER_CONFIG_INVALID: a service and an authPreProcess are required');
23
+ }
24
+ DyNTS_Notifications_Controller.config = config;
25
+ }
26
+ static getInstance() {
27
+ return DyNTS_Notifications_Controller.getSingletonInstance();
28
+ }
29
+ /** The current configuration — read on EVERY request, so a reconfiguration never leaves a stale service or auth. */
30
+ static requireConfig() {
31
+ const config = DyNTS_Notifications_Controller.config;
32
+ if (!config) {
33
+ throw new Error('DYNTS_NOTIFICATIONS_CONTROLLER_NOT_CONFIGURED: call DyNTS_getNotificationsRoutingModule(config)');
34
+ }
35
+ return config;
36
+ }
37
+ setupEndpoints() {
38
+ DyNTS_Notifications_Controller.requireConfig();
39
+ const auth = [
40
+ (req, res) => (DyNTS_Notifications_Controller.requireConfig().authPreProcess(req, res)),
41
+ ];
42
+ const service = () => DyNTS_Notifications_Controller.requireConfig().service;
43
+ this.endpoints = [
44
+ new endpoint_params_control_model_1.DyNTS_Endpoint_Params({
45
+ name: 'listNotifications',
46
+ type: fsm_dynamo_1.DyFM_HttpCallType.get,
47
+ endpoint: '/list',
48
+ preProcesses: auth,
49
+ tasks: [
50
+ async (req, res) => {
51
+ res.send(await service().listForAccount(DyNTS_Notifications_Controller.accountOf(req), {
52
+ limit: req.query.limit === undefined ? undefined : Number(req.query.limit),
53
+ before: typeof req.query.before === 'string' ? req.query.before : undefined,
54
+ unreadOnly: req.query.unreadOnly === 'true',
55
+ }));
56
+ },
57
+ ],
58
+ }),
59
+ new endpoint_params_control_model_1.DyNTS_Endpoint_Params({
60
+ name: 'unreadNotificationCount',
61
+ type: fsm_dynamo_1.DyFM_HttpCallType.get,
62
+ endpoint: '/unread-count',
63
+ preProcesses: auth,
64
+ tasks: [
65
+ async (req, res) => {
66
+ res.send({ unreadCount: await service().unreadCount(DyNTS_Notifications_Controller.accountOf(req)) });
67
+ },
68
+ ],
69
+ }),
70
+ new endpoint_params_control_model_1.DyNTS_Endpoint_Params({
71
+ name: 'markNotificationsRead',
72
+ type: fsm_dynamo_1.DyFM_HttpCallType.post,
73
+ endpoint: '/read',
74
+ preProcesses: auth,
75
+ tasks: [
76
+ async (req, res) => {
77
+ res.send(await service().markRead(DyNTS_Notifications_Controller.accountOf(req), req.body?.ids));
78
+ },
79
+ ],
80
+ }),
81
+ new endpoint_params_control_model_1.DyNTS_Endpoint_Params({
82
+ name: 'markAllNotificationsRead',
83
+ type: fsm_dynamo_1.DyFM_HttpCallType.post,
84
+ endpoint: '/read-all',
85
+ preProcesses: auth,
86
+ tasks: [
87
+ async (req, res) => {
88
+ res.send(await service().markAllRead(DyNTS_Notifications_Controller.accountOf(req), req.body?.upTo));
89
+ },
90
+ ],
91
+ }),
92
+ ];
93
+ }
94
+ /** The request's account — a missing one is a 401 (never an "empty account" read). */
95
+ static accountOf(req) {
96
+ const config = DyNTS_Notifications_Controller.config;
97
+ let accountId;
98
+ try {
99
+ accountId = config?.resolveAccountId
100
+ ? config.resolveAccountId(req)
101
+ : global_service_1.DyNTS_GlobalService.getAuthService()?.getIssuerFromRequest(req);
102
+ }
103
+ catch {
104
+ accountId = undefined;
105
+ }
106
+ if (!accountId || accountId === 'unknown') {
107
+ throw new fsm_dynamo_1.DyFM_Error({
108
+ status: 401,
109
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-NTF-AU0`,
110
+ message: 'Notifications: the request has no account.',
111
+ userMessage: 'Please sign in to see your notifications.',
112
+ });
113
+ }
114
+ return accountId;
115
+ }
116
+ }
117
+ exports.DyNTS_Notifications_Controller = DyNTS_Notifications_Controller;
118
+ //# sourceMappingURL=notifications.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.controller.js","sourceRoot":"","sources":["../../../src/_modules/notifications/notifications.controller.ts"],"names":[],"mappings":";;;AAEA,sDAAsE;AAEtE,oFAAiF;AACjF,8GAAmG;AACnG,wEAA0E;AAC1E,iFAA4E;AAY5E;;;;;;;;GAQG;AACH,MAAa,8BAA+B,SAAQ,qCAAgB;IAC1D,MAAM,CAAC,MAAM,GAAgD,IAAI,CAAC;IAE1E,MAAM,CAAC,SAAS,CAAC,MAA4C;QA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B,CAAC,IAAI;gBAC5B,QAAQ,EAAE,WAAW;gBACrB,YAAY,EAAE,IAAI;gBAClB,KAAK,EAAE;oBACL,KAAK,EAAE,GAAY,EAAE,GAAa,EAAiB,EAAE;wBACnD,GAAG,CAAC,IAAI,CAAC,MAAM,OAAO,EAAE,CAAC,WAAW,CAAC,8BAA8B,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;oBACvG,CAAC;iBACF;aACF,CAAC;SACH,CAAC;IACJ,CAAC;IAED,sFAAsF;IACtF,MAAM,CAAC,SAAS,CAAC,GAAY;QAC3B,MAAM,MAAM,GAAgD,8BAA8B,CAAC,MAAM,CAAC;QAClG,IAAI,SAA6B,CAAC;QAElC,IAAI,CAAC;YACH,SAAS,GAAG,MAAM,EAAE,gBAAgB;gBAClC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC;gBAC9B,CAAC,CAAC,oCAAmB,CAAC,cAAc,EAAE,EAAE,oBAAoB,CAAC,GAAG,CAAC,CAAC;QACtE,CAAC;QAAC,MAAM,CAAC;YACP,SAAS,GAAG,SAAS,CAAC;QACxB,CAAC;QAED,IAAI,CAAC,SAAS,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC1C,MAAM,IAAI,uBAAU,CAAC;gBACnB,MAAM,EAAE,GAAG;gBACX,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,gBAAgB;gBACvE,OAAO,EAAE,4CAA4C;gBACrD,WAAW,EAAE,2CAA2C;aACzD,CAAC,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;;AAhHH,wEAiHC"}
@@ -17,6 +17,8 @@
17
17
  * Only the two sink endpoints use this; server-internal `recordError` callers (trusted) are unchanged.
18
18
  */
19
19
  export declare class DyNTS_ErrorsSink_Util {
20
+ /** The `source` of a client report that names none (BFR-MASTERPROMPTER-085). */
21
+ static readonly unknownClientSource: string;
20
22
  /** Fields a client-submitted error record must never set. */
21
23
  static readonly serverOwnedKeys: readonly string[];
22
24
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"errors-sink.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/server/errors/errors-sink.util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,qBAAqB;IAEhC,6DAA6D;IAC7D,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAShD;IAEF;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC;CAanC"}
1
+ {"version":3,"file":"errors-sink.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/server/errors/errors-sink.util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,qBAAqB;IAEhC,gFAAgF;IAChF,MAAM,CAAC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAoB;IAE/D,6DAA6D;IAC7D,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAShD;IAEF;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC;CAqBnC"}
@@ -20,6 +20,8 @@ exports.DyNTS_ErrorsSink_Util = void 0;
20
20
  * Only the two sink endpoints use this; server-internal `recordError` callers (trusted) are unchanged.
21
21
  */
22
22
  class DyNTS_ErrorsSink_Util {
23
+ /** The `source` of a client report that names none (BFR-MASTERPROMPTER-085). */
24
+ static unknownClientSource = 'CLIENT-UNKNOWN';
23
25
  /** Fields a client-submitted error record must never set. */
24
26
  static serverOwnedKeys = [
25
27
  // record identity + DyFM metadata
@@ -43,6 +45,12 @@ class DyNTS_ErrorsSink_Util {
43
45
  for (const key of DyNTS_ErrorsSink_Util.serverOwnedKeys) {
44
46
  Reflect.deleteProperty(clean, key);
45
47
  }
48
+ // BFR-MASTERPROMPTER-085 — a report without a usable `source` is stored as `CLIENT-UNKNOWN`, so every reader can
49
+ // rely on the field (before, one such record crashed the error statistics)
50
+ const source = Reflect.get(clean, 'source');
51
+ if (typeof source !== 'string' || !source.trim()) {
52
+ Reflect.set(clean, 'source', DyNTS_ErrorsSink_Util.unknownClientSource);
53
+ }
46
54
  return clean;
47
55
  }
48
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errors-sink.util.js","sourceRoot":"","sources":["../../../../src/_modules/server/errors/errors-sink.util.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,qBAAqB;IAEhC,6DAA6D;IAC7D,MAAM,CAAU,eAAe,GAAsB;QACnD,kCAAkC;QAClC,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,KAAK;QAC9E,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa;QACpD,YAAY;QACZ,QAAQ,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB;QACnH,mBAAmB,EAAE,qBAAqB;QAC1C,2CAA2C;QAC3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,uBAAuB,EAAE,kBAAkB;KACjF,CAAC;IAEF;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAI,IAAO;QAC5B,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GAAe,EAAE,GAAG,IAAI,EAAE,CAAC;QAEtC,KAAK,MAAM,GAAG,IAAI,qBAAqB,CAAC,eAAe,EAAE,CAAC;YACxD,OAAO,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACrC,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CA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AAO,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;QAC1E,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;;AAzCH,sDA0CC"}
@@ -102,6 +102,14 @@ export declare abstract class DyNTS_ServerStatus_ControlService<T_ServerStatus e
102
102
  * ne irányítson forgalmat a DB-vesztett instance-ra.
103
103
  */
104
104
  checkDbReadiness(): Promise<DyNTS_DbReadiness>;
105
+ /**
106
+ * BFR-MASTERPROMPTER-085 — whether a stored error came from a server. `source` is OPTIONAL on `DyFM_Errors` and the
107
+ * unauthenticated client sink (`/error/log`) does not require it, so a record without it counts as a client error
108
+ * and never throws: before, ONE such record turned the whole error statistics into a permanent 500.
109
+ */
110
+ static isServerError(error: {
111
+ source?: unknown;
112
+ }): boolean;
105
113
  getErrorStatistics(range: DyFM_RelativeDate, issuer: string): Promise<DyFM_Error_Statistics>;
106
114
  protected getVersionNumeric(version: string): number;
107
115
  protected clientVersionIsLatest(clientVersion: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"server-status.control-service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/server/server-status/server-status.control-service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,YAAY,EAAS,MAAM,MAAM,CAAC;AAE3C,OAAO,EACU,iBAAiB,EAAa,iBAAiB,EAC9D,UAAU,EAAE,qBAAqB,EAAE,WAAW,EAG9C,gCAAgC,EAGjC,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,aAAa,EAAsB,MAAM,0CAA0C,CAAC;AAC7F,OAAO,EAAqB,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEpG,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC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AAI,OAAO,CAAC,iBAAiB,CAAC;IAoD9C,kBAAkB,CACtB,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,qBAAqB,CAAC;IA+FjC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAUpD,SAAS,CAAC,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;IA4B/D,SAAS,CAAC,sBAAsB,CAAC,aAAa,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAAG,IAAI;cAO3E,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB9D,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAiB/E"}
1
+ {"version":3,"file":"server-status.control-service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/server/server-status/server-status.control-service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,YAAY,EAAS,MAAM,MAAM,CAAC;AAE3C,OAAO,EACU,iBAAiB,EAAa,iBAAiB,EAC9D,UAAU,EAAE,qBAAqB,EAAE,WAAW,EAG9C,gCAAgC,EAGjC,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,aAAa,EAAsB,MAAM,0CAA0C,CAAC;AAC7F,OAAO,EAAqB,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEpG,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AAErG,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,U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