@lssm/lib.feature-flags 0.0.0-canary-20251217080011 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/dist/contracts/index.js +1 -910
  2. package/dist/docs/feature-flags.docblock.js +2 -21
  3. package/dist/docs/index.js +1 -1
  4. package/dist/entities/index.js +1 -325
  5. package/dist/evaluation/index.js +1 -220
  6. package/dist/events.js +1 -459
  7. package/dist/feature-flags.feature.js +1 -139
  8. package/dist/index.js +1 -8
  9. package/package.json +13 -14
  10. package/dist/contracts/dist/capabilities/openbanking.js +0 -88
  11. package/dist/contracts/dist/client/index.js +0 -5
  12. package/dist/contracts/dist/client/react/feature-render.js +0 -2
  13. package/dist/contracts/dist/client/react/form-render.js +0 -4
  14. package/dist/contracts/dist/client/react/index.js +0 -4
  15. package/dist/contracts/dist/contract-registry/index.js +0 -1
  16. package/dist/contracts/dist/contract-registry/schemas.js +0 -60
  17. package/dist/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  18. package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
  19. package/dist/contracts/dist/docs/index.js +0 -29
  20. package/dist/contracts/dist/docs/presentations.js +0 -71
  21. package/dist/contracts/dist/docs/registry.js +0 -44
  22. package/dist/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  23. package/dist/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  24. package/dist/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  25. package/dist/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  26. package/dist/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  27. package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
  28. package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
  29. package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
  30. package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
  31. package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
  32. package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
  33. package/dist/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
  34. package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
  35. package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
  36. package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
  37. package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
  38. package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
  39. package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
  40. package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
  41. package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
  42. package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
  43. package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
  44. package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
  45. package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
  46. package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
  47. package/dist/contracts/dist/events.js +0 -10
  48. package/dist/contracts/dist/experiments/evaluator.js +0 -1
  49. package/dist/contracts/dist/index.js +0 -71
  50. package/dist/contracts/dist/install.js +0 -2
  51. package/dist/contracts/dist/integrations/contracts.js +0 -377
  52. package/dist/contracts/dist/integrations/index.js +0 -18
  53. package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
  54. package/dist/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
  55. package/dist/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
  56. package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
  57. package/dist/contracts/dist/integrations/openbanking/models.js +0 -242
  58. package/dist/contracts/dist/integrations/openbanking/telemetry.js +0 -13
  59. package/dist/contracts/dist/integrations/providers/elevenlabs.js +0 -52
  60. package/dist/contracts/dist/integrations/providers/gcs-storage.js +0 -75
  61. package/dist/contracts/dist/integrations/providers/gmail.js +0 -87
  62. package/dist/contracts/dist/integrations/providers/google-calendar.js +0 -66
  63. package/dist/contracts/dist/integrations/providers/index.js +0 -11
  64. package/dist/contracts/dist/integrations/providers/mistral.js +0 -68
  65. package/dist/contracts/dist/integrations/providers/postmark.js +0 -68
  66. package/dist/contracts/dist/integrations/providers/powens.js +0 -116
  67. package/dist/contracts/dist/integrations/providers/qdrant.js +0 -73
  68. package/dist/contracts/dist/integrations/providers/registry.js +0 -10
  69. package/dist/contracts/dist/integrations/providers/stripe.js +0 -83
  70. package/dist/contracts/dist/integrations/providers/twilio-sms.js +0 -61
  71. package/dist/contracts/dist/jsonschema.js +0 -1
  72. package/dist/contracts/dist/knowledge/contracts.js +0 -306
  73. package/dist/contracts/dist/knowledge/index.js +0 -7
  74. package/dist/contracts/dist/knowledge/spaces/email-threads.js +0 -34
  75. package/dist/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
  76. package/dist/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
  77. package/dist/contracts/dist/knowledge/spaces/index.js +0 -6
  78. package/dist/contracts/dist/knowledge/spaces/product-canon.js +0 -34
  79. package/dist/contracts/dist/knowledge/spaces/support-faq.js +0 -37
  80. package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
  81. package/dist/contracts/dist/llm/exporters.js +0 -19
  82. package/dist/contracts/dist/llm/index.js +0 -2
  83. package/dist/contracts/dist/llm/prompts.js +0 -1
  84. package/dist/contracts/dist/onboarding-base.js +0 -196
  85. package/dist/contracts/dist/openapi.js +0 -1
  86. package/dist/contracts/dist/ownership.js +0 -21
  87. package/dist/contracts/dist/presentations.js +0 -1
  88. package/dist/contracts/dist/presentations.v2.js +0 -11
  89. package/dist/contracts/dist/prompt.js +0 -1
  90. package/dist/contracts/dist/promptRegistry.js +0 -1
  91. package/dist/contracts/dist/regenerator/index.js +0 -1
  92. package/dist/contracts/dist/regenerator/service.js +0 -6
  93. package/dist/contracts/dist/registry.js +0 -2
  94. package/dist/contracts/dist/resources.js +0 -1
  95. package/dist/contracts/dist/schema/dist/EnumType.js +0 -2
  96. package/dist/contracts/dist/schema/dist/FieldType.js +0 -49
  97. package/dist/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  98. package/dist/contracts/dist/schema/dist/SchemaModel.js +0 -34
  99. package/dist/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  100. package/dist/contracts/dist/schema/dist/entity/index.js +0 -2
  101. package/dist/contracts/dist/schema/dist/entity/types.js +0 -1
  102. package/dist/contracts/dist/schema/dist/index.js +0 -6
  103. package/dist/contracts/dist/server/graphql-pothos.js +0 -6
  104. package/dist/contracts/dist/server/index.js +0 -8
  105. package/dist/contracts/dist/server/mcp/createMcpServer.js +0 -4
  106. package/dist/contracts/dist/server/mcp/registerPresentations.js +0 -2
  107. package/dist/contracts/dist/server/mcp/registerPrompts.js +0 -1
  108. package/dist/contracts/dist/server/mcp/registerResources.js +0 -2
  109. package/dist/contracts/dist/server/mcp/registerTools.js +0 -1
  110. package/dist/contracts/dist/server/provider-mcp.js +0 -1
  111. package/dist/contracts/dist/server/rest-elysia.js +0 -1
  112. package/dist/contracts/dist/server/rest-express.js +0 -1
  113. package/dist/contracts/dist/server/rest-generic.js +0 -1
  114. package/dist/contracts/dist/server/rest-next-app.js +0 -1
  115. package/dist/contracts/dist/server/rest-next-pages.js +0 -1
  116. package/dist/contracts/dist/spec.js +0 -34
  117. package/dist/contracts/dist/telemetry/index.js +0 -1
  118. package/dist/contracts/dist/telemetry/tracker.js +0 -1
  119. package/dist/contracts/dist/tests/index.js +0 -1
  120. package/dist/contracts/dist/tests/runner.js +0 -2
  121. package/dist/contracts/dist/workflow/index.js +0 -1
  122. package/dist/contracts/dist/workflow/runner.js +0 -1
  123. package/dist/contracts/index.d.ts +0 -1006
  124. package/dist/docs/feature-flags.docblock.d.ts +0 -1
  125. package/dist/docs/index.d.ts +0 -1
  126. package/dist/entities/index.d.ts +0 -200
  127. package/dist/evaluation/index.d.ts +0 -162
  128. package/dist/events.d.ts +0 -624
  129. package/dist/feature-flags.feature.d.ts +0 -11
  130. package/dist/index.d.ts +0 -6
  131. package/dist/schema/dist/EnumType.js +0 -2
  132. package/dist/schema/dist/FieldType.js +0 -49
  133. package/dist/schema/dist/ScalarTypeEnum.js +0 -236
  134. package/dist/schema/dist/SchemaModel.js +0 -39
  135. package/dist/schema/dist/entity/defineEntity.js +0 -236
  136. package/dist/schema/dist/entity/index.js +0 -2
  137. package/dist/schema/dist/entity/types.js +0 -1
  138. package/dist/schema/dist/index.js +0 -6
