@xemahq/contracts 0.13.0 → 0.14.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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "algorithm": "sha256/len-framed-v1",
3
- "hash": "092ce22b6df9cfb6377f5042d26ec0991e4730ffdc2c657c281f5178c9be0d6d",
4
- "fileCount": 519
3
+ "hash": "f7d4978b36b80f792698394622697e2502c66b2ddd737cb6df663f261c4b1d11",
4
+ "fileCount": 522
5
5
  }
@@ -37,6 +37,7 @@ export declare enum ContributionKind {
37
37
  CanonicalObjectType = "canonical-object-type",
38
38
  ResourceRole = "resource-role",
39
39
  IngestionSource = "ingestion-source",
40
+ NotificationDescriptor = "notification-descriptor",
40
41
  ContributionKindDescriptor = "contribution-kind"
41
42
  }
42
43
  export declare const ContributionKindSchema: z.ZodEnum<typeof ContributionKind>;
@@ -1 +1 @@
1
- {"version":3,"file":"contribution-kind.d.ts","sourceRoot":"","sources":["../../../src/contribution/lib/contribution-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqFxB,oBAAY,gBAAgB;IAW1B,YAAY,kBAAkB;IAC9B,UAAU,gBAAgB;IAC1B,WAAW,iBAAiB;IAuC5B,SAAS,eAAe;IAmBxB,YAAY,kBAAkB;IAC9B,UAAU,gBAAgB;IA2B1B,WAAW,iBAAiB;IAQ5B,YAAY,kBAAkB;IAE9B,YAAY,kBAAkB;IAE9B,gBAAgB,uBAAuB;IAEvC,QAAQ,aAAa;IAErB,YAAY,kBAAkB;IAM9B,WAAW,iBAAiB;IAW5B,cAAc,oBAAoB;IAclC,kBAAkB,yBAAyB;IAY3C,IAAI,SAAS;IAEb,UAAU,gBAAgB;IAe1B,oBAAoB,0BAA0B;IAG9C,gBAAgB,sBAAsB;IAmBtC,eAAe,qBAAqB;IAIpC,cAAc,oBAAoB;IAElC,eAAe,qBAAqB;IAEpC,iBAAiB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Ae;IAezB,iBAAiB,uBAAuB;IAwCxC,YAAY,kBAAkB;IAa9B,kBAAkB,wBAAwB;IAc1C,YAAY,kBAAkB;IAkB9B,UAAU,gBAAgB;IAoB1B,kBAAkB,wBAAwB;IAmB1C,mBAAmB,0BAA0B;IA4B7C,YAAY,kBAAkB;IAkB9B,eAAe,qBAAqB;IAsCpC,sBAAsB,4BAA4B;IAoClD,0BAA0B,sBAAsB;CACjD;AAMD,eAAO,MAAM,sBAAsB,oCAAiC,CAAC;AAErE,MAAM,MAAM,qBAAqB,GAAG,GAAG,gBAAgB,EAAE,CAAC"}
@@ -41,6 +41,7 @@ var ContributionKind;
41
41
  ContributionKind["CanonicalObjectType"] = "canonical-object-type";
42
42
  ContributionKind["ResourceRole"] = "resource-role";
43
43
  ContributionKind["IngestionSource"] = "ingestion-source";
44
+ ContributionKind["NotificationDescriptor"] = "notification-descriptor";
44
45
  ContributionKind["ContributionKindDescriptor"] = "contribution-kind";
45
46
  })(ContributionKind || (exports.ContributionKind = ContributionKind = {}));
46
47
  exports.ContributionKindSchema = zod_1.z.nativeEnum(ContributionKind);
