@lssm/module.notifications 0.0.0-canary-20251217063201 → 0.0.0-canary-20251217072406

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/channels/index.js +126 -1
  2. package/dist/contracts/index.js +436 -1
  3. package/dist/entities/index.js +254 -1
  4. package/dist/index.js +7 -1
  5. package/dist/libs/contracts/dist/capabilities/openbanking.js +88 -1
  6. package/dist/libs/contracts/dist/client/index.js +5 -1
  7. package/dist/libs/contracts/dist/client/react/feature-render.js +2 -1
  8. package/dist/libs/contracts/dist/client/react/form-render.js +4 -1
  9. package/dist/libs/contracts/dist/client/react/index.js +4 -1
  10. package/dist/libs/contracts/dist/contract-registry/index.js +1 -1
  11. package/dist/libs/contracts/dist/contract-registry/schemas.js +60 -1
  12. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -76
  13. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -350
  14. package/dist/libs/contracts/dist/docs/index.js +29 -1
  15. package/dist/libs/contracts/dist/docs/presentations.js +71 -1
  16. package/dist/libs/contracts/dist/docs/registry.js +44 -1
  17. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -383
  18. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -68
  19. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -140
  20. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -86
  21. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -1
  22. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +24 -2
  23. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +21 -2
  24. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -213
  25. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +73 -5
  26. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -1
  27. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -1
  28. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -262
  29. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -1
  30. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +24 -2
  31. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +23 -2
  32. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +25 -16
  33. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -1
  34. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +22 -2
  35. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +40 -36
  36. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -1
  37. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +23 -2
  38. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +36 -3
  39. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -1
  40. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +36 -3
  41. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -1
  42. package/dist/libs/contracts/dist/events.js +1 -1
  43. package/dist/libs/contracts/dist/experiments/evaluator.js +1 -1
  44. package/dist/libs/contracts/dist/index.js +71 -1
  45. package/dist/libs/contracts/dist/install.js +2 -1
  46. package/dist/libs/contracts/dist/integrations/contracts.js +377 -1
  47. package/dist/libs/contracts/dist/integrations/index.js +18 -1
  48. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +228 -1
  49. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +159 -1
  50. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -1
  51. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +210 -1
  52. package/dist/libs/contracts/dist/integrations/openbanking/models.js +242 -1
  53. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +13 -1
  54. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +52 -1
  55. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +75 -1
  56. package/dist/libs/contracts/dist/integrations/providers/gmail.js +87 -1
  57. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +66 -1
  58. package/dist/libs/contracts/dist/integrations/providers/index.js +11 -1
  59. package/dist/libs/contracts/dist/integrations/providers/mistral.js +68 -1
  60. package/dist/libs/contracts/dist/integrations/providers/postmark.js +68 -1
  61. package/dist/libs/contracts/dist/integrations/providers/powens.js +116 -1
  62. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +73 -1
  63. package/dist/libs/contracts/dist/integrations/providers/registry.js +10 -1
  64. package/dist/libs/contracts/dist/integrations/providers/stripe.js +83 -1
  65. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +61 -1
  66. package/dist/libs/contracts/dist/jsonschema.js +1 -1
  67. package/dist/libs/contracts/dist/knowledge/contracts.js +306 -1
  68. package/dist/libs/contracts/dist/knowledge/index.js +7 -1
  69. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +34 -1
  70. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +34 -1
  71. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +38 -1
  72. package/dist/libs/contracts/dist/knowledge/spaces/index.js +6 -1
  73. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +34 -1
  74. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +37 -1
  75. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -1
  76. package/dist/libs/contracts/dist/llm/exporters.js +19 -1
  77. package/dist/libs/contracts/dist/llm/index.js +2 -1
  78. package/dist/libs/contracts/dist/llm/prompts.js +1 -1
  79. package/dist/libs/contracts/dist/onboarding-base.js +196 -1
  80. package/dist/libs/contracts/dist/openapi.js +1 -1
  81. package/dist/libs/contracts/dist/ownership.js +21 -1
  82. package/dist/libs/contracts/dist/presentations.js +1 -1
  83. package/dist/libs/contracts/dist/presentations.v2.js +11 -1
  84. package/dist/libs/contracts/dist/prompt.js +1 -1
  85. package/dist/libs/contracts/dist/promptRegistry.js +1 -1
  86. package/dist/libs/contracts/dist/regenerator/index.js +1 -1
  87. package/dist/libs/contracts/dist/regenerator/service.js +6 -1
  88. package/dist/libs/contracts/dist/registry.js +2 -1
  89. package/dist/libs/contracts/dist/resources.js +1 -1
  90. package/dist/libs/contracts/dist/schema/dist/EnumType.js +2 -1
  91. package/dist/libs/contracts/dist/schema/dist/FieldType.js +49 -1
  92. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +236 -1
  93. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +39 -1
  94. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -1
  95. package/dist/libs/contracts/dist/schema/dist/entity/index.js +2 -1
  96. package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -1
  97. package/dist/libs/contracts/dist/schema/dist/index.js +6 -1
  98. package/dist/libs/contracts/dist/server/graphql-pothos.js +6 -1
  99. package/dist/libs/contracts/dist/server/index.js +8 -1
  100. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +4 -1
  101. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +2 -1
  102. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -1
  103. package/dist/libs/contracts/dist/server/mcp/registerResources.js +2 -1
  104. package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -1
  105. package/dist/libs/contracts/dist/server/provider-mcp.js +1 -1
  106. package/dist/libs/contracts/dist/server/rest-elysia.js +1 -1
  107. package/dist/libs/contracts/dist/server/rest-express.js +1 -1
  108. package/dist/libs/contracts/dist/server/rest-generic.js +1 -1
  109. package/dist/libs/contracts/dist/server/rest-next-app.js +1 -1
  110. package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -1
  111. package/dist/libs/contracts/dist/spec.js +34 -1
  112. package/dist/libs/contracts/dist/telemetry/index.js +1 -1
  113. package/dist/libs/contracts/dist/telemetry/tracker.js +1 -1
  114. package/dist/libs/contracts/dist/tests/index.js +1 -1
  115. package/dist/libs/contracts/dist/tests/runner.js +2 -1
  116. package/dist/libs/contracts/dist/workflow/index.js +1 -1
  117. package/dist/libs/contracts/dist/workflow/runner.js +1 -1
  118. package/dist/libs/schema/dist/EnumType.js +56 -1
  119. package/dist/libs/schema/dist/FieldType.js +49 -1
  120. package/dist/libs/schema/dist/ScalarTypeEnum.js +236 -1
  121. package/dist/libs/schema/dist/SchemaModel.js +3 -1
  122. package/dist/libs/schema/dist/entity/defineEntity.js +236 -1
  123. package/dist/libs/schema/dist/entity/index.js +2 -1
  124. package/dist/libs/schema/dist/entity/types.js +1 -1
  125. package/dist/libs/schema/dist/index.js +6 -1
  126. package/dist/notifications.feature.js +68 -1
  127. package/dist/templates/index.js +195 -3
  128. package/package.json +6 -6
