@contractspec/module.notifications 1.57.0 → 1.58.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.
Files changed (42) hide show
  1. package/dist/browser/channels/index.js +124 -0
  2. package/dist/browser/contracts/index.js +340 -0
  3. package/dist/browser/entities/index.js +223 -0
  4. package/dist/browser/index.js +864 -0
  5. package/dist/browser/notifications.capability.js +16 -0
  6. package/dist/browser/notifications.feature.js +34 -0
  7. package/dist/browser/templates/index.js +147 -0
  8. package/dist/channels/index.d.ts +64 -67
  9. package/dist/channels/index.d.ts.map +1 -1
  10. package/dist/channels/index.js +123 -125
  11. package/dist/contracts/index.d.ts +571 -577
  12. package/dist/contracts/index.d.ts.map +1 -1
  13. package/dist/contracts/index.js +324 -416
  14. package/dist/entities/index.d.ts +145 -150
  15. package/dist/entities/index.d.ts.map +1 -1
  16. package/dist/entities/index.js +215 -245
  17. package/dist/index.d.ts +6 -6
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +864 -6
  20. package/dist/node/channels/index.js +124 -0
  21. package/dist/node/contracts/index.js +340 -0
  22. package/dist/node/entities/index.js +223 -0
  23. package/dist/node/index.js +864 -0
  24. package/dist/node/notifications.capability.js +16 -0
  25. package/dist/node/notifications.feature.js +34 -0
  26. package/dist/node/templates/index.js +147 -0
  27. package/dist/notifications.capability.d.ts +1 -6
  28. package/dist/notifications.capability.d.ts.map +1 -1
  29. package/dist/notifications.capability.js +17 -20
  30. package/dist/notifications.feature.d.ts +1 -6
  31. package/dist/notifications.feature.d.ts.map +1 -1
  32. package/dist/notifications.feature.js +33 -75
  33. package/dist/templates/index.d.ts +47 -50
  34. package/dist/templates/index.d.ts.map +1 -1
  35. package/dist/templates/index.js +127 -181
  36. package/package.json +102 -27
  37. package/dist/channels/index.js.map +0 -1
  38. package/dist/contracts/index.js.map +0 -1
  39. package/dist/entities/index.js.map +0 -1
  40. package/dist/notifications.capability.js.map +0 -1
  41. package/dist/notifications.feature.js.map +0 -1
  42. package/dist/templates/index.js.map +0 -1
@@ -1,433 +1,341 @@
1
+ // @bun
2
+ // src/contracts/index.ts
3
+ import {
4
+ defineCommand,
5
+ defineQuery,
6
+ defineSchemaModel
7
+ } from "@contractspec/lib.contracts";
1
8
  import { ScalarTypeEnum, defineEnum } from "@contractspec/lib.schema";