@@ -1 +1 @@
1
- {"version":3,"file":"contribution-kind.js","sourceRoot":"","sources":["../../../src/contribution/lib/contribution-kind.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAqFxB,IAAY,gBA2hBX;AA3hBD,WAAY,gBAAgB;IAW1B,kDAA8B,CAAA;IAC9B,8CAA0B,CAAA;IAC1B,gDAA4B,CAAA;IAuC5B,4CAAwB,CAAA;IAmBxB,kDAA8B,CAAA;IAC9B,8CAA0B,CAAA;IA2B1B,gDAA4B,CAAA;IAQ5B,kDAA8B,CAAA;IAE9B,kDAA8B,CAAA;IAE9B,2DAAuC,CAAA;IAEvC,yCAAqB,CAAA;IAErB,kDAA8B,CAAA;IAM9B,gDAA4B,CAAA;IAW5B,sDAAkC,CAAA;IAclC,+DAA2C,CAAA;IAY3C,iCAAa,CAAA;IAEb,8CAA0B,CAAA;IAe1B,kEAA8C,C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A4B,CAAA;IAI5B,8CAA0B,CAAA;IA4C1B,kDAA8B,CAAA;IAuB9B,sDAAkC,CAAA;IAmClC,6CAAyB,CAAA;IAezB,4DAAwC,CAAA;IAwCxC,kDAA8B,CAAA;IAa9B,8DAA0C,CAAA;IAc1C,kDAA8B,CAAA;IAkB9B,8CAA0B,CAAA;IAoB1B,8DAA0C,CAAA;IAmB1C,iEAA6C,CAAA;IA4B7C,kDAA8B,CAAA;IAkB9B,wDAAoC,CAAA;IAsCpC,sEAAkD,CAAA;IAoClD,oEAAgD,CAAA;AAClD,CAAC,EAjkBW,gBAAgB,gCAAhB,gBAAgB,QAikB3B;AAMY,QAAA,sBAAsB,GAAG,OAAC,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC"}
@@ -1,2 +1,5 @@
1
1
  export * from './lib/notification-category';
2
+ export * from './lib/notification-channel';
3
+ export * from './lib/notification-descriptor-contribution';
4
+ export * from './lib/notification-severity';
2
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notification/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notification/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6BAA6B,CAAC"}
@@ -15,4 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./lib/notification-category"), exports);
18
+ __exportStar(require("./lib/notification-channel"), exports);
19
+ __exportStar(require("./lib/notification-descriptor-contribution"), exports);
20
+ __exportStar(require("./lib/notification-severity"), exports);
18
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notification/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notification/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,6DAA2C;AAC3C,6EAA2D;AAC3D,8DAA4C"}
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ export declare enum NotificationChannel {
3
+ WEB = "WEB",
4
+ EMAIL = "EMAIL"
5
+ }
6
+ export declare const NotificationChannelSchema: z.ZodEnum<typeof NotificationChannel>;
7
+ export type NotificationChannelValue = `${NotificationChannel}`;
8
+ export declare const ALWAYS_AVAILABLE_NOTIFICATION_CHANNEL = NotificationChannel.WEB;
9
+ //# sourceMappingURL=notification-channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-channel.d.ts","sourceRoot":"","sources":["../../../src/notification/lib/notification-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,oBAAY,mBAAmB;IAE7B,GAAG,QAAQ;IAEX,KAAK,UAAU;CAChB;AAED,eAAO,MAAM,yBAAyB,uCAAoC,CAAC;AAE3E,MAAM,MAAM,wBAAwB,GAAG,GAAG,mBAAmB,EAAE,CAAC;AAUhE,eAAO,MAAM,qCAAqC,0BAA0B,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ALWAYS_AVAILABLE_NOTIFICATION_CHANNEL = exports.NotificationChannelSchema = exports.NotificationChannel = void 0;
4
+ const zod_1 = require("zod");
5
+ var NotificationChannel;
6
+ (function (NotificationChannel) {
7
+ NotificationChannel["WEB"] = "WEB";
8
+ NotificationChannel["EMAIL"] = "EMAIL";
9
+ })(NotificationChannel || (exports.NotificationChannel = NotificationChannel = {}));
10
+ exports.NotificationChannelSchema = zod_1.z.nativeEnum(NotificationChannel);
11
+ exports.ALWAYS_AVAILABLE_NOTIFICATION_CHANNEL = NotificationChannel.WEB;
12
+ //# sourceMappingURL=notification-channel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-channel.js","sourceRoot":"","sources":["../../../src/notification/lib/notification-channel.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAwBxB,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAE7B,kCAAW,CAAA;IAEX,sCAAe,CAAA;AACjB,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AAEY,QAAA,yBAAyB,GAAG,OAAC,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;AAY9D,QAAA,qCAAqC,GAAG,mBAAmB,CAAC,GAAG,CAAC"}
@@ -0,0 +1,371 @@
1
+ import { z } from 'zod';
2
+ import { NotificationCategory } from './notification-category';
3
+ import { NotificationChannel } from './notification-channel';
4
+ import { NotificationSeverity } from './notification-severity';
5
+ export declare const NotificationTemplateSchema: z.ZodObject<{
6
+ template: z.ZodString;
7
+ }, z.core.$strict>;
8
+ export declare const NotificationTextSchema: z.ZodUnion<readonly [z.ZodObject<{
9
+ text: z.ZodString;
10
+ }, z.core.$strict>, z.ZodObject<{
11
+ template: z.ZodString;
12
+ }, z.core.$strict>]>;
13
+ export declare const NotificationSubjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
14
+ kind: z.ZodLiteral<"resource">;
15
+ resourceKind: z.ZodString;
16
+ idPath: z.ZodString;
17
+ }, z.core.$strict>, z.ZodObject<{
18
+ kind: z.ZodLiteral<"none">;
19
+ reason: z.ZodString;
20
+ }, z.core.$strict>], "kind">;
21
+ export declare const NotificationAudienceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
22
+ kind: z.ZodLiteral<"actor">;
23
+ }, z.core.$strict>, z.ZodObject<{
24
+ kind: z.ZodLiteral<"principal-path">;
25
+ path: z.ZodString;
26
+ }, z.core.$strict>, z.ZodObject<{
27
+ kind: z.ZodLiteral<"resource-role">;
28
+ role: z.ZodString;
29
+ resourcePath: z.ZodString;
30
+ }, z.core.$strict>, z.ZodObject<{
31
+ kind: z.ZodLiteral<"org-role">;
32
+ role: z.ZodString;
33
+ }, z.core.$strict>, z.ZodObject<{
34
+ kind: z.ZodLiteral<"org-members">;
35
+ }, z.core.$strict>, z.ZodObject<{
36
+ kind: z.ZodLiteral<"project-members">;
37
+ }, z.core.$strict>, z.ZodObject<{
38
+ kind: z.ZodLiteral<"external-endpoint">;
39
+ addressPath: z.ZodString;
40
+ }, z.core.$strict>], "kind">;
41
+ export declare const NotificationRecipientEligibilitySchema: z.ZodEnum<{
42
+ none: "none";
43
+ "subject-authorization": "subject-authorization";
44
+ }>;
45
+ export declare const NotificationAggregateKindSchema: z.ZodEnum<{
46
+ none: "none";
47
+ inquiry: "inquiry";
48
+ decision: "decision";
49
+ workflow_run: "workflow_run";
50
+ invitation: "invitation";
51
+ }>;
52
+ declare const NotifyingDescriptorSchema: z.ZodObject<{
53
+ notifies: z.ZodLiteral<true>;
54
+ eventType: z.ZodString;
55
+ category: z.ZodDefault<z.ZodEnum<typeof NotificationCategory>>;
56
+ domain: z.ZodOptional<z.ZodString>;
57
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
58
+ severity: z.ZodDefault<z.ZodEnum<typeof NotificationSeverity>>;
59
+ title: z.ZodUnion<readonly [z.ZodObject<{
60
+ text: z.ZodString;
61
+ }, z.core.$strict>, z.ZodObject<{
62
+ template: z.ZodString;
63
+ }, z.core.$strict>]>;
64
+ body: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
65
+ text: z.ZodString;
66
+ }, z.core.$strict>, z.ZodObject<{
67
+ template: z.ZodString;
68
+ }, z.core.$strict>]>>;
69
+ subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
70
+ kind: z.ZodLiteral<"resource">;
71
+ resourceKind: z.ZodString;
72
+ idPath: z.ZodString;
73
+ }, z.core.$strict>, z.ZodObject<{
74
+ kind: z.ZodLiteral<"none">;
75
+ reason: z.ZodString;
76
+ }, z.core.$strict>], "kind">;
77
+ audience: z.ZodDiscriminatedUnion<[z.ZodObject<{
78
+ kind: z.ZodLiteral<"actor">;
79
+ }, z.core.$strict>, z.ZodObject<{
80
+ kind: z.ZodLiteral<"principal-path">;
81
+ path: z.ZodString;
82
+ }, z.core.$strict>, z.ZodObject<{
83
+ kind: z.ZodLiteral<"resource-role">;
84
+ role: z.ZodString;
85
+ resourcePath: z.ZodString;
86
+ }, z.core.$strict>, z.ZodObject<{
87
+ kind: z.ZodLiteral<"org-role">;
88
+ role: z.ZodString;
89
+ }, z.core.$strict>, z.ZodObject<{
90
+ kind: z.ZodLiteral<"org-members">;
91
+ }, z.core.$strict>, z.ZodObject<{
92
+ kind: z.ZodLiteral<"project-members">;
93
+ }, z.core.$strict>, z.ZodObject<{
94
+ kind: z.ZodLiteral<"external-endpoint">;
95
+ addressPath: z.ZodString;
96
+ }, z.core.$strict>], "kind">;
97
+ recipientEligibility: z.ZodOptional<z.ZodEnum<{
98
+ none: "none";
99
+ "subject-authorization": "subject-authorization";
100
+ }>>;
101
+ fanout: z.ZodDefault<z.ZodEnum<{
102
+ addressed: "addressed";
103
+ broadcast: "broadcast";
104
+ }>>;
105
+ publishCapability: z.ZodOptional<z.ZodString>;
106
+ aggregate: z.ZodDefault<z.ZodEnum<{
107
+ none: "none";
108
+ inquiry: "inquiry";
109
+ decision: "decision";
110
+ workflow_run: "workflow_run";
111
+ invitation: "invitation";
112
+ }>>;
113
+ aggregateIdPath: z.ZodOptional<z.ZodString>;
114
+ coalesceKey: z.ZodOptional<z.ZodObject<{
115
+ template: z.ZodString;
116
+ }, z.core.$strict>>;
117
+ action: z.ZodOptional<z.ZodObject<{
118
+ hrefTemplate: z.ZodString;
119
+ label: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
120
+ text: z.ZodString;
121
+ }, z.core.$strict>, z.ZodObject<{
122
+ template: z.ZodString;
123
+ }, z.core.$strict>]>>;
124
+ }, z.core.$strict>>;
125
+ channels: z.ZodDefault<z.ZodObject<{
126
+ eligible: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof NotificationChannel>>>;
127
+ default: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof NotificationChannel>>>;
128
+ }, z.core.$strict>>;
129
+ lifecycle: z.ZodOptional<z.ZodObject<{
130
+ resolvedBy: z.ZodDefault<z.ZodArray<z.ZodString>>;
131
+ cancelledBy: z.ZodDefault<z.ZodArray<z.ZodString>>;
132
+ }, z.core.$strict>>;
133
+ }, z.core.$strict>;
134
+ export declare const NotificationDescriptorManifestSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
135
+ notifies: z.ZodLiteral<true>;
136
+ eventType: z.ZodString;
137
+ category: z.ZodDefault<z.ZodEnum<typeof NotificationCategory>>;
138
+ domain: z.ZodOptional<z.ZodString>;
139
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
140
+ severity: z.ZodDefault<z.ZodEnum<typeof NotificationSeverity>>;
141
+ title: z.ZodUnion<readonly [z.ZodObject<{
142
+ text: z.ZodString;
143
+ }, z.core.$strict>, z.ZodObject<{
144
+ template: z.ZodString;
145
+ }, z.core.$strict>]>;
146
+ body: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
147
+ text: z.ZodString;
148
+ }, z.core.$strict>, z.ZodObject<{
149
+ template: z.ZodString;
150
+ }, z.core.$strict>]>>;
151
+ subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
152
+ kind: z.ZodLiteral<"resource">;
153
+ resourceKind: z.ZodString;
154
+ idPath: z.ZodString;
155
+ }, z.core.$strict>, z.ZodObject<{
156
+ kind: z.ZodLiteral<"none">;
157
+ reason: z.ZodString;
158
+ }, z.core.$strict>], "kind">;
159
+ audience: z.ZodDiscriminatedUnion<[z.ZodObject<{
160
+ kind: z.ZodLiteral<"actor">;
161
+ }, z.core.$strict>, z.ZodObject<{
162
+ kind: z.ZodLiteral<"principal-path">;
163
+ path: z.ZodString;
164
+ }, z.core.$strict>, z.ZodObject<{
165
+ kind: z.ZodLiteral<"resource-role">;
166
+ role: z.ZodString;
167
+ resourcePath: z.ZodString;
168
+ }, z.core.$strict>, z.ZodObject<{
169
+ kind: z.ZodLiteral<"org-role">;
170
+ role: z.ZodString;
171
+ }, z.core.$strict>, z.ZodObject<{
172
+ kind: z.ZodLiteral<"org-members">;
173
+ }, z.core.$strict>, z.ZodObject<{
174
+ kind: z.ZodLiteral<"project-members">;
175
+ }, z.core.$strict>, z.ZodObject<{
176
+ kind: z.ZodLiteral<"external-endpoint">;
177
+ addressPath: z.ZodString;
178
+ }, z.core.$strict>], "kind">;
179
+ recipientEligibility: z.ZodOptional<z.ZodEnum<{
180
+ none: "none";
181
+ "subject-authorization": "subject-authorization";
182
+ }>>;
183
+ fanout: z.ZodDefault<z.ZodEnum<{
184
+ addressed: "addressed";
185
+ broadcast: "broadcast";
186
+ }>>;
187
+ publishCapability: z.ZodOptional<z.ZodString>;
188
+ aggregate: z.ZodDefault<z.ZodEnum<{
189
+ none: "none";
190
+ inquiry: "inquiry";
191
+ decision: "decision";
192
+ workflow_run: "workflow_run";
193
+ invitation: "invitation";
194
+ }>>;
195
+ aggregateIdPath: z.ZodOptional<z.ZodString>;
196
+ coalesceKey: z.ZodOptional<z.ZodObject<{
197
+ template: z.ZodString;
198
+ }, z.core.$strict>>;
199
+ action: z.ZodOptional<z.ZodObject<{
200
+ hrefTemplate: z.ZodString;
201
+ label: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
202
+ text: z.ZodString;
203
+ }, z.core.$strict>, z.ZodObject<{
204
+ template: z.ZodString;
205
+ }, z.core.$strict>]>>;
206
+ }, z.core.$strict>>;
207
+ channels: z.ZodDefault<z.ZodObject<{
208
+ eligible: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof NotificationChannel>>>;
209
+ default: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof NotificationChannel>>>;
210
+ }, z.core.$strict>>;
211
+ lifecycle: z.ZodOptional<z.ZodObject<{
212
+ resolvedBy: z.ZodDefault<z.ZodArray<z.ZodString>>;
213
+ cancelledBy: z.ZodDefault<z.ZodArray<z.ZodString>>;
214
+ }, z.core.$strict>>;
215
+ }, z.core.$strict>, z.ZodObject<{
216
+ notifies: z.ZodLiteral<false>;
217
+ eventType: z.ZodString;
218
+ reason: z.ZodString;
219
+ }, z.core.$strict>], "notifies">, z.ZodTransform<{
220
+ notifies: true;
221
+ eventType: string;
222
+ category: NotificationCategory;
223
+ severity: NotificationSeverity;
224
+ title: {
225
+ template: string;
226
+ } | {
227
+ text: string;
228
+ };
229
+ subject: {
230
+ kind: "resource";
231
+ resourceKind: string;
232
+ idPath: string;
233
+ } | {
234
+ kind: "none";
235
+ reason: string;
236
+ };
237
+ audience: {
238
+ kind: "actor";
239
+ } | {
240
+ kind: "principal-path";
241
+ path: string;
242
+ } | {
243
+ kind: "resource-role";
244
+ role: string;
245
+ resourcePath: string;
246
+ } | {
247
+ kind: "org-role";
248
+ role: string;
249
+ } | {
250
+ kind: "org-members";
251
+ } | {
252
+ kind: "project-members";
253
+ } | {
254
+ kind: "external-endpoint";
255
+ addressPath: string;
256
+ };
257
+ fanout: "addressed" | "broadcast";
258
+ aggregate: "none" | "inquiry" | "decision" | "workflow_run" | "invitation";
259
+ channels: {
260
+ eligible: NotificationChannel[];
261
+ default: NotificationChannel[];
262
+ };
263
+ domain?: string | undefined;
264
+ tags?: string[] | undefined;
265
+ body?: {
266
+ template: string;
267
+ } | {
268
+ text: string;
269
+ } | undefined;
270
+ recipientEligibility?: "none" | "subject-authorization" | undefined;
271
+ publishCapability?: string | undefined;
272
+ aggregateIdPath?: string | undefined;
273
+ coalesceKey?: {
274
+ template: string;
275
+ } | undefined;
276
+ action?: {
277
+ hrefTemplate: string;
278
+ label?: {
279
+ template: string;
280
+ } | {
281
+ text: string;
282
+ } | undefined;
283
+ } | undefined;
284
+ lifecycle?: {
285
+ resolvedBy: string[];
286
+ cancelledBy: string[];
287
+ } | undefined;
288
+ } | {
289
+ notifies: false;
290
+ eventType: string;
291
+ reason: string;
292
+ }, {
293
+ notifies: true;
294
+ eventType: string;
295
+ category: NotificationCategory;
296
+ severity: NotificationSeverity;
297
+ title: {
298
+ template: string;
299
+ } | {
300
+ text: string;
301
+ };
302
+ subject: {
303
+ kind: "resource";
304
+ resourceKind: string;
305
+ idPath: string;
306
+ } | {
307
+ kind: "none";
308
+ reason: string;
309
+ };
310
+ audience: {
311
+ kind: "actor";
312
+ } | {
313
+ kind: "principal-path";
314
+ path: string;
315
+ } | {
316
+ kind: "resource-role";
317
+ role: string;
318
+ resourcePath: string;
319
+ } | {
320
+ kind: "org-role";
321
+ role: string;
322
+ } | {
323
+ kind: "org-members";
324
+ } | {
325
+ kind: "project-members";
326
+ } | {
327
+ kind: "external-endpoint";
328
+ addressPath: string;
329
+ };
330
+ fanout: "addressed" | "broadcast";
331
+ aggregate: "none" | "inquiry" | "decision" | "workflow_run" | "invitation";
332
+ channels: {
333
+ eligible: NotificationChannel[];
334
+ default: NotificationChannel[];
335
+ };
336
+ domain?: string | undefined;
337
+ tags?: string[] | undefined;
338
+ body?: {
339
+ template: string;
340
+ } | {
341
+ text: string;
342
+ } | undefined;
343
+ recipientEligibility?: "none" | "subject-authorization" | undefined;
344
+ publishCapability?: string | undefined;
345
+ aggregateIdPath?: string | undefined;
346
+ coalesceKey?: {
347
+ template: string;
348
+ } | undefined;
349
+ action?: {
350
+ hrefTemplate: string;
351
+ label?: {
352
+ template: string;
353
+ } | {
354
+ text: string;
355
+ } | undefined;
356
+ } | undefined;
357
+ lifecycle?: {
358
+ resolvedBy: string[];
359
+ cancelledBy: string[];
360
+ } | undefined;
361
+ } | {
362
+ notifies: false;
363
+ eventType: string;
364
+ reason: string;
365
+ }>>;
366
+ export type NotificationDescriptorManifest = z.infer<typeof NotificationDescriptorManifestSchema>;
367
+ export type NotifyingNotificationDescriptor = z.infer<typeof NotifyingDescriptorSchema>;
368
+ export type NotificationAudience = z.infer<typeof NotificationAudienceSchema>;
369
+ export declare function descriptorNotifies(descriptor: NotificationDescriptorManifest): descriptor is NotifyingNotificationDescriptor;
370
+ export {};
371
+ //# sourceMappingURL=notification-descriptor-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-descriptor-contribution.d.ts","sourceRoot":"","sources":["../../../src/notification/lib/notification-descriptor-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,oBAAoB,EAErB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oBAAoB,EAErB,MAAM,yBAAyB,CAAC;AAiDjC,eAAO,MAAM,0BAA0B;;kBAI5B,CAAC;AAGZ,eAAO,MAAM,sBAAsB;;;;oBAGjC,CAAC;AAiBH,eAAO,MAAM,yBAAyB;;;;;;;4BAcpC,CAAC;AA+BH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;4BA4DrC,CAAC;AAeH,eAAO,MAAM,sCAAsC;;;EAGjD,CAAC;AAWH,eAAO,MAAM,+BAA+B;;;;;;EAM1C,CAAC;AAEH,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6Q3B,CAAC;AAmBL,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkB9C,CAAC;AAEJ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,yBAAyB,CACjC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAG9E,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,8BAA8B,GACzC,UAAU,IAAI,+BAA+B,CAE/C"}
@@ -0,0 +1,231 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationDescriptorManifestSchema = exports.NotificationAggregateKindSchema = exports.NotificationRecipientEligibilitySchema = exports.NotificationAudienceSchema = exports.NotificationSubjectSchema = exports.NotificationTextSchema = exports.NotificationTemplateSchema = void 0;
4
+ exports.descriptorNotifies = descriptorNotifies;
5
+ const zod_1 = require("zod");
6
+ const notification_category_1 = require("./notification-category");
7
+ const notification_channel_1 = require("./notification-channel");
8
+ const notification_severity_1 = require("./notification-severity");
9
+ exports.NotificationTemplateSchema = zod_1.z
10
+ .object({
11
+ template: zod_1.z.string().min(1).max(512),
12
+ })
13
+ .strict();
14
+ exports.NotificationTextSchema = zod_1.z.union([
15
+ zod_1.z.object({ text: zod_1.z.string().min(1).max(512) }).strict(),
16
+ exports.NotificationTemplateSchema,
17
+ ]);
18
+ exports.NotificationSubjectSchema = zod_1.z.discriminatedUnion('kind', [
19
+ zod_1.z
20
+ .object({
21
+ kind: zod_1.z.literal('resource'),
22
+ resourceKind: zod_1.z.string().min(1).max(200),
23
+ idPath: zod_1.z.string().min(1).max(200),
24
+ })
25
+ .strict(),
26
+ zod_1.z
27
+ .object({
28
+ kind: zod_1.z.literal('none'),
29
+ reason: zod_1.z.string().min(12).max(500),
30
+ })
31
+ .strict(),
32
+ ]);
33
+ exports.NotificationAudienceSchema = zod_1.z.discriminatedUnion('kind', [
34
+ zod_1.z.object({ kind: zod_1.z.literal('actor') }).strict(),
35
+ zod_1.z
36
+ .object({
37
+ kind: zod_1.z.literal('principal-path'),
38
+ path: zod_1.z.string().min(1).max(200),
39
+ })
40
+ .strict(),
41
+ zod_1.z
42
+ .object({
43
+ kind: zod_1.z.literal('resource-role'),
44
+ role: zod_1.z.string().min(1).max(200),
45
+ resourcePath: zod_1.z.string().min(1).max(200),
46
+ })
47
+ .strict(),
48
+ zod_1.z
49
+ .object({
50
+ kind: zod_1.z.literal('org-role'),
51
+ role: zod_1.z.string().min(1).max(200),
52
+ })
53
+ .strict(),
54
+ zod_1.z.object({ kind: zod_1.z.literal('org-members') }).strict(),
55
+ zod_1.z.object({ kind: zod_1.z.literal('project-members') }).strict(),
56
+ zod_1.z
57
+ .object({
58
+ kind: zod_1.z.literal('external-endpoint'),
59
+ addressPath: zod_1.z.string().min(1).max(200),
60
+ })
61
+ .strict(),
62
+ ]);
63
+ exports.NotificationRecipientEligibilitySchema = zod_1.z.enum([
64
+ 'subject-authorization',
65
+ 'none',
66
+ ]);
67
+ exports.NotificationAggregateKindSchema = zod_1.z.enum([
68
+ 'decision',
69
+ 'inquiry',
70
+ 'workflow_run',
71
+ 'invitation',
72
+ 'none',
73
+ ]);
74
+ const NotifyingDescriptorSchema = zod_1.z
75
+ .object({
76
+ notifies: zod_1.z.literal(true),
77
+ eventType: zod_1.z.string().min(1).max(200),
78
+ category: notification_category_1.NotificationCategorySchema.default(notification_category_1.NotificationCategory.NOTIFICATION),
79
+ domain: zod_1.z.string().min(1).max(200).optional(),
80
+ tags: zod_1.z
81
+ .array(zod_1.z
82
+ .string()
83
+ .min(3)
84
+ .max(120)
85
+ .regex(/^[a-z0-9][a-z0-9-]*:[a-z0-9][a-z0-9-]*$/, 'a tag is `<namespace>:<key>`, lower-case'))
86
+ .max(16)
87
+ .optional(),
88
+ severity: notification_severity_1.NotificationSeveritySchema.default(notification_severity_1.NotificationSeverity.INFO),
89
+ title: exports.NotificationTextSchema,
90
+ body: exports.NotificationTextSchema.optional(),
91
+ subject: exports.NotificationSubjectSchema,
92
+ audience: exports.NotificationAudienceSchema,
93
+ recipientEligibility: exports.NotificationRecipientEligibilitySchema.optional(),
94
+ fanout: zod_1.z.enum(['addressed', 'broadcast']).default('addressed'),
95
+ publishCapability: zod_1.z.string().min(1).max(200).optional(),
96
+ aggregate: exports.NotificationAggregateKindSchema.default('none'),
97
+ aggregateIdPath: zod_1.z.string().min(1).max(200).optional(),
98
+ coalesceKey: exports.NotificationTemplateSchema.optional(),
99
+ action: zod_1.z
100
+ .object({
101
+ hrefTemplate: zod_1.z.string().min(1).max(512),
102
+ label: exports.NotificationTextSchema.optional(),
103
+ })
104
+ .strict()
105
+ .optional(),
106
+ channels: zod_1.z
107
+ .object({
108
+ eligible: zod_1.z
109
+ .array(notification_channel_1.NotificationChannelSchema)
110
+ .nonempty()
111
+ .default([notification_channel_1.NotificationChannel.WEB]),
112
+ default: zod_1.z
113
+ .array(notification_channel_1.NotificationChannelSchema)
114
+ .nonempty()
115
+ .default([notification_channel_1.NotificationChannel.WEB]),
116
+ })
117
+ .strict()
118
+ .default({
119
+ eligible: [notification_channel_1.NotificationChannel.WEB],
120
+ default: [notification_channel_1.NotificationChannel.WEB],
121
+ }),
122
+ lifecycle: zod_1.z
123
+ .object({
124
+ resolvedBy: zod_1.z.array(zod_1.z.string().min(1).max(200)).default([]),
125
+ cancelledBy: zod_1.z.array(zod_1.z.string().min(1).max(200)).default([]),
126
+ })
127
+ .strict()
128
+ .optional(),
129
+ })
130
+ .strict()
131
+ .superRefine((descriptor, ctx) => {
132
+ if (descriptor.aggregate !== 'none' &&
133
+ descriptor.aggregateIdPath === undefined) {
134
+ ctx.addIssue({
135
+ code: zod_1.z.ZodIssueCode.custom,
136
+ path: ['aggregateIdPath'],
137
+ message: `aggregate "${descriptor.aggregate}" declares no aggregateIdPath. ` +
138
+ 'An aggregate kind without an id names a TYPE of record and no ' +
139
+ 'record, so nothing can resolve the live state or close the row.',
140
+ });
141
+ }
142
+ const effectiveEligibility = descriptor.recipientEligibility ??
143
+ (descriptor.subject.kind === 'none' ? 'none' : 'subject-authorization');
144
+ if (descriptor.audience.kind === 'principal-path' &&
145
+ effectiveEligibility === 'none') {
146
+ ctx.addIssue({
147
+ code: zod_1.z.ZodIssueCode.custom,
148
+ path: ['recipientEligibility'],
149
+ message: 'audience "principal-path" cannot declare recipientEligibility ' +
150
+ '"none". Naming principals from the payload is safe only because ' +
151
+ 'each one is filtered against the subject; without that filter a ' +
152
+ 'producer that controls the payload can address anyone.',
153
+ });
154
+ }
155
+ if (descriptor.recipientEligibility === 'subject-authorization' &&
156
+ descriptor.subject.kind === 'none') {
157
+ ctx.addIssue({
158
+ code: zod_1.z.ZodIssueCode.custom,
159
+ path: ['recipientEligibility'],
160
+ message: 'recipientEligibility "subject-authorization" requires a resource ' +
161
+ 'subject. A subjectless notification has nothing to authorize ' +
162
+ 'against, so the check would silently pass for everyone.',
163
+ });
164
+ }
165
+ if (descriptor.audience.kind === 'external-endpoint' &&
166
+ effectiveEligibility !== 'none') {
167
+ ctx.addIssue({
168
+ code: zod_1.z.ZodIssueCode.custom,
169
+ path: ['recipientEligibility'],
170
+ message: 'audience "external-endpoint" must declare recipientEligibility ' +
171
+ '"none": it addresses somebody who has no principal yet, so there ' +
172
+ 'is no entitlement to evaluate.',
173
+ });
174
+ }
175
+ const isBroad = descriptor.audience.kind === 'org-members' ||
176
+ descriptor.audience.kind === 'project-members';
177
+ if (isBroad && descriptor.fanout !== 'broadcast') {
178
+ ctx.addIssue({
179
+ code: zod_1.z.ZodIssueCode.custom,
180
+ path: ['fanout'],
181
+ message: `audience "${descriptor.audience.kind}" writes one row per member ` +
182
+ 'and must declare fanout "broadcast". The declaration is what makes ' +
183
+ 'the scale visible in review and rate-limitable at runtime.',
184
+ });
185
+ }
186
+ if (!isBroad && descriptor.fanout === 'broadcast') {
187
+ ctx.addIssue({
188
+ code: zod_1.z.ZodIssueCode.custom,
189
+ path: ['fanout'],
190
+ message: 'fanout "broadcast" declared on an addressed audience. A label that ' +
191
+ 'does not describe the shape it sits on teaches the next reader to ' +
192
+ 'ignore it.',
193
+ });
194
+ }
195
+ const eligible = new Set(descriptor.channels.eligible);
196
+ const outside = descriptor.channels.default.filter((c) => !eligible.has(c));
197
+ if (outside.length > 0) {
198
+ ctx.addIssue({
199
+ code: zod_1.z.ZodIssueCode.custom,
200
+ path: ['channels', 'default'],
201
+ message: `default channel(s) ${outside.join(', ')} are not in eligible. ` +
202
+ 'A default outside the ceiling is a declaration that can never be ' +
203
+ 'honoured, and it would read as an enabled channel that silently ' +
204
+ 'never sends.',
205
+ });
206
+ }
207
+ });
208
+ const NonNotifyingDescriptorSchema = zod_1.z
209
+ .object({
210
+ notifies: zod_1.z.literal(false),
211
+ eventType: zod_1.z.string().min(1).max(200),
212
+ reason: zod_1.z.string().min(12).max(500),
213
+ })
214
+ .strict();
215
+ exports.NotificationDescriptorManifestSchema = zod_1.z
216
+ .discriminatedUnion('notifies', [
217
+ NotifyingDescriptorSchema,
218
+ NonNotifyingDescriptorSchema,
219
+ ])
220
+ .transform((descriptor) => descriptor.notifies && descriptor.recipientEligibility === undefined
221
+ ? {
222
+ ...descriptor,
223
+ recipientEligibility: descriptor.subject.kind === 'none'
224
+ ? 'none'
225
+ : 'subject-authorization',
226
+ }
227
+ : descriptor);
228
+ function descriptorNotifies(descriptor) {
229
+ return descriptor.notifies;
230
+ }
231
+ //# sourceMappingURL=notification-descriptor-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-descriptor-contribution.js","sourceRoot":"","sources":["../../../src/notification/lib/notification-descriptor-contribution.ts"],"names":[],"mappings":";;;AAsiBA,gDAIC;AA1iBD,6BAAwB;AAExB,mEAGiC;AACjC,iEAGgC;AAChC,mEAGiC;AAiDpB,QAAA,0BAA0B,GAAG,OAAC;KACxC,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;CACrC,CAAC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ity {
3
+ INFO = "INFO",
4
+ SUCCESS = "SUCCESS",
5
+ WARNING = "WARNING",
6
+ ACTION_REQUIRED = "ACTION_REQUIRED",
7
+ ERROR = "ERROR"
8
+ }
9
+ export declare const NotificationSeveritySchema: z.ZodEnum<typeof NotificationSeverity>;
10
+ export type NotificationSeverityValue = `${NotificationSeverity}`;
11
+ export declare const NOTIFICATION_SEVERITY_RANK: Readonly<Record<NotificationSeverity, number>>;
12
+ export declare function notificationSeverityRank(severity: NotificationSeverity): number;
13
+ //# sourceMappingURL=notification-severity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-severity.d.ts","sourceRoot":"","sources":["../../../src/notification/lib/notification-severity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,eAAe,oBAAoB;IACnC,KAAK,UAAU;CAChB;AAED,eAAO,MAAM,0BAA0B,wCAAqC,CAAC;AAE7E,MAAM,MAAM,yBAAyB,GAAG,GAAG,oBAAoB,EAAE,CAAC;AAMlE,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAC/C,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAOpC,CAAC;AAUH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,oBAAoB,GAC7B,MAAM,CAUR"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NOTIFICATION_SEVERITY_RANK = exports.NotificationSeveritySchema = exports.NotificationSeverity = void 0;
4
+ exports.notificationSeverityRank = notificationSeverityRank;
5
+ const zod_1 = require("zod");
6
+ var NotificationSeverity;
7
+ (function (NotificationSeverity) {
8
+ NotificationSeverity["INFO"] = "INFO";
9
+ NotificationSeverity["SUCCESS"] = "SUCCESS";
10
+ NotificationSeverity["WARNING"] = "WARNING";
11
+ NotificationSeverity["ACTION_REQUIRED"] = "ACTION_REQUIRED";
12
+ NotificationSeverity["ERROR"] = "ERROR";
13
+ })(NotificationSeverity || (exports.NotificationSeverity = NotificationSeverity = {}));
14
+ exports.NotificationSeveritySchema = zod_1.z.nativeEnum(NotificationSeverity);
15
+ exports.NOTIFICATION_SEVERITY_RANK = Object.freeze({
16
+ [NotificationSeverity.INFO]: 0,
17
+ [NotificationSeverity.SUCCESS]: 0,
18
+ [NotificationSeverity.WARNING]: 1,
19
+ [NotificationSeverity.ACTION_REQUIRED]: 2,
20
+ [NotificationSeverity.ERROR]: 3,
21
+ });
22
+ function notificationSeverityRank(severity) {
23
+ const rank = exports.NOTIFICATION_SEVERITY_RANK[severity];
24
+ if (rank === undefined) {
25
+ throw new Error(`notificationSeverityRank: unranked severity "${String(severity)}". ` +
26
+ 'Every member of NotificationSeverity must be ranked in ' +
27
+ 'NOTIFICATION_SEVERITY_RANK.');
28
+ }
29
+ return rank;
30
+ }
31
+ //# sourceMappingURL=notification-severity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-severity.js","sourceRoot":"","sources":["../../../src/notification/lib/notification-severity.ts"],"names":[],"mappings":";;;AA0DA,4DAYC;AAtED,6BAAwB;AAwBxB,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,2CAAmB,CAAA;IACnB,2CAAmB,CAAA;IACnB,2DAAmC,CAAA;IACnC,uCAAe,CAAA;AACjB,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAEY,QAAA,0BAA0B,GAAG,OAAC,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAQhE,QAAA,0BAA0B,GAEnC,MAAM,CAAC,MAAM,CAAC;IAChB,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC9B,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC;IACjC,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC;IACjC,CAAC,oBAAoB,CAAC,eAAe,CAAC,EAAE,CAAC;IACzC,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;CAChC,CAAC,CAAC;AAUH,SAAgB,wBAAwB,CACtC,QAA8B;IAE9B,MAAM,IAAI,GAAG,kCAA0B,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,gDAAgD,MAAM,CAAC,QAAQ,CAAC,KAAK;YACnE,yDAAyD;YACzD,6BAA6B,CAChC,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xemahq/contracts",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Consolidated Xema OS kernel wire contracts — pure types + zod schemas for the kernel protocol surfaces. One package, one npm scope, wildcard per-surface subpath exports. No framework/runtime deps.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Neuralchowder Inc. <developer@xema.dev> (https://xema.dev)",