@contractspec/module.notifications 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +121 -0
- package/dist/channels/index.d.ts +107 -0
- package/dist/channels/index.d.ts.map +1 -0
- package/dist/channels/index.js +127 -0
- package/dist/channels/index.js.map +1 -0
- package/dist/contracts/index.d.ts +638 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +433 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/entities/index.d.ts +183 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +254 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/notifications.feature.d.ts +12 -0
- package/dist/notifications.feature.d.ts.map +1 -0
- package/dist/notifications.feature.js +70 -0
- package/dist/notifications.feature.js.map +1 -0
- package/dist/templates/index.d.ts +92 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +202 -0
- package/dist/templates/index.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
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"
|
|
13
|
+
]);
|
|
14
|
+
const NotificationChannelSchemaEnum = defineEnum("NotificationChannel", [
|
|
15
|
+
"EMAIL",
|
|
16
|
+
"IN_APP",
|
|
17
|
+
"PUSH",
|
|
18
|
+
"WEBHOOK"
|
|
19
|
+
]);
|
|
20
|
+
const NotificationFilterEnum = defineEnum("NotificationFilter", [
|
|
21
|
+
"unread",
|
|
22
|
+
"read",
|
|
23
|
+
"all"
|
|
24
|
+
]);
|
|
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
|
+
}
|
|
71
|
+
});
|
|
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
|
+
}
|
|
113
|
+
});
|
|
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
|
+
}
|
|
156
|
+
});
|
|
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
|
+
}
|
|
180
|
+
});
|
|
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
|
+
}
|
|
199
|
+
});
|
|
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
|
+
}
|
|
237
|
+
});
|
|
238
|
+
/**
|
|
239
|
+
* Send a notification.
|
|
240
|
+
*/
|
|
241
|
+
const SendNotificationContract = defineCommand({
|
|
242
|
+
meta: {
|
|
243
|
+
key: "notifications.send",
|
|
244
|
+
version: 1,
|
|
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,
|
|
274
|
+
when: "Notification is sent",
|
|
275
|
+
payload: NotificationModel
|
|
276
|
+
}] }
|
|
277
|
+
});
|
|
278
|
+
/**
|
|
279
|
+
* List notifications for current user.
|
|
280
|
+
*/
|
|
281
|
+
const ListNotificationsContract = defineQuery({
|
|
282
|
+
meta: {
|
|
283
|
+
key: "notifications.list",
|
|
284
|
+
version: 1,
|
|
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" }
|
|
297
|
+
});
|
|
298
|
+
/**
|
|
299
|
+
* Mark notification as read.
|
|
300
|
+
*/
|
|
301
|
+
const MarkNotificationReadContract = defineCommand({
|
|
302
|
+
meta: {
|
|
303
|
+
key: "notifications.markRead",
|
|
304
|
+
version: 1,
|
|
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" }
|
|
323
|
+
});
|
|
324
|
+
/**
|
|
325
|
+
* Mark all notifications as read.
|
|
326
|
+
*/
|
|
327
|
+
const MarkAllNotificationsReadContract = defineCommand({
|
|
328
|
+
meta: {
|
|
329
|
+
key: "notifications.markAllRead",
|
|
330
|
+
version: 1,
|
|
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" }
|
|
349
|
+
});
|
|
350
|
+
/**
|
|
351
|
+
* Get notification preferences.
|
|
352
|
+
*/
|
|
353
|
+
const GetNotificationPreferencesContract = defineQuery({
|
|
354
|
+
meta: {
|
|
355
|
+
key: "notifications.preferences.get",
|
|
356
|
+
version: 1,
|
|
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" }
|
|
373
|
+
});
|
|
374
|
+
/**
|
|
375
|
+
* Update notification preferences.
|
|
376
|
+
*/
|
|
377
|
+
const UpdateNotificationPreferencesContract = defineCommand({
|
|
378
|
+
meta: {
|
|
379
|
+
key: "notifications.preferences.update",
|
|
380
|
+
version: 1,
|
|
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" }
|
|
397
|
+
});
|
|
398
|
+
/**
|
|
399
|
+
* Delete a notification.
|
|
400
|
+
*/
|
|
401
|
+
const DeleteNotificationContract = defineCommand({
|
|
402
|
+
meta: {
|
|
403
|
+
key: "notifications.delete",
|
|
404
|
+
version: 1,
|
|
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" }
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
//#endregion
|
|
432
|
+
export { DeleteNotificationContract, GetNotificationPreferencesContract, ListNotificationsContract, ListNotificationsInputModel, ListNotificationsOutputModel, MarkAllNotificationsReadContract, MarkNotificationReadContract, NotificationFilterEnum, NotificationModel, NotificationPreferenceModel, SendNotificationContract, SendNotificationInputModel, UpdateNotificationPreferencesContract, UpdatePreferencesInputModel };
|
|
433
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/contracts/index.ts"],"sourcesContent":["import {\n defineCommand,\n defineQuery,\n defineSchemaModel,\n} from '@contractspec/lib.contracts';\nimport { ScalarTypeEnum, defineEnum } from '@contractspec/lib.schema';\n\nconst OWNERS = ['platform.notifications'] as const;\n\n// ============ Enums (for contract schemas) ============\n// Note: These are EnumType for use in SchemaModel fields.\n// Entity enums for Prisma are defined separately in ./entities\n\nconst NotificationStatusSchemaEnum = defineEnum('NotificationStatus', [\n 'PENDING',\n 'SENT',\n 'DELIVERED',\n 'READ',\n 'FAILED',\n 'CANCELLED',\n]);\n\nconst NotificationChannelSchemaEnum = defineEnum('NotificationChannel', [\n 'EMAIL',\n 'IN_APP',\n 'PUSH',\n 'WEBHOOK',\n]);\n\nexport const NotificationFilterEnum = defineEnum('NotificationFilter', [\n 'unread',\n 'read',\n 'all',\n]);\n\n// ============ Schemas ============\n\nexport const NotificationModel = defineSchemaModel({\n name: 'Notification',\n description: 'A notification sent to a user',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: NotificationStatusSchemaEnum, isOptional: false },\n channels: {\n type: NotificationChannelSchemaEnum,\n isArray: true,\n isOptional: false,\n },\n actionUrl: { type: ScalarTypeEnum.URL(), isOptional: true },\n readAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const NotificationPreferenceModel = defineSchemaModel({\n name: 'NotificationPreference',\n description: 'User notification preferences',\n fields: {\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n globalEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n channelPreferences: {\n type: ScalarTypeEnum.JSONObject(),\n isOptional: false,\n },\n typePreferences: { type: ScalarTypeEnum.JSONObject(), isOptional: false },\n quietHoursStart: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n quietHoursEnd: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n timezone: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n digestEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n digestFrequency: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n },\n});\n\nexport const SendNotificationInputModel = defineSchemaModel({\n name: 'SendNotificationInput',\n description: 'Input for sending a notification',\n fields: {\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n templateId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n body: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n channels: {\n type: NotificationChannelSchemaEnum,\n isArray: true,\n isOptional: true,\n },\n actionUrl: { type: ScalarTypeEnum.URL(), isOptional: true },\n variables: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n },\n});\n\nexport const ListNotificationsInputModel = defineSchemaModel({\n name: 'ListNotificationsInput',\n description: 'Input for listing notifications',\n fields: {\n status: { type: NotificationFilterEnum, isOptional: true },\n type: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n});\n\nexport const ListNotificationsOutputModel = defineSchemaModel({\n name: 'ListNotificationsOutput',\n description: 'Output for listing notifications',\n fields: {\n notifications: {\n type: NotificationModel,\n isArray: true,\n isOptional: false,\n },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n unreadCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nexport const UpdatePreferencesInputModel = defineSchemaModel({\n name: 'UpdateNotificationPreferencesInput',\n description: 'Input for updating notification preferences',\n fields: {\n globalEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n channelPreferences: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n typePreferences: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n quietHoursStart: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n quietHoursEnd: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n timezone: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n digestEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n digestFrequency: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n },\n});\n\n// ============ Contracts ============\n\n/**\n * Send a notification.\n */\nexport const SendNotificationContract = defineCommand({\n meta: {\n key: 'notifications.send',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['notifications', 'send'],\n description: 'Send a notification to a user.',\n goal: 'Deliver notifications across multiple channels.',\n context: 'Called by services when events require user notification.',\n },\n io: {\n input: SendNotificationInputModel,\n output: NotificationModel,\n errors: {\n USER_NOT_FOUND: {\n description: 'Target user does not exist',\n http: 404,\n gqlCode: 'USER_NOT_FOUND',\n when: 'User ID is invalid',\n },\n TEMPLATE_NOT_FOUND: {\n description: 'Notification template does not exist',\n http: 404,\n gqlCode: 'TEMPLATE_NOT_FOUND',\n when: 'Template ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n sideEffects: {\n emits: [\n {\n key: 'notification.sent',\n version: 1,\n when: 'Notification is sent',\n payload: NotificationModel,\n },\n ],\n },\n});\n\n/**\n * List notifications for current user.\n */\nexport const ListNotificationsContract = defineQuery({\n meta: {\n key: 'notifications.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['notifications', 'list'],\n description: 'List notifications for the current user.',\n goal: 'Show user their notifications.',\n context: 'Notification center UI.',\n },\n io: {\n input: ListNotificationsInputModel,\n output: ListNotificationsOutputModel,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Mark notification as read.\n */\nexport const MarkNotificationReadContract = defineCommand({\n meta: {\n key: 'notifications.markRead',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['notifications', 'read'],\n description: 'Mark a notification as read.',\n goal: 'Track which notifications user has seen.',\n context: 'User clicks on a notification.',\n },\n io: {\n input: defineSchemaModel({\n name: 'MarkNotificationReadInput',\n fields: {\n notificationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n },\n }),\n output: NotificationModel,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Mark all notifications as read.\n */\nexport const MarkAllNotificationsReadContract = defineCommand({\n meta: {\n key: 'notifications.markAllRead',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['notifications', 'read'],\n description: 'Mark all notifications as read.',\n goal: 'Clear notification badge.',\n context: 'User clicks \"mark all as read\".',\n },\n io: {\n input: null,\n output: defineSchemaModel({\n name: 'MarkAllNotificationsReadOutput',\n fields: {\n markedCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n }),\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Get notification preferences.\n */\nexport const GetNotificationPreferencesContract = defineQuery({\n meta: {\n key: 'notifications.preferences.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['notifications', 'preferences', 'get'],\n description: 'Get notification preferences for current user.',\n goal: 'Show user their notification settings.',\n context: 'Notification settings page.',\n },\n io: {\n input: null,\n output: NotificationPreferenceModel,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Update notification preferences.\n */\nexport const UpdateNotificationPreferencesContract = defineCommand({\n meta: {\n key: 'notifications.preferences.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['notifications', 'preferences', 'update'],\n description: 'Update notification preferences.',\n goal: 'Allow user to control notification delivery.',\n context: 'Notification settings page.',\n },\n io: {\n input: UpdatePreferencesInputModel,\n output: NotificationPreferenceModel,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Delete a notification.\n */\nexport const DeleteNotificationContract = defineCommand({\n meta: {\n key: 'notifications.delete',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['notifications', 'delete'],\n description: 'Delete a notification.',\n goal: 'Allow user to remove unwanted notifications.',\n context: 'User dismisses a notification.',\n },\n io: {\n input: defineSchemaModel({\n name: 'DeleteNotificationInput',\n fields: {\n notificationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n },\n }),\n output: defineSchemaModel({\n name: 'DeleteNotificationOutput',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n }),\n },\n policy: {\n auth: 'user',\n },\n});\n"],"mappings":";;;;AAOA,MAAM,SAAS,CAAC,yBAAyB;AAMzC,MAAM,+BAA+B,WAAW,sBAAsB;CACpE;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAM,gCAAgC,WAAW,uBAAuB;CACtE;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAa,yBAAyB,WAAW,sBAAsB;CACrE;CACA;CACA;CACD,CAAC;AAIF,MAAa,oBAAoB,kBAAkB;CACjD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,QAAQ;GAAE,MAAM;GAA8B,YAAY;GAAO;EACjE,UAAU;GACR,MAAM;GACN,SAAS;GACT,YAAY;GACb;EACD,WAAW;GAAE,MAAM,eAAe,KAAK;GAAE,YAAY;GAAM;EAC3D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ACN,aAAa;IAAE,MAAM,eAAe,cAAc;IAAE,YAAY;IAAO,EACxE;GACF,CAAC;EACH;CACD,QAAQ,EACN,MAAM,QACP;CACF,CAAC;;;;AAKF,MAAa,qCAAqC,YAAY;CAC5D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAiB;GAAe;GAAM;EAC7C,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EACN,MAAM,QACP;CACF,CAAC;;;;AAKF,MAAa,wCAAwC,cAAc;CACjE,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAiB;GAAe;GAAS;EAChD,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EACN,MAAM,QACP;CACF,CAAC;;;;AAKF,MAAa,6BAA6B,cAAc;CACtD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,iBAAiB,SAAS;EACjC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO,kBAAkB;GACvB,MAAM;GACN,QAAQ,EACN,gBAAgB;IACd,MAAM,eAAe,iBAAiB;IACtC,YAAY;IACb,EACF;GACF,CAAC;EACF,QAAQ,kBAAkB;GACxB,MAAM;GACN,QAAQ,EACN,SAAS;IAAE,MAAM,eAAe,SAAS;IAAE,YAAY;IAAO,EAC/D;GACF,CAAC;EACH;CACD,QAAQ,EACN,MAAM,QACP;CACF,CAAC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import * as _contractspec_lib_schema160 from "@contractspec/lib.schema";
|
|
2
|
+
import { ModuleSchemaContribution } from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/entities/index.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Notification status enum.
|
|
7
|
+
*/
|
|
8
|
+
declare const NotificationStatusEnum: _contractspec_lib_schema160.EntityEnumDef;
|
|
9
|
+
/**
|
|
10
|
+
* Notification channel enum.
|
|
11
|
+
*/
|
|
12
|
+
declare const NotificationChannelEnum: _contractspec_lib_schema160.EntityEnumDef;
|
|
13
|
+
/**
|
|
14
|
+
* Notification entity - individual notification instance.
|
|
15
|
+
*/
|
|
16
|
+
declare const NotificationEntity: _contractspec_lib_schema160.EntitySpec<{
|
|
17
|
+
id: _contractspec_lib_schema160.EntityScalarField;
|
|
18
|
+
userId: _contractspec_lib_schema160.EntityScalarField;
|
|
19
|
+
orgId: _contractspec_lib_schema160.EntityScalarField;
|
|
20
|
+
templateId: _contractspec_lib_schema160.EntityScalarField;
|
|
21
|
+
title: _contractspec_lib_schema160.EntityScalarField;
|
|
22
|
+
body: _contractspec_lib_schema160.EntityScalarField;
|
|
23
|
+
actionUrl: _contractspec_lib_schema160.EntityScalarField;
|
|
24
|
+
imageUrl: _contractspec_lib_schema160.EntityScalarField;
|
|
25
|
+
type: _contractspec_lib_schema160.EntityScalarField;
|
|
26
|
+
category: _contractspec_lib_schema160.EntityScalarField;
|
|
27
|
+
priority: _contractspec_lib_schema160.EntityEnumField;
|
|
28
|
+
channels: _contractspec_lib_schema160.EntityScalarField;
|
|
29
|
+
status: _contractspec_lib_schema160.EntityEnumField;
|
|
30
|
+
sentAt: _contractspec_lib_schema160.EntityScalarField;
|
|
31
|
+
deliveredAt: _contractspec_lib_schema160.EntityScalarField;
|
|
32
|
+
readAt: _contractspec_lib_schema160.EntityScalarField;
|
|
33
|
+
metadata: _contractspec_lib_schema160.EntityScalarField;
|
|
34
|
+
variables: _contractspec_lib_schema160.EntityScalarField;
|
|
35
|
+
triggeredBy: _contractspec_lib_schema160.EntityScalarField;
|
|
36
|
+
sourceId: _contractspec_lib_schema160.EntityScalarField;
|
|
37
|
+
sourceType: _contractspec_lib_schema160.EntityScalarField;
|
|
38
|
+
createdAt: _contractspec_lib_schema160.EntityScalarField;
|
|
39
|
+
updatedAt: _contractspec_lib_schema160.EntityScalarField;
|
|
40
|
+
expiresAt: _contractspec_lib_schema160.EntityScalarField;
|
|
41
|
+
deliveryLogs: _contractspec_lib_schema160.EntityRelationField;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Notification priority enum.
|
|
45
|
+
*/
|
|
46
|
+
declare const NotificationPriorityEnum: _contractspec_lib_schema160.EntityEnumDef;
|
|
47
|
+
/**
|
|
48
|
+
* NotificationTemplate entity - reusable notification templates.
|
|
49
|
+
*/
|
|
50
|
+
declare const NotificationTemplateEntity: _contractspec_lib_schema160.EntitySpec<{
|
|
51
|
+
id: _contractspec_lib_schema160.EntityScalarField;
|
|
52
|
+
templateId: _contractspec_lib_schema160.EntityScalarField;
|
|
53
|
+
name: _contractspec_lib_schema160.EntityScalarField;
|
|
54
|
+
description: _contractspec_lib_schema160.EntityScalarField;
|
|
55
|
+
emailSubject: _contractspec_lib_schema160.EntityScalarField;
|
|
56
|
+
emailBody: _contractspec_lib_schema160.EntityScalarField;
|
|
57
|
+
inAppTitle: _contractspec_lib_schema160.EntityScalarField;
|
|
58
|
+
inAppBody: _contractspec_lib_schema160.EntityScalarField;
|
|
59
|
+
pushTitle: _contractspec_lib_schema160.EntityScalarField;
|
|
60
|
+
pushBody: _contractspec_lib_schema160.EntityScalarField;
|
|
61
|
+
defaultChannels: _contractspec_lib_schema160.EntityScalarField;
|
|
62
|
+
category: _contractspec_lib_schema160.EntityScalarField;
|
|
63
|
+
priority: _contractspec_lib_schema160.EntityEnumField;
|
|
64
|
+
variablesSchema: _contractspec_lib_schema160.EntityScalarField;
|
|
65
|
+
enabled: _contractspec_lib_schema160.EntityScalarField;
|
|
66
|
+
createdAt: _contractspec_lib_schema160.EntityScalarField;
|
|
67
|
+
updatedAt: _contractspec_lib_schema160.EntityScalarField;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* NotificationPreference entity - user notification preferences.
|
|
71
|
+
*/
|
|
72
|
+
declare const NotificationPreferenceEntity: _contractspec_lib_schema160.EntitySpec<{
|
|
73
|
+
id: _contractspec_lib_schema160.EntityScalarField;
|
|
74
|
+
userId: _contractspec_lib_schema160.EntityScalarField;
|
|
75
|
+
globalEnabled: _contractspec_lib_schema160.EntityScalarField;
|
|
76
|
+
quietHoursStart: _contractspec_lib_schema160.EntityScalarField;
|
|
77
|
+
quietHoursEnd: _contractspec_lib_schema160.EntityScalarField;
|
|
78
|
+
timezone: _contractspec_lib_schema160.EntityScalarField;
|
|
79
|
+
channelPreferences: _contractspec_lib_schema160.EntityScalarField;
|
|
80
|
+
typePreferences: _contractspec_lib_schema160.EntityScalarField;
|
|
81
|
+
digestEnabled: _contractspec_lib_schema160.EntityScalarField;
|
|
82
|
+
digestFrequency: _contractspec_lib_schema160.EntityScalarField;
|
|
83
|
+
digestTime: _contractspec_lib_schema160.EntityScalarField;
|
|
84
|
+
createdAt: _contractspec_lib_schema160.EntityScalarField;
|
|
85
|
+
updatedAt: _contractspec_lib_schema160.EntityScalarField;
|
|
86
|
+
}>;
|
|
87
|
+
/**
|
|
88
|
+
* DeliveryLog entity - track delivery attempts per channel.
|
|
89
|
+
*/
|
|
90
|
+
declare const DeliveryLogEntity: _contractspec_lib_schema160.EntitySpec<{
|
|
91
|
+
id: _contractspec_lib_schema160.EntityScalarField;
|
|
92
|
+
notificationId: _contractspec_lib_schema160.EntityScalarField;
|
|
93
|
+
channel: _contractspec_lib_schema160.EntityEnumField;
|
|
94
|
+
status: _contractspec_lib_schema160.EntityEnumField;
|
|
95
|
+
attemptedAt: _contractspec_lib_schema160.EntityScalarField;
|
|
96
|
+
deliveredAt: _contractspec_lib_schema160.EntityScalarField;
|
|
97
|
+
responseCode: _contractspec_lib_schema160.EntityScalarField;
|
|
98
|
+
responseMessage: _contractspec_lib_schema160.EntityScalarField;
|
|
99
|
+
externalId: _contractspec_lib_schema160.EntityScalarField;
|
|
100
|
+
metadata: _contractspec_lib_schema160.EntityScalarField;
|
|
101
|
+
notification: _contractspec_lib_schema160.EntityRelationField;
|
|
102
|
+
}>;
|
|
103
|
+
/**
|
|
104
|
+
* All notification entities for schema composition.
|
|
105
|
+
*/
|
|
106
|
+
declare const notificationEntities: (_contractspec_lib_schema160.EntitySpec<{
|
|
107
|
+
id: _contractspec_lib_schema160.EntityScalarField;
|
|
108
|
+
userId: _contractspec_lib_schema160.EntityScalarField;
|
|
109
|
+
orgId: _contractspec_lib_schema160.EntityScalarField;
|
|
110
|
+
templateId: _contractspec_lib_schema160.EntityScalarField;
|
|
111
|
+
title: _contractspec_lib_schema160.EntityScalarField;
|
|
112
|
+
body: _contractspec_lib_schema160.EntityScalarField;
|
|
113
|
+
actionUrl: _contractspec_lib_schema160.EntityScalarField;
|
|
114
|
+
imageUrl: _contractspec_lib_schema160.EntityScalarField;
|
|
115
|
+
type: _contractspec_lib_schema160.EntityScalarField;
|
|
116
|
+
category: _contractspec_lib_schema160.EntityScalarField;
|
|
117
|
+
priority: _contractspec_lib_schema160.EntityEnumField;
|
|
118
|
+
channels: _contractspec_lib_schema160.EntityScalarField;
|
|
119
|
+
status: _contractspec_lib_schema160.EntityEnumField;
|
|
120
|
+
sentAt: _contractspec_lib_schema160.EntityScalarField;
|
|
121
|
+
deliveredAt: _contractspec_lib_schema160.EntityScalarField;
|
|
122
|
+
readAt: _contractspec_lib_schema160.EntityScalarField;
|
|
123
|
+
metadata: _contractspec_lib_schema160.EntityScalarField;
|
|
124
|
+
variables: _contractspec_lib_schema160.EntityScalarField;
|
|
125
|
+
triggeredBy: _contractspec_lib_schema160.EntityScalarField;
|
|
126
|
+
sourceId: _contractspec_lib_schema160.EntityScalarField;
|
|
127
|
+
sourceType: _contractspec_lib_schema160.EntityScalarField;
|
|
128
|
+
createdAt: _contractspec_lib_schema160.EntityScalarField;
|
|
129
|
+
updatedAt: _contractspec_lib_schema160.EntityScalarField;
|
|
130
|
+
expiresAt: _contractspec_lib_schema160.EntityScalarField;
|
|
131
|
+
deliveryLogs: _contractspec_lib_schema160.EntityRelationField;
|
|
132
|
+
}> | _contractspec_lib_schema160.EntitySpec<{
|
|
133
|
+
id: _contractspec_lib_schema160.EntityScalarField;
|
|
134
|
+
templateId: _contractspec_lib_schema160.EntityScalarField;
|
|
135
|
+
name: _contractspec_lib_schema160.EntityScalarField;
|
|
136
|
+
description: _contractspec_lib_schema160.EntityScalarField;
|
|
137
|
+
emailSubject: _contractspec_lib_schema160.EntityScalarField;
|
|
138
|
+
emailBody: _contractspec_lib_schema160.EntityScalarField;
|
|
139
|
+
inAppTitle: _contractspec_lib_schema160.EntityScalarField;
|
|
140
|
+
inAppBody: _contractspec_lib_schema160.EntityScalarField;
|
|
141
|
+
pushTitle: _contractspec_lib_schema160.EntityScalarField;
|
|
142
|
+
pushBody: _contractspec_lib_schema160.EntityScalarField;
|
|
143
|
+
defaultChannels: _contractspec_lib_schema160.EntityScalarField;
|
|
144
|
+
category: _contractspec_lib_schema160.EntityScalarField;
|
|
145
|
+
priority: _contractspec_lib_schema160.EntityEnumField;
|
|
146
|
+
variablesSchema: _contractspec_lib_schema160.EntityScalarField;
|
|
147
|
+
enabled: _contractspec_lib_schema160.EntityScalarField;
|
|
148
|
+
createdAt: _contractspec_lib_schema160.EntityScalarField;
|
|
149
|
+
updatedAt: _contractspec_lib_schema160.EntityScalarField;
|
|
150
|
+
}> | _contractspec_lib_schema160.EntitySpec<{
|
|
151
|
+
id: _contractspec_lib_schema160.EntityScalarField;
|
|
152
|
+
userId: _contractspec_lib_schema160.EntityScalarField;
|
|
153
|
+
globalEnabled: _contractspec_lib_schema160.EntityScalarField;
|
|
154
|
+
quietHoursStart: _contractspec_lib_schema160.EntityScalarField;
|
|
155
|
+
quietHoursEnd: _contractspec_lib_schema160.EntityScalarField;
|
|
156
|
+
timezone: _contractspec_lib_schema160.EntityScalarField;
|
|
157
|
+
channelPreferences: _contractspec_lib_schema160.EntityScalarField;
|
|
158
|
+
typePreferences: _contractspec_lib_schema160.EntityScalarField;
|
|
159
|
+
digestEnabled: _contractspec_lib_schema160.EntityScalarField;
|
|
160
|
+
digestFrequency: _contractspec_lib_schema160.EntityScalarField;
|
|
161
|
+
digestTime: _contractspec_lib_schema160.EntityScalarField;
|
|
162
|
+
createdAt: _contractspec_lib_schema160.EntityScalarField;
|
|
163
|
+
updatedAt: _contractspec_lib_schema160.EntityScalarField;
|
|
164
|
+
}> | _contractspec_lib_schema160.EntitySpec<{
|
|
165
|
+
id: _contractspec_lib_schema160.EntityScalarField;
|
|
166
|
+
notificationId: _contractspec_lib_schema160.EntityScalarField;
|
|
167
|
+
channel: _contractspec_lib_schema160.EntityEnumField;
|
|
168
|
+
status: _contractspec_lib_schema160.EntityEnumField;
|
|
169
|
+
attemptedAt: _contractspec_lib_schema160.EntityScalarField;
|
|
170
|
+
deliveredAt: _contractspec_lib_schema160.EntityScalarField;
|
|
171
|
+
responseCode: _contractspec_lib_schema160.EntityScalarField;
|
|
172
|
+
responseMessage: _contractspec_lib_schema160.EntityScalarField;
|
|
173
|
+
externalId: _contractspec_lib_schema160.EntityScalarField;
|
|
174
|
+
metadata: _contractspec_lib_schema160.EntityScalarField;
|
|
175
|
+
notification: _contractspec_lib_schema160.EntityRelationField;
|
|
176
|
+
}>)[];
|
|
177
|
+
/**
|
|
178
|
+
* Module schema contribution for notifications.
|
|
179
|
+
*/
|
|
180
|
+
declare const notificationsSchemaContribution: ModuleSchemaContribution;
|
|
181
|
+
//#endregion
|
|
182
|
+
export { DeliveryLogEntity, NotificationChannelEnum, NotificationEntity, NotificationPreferenceEntity, NotificationPriorityEnum, NotificationStatusEnum, NotificationTemplateEntity, notificationEntities, notificationsSchemaContribution };
|
|
183
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/entities/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAWa,cAAA,sBAYX,EAAA,2BAAA,CAZiC,aAYjC;AAKF;AAUA;;cAVa,yBAKX,2BAAA,CALkC;;;;cAUvB,gDAAkB;MAyF7B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;yDAzF6B;EAAA,UAAA,+CAAA;EA8FlB,SAAA,+CAKX;EAKW,SAAA,+CAyCX;EAAA,SAAA,+CAAA;;;;;;cAnDW,0BAKX,2BAAA,CALmC;;;;cAUxB,wDAA0B;MAyCrC,2BAAA,CAAA;;;;;;2DAzCqC;EAAA,SAAA,+CAAA;EA8C1B,SAAA,+CA6CX;EAAA,QAAA,+CAAA;;;;;;;;;;;;cA7CW,0DAA4B;MA6CvC,2BAAA,CAAA,iBA7CuC;EAAA,MAAA,+CAAA;EAkD5B,aAAA,+CAoCX;EAAA,eAAA,+CAAA;;;;;;;;;;;;;AAKF;AAKC,cA9CY,iBA8CZ,8BA9C6B,UA8C7B,CAAA;MAVC,2BAAA,CAAA;;;;;;;;;;;;;;;cAKW,mDAAoB;MAKhC,2BAAA,CAAA;;;;;;;;qDALgC;EAAA,QAAA,+CAAA;;;;;;;;;;;;;;;;;MAAA,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUpB,UAAA,+CAAiC;;;;;;;;;;;;;;;;;;;cAAjC,iCAAiC"}
|