@@ -1,228 +0,0 @@
1
- import { SchemaModel } from "../../../schema/dist/SchemaModel.js";
2
- import { ScalarTypeEnum } from "../../../schema/dist/ScalarTypeEnum.js";
3
- import "../../../schema/dist/index.js";
4
- import { defineCommand, defineQuery } from "../../../spec.js";
5
- import { BankAccountRecord } from "../models.js";
6
- import { OPENBANKING_TELEMETRY_EVENTS } from "../telemetry.js";
7
-
8
- //#region ../contracts/dist/integrations/openbanking/contracts/accounts.js
9
- const OpenBankingListAccountsInput = new SchemaModel({
10
- name: "OpenBankingListAccountsInput",
11
- description: "Parameters for listing bank accounts through the open banking provider.",
12
- fields: {
13
- tenantId: {
14
- type: ScalarTypeEnum.ID(),
15
- isOptional: false
16
- },
17
- userId: {
18
- type: ScalarTypeEnum.ID(),
19
- isOptional: false
20
- },
21
- connectionId: {
22
- type: ScalarTypeEnum.ID(),
23
- isOptional: true
24
- },
25
- includeBalances: {
26
- type: ScalarTypeEnum.Boolean(),
27
- isOptional: true
28
- },
29
- institutionId: {
30
- type: ScalarTypeEnum.String_unsecure(),
31
- isOptional: true
32
- },
33
- cursor: {
34
- type: ScalarTypeEnum.String_unsecure(),
35
- isOptional: true
36
- },
37
- pageSize: {
38
- type: ScalarTypeEnum.Int_unsecure(),
39
- isOptional: true
40
- }
41
- }
42
- });
43
- const OpenBankingListAccountsOutput = new SchemaModel({
44
- name: "OpenBankingListAccountsOutput",
45
- description: "Paginated list of bank accounts available to the tenant and user.",
46
- fields: {
47
- accounts: {
48
- type: BankAccountRecord,
49
- isOptional: false,
50
- isArray: true
51
- },
52
- nextCursor: {
53
- type: ScalarTypeEnum.String_unsecure(),
54
- isOptional: true
55
- },
56
- hasMore: {
57
- type: ScalarTypeEnum.Boolean(),
58
- isOptional: true
59
- }
60
- }
61
- });
62
- const OpenBankingGetAccountInput = new SchemaModel({
63
- name: "OpenBankingGetAccountInput",
64
- description: "Parameters for retrieving a specific bank account.",
65
- fields: {
66
- tenantId: {
67
- type: ScalarTypeEnum.ID(),
68
- isOptional: false
69
- },
70
- accountId: {
71
- type: ScalarTypeEnum.ID(),
72
- isOptional: false
73
- },
74
- includeBalances: {
75
- type: ScalarTypeEnum.Boolean(),
76
- isOptional: true
77
- },
78
- includeLatestTransactions: {
79
- type: ScalarTypeEnum.Boolean(),
80
- isOptional: true
81
- }
82
- }
83
- });
84
- const OpenBankingSyncAccountsInput = new SchemaModel({
85
- name: "OpenBankingSyncAccountsInput",
86
- description: "Command payload to trigger an account synchronisation against the open banking provider.",
87
- fields: {
88
- tenantId: {
89
- type: ScalarTypeEnum.ID(),
90
- isOptional: false
91
- },
92
- userId: {
93
- type: ScalarTypeEnum.ID(),
94
- isOptional: true
95
- },
96
- connectionId: {
97
- type: ScalarTypeEnum.ID(),
98
- isOptional: false
99
- },
100
- accountIds: {
101
- type: ScalarTypeEnum.ID(),
102
- isArray: true,
103
- isOptional: true
104
- },
105
- forceFullRefresh: {
106
- type: ScalarTypeEnum.Boolean(),
107
- isOptional: true
108
- },
109
- triggerWorkflows: {
110
- type: ScalarTypeEnum.Boolean(),
111
- isOptional: true
112
- }
113
- }
114
- });
115
- const OpenBankingSyncAccountsOutput = new SchemaModel({
116
- name: "OpenBankingSyncAccountsOutput",
117
- description: "Result of a bank account synchronisation run.",
118
- fields: {
119
- synced: {
120
- type: ScalarTypeEnum.Int_unsecure(),
121
- isOptional: false
122
- },
123
- failed: {
124
- type: ScalarTypeEnum.Int_unsecure(),
125
- isOptional: false
126
- },
127
- errors: {
128
- type: ScalarTypeEnum.String_unsecure(),
129
- isArray: true,
130
- isOptional: true
131
- },
132
- nextSyncSuggestedAt: {
133
- type: ScalarTypeEnum.DateTime(),
134
- isOptional: true
135
- }
136
- }
137
- });
138
- const OpenBankingListAccounts = defineQuery({
139
- meta: {
140
- name: "openbanking.accounts.list",
141
- version: 1,
142
- description: "List bank accounts available to a tenant/user via Powens Open Banking.",
143
- goal: "Provide downstream workflows with the set of accounts accessible via the configured open banking connection.",
144
- context: "Used by Pocket Family Office dashboards and sync workflows to enumerate bank accounts prior to syncing balances or transactions.",
145
- owners: ["platform.finance"],
146
- tags: [
147
- "open-banking",
148
- "powens",
149
- "accounts"
150
- ],
151
- stability: "experimental"
152
- },
153
- io: {
154
- input: OpenBankingListAccountsInput,
155
- output: OpenBankingListAccountsOutput
156
- },
157
- policy: { auth: "user" }
158
- });
159
- const OpenBankingGetAccount = defineQuery({
160
- meta: {
161
- name: "openbanking.accounts.get",
162
- version: 1,
163
- description: "Retrieve the canonical bank account record for the given account identifier.",
164
- goal: "Allow user-facing experiences and automations to display up-to-date account metadata.",
165
- context: "Invoked by UI surfaces and workflow automation steps that require detailed metadata for a specific bank account.",
166
- owners: ["platform.finance"],
167
- tags: [
168
- "open-banking",
169
- "powens",
170
- "accounts"
171
- ],
172
- stability: "experimental"
173
- },
174
- io: {
175
- input: OpenBankingGetAccountInput,
176
- output: BankAccountRecord
177
- },
178
- policy: { auth: "user" }
179
- });
180
- const OpenBankingSyncAccounts = defineCommand({
181
- meta: {
182
- name: "openbanking.accounts.sync",
183
- version: 1,
184
- description: "Initiate a synchronisation run to refresh bank account metadata from Powens.",
185
- goal: "Keep canonical bank account records aligned with the external open banking provider.",
186
- context: "Triggered by scheduled workflows or manual operator actions to reconcile account metadata prior to transaction/balance syncs.",
187
- owners: ["platform.finance"],
188
- tags: [
189
- "open-banking",
190
- "powens",
191
- "accounts"
192
- ],
193
- stability: "experimental"
194
- },
195
- io: {
196
- input: OpenBankingSyncAccountsInput,
197
- output: OpenBankingSyncAccountsOutput
198
- },
199
- policy: { auth: "admin" },
200
- telemetry: {
201
- success: {
202
- event: { name: OPENBANKING_TELEMETRY_EVENTS.accountsSynced },
203
- properties: ({ input, output }) => {
204
- const payload = input;
205
- const result = output;
206
- return {
207
- tenantId: payload?.tenantId,
208
- connectionId: payload?.connectionId,
209
- synced: result?.synced,
210
- failed: result?.failed
211
- };
212
- }
213
- },
214
- failure: {
215
- event: { name: OPENBANKING_TELEMETRY_EVENTS.accountsSyncFailed },
216
- properties: ({ input, error }) => {
217
- const payload = input;
218
- return {
219
- tenantId: payload?.tenantId,
220
- connectionId: payload?.connectionId,
221
- error: error instanceof Error ? error.message : String(error ?? "unknown")
222
- };
223
- }
224
- }
225
- }
226
- });
227
-
228
- //#endregion
@@ -1,159 +0,0 @@
1
- import { SchemaModel } from "../../../schema/dist/SchemaModel.js";
2
- import { ScalarTypeEnum } from "../../../schema/dist/ScalarTypeEnum.js";
3
- import "../../../schema/dist/index.js";
4
- import { defineCommand, defineQuery } from "../../../spec.js";
5
- import { AccountBalanceRecord } from "../models.js";
6
- import { OPENBANKING_TELEMETRY_EVENTS } from "../telemetry.js";
7
-
8
- //#region ../contracts/dist/integrations/openbanking/contracts/balances.js
9
- const OpenBankingGetBalancesInput = new SchemaModel({
10
- name: "OpenBankingGetBalancesInput",
11
- description: "Parameters for retrieving bank account balances from the canonical ledger.",
12
- fields: {
13
- tenantId: {
14
- type: ScalarTypeEnum.ID(),
15
- isOptional: false
16
- },
17
- accountId: {
18
- type: ScalarTypeEnum.ID(),
19
- isOptional: false
20
- },
21
- balanceTypes: {
22
- type: ScalarTypeEnum.String_unsecure(),
23
- isArray: true,
24
- isOptional: true
25
- }
26
- }
27
- });
28
- const OpenBankingGetBalancesOutput = new SchemaModel({
29
- name: "OpenBankingGetBalancesOutput",
30
- description: "Canonical balances for a bank account.",
31
- fields: {
32
- balances: {
33
- type: AccountBalanceRecord,
34
- isOptional: false,
35
- isArray: true
36
- },
37
- asOf: {
38
- type: ScalarTypeEnum.DateTime(),
39
- isOptional: true
40
- }
41
- }
42
- });
43
- const OpenBankingRefreshBalancesInput = new SchemaModel({
44
- name: "OpenBankingRefreshBalancesInput",
45
- description: "Command payload to refresh balances for a bank account via the open banking provider.",
46
- fields: {
47
- tenantId: {
48
- type: ScalarTypeEnum.ID(),
49
- isOptional: false
50
- },
51
- accountId: {
52
- type: ScalarTypeEnum.ID(),
53
- isOptional: false
54
- },
55
- connectionId: {
56
- type: ScalarTypeEnum.ID(),
57
- isOptional: true
58
- },
59
- balanceTypes: {
60
- type: ScalarTypeEnum.String_unsecure(),
61
- isArray: true,
62
- isOptional: true
63
- },
64
- forceRefresh: {
65
- type: ScalarTypeEnum.Boolean(),
66
- isOptional: true
67
- }
68
- }
69
- });
70
- const OpenBankingRefreshBalancesOutput = new SchemaModel({
71
- name: "OpenBankingRefreshBalancesOutput",
72
- description: "Result of a balance refresh against the open banking provider.",
73
- fields: {
74
- balances: {
75
- type: AccountBalanceRecord,
76
- isOptional: false,
77
- isArray: true
78
- },
79
- refreshedAt: {
80
- type: ScalarTypeEnum.DateTime(),
81
- isOptional: false
82
- },
83
- errors: {
84
- type: ScalarTypeEnum.String_unsecure(),
85
- isArray: true,
86
- isOptional: true
87
- }
88
- }
89
- });
90
- const OpenBankingGetBalances = defineQuery({
91
- meta: {
92
- name: "openbanking.balances.get",
93
- version: 1,
94
- description: "Retrieve the latest cached balances for a bank account.",
95
- goal: "Expose current and available balances required by dashboards and analytics.",
96
- context: "Used by Pocket Family Office UI surfaces and automation steps that require balance totals prior to generating summaries.",
97
- owners: ["platform.finance"],
98
- tags: [
99
- "open-banking",
100
- "powens",
101
- "balances"
102
- ],
103
- stability: "experimental"
104
- },
105
- io: {
106
- input: OpenBankingGetBalancesInput,
107
- output: OpenBankingGetBalancesOutput
108
- },
109
- policy: { auth: "user" }
110
- });
111
- const OpenBankingRefreshBalances = defineCommand({
112
- meta: {
113
- name: "openbanking.balances.refresh",
114
- version: 1,
115
- description: "Refresh balances for a bank account via the configured open banking provider.",
116
- goal: "Ensure canonical balance records reflect the latest values from Powens.",
117
- context: "Triggered by scheduled workflows before generating summaries or forecasting cashflow.",
118
- owners: ["platform.finance"],
119
- tags: [
120
- "open-banking",
121
- "powens",
122
- "balances"
123
- ],
124
- stability: "experimental"
125
- },
126
- io: {
127
- input: OpenBankingRefreshBalancesInput,
128
- output: OpenBankingRefreshBalancesOutput
129
- },
130
- policy: { auth: "admin" },
131
- telemetry: {
132
- success: {
133
- event: { name: OPENBANKING_TELEMETRY_EVENTS.balancesRefreshed },
134
- properties: ({ input, output }) => {
135
- const payload = input;
136
- const result = output;
137
- return {
138
- tenantId: payload?.tenantId,
139
- accountId: payload?.accountId,
140
- refreshedAt: result?.refreshedAt,
141
- balanceCount: Array.isArray(result?.balances) ? result?.balances.length : void 0
142
- };
143
- }
144
- },
145
- failure: {
146
- event: { name: OPENBANKING_TELEMETRY_EVENTS.balancesRefreshFailed },
147
- properties: ({ input, error }) => {
148
- const payload = input;
149
- return {
150
- tenantId: payload?.tenantId,
151
- accountId: payload?.accountId,
152
- error: error instanceof Error ? error.message : String(error ?? "unknown")
153
- };
154
- }
155
- }
156
- }
157
- });
158
-
159
- //#endregion
@@ -1,3 +0,0 @@
1
- import "./accounts.js";
2
- import "./transactions.js";
3
- import "./balances.js";
@@ -1,210 +0,0 @@
1
- import { SchemaModel } from "../../../schema/dist/SchemaModel.js";
2
- import { ScalarTypeEnum } from "../../../schema/dist/ScalarTypeEnum.js";
3
- import "../../../schema/dist/index.js";
4
- import { defineCommand, defineQuery } from "../../../spec.js";
5
- import { BankTransactionRecord } from "../models.js";
6
- import { OPENBANKING_TELEMETRY_EVENTS } from "../telemetry.js";
7
-
8
- //#region ../contracts/dist/integrations/openbanking/contracts/transactions.js
9
- const OpenBankingListTransactionsInput = new SchemaModel({
10
- name: "OpenBankingListTransactionsInput",
11
- description: "Parameters for listing bank transactions from the canonical ledger.",
12
- fields: {
13
- tenantId: {
14
- type: ScalarTypeEnum.ID(),
15
- isOptional: false
16
- },
17
- accountId: {
18
- type: ScalarTypeEnum.ID(),
19
- isOptional: false
20
- },
21
- from: {
22
- type: ScalarTypeEnum.DateTime(),
23
- isOptional: true
24
- },
25
- to: {
26
- type: ScalarTypeEnum.DateTime(),
27
- isOptional: true
28
- },
29
- cursor: {
30
- type: ScalarTypeEnum.String_unsecure(),
31
- isOptional: true
32
- },
33
- pageSize: {
34
- type: ScalarTypeEnum.Int_unsecure(),
35
- isOptional: true
36
- },
37
- direction: {
38
- type: ScalarTypeEnum.String_unsecure(),
39
- isOptional: true
40
- },
41
- minimumAmount: {
42
- type: ScalarTypeEnum.Float_unsecure(),
43
- isOptional: true
44
- },
45
- maximumAmount: {
46
- type: ScalarTypeEnum.Float_unsecure(),
47
- isOptional: true
48
- },
49
- category: {
50
- type: ScalarTypeEnum.String_unsecure(),
51
- isOptional: true
52
- }
53
- }
54
- });
55
- const OpenBankingListTransactionsOutput = new SchemaModel({
56
- name: "OpenBankingListTransactionsOutput",
57
- description: "Paginated list of transactions for a bank account.",
58
- fields: {
59
- transactions: {
60
- type: BankTransactionRecord,
61
- isOptional: false,
62
- isArray: true
63
- },
64
- nextCursor: {
65
- type: ScalarTypeEnum.String_unsecure(),
66
- isOptional: true
67
- },
68
- hasMore: {
69
- type: ScalarTypeEnum.Boolean(),
70
- isOptional: true
71
- }
72
- }
73
- });
74
- const OpenBankingSyncTransactionsInput = new SchemaModel({
75
- name: "OpenBankingSyncTransactionsInput",
76
- description: "Command payload to synchronise transactions from the open banking provider into the canonical ledger.",
77
- fields: {
78
- tenantId: {
79
- type: ScalarTypeEnum.ID(),
80
- isOptional: false
81
- },
82
- accountId: {
83
- type: ScalarTypeEnum.ID(),
84
- isOptional: false
85
- },
86
- from: {
87
- type: ScalarTypeEnum.DateTime(),
88
- isOptional: true
89
- },
90
- to: {
91
- type: ScalarTypeEnum.DateTime(),
92
- isOptional: true
93
- },
94
- connectionId: {
95
- type: ScalarTypeEnum.ID(),
96
- isOptional: true
97
- },
98
- includePending: {
99
- type: ScalarTypeEnum.Boolean(),
100
- isOptional: true
101
- },
102
- backfillDays: {
103
- type: ScalarTypeEnum.Int_unsecure(),
104
- isOptional: true
105
- }
106
- }
107
- });
108
- const OpenBankingSyncTransactionsOutput = new SchemaModel({
109
- name: "OpenBankingSyncTransactionsOutput",
110
- description: "Result of a transaction synchronisation run.",
111
- fields: {
112
- synced: {
113
- type: ScalarTypeEnum.Int_unsecure(),
114
- isOptional: false
115
- },
116
- failed: {
117
- type: ScalarTypeEnum.Int_unsecure(),
118
- isOptional: false
119
- },
120
- earliestSyncedAt: {
121
- type: ScalarTypeEnum.DateTime(),
122
- isOptional: true
123
- },
124
- latestSyncedAt: {
125
- type: ScalarTypeEnum.DateTime(),
126
- isOptional: true
127
- },
128
- nextSinceToken: {
129
- type: ScalarTypeEnum.String_unsecure(),
130
- isOptional: true
131
- },
132
- errors: {
133
- type: ScalarTypeEnum.String_unsecure(),
134
- isArray: true,
135
- isOptional: true
136
- }
137
- }
138
- });
139
- const OpenBankingListTransactions = defineQuery({
140
- meta: {
141
- name: "openbanking.transactions.list",
142
- version: 1,
143
- description: "List bank transactions that have been normalised into the canonical ledger.",
144
- goal: "Allow downstream analytics and UI surfaces to page through canonical bank transactions.",
145
- context: "Used by Pocket Family Office dashboards, reconciliation workflows, and analytics data views.",
146
- owners: ["platform.finance"],
147
- tags: [
148
- "open-banking",
149
- "powens",
150
- "transactions"
151
- ],
152
- stability: "experimental"
153
- },
154
- io: {
155
- input: OpenBankingListTransactionsInput,
156
- output: OpenBankingListTransactionsOutput
157
- },
158
- policy: { auth: "user" }
159
- });
160
- const OpenBankingSyncTransactions = defineCommand({
161
- meta: {
162
- name: "openbanking.transactions.sync",
163
- version: 1,
164
- description: "Synchronise transactions for a bank account by calling the configured open banking provider.",
165
- goal: "Ensure the canonical transaction ledger stays aligned with the external provider.",
166
- context: "Triggered by scheduled workflows or on-demand actions when activity is expected on an account.",
167
- owners: ["platform.finance"],
168
- tags: [
169
- "open-banking",
170
- "powens",
171
- "transactions"
172
- ],
173
- stability: "experimental"
174
- },
175
- io: {
176
- input: OpenBankingSyncTransactionsInput,
177
- output: OpenBankingSyncTransactionsOutput
178
- },
179
- policy: { auth: "admin" },
180
- telemetry: {
181
- success: {
182
- event: { name: OPENBANKING_TELEMETRY_EVENTS.transactionsSynced },
183
- properties: ({ input, output }) => {
184
- const payload = input;
185
- const result = output;
186
- return {
187
- tenantId: payload?.tenantId,
188
- accountId: payload?.accountId,
189
- synced: result?.synced,
190
- failed: result?.failed,
191
- earliestSyncedAt: result?.earliestSyncedAt,
192
- latestSyncedAt: result?.latestSyncedAt
193
- };
194
- }
195
- },
196
- failure: {
197
- event: { name: OPENBANKING_TELEMETRY_EVENTS.transactionsSyncFailed },
198
- properties: ({ input, error }) => {
199
- const payload = input;
200
- return {
201
- tenantId: payload?.tenantId,
202
- accountId: payload?.accountId,
203
- error: error instanceof Error ? error.message : String(error ?? "unknown")
204
- };
205
- }
206
- }
207
- }
208
- });
209
-
210
- //#endregion