@iveri/contracts 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -1
- package/dist/cjs/api/notification/index.d.ts +5 -0
- package/dist/cjs/api/notification/index.d.ts.map +1 -0
- package/dist/cjs/api/notification/index.js +21 -0
- package/dist/cjs/api/notification/index.js.map +1 -0
- package/dist/cjs/api/notification/notification-channel.enum.d.ts +27 -0
- package/dist/cjs/api/notification/notification-channel.enum.d.ts.map +1 -0
- package/dist/cjs/api/notification/notification-channel.enum.js +31 -0
- package/dist/cjs/api/notification/notification-channel.enum.js.map +1 -0
- package/dist/cjs/api/notification/notification-delivery-status.enum.d.ts +45 -0
- package/dist/cjs/api/notification/notification-delivery-status.enum.d.ts.map +1 -0
- package/dist/cjs/api/notification/notification-delivery-status.enum.js +49 -0
- package/dist/cjs/api/notification/notification-delivery-status.enum.js.map +1 -0
- package/dist/cjs/api/notification/notification-template.type.d.ts +68 -0
- package/dist/cjs/api/notification/notification-template.type.d.ts.map +1 -0
- package/dist/cjs/api/notification/notification-template.type.js +3 -0
- package/dist/cjs/api/notification/notification-template.type.js.map +1 -0
- package/dist/cjs/api/notification/notification.type.d.ts +136 -0
- package/dist/cjs/api/notification/notification.type.d.ts.map +1 -0
- package/dist/cjs/api/notification/notification.type.js +3 -0
- package/dist/cjs/api/notification/notification.type.js.map +1 -0
- package/dist/cjs/api/realtime/index.d.ts +4 -0
- package/dist/cjs/api/realtime/index.d.ts.map +1 -0
- package/dist/cjs/api/realtime/index.js +20 -0
- package/dist/cjs/api/realtime/index.js.map +1 -0
- package/dist/cjs/api/realtime/realtime-event-type.enum.d.ts +14 -0
- package/dist/cjs/api/realtime/realtime-event-type.enum.d.ts.map +1 -0
- package/dist/cjs/api/realtime/realtime-event-type.enum.js +18 -0
- package/dist/cjs/api/realtime/realtime-event-type.enum.js.map +1 -0
- package/dist/cjs/api/realtime/realtime-resource-type.enum.d.ts +13 -0
- package/dist/cjs/api/realtime/realtime-resource-type.enum.d.ts.map +1 -0
- package/dist/cjs/api/realtime/realtime-resource-type.enum.js +17 -0
- package/dist/cjs/api/realtime/realtime-resource-type.enum.js.map +1 -0
- package/dist/cjs/api/realtime/realtime.type.d.ts +106 -0
- package/dist/cjs/api/realtime/realtime.type.d.ts.map +1 -0
- package/dist/cjs/api/realtime/realtime.type.js +21 -0
- package/dist/cjs/api/realtime/realtime.type.js.map +1 -0
- package/dist/cjs/enum/user-permission.enum.d.ts +66 -1
- package/dist/cjs/enum/user-permission.enum.d.ts.map +1 -1
- package/dist/cjs/enum/user-permission.enum.js +67 -0
- package/dist/cjs/enum/user-permission.enum.js.map +1 -1
- package/dist/esm/api/notification/index.d.ts +5 -0
- package/dist/esm/api/notification/index.d.ts.map +1 -0
- package/dist/esm/api/notification/index.js +5 -0
- package/dist/esm/api/notification/index.js.map +1 -0
- package/dist/esm/api/notification/notification-channel.enum.d.ts +27 -0
- package/dist/esm/api/notification/notification-channel.enum.d.ts.map +1 -0
- package/dist/esm/api/notification/notification-channel.enum.js +28 -0
- package/dist/esm/api/notification/notification-channel.enum.js.map +1 -0
- package/dist/esm/api/notification/notification-delivery-status.enum.d.ts +45 -0
- package/dist/esm/api/notification/notification-delivery-status.enum.d.ts.map +1 -0
- package/dist/esm/api/notification/notification-delivery-status.enum.js +46 -0
- package/dist/esm/api/notification/notification-delivery-status.enum.js.map +1 -0
- package/dist/esm/api/notification/notification-template.type.d.ts +68 -0
- package/dist/esm/api/notification/notification-template.type.d.ts.map +1 -0
- package/dist/esm/api/notification/notification-template.type.js +2 -0
- package/dist/esm/api/notification/notification-template.type.js.map +1 -0
- package/dist/esm/api/notification/notification.type.d.ts +136 -0
- package/dist/esm/api/notification/notification.type.d.ts.map +1 -0
- package/dist/esm/api/notification/notification.type.js +2 -0
- package/dist/esm/api/notification/notification.type.js.map +1 -0
- package/dist/esm/api/realtime/index.d.ts +4 -0
- package/dist/esm/api/realtime/index.d.ts.map +1 -0
- package/dist/esm/api/realtime/index.js +4 -0
- package/dist/esm/api/realtime/index.js.map +1 -0
- package/dist/esm/api/realtime/realtime-event-type.enum.d.ts +14 -0
- package/dist/esm/api/realtime/realtime-event-type.enum.d.ts.map +1 -0
- package/dist/esm/api/realtime/realtime-event-type.enum.js +15 -0
- package/dist/esm/api/realtime/realtime-event-type.enum.js.map +1 -0
- package/dist/esm/api/realtime/realtime-resource-type.enum.d.ts +13 -0
- package/dist/esm/api/realtime/realtime-resource-type.enum.d.ts.map +1 -0
- package/dist/esm/api/realtime/realtime-resource-type.enum.js +14 -0
- package/dist/esm/api/realtime/realtime-resource-type.enum.js.map +1 -0
- package/dist/esm/api/realtime/realtime.type.d.ts +106 -0
- package/dist/esm/api/realtime/realtime.type.d.ts.map +1 -0
- package/dist/esm/api/realtime/realtime.type.js +18 -0
- package/dist/esm/api/realtime/realtime.type.js.map +1 -0
- package/dist/esm/enum/user-permission.enum.d.ts +66 -1
- package/dist/esm/enum/user-permission.enum.d.ts.map +1 -1
- package/dist/esm/enum/user-permission.enum.js +67 -0
- package/dist/esm/enum/user-permission.enum.js.map +1 -1
- package/package.json +17 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
3
|
+
import type { RealtimeEventType } from './realtime-event-type.enum.js';
|
|
4
|
+
import type { RealtimeResourceType } from './realtime-resource-type.enum.js';
|
|
5
|
+
export declare const REALTIME_CLIENT_EVENT: {
|
|
6
|
+
readonly SUBSCRIBE: "realtime.subscribe";
|
|
7
|
+
readonly UNSUBSCRIBE: "realtime.unsubscribe";
|
|
8
|
+
};
|
|
9
|
+
export declare const REALTIME_SERVER_EVENT: {
|
|
10
|
+
readonly READY: "realtime.ready";
|
|
11
|
+
readonly SUBSCRIBED: "realtime.subscribed";
|
|
12
|
+
readonly RESOURCE_UPDATED: "realtime.resource-updated";
|
|
13
|
+
readonly ERROR: "realtime.error";
|
|
14
|
+
};
|
|
15
|
+
export declare const REALTIME_PROTOCOL_VERSION = 1;
|
|
16
|
+
export declare const MAX_REALTIME_SUBSCRIPTIONS_PER_SOCKET = 100;
|
|
17
|
+
export declare const MAX_REALTIME_EVENT_BYTES: number;
|
|
18
|
+
export declare const DEFAULT_REALTIME_GRANT_TTL_SECONDS = 120;
|
|
19
|
+
export declare const MAX_REALTIME_GRANT_TTL_SECONDS = 300;
|
|
20
|
+
export declare const REALTIME_GRANT_AUDIENCE = "iveri-realtime-subscription";
|
|
21
|
+
export declare const REALTIME_GRANT_ISSUER = "iveri-realtime";
|
|
22
|
+
/**
|
|
23
|
+
* Requested by an owning API only after it has authorized a person to read the resource.
|
|
24
|
+
*
|
|
25
|
+
* `tenantId` is absent: it comes from the API's service token. The grant is bound to
|
|
26
|
+
* `subjectId`, so copying one to another authenticated socket does not authorize that socket.
|
|
27
|
+
*/
|
|
28
|
+
export interface IssueRealtimeSubscriptionGrantBody {
|
|
29
|
+
subjectId: UUID;
|
|
30
|
+
resourceType: RealtimeResourceType;
|
|
31
|
+
resourceId: UUID;
|
|
32
|
+
ttlSeconds?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface RealtimeSubscriptionGrantResponse {
|
|
35
|
+
grant: string;
|
|
36
|
+
expiresAt: IsoDateTime;
|
|
37
|
+
}
|
|
38
|
+
/** Claims inside a subscription grant signed and verified only by `iveri-realtime`. */
|
|
39
|
+
export interface RealtimeSubscriptionGrantClaims {
|
|
40
|
+
jti: UUID;
|
|
41
|
+
sub: UUID;
|
|
42
|
+
tid: UUID;
|
|
43
|
+
azp: UUID;
|
|
44
|
+
resourceType: RealtimeResourceType;
|
|
45
|
+
resourceId: UUID;
|
|
46
|
+
purpose: 'subscription';
|
|
47
|
+
iat: number;
|
|
48
|
+
exp: number;
|
|
49
|
+
iss: typeof REALTIME_GRANT_ISSUER;
|
|
50
|
+
aud: typeof REALTIME_GRANT_AUDIENCE;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A product service's best-effort change notification.
|
|
54
|
+
*
|
|
55
|
+
* The tenant comes from the authenticated service principal and is intentionally absent here.
|
|
56
|
+
* `idempotencyKey` makes an HTTP retry harmless; no domain data or location coordinates travel
|
|
57
|
+
* over this channel.
|
|
58
|
+
*/
|
|
59
|
+
export interface PublishRealtimeEventBody {
|
|
60
|
+
idempotencyKey: UUID;
|
|
61
|
+
resourceType: RealtimeResourceType;
|
|
62
|
+
resourceId: UUID;
|
|
63
|
+
event: RealtimeEventType;
|
|
64
|
+
version: number;
|
|
65
|
+
occurredAt: IsoDateTime;
|
|
66
|
+
}
|
|
67
|
+
export interface PublishRealtimeEventResponse {
|
|
68
|
+
accepted: boolean;
|
|
69
|
+
duplicate: boolean;
|
|
70
|
+
}
|
|
71
|
+
/** A socket subscribes with grants, never with client-chosen room names or bare resource ids. */
|
|
72
|
+
export interface RealtimeSubscribeRequest {
|
|
73
|
+
grants: string[];
|
|
74
|
+
}
|
|
75
|
+
export interface RealtimeUnsubscribeRequest {
|
|
76
|
+
subscriptions: RealtimeSubscription[];
|
|
77
|
+
}
|
|
78
|
+
export interface RealtimeSubscription {
|
|
79
|
+
resourceType: RealtimeResourceType;
|
|
80
|
+
resourceId: UUID;
|
|
81
|
+
}
|
|
82
|
+
export interface RealtimeReadyMessage {
|
|
83
|
+
protocolVersion: typeof REALTIME_PROTOCOL_VERSION;
|
|
84
|
+
}
|
|
85
|
+
export interface RealtimeSubscribedMessage {
|
|
86
|
+
subscriptions: RealtimeSubscription[];
|
|
87
|
+
}
|
|
88
|
+
export interface RealtimeResourceUpdatedMessage {
|
|
89
|
+
resourceType: RealtimeResourceType;
|
|
90
|
+
resourceId: UUID;
|
|
91
|
+
event: RealtimeEventType;
|
|
92
|
+
version: number;
|
|
93
|
+
occurredAt: IsoDateTime;
|
|
94
|
+
}
|
|
95
|
+
export interface RealtimeErrorMessage {
|
|
96
|
+
code: 'UNAUTHENTICATED' | 'FORBIDDEN' | 'INVALID_GRANT' | 'INVALID_SUBSCRIPTION' | 'SUBSCRIPTION_LIMIT_REACHED';
|
|
97
|
+
message: string;
|
|
98
|
+
}
|
|
99
|
+
export type RealtimeSubscriptionAck = {
|
|
100
|
+
ok: true;
|
|
101
|
+
message: RealtimeSubscribedMessage;
|
|
102
|
+
} | {
|
|
103
|
+
ok: false;
|
|
104
|
+
message: RealtimeErrorMessage;
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=realtime.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtime.type.d.ts","sourceRoot":"","sources":["../../../../src/api/realtime/realtime.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,eAAO,MAAM,qBAAqB;;;CAGxB,CAAC;AAEX,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AAEX,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,qCAAqC,MAAM,CAAC;AACzD,eAAO,MAAM,wBAAwB,QAAW,CAAC;AACjD,eAAO,MAAM,kCAAkC,MAAM,CAAC;AACtD,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAClD,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AACrE,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,kCAAkC;IAC/C,SAAS,EAAE,IAAI,CAAC;IAChB,YAAY,EAAE,oBAAoB,CAAC;IACnC,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iCAAiC;IAC9C,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AU,EAAE,IAAI,CAAC;IACjB,KAAK,EAAE,iBAAiB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,WAAW,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,iBAAiB,GAAG,WAAW,GAAG,eAAe,GAAG,sBAAsB,GAAG,4BAA4B,CAAC;IAChH,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,uBAAuB,GAC/B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,yBAAyB,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,oBAAoB,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REALTIME_GRANT_ISSUER = exports.REALTIME_GRANT_AUDIENCE = exports.MAX_REALTIME_GRANT_TTL_SECONDS = exports.DEFAULT_REALTIME_GRANT_TTL_SECONDS = exports.MAX_REALTIME_EVENT_BYTES = exports.MAX_REALTIME_SUBSCRIPTIONS_PER_SOCKET = exports.REALTIME_PROTOCOL_VERSION = exports.REALTIME_SERVER_EVENT = exports.REALTIME_CLIENT_EVENT = void 0;
|
|
4
|
+
exports.REALTIME_CLIENT_EVENT = {
|
|
5
|
+
SUBSCRIBE: 'realtime.subscribe',
|
|
6
|
+
UNSUBSCRIBE: 'realtime.unsubscribe',
|
|
7
|
+
};
|
|
8
|
+
exports.REALTIME_SERVER_EVENT = {
|
|
9
|
+
READY: 'realtime.ready',
|
|
10
|
+
SUBSCRIBED: 'realtime.subscribed',
|
|
11
|
+
RESOURCE_UPDATED: 'realtime.resource-updated',
|
|
12
|
+
ERROR: 'realtime.error',
|
|
13
|
+
};
|
|
14
|
+
exports.REALTIME_PROTOCOL_VERSION = 1;
|
|
15
|
+
exports.MAX_REALTIME_SUBSCRIPTIONS_PER_SOCKET = 100;
|
|
16
|
+
exports.MAX_REALTIME_EVENT_BYTES = 4 * 1024;
|
|
17
|
+
exports.DEFAULT_REALTIME_GRANT_TTL_SECONDS = 120;
|
|
18
|
+
exports.MAX_REALTIME_GRANT_TTL_SECONDS = 300;
|
|
19
|
+
exports.REALTIME_GRANT_AUDIENCE = 'iveri-realtime-subscription';
|
|
20
|
+
exports.REALTIME_GRANT_ISSUER = 'iveri-realtime';
|
|
21
|
+
//# sourceMappingURL=realtime.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtime.type.js","sourceRoot":"","sources":["../../../../src/api/realtime/realtime.type.ts"],"names":[],"mappings":";;;AAMa,QAAA,qBAAqB,GAAG;IACjC,SAAS,EAAE,oBAAoB;IAC/B,WAAW,EAAE,sBAAsB;CAC7B,CAAC;AAEE,QAAA,qBAAqB,GAAG;IACjC,KAAK,EAAE,gBAAgB;IACvB,UAAU,EAAE,qBAAqB;IACjC,gBAAgB,EAAE,2BAA2B;IAC7C,KAAK,EAAE,gBAAgB;CACjB,CAAC;AAEE,QAAA,yBAAyB,GAAG,CAAC,CAAC;AAC9B,QAAA,qCAAqC,GAAG,GAAG,CAAC;AAC5C,QAAA,wBAAwB,GAAG,CAAC,GAAG,IAAI,CAAC;AACpC,QAAA,kCAAkC,GAAG,GAAG,CAAC;AACzC,QAAA,8BAA8B,GAAG,GAAG,CAAC;AACrC,QAAA,uBAAuB,GAAG,6BAA6B,CAAC;AACxD,QAAA,qBAAqB,GAAG,gBAAgB,CAAC"}
|
|
@@ -271,7 +271,72 @@ export declare enum UserPermission {
|
|
|
271
271
|
* rendering an invoice line hold this and nothing else here — they have no reason to read the
|
|
272
272
|
* key catalogue, and separating it keeps a compromised worker from enumerating it.
|
|
273
273
|
*/
|
|
274
|
-
LOCALIZATION_RENDER = "localization:render"
|
|
274
|
+
LOCALIZATION_RENDER = "localization:render",
|
|
275
|
+
/**
|
|
276
|
+
* Submit a notification for delivery.
|
|
277
|
+
*
|
|
278
|
+
* **A service permission, and the sharpest one here.** It reaches a real person's mailbox with
|
|
279
|
+
* text the platform composed, and it is not deliberately absent from the seeded `ADMIN` role
|
|
280
|
+
* the way `UNIBOX_REALTIME_PUBLISH` is — an admin has no reason to hold it, because there is
|
|
281
|
+
* nothing for a human to prove by sending a notification to somebody else by hand.
|
|
282
|
+
*
|
|
283
|
+
* Note what it does *not* let a holder do: a submission names a **template key**, never a
|
|
284
|
+
* subject and body. The wording of every notification the platform sends was written by
|
|
285
|
+
* somebody holding {@link UserPermission.NOTIFICATION_TEMPLATE_MANAGE} and translated by
|
|
286
|
+
* somebody holding {@link UserPermission.LOCALIZATION_TRANSLATE}. This is the same shape as
|
|
287
|
+
* `CONDUIT_DISPATCH_SEND` naming an operation rather than a URL, and it is load-bearing for
|
|
288
|
+
* the same reason: without it, a compromised service principal is an authenticated way to
|
|
289
|
+
* send arbitrary text from our own domain to any address it likes.
|
|
290
|
+
*/
|
|
291
|
+
NOTIFICATION_SEND = "notification:send",
|
|
292
|
+
/**
|
|
293
|
+
* Read **your own** in-app inbox, and mark your own rows read.
|
|
294
|
+
*
|
|
295
|
+
* Scoped to the calling principal by the endpoint, not by this permission — there is no
|
|
296
|
+
* variant that reads somebody else's inbox, because a notification is addressed to one person
|
|
297
|
+
* and reading another's is reading their mail. It belongs in every human role, including the
|
|
298
|
+
* narrowest, for the same reason: without it a member cannot see what the product is telling
|
|
299
|
+
* them.
|
|
300
|
+
*/
|
|
301
|
+
NOTIFICATION_READ = "notification:read",
|
|
302
|
+
/** Read the tenant's notification templates and the platform's built-in ones. */
|
|
303
|
+
NOTIFICATION_TEMPLATE_READ = "notification:template:read",
|
|
304
|
+
/**
|
|
305
|
+
* Override a built-in template, or define a new one — which channels a notification type
|
|
306
|
+
* reaches and which message keys it renders.
|
|
307
|
+
*
|
|
308
|
+
* Configuration that decides what every future notification of a type says, including the
|
|
309
|
+
* password-reset email. Overriding one badly is a way to stop people getting back into their
|
|
310
|
+
* accounts, so it is separated from reading for the same reason `CONDUIT_CONNECTOR_MANAGE` is.
|
|
311
|
+
*/
|
|
312
|
+
NOTIFICATION_TEMPLATE_MANAGE = "notification:template:manage",
|
|
313
|
+
/**
|
|
314
|
+
* Read the delivery log and the dead-letter queue, including each delivery's last error.
|
|
315
|
+
*
|
|
316
|
+
* Grouped with reading rather than with operating the queue, and it is closer to a data-read
|
|
317
|
+
* permission than a config one: the log names who was written to and about what.
|
|
318
|
+
*/
|
|
319
|
+
NOTIFICATION_DELIVERY_READ = "notification:delivery:read",
|
|
320
|
+
/**
|
|
321
|
+
* Redrive a dead-lettered delivery, or cancel one still pending.
|
|
322
|
+
*
|
|
323
|
+
* Separate from reading because it causes a message to be sent to a person rather than
|
|
324
|
+
* returning a row — and because redriving a backlog is a way to mail somebody the same thing
|
|
325
|
+
* fifty times an hour after an outage.
|
|
326
|
+
*/
|
|
327
|
+
NOTIFICATION_DELIVERY_OPERATE = "notification:delivery:operate",
|
|
328
|
+
/**
|
|
329
|
+
* Ask the shared gateway to issue a short-lived subscription grant after the owning API has
|
|
330
|
+
* authorized a person to read one resource. Service-only: a human may consume a grant but
|
|
331
|
+
* must never mint one.
|
|
332
|
+
*/
|
|
333
|
+
REALTIME_SUBSCRIPTION_GRANT_ISSUE = "realtime:subscription-grant:issue",
|
|
334
|
+
/**
|
|
335
|
+
* Publish an identifier-only resource change. Separate from grant issue because announcing a
|
|
336
|
+
* write and authorizing a read are distinct powers and a service may legitimately need one
|
|
337
|
+
* without the other.
|
|
338
|
+
*/
|
|
339
|
+
REALTIME_EVENT_PUBLISH = "realtime:event:publish"
|
|
275
340
|
}
|
|
276
341
|
/**
|
|
277
342
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-permission.enum.d.ts","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,cAAc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yBAAyB,8BAA8B;IACvD,qDAAqD;IACrD,2BAA2B,gCAAgC;IAG3D,yCAAyC;IACzC,kBAAkB,uBAAuB;IACzC,2DAA2D;IAC3D,oBAAoB,yBAAyB;IAG7C,+DAA+D;IAC/D,oBAAoB,yBAAyB;IAC7C,+EAA+E;IAC/E,sBAAsB,2BAA2B;IAGjD,2DAA2D;IAC3D,oBAAoB,yBAAyB;IAC7C,gDAAgD;IAChD,sBAAsB,2BAA2B;IAUjD;;;;;;;OAOG;IACH,iBAAiB,sBAAsB;IAEvC;;;;;;;OAOG;IACH,2BAA2B,gCAAgC;IAE3D;;;;;;;OAOG;IACH,sBAAsB,2BAA2B;IAEjD;;;;;;OAMG;IACH,oBAAoB,yBAAyB;IAE7C;;;;;;OAMG;IACH,mBAAmB,wBAAwB;IAI3C;;;;;;;;;;;;;;;OAeG;IACH,iBAAiB,sBAAsB;IAEvC;;;;;;;;OAQG;IACH,iBAAiB,sBAAsB;IAEvC,iFAAiF;IACjF,0BAA0B,+BAA+B;IAEzD;;;;;;;OAOG;IACH,4BAA4B,iCAAiC;IAE7D;;;;;OAKG;IACH,0BAA0B,+BAA+B;IAEzD;;;;;;OAMG;IACH,6BAA6B,kCAAkC;IAI/D;;;;OAIG;IACH,iCAAiC,sCAAsC;IAEvE;;;;OAIG;IACH,sBAAsB,2BAA2B;CACpD;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,cAAc,EAAiD,CAAC"}
|
|
@@ -319,6 +319,73 @@ var UserPermission;
|
|
|
319
319
|
* key catalogue, and separating it keeps a compromised worker from enumerating it.
|
|
320
320
|
*/
|
|
321
321
|
UserPermission["LOCALIZATION_RENDER"] = "localization:render";
|
|
322
|
+
// ══ iveri-notification-api ══════════════════════════════════════════════
|
|
323
|
+
/**
|
|
324
|
+
* Submit a notification for delivery.
|
|
325
|
+
*
|
|
326
|
+
* **A service permission, and the sharpest one here.** It reaches a real person's mailbox with
|
|
327
|
+
* text the platform composed, and it is not deliberately absent from the seeded `ADMIN` role
|
|
328
|
+
* the way `UNIBOX_REALTIME_PUBLISH` is — an admin has no reason to hold it, because there is
|
|
329
|
+
* nothing for a human to prove by sending a notification to somebody else by hand.
|
|
330
|
+
*
|
|
331
|
+
* Note what it does *not* let a holder do: a submission names a **template key**, never a
|
|
332
|
+
* subject and body. The wording of every notification the platform sends was written by
|
|
333
|
+
* somebody holding {@link UserPermission.NOTIFICATION_TEMPLATE_MANAGE} and translated by
|
|
334
|
+
* somebody holding {@link UserPermission.LOCALIZATION_TRANSLATE}. This is the same shape as
|
|
335
|
+
* `CONDUIT_DISPATCH_SEND` naming an operation rather than a URL, and it is load-bearing for
|
|
336
|
+
* the same reason: without it, a compromised service principal is an authenticated way to
|
|
337
|
+
* send arbitrary text from our own domain to any address it likes.
|
|
338
|
+
*/
|
|
339
|
+
UserPermission["NOTIFICATION_SEND"] = "notification:send";
|
|
340
|
+
/**
|
|
341
|
+
* Read **your own** in-app inbox, and mark your own rows read.
|
|
342
|
+
*
|
|
343
|
+
* Scoped to the calling principal by the endpoint, not by this permission — there is no
|
|
344
|
+
* variant that reads somebody else's inbox, because a notification is addressed to one person
|
|
345
|
+
* and reading another's is reading their mail. It belongs in every human role, including the
|
|
346
|
+
* narrowest, for the same reason: without it a member cannot see what the product is telling
|
|
347
|
+
* them.
|
|
348
|
+
*/
|
|
349
|
+
UserPermission["NOTIFICATION_READ"] = "notification:read";
|
|
350
|
+
/** Read the tenant's notification templates and the platform's built-in ones. */
|
|
351
|
+
UserPermission["NOTIFICATION_TEMPLATE_READ"] = "notification:template:read";
|
|
352
|
+
/**
|
|
353
|
+
* Override a built-in template, or define a new one — which channels a notification type
|
|
354
|
+
* reaches and which message keys it renders.
|
|
355
|
+
*
|
|
356
|
+
* Configuration that decides what every future notification of a type says, including the
|
|
357
|
+
* password-reset email. Overriding one badly is a way to stop people getting back into their
|
|
358
|
+
* accounts, so it is separated from reading for the same reason `CONDUIT_CONNECTOR_MANAGE` is.
|
|
359
|
+
*/
|
|
360
|
+
UserPermission["NOTIFICATION_TEMPLATE_MANAGE"] = "notification:template:manage";
|
|
361
|
+
/**
|
|
362
|
+
* Read the delivery log and the dead-letter queue, including each delivery's last error.
|
|
363
|
+
*
|
|
364
|
+
* Grouped with reading rather than with operating the queue, and it is closer to a data-read
|
|
365
|
+
* permission than a config one: the log names who was written to and about what.
|
|
366
|
+
*/
|
|
367
|
+
UserPermission["NOTIFICATION_DELIVERY_READ"] = "notification:delivery:read";
|
|
368
|
+
/**
|
|
369
|
+
* Redrive a dead-lettered delivery, or cancel one still pending.
|
|
370
|
+
*
|
|
371
|
+
* Separate from reading because it causes a message to be sent to a person rather than
|
|
372
|
+
* returning a row — and because redriving a backlog is a way to mail somebody the same thing
|
|
373
|
+
* fifty times an hour after an outage.
|
|
374
|
+
*/
|
|
375
|
+
UserPermission["NOTIFICATION_DELIVERY_OPERATE"] = "notification:delivery:operate";
|
|
376
|
+
// ══ iveri-realtime ══════════════════════════════════════════════════════
|
|
377
|
+
/**
|
|
378
|
+
* Ask the shared gateway to issue a short-lived subscription grant after the owning API has
|
|
379
|
+
* authorized a person to read one resource. Service-only: a human may consume a grant but
|
|
380
|
+
* must never mint one.
|
|
381
|
+
*/
|
|
382
|
+
UserPermission["REALTIME_SUBSCRIPTION_GRANT_ISSUE"] = "realtime:subscription-grant:issue";
|
|
383
|
+
/**
|
|
384
|
+
* Publish an identifier-only resource change. Separate from grant issue because announcing a
|
|
385
|
+
* write and authorizing a read are distinct powers and a service may legitimately need one
|
|
386
|
+
* without the other.
|
|
387
|
+
*/
|
|
388
|
+
UserPermission["REALTIME_EVENT_PUBLISH"] = "realtime:event:publish";
|
|
322
389
|
})(UserPermission || (exports.UserPermission = UserPermission = {}));
|
|
323
390
|
/**
|
|
324
391
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-permission.enum.js","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"user-permission.enum.js","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,IAAY,cAkaX;AAlaD,WAAY,cAAc;IACtB,4EAA4E;IAE5E,2EAA2E;IAC3E,6CAA2B,CAAA;IAC3B,iDAA+B,CAAA;IAC/B,sFAAsF;IACtF,iDAA+B,CAAA;IAE/B,2EAA2E;IAC3E,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,qDAAmC,CAAA;IACnC,6EAA6E;IAC7E,yDAAuC,CAAA;IACvC;;;OAGG;IACH,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,+CAA6B,CAAA;IAC7B,iDAA+B,CAAA;IAC/B,mDAAiC,CAAA;IAEjC,4EAA4E;IAE5E,2EAA2E;IAC3E,qEAAqE;IACrE,iEAA+C,CAAA;IAC/C,qEAAmD,CAAA;IACnD,qEAAmD,CAAA;IACnD,qEAAmD,CAAA;IAEnD,2EAA2E;IAC3E;;;;OAIG;IACH,+DAA6C,CAAA;IAC7C,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E;;;;OAIG;IACH,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E,iEAA+C,CAAA;IAC/C,yFAAyF;IACzF,qEAAmD,CAAA;IAEnD,2EAA2E;IAC3E,mEAAmE;IACnE,uEAAqD,CAAA;IACrD;;;;;;;OAOG;IACH,2EAAyD,CAAA;IAEzD,2EAA2E;IAC3E,2DAAyC,CAAA;IACzC,2DAA2D;IAC3D,+DAA6C,CAAA;IAE7C,2EAA2E;IAC3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E;;;;OAIG;IACH,mEAAiD,CAAA;AACrD,CAAC,EAlaW,cAAc,8BAAd,cAAc,QAkazB;AAED;;;;;GAKG;AACU,QAAA,oBAAoB,GAA8B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/notification/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/notification/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A way a notification reaches a person.
|
|
3
|
+
*
|
|
4
|
+
* A channel is not a provider. `EMAIL` says a message is addressed to a mailbox; whether it
|
|
5
|
+
* leaves through a local SMTP sink, SES or a transactional-email vendor is an adapter detail
|
|
6
|
+
* `iveri-notification-api` keeps behind its own boundary, and nothing on the wire names one.
|
|
7
|
+
*
|
|
8
|
+
* **There is deliberately no `PUSH` member yet**, and adding one is not a formality. Push needs a
|
|
9
|
+
* device registry, per-platform credentials (APNs keys, FCM service accounts) and a token-rotation
|
|
10
|
+
* story, none of which exist and none of which any product currently asks for. A member declared
|
|
11
|
+
* before the machinery behind it is a value a caller can send that quietly goes nowhere — worse
|
|
12
|
+
* than a 422 saying the channel is unknown, because it looks like it worked.
|
|
13
|
+
*/
|
|
14
|
+
export declare enum NotificationChannel {
|
|
15
|
+
/** A message to a mailbox. Needs `recipient.emailAddress`. */
|
|
16
|
+
EMAIL = "email",
|
|
17
|
+
/**
|
|
18
|
+
* A row in the recipient's own in-app inbox. Needs `recipient.userId`.
|
|
19
|
+
*
|
|
20
|
+
* The only channel whose delivery is a local write, which is why it is the one channel that
|
|
21
|
+
* cannot fail for a reason outside our control. It still goes through the same queue as
|
|
22
|
+
* email: a notification that fans out to both must not have one half committed inline and the
|
|
23
|
+
* other half queued, or a rollback leaves the two halves disagreeing about what happened.
|
|
24
|
+
*/
|
|
25
|
+
IN_APP = "in-app"
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=notification-channel.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-channel.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/notification/notification-channel.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,oBAAY,mBAAmB;IAC3B,8DAA8D;IAC9D,KAAK,UAAU;IAEf;;;;;;;OAOG;IACH,MAAM,WAAW;CACpB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A way a notification reaches a person.
|
|
3
|
+
*
|
|
4
|
+
* A channel is not a provider. `EMAIL` says a message is addressed to a mailbox; whether it
|
|
5
|
+
* leaves through a local SMTP sink, SES or a transactional-email vendor is an adapter detail
|
|
6
|
+
* `iveri-notification-api` keeps behind its own boundary, and nothing on the wire names one.
|
|
7
|
+
*
|
|
8
|
+
* **There is deliberately no `PUSH` member yet**, and adding one is not a formality. Push needs a
|
|
9
|
+
* device registry, per-platform credentials (APNs keys, FCM service accounts) and a token-rotation
|
|
10
|
+
* story, none of which exist and none of which any product currently asks for. A member declared
|
|
11
|
+
* before the machinery behind it is a value a caller can send that quietly goes nowhere — worse
|
|
12
|
+
* than a 422 saying the channel is unknown, because it looks like it worked.
|
|
13
|
+
*/
|
|
14
|
+
export var NotificationChannel;
|
|
15
|
+
(function (NotificationChannel) {
|
|
16
|
+
/** A message to a mailbox. Needs `recipient.emailAddress`. */
|
|
17
|
+
NotificationChannel["EMAIL"] = "email";
|
|
18
|
+
/**
|
|
19
|
+
* A row in the recipient's own in-app inbox. Needs `recipient.userId`.
|
|
20
|
+
*
|
|
21
|
+
* The only channel whose delivery is a local write, which is why it is the one channel that
|
|
22
|
+
* cannot fail for a reason outside our control. It still goes through the same queue as
|
|
23
|
+
* email: a notification that fans out to both must not have one half committed inline and the
|
|
24
|
+
* other half queued, or a rollback leaves the two halves disagreeing about what happened.
|
|
25
|
+
*/
|
|
26
|
+
NotificationChannel["IN_APP"] = "in-app";
|
|
27
|
+
})(NotificationChannel || (NotificationChannel = {}));
|
|
28
|
+
//# sourceMappingURL=notification-channel.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-channel.enum.js","sourceRoot":"","sources":["../../../../src/api/notification/notification-channel.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAN,IAAY,mBAaX;AAbD,WAAY,mBAAmB;IAC3B,8DAA8D;IAC9D,sCAAe,CAAA;IAEf;;;;;;;OAOG;IACH,wCAAiB,CAAA;AACrB,CAAC,EAbW,mBAAmB,KAAnB,mBAAmB,QAa9B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How far one channel's attempt at a notification got.
|
|
3
|
+
*
|
|
4
|
+
* The state lives on the **delivery**, never on the notification. A notification that fans out to
|
|
5
|
+
* email and the in-app inbox has two independent fates, and a single rolled-up status would have
|
|
6
|
+
* to pick one of them to report — which means either hiding a dead letter behind a success or
|
|
7
|
+
* marking a wholly delivered notification as failed because one channel bounced.
|
|
8
|
+
*
|
|
9
|
+
* These mirror `conduit-api`'s outbound states deliberately but are a **separate enum**, for the
|
|
10
|
+
* same reason Conduit keeps its inbound and outbound statuses apart: the words coincide and the
|
|
11
|
+
* stories do not. A dead-lettered dispatch means a customer's message never reached a provider; a
|
|
12
|
+
* dead-lettered notification means a person was never told something we decided to tell them.
|
|
13
|
+
*/
|
|
14
|
+
export declare enum NotificationDeliveryStatus {
|
|
15
|
+
/** Waiting for its next attempt, due at `nextAttemptAt`. */
|
|
16
|
+
PENDING = "pending",
|
|
17
|
+
/**
|
|
18
|
+
* Claimed by a worker and in progress.
|
|
19
|
+
*
|
|
20
|
+
* A row stranded here past the claim timeout is reclaimed by the same query that claims fresh
|
|
21
|
+
* work, which is where at-least-once becomes visible and why every channel adapter has to
|
|
22
|
+
* tolerate being asked twice.
|
|
23
|
+
*/
|
|
24
|
+
IN_FLIGHT = "in-flight",
|
|
25
|
+
/**
|
|
26
|
+
* The channel accepted it. Terminal, and the strongest thing we can honestly say.
|
|
27
|
+
*
|
|
28
|
+
* **There is no `DELIVERED`**, and its absence is a decision rather than an omission. An SMTP
|
|
29
|
+
* relay accepting a message is not evidence a person received it — the bounce arrives minutes
|
|
30
|
+
* later, out of band, and nothing here is listening for one yet. A `DELIVERED` state we cannot
|
|
31
|
+
* observe would be a field every UI renders as a green tick and no code ever sets.
|
|
32
|
+
*/
|
|
33
|
+
SENT = "sent",
|
|
34
|
+
/**
|
|
35
|
+
* The attempt budget is spent, or the channel refused in a way no retry can fix. Terminal.
|
|
36
|
+
*
|
|
37
|
+
* Reached from a permanent refusal on the very first attempt — an address the relay rejects
|
|
38
|
+
* outright, a template that names a message key nobody has published — because four more
|
|
39
|
+
* identical failures buy nothing and delay the moment somebody can act.
|
|
40
|
+
*/
|
|
41
|
+
DEAD_LETTERED = "dead-lettered",
|
|
42
|
+
/** An operator stopped it before it went out. Terminal, and not a failure. */
|
|
43
|
+
CANCELLED = "cancelled"
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=notification-delivery-status.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-delivery-status.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/notification/notification-delivery-status.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,oBAAY,0BAA0B;IAClC,4DAA4D;IAC5D,OAAO,YAAY;IAEnB;;;;;;OAMG;IACH,SAAS,cAAc;IAEvB;;;;;;;OAOG;IACH,IAAI,SAAS;IAEb;;;;;;OAMG;IACH,aAAa,kBAAkB;IAE/B,8EAA8E;IAC9E,SAAS,cAAc;CAC1B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How far one channel's attempt at a notification got.
|
|
3
|
+
*
|
|
4
|
+
* The state lives on the **delivery**, never on the notification. A notification that fans out to
|
|
5
|
+
* email and the in-app inbox has two independent fates, and a single rolled-up status would have
|
|
6
|
+
* to pick one of them to report — which means either hiding a dead letter behind a success or
|
|
7
|
+
* marking a wholly delivered notification as failed because one channel bounced.
|
|
8
|
+
*
|
|
9
|
+
* These mirror `conduit-api`'s outbound states deliberately but are a **separate enum**, for the
|
|
10
|
+
* same reason Conduit keeps its inbound and outbound statuses apart: the words coincide and the
|
|
11
|
+
* stories do not. A dead-lettered dispatch means a customer's message never reached a provider; a
|
|
12
|
+
* dead-lettered notification means a person was never told something we decided to tell them.
|
|
13
|
+
*/
|
|
14
|
+
export var NotificationDeliveryStatus;
|
|
15
|
+
(function (NotificationDeliveryStatus) {
|
|
16
|
+
/** Waiting for its next attempt, due at `nextAttemptAt`. */
|
|
17
|
+
NotificationDeliveryStatus["PENDING"] = "pending";
|
|
18
|
+
/**
|
|
19
|
+
* Claimed by a worker and in progress.
|
|
20
|
+
*
|
|
21
|
+
* A row stranded here past the claim timeout is reclaimed by the same query that claims fresh
|
|
22
|
+
* work, which is where at-least-once becomes visible and why every channel adapter has to
|
|
23
|
+
* tolerate being asked twice.
|
|
24
|
+
*/
|
|
25
|
+
NotificationDeliveryStatus["IN_FLIGHT"] = "in-flight";
|
|
26
|
+
/**
|
|
27
|
+
* The channel accepted it. Terminal, and the strongest thing we can honestly say.
|
|
28
|
+
*
|
|
29
|
+
* **There is no `DELIVERED`**, and its absence is a decision rather than an omission. An SMTP
|
|
30
|
+
* relay accepting a message is not evidence a person received it — the bounce arrives minutes
|
|
31
|
+
* later, out of band, and nothing here is listening for one yet. A `DELIVERED` state we cannot
|
|
32
|
+
* observe would be a field every UI renders as a green tick and no code ever sets.
|
|
33
|
+
*/
|
|
34
|
+
NotificationDeliveryStatus["SENT"] = "sent";
|
|
35
|
+
/**
|
|
36
|
+
* The attempt budget is spent, or the channel refused in a way no retry can fix. Terminal.
|
|
37
|
+
*
|
|
38
|
+
* Reached from a permanent refusal on the very first attempt — an address the relay rejects
|
|
39
|
+
* outright, a template that names a message key nobody has published — because four more
|
|
40
|
+
* identical failures buy nothing and delay the moment somebody can act.
|
|
41
|
+
*/
|
|
42
|
+
NotificationDeliveryStatus["DEAD_LETTERED"] = "dead-lettered";
|
|
43
|
+
/** An operator stopped it before it went out. Terminal, and not a failure. */
|
|
44
|
+
NotificationDeliveryStatus["CANCELLED"] = "cancelled";
|
|
45
|
+
})(NotificationDeliveryStatus || (NotificationDeliveryStatus = {}));
|
|
46
|
+
//# sourceMappingURL=notification-delivery-status.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-delivery-status.enum.js","sourceRoot":"","sources":["../../../../src/api/notification/notification-delivery-status.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAN,IAAY,0BAkCX;AAlCD,WAAY,0BAA0B;IAClC,4DAA4D;IAC5D,iDAAmB,CAAA;IAEnB;;;;;;OAMG;IACH,qDAAuB,CAAA;IAEvB;;;;;;;OAOG;IACH,2CAAa,CAAA;IAEb;;;;;;OAMG;IACH,6DAA+B,CAAA;IAE/B,8EAA8E;IAC9E,qDAAuB,CAAA;AAC3B,CAAC,EAlCW,0BAA0B,KAA1B,0BAA0B,QAkCrC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { NotificationChannel } from './notification-channel.enum.js';
|
|
5
|
+
/**
|
|
6
|
+
* What a notification *type* means: which channels it reaches and which strings it renders.
|
|
7
|
+
*
|
|
8
|
+
* A template holds **no text**. It names message keys in `iveri-localization-api`, which resolves
|
|
9
|
+
* them into the recipient's own language at send time. Storing the wording here instead would
|
|
10
|
+
* give the platform two places to author user-facing copy, and the second one would be the one
|
|
11
|
+
* without ICU validation, without a review gate and without Russian — see §13.1 of the workspace
|
|
12
|
+
* guide, which draws that line for exactly this case.
|
|
13
|
+
*
|
|
14
|
+
* **Built-in templates ship in code and a tenant row overrides one by key**, the same arrangement
|
|
15
|
+
* `conduit-api` uses for provider and connector manifests. `user.invitation` has to exist before
|
|
16
|
+
* any tenant has configured anything, and a platform whose password-reset email depends on a seed
|
|
17
|
+
* row is a platform where one missing row means nobody can get back into their account.
|
|
18
|
+
*/
|
|
19
|
+
export interface NotificationTemplate {
|
|
20
|
+
/**
|
|
21
|
+
* The stable type key a caller submits — `user.invitation`, `user.password-reset`.
|
|
22
|
+
*
|
|
23
|
+
* Dotted `<aggregate>.<event>`, lowercase. It is what a caller writes down, so it never
|
|
24
|
+
* changes once shipped; a rename is a new key and a deprecation of the old one.
|
|
25
|
+
*/
|
|
26
|
+
key: string;
|
|
27
|
+
/** Null for a built-in. A tenant override is a real row and carries an id. */
|
|
28
|
+
id: Nullable<UUID>;
|
|
29
|
+
/**
|
|
30
|
+
* Which channels this type fans out to. One delivery row is written per channel.
|
|
31
|
+
*
|
|
32
|
+
* An empty list is refused on write rather than stored: a template that reaches nobody is a
|
|
33
|
+
* notification that silently disappears, and the submit would still answer 202.
|
|
34
|
+
*/
|
|
35
|
+
channels: NotificationChannel[];
|
|
36
|
+
/** The localization namespace holding this template's strings. */
|
|
37
|
+
namespaceKey: string;
|
|
38
|
+
/** Message key for the subject line. Null for channels that have no subject. */
|
|
39
|
+
subjectMessageKey: Nullable<string>;
|
|
40
|
+
/** Message key for the body. Always present — a notification with no body says nothing. */
|
|
41
|
+
bodyMessageKey: string;
|
|
42
|
+
/**
|
|
43
|
+
* Placeholder names the body and subject need supplied at submit time.
|
|
44
|
+
*
|
|
45
|
+
* Checked when a notification is submitted, not when it is sent. A missing variable fails
|
|
46
|
+
* identically on every attempt, so discovering it five backoffs later tells the caller nothing
|
|
47
|
+
* they can still act on — the same rule Conduit applies to an unfillable path template.
|
|
48
|
+
*/
|
|
49
|
+
requiredVariables: string[];
|
|
50
|
+
/**
|
|
51
|
+
* False for a tenant's own row, true for one of the platform's.
|
|
52
|
+
*
|
|
53
|
+
* Surfaced so a panel can say "you are overriding a built-in" rather than presenting a
|
|
54
|
+
* customised password-reset email as if the platform had no opinion about it.
|
|
55
|
+
*/
|
|
56
|
+
isBuiltIn: boolean;
|
|
57
|
+
createdAt: Nullable<IsoDateTime>;
|
|
58
|
+
updatedAt: Nullable<IsoDateTime>;
|
|
59
|
+
}
|
|
60
|
+
/** `PUT /api/v1/templates/{key}` — create or replace a tenant's override of a template. */
|
|
61
|
+
export interface UpsertNotificationTemplateBody {
|
|
62
|
+
channels: NotificationChannel[];
|
|
63
|
+
namespaceKey: string;
|
|
64
|
+
subjectMessageKey?: Nullable<string>;
|
|
65
|
+
bodyMessageKey: string;
|
|
66
|
+
requiredVariables?: Nullable<string[]>;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=notification-template.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-template.type.d.ts","sourceRoot":"","sources":["../../../../src/api/notification/notification-template.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,oBAAoB;IACjC;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ,8EAA8E;IAC9E,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEnB;;;;;OAKG;IACH,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAEhC,kEAAkE;IAClE,YAAY,EAAE,MAAM,CAAC;IAErB,gFAAgF;IAChF,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEpC,2FAA2F;IAC3F,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAE5B;;;;;OAKG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;CACpC;AAED,2FAA2F;AAC3F,MAAM,WAAW,8BAA8B;IAC3C,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;CAC1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-template.type.js","sourceRoot":"","sources":["../../../../src/api/notification/notification-template.type.ts"],"names":[],"mappings":""}
|