2
- import { defineCommand, defineQuery, defineSchemaModel } from "@contractspec/lib.contracts";
3
-
4
- //#region src/contracts/index.ts
5
- const OWNERS = ["platform.notifications"];
6
- const NotificationStatusSchemaEnum = defineEnum("NotificationStatus", [
7
- "PENDING",
8
- "SENT",
9
- "DELIVERED",
10
- "READ",
11
- "FAILED",
12
- "CANCELLED"
9
+ var OWNERS = ["platform.notifications"];
10
+ var NotificationStatusSchemaEnum = defineEnum("NotificationStatus", [
11
+ "PENDING",
12
+ "SENT",
13
+ "DELIVERED",
14
+ "READ",
15
+ "FAILED",
16
+ "CANCELLED"
13
17
  ]);
14
- const NotificationChannelSchemaEnum = defineEnum("NotificationChannel", [
15
- "EMAIL",
16
- "IN_APP",
17
- "PUSH",
18
- "WEBHOOK"
18
+ var NotificationChannelSchemaEnum = defineEnum("NotificationChannel", [
19
+ "EMAIL",
20
+ "IN_APP",
21
+ "PUSH",
22
+ "WEBHOOK"
19
23
  ]);
20
- const NotificationFilterEnum = defineEnum("NotificationFilter", [
21
- "unread",
22
- "read",
23
- "all"
24
+ var NotificationFilterEnum = defineEnum("NotificationFilter", [
25
+ "unread",
26
+ "read",
27
+ "all"
24
28
  ]);
25
- const NotificationModel = defineSchemaModel({
26
- name: "Notification",
27
- description: "A notification sent to a user",
28
- fields: {
29
- id: {
30
- type: ScalarTypeEnum.String_unsecure(),
31
- isOptional: false
32
- },
33
- userId: {
34
- type: ScalarTypeEnum.String_unsecure(),
35
- isOptional: false
36
- },
37
- title: {
38
- type: ScalarTypeEnum.String_unsecure(),
39
- isOptional: false
40
- },
41
- body: {
42
- type: ScalarTypeEnum.String_unsecure(),
43
- isOptional: false
44
- },
45
- type: {
46
- type: ScalarTypeEnum.String_unsecure(),
47
- isOptional: false
48
- },
49
- status: {
50
- type: NotificationStatusSchemaEnum,
51
- isOptional: false
52
- },
53
- channels: {
54
- type: NotificationChannelSchemaEnum,
55
- isArray: true,
56
- isOptional: false
57
- },
58
- actionUrl: {
59
- type: ScalarTypeEnum.URL(),
60
- isOptional: true
61
- },
62
- readAt: {
63
- type: ScalarTypeEnum.DateTime(),
64
- isOptional: true
65
- },
66
- createdAt: {
67
- type: ScalarTypeEnum.DateTime(),
68
- isOptional: false
69
- }
70
- }
29
+ var NotificationModel = defineSchemaModel({
30
+ name: "Notification",
31
+ description: "A notification sent to a user",
32
+ fields: {
33
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
34
+ userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
35
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
36
+ body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
37
+ type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
38
+ status: { type: NotificationStatusSchemaEnum, isOptional: false },
39
+ channels: {
40
+ type: NotificationChannelSchemaEnum,
41
+ isArray: true,
42
+ isOptional: false
43
+ },
44
+ actionUrl: { type: ScalarTypeEnum.URL(), isOptional: true },
45
+ readAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
46
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
47
+ }
71
48
  });
72
- const NotificationPreferenceModel = defineSchemaModel({
73
- name: "NotificationPreference",
74
- description: "User notification preferences",
75
- fields: {
76
- userId: {
77
- type: ScalarTypeEnum.String_unsecure(),
78
- isOptional: false
79
- },
80
- globalEnabled: {
81
- type: ScalarTypeEnum.Boolean(),
82
- isOptional: false
83
- },
84
- channelPreferences: {
85
- type: ScalarTypeEnum.JSONObject(),
86
- isOptional: false
87
- },
88
- typePreferences: {
89
- type: ScalarTypeEnum.JSONObject(),
90
- isOptional: false
91
- },
92
- quietHoursStart: {
93
- type: ScalarTypeEnum.String_unsecure(),
94
- isOptional: true
95
- },
96
- quietHoursEnd: {
97
- type: ScalarTypeEnum.String_unsecure(),
98
- isOptional: true
99
- },
100
- timezone: {
101
- type: ScalarTypeEnum.String_unsecure(),
102
- isOptional: false
103
- },
104
- digestEnabled: {
105
- type: ScalarTypeEnum.Boolean(),
106
- isOptional: false
107
- },
108
- digestFrequency: {
109
- type: ScalarTypeEnum.String_unsecure(),
110
- isOptional: true
111
- }
112
- }
49
+ var NotificationPreferenceModel = defineSchemaModel({
50
+ name: "NotificationPreference",
51
+ description: "User notification preferences",
52
+ fields: {
53
+ userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
54
+ globalEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: false },
55
+ channelPreferences: {
56
+ type: ScalarTypeEnum.JSONObject(),
57
+ isOptional: false
58
+ },
59
+ typePreferences: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
60
+ quietHoursStart: {
61
+ type: ScalarTypeEnum.String_unsecure(),
62
+ isOptional: true
63
+ },
64
+ quietHoursEnd: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
65
+ timezone: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
66
+ digestEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: false },
67
+ digestFrequency: {
68
+ type: ScalarTypeEnum.String_unsecure(),
69
+ isOptional: true
70
+ }
71
+ }
113
72
  });
114
- const SendNotificationInputModel = defineSchemaModel({
115
- name: "SendNotificationInput",
116
- description: "Input for sending a notification",
117
- fields: {
118
- userId: {
119
- type: ScalarTypeEnum.String_unsecure(),
120
- isOptional: false
121
- },
122
- templateId: {
123
- type: ScalarTypeEnum.String_unsecure(),
124
- isOptional: true
125
- },
126
- title: {
127
- type: ScalarTypeEnum.String_unsecure(),
128
- isOptional: true
129
- },
130
- body: {
131
- type: ScalarTypeEnum.String_unsecure(),
132
- isOptional: true
133
- },
134
- type: {
135
- type: ScalarTypeEnum.String_unsecure(),
136
- isOptional: false
137
- },
138
- channels: {
139
- type: NotificationChannelSchemaEnum,
140
- isArray: true,
141
- isOptional: true
142
- },
143
- actionUrl: {
144
- type: ScalarTypeEnum.URL(),
145
- isOptional: true
146
- },
147
- variables: {
148
- type: ScalarTypeEnum.JSONObject(),
149
- isOptional: true
150
- },
151
- metadata: {
152
- type: ScalarTypeEnum.JSONObject(),
153
- isOptional: true
154
- }
155
- }
73
+ var SendNotificationInputModel = defineSchemaModel({
74
+ name: "SendNotificationInput",
75
+ description: "Input for sending a notification",
76
+ fields: {
77
+ userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
78
+ templateId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
79
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
80
+ body: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
81
+ type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
82
+ channels: {
83
+ type: NotificationChannelSchemaEnum,
84
+ isArray: true,
85
+ isOptional: true
86
+ },
87
+ actionUrl: { type: ScalarTypeEnum.URL(), isOptional: true },
88
+ variables: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
89
+ metadata: { type: ScalarTypeEnum.JSONObject(), isOptional: true }
90
+ }
156
91
  });
157
- const ListNotificationsInputModel = defineSchemaModel({
158
- name: "ListNotificationsInput",
159
- description: "Input for listing notifications",
160
- fields: {
161
- status: {
162
- type: NotificationFilterEnum,
163
- isOptional: true
164
- },
165
- type: {
166
- type: ScalarTypeEnum.String_unsecure(),
167
- isOptional: true
168
- },
169
- limit: {
170
- type: ScalarTypeEnum.Int_unsecure(),
171
- isOptional: true,
172
- defaultValue: 20
173
- },
174
- offset: {
175
- type: ScalarTypeEnum.Int_unsecure(),
176
- isOptional: true,
177
- defaultValue: 0
178
- }
179
- }
92
+ var ListNotificationsInputModel = defineSchemaModel({
93
+ name: "ListNotificationsInput",
94
+ description: "Input for listing notifications",
95
+ fields: {
96
+ status: { type: NotificationFilterEnum, isOptional: true },
97
+ type: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
98
+ limit: {
99
+ type: ScalarTypeEnum.Int_unsecure(),
100
+ isOptional: true,
101
+ defaultValue: 20
102
+ },
103
+ offset: {
104
+ type: ScalarTypeEnum.Int_unsecure(),
105
+ isOptional: true,
106
+ defaultValue: 0
107
+ }
108
+ }
180
109
  });
181
- const ListNotificationsOutputModel = defineSchemaModel({
182
- name: "ListNotificationsOutput",
183
- description: "Output for listing notifications",
184
- fields: {
185
- notifications: {
186
- type: NotificationModel,
187
- isArray: true,
188
- isOptional: false
189
- },
190
- total: {
191
- type: ScalarTypeEnum.Int_unsecure(),
192
- isOptional: false
193
- },
194
- unreadCount: {
195
- type: ScalarTypeEnum.Int_unsecure(),
196
- isOptional: false
197
- }
198
- }
110
+ var ListNotificationsOutputModel = defineSchemaModel({
111
+ name: "ListNotificationsOutput",
112
+ description: "Output for listing notifications",
113
+ fields: {
114
+ notifications: {
115
+ type: NotificationModel,
116
+ isArray: true,
117
+ isOptional: false
118
+ },
119
+ total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
120
+ unreadCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
121
+ }
199
122
  });
200
- const UpdatePreferencesInputModel = defineSchemaModel({
201
- name: "UpdateNotificationPreferencesInput",
202
- description: "Input for updating notification preferences",
203
- fields: {
204
- globalEnabled: {
205
- type: ScalarTypeEnum.Boolean(),
206
- isOptional: true
207
- },
208
- channelPreferences: {
209
- type: ScalarTypeEnum.JSONObject(),
210
- isOptional: true
211
- },
212
- typePreferences: {
213
- type: ScalarTypeEnum.JSONObject(),
214
- isOptional: true
215
- },
216
- quietHoursStart: {
217
- type: ScalarTypeEnum.String_unsecure(),
218
- isOptional: true
219
- },
220
- quietHoursEnd: {
221
- type: ScalarTypeEnum.String_unsecure(),
222
- isOptional: true
223
- },
224
- timezone: {
225
- type: ScalarTypeEnum.String_unsecure(),
226
- isOptional: true
227
- },
228
- digestEnabled: {
229
- type: ScalarTypeEnum.Boolean(),
230
- isOptional: true
231
- },
232
- digestFrequency: {
233
- type: ScalarTypeEnum.String_unsecure(),
234
- isOptional: true
235
- }
236
- }
123
+ var UpdatePreferencesInputModel = defineSchemaModel({
124
+ name: "UpdateNotificationPreferencesInput",
125
+ description: "Input for updating notification preferences",
126
+ fields: {
127
+ globalEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: true },
128
+ channelPreferences: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
129
+ typePreferences: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
130
+ quietHoursStart: {
131
+ type: ScalarTypeEnum.String_unsecure(),
132
+ isOptional: true
133
+ },
134
+ quietHoursEnd: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
135
+ timezone: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
136
+ digestEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: true },
137
+ digestFrequency: {
138
+ type: ScalarTypeEnum.String_unsecure(),
139
+ isOptional: true
140
+ }
141
+ }
237
142
  });
238
- /**
239
- * Send a notification.
240
- */
241
- const SendNotificationContract = defineCommand({
242
- meta: {
243
- key: "notifications.send",
244
- version: "1.0.0",
245
- stability: "stable",
246
- owners: [...OWNERS],
247
- tags: ["notifications", "send"],
248
- description: "Send a notification to a user.",
249
- goal: "Deliver notifications across multiple channels.",
250
- context: "Called by services when events require user notification."
251
- },
252
- io: {
253
- input: SendNotificationInputModel,
254
- output: NotificationModel,
255
- errors: {
256
- USER_NOT_FOUND: {
257
- description: "Target user does not exist",
258
- http: 404,
259
- gqlCode: "USER_NOT_FOUND",
260
- when: "User ID is invalid"
261
- },
262
- TEMPLATE_NOT_FOUND: {
263
- description: "Notification template does not exist",
264
- http: 404,
265
- gqlCode: "TEMPLATE_NOT_FOUND",
266
- when: "Template ID is invalid"
267
- }
268
- }
269
- },
270
- policy: { auth: "user" },
271
- sideEffects: { emits: [{
272
- key: "notification.sent",
273
- version: "1.0.0",
274
- when: "Notification is sent",
275
- payload: NotificationModel
276
- }] }
143
+ var SendNotificationContract = defineCommand({
144
+ meta: {
145
+ key: "notifications.send",
146
+ version: "1.0.0",
147
+ stability: "stable",
148
+ owners: [...OWNERS],
149
+ tags: ["notifications", "send"],
150
+ description: "Send a notification to a user.",
151
+ goal: "Deliver notifications across multiple channels.",
152
+ context: "Called by services when events require user notification."
153
+ },
154
+ io: {
155
+ input: SendNotificationInputModel,
156
+ output: NotificationModel,
157
+ errors: {
158
+ USER_NOT_FOUND: {
159
+ description: "Target user does not exist",
160
+ http: 404,
161
+ gqlCode: "USER_NOT_FOUND",
162
+ when: "User ID is invalid"
163
+ },
164
+ TEMPLATE_NOT_FOUND: {
165
+ description: "Notification template does not exist",
166
+ http: 404,
167
+ gqlCode: "TEMPLATE_NOT_FOUND",
168
+ when: "Template ID is invalid"
169
+ }
170
+ }
171
+ },
172
+ policy: {
173
+ auth: "user"
174
+ },
175
+ sideEffects: {
176
+ emits: [
177
+ {
178
+ key: "notification.sent",
179
+ version: "1.0.0",
180
+ when: "Notification is sent",
181
+ payload: NotificationModel
182
+ }
183
+ ]
184
+ }
277
185
  });
278
- /**
279
- * List notifications for current user.
280
- */
281
- const ListNotificationsContract = defineQuery({
282
- meta: {
283
- key: "notifications.list",
284
- version: "1.0.0",
285
- stability: "stable",
286
- owners: [...OWNERS],
287
- tags: ["notifications", "list"],
288
- description: "List notifications for the current user.",
289
- goal: "Show user their notifications.",
290
- context: "Notification center UI."
291
- },
292
- io: {
293
- input: ListNotificationsInputModel,
294
- output: ListNotificationsOutputModel
295
- },
296
- policy: { auth: "user" }
186
+ var ListNotificationsContract = defineQuery({
187
+ meta: {
188
+ key: "notifications.list",
189
+ version: "1.0.0",
190
+ stability: "stable",
191
+ owners: [...OWNERS],
192
+ tags: ["notifications", "list"],
193
+ description: "List notifications for the current user.",
194
+ goal: "Show user their notifications.",
195
+ context: "Notification center UI."
196
+ },
197
+ io: {
198
+ input: ListNotificationsInputModel,
199
+ output: ListNotificationsOutputModel
200
+ },
201
+ policy: {
202
+ auth: "user"
203
+ }
297
204
  });
298
- /**
299
- * Mark notification as read.
300
- */
301
- const MarkNotificationReadContract = defineCommand({
302
- meta: {
303
- key: "notifications.markRead",
304
- version: "1.0.0",
305
- stability: "stable",
306
- owners: [...OWNERS],
307
- tags: ["notifications", "read"],
308
- description: "Mark a notification as read.",
309
- goal: "Track which notifications user has seen.",
310
- context: "User clicks on a notification."
311
- },
312
- io: {
313
- input: defineSchemaModel({
314
- name: "MarkNotificationReadInput",
315
- fields: { notificationId: {
316
- type: ScalarTypeEnum.String_unsecure(),
317
- isOptional: false
318
- } }
319
- }),
320
- output: NotificationModel
321
- },
322
- policy: { auth: "user" }
205
+ var MarkNotificationReadContract = defineCommand({
206
+ meta: {
207
+ key: "notifications.markRead",
208
+ version: "1.0.0",
209
+ stability: "stable",
210
+ owners: [...OWNERS],
211
+ tags: ["notifications", "read"],
212
+ description: "Mark a notification as read.",
213
+ goal: "Track which notifications user has seen.",
214
+ context: "User clicks on a notification."
215
+ },
216
+ io: {
217
+ input: defineSchemaModel({
218
+ name: "MarkNotificationReadInput",
219
+ fields: {
220
+ notificationId: {
221
+ type: ScalarTypeEnum.String_unsecure(),
222
+ isOptional: false
223
+ }
224
+ }
225
+ }),
226
+ output: NotificationModel
227
+ },
228
+ policy: {
229
+ auth: "user"
230
+ }
323
231
  });
324
- /**
325
- * Mark all notifications as read.
326
- */
327
- const MarkAllNotificationsReadContract = defineCommand({
328
- meta: {
329
- key: "notifications.markAllRead",
330
- version: "1.0.0",
331
- stability: "stable",
332
- owners: [...OWNERS],
333
- tags: ["notifications", "read"],
334
- description: "Mark all notifications as read.",
335
- goal: "Clear notification badge.",
336
- context: "User clicks \"mark all as read\"."
337
- },
338
- io: {
339
- input: null,
340
- output: defineSchemaModel({
341
- name: "MarkAllNotificationsReadOutput",
342
- fields: { markedCount: {
343
- type: ScalarTypeEnum.Int_unsecure(),
344
- isOptional: false
345
- } }
346
- })
347
- },
348
- policy: { auth: "user" }
232
+ var MarkAllNotificationsReadContract = defineCommand({
233
+ meta: {
234
+ key: "notifications.markAllRead",
235
+ version: "1.0.0",
236
+ stability: "stable",
237
+ owners: [...OWNERS],
238
+ tags: ["notifications", "read"],
239
+ description: "Mark all notifications as read.",
240
+ goal: "Clear notification badge.",
241
+ context: 'User clicks "mark all as read".'
242
+ },
243
+ io: {
244
+ input: null,
245
+ output: defineSchemaModel({
246
+ name: "MarkAllNotificationsReadOutput",
247
+ fields: {
248
+ markedCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
249
+ }
250
+ })
251
+ },
252
+ policy: {
253
+ auth: "user"
254
+ }
349
255
  });
350
- /**
351
- * Get notification preferences.
352
- */
353
- const GetNotificationPreferencesContract = defineQuery({
354
- meta: {
355
- key: "notifications.preferences.get",
356
- version: "1.0.0",
357
- stability: "stable",
358
- owners: [...OWNERS],
359
- tags: [
360
- "notifications",
361
- "preferences",
362
- "get"
363
- ],
364
- description: "Get notification preferences for current user.",
365
- goal: "Show user their notification settings.",
366
- context: "Notification settings page."
367
- },
368
- io: {
369
- input: null,
370
- output: NotificationPreferenceModel
371
- },
372
- policy: { auth: "user" }
256
+ var GetNotificationPreferencesContract = defineQuery({
257
+ meta: {
258
+ key: "notifications.preferences.get",
259
+ version: "1.0.0",
260
+ stability: "stable",
261
+ owners: [...OWNERS],
262
+ tags: ["notifications", "preferences", "get"],
263
+ description: "Get notification preferences for current user.",
264
+ goal: "Show user their notification settings.",
265
+ context: "Notification settings page."
266
+ },
267
+ io: {
268
+ input: null,
269
+ output: NotificationPreferenceModel
270
+ },
271
+ policy: {
272
+ auth: "user"
273
+ }
373
274
  });
374
- /**
375
- * Update notification preferences.
376
- */
377
- const UpdateNotificationPreferencesContract = defineCommand({
378
- meta: {
379
- key: "notifications.preferences.update",
380
- version: "1.0.0",
381
- stability: "stable",
382
- owners: [...OWNERS],
383
- tags: [
384
- "notifications",
385
- "preferences",
386
- "update"
387
- ],
388
- description: "Update notification preferences.",
389
- goal: "Allow user to control notification delivery.",
390
- context: "Notification settings page."
391
- },
392
- io: {
393
- input: UpdatePreferencesInputModel,
394
- output: NotificationPreferenceModel
395
- },
396
- policy: { auth: "user" }
275
+ var UpdateNotificationPreferencesContract = defineCommand({
276
+ meta: {
277
+ key: "notifications.preferences.update",
278
+ version: "1.0.0",
279
+ stability: "stable",
280
+ owners: [...OWNERS],
281
+ tags: ["notifications", "preferences", "update"],
282
+ description: "Update notification preferences.",
283
+ goal: "Allow user to control notification delivery.",
284
+ context: "Notification settings page."
285
+ },
286
+ io: {
287
+ input: UpdatePreferencesInputModel,
288
+ output: NotificationPreferenceModel
289
+ },
290
+ policy: {
291
+ auth: "user"
292
+ }
397
293
  });
398
- /**
399
- * Delete a notification.
400
- */
401
- const DeleteNotificationContract = defineCommand({
402
- meta: {
403
- key: "notifications.delete",
404
- version: "1.0.0",
405
- stability: "stable",
406
- owners: [...OWNERS],
407
- tags: ["notifications", "delete"],
408
- description: "Delete a notification.",
409
- goal: "Allow user to remove unwanted notifications.",
410
- context: "User dismisses a notification."
411
- },
412
- io: {
413
- input: defineSchemaModel({
414
- name: "DeleteNotificationInput",
415
- fields: { notificationId: {
416
- type: ScalarTypeEnum.String_unsecure(),
417
- isOptional: false
418
- } }
419
- }),
420
- output: defineSchemaModel({
421
- name: "DeleteNotificationOutput",
422
- fields: { success: {
423
- type: ScalarTypeEnum.Boolean(),
424
- isOptional: false
425
- } }
426
- })
427
- },
428
- policy: { auth: "user" }
294
+ var DeleteNotificationContract = defineCommand({
295
+ meta: {
296
+ key: "notifications.delete",
297
+ version: "1.0.0",
298
+ stability: "stable",
299
+ owners: [...OWNERS],
300
+ tags: ["notifications", "delete"],
301
+ description: "Delete a notification.",
302
+ goal: "Allow user to remove unwanted notifications.",
303
+ context: "User dismisses a notification."
304
+ },
305
+ io: {
306
+ input: defineSchemaModel({
307
+ name: "DeleteNotificationInput",
308
+ fields: {
309
+ notificationId: {
310
+ type: ScalarTypeEnum.String_unsecure(),
311
+ isOptional: false
312
+ }
313
+ }
314
+ }),
315
+ output: defineSchemaModel({
316
+ name: "DeleteNotificationOutput",
317
+ fields: {
318
+ success: { type: ScalarTypeEnum.Boolean(), isOptional: false }
319
+ }
320
+ })
321
+ },
322
+ policy: {
323
+ auth: "user"
324
+ }
429
325
  });
430
-
431
- //#endregion
432
- export { DeleteNotificationContract, GetNotificationPreferencesContract, ListNotificationsContract, ListNotificationsInputModel, ListNotificationsOutputModel, MarkAllNotificationsReadContract, MarkNotificationReadContract, NotificationFilterEnum, NotificationModel, NotificationPreferenceModel, SendNotificationContract, SendNotificationInputModel, UpdateNotificationPreferencesContract, UpdatePreferencesInputModel };
433
- //# sourceMappingURL=index.js.map
326
+ export {
327
+ UpdatePreferencesInputModel,
328
+ UpdateNotificationPreferencesContract,
329
+ SendNotificationInputModel,
330
+ SendNotificationContract,
331
+ NotificationPreferenceModel,
332
+ NotificationModel,
333
+ NotificationFilterEnum,
334
+ MarkNotificationReadContract,
335
+ MarkAllNotificationsReadContract,
336
+ ListNotificationsOutputModel,
337
+ ListNotificationsInputModel,
338
+ ListNotificationsContract,
339
+ GetNotificationPreferencesContract,
340
+ DeleteNotificationContract
341
+ };