@@ -1 +1,254 @@
1
- import{i as e,n as t,r as n,t as r}from"../libs/schema/dist/entity/defineEntity.js";import"../libs/schema/dist/index.js";const i=t({name:`NotificationStatus`,values:[`PENDING`,`SENT`,`DELIVERED`,`READ`,`FAILED`,`CANCELLED`],schema:`lssm_notifications`,description:`Status of a notification.`}),a=t({name:`NotificationChannel`,values:[`EMAIL`,`IN_APP`,`PUSH`,`WEBHOOK`,`SMS`],schema:`lssm_notifications`,description:`Delivery channel for notifications.`}),o=r({name:`Notification`,description:`An individual notification to be delivered to a user.`,schema:`lssm_notifications`,map:`notification`,fields:{id:n.id({description:`Unique notification ID`}),userId:n.foreignKey({description:`Target user ID`}),orgId:n.string({isOptional:!0,description:`Organization context`}),templateId:n.string({isOptional:!0,description:`Template used`}),title:n.string({description:`Notification title`}),body:n.string({description:`Notification body`}),actionUrl:n.string({isOptional:!0,description:`Action URL`}),imageUrl:n.string({isOptional:!0,description:`Image URL`}),type:n.string({description:`Notification type (e.g., mention, update)`}),category:n.string({isOptional:!0,description:`Notification category`}),priority:n.enum(`NotificationPriority`,{default:`NORMAL`}),channels:n.string({isArray:!0,description:`Target delivery channels`}),status:n.enum(`NotificationStatus`,{default:`PENDING`}),sentAt:n.dateTime({isOptional:!0}),deliveredAt:n.dateTime({isOptional:!0}),readAt:n.dateTime({isOptional:!0}),metadata:n.json({isOptional:!0,description:`Additional metadata`}),variables:n.json({isOptional:!0,description:`Template variables used`}),triggeredBy:n.string({isOptional:!0,description:`Event/action that triggered`}),sourceId:n.string({isOptional:!0,description:`Source entity ID`}),sourceType:n.string({isOptional:!0,description:`Source entity type`}),createdAt:n.createdAt(),updatedAt:n.updatedAt(),expiresAt:n.dateTime({isOptional:!0,description:`Notification expiry`}),deliveryLogs:n.hasMany(`DeliveryLog`)},indexes:[e.on([`userId`,`status`,`createdAt`]),e.on([`userId`,`readAt`]),e.on([`orgId`,`createdAt`]),e.on([`type`,`createdAt`])],enums:[i,a]}),s=t({name:`NotificationPriority`,values:[`LOW`,`NORMAL`,`HIGH`,`URGENT`],schema:`lssm_notifications`,description:`Priority level of a notification.`}),c=r({name:`NotificationTemplate`,description:`Reusable notification template.`,schema:`lssm_notifications`,map:`notification_template`,fields:{id:n.id(),templateId:n.string({isUnique:!0,description:`Template identifier`}),name:n.string({description:`Template display name`}),description:n.string({isOptional:!0}),emailSubject:n.string({isOptional:!0}),emailBody:n.string({isOptional:!0}),inAppTitle:n.string({isOptional:!0}),inAppBody:n.string({isOptional:!0}),pushTitle:n.string({isOptional:!0}),pushBody:n.string({isOptional:!0}),defaultChannels:n.string({isArray:!0}),category:n.string({isOptional:!0}),priority:n.enum(`NotificationPriority`,{default:`NORMAL`}),variablesSchema:n.json({isOptional:!0,description:`JSON schema for variables`}),enabled:n.boolean({default:!0}),createdAt:n.createdAt(),updatedAt:n.updatedAt()},enums:[s]}),l=r({name:`NotificationPreference`,description:`User notification preferences by type and channel.`,schema:`lssm_notifications`,map:`notification_preference`,fields:{id:n.id(),userId:n.foreignKey(),globalEnabled:n.boolean({default:!0}),quietHoursStart:n.string({isOptional:!0,description:`Quiet hours start (HH:MM)`}),quietHoursEnd:n.string({isOptional:!0,description:`Quiet hours end (HH:MM)`}),timezone:n.string({default:`"UTC"`}),channelPreferences:n.json({description:`Channel-level preferences`}),typePreferences:n.json({description:`Type-level preferences`}),digestEnabled:n.boolean({default:!1}),digestFrequency:n.string({isOptional:!0,description:`daily, weekly, etc.`}),digestTime:n.string({isOptional:!0,description:`Digest send time (HH:MM)`}),createdAt:n.createdAt(),updatedAt:n.updatedAt()},indexes:[e.unique([`userId`])]}),u=r({name:`DeliveryLog`,description:`Log of notification delivery attempts.`,schema:`lssm_notifications`,map:`delivery_log`,fields:{id:n.id(),notificationId:n.foreignKey(),channel:n.enum(`NotificationChannel`),status:n.enum(`NotificationStatus`),attemptedAt:n.dateTime(),deliveredAt:n.dateTime({isOptional:!0}),responseCode:n.string({isOptional:!0}),responseMessage:n.string({isOptional:!0}),externalId:n.string({isOptional:!0,description:`Provider message ID`}),metadata:n.json({isOptional:!0}),notification:n.belongsTo(`Notification`,[`notificationId`],[`id`],{onDelete:`Cascade`})},indexes:[e.on([`notificationId`,`channel`])]}),d=[o,c,l,u],f={moduleId:`@lssm/module.notifications`,entities:d,enums:[i,a,s]};export{u as DeliveryLogEntity,a as NotificationChannelEnum,o as NotificationEntity,l as NotificationPreferenceEntity,s as NotificationPriorityEnum,i as NotificationStatusEnum,c as NotificationTemplateEntity,d as notificationEntities,f as notificationsSchemaContribution};
1
+ import { defineEntity, defineEntityEnum, field, index } from "../libs/schema/dist/entity/defineEntity.js";
2
+ import "../libs/schema/dist/index.js";
3
+
4
+ //#region src/entities/index.ts
5
+ /**
6
+ * Notification status enum.
7
+ */
8
+ const NotificationStatusEnum = defineEntityEnum({
9
+ name: "NotificationStatus",
10
+ values: [
11
+ "PENDING",
12
+ "SENT",
13
+ "DELIVERED",
14
+ "READ",
15
+ "FAILED",
16
+ "CANCELLED"
17
+ ],
18
+ schema: "lssm_notifications",
19
+ description: "Status of a notification."
20
+ });
21
+ /**
22
+ * Notification channel enum.
23
+ */
24
+ const NotificationChannelEnum = defineEntityEnum({
25
+ name: "NotificationChannel",
26
+ values: [
27
+ "EMAIL",
28
+ "IN_APP",
29
+ "PUSH",
30
+ "WEBHOOK",
31
+ "SMS"
32
+ ],
33
+ schema: "lssm_notifications",
34
+ description: "Delivery channel for notifications."
35
+ });
36
+ /**
37
+ * Notification entity - individual notification instance.
38
+ */
39
+ const NotificationEntity = defineEntity({
40
+ name: "Notification",
41
+ description: "An individual notification to be delivered to a user.",
42
+ schema: "lssm_notifications",
43
+ map: "notification",
44
+ fields: {
45
+ id: field.id({ description: "Unique notification ID" }),
46
+ userId: field.foreignKey({ description: "Target user ID" }),
47
+ orgId: field.string({
48
+ isOptional: true,
49
+ description: "Organization context"
50
+ }),
51
+ templateId: field.string({
52
+ isOptional: true,
53
+ description: "Template used"
54
+ }),
55
+ title: field.string({ description: "Notification title" }),
56
+ body: field.string({ description: "Notification body" }),
57
+ actionUrl: field.string({
58
+ isOptional: true,
59
+ description: "Action URL"
60
+ }),
61
+ imageUrl: field.string({
62
+ isOptional: true,
63
+ description: "Image URL"
64
+ }),
65
+ type: field.string({ description: "Notification type (e.g., mention, update)" }),
66
+ category: field.string({
67
+ isOptional: true,
68
+ description: "Notification category"
69
+ }),
70
+ priority: field.enum("NotificationPriority", { default: "NORMAL" }),
71
+ channels: field.string({
72
+ isArray: true,
73
+ description: "Target delivery channels"
74
+ }),
75
+ status: field.enum("NotificationStatus", { default: "PENDING" }),
76
+ sentAt: field.dateTime({ isOptional: true }),
77
+ deliveredAt: field.dateTime({ isOptional: true }),
78
+ readAt: field.dateTime({ isOptional: true }),
79
+ metadata: field.json({
80
+ isOptional: true,
81
+ description: "Additional metadata"
82
+ }),
83
+ variables: field.json({
84
+ isOptional: true,
85
+ description: "Template variables used"
86
+ }),
87
+ triggeredBy: field.string({
88
+ isOptional: true,
89
+ description: "Event/action that triggered"
90
+ }),
91
+ sourceId: field.string({
92
+ isOptional: true,
93
+ description: "Source entity ID"
94
+ }),
95
+ sourceType: field.string({
96
+ isOptional: true,
97
+ description: "Source entity type"
98
+ }),
99
+ createdAt: field.createdAt(),
100
+ updatedAt: field.updatedAt(),
101
+ expiresAt: field.dateTime({
102
+ isOptional: true,
103
+ description: "Notification expiry"
104
+ }),
105
+ deliveryLogs: field.hasMany("DeliveryLog")
106
+ },
107
+ indexes: [
108
+ index.on([
109
+ "userId",
110
+ "status",
111
+ "createdAt"
112
+ ]),
113
+ index.on(["userId", "readAt"]),
114
+ index.on(["orgId", "createdAt"]),
115
+ index.on(["type", "createdAt"])
116
+ ],
117
+ enums: [NotificationStatusEnum, NotificationChannelEnum]
118
+ });
119
+ /**
120
+ * Notification priority enum.
121
+ */
122
+ const NotificationPriorityEnum = defineEntityEnum({
123
+ name: "NotificationPriority",
124
+ values: [
125
+ "LOW",
126
+ "NORMAL",
127
+ "HIGH",
128
+ "URGENT"
129
+ ],
130
+ schema: "lssm_notifications",
131
+ description: "Priority level of a notification."
132
+ });
133
+ /**
134
+ * NotificationTemplate entity - reusable notification templates.
135
+ */
136
+ const NotificationTemplateEntity = defineEntity({
137
+ name: "NotificationTemplate",
138
+ description: "Reusable notification template.",
139
+ schema: "lssm_notifications",
140
+ map: "notification_template",
141
+ fields: {
142
+ id: field.id(),
143
+ templateId: field.string({
144
+ isUnique: true,
145
+ description: "Template identifier"
146
+ }),
147
+ name: field.string({ description: "Template display name" }),
148
+ description: field.string({ isOptional: true }),
149
+ emailSubject: field.string({ isOptional: true }),
150
+ emailBody: field.string({ isOptional: true }),
151
+ inAppTitle: field.string({ isOptional: true }),
152
+ inAppBody: field.string({ isOptional: true }),
153
+ pushTitle: field.string({ isOptional: true }),
154
+ pushBody: field.string({ isOptional: true }),
155
+ defaultChannels: field.string({ isArray: true }),
156
+ category: field.string({ isOptional: true }),
157
+ priority: field.enum("NotificationPriority", { default: "NORMAL" }),
158
+ variablesSchema: field.json({
159
+ isOptional: true,
160
+ description: "JSON schema for variables"
161
+ }),
162
+ enabled: field.boolean({ default: true }),
163
+ createdAt: field.createdAt(),
164
+ updatedAt: field.updatedAt()
165
+ },
166
+ enums: [NotificationPriorityEnum]
167
+ });
168
+ /**
169
+ * NotificationPreference entity - user notification preferences.
170
+ */
171
+ const NotificationPreferenceEntity = defineEntity({
172
+ name: "NotificationPreference",
173
+ description: "User notification preferences by type and channel.",
174
+ schema: "lssm_notifications",
175
+ map: "notification_preference",
176
+ fields: {
177
+ id: field.id(),
178
+ userId: field.foreignKey(),
179
+ globalEnabled: field.boolean({ default: true }),
180
+ quietHoursStart: field.string({
181
+ isOptional: true,
182
+ description: "Quiet hours start (HH:MM)"
183
+ }),
184
+ quietHoursEnd: field.string({
185
+ isOptional: true,
186
+ description: "Quiet hours end (HH:MM)"
187
+ }),
188
+ timezone: field.string({ default: "\"UTC\"" }),
189
+ channelPreferences: field.json({ description: "Channel-level preferences" }),
190
+ typePreferences: field.json({ description: "Type-level preferences" }),
191
+ digestEnabled: field.boolean({ default: false }),
192
+ digestFrequency: field.string({
193
+ isOptional: true,
194
+ description: "daily, weekly, etc."
195
+ }),
196
+ digestTime: field.string({
197
+ isOptional: true,
198
+ description: "Digest send time (HH:MM)"
199
+ }),
200
+ createdAt: field.createdAt(),
201
+ updatedAt: field.updatedAt()
202
+ },
203
+ indexes: [index.unique(["userId"])]
204
+ });
205
+ /**
206
+ * DeliveryLog entity - track delivery attempts per channel.
207
+ */
208
+ const DeliveryLogEntity = defineEntity({
209
+ name: "DeliveryLog",
210
+ description: "Log of notification delivery attempts.",
211
+ schema: "lssm_notifications",
212
+ map: "delivery_log",
213
+ fields: {
214
+ id: field.id(),
215
+ notificationId: field.foreignKey(),
216
+ channel: field.enum("NotificationChannel"),
217
+ status: field.enum("NotificationStatus"),
218
+ attemptedAt: field.dateTime(),
219
+ deliveredAt: field.dateTime({ isOptional: true }),
220
+ responseCode: field.string({ isOptional: true }),
221
+ responseMessage: field.string({ isOptional: true }),
222
+ externalId: field.string({
223
+ isOptional: true,
224
+ description: "Provider message ID"
225
+ }),
226
+ metadata: field.json({ isOptional: true }),
227
+ notification: field.belongsTo("Notification", ["notificationId"], ["id"], { onDelete: "Cascade" })
228
+ },
229
+ indexes: [index.on(["notificationId", "channel"])]
230
+ });
231
+ /**
232
+ * All notification entities for schema composition.
233
+ */
234
+ const notificationEntities = [
235
+ NotificationEntity,
236
+ NotificationTemplateEntity,
237
+ NotificationPreferenceEntity,
238
+ DeliveryLogEntity
239
+ ];
240
+ /**
241
+ * Module schema contribution for notifications.
242
+ */
243
+ const notificationsSchemaContribution = {
244
+ moduleId: "@lssm/module.notifications",
245
+ entities: notificationEntities,
246
+ enums: [
247
+ NotificationStatusEnum,
248
+ NotificationChannelEnum,
249
+ NotificationPriorityEnum
250
+ ]
251
+ };
252
+
253
+ //#endregion
254
+ export { DeliveryLogEntity, NotificationChannelEnum, NotificationEntity, NotificationPreferenceEntity, NotificationPriorityEnum, NotificationStatusEnum, NotificationTemplateEntity, notificationEntities, notificationsSchemaContribution };
package/dist/index.js CHANGED
@@ -1 +1,7 @@
1
- import{DeliveryLogEntity as e,NotificationChannelEnum as t,NotificationEntity as n,NotificationPreferenceEntity as r,NotificationPriorityEnum as i,NotificationStatusEnum as a,NotificationTemplateEntity as o,notificationEntities as s,notificationsSchemaContribution as c}from"./entities/index.js";import{DeleteNotificationContract as l,GetNotificationPreferencesContract as u,ListNotificationsContract as d,ListNotificationsInputModel as f,ListNotificationsOutputModel as p,MarkAllNotificationsReadContract as m,MarkNotificationReadContract as h,NotificationFilterEnum as g,NotificationModel as _,NotificationPreferenceModel as v,SendNotificationContract as y,SendNotificationInputModel as b,UpdateNotificationPreferencesContract as x,UpdatePreferencesInputModel as S}from"./contracts/index.js";import{ChannelRegistry as C,ConsoleChannel as w,EmailChannel as T,InAppChannel as E,PushChannel as D,WebhookChannel as O,createChannelRegistry as k}from"./channels/index.js";import{MentionTemplate as A,OrgInviteTemplate as j,TemplateRegistry as M,WelcomeTemplate as N,createTemplateRegistry as P,defineTemplate as F,renderNotificationTemplate as I,renderTemplate as L}from"./templates/index.js";import{NotificationsFeature as R}from"./notifications.feature.js";export{C as ChannelRegistry,w as ConsoleChannel,l as DeleteNotificationContract,e as DeliveryLogEntity,T as EmailChannel,u as GetNotificationPreferencesContract,E as InAppChannel,d as ListNotificationsContract,f as ListNotificationsInputModel,p as ListNotificationsOutputModel,m as MarkAllNotificationsReadContract,h as MarkNotificationReadContract,A as MentionTemplate,t as NotificationChannelEnum,n as NotificationEntity,g as NotificationFilterEnum,_ as NotificationModel,r as NotificationPreferenceEntity,v as NotificationPreferenceModel,i as NotificationPriorityEnum,a as NotificationStatusEnum,o as NotificationTemplateEntity,R as NotificationsFeature,j as OrgInviteTemplate,D as PushChannel,y as SendNotificationContract,b as SendNotificationInputModel,M as TemplateRegistry,x as UpdateNotificationPreferencesContract,S as UpdatePreferencesInputModel,O as WebhookChannel,N as WelcomeTemplate,k as createChannelRegistry,P as createTemplateRegistry,F as defineTemplate,s as notificationEntities,c as notificationsSchemaContribution,I as renderNotificationTemplate,L as renderTemplate};
1
+ import { DeliveryLogEntity, NotificationChannelEnum, NotificationEntity, NotificationPreferenceEntity, NotificationPriorityEnum, NotificationStatusEnum, NotificationTemplateEntity, notificationEntities, notificationsSchemaContribution } from "./entities/index.js";
2
+ import { DeleteNotificationContract, GetNotificationPreferencesContract, ListNotificationsContract, ListNotificationsInputModel, ListNotificationsOutputModel, MarkAllNotificationsReadContract, MarkNotificationReadContract, NotificationFilterEnum, NotificationModel, NotificationPreferenceModel, SendNotificationContract, SendNotificationInputModel, UpdateNotificationPreferencesContract, UpdatePreferencesInputModel } from "./contracts/index.js";
3
+ import { ChannelRegistry, ConsoleChannel, EmailChannel, InAppChannel, PushChannel, WebhookChannel, createChannelRegistry } from "./channels/index.js";
4
+ import { MentionTemplate, OrgInviteTemplate, TemplateRegistry, WelcomeTemplate, createTemplateRegistry, defineTemplate, renderNotificationTemplate, renderTemplate } from "./templates/index.js";
5
+ import { NotificationsFeature } from "./notifications.feature.js";
6
+
7
+ export { ChannelRegistry, ConsoleChannel, DeleteNotificationContract, DeliveryLogEntity, EmailChannel, GetNotificationPreferencesContract, InAppChannel, ListNotificationsContract, ListNotificationsInputModel, ListNotificationsOutputModel, MarkAllNotificationsReadContract, MarkNotificationReadContract, MentionTemplate, NotificationChannelEnum, NotificationEntity, NotificationFilterEnum, NotificationModel, NotificationPreferenceEntity, NotificationPreferenceModel, NotificationPriorityEnum, NotificationStatusEnum, NotificationTemplateEntity, NotificationsFeature, OrgInviteTemplate, PushChannel, SendNotificationContract, SendNotificationInputModel, TemplateRegistry, UpdateNotificationPreferencesContract, UpdatePreferencesInputModel, WebhookChannel, WelcomeTemplate, createChannelRegistry, createTemplateRegistry, defineTemplate, notificationEntities, notificationsSchemaContribution, renderNotificationTemplate, renderTemplate };
@@ -1 +1,88 @@
1
- import{e}from"../ownership.js";const t=[`platform.finance`],n=[`open-banking`,`finance`];[...t],[...n],e.Experimental,[...t],[...n],e.Experimental,[...t],[...n],e.Experimental;
1
+ import { StabilityEnum } from "../ownership.js";
2
+
3
+ //#region ../../libs/contracts/dist/capabilities/openbanking.js
4
+ const OWNERS = ["platform.finance"];
5
+ const TAGS = ["open-banking", "finance"];
6
+ const openBankingAccountsReadCapability = {
7
+ meta: {
8
+ key: "openbanking.accounts.read",
9
+ version: 1,
10
+ kind: "integration",
11
+ title: "Open Banking Accounts (Read)",
12
+ description: "Provides read-only access to linked bank accounts, including account summaries and metadata.",
13
+ domain: "finance",
14
+ owners: [...OWNERS],
15
+ tags: [...TAGS],
16
+ stability: StabilityEnum.Experimental
17
+ },
18
+ provides: [
19
+ {
20
+ surface: "operation",
21
+ name: "openbanking.accounts.list",
22
+ version: 1,
23
+ description: "List bank accounts linked to a Powens open banking connection."
24
+ },
25
+ {
26
+ surface: "operation",
27
+ name: "openbanking.accounts.get",
28
+ version: 1,
29
+ description: "Retrieve the canonical bank account record for a specific account."
30
+ },
31
+ {
32
+ surface: "operation",
33
+ name: "openbanking.accounts.sync",
34
+ version: 1,
35
+ description: "Trigger a refresh of bank account metadata from the open banking provider."
36
+ }
37
+ ]
38
+ };
39
+ const openBankingTransactionsReadCapability = {
40
+ meta: {
41
+ key: "openbanking.transactions.read",
42
+ version: 1,
43
+ kind: "integration",
44
+ title: "Open Banking Transactions (Read)",
45
+ description: "Enables retrieval of transaction history for linked bank accounts via open banking providers.",
46
+ domain: "finance",
47
+ owners: [...OWNERS],
48
+ tags: [...TAGS, "transactions"],
49
+ stability: StabilityEnum.Experimental
50
+ },
51
+ provides: [{
52
+ surface: "operation",
53
+ name: "openbanking.transactions.list",
54
+ version: 1,
55
+ description: "List transactions for a given bank account with optional date filtering."
56
+ }, {
57
+ surface: "operation",
58
+ name: "openbanking.transactions.sync",
59
+ version: 1,
60
+ description: "Synchronise transactions from the open banking provider into the canonical ledger."
61
+ }]
62
+ };
63
+ const openBankingBalancesReadCapability = {
64
+ meta: {
65
+ key: "openbanking.balances.read",
66
+ version: 1,
67
+ kind: "integration",
68
+ title: "Open Banking Balances (Read)",
69
+ description: "Allows querying of current and available balances for linked bank accounts via open banking providers.",
70
+ domain: "finance",
71
+ owners: [...OWNERS],
72
+ tags: [...TAGS, "balances"],
73
+ stability: StabilityEnum.Experimental
74
+ },
75
+ provides: [{
76
+ surface: "operation",
77
+ name: "openbanking.balances.get",
78
+ version: 1,
79
+ description: "Retrieve the latest known balances for a specified bank account."
80
+ }, {
81
+ surface: "operation",
82
+ name: "openbanking.balances.refresh",
83
+ version: 1,
84
+ description: "Force a balance refresh from the open banking provider."
85
+ }]
86
+ };
87
+
88
+ //#endregion
@@ -1 +1,5 @@
1
- "use client";import"./react/feature-render.js";import"./react/form-render.js";import"./react/index.js";
1
+ 'use client';
2
+
3
+ import "./react/feature-render.js";
4
+ import "./react/form-render.js";
5
+ import "./react/index.js";
@@ -1 +1,2 @@
1
- import"../../presentations.v2.js";import"react";
1
+ import "../../presentations.v2.js";
2
+ import "react";
@@ -1 +1,4 @@
1
- import"react";import"react-hook-form";import"@hookform/resolvers/zod";import"react/jsx-runtime";
1
+ import "react";
2
+ import "react-hook-form";
3
+ import "@hookform/resolvers/zod";
4
+ import "react/jsx-runtime";
@@ -1 +1,4 @@
1
- "use client";import"./feature-render.js";import"./form-render.js";
1
+ 'use client';
2
+
3
+ import "./feature-render.js";
4
+ import "./form-render.js";
@@ -1 +1 @@
1
- import{i as e,n as t,r as n}from"./schemas.js";
1
+ import { ContractRegistryFileSchema, ContractRegistryItemSchema, ContractRegistryItemTypeSchema } from "./schemas.js";
@@ -1 +1,60 @@
1
- import{e}from"../ownership.js";import t from"zod";const n=t.enum([`contractspec:operation`,`contractspec:event`,`contractspec:presentation`,`contractspec:form`,`contractspec:feature`,`contractspec:workflow`,`contractspec:template`,`contractspec:integration`,`contractspec:data-view`,`contractspec:migration`,`contractspec:telemetry`,`contractspec:experiment`,`contractspec:app-config`,`contractspec:knowledge`]),r=t.object({path:t.string().min(1),type:t.string().min(1),content:t.string().optional()}),i=t.object({name:t.string().min(1),type:n,version:t.number().int().nonnegative(),title:t.string().min(1),description:t.string().min(1),meta:t.object({stability:t.enum([e.Idea,e.InCreation,e.Experimental,e.Beta,e.Stable,e.Deprecated]),owners:t.array(t.string().min(1)).default([]),tags:t.array(t.string().min(1)).default([])}),dependencies:t.array(t.string().min(1)).optional(),registryDependencies:t.array(t.string().min(1)).optional(),files:t.array(r).min(1),schema:t.object({input:t.unknown().optional(),output:t.unknown().optional()}).optional()});t.object({$schema:t.string().min(1).optional(),name:t.string().min(1),homepage:t.string().min(1).optional(),items:t.array(i)});export{i,n,r};
1
+ import { StabilityEnum } from "../ownership.js";
2
+ import z from "zod";
3
+
4
+ //#region ../../libs/contracts/dist/contract-registry/schemas.js
5
+ const ContractRegistryItemTypeSchema = z.enum([
6
+ "contractspec:operation",
7
+ "contractspec:event",
8
+ "contractspec:presentation",
9
+ "contractspec:form",
10
+ "contractspec:feature",
11
+ "contractspec:workflow",
12
+ "contractspec:template",
13
+ "contractspec:integration",
14
+ "contractspec:data-view",
15
+ "contractspec:migration",
16
+ "contractspec:telemetry",
17
+ "contractspec:experiment",
18
+ "contractspec:app-config",
19
+ "contractspec:knowledge"
20
+ ]);
21
+ const ContractRegistryFileSchema = z.object({
22
+ path: z.string().min(1),
23
+ type: z.string().min(1),
24
+ content: z.string().optional()
25
+ });
26
+ const ContractRegistryItemSchema = z.object({
27
+ name: z.string().min(1),
28
+ type: ContractRegistryItemTypeSchema,
29
+ version: z.number().int().nonnegative(),
30
+ title: z.string().min(1),
31
+ description: z.string().min(1),
32
+ meta: z.object({
33
+ stability: z.enum([
34
+ StabilityEnum.Idea,
35
+ StabilityEnum.InCreation,
36
+ StabilityEnum.Experimental,
37
+ StabilityEnum.Beta,
38
+ StabilityEnum.Stable,
39
+ StabilityEnum.Deprecated
40
+ ]),
41
+ owners: z.array(z.string().min(1)).default([]),
42
+ tags: z.array(z.string().min(1)).default([])
43
+ }),
44
+ dependencies: z.array(z.string().min(1)).optional(),
45
+ registryDependencies: z.array(z.string().min(1)).optional(),
46
+ files: z.array(ContractRegistryFileSchema).min(1),
47
+ schema: z.object({
48
+ input: z.unknown().optional(),
49
+ output: z.unknown().optional()
50
+ }).optional()
51
+ });
52
+ const ContractRegistryManifestSchema = z.object({
53
+ $schema: z.string().min(1).optional(),
54
+ name: z.string().min(1),
55
+ homepage: z.string().min(1).optional(),
56
+ items: z.array(ContractRegistryItemSchema)
57
+ });
58
+
59
+ //#endregion
60
+ export { ContractRegistryFileSchema, ContractRegistryItemSchema, ContractRegistryItemTypeSchema };
@@ -1,76 +1,16 @@
1
- import{a as e}from"./registry.js";e([{id:`docs.PUBLISHING`,title:`Publishing ContractSpec Libraries`,summary:`This guide describes how we release the ContractSpec libraries to npm. We use a dual-track release system: **Stable** (manual) and **Canary** (automatic).`,kind:`reference`,visibility:`public`,route:`/docs/PUBLISHING`,tags:[`PUBLISHING`],body:`# Publishing ContractSpec Libraries
2
-
3
- This guide describes how we release the ContractSpec libraries to npm. We use a dual-track release system: **Stable** (manual) and **Canary** (automatic).
4
-
5
- ## Release Tracks
6
-
7
- | Track | Branch | npm Tag | Frequency | Versioning | Use Case |
8
- |-------|--------|---------|-----------|------------|----------|
9
- | **Stable** | \`release\` | \`latest\` | Manual | SemVer (e.g., \`1.7.4\`) | Production, external users |
10
- | **Canary** | \`main\` | \`canary\` | Every Push | Snapshot (e.g., \`1.7.4-canary...\`) | Dev, internal testing |
11
-
12
- ## Prerequisites
13
-
14
- - ✅ \`NPM_TOKEN\` secret is configured in GitHub (owner or automation token with _publish_ scope).
15
- - ✅ \`GITHUB_TOKEN\` (built-in) has permissions to create PRs (enabled by default in new repos).
16
- - ✅ For stable releases: \`release\` branch exists and is protected.
17
-
18
- ## Canary Workflow (Automatic)
19
-
20
- Every commit pushed to \`main\` triggers the \`.github/workflows/publish-canary.yml\` workflow.
21
-
22
- 1. **Trigger**: Push to \`main\`.
23
- 2. **Versioning**: Runs \`changeset version --snapshot canary\` to generate a temporary snapshot version.
24
- 3. **Publish**: Packages are published to npm with the \`canary\` tag using \`changeset publish --tag canary\`.
25
-
26
- ### Consuming Canary Builds
27
-
28
- To install the latest bleeding-edge version:
29
-
30
- \`\`\`bash
31
- npm install @lssm/lib.contracts@canary
32
- # or
33
- bun add @lssm/lib.contracts@canary
34
- \`\`\`
35
-
36
- ## Stable Release Workflow (Manual)
37
-
38
- Stable releases are managed via the \`release\` branch using the standard [Changesets Action](https://github.com/changesets/action).
39
-
40
- 1. **Develop on \`main\`**: Create features and fixes.
41
- 2. **Add Changesets**: Run \`bun changeset\` to document changes and impact (major/minor/patch).
42
- 3. **Merge to \`release\`**: When ready to ship, open a PR from \`main\` to \`release\` or merge manually.
43
- 4. **"Version Packages" PR**:
44
- - The GitHub Action detects new changesets and automatically creates a Pull Request titled **"Version Packages"**.
45
- - This PR contains the version bumps and updated \`CHANGELOG.md\` files.
46
- 5. **Merge & Publish**:
47
- - Review and merge the "Version Packages" PR.
48
- - The Action runs again, detects the versions have been bumped, builds the libraries, and publishes them to npm with the \`latest\` tag.
49
-
50
- ### Publishing Steps
51
-
52
- 1. Ensure all changesets are present on \`main\`.
53
- 2. Merge \`main\` into \`release\`:
54
- \`\`\`bash
55
- git checkout release
56
- git pull origin release
57
- git merge main
58
- git push origin release
59
- \`\`\`
60
- 3. Go to GitHub Pull Requests. You will see a **"Version Packages"** PR created by the bot.
61
- 4. Merge that PR.
62
- 5. The release is now live on npm!
63
-
64
- ## Manual Verification (Optional)
65
-
66
- Before publishing a new version you can run:
67
-
68
- \`\`\`bash
69
- bun run build:not-apps
70
- npx npm-packlist --json packages/libs/contracts
71
- \`\`\`
72
-
73
- ## Rollback
74
-
75
- If a publish fails mid-way, re-run the workflow once the issue is fixed. Already published packages are skipped automatically. Use \`npm deprecate <package>@<version>\` if we need to warn consumers about a broken release.
76
- `}]);
1
+ import { registerDocBlocks } from "./registry.js";
2
+
3
+ //#region ../../libs/contracts/dist/docs/PUBLISHING.docblock.js
4
+ const PUBLISHING_DocBlocks = [{
5
+ id: "docs.PUBLISHING",
6
+ title: "Publishing ContractSpec Libraries",
7
+ summary: "This guide describes how we release the ContractSpec libraries to npm. We use a dual-track release system: **Stable** (manual) and **Canary** (automatic).",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/PUBLISHING",
11
+ tags: ["PUBLISHING"],
12
+ body: "# Publishing ContractSpec Libraries\n\nThis guide describes how we release the ContractSpec libraries to npm. We use a dual-track release system: **Stable** (manual) and **Canary** (automatic).\n\n## Release Tracks\n\n| Track | Branch | npm Tag | Frequency | Versioning | Use Case |\n|-------|--------|---------|-----------|------------|----------|\n| **Stable** | `release` | `latest` | Manual | SemVer (e.g., `1.7.4`) | Production, external users |\n| **Canary** | `main` | `canary` | Every Push | Snapshot (e.g., `1.7.4-canary...`) | Dev, internal testing |\n\n## Prerequisites\n\n- ✅ `NPM_TOKEN` secret is configured in GitHub (owner or automation token with _publish_ scope).\n- ✅ `GITHUB_TOKEN` (built-in) has permissions to create PRs (enabled by default in new repos).\n- ✅ For stable releases: `release` branch exists and is protected.\n\n## Canary Workflow (Automatic)\n\nEvery commit pushed to `main` triggers the `.github/workflows/publish-canary.yml` workflow.\n\n1. **Trigger**: Push to `main`.\n2. **Versioning**: Runs `changeset version --snapshot canary` to generate a temporary snapshot version.\n3. **Publish**: Packages are published to npm with the `canary` tag using `changeset publish --tag canary`.\n\n### Consuming Canary Builds\n\nTo install the latest bleeding-edge version:\n\n```bash\nnpm install @lssm/lib.contracts@canary\n# or\nbun add @lssm/lib.contracts@canary\n```\n\n## Stable Release Workflow (Manual)\n\nStable releases are managed via the `release` branch using the standard [Changesets Action](https://github.com/changesets/action).\n\n1. **Develop on `main`**: Create features and fixes.\n2. **Add Changesets**: Run `bun changeset` to document changes and impact (major/minor/patch).\n3. **Merge to `release`**: When ready to ship, open a PR from `main` to `release` or merge manually.\n4. **\"Version Packages\" PR**:\n - The GitHub Action detects new changesets and automatically creates a Pull Request titled **\"Version Packages\"**.\n - This PR contains the version bumps and updated `CHANGELOG.md` files.\n5. **Merge & Publish**:\n - Review and merge the \"Version Packages\" PR.\n - The Action runs again, detects the versions have been bumped, builds the libraries, and publishes them to npm with the `latest` tag.\n\n### Publishing Steps\n\n1. Ensure all changesets are present on `main`.\n2. Merge `main` into `release`:\n ```bash\n git checkout release\n git pull origin release\n git merge main\n git push origin release\n ```\n3. Go to GitHub Pull Requests. You will see a **\"Version Packages\"** PR created by the bot.\n4. Merge that PR.\n5. The release is now live on npm!\n\n## Manual Verification (Optional)\n\nBefore publishing a new version you can run:\n\n```bash\nbun run build:not-apps\nnpx npm-packlist --json packages/libs/contracts\n```\n\n## Rollback\n\nIf a publish fails mid-way, re-run the workflow once the issue is fixed. Already published packages are skipped automatically. Use `npm deprecate <package>@<version>` if we need to warn consumers about a broken release.\n"
13
+ }];
14
+ registerDocBlocks(PUBLISHING_DocBlocks);
15
+
16
+ //#endregion