@contractspec/module.notifications 1.44.0 → 1.45.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.
@@ -319,7 +319,7 @@ declare const SendNotificationContract: _contractspec_lib_contracts0.OperationSp
319
319
  };
320
320
  }>, {
321
321
  key: string;
322
- version: number;
322
+ version: string;
323
323
  when: string;
324
324
  payload: _contractspec_lib_schema0.SchemaModel<{
325
325
  id: {
@@ -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;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;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"}
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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P,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"}
@@ -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;GAAG;EACzC;GAAE,KAAK;GAA0B,SAAS;GAAG;EAC7C;GAAE,KAAK;GAA6B,SAAS;GAAG;EAChD;GAAE,KAAK;GAAwB,SAAS;GAAG;EAC3C;GAAE,KAAK;GAAsB,SAAS;GAAG;EACzC;GAAE,KAAK;GAAoC,SAAS;GAAG;EACvD;GAAE,KAAK;GAAiC,SAAS;GAAG;EACrD;CAGD,QAAQ,EAAE;CAGV,eAAe,EAAE;CACjB,kBAAkB,EAAE;CACpB,sBAAsB,EAAE;CAGxB,cAAc;EACZ,UAAU,CAAC;GAAE,KAAK;GAAiB,SAAS;GAAG,CAAC;EAChD,UAAU,CAAC;GAAE,KAAK;GAAY,SAAS;GAAG,CAAC;EAC5C;CACF"}
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,7 +1,15 @@
1
1
  {
2
2
  "name": "@contractspec/module.notifications",
3
- "version": "1.44.0",
3
+ "version": "1.45.0",
4
4
  "description": "Notification center module for ContractSpec applications",
5
+ "keywords": [
6
+ "contractspec",
7
+ "notifications",
8
+ "messaging",
9
+ "channels",
10
+ "email",
11
+ "typescript"
12
+ ],
5
13
  "main": "./dist/index.js",
6
14
  "types": "./dist/index.d.ts",
7
15
  "type": "module",
@@ -18,14 +26,14 @@
18
26
  "lint:check": "eslint src"
19
27
  },
20
28
  "dependencies": {
21
- "@contractspec/lib.schema": "1.44.0",
22
- "@contractspec/lib.contracts": "1.44.0",
23
- "@contractspec/lib.bus": "1.44.0",
29
+ "@contractspec/lib.schema": "1.45.0",
30
+ "@contractspec/lib.contracts": "1.45.0",
31
+ "@contractspec/lib.bus": "1.45.0",
24
32
  "zod": "^4.1.13"
25
33
  },
26
34
  "devDependencies": {
27
- "@contractspec/tool.typescript": "1.44.0",
28
- "@contractspec/tool.tsdown": "1.44.0",
35
+ "@contractspec/tool.typescript": "1.45.0",
36
+ "@contractspec/tool.tsdown": "1.45.0",
29
37
  "typescript": "^5.9.3"
30
38
  },
31
39
  "exports": {