@contractspec/module.notifications 1.44.1 → 1.45.1
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/dist/contracts/index.d.ts +161 -161
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +8 -8
- package/dist/contracts/index.js.map +1 -1
- package/dist/entities/index.d.ts +144 -144
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/notifications.feature.js +10 -10
- package/dist/notifications.feature.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/contracts/index.ts"],"sourcesContent":[],"mappings":";;;;cA6Ba,wBAIX,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/contracts/index.ts"],"sourcesContent":[],"mappings":";;;;cA6Ba,wBAIX,2BAAA,CAJiC;cAQtB,+CAAiB;;UAmB5B,2BAAA,CAAA;IA3BW,UAAA,EAAA,KAAA;EAQA,CAAA;EAmBX,MAAA,EAAA;;;;;;;;;;;;;IAnB4B,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAqBjB,UAAA,EAAA,KAAA;EAuBX,CAAA;;;;;;;;;;;;;;EAvBsC,MAAA,EAAA;IAyB3B,IAAA,uCAkBX,KAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;;;;cA3CW,yDAA2B;;UAuBtC,2BAAA,CAAA;;;;+CAEqC,CAAA,OAAA,EAAA,OAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAoB1B,CAAA;EAiBX,kBAAA,EAAA;;;;;IAjBsC,IAAA,uCAAA,OAAA,CAAA,MAAA,EAAA,OAAA,CAAA,QAAA,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA;IAmB3B,UAAA,EAAA,KAAA;EAYX,CAAA;;;;;;;;;;;;;;;;EAZuC,CAAA;EAc5B,eAAA,EAAA;IAmBX,IAAA,uC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A;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA/KF,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+CxB,wDAAyB,0CAAA;;UAkBpC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;cAlBoC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBzB,2DAA4B,0CAAA;;UA0BvC,2BAAA,CAAA;;;;;UA1BuC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+B5B,kCAAgC,4BAAA,CAAA,cAuB3C,2BAAA,CAvB2C,cAAA,8BAAA;;UAAA,2BAAA,CAAA;;;;;;;cA4BhC,oCAAkC,4BAAA,CAAA,cAkB7C,2BAAA,CAlB6C,cAAA,8BAAA;;UAAA,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBlC,oEAAqC,0CAAA;;UAkBhD,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAlBgD,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBrC,yDAA0B,0CAAA;;UA+BrC,2BAAA,CAAA;;;;;UA/BqC,2BAAA,CAAA"}
|
package/dist/contracts/index.js
CHANGED
|
@@ -241,7 +241,7 @@ const UpdatePreferencesInputModel = defineSchemaModel({
|
|
|
241
241
|
const SendNotificationContract = defineCommand({
|
|
242
242
|
meta: {
|
|
243
243
|
key: "notifications.send",
|
|
244
|
-
version: 1,
|
|
244
|
+
version: "1.0.0",
|
|
245
245
|
stability: "stable",
|
|
246
246
|
owners: [...OWNERS],
|
|
247
247
|
tags: ["notifications", "send"],
|
|
@@ -270,7 +270,7 @@ const SendNotificationContract = defineCommand({
|
|
|
270
270
|
policy: { auth: "user" },
|
|
271
271
|
sideEffects: { emits: [{
|
|
272
272
|
key: "notification.sent",
|
|
273
|
-
version: 1,
|
|
273
|
+
version: "1.0.0",
|
|
274
274
|
when: "Notification is sent",
|
|
275
275
|
payload: NotificationModel
|
|
276
276
|
}] }
|
|
@@ -281,7 +281,7 @@ const SendNotificationContract = defineCommand({
|
|
|
281
281
|
const ListNotificationsContract = defineQuery({
|
|
282
282
|
meta: {
|
|
283
283
|
key: "notifications.list",
|
|
284
|
-
version: 1,
|
|
284
|
+
version: "1.0.0",
|
|
285
285
|
stability: "stable",
|
|
286
286
|
owners: [...OWNERS],
|
|
287
287
|
tags: ["notifications", "list"],
|
|
@@ -301,7 +301,7 @@ const ListNotificationsContract = defineQuery({
|
|
|
301
301
|
const MarkNotificationReadContract = defineCommand({
|
|
302
302
|
meta: {
|
|
303
303
|
key: "notifications.markRead",
|
|
304
|
-
version: 1,
|
|
304
|
+
version: "1.0.0",
|
|
305
305
|
stability: "stable",
|
|
306
306
|
owners: [...OWNERS],
|
|
307
307
|
tags: ["notifications", "read"],
|
|
@@ -327,7 +327,7 @@ const MarkNotificationReadContract = defineCommand({
|
|
|
327
327
|
const MarkAllNotificationsReadContract = defineCommand({
|
|
328
328
|
meta: {
|
|
329
329
|
key: "notifications.markAllRead",
|
|
330
|
-
version: 1,
|
|
330
|
+
version: "1.0.0",
|
|
331
331
|
stability: "stable",
|
|
332
332
|
owners: [...OWNERS],
|
|
333
333
|
tags: ["notifications", "read"],
|
|
@@ -353,7 +353,7 @@ const MarkAllNotificationsReadContract = defineCommand({
|
|
|
353
353
|
const GetNotificationPreferencesContract = defineQuery({
|
|
354
354
|
meta: {
|
|
355
355
|
key: "notifications.preferences.get",
|
|
356
|
-
version: 1,
|
|
356
|
+
version: "1.0.0",
|
|
357
357
|
stability: "stable",
|
|
358
358
|
owners: [...OWNERS],
|
|
359
359
|
tags: [
|
|
@@ -377,7 +377,7 @@ const GetNotificationPreferencesContract = defineQuery({
|
|
|
377
377
|
const UpdateNotificationPreferencesContract = defineCommand({
|
|
378
378
|
meta: {
|
|
379
379
|
key: "notifications.preferences.update",
|
|
380
|
-
version: 1,
|
|
380
|
+
version: "1.0.0",
|
|
381
381
|
stability: "stable",
|
|
382
382
|
owners: [...OWNERS],
|
|
383
383
|
tags: [
|
|
@@ -401,7 +401,7 @@ const UpdateNotificationPreferencesContract = defineCommand({
|
|
|
401
401
|
const DeleteNotificationContract = defineCommand({
|
|
402
402
|
meta: {
|
|
403
403
|
key: "notifications.delete",
|
|
404
|
-
version: 1,
|
|
404
|
+
version: "1.0.0",
|
|
405
405
|
stability: "stable",
|
|
406
406
|
owners: [...OWNERS],
|
|
407
407
|
tags: ["notifications", "delete"],
|
|
@@ -1 +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;CAC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B,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"}
|
|
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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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;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;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"}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,178 +1,178 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
|
|
2
2
|
import { ModuleSchemaContribution } from "@contractspec/lib.schema";
|
|
3
3
|
|
|
4
4
|
//#region src/entities/index.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Notification status enum.
|
|
7
7
|
*/
|
|
8
|
-
declare const NotificationStatusEnum:
|
|
8
|
+
declare const NotificationStatusEnum: _contractspec_lib_schema0.EntityEnumDef;
|
|
9
9
|
/**
|
|
10
10
|
* Notification channel enum.
|
|
11
11
|
*/
|
|
12
|
-
declare const NotificationChannelEnum:
|
|
12
|
+
declare const NotificationChannelEnum: _contractspec_lib_schema0.EntityEnumDef;
|
|
13
13
|
/**
|
|
14
14
|
* Notification entity - individual notification instance.
|
|
15
15
|
*/
|
|
16
|
-
declare const NotificationEntity:
|
|
17
|
-
id:
|
|
18
|
-
userId:
|
|
19
|
-
orgId:
|
|
20
|
-
templateId:
|
|
21
|
-
title:
|
|
22
|
-
body:
|
|
23
|
-
actionUrl:
|
|
24
|
-
imageUrl:
|
|
25
|
-
type:
|
|
26
|
-
category:
|
|
27
|
-
priority:
|
|
28
|
-
channels:
|
|
29
|
-
status:
|
|
30
|
-
sentAt:
|
|
31
|
-
deliveredAt:
|
|
32
|
-
readAt:
|
|
33
|
-
metadata:
|
|
34
|
-
variables:
|
|
35
|
-
triggeredBy:
|
|
36
|
-
sourceId:
|
|
37
|
-
sourceType:
|
|
38
|
-
createdAt:
|
|
39
|
-
updatedAt:
|
|
40
|
-
expiresAt:
|
|
41
|
-
deliveryLogs:
|
|
16
|
+
declare const NotificationEntity: _contractspec_lib_schema0.EntitySpec<{
|
|
17
|
+
id: _contractspec_lib_schema0.EntityScalarField;
|
|
18
|
+
userId: _contractspec_lib_schema0.EntityScalarField;
|
|
19
|
+
orgId: _contractspec_lib_schema0.EntityScalarField;
|
|
20
|
+
templateId: _contractspec_lib_schema0.EntityScalarField;
|
|
21
|
+
title: _contractspec_lib_schema0.EntityScalarField;
|
|
22
|
+
body: _contractspec_lib_schema0.EntityScalarField;
|
|
23
|
+
actionUrl: _contractspec_lib_schema0.EntityScalarField;
|
|
24
|
+
imageUrl: _contractspec_lib_schema0.EntityScalarField;
|
|
25
|
+
type: _contractspec_lib_schema0.EntityScalarField;
|
|
26
|
+
category: _contractspec_lib_schema0.EntityScalarField;
|
|
27
|
+
priority: _contractspec_lib_schema0.EntityEnumField;
|
|
28
|
+
channels: _contractspec_lib_schema0.EntityScalarField;
|
|
29
|
+
status: _contractspec_lib_schema0.EntityEnumField;
|
|
30
|
+
sentAt: _contractspec_lib_schema0.EntityScalarField;
|
|
31
|
+
deliveredAt: _contractspec_lib_schema0.EntityScalarField;
|
|
32
|
+
readAt: _contractspec_lib_schema0.EntityScalarField;
|
|
33
|
+
metadata: _contractspec_lib_schema0.EntityScalarField;
|
|
34
|
+
variables: _contractspec_lib_schema0.EntityScalarField;
|
|
35
|
+
triggeredBy: _contractspec_lib_schema0.EntityScalarField;
|
|
36
|
+
sourceId: _contractspec_lib_schema0.EntityScalarField;
|
|
37
|
+
sourceType: _contractspec_lib_schema0.EntityScalarField;
|
|
38
|
+
createdAt: _contractspec_lib_schema0.EntityScalarField;
|
|
39
|
+
updatedAt: _contractspec_lib_schema0.EntityScalarField;
|
|
40
|
+
expiresAt: _contractspec_lib_schema0.EntityScalarField;
|
|
41
|
+
deliveryLogs: _contractspec_lib_schema0.EntityRelationField;
|
|
42
42
|
}>;
|
|
43
43
|
/**
|
|
44
44
|
* Notification priority enum.
|
|
45
45
|
*/
|
|
46
|
-
declare const NotificationPriorityEnum:
|
|
46
|
+
declare const NotificationPriorityEnum: _contractspec_lib_schema0.EntityEnumDef;
|
|
47
47
|
/**
|
|
48
48
|
* NotificationTemplate entity - reusable notification templates.
|
|
49
49
|
*/
|
|
50
|
-
declare const NotificationTemplateEntity:
|
|
51
|
-
id:
|
|
52
|
-
templateId:
|
|
53
|
-
name:
|
|
54
|
-
description:
|
|
55
|
-
emailSubject:
|
|
56
|
-
emailBody:
|
|
57
|
-
inAppTitle:
|
|
58
|
-
inAppBody:
|
|
59
|
-
pushTitle:
|
|
60
|
-
pushBody:
|
|
61
|
-
defaultChannels:
|
|
62
|
-
category:
|
|
63
|
-
priority:
|
|
64
|
-
variablesSchema:
|
|
65
|
-
enabled:
|
|
66
|
-
createdAt:
|
|
67
|
-
updatedAt:
|
|
50
|
+
declare const NotificationTemplateEntity: _contractspec_lib_schema0.EntitySpec<{
|
|
51
|
+
id: _contractspec_lib_schema0.EntityScalarField;
|
|
52
|
+
templateId: _contractspec_lib_schema0.EntityScalarField;
|
|
53
|
+
name: _contractspec_lib_schema0.EntityScalarField;
|
|
54
|
+
description: _contractspec_lib_schema0.EntityScalarField;
|
|
55
|
+
emailSubject: _contractspec_lib_schema0.EntityScalarField;
|
|
56
|
+
emailBody: _contractspec_lib_schema0.EntityScalarField;
|
|
57
|
+
inAppTitle: _contractspec_lib_schema0.EntityScalarField;
|
|
58
|
+
inAppBody: _contractspec_lib_schema0.EntityScalarField;
|
|
59
|
+
pushTitle: _contractspec_lib_schema0.EntityScalarField;
|
|
60
|
+
pushBody: _contractspec_lib_schema0.EntityScalarField;
|
|
61
|
+
defaultChannels: _contractspec_lib_schema0.EntityScalarField;
|
|
62
|
+
category: _contractspec_lib_schema0.EntityScalarField;
|
|
63
|
+
priority: _contractspec_lib_schema0.EntityEnumField;
|
|
64
|
+
variablesSchema: _contractspec_lib_schema0.EntityScalarField;
|
|
65
|
+
enabled: _contractspec_lib_schema0.EntityScalarField;
|
|
66
|
+
createdAt: _contractspec_lib_schema0.EntityScalarField;
|
|
67
|
+
updatedAt: _contractspec_lib_schema0.EntityScalarField;
|
|
68
68
|
}>;
|
|
69
69
|
/**
|
|
70
70
|
* NotificationPreference entity - user notification preferences.
|
|
71
71
|
*/
|
|
72
|
-
declare const NotificationPreferenceEntity:
|
|
73
|
-
id:
|
|
74
|
-
userId:
|
|
75
|
-
globalEnabled:
|
|
76
|
-
quietHoursStart:
|
|
77
|
-
quietHoursEnd:
|
|
78
|
-
timezone:
|
|
79
|
-
channelPreferences:
|
|
80
|
-
typePreferences:
|
|
81
|
-
digestEnabled:
|
|
82
|
-
digestFrequency:
|
|
83
|
-
digestTime:
|
|
84
|
-
createdAt:
|
|
85
|
-
updatedAt:
|
|
72
|
+
declare const NotificationPreferenceEntity: _contractspec_lib_schema0.EntitySpec<{
|
|
73
|
+
id: _contractspec_lib_schema0.EntityScalarField;
|
|
74
|
+
userId: _contractspec_lib_schema0.EntityScalarField;
|
|
75
|
+
globalEnabled: _contractspec_lib_schema0.EntityScalarField;
|
|
76
|
+
quietHoursStart: _contractspec_lib_schema0.EntityScalarField;
|
|
77
|
+
quietHoursEnd: _contractspec_lib_schema0.EntityScalarField;
|
|
78
|
+
timezone: _contractspec_lib_schema0.EntityScalarField;
|
|
79
|
+
channelPreferences: _contractspec_lib_schema0.EntityScalarField;
|
|
80
|
+
typePreferences: _contractspec_lib_schema0.EntityScalarField;
|
|
81
|
+
digestEnabled: _contractspec_lib_schema0.EntityScalarField;
|
|
82
|
+
digestFrequency: _contractspec_lib_schema0.EntityScalarField;
|
|
83
|
+
digestTime: _contractspec_lib_schema0.EntityScalarField;
|
|
84
|
+
createdAt: _contractspec_lib_schema0.EntityScalarField;
|
|
85
|
+
updatedAt: _contractspec_lib_schema0.EntityScalarField;
|
|
86
86
|
}>;
|
|
87
87
|
/**
|
|
88
88
|
* DeliveryLog entity - track delivery attempts per channel.
|
|
89
89
|
*/
|
|
90
|
-
declare const DeliveryLogEntity:
|
|
91
|
-
id:
|
|
92
|
-
notificationId:
|
|
93
|
-
channel:
|
|
94
|
-
status:
|
|
95
|
-
attemptedAt:
|
|
96
|
-
deliveredAt:
|
|
97
|
-
responseCode:
|
|
98
|
-
responseMessage:
|
|
99
|
-
externalId:
|
|
100
|
-
metadata:
|
|
101
|
-
notification:
|
|
90
|
+
declare const DeliveryLogEntity: _contractspec_lib_schema0.EntitySpec<{
|
|
91
|
+
id: _contractspec_lib_schema0.EntityScalarField;
|
|
92
|
+
notificationId: _contractspec_lib_schema0.EntityScalarField;
|
|
93
|
+
channel: _contractspec_lib_schema0.EntityEnumField;
|
|
94
|
+
status: _contractspec_lib_schema0.EntityEnumField;
|
|
95
|
+
attemptedAt: _contractspec_lib_schema0.EntityScalarField;
|
|
96
|
+
deliveredAt: _contractspec_lib_schema0.EntityScalarField;
|
|
97
|
+
responseCode: _contractspec_lib_schema0.EntityScalarField;
|
|
98
|
+
responseMessage: _contractspec_lib_schema0.EntityScalarField;
|
|
99
|
+
externalId: _contractspec_lib_schema0.EntityScalarField;
|
|
100
|
+
metadata: _contractspec_lib_schema0.EntityScalarField;
|
|
101
|
+
notification: _contractspec_lib_schema0.EntityRelationField;
|
|
102
102
|
}>;
|
|
103
103
|
/**
|
|
104
104
|
* All notification entities for schema composition.
|
|
105
105
|
*/
|
|
106
|
-
declare const notificationEntities: (
|
|
107
|
-
id:
|
|
108
|
-
userId:
|
|
109
|
-
orgId:
|
|
110
|
-
templateId:
|
|
111
|
-
title:
|
|
112
|
-
body:
|
|
113
|
-
actionUrl:
|
|
114
|
-
imageUrl:
|
|
115
|
-
type:
|
|
116
|
-
category:
|
|
117
|
-
priority:
|
|
118
|
-
channels:
|
|
119
|
-
status:
|
|
120
|
-
sentAt:
|
|
121
|
-
deliveredAt:
|
|
122
|
-
readAt:
|
|
123
|
-
metadata:
|
|
124
|
-
variables:
|
|
125
|
-
triggeredBy:
|
|
126
|
-
sourceId:
|
|
127
|
-
sourceType:
|
|
128
|
-
createdAt:
|
|
129
|
-
updatedAt:
|
|
130
|
-
expiresAt:
|
|
131
|
-
deliveryLogs:
|
|
132
|
-
}> |
|
|
133
|
-
id:
|
|
134
|
-
templateId:
|
|
135
|
-
name:
|
|
136
|
-
description:
|
|
137
|
-
emailSubject:
|
|
138
|
-
emailBody:
|
|
139
|
-
inAppTitle:
|
|
140
|
-
inAppBody:
|
|
141
|
-
pushTitle:
|
|
142
|
-
pushBody:
|
|
143
|
-
defaultChannels:
|
|
144
|
-
category:
|
|
145
|
-
priority:
|
|
146
|
-
variablesSchema:
|
|
147
|
-
enabled:
|
|
148
|
-
createdAt:
|
|
149
|
-
updatedAt:
|
|
150
|
-
}> |
|
|
151
|
-
id:
|
|
152
|
-
userId:
|
|
153
|
-
globalEnabled:
|
|
154
|
-
quietHoursStart:
|
|
155
|
-
quietHoursEnd:
|
|
156
|
-
timezone:
|
|
157
|
-
channelPreferences:
|
|
158
|
-
typePreferences:
|
|
159
|
-
digestEnabled:
|
|
160
|
-
digestFrequency:
|
|
161
|
-
digestTime:
|
|
162
|
-
createdAt:
|
|
163
|
-
updatedAt:
|
|
164
|
-
}> |
|
|
165
|
-
id:
|
|
166
|
-
notificationId:
|
|
167
|
-
channel:
|
|
168
|
-
status:
|
|
169
|
-
attemptedAt:
|
|
170
|
-
deliveredAt:
|
|
171
|
-
responseCode:
|
|
172
|
-
responseMessage:
|
|
173
|
-
externalId:
|
|
174
|
-
metadata:
|
|
175
|
-
notification:
|
|
106
|
+
declare const notificationEntities: (_contractspec_lib_schema0.EntitySpec<{
|
|
107
|
+
id: _contractspec_lib_schema0.EntityScalarField;
|
|
108
|
+
userId: _contractspec_lib_schema0.EntityScalarField;
|
|
109
|
+
orgId: _contractspec_lib_schema0.EntityScalarField;
|
|
110
|
+
templateId: _contractspec_lib_schema0.EntityScalarField;
|
|
111
|
+
title: _contractspec_lib_schema0.EntityScalarField;
|
|
112
|
+
body: _contractspec_lib_schema0.EntityScalarField;
|
|
113
|
+
actionUrl: _contractspec_lib_schema0.EntityScalarField;
|
|
114
|
+
imageUrl: _contractspec_lib_schema0.EntityScalarField;
|
|
115
|
+
type: _contractspec_lib_schema0.EntityScalarField;
|
|
116
|
+
category: _contractspec_lib_schema0.EntityScalarField;
|
|
117
|
+
priority: _contractspec_lib_schema0.EntityEnumField;
|
|
118
|
+
channels: _contractspec_lib_schema0.EntityScalarField;
|
|
119
|
+
status: _contractspec_lib_schema0.EntityEnumField;
|
|
120
|
+
sentAt: _contractspec_lib_schema0.EntityScalarField;
|
|
121
|
+
deliveredAt: _contractspec_lib_schema0.EntityScalarField;
|
|
122
|
+
readAt: _contractspec_lib_schema0.EntityScalarField;
|
|
123
|
+
metadata: _contractspec_lib_schema0.EntityScalarField;
|
|
124
|
+
variables: _contractspec_lib_schema0.EntityScalarField;
|
|
125
|
+
triggeredBy: _contractspec_lib_schema0.EntityScalarField;
|
|
126
|
+
sourceId: _contractspec_lib_schema0.EntityScalarField;
|
|
127
|
+
sourceType: _contractspec_lib_schema0.EntityScalarField;
|
|
128
|
+
createdAt: _contractspec_lib_schema0.EntityScalarField;
|
|
129
|
+
updatedAt: _contractspec_lib_schema0.EntityScalarField;
|
|
130
|
+
expiresAt: _contractspec_lib_schema0.EntityScalarField;
|
|
131
|
+
deliveryLogs: _contractspec_lib_schema0.EntityRelationField;
|
|
132
|
+
}> | _contractspec_lib_schema0.EntitySpec<{
|
|
133
|
+
id: _contractspec_lib_schema0.EntityScalarField;
|
|
134
|
+
templateId: _contractspec_lib_schema0.EntityScalarField;
|
|
135
|
+
name: _contractspec_lib_schema0.EntityScalarField;
|
|
136
|
+
description: _contractspec_lib_schema0.EntityScalarField;
|
|
137
|
+
emailSubject: _contractspec_lib_schema0.EntityScalarField;
|
|
138
|
+
emailBody: _contractspec_lib_schema0.EntityScalarField;
|
|
139
|
+
inAppTitle: _contractspec_lib_schema0.EntityScalarField;
|
|
140
|
+
inAppBody: _contractspec_lib_schema0.EntityScalarField;
|
|
141
|
+
pushTitle: _contractspec_lib_schema0.EntityScalarField;
|
|
142
|
+
pushBody: _contractspec_lib_schema0.EntityScalarField;
|
|
143
|
+
defaultChannels: _contractspec_lib_schema0.EntityScalarField;
|
|
144
|
+
category: _contractspec_lib_schema0.EntityScalarField;
|
|
145
|
+
priority: _contractspec_lib_schema0.EntityEnumField;
|
|
146
|
+
variablesSchema: _contractspec_lib_schema0.EntityScalarField;
|
|
147
|
+
enabled: _contractspec_lib_schema0.EntityScalarField;
|
|
148
|
+
createdAt: _contractspec_lib_schema0.EntityScalarField;
|
|
149
|
+
updatedAt: _contractspec_lib_schema0.EntityScalarField;
|
|
150
|
+
}> | _contractspec_lib_schema0.EntitySpec<{
|
|
151
|
+
id: _contractspec_lib_schema0.EntityScalarField;
|
|
152
|
+
userId: _contractspec_lib_schema0.EntityScalarField;
|
|
153
|
+
globalEnabled: _contractspec_lib_schema0.EntityScalarField;
|
|
154
|
+
quietHoursStart: _contractspec_lib_schema0.EntityScalarField;
|
|
155
|
+
quietHoursEnd: _contractspec_lib_schema0.EntityScalarField;
|
|
156
|
+
timezone: _contractspec_lib_schema0.EntityScalarField;
|
|
157
|
+
channelPreferences: _contractspec_lib_schema0.EntityScalarField;
|
|
158
|
+
typePreferences: _contractspec_lib_schema0.EntityScalarField;
|
|
159
|
+
digestEnabled: _contractspec_lib_schema0.EntityScalarField;
|
|
160
|
+
digestFrequency: _contractspec_lib_schema0.EntityScalarField;
|
|
161
|
+
digestTime: _contractspec_lib_schema0.EntityScalarField;
|
|
162
|
+
createdAt: _contractspec_lib_schema0.EntityScalarField;
|
|
163
|
+
updatedAt: _contractspec_lib_schema0.EntityScalarField;
|
|
164
|
+
}> | _contractspec_lib_schema0.EntitySpec<{
|
|
165
|
+
id: _contractspec_lib_schema0.EntityScalarField;
|
|
166
|
+
notificationId: _contractspec_lib_schema0.EntityScalarField;
|
|
167
|
+
channel: _contractspec_lib_schema0.EntityEnumField;
|
|
168
|
+
status: _contractspec_lib_schema0.EntityEnumField;
|
|
169
|
+
attemptedAt: _contractspec_lib_schema0.EntityScalarField;
|
|
170
|
+
deliveredAt: _contractspec_lib_schema0.EntityScalarField;
|
|
171
|
+
responseCode: _contractspec_lib_schema0.EntityScalarField;
|
|
172
|
+
responseMessage: _contractspec_lib_schema0.EntityScalarField;
|
|
173
|
+
externalId: _contractspec_lib_schema0.EntityScalarField;
|
|
174
|
+
metadata: _contractspec_lib_schema0.EntityScalarField;
|
|
175
|
+
notification: _contractspec_lib_schema0.EntityRelationField;
|
|
176
176
|
}>)[];
|
|
177
177
|
/**
|
|
178
178
|
* Module schema contribution for notifications.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/entities/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAWa,cAAA,sBAYX,EAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/entities/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAWa,cAAA,sBAYX,EAAA,yBAAA,CAZiC,aAYjC;AAKF;AAUA;;cAVa,yBAKX,yBAAA,CALkC;;;;cAUvB,8CAAkB;MAyF7B,yBAAA,CAAA;;;;;;;;;;;;;;;;;;;uDAzF6B;EAAA,UAAA,6CAAA;EA8FlB,SAAA,6CAKX;EAKW,SAAA,6CAyCX;EAAA,SAAA,6CAAA;;;;;;cAnDW,0BAKX,yBAAA,CALmC;;;;cAUxB,sDAA0B;MAyCrC,yBAAA,CAAA;;;;;;yDAzCqC;EAAA,SAAA,6CAAA;EA8C1B,SAAA,6CA6CX;EAAA,QAAA,6CAAA;;;;;;;;;;;;cA7CW,wDAA4B;MA6CvC,yBAAA,CAAA,iBA7CuC;EAAA,MAAA,6CAAA;EAkD5B,aAAA,6CAoCX;EAAA,eAAA,6CAAA;;;;;;;;;;;;;AAKF;AAKC,cA9CY,iBA8CZ,4BA9C6B,UA8C7B,CAAA;MAVC,yBAAA,CAAA;;;;;;;;;;;;;;;cAKW,iDAAoB;MAKhC,yBAAA,CAAA;;;;;;;;mDALgC;EAAA,QAAA,6CAAA;;;;;;;;;;;;;;;;;MAAA,yBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUpB,UAAA,6CAAiC;;;;;;;;;;;;;;;;;;;cAAjC,iCAAiC"}
|
|
@@ -9,7 +9,7 @@ const NotificationsFeature = {
|
|
|
9
9
|
title: "Notifications",
|
|
10
10
|
description: "Multi-channel notification delivery with preference management",
|
|
11
11
|
domain: "platform",
|
|
12
|
-
version: 1,
|
|
12
|
+
version: "1.0.0",
|
|
13
13
|
owners: ["@platform.notifications"],
|
|
14
14
|
tags: [
|
|
15
15
|
"notifications",
|
|
@@ -22,31 +22,31 @@ const NotificationsFeature = {
|
|
|
22
22
|
operations: [
|
|
23
23
|
{
|
|
24
24
|
key: "notifications.send",
|
|
25
|
-
version: 1
|
|
25
|
+
version: "1.0.0"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
key: "notifications.markRead",
|
|
29
|
-
version: 1
|
|
29
|
+
version: "1.0.0"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
key: "notifications.markAllRead",
|
|
33
|
-
version: 1
|
|
33
|
+
version: "1.0.0"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
key: "notifications.delete",
|
|
37
|
-
version: 1
|
|
37
|
+
version: "1.0.0"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
key: "notifications.list",
|
|
41
|
-
version: 1
|
|
41
|
+
version: "1.0.0"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
key: "notifications.preferences.update",
|
|
45
|
-
version: 1
|
|
45
|
+
version: "1.0.0"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
key: "notifications.preferences.get",
|
|
49
|
-
version: 1
|
|
49
|
+
version: "1.0.0"
|
|
50
50
|
}
|
|
51
51
|
],
|
|
52
52
|
events: [],
|
|
@@ -56,11 +56,11 @@ const NotificationsFeature = {
|
|
|
56
56
|
capabilities: {
|
|
57
57
|
provides: [{
|
|
58
58
|
key: "notifications",
|
|
59
|
-
version: 1
|
|
59
|
+
version: "1.0.0"
|
|
60
60
|
}],
|
|
61
61
|
requires: [{
|
|
62
62
|
key: "identity",
|
|
63
|
-
version: 1
|
|
63
|
+
version: "1.0.0"
|
|
64
64
|
}]
|
|
65
65
|
}
|
|
66
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.feature.js","names":["NotificationsFeature: FeatureModuleSpec"],"sources":["../src/notifications.feature.ts"],"sourcesContent":["/**\n * Notifications Feature Module Specification\n *\n * Defines the feature module for notification management.\n */\nimport type { FeatureModuleSpec } from '@contractspec/lib.contracts';\n\n/**\n * Notifications feature module that bundles notification sending,\n * listing, marking as read, and preference management capabilities.\n */\nexport const NotificationsFeature: FeatureModuleSpec = {\n meta: {\n key: 'notifications',\n title: 'Notifications',\n description:\n 'Multi-channel notification delivery with preference management',\n domain: 'platform',\n version: 1,\n owners: ['@platform.notifications'],\n tags: ['notifications', 'email', 'push', 'in-app'],\n stability: 'stable',\n },\n\n // All contract operations included in this feature\n operations: [\n { key: 'notifications.send', version: 1 },\n { key: 'notifications.markRead', version: 1 },\n { key: 'notifications.markAllRead', version: 1 },\n { key: 'notifications.delete', version: 1 },\n { key: 'notifications.list', version: 1 },\n { key: 'notifications.preferences.update', version: 1 },\n { key: 'notifications.preferences.get', version: 1 },\n ],\n\n // No events for this feature - it consumes events to send notifications\n events: [],\n\n // No presentations for this module feature\n presentations: [],\n opToPresentation: [],\n presentationsTargets: [],\n\n // Capability definitions\n capabilities: {\n provides: [{ key: 'notifications', version: 1 }],\n requires: [{ key: 'identity', version: 1 }],\n },\n};\n"],"mappings":";;;;;AAWA,MAAaA,uBAA0C;CACrD,MAAM;EACJ,KAAK;EACL,OAAO;EACP,aACE;EACF,QAAQ;EACR,SAAS;EACT,QAAQ,CAAC,0BAA0B;EACnC,MAAM;GAAC;GAAiB;GAAS;GAAQ;GAAS;EAClD,WAAW;EACZ;CAGD,YAAY;EACV;GAAE,KAAK;GAAsB,SAAS;
|
|
1
|
+
{"version":3,"file":"notifications.feature.js","names":["NotificationsFeature: FeatureModuleSpec"],"sources":["../src/notifications.feature.ts"],"sourcesContent":["/**\n * Notifications Feature Module Specification\n *\n * Defines the feature module for notification management.\n */\nimport type { FeatureModuleSpec } from '@contractspec/lib.contracts';\n\n/**\n * Notifications feature module that bundles notification sending,\n * listing, marking as read, and preference management capabilities.\n */\nexport const NotificationsFeature: FeatureModuleSpec = {\n meta: {\n key: 'notifications',\n title: 'Notifications',\n description:\n 'Multi-channel notification delivery with preference management',\n domain: 'platform',\n version: '1.0.0',\n owners: ['@platform.notifications'],\n tags: ['notifications', 'email', 'push', 'in-app'],\n stability: 'stable',\n },\n\n // All contract operations included in this feature\n operations: [\n { key: 'notifications.send', version: '1.0.0' },\n { key: 'notifications.markRead', version: '1.0.0' },\n { key: 'notifications.markAllRead', version: '1.0.0' },\n { key: 'notifications.delete', version: '1.0.0' },\n { key: 'notifications.list', version: '1.0.0' },\n { key: 'notifications.preferences.update', version: '1.0.0' },\n { key: 'notifications.preferences.get', version: '1.0.0' },\n ],\n\n // No events for this feature - it consumes events to send notifications\n events: [],\n\n // No presentations for this module feature\n presentations: [],\n opToPresentation: [],\n presentationsTargets: [],\n\n // Capability definitions\n capabilities: {\n provides: [{ key: 'notifications', version: '1.0.0' }],\n requires: [{ key: 'identity', version: '1.0.0' }],\n },\n};\n"],"mappings":";;;;;AAWA,MAAaA,uBAA0C;CACrD,MAAM;EACJ,KAAK;EACL,OAAO;EACP,aACE;EACF,QAAQ;EACR,SAAS;EACT,QAAQ,CAAC,0BAA0B;EACnC,MAAM;GAAC;GAAiB;GAAS;GAAQ;GAAS;EAClD,WAAW;EACZ;CAGD,YAAY;EACV;GAAE,KAAK;GAAsB,SAAS;GAAS;EAC/C;GAAE,KAAK;GAA0B,SAAS;GAAS;EACnD;GAAE,KAAK;GAA6B,SAAS;GAAS;EACtD;GAAE,KAAK;GAAwB,SAAS;GAAS;EACjD;GAAE,KAAK;GAAsB,SAAS;GAAS;EAC/C;GAAE,KAAK;GAAoC,SAAS;GAAS;EAC7D;GAAE,KAAK;GAAiC,SAAS;GAAS;EAC3D;CAGD,QAAQ,EAAE;CAGV,eAAe,EAAE;CACjB,kBAAkB,EAAE;CACpB,sBAAsB,EAAE;CAGxB,cAAc;EACZ,UAAU,CAAC;GAAE,KAAK;GAAiB,SAAS;GAAS,CAAC;EACtD,UAAU,CAAC;GAAE,KAAK;GAAY,SAAS;GAAS,CAAC;EAClD;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/module.notifications",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.1",
|
|
4
4
|
"description": "Notification center module for ContractSpec applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"lint:check": "eslint src"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@contractspec/lib.schema": "1.
|
|
30
|
-
"@contractspec/lib.contracts": "1.
|
|
31
|
-
"@contractspec/lib.bus": "1.
|
|
29
|
+
"@contractspec/lib.schema": "1.45.1",
|
|
30
|
+
"@contractspec/lib.contracts": "1.45.1",
|
|
31
|
+
"@contractspec/lib.bus": "1.45.1",
|
|
32
32
|
"zod": "^4.1.13"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@contractspec/tool.typescript": "1.
|
|
36
|
-
"@contractspec/tool.tsdown": "1.
|
|
35
|
+
"@contractspec/tool.typescript": "1.45.1",
|
|
36
|
+
"@contractspec/tool.tsdown": "1.45.1",
|
|
37
37
|
"typescript": "^5.9.3"
|
|
38
38
|
},
|
|
39
39
|
"exports": {
|