@xemahq/contracts 0.13.0 → 0.15.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": "861703754d892c9996fa09192ef026a401df99858ba5c8fddfb835dd776e7571",
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,uB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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,CAAA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,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,471 @@
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 NotificationLifecycleTriggerSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
6
+ eventType: z.ZodString;
7
+ when: z.ZodObject<{
8
+ path: z.ZodString;
9
+ equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
10
+ }, z.core.$strict>;
11
+ }, z.core.$strict>]>;
12
+ export type NotificationLifecycleTrigger = z.infer<typeof NotificationLifecycleTriggerSchema>;
13
+ export declare function lifecycleTriggerEventType(trigger: NotificationLifecycleTrigger): string;
14
+ export declare const NotificationTemplateSchema: z.ZodObject<{
15
+ template: z.ZodString;
16
+ }, z.core.$strict>;
17
+ export declare const NotificationTextSchema: z.ZodUnion<readonly [z.ZodObject<{
18
+ text: z.ZodString;
19
+ }, z.core.$strict>, z.ZodObject<{
20
+ template: z.ZodString;
21
+ }, z.core.$strict>]>;
22
+ export declare const NotificationSubjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
23
+ kind: z.ZodLiteral<"resource">;
24
+ resourceKind: z.ZodString;
25
+ idPath: z.ZodString;
26
+ }, z.core.$strict>, z.ZodObject<{
27
+ kind: z.ZodLiteral<"resource-ref">;
28
+ refPath: z.ZodString;
29
+ }, z.core.$strict>, z.ZodObject<{
30
+ kind: z.ZodLiteral<"none">;
31
+ reason: z.ZodString;
32
+ }, z.core.$strict>], "kind">;
33
+ export declare const NotificationAudienceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
34
+ kind: z.ZodLiteral<"actor">;
35
+ }, z.core.$strict>, z.ZodObject<{
36
+ kind: z.ZodLiteral<"principal-path">;
37
+ path: z.ZodString;
38
+ }, z.core.$strict>, z.ZodObject<{
39
+ kind: z.ZodLiteral<"resource-role">;
40
+ role: z.ZodString;
41
+ resourcePath: z.ZodString;
42
+ }, z.core.$strict>, z.ZodObject<{
43
+ kind: z.ZodLiteral<"org-role">;
44
+ role: z.ZodString;
45
+ }, z.core.$strict>, z.ZodObject<{
46
+ kind: z.ZodLiteral<"org-members">;
47
+ }, z.core.$strict>, z.ZodObject<{
48
+ kind: z.ZodLiteral<"project-members">;
49
+ }, z.core.$strict>, z.ZodObject<{
50
+ kind: z.ZodLiteral<"external-endpoint">;
51
+ addressPath: z.ZodString;
52
+ }, z.core.$strict>], "kind">;
53
+ export declare const NotificationRecipientEligibilitySchema: z.ZodEnum<{
54
+ none: "none";
55
+ "subject-authorization": "subject-authorization";
56
+ }>;
57
+ export declare const NotificationAggregateKindSchema: z.ZodEnum<{
58
+ none: "none";
59
+ inquiry: "inquiry";
60
+ decision: "decision";
61
+ workflow_run: "workflow_run";
62
+ invitation: "invitation";
63
+ }>;
64
+ declare const NotifyingDescriptorSchema: z.ZodObject<{
65
+ notifies: z.ZodLiteral<true>;
66
+ eventType: z.ZodString;
67
+ category: z.ZodDefault<z.ZodEnum<typeof NotificationCategory>>;
68
+ domain: z.ZodOptional<z.ZodString>;
69
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
70
+ severity: z.ZodDefault<z.ZodEnum<typeof NotificationSeverity>>;
71
+ title: z.ZodUnion<readonly [z.ZodObject<{
72
+ text: z.ZodString;
73
+ }, z.core.$strict>, z.ZodObject<{
74
+ template: z.ZodString;
75
+ }, z.core.$strict>]>;
76
+ body: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
77
+ text: z.ZodString;
78
+ }, z.core.$strict>, z.ZodObject<{
79
+ template: z.ZodString;
80
+ }, z.core.$strict>]>>;
81
+ subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
82
+ kind: z.ZodLiteral<"resource">;
83
+ resourceKind: z.ZodString;
84
+ idPath: z.ZodString;
85
+ }, z.core.$strict>, z.ZodObject<{
86
+ kind: z.ZodLiteral<"resource-ref">;
87
+ refPath: z.ZodString;
88
+ }, z.core.$strict>, z.ZodObject<{
89
+ kind: z.ZodLiteral<"none">;
90
+ reason: z.ZodString;
91
+ }, z.core.$strict>], "kind">;
92
+ audience: z.ZodDiscriminatedUnion<[z.ZodObject<{
93
+ kind: z.ZodLiteral<"actor">;
94
+ }, z.core.$strict>, z.ZodObject<{
95
+ kind: z.ZodLiteral<"principal-path">;
96
+ path: z.ZodString;
97
+ }, z.core.$strict>, z.ZodObject<{
98
+ kind: z.ZodLiteral<"resource-role">;
99
+ role: z.ZodString;
100
+ resourcePath: z.ZodString;
101
+ }, z.core.$strict>, z.ZodObject<{
102
+ kind: z.ZodLiteral<"org-role">;
103
+ role: z.ZodString;
104
+ }, z.core.$strict>, z.ZodObject<{
105
+ kind: z.ZodLiteral<"org-members">;
106
+ }, z.core.$strict>, z.ZodObject<{
107
+ kind: z.ZodLiteral<"project-members">;
108
+ }, z.core.$strict>, z.ZodObject<{
109
+ kind: z.ZodLiteral<"external-endpoint">;
110
+ addressPath: z.ZodString;
111
+ }, z.core.$strict>], "kind">;
112
+ recipientEligibility: z.ZodOptional<z.ZodEnum<{
113
+ none: "none";
114
+ "subject-authorization": "subject-authorization";
115
+ }>>;
116
+ fanout: z.ZodDefault<z.ZodEnum<{
117
+ addressed: "addressed";
118
+ broadcast: "broadcast";
119
+ }>>;
120
+ publishCapability: z.ZodOptional<z.ZodString>;
121
+ aggregate: z.ZodDefault<z.ZodEnum<{
122
+ none: "none";
123
+ inquiry: "inquiry";
124
+ decision: "decision";
125
+ workflow_run: "workflow_run";
126
+ invitation: "invitation";
127
+ }>>;
128
+ aggregateIdPath: z.ZodOptional<z.ZodString>;
129
+ coalesceKey: z.ZodOptional<z.ZodObject<{
130
+ template: z.ZodString;
131
+ }, z.core.$strict>>;
132
+ action: z.ZodOptional<z.ZodObject<{
133
+ hrefTemplate: z.ZodString;
134
+ label: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
135
+ text: z.ZodString;
136
+ }, z.core.$strict>, z.ZodObject<{
137
+ template: z.ZodString;
138
+ }, z.core.$strict>]>>;
139
+ }, z.core.$strict>>;
140
+ channels: z.ZodDefault<z.ZodObject<{
141
+ eligible: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof NotificationChannel>>>;
142
+ default: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof NotificationChannel>>>;
143
+ }, z.core.$strict>>;
144
+ lifecycle: z.ZodOptional<z.ZodObject<{
145
+ resolvedBy: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
146
+ eventType: z.ZodString;
147
+ when: z.ZodObject<{
148
+ path: z.ZodString;
149
+ equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
150
+ }, z.core.$strict>;
151
+ }, z.core.$strict>]>>>;
152
+ cancelledBy: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
153
+ eventType: z.ZodString;
154
+ when: z.ZodObject<{
155
+ path: z.ZodString;
156
+ equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
157
+ }, z.core.$strict>;
158
+ }, z.core.$strict>]>>>;
159
+ reopenedBy: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
160
+ eventType: z.ZodString;
161
+ when: z.ZodObject<{
162
+ path: z.ZodString;
163
+ equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
164
+ }, z.core.$strict>;
165
+ }, z.core.$strict>]>>>;
166
+ }, z.core.$strict>>;
167
+ }, z.core.$strict>;
168
+ export declare const NotificationDescriptorManifestSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
169
+ notifies: z.ZodLiteral<true>;
170
+ eventType: z.ZodString;
171
+ category: z.ZodDefault<z.ZodEnum<typeof NotificationCategory>>;
172
+ domain: z.ZodOptional<z.ZodString>;
173
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
174
+ severity: z.ZodDefault<z.ZodEnum<typeof NotificationSeverity>>;
175
+ title: z.ZodUnion<readonly [z.ZodObject<{
176
+ text: z.ZodString;
177
+ }, z.core.$strict>, z.ZodObject<{
178
+ template: z.ZodString;
179
+ }, z.core.$strict>]>;
180
+ body: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
181
+ text: z.ZodString;
182
+ }, z.core.$strict>, z.ZodObject<{
183
+ template: z.ZodString;
184
+ }, z.core.$strict>]>>;
185
+ subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
186
+ kind: z.ZodLiteral<"resource">;
187
+ resourceKind: z.ZodString;
188
+ idPath: z.ZodString;
189
+ }, z.core.$strict>, z.ZodObject<{
190
+ kind: z.ZodLiteral<"resource-ref">;
191
+ refPath: z.ZodString;
192
+ }, z.core.$strict>, z.ZodObject<{
193
+ kind: z.ZodLiteral<"none">;
194
+ reason: z.ZodString;
195
+ }, z.core.$strict>], "kind">;
196
+ audience: z.ZodDiscriminatedUnion<[z.ZodObject<{
197
+ kind: z.ZodLiteral<"actor">;
198
+ }, z.core.$strict>, z.ZodObject<{
199
+ kind: z.ZodLiteral<"principal-path">;
200
+ path: z.ZodString;
201
+ }, z.core.$strict>, z.ZodObject<{
202
+ kind: z.ZodLiteral<"resource-role">;
203
+ role: z.ZodString;
204
+ resourcePath: z.ZodString;
205
+ }, z.core.$strict>, z.ZodObject<{
206
+ kind: z.ZodLiteral<"org-role">;
207
+ role: z.ZodString;
208
+ }, z.core.$strict>, z.ZodObject<{
209
+ kind: z.ZodLiteral<"org-members">;
210
+ }, z.core.$strict>, z.ZodObject<{
211
+ kind: z.ZodLiteral<"project-members">;
212
+ }, z.core.$strict>, z.ZodObject<{
213
+ kind: z.ZodLiteral<"external-endpoint">;
214
+ addressPath: z.ZodString;
215
+ }, z.core.$strict>], "kind">;
216
+ recipientEligibility: z.ZodOptional<z.ZodEnum<{
217
+ none: "none";
218
+ "subject-authorization": "subject-authorization";
219
+ }>>;
220
+ fanout: z.ZodDefault<z.ZodEnum<{
221
+ addressed: "addressed";
222
+ broadcast: "broadcast";
223
+ }>>;
224
+ publishCapability: z.ZodOptional<z.ZodString>;
225
+ aggregate: z.ZodDefault<z.ZodEnum<{
226
+ none: "none";
227
+ inquiry: "inquiry";
228
+ decision: "decision";
229
+ workflow_run: "workflow_run";
230
+ invitation: "invitation";
231
+ }>>;
232
+ aggregateIdPath: z.ZodOptional<z.ZodString>;
233
+ coalesceKey: z.ZodOptional<z.ZodObject<{
234
+ template: z.ZodString;
235
+ }, z.core.$strict>>;
236
+ action: z.ZodOptional<z.ZodObject<{
237
+ hrefTemplate: z.ZodString;
238
+ label: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
239
+ text: z.ZodString;
240
+ }, z.core.$strict>, z.ZodObject<{
241
+ template: z.ZodString;
242
+ }, z.core.$strict>]>>;
243
+ }, z.core.$strict>>;
244
+ channels: z.ZodDefault<z.ZodObject<{
245
+ eligible: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof NotificationChannel>>>;
246
+ default: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof NotificationChannel>>>;
247
+ }, z.core.$strict>>;
248
+ lifecycle: z.ZodOptional<z.ZodObject<{
249
+ resolvedBy: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
250
+ eventType: z.ZodString;
251
+ when: z.ZodObject<{
252
+ path: z.ZodString;
253
+ equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
254
+ }, z.core.$strict>;
255
+ }, z.core.$strict>]>>>;
256
+ cancelledBy: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
257
+ eventType: z.ZodString;
258
+ when: z.ZodObject<{
259
+ path: z.ZodString;
260
+ equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
261
+ }, z.core.$strict>;
262
+ }, z.core.$strict>]>>>;
263
+ reopenedBy: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
264
+ eventType: z.ZodString;
265
+ when: z.ZodObject<{
266
+ path: z.ZodString;
267
+ equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
268
+ }, z.core.$strict>;
269
+ }, z.core.$strict>]>>>;
270
+ }, z.core.$strict>>;
271
+ }, z.core.$strict>, z.ZodObject<{
272
+ notifies: z.ZodLiteral<false>;
273
+ eventType: z.ZodString;
274
+ reason: z.ZodString;
275
+ }, z.core.$strict>], "notifies">, z.ZodTransform<{
276
+ notifies: true;
277
+ eventType: string;
278
+ category: NotificationCategory;
279
+ severity: NotificationSeverity;
280
+ title: {
281
+ template: string;
282
+ } | {
283
+ text: string;
284
+ };
285
+ subject: {
286
+ kind: "resource";
287
+ resourceKind: string;
288
+ idPath: string;
289
+ } | {
290
+ kind: "resource-ref";
291
+ refPath: string;
292
+ } | {
293
+ kind: "none";
294
+ reason: string;
295
+ };
296
+ audience: {
297
+ kind: "actor";
298
+ } | {
299
+ kind: "principal-path";
300
+ path: string;
301
+ } | {
302
+ kind: "resource-role";
303
+ role: string;
304
+ resourcePath: string;
305
+ } | {
306
+ kind: "org-role";
307
+ role: string;
308
+ } | {
309
+ kind: "org-members";
310
+ } | {
311
+ kind: "project-members";
312
+ } | {
313
+ kind: "external-endpoint";
314
+ addressPath: string;
315
+ };
316
+ fanout: "addressed" | "broadcast";
317
+ aggregate: "none" | "inquiry" | "decision" | "workflow_run" | "invitation";
318
+ channels: {
319
+ eligible: NotificationChannel[];
320
+ default: NotificationChannel[];
321
+ };
322
+ domain?: string | undefined;
323
+ tags?: string[] | undefined;
324
+ body?: {
325
+ template: string;
326
+ } | {
327
+ text: string;
328
+ } | undefined;
329
+ recipientEligibility?: "none" | "subject-authorization" | undefined;
330
+ publishCapability?: string | undefined;
331
+ aggregateIdPath?: string | undefined;
332
+ coalesceKey?: {
333
+ template: string;
334
+ } | undefined;
335
+ action?: {
336
+ hrefTemplate: string;
337
+ label?: {
338
+ template: string;
339
+ } | {
340
+ text: string;
341
+ } | undefined;
342
+ } | undefined;
343
+ lifecycle?: {
344
+ resolvedBy: (string | {
345
+ eventType: string;
346
+ when: {
347
+ path: string;
348
+ equals: string | number | boolean;
349
+ };
350
+ })[];
351
+ cancelledBy: (string | {
352
+ eventType: string;
353
+ when: {
354
+ path: string;
355
+ equals: string | number | boolean;
356
+ };
357
+ })[];
358
+ reopenedBy: (string | {
359
+ eventType: string;
360
+ when: {
361
+ path: string;
362
+ equals: string | number | boolean;
363
+ };
364
+ })[];
365
+ } | undefined;
366
+ } | {
367
+ notifies: false;
368
+ eventType: string;
369
+ reason: string;
370
+ }, {
371
+ notifies: true;
372
+ eventType: string;
373
+ category: NotificationCategory;
374
+ severity: NotificationSeverity;
375
+ title: {
376
+ template: string;
377
+ } | {
378
+ text: string;
379
+ };
380
+ subject: {
381
+ kind: "resource";
382
+ resourceKind: string;
383
+ idPath: string;
384
+ } | {
385
+ kind: "resource-ref";
386
+ refPath: string;
387
+ } | {
388
+ kind: "none";
389
+ reason: string;
390
+ };
391
+ audience: {
392
+ kind: "actor";
393
+ } | {
394
+ kind: "principal-path";
395
+ path: string;
396
+ } | {
397
+ kind: "resource-role";
398
+ role: string;
399
+ resourcePath: string;
400
+ } | {
401
+ kind: "org-role";
402
+ role: string;
403
+ } | {
404
+ kind: "org-members";
405
+ } | {
406
+ kind: "project-members";
407
+ } | {
408
+ kind: "external-endpoint";
409
+ addressPath: string;
410
+ };
411
+ fanout: "addressed" | "broadcast";
412
+ aggregate: "none" | "inquiry" | "decision" | "workflow_run" | "invitation";
413
+ channels: {
414
+ eligible: NotificationChannel[];
415
+ default: NotificationChannel[];
416
+ };
417
+ domain?: string | undefined;
418
+ tags?: string[] | undefined;
419
+ body?: {
420
+ template: string;
421
+ } | {
422
+ text: string;
423
+ } | undefined;
424
+ recipientEligibility?: "none" | "subject-authorization" | undefined;
425
+ publishCapability?: string | undefined;
426
+ aggregateIdPath?: string | undefined;
427
+ coalesceKey?: {
428
+ template: string;
429
+ } | undefined;
430
+ action?: {
431
+ hrefTemplate: string;
432
+ label?: {
433
+ template: string;
434
+ } | {
435
+ text: string;
436
+ } | undefined;
437
+ } | undefined;
438
+ lifecycle?: {
439
+ resolvedBy: (string | {
440
+ eventType: string;
441
+ when: {
442
+ path: string;
443
+ equals: string | number | boolean;
444
+ };
445
+ })[];
446
+ cancelledBy: (string | {
447
+ eventType: string;
448
+ when: {
449
+ path: string;
450
+ equals: string | number | boolean;
451
+ };
452
+ })[];
453
+ reopenedBy: (string | {
454
+ eventType: string;
455
+ when: {
456
+ path: string;
457
+ equals: string | number | boolean;
458
+ };
459
+ })[];
460
+ } | undefined;
461
+ } | {
462
+ notifies: false;
463
+ eventType: string;
464
+ reason: string;
465
+ }>>;
466
+ export type NotificationDescriptorManifest = z.infer<typeof NotificationDescriptorManifestSchema>;
467
+ export type NotifyingNotificationDescriptor = z.infer<typeof NotifyingDescriptorSchema>;
468
+ export type NotificationAudience = z.infer<typeof NotificationAudienceSchema>;
469
+ export declare function descriptorNotifies(descriptor: NotificationDescriptorManifest): descriptor is NotifyingNotificationDescriptor;
470
+ export {};
471
+ //# sourceMappingURL=notification-descriptor-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-descriptor-contribution.d.ts","sourceR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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,289 @@
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 = exports.NotificationLifecycleTriggerSchema = void 0;
4
+ exports.lifecycleTriggerEventType = lifecycleTriggerEventType;
5
+ exports.descriptorNotifies = descriptorNotifies;
6
+ const zod_1 = require("zod");
7
+ const notification_category_1 = require("./notification-category");
8
+ const notification_channel_1 = require("./notification-channel");
9
+ const notification_severity_1 = require("./notification-severity");
10
+ exports.NotificationLifecycleTriggerSchema = zod_1.z.union([
11
+ zod_1.z.string().min(1).max(200),
12
+ zod_1.z
13
+ .object({
14
+ eventType: zod_1.z.string().min(1).max(200),
15
+ when: zod_1.z
16
+ .object({
17
+ path: zod_1.z.string().min(1).max(200),
18
+ equals: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean()]),
19
+ })
20
+ .strict(),
21
+ })
22
+ .strict(),
23
+ ]);
24
+ function lifecycleTriggerEventType(trigger) {
25
+ return typeof trigger === 'string' ? trigger : trigger.eventType;
26
+ }
27
+ exports.NotificationTemplateSchema = zod_1.z
28
+ .object({
29
+ template: zod_1.z.string().min(1).max(512),
30
+ })
31
+ .strict();
32
+ exports.NotificationTextSchema = zod_1.z.union([
33
+ zod_1.z.object({ text: zod_1.z.string().min(1).max(512) }).strict(),
34
+ exports.NotificationTemplateSchema,
35
+ ]);
36
+ exports.NotificationSubjectSchema = zod_1.z.discriminatedUnion('kind', [
37
+ zod_1.z
38
+ .object({
39
+ kind: zod_1.z.literal('resource'),
40
+ resourceKind: zod_1.z.string().min(1).max(200),
41
+ idPath: zod_1.z.string().min(1).max(200),
42
+ })
43
+ .strict(),
44
+ zod_1.z
45
+ .object({
46
+ kind: zod_1.z.literal('resource-ref'),
47
+ refPath: zod_1.z.string().min(1).max(200),
48
+ })
49
+ .strict(),
50
+ zod_1.z
51
+ .object({
52
+ kind: zod_1.z.literal('none'),
53
+ reason: zod_1.z.string().min(12).max(500),
54
+ })
55
+ .strict(),
56
+ ]);
57
+ exports.NotificationAudienceSchema = zod_1.z.discriminatedUnion('kind', [
58
+ zod_1.z.object({ kind: zod_1.z.literal('actor') }).strict(),
59
+ zod_1.z
60
+ .object({
61
+ kind: zod_1.z.literal('principal-path'),
62
+ path: zod_1.z.string().min(1).max(200),
63
+ })
64
+ .strict(),
65
+ zod_1.z
66
+ .object({
67
+ kind: zod_1.z.literal('resource-role'),
68
+ role: zod_1.z.string().min(1).max(200),
69
+ resourcePath: zod_1.z.string().min(1).max(200),
70
+ })
71
+ .strict(),
72
+ zod_1.z
73
+ .object({
74
+ kind: zod_1.z.literal('org-role'),
75
+ role: zod_1.z.string().min(1).max(200),
76
+ })
77
+ .strict(),
78
+ zod_1.z.object({ kind: zod_1.z.literal('org-members') }).strict(),
79
+ zod_1.z.object({ kind: zod_1.z.literal('project-members') }).strict(),
80
+ zod_1.z
81
+ .object({
82
+ kind: zod_1.z.literal('external-endpoint'),
83
+ addressPath: zod_1.z.string().min(1).max(200),
84
+ })
85
+ .strict(),
86
+ ]);
87
+ exports.NotificationRecipientEligibilitySchema = zod_1.z.enum([
88
+ 'subject-authorization',
89
+ 'none',
90
+ ]);
91
+ exports.NotificationAggregateKindSchema = zod_1.z.enum([
92
+ 'decision',
93
+ 'inquiry',
94
+ 'workflow_run',
95
+ 'invitation',
96
+ 'none',
97
+ ]);
98
+ const NotifyingDescriptorSchema = zod_1.z
99
+ .object({
100
+ notifies: zod_1.z.literal(true),
101
+ eventType: zod_1.z.string().min(1).max(200),
102
+ category: notification_category_1.NotificationCategorySchema.default(notification_category_1.NotificationCategory.NOTIFICATION),
103
+ domain: zod_1.z.string().min(1).max(200).optional(),
104
+ tags: zod_1.z
105
+ .array(zod_1.z
106
+ .string()
107
+ .min(3)
108
+ .max(120)
109
+ .regex(/^[a-z0-9][a-z0-9-]*:[a-z0-9][a-z0-9-]*$/, 'a tag is `<namespace>:<key>`, lower-case'))
110
+ .max(16)
111
+ .optional(),
112
+ severity: notification_severity_1.NotificationSeveritySchema.default(notification_severity_1.NotificationSeverity.INFO),
113
+ title: exports.NotificationTextSchema,
114
+ body: exports.NotificationTextSchema.optional(),
115
+ subject: exports.NotificationSubjectSchema,
116
+ audience: exports.NotificationAudienceSchema,
117
+ recipientEligibility: exports.NotificationRecipientEligibilitySchema.optional(),
118
+ fanout: zod_1.z.enum(['addressed', 'broadcast']).default('addressed'),
119
+ publishCapability: zod_1.z.string().min(1).max(200).optional(),
120
+ aggregate: exports.NotificationAggregateKindSchema.default('none'),
121
+ aggregateIdPath: zod_1.z.string().min(1).max(200).optional(),
122
+ coalesceKey: exports.NotificationTemplateSchema.optional(),
123
+ action: zod_1.z
124
+ .object({
125
+ hrefTemplate: zod_1.z.string().min(1).max(512),
126
+ label: exports.NotificationTextSchema.optional(),
127
+ })
128
+ .strict()
129
+ .optional(),
130
+ channels: zod_1.z
131
+ .object({
132
+ eligible: zod_1.z
133
+ .array(notification_channel_1.NotificationChannelSchema)
134
+ .nonempty()
135
+ .default([notification_channel_1.NotificationChannel.WEB]),
136
+ default: zod_1.z
137
+ .array(notification_channel_1.NotificationChannelSchema)
138
+ .nonempty()
139
+ .default([notification_channel_1.NotificationChannel.WEB]),
140
+ })
141
+ .strict()
142
+ .default({
143
+ eligible: [notification_channel_1.NotificationChannel.WEB],
144
+ default: [notification_channel_1.NotificationChannel.WEB],
145
+ }),
146
+ lifecycle: zod_1.z
147
+ .object({
148
+ resolvedBy: zod_1.z.array(exports.NotificationLifecycleTriggerSchema).default([]),
149
+ cancelledBy: zod_1.z.array(exports.NotificationLifecycleTriggerSchema).default([]),
150
+ reopenedBy: zod_1.z.array(exports.NotificationLifecycleTriggerSchema).default([]),
151
+ })
152
+ .strict()
153
+ .optional(),
154
+ })
155
+ .strict()
156
+ .superRefine((descriptor, ctx) => {
157
+ if (descriptor.aggregate !== 'none' &&
158
+ descriptor.aggregateIdPath === undefined) {
159
+ ctx.addIssue({
160
+ code: zod_1.z.ZodIssueCode.custom,
161
+ path: ['aggregateIdPath'],
162
+ message: `aggregate "${descriptor.aggregate}" declares no aggregateIdPath. ` +
163
+ 'An aggregate kind without an id names a TYPE of record and no ' +
164
+ 'record, so nothing can resolve the live state or close the row.',
165
+ });
166
+ }
167
+ const effectiveEligibility = descriptor.recipientEligibility ??
168
+ (descriptor.subject.kind === 'none' ? 'none' : 'subject-authorization');
169
+ if (descriptor.audience.kind === 'principal-path' &&
170
+ effectiveEligibility === 'none') {
171
+ ctx.addIssue({
172
+ code: zod_1.z.ZodIssueCode.custom,
173
+ path: ['recipientEligibility'],
174
+ message: 'audience "principal-path" cannot declare recipientEligibility ' +
175
+ '"none". Naming principals from the payload is safe only because ' +
176
+ 'each one is filtered against the subject; without that filter a ' +
177
+ 'producer that controls the payload can address anyone.',
178
+ });
179
+ }
180
+ if (descriptor.recipientEligibility === 'subject-authorization' &&
181
+ descriptor.subject.kind === 'none') {
182
+ ctx.addIssue({
183
+ code: zod_1.z.ZodIssueCode.custom,
184
+ path: ['recipientEligibility'],
185
+ message: 'recipientEligibility "subject-authorization" requires a resource ' +
186
+ 'subject. A subjectless notification has nothing to authorize ' +
187
+ 'against, so the check would silently pass for everyone.',
188
+ });
189
+ }
190
+ if (descriptor.audience.kind === 'external-endpoint' &&
191
+ effectiveEligibility !== 'none') {
192
+ ctx.addIssue({
193
+ code: zod_1.z.ZodIssueCode.custom,
194
+ path: ['recipientEligibility'],
195
+ message: 'audience "external-endpoint" must declare recipientEligibility ' +
196
+ '"none": it addresses somebody who has no principal yet, so there ' +
197
+ 'is no entitlement to evaluate.',
198
+ });
199
+ }
200
+ const isBroad = descriptor.audience.kind === 'org-members' ||
201
+ descriptor.audience.kind === 'project-members';
202
+ if (isBroad && descriptor.fanout !== 'broadcast') {
203
+ ctx.addIssue({
204
+ code: zod_1.z.ZodIssueCode.custom,
205
+ path: ['fanout'],
206
+ message: `audience "${descriptor.audience.kind}" writes one row per member ` +
207
+ 'and must declare fanout "broadcast". The declaration is what makes ' +
208
+ 'the scale visible in review and rate-limitable at runtime.',
209
+ });
210
+ }
211
+ if (!isBroad && descriptor.fanout === 'broadcast') {
212
+ ctx.addIssue({
213
+ code: zod_1.z.ZodIssueCode.custom,
214
+ path: ['fanout'],
215
+ message: 'fanout "broadcast" declared on an addressed audience. A label that ' +
216
+ 'does not describe the shape it sits on teaches the next reader to ' +
217
+ 'ignore it.',
218
+ });
219
+ }
220
+ const eligible = new Set(descriptor.channels.eligible);
221
+ const outside = descriptor.channels.default.filter((c) => !eligible.has(c));
222
+ if (outside.length > 0) {
223
+ ctx.addIssue({
224
+ code: zod_1.z.ZodIssueCode.custom,
225
+ path: ['channels', 'default'],
226
+ message: `default channel(s) ${outside.join(', ')} are not in eligible. ` +
227
+ 'A default outside the ceiling is a declaration that can never be ' +
228
+ 'honoured, and it would read as an enabled channel that silently ' +
229
+ 'never sends.',
230
+ });
231
+ }
232
+ if (descriptor.lifecycle !== undefined) {
233
+ const arms = [
234
+ ['resolvedBy', descriptor.lifecycle.resolvedBy],
235
+ ['cancelledBy', descriptor.lifecycle.cancelledBy],
236
+ ['reopenedBy', descriptor.lifecycle.reopenedBy],
237
+ ];
238
+ for (const [i, [leftName, left]] of arms.entries()) {
239
+ for (const [rightName, right] of arms.slice(i + 1)) {
240
+ for (const leftTrigger of left) {
241
+ const type = lifecycleTriggerEventType(leftTrigger);
242
+ for (const rightTrigger of right) {
243
+ if (lifecycleTriggerEventType(rightTrigger) !== type) {
244
+ continue;
245
+ }
246
+ if (typeof leftTrigger === 'string' ||
247
+ typeof rightTrigger === 'string') {
248
+ ctx.addIssue({
249
+ code: zod_1.z.ZodIssueCode.custom,
250
+ path: ['lifecycle', rightName],
251
+ message: `"${type}" is declared in both ${leftName} and ` +
252
+ `${rightName}, at least once with no condition. An ` +
253
+ 'unconditional trigger fires every time, so one event ' +
254
+ 'would both close and reopen a row — and nothing ranks ' +
255
+ 'the arms, so a consumer would resolve it by iteration ' +
256
+ 'order rather than by what the producer meant. Give each ' +
257
+ 'occurrence a `when` that tells them apart.',
258
+ });
259
+ }
260
+ }
261
+ }
262
+ }
263
+ }
264
+ }
265
+ });
266
+ const NonNotifyingDescriptorSchema = zod_1.z
267
+ .object({
268
+ notifies: zod_1.z.literal(false),
269
+ eventType: zod_1.z.string().min(1).max(200),
270
+ reason: zod_1.z.string().min(12).max(500),
271
+ })
272
+ .strict();
273
+ exports.NotificationDescriptorManifestSchema = zod_1.z
274
+ .discriminatedUnion('notifies', [
275
+ NotifyingDescriptorSchema,
276
+ NonNotifyingDescriptorSchema,
277
+ ])
278
+ .transform((descriptor) => descriptor.notifies && descriptor.recipientEligibility === undefined
279
+ ? {
280
+ ...descriptor,
281
+ recipientEligibility: descriptor.subject.kind === 'none'
282
+ ? 'none'
283
+ : 'subject-authorization',
284
+ }
285
+ : descriptor);
286
+ function descriptorNotifies(descriptor) {
287
+ return descriptor.notifies;
288
+ }
289
+ //# 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":";;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",
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.15.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)",