@lssm/example.analytics-dashboard 0.0.0-canary-20251217063201 → 0.0.0-canary-20251217073102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard/dashboard.contracts.d.ts +131 -131
- package/dist/dashboard/dashboard.contracts.js +5 -5
- package/dist/dashboard/dashboard.enum.d.ts +4 -4
- package/dist/dashboard/dashboard.enum.js +4 -4
- package/dist/dashboard/dashboard.schema.d.ts +79 -79
- package/dist/dashboard/dashboard.schema.js +43 -43
- package/dist/docs/analytics-dashboard.docblock.js +2 -2
- package/dist/events.d.ts +40 -40
- package/dist/events.js +25 -25
- package/dist/libs/contracts/dist/capabilities/openbanking.js +53 -49
- package/dist/libs/contracts/dist/client/index.js +1 -1
- package/dist/libs/contracts/dist/client/react/index.js +1 -1
- package/dist/libs/contracts/dist/contract-registry/index.js +1 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +52 -49
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +11 -86
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +11 -360
- package/dist/libs/contracts/dist/docs/index.js +2 -2
- package/dist/libs/contracts/dist/docs/presentations.js +48 -44
- package/dist/libs/contracts/dist/docs/registry.js +27 -25
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +11 -393
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +11 -78
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +11 -150
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +11 -96
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +10 -10
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +15 -15
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +12 -12
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +11 -223
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +44 -44
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +30 -14
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +10 -10
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +13 -274
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +41 -15
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +15 -15
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +14 -14
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +16 -28
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +60 -15
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +13 -13
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +31 -48
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +40 -15
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +14 -14
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +22 -22
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +12 -12
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +22 -22
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +11 -11
- package/dist/libs/contracts/dist/events.js +4 -3
- package/dist/libs/contracts/dist/index.js +14 -14
- package/dist/libs/contracts/dist/integrations/contracts.js +205 -199
- package/dist/libs/contracts/dist/integrations/index.js +5 -5
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +133 -130
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +95 -93
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -3
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +120 -118
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +122 -120
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +9 -20
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +25 -25
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +36 -36
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +40 -40
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +31 -31
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +31 -31
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +31 -31
- package/dist/libs/contracts/dist/integrations/providers/powens.js +51 -51
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +31 -31
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +35 -35
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +28 -28
- package/dist/libs/contracts/dist/jsonschema.js +1 -1
- package/dist/libs/contracts/dist/knowledge/contracts.js +170 -163
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +17 -17
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +17 -17
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +19 -19
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +17 -17
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +17 -17
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +17 -17
- package/dist/libs/contracts/dist/llm/exporters.js +13 -12
- package/dist/libs/contracts/dist/onboarding-base.js +116 -99
- package/dist/libs/contracts/dist/ownership.js +18 -33
- package/dist/libs/contracts/dist/presentations.js +1 -1
- package/dist/libs/contracts/dist/presentations.v2.js +6 -2
- package/dist/libs/contracts/dist/regenerator/service.js +5 -0
- package/dist/libs/contracts/dist/registry.js +1 -1
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +24 -14
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +180 -166
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +20 -9
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -1
- package/dist/libs/contracts/dist/spec.js +22 -13
- package/dist/libs/schema/dist/EnumType.js +25 -9
- package/dist/libs/schema/dist/FieldType.js +24 -14
- package/dist/libs/schema/dist/ScalarTypeEnum.js +180 -166
- package/dist/libs/schema/dist/SchemaModel.js +25 -10
- package/dist/libs/schema/dist/index.js +4 -4
- package/dist/query/query.contracts.js +3 -3
- package/dist/query/query.enum.d.ts +2 -2
- package/dist/query/query.enum.js +2 -2
- package/dist/query/query.schema.d.ts +34 -34
- package/dist/query/query.schema.js +33 -33
- package/package.json +10 -10
|
@@ -1,225 +1,228 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SchemaModel } from "../../../schema/dist/SchemaModel.js";
|
|
2
|
+
import { ScalarTypeEnum } from "../../../schema/dist/ScalarTypeEnum.js";
|
|
3
3
|
import "../../../schema/dist/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { defineCommand, defineQuery } from "../../../spec.js";
|
|
5
|
+
import { BankAccountRecord } from "../models.js";
|
|
6
|
+
import { OPENBANKING_TELEMETRY_EVENTS } from "../telemetry.js";
|
|
7
7
|
|
|
8
8
|
//#region ../../libs/contracts/dist/integrations/openbanking/contracts/accounts.js
|
|
9
|
-
const
|
|
10
|
-
name:
|
|
11
|
-
description:
|
|
9
|
+
const OpenBankingListAccountsInput = new SchemaModel({
|
|
10
|
+
name: "OpenBankingListAccountsInput",
|
|
11
|
+
description: "Parameters for listing bank accounts through the open banking provider.",
|
|
12
12
|
fields: {
|
|
13
13
|
tenantId: {
|
|
14
|
-
type:
|
|
15
|
-
isOptional:
|
|
14
|
+
type: ScalarTypeEnum.ID(),
|
|
15
|
+
isOptional: false
|
|
16
16
|
},
|
|
17
17
|
userId: {
|
|
18
|
-
type:
|
|
19
|
-
isOptional:
|
|
18
|
+
type: ScalarTypeEnum.ID(),
|
|
19
|
+
isOptional: false
|
|
20
20
|
},
|
|
21
21
|
connectionId: {
|
|
22
|
-
type:
|
|
23
|
-
isOptional:
|
|
22
|
+
type: ScalarTypeEnum.ID(),
|
|
23
|
+
isOptional: true
|
|
24
24
|
},
|
|
25
25
|
includeBalances: {
|
|
26
|
-
type:
|
|
27
|
-
isOptional:
|
|
26
|
+
type: ScalarTypeEnum.Boolean(),
|
|
27
|
+
isOptional: true
|
|
28
28
|
},
|
|
29
29
|
institutionId: {
|
|
30
|
-
type:
|
|
31
|
-
isOptional:
|
|
30
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
31
|
+
isOptional: true
|
|
32
32
|
},
|
|
33
33
|
cursor: {
|
|
34
|
-
type:
|
|
35
|
-
isOptional:
|
|
34
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
+
isOptional: true
|
|
36
36
|
},
|
|
37
37
|
pageSize: {
|
|
38
|
-
type:
|
|
39
|
-
isOptional:
|
|
38
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
39
|
+
isOptional: true
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
});
|
|
43
|
+
const OpenBankingListAccountsOutput = new SchemaModel({
|
|
44
|
+
name: "OpenBankingListAccountsOutput",
|
|
45
|
+
description: "Paginated list of bank accounts available to the tenant and user.",
|
|
45
46
|
fields: {
|
|
46
47
|
accounts: {
|
|
47
|
-
type:
|
|
48
|
-
isOptional:
|
|
49
|
-
isArray:
|
|
48
|
+
type: BankAccountRecord,
|
|
49
|
+
isOptional: false,
|
|
50
|
+
isArray: true
|
|
50
51
|
},
|
|
51
52
|
nextCursor: {
|
|
52
|
-
type:
|
|
53
|
-
isOptional:
|
|
53
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
54
|
+
isOptional: true
|
|
54
55
|
},
|
|
55
56
|
hasMore: {
|
|
56
|
-
type:
|
|
57
|
-
isOptional:
|
|
57
|
+
type: ScalarTypeEnum.Boolean(),
|
|
58
|
+
isOptional: true
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
});
|
|
62
|
+
const OpenBankingGetAccountInput = new SchemaModel({
|
|
63
|
+
name: "OpenBankingGetAccountInput",
|
|
64
|
+
description: "Parameters for retrieving a specific bank account.",
|
|
63
65
|
fields: {
|
|
64
66
|
tenantId: {
|
|
65
|
-
type:
|
|
66
|
-
isOptional:
|
|
67
|
+
type: ScalarTypeEnum.ID(),
|
|
68
|
+
isOptional: false
|
|
67
69
|
},
|
|
68
70
|
accountId: {
|
|
69
|
-
type:
|
|
70
|
-
isOptional:
|
|
71
|
+
type: ScalarTypeEnum.ID(),
|
|
72
|
+
isOptional: false
|
|
71
73
|
},
|
|
72
74
|
includeBalances: {
|
|
73
|
-
type:
|
|
74
|
-
isOptional:
|
|
75
|
+
type: ScalarTypeEnum.Boolean(),
|
|
76
|
+
isOptional: true
|
|
75
77
|
},
|
|
76
78
|
includeLatestTransactions: {
|
|
77
|
-
type:
|
|
78
|
-
isOptional:
|
|
79
|
+
type: ScalarTypeEnum.Boolean(),
|
|
80
|
+
isOptional: true
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
});
|
|
84
|
+
const OpenBankingSyncAccountsInput = new SchemaModel({
|
|
85
|
+
name: "OpenBankingSyncAccountsInput",
|
|
86
|
+
description: "Command payload to trigger an account synchronisation against the open banking provider.",
|
|
84
87
|
fields: {
|
|
85
88
|
tenantId: {
|
|
86
|
-
type:
|
|
87
|
-
isOptional:
|
|
89
|
+
type: ScalarTypeEnum.ID(),
|
|
90
|
+
isOptional: false
|
|
88
91
|
},
|
|
89
92
|
userId: {
|
|
90
|
-
type:
|
|
91
|
-
isOptional:
|
|
93
|
+
type: ScalarTypeEnum.ID(),
|
|
94
|
+
isOptional: true
|
|
92
95
|
},
|
|
93
96
|
connectionId: {
|
|
94
|
-
type:
|
|
95
|
-
isOptional:
|
|
97
|
+
type: ScalarTypeEnum.ID(),
|
|
98
|
+
isOptional: false
|
|
96
99
|
},
|
|
97
100
|
accountIds: {
|
|
98
|
-
type:
|
|
99
|
-
isArray:
|
|
100
|
-
isOptional:
|
|
101
|
+
type: ScalarTypeEnum.ID(),
|
|
102
|
+
isArray: true,
|
|
103
|
+
isOptional: true
|
|
101
104
|
},
|
|
102
105
|
forceFullRefresh: {
|
|
103
|
-
type:
|
|
104
|
-
isOptional:
|
|
106
|
+
type: ScalarTypeEnum.Boolean(),
|
|
107
|
+
isOptional: true
|
|
105
108
|
},
|
|
106
109
|
triggerWorkflows: {
|
|
107
|
-
type:
|
|
108
|
-
isOptional:
|
|
110
|
+
type: ScalarTypeEnum.Boolean(),
|
|
111
|
+
isOptional: true
|
|
109
112
|
}
|
|
110
113
|
}
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
});
|
|
115
|
+
const OpenBankingSyncAccountsOutput = new SchemaModel({
|
|
116
|
+
name: "OpenBankingSyncAccountsOutput",
|
|
117
|
+
description: "Result of a bank account synchronisation run.",
|
|
114
118
|
fields: {
|
|
115
119
|
synced: {
|
|
116
|
-
type:
|
|
117
|
-
isOptional:
|
|
120
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
121
|
+
isOptional: false
|
|
118
122
|
},
|
|
119
123
|
failed: {
|
|
120
|
-
type:
|
|
121
|
-
isOptional:
|
|
124
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
125
|
+
isOptional: false
|
|
122
126
|
},
|
|
123
127
|
errors: {
|
|
124
|
-
type:
|
|
125
|
-
isArray:
|
|
126
|
-
isOptional:
|
|
128
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
129
|
+
isArray: true,
|
|
130
|
+
isOptional: true
|
|
127
131
|
},
|
|
128
132
|
nextSyncSuggestedAt: {
|
|
129
|
-
type:
|
|
130
|
-
isOptional:
|
|
133
|
+
type: ScalarTypeEnum.DateTime(),
|
|
134
|
+
isOptional: true
|
|
131
135
|
}
|
|
132
136
|
}
|
|
133
|
-
})
|
|
137
|
+
});
|
|
138
|
+
const OpenBankingListAccounts = defineQuery({
|
|
134
139
|
meta: {
|
|
135
|
-
name:
|
|
140
|
+
name: "openbanking.accounts.list",
|
|
136
141
|
version: 1,
|
|
137
|
-
description:
|
|
138
|
-
goal:
|
|
139
|
-
context:
|
|
140
|
-
owners: [
|
|
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"],
|
|
141
146
|
tags: [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
147
|
+
"open-banking",
|
|
148
|
+
"powens",
|
|
149
|
+
"accounts"
|
|
145
150
|
],
|
|
146
|
-
stability:
|
|
151
|
+
stability: "experimental"
|
|
147
152
|
},
|
|
148
153
|
io: {
|
|
149
|
-
input:
|
|
150
|
-
output:
|
|
154
|
+
input: OpenBankingListAccountsInput,
|
|
155
|
+
output: OpenBankingListAccountsOutput
|
|
151
156
|
},
|
|
152
|
-
policy: { auth:
|
|
153
|
-
})
|
|
157
|
+
policy: { auth: "user" }
|
|
158
|
+
});
|
|
159
|
+
const OpenBankingGetAccount = defineQuery({
|
|
154
160
|
meta: {
|
|
155
|
-
name:
|
|
161
|
+
name: "openbanking.accounts.get",
|
|
156
162
|
version: 1,
|
|
157
|
-
description:
|
|
158
|
-
goal:
|
|
159
|
-
context:
|
|
160
|
-
owners: [
|
|
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"],
|
|
161
167
|
tags: [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
168
|
+
"open-banking",
|
|
169
|
+
"powens",
|
|
170
|
+
"accounts"
|
|
165
171
|
],
|
|
166
|
-
stability:
|
|
172
|
+
stability: "experimental"
|
|
167
173
|
},
|
|
168
174
|
io: {
|
|
169
|
-
input:
|
|
170
|
-
output:
|
|
175
|
+
input: OpenBankingGetAccountInput,
|
|
176
|
+
output: BankAccountRecord
|
|
171
177
|
},
|
|
172
|
-
policy: { auth:
|
|
173
|
-
})
|
|
178
|
+
policy: { auth: "user" }
|
|
179
|
+
});
|
|
180
|
+
const OpenBankingSyncAccounts = defineCommand({
|
|
174
181
|
meta: {
|
|
175
|
-
name:
|
|
182
|
+
name: "openbanking.accounts.sync",
|
|
176
183
|
version: 1,
|
|
177
|
-
description:
|
|
178
|
-
goal:
|
|
179
|
-
context:
|
|
180
|
-
owners: [
|
|
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"],
|
|
181
188
|
tags: [
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
189
|
+
"open-banking",
|
|
190
|
+
"powens",
|
|
191
|
+
"accounts"
|
|
185
192
|
],
|
|
186
|
-
stability:
|
|
193
|
+
stability: "experimental"
|
|
187
194
|
},
|
|
188
195
|
io: {
|
|
189
|
-
input:
|
|
190
|
-
output:
|
|
196
|
+
input: OpenBankingSyncAccountsInput,
|
|
197
|
+
output: OpenBankingSyncAccountsOutput
|
|
191
198
|
},
|
|
192
|
-
policy: { auth:
|
|
199
|
+
policy: { auth: "admin" },
|
|
193
200
|
telemetry: {
|
|
194
201
|
success: {
|
|
195
|
-
event: { name:
|
|
196
|
-
properties: ({ input
|
|
197
|
-
|
|
202
|
+
event: { name: OPENBANKING_TELEMETRY_EVENTS.accountsSynced },
|
|
203
|
+
properties: ({ input, output }) => {
|
|
204
|
+
const payload = input;
|
|
205
|
+
const result = output;
|
|
198
206
|
return {
|
|
199
|
-
tenantId:
|
|
200
|
-
connectionId:
|
|
201
|
-
synced:
|
|
202
|
-
failed:
|
|
207
|
+
tenantId: payload?.tenantId,
|
|
208
|
+
connectionId: payload?.connectionId,
|
|
209
|
+
synced: result?.synced,
|
|
210
|
+
failed: result?.failed
|
|
203
211
|
};
|
|
204
212
|
}
|
|
205
213
|
},
|
|
206
214
|
failure: {
|
|
207
|
-
event: { name:
|
|
208
|
-
properties: ({ input
|
|
209
|
-
|
|
215
|
+
event: { name: OPENBANKING_TELEMETRY_EVENTS.accountsSyncFailed },
|
|
216
|
+
properties: ({ input, error }) => {
|
|
217
|
+
const payload = input;
|
|
210
218
|
return {
|
|
211
|
-
tenantId:
|
|
212
|
-
connectionId:
|
|
213
|
-
error:
|
|
219
|
+
tenantId: payload?.tenantId,
|
|
220
|
+
connectionId: payload?.connectionId,
|
|
221
|
+
error: error instanceof Error ? error.message : String(error ?? "unknown")
|
|
214
222
|
};
|
|
215
223
|
}
|
|
216
224
|
}
|
|
217
225
|
}
|
|
218
|
-
})
|
|
219
|
-
OpenBankingListAccounts: d,
|
|
220
|
-
OpenBankingGetAccount: f,
|
|
221
|
-
OpenBankingSyncAccounts: p
|
|
222
|
-
};
|
|
226
|
+
});
|
|
223
227
|
|
|
224
|
-
//#endregion
|
|
225
|
-
export { d, f, p };
|
|
228
|
+
//#endregion
|
|
@@ -1,157 +1,159 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SchemaModel } from "../../../schema/dist/SchemaModel.js";
|
|
2
|
+
import { ScalarTypeEnum } from "../../../schema/dist/ScalarTypeEnum.js";
|
|
3
3
|
import "../../../schema/dist/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { defineCommand, defineQuery } from "../../../spec.js";
|
|
5
|
+
import { AccountBalanceRecord } from "../models.js";
|
|
6
|
+
import { OPENBANKING_TELEMETRY_EVENTS } from "../telemetry.js";
|
|
7
7
|
|
|
8
8
|
//#region ../../libs/contracts/dist/integrations/openbanking/contracts/balances.js
|
|
9
|
-
const
|
|
10
|
-
name:
|
|
11
|
-
description:
|
|
9
|
+
const OpenBankingGetBalancesInput = new SchemaModel({
|
|
10
|
+
name: "OpenBankingGetBalancesInput",
|
|
11
|
+
description: "Parameters for retrieving bank account balances from the canonical ledger.",
|
|
12
12
|
fields: {
|
|
13
13
|
tenantId: {
|
|
14
|
-
type:
|
|
15
|
-
isOptional:
|
|
14
|
+
type: ScalarTypeEnum.ID(),
|
|
15
|
+
isOptional: false
|
|
16
16
|
},
|
|
17
17
|
accountId: {
|
|
18
|
-
type:
|
|
19
|
-
isOptional:
|
|
18
|
+
type: ScalarTypeEnum.ID(),
|
|
19
|
+
isOptional: false
|
|
20
20
|
},
|
|
21
21
|
balanceTypes: {
|
|
22
|
-
type:
|
|
23
|
-
isArray:
|
|
24
|
-
isOptional:
|
|
22
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
23
|
+
isArray: true,
|
|
24
|
+
isOptional: true
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
});
|
|
28
|
+
const OpenBankingGetBalancesOutput = new SchemaModel({
|
|
29
|
+
name: "OpenBankingGetBalancesOutput",
|
|
30
|
+
description: "Canonical balances for a bank account.",
|
|
30
31
|
fields: {
|
|
31
32
|
balances: {
|
|
32
|
-
type:
|
|
33
|
-
isOptional:
|
|
34
|
-
isArray:
|
|
33
|
+
type: AccountBalanceRecord,
|
|
34
|
+
isOptional: false,
|
|
35
|
+
isArray: true
|
|
35
36
|
},
|
|
36
37
|
asOf: {
|
|
37
|
-
type:
|
|
38
|
-
isOptional:
|
|
38
|
+
type: ScalarTypeEnum.DateTime(),
|
|
39
|
+
isOptional: true
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
|
|
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.",
|
|
44
46
|
fields: {
|
|
45
47
|
tenantId: {
|
|
46
|
-
type:
|
|
47
|
-
isOptional:
|
|
48
|
+
type: ScalarTypeEnum.ID(),
|
|
49
|
+
isOptional: false
|
|
48
50
|
},
|
|
49
51
|
accountId: {
|
|
50
|
-
type:
|
|
51
|
-
isOptional:
|
|
52
|
+
type: ScalarTypeEnum.ID(),
|
|
53
|
+
isOptional: false
|
|
52
54
|
},
|
|
53
55
|
connectionId: {
|
|
54
|
-
type:
|
|
55
|
-
isOptional:
|
|
56
|
+
type: ScalarTypeEnum.ID(),
|
|
57
|
+
isOptional: true
|
|
56
58
|
},
|
|
57
59
|
balanceTypes: {
|
|
58
|
-
type:
|
|
59
|
-
isArray:
|
|
60
|
-
isOptional:
|
|
60
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
61
|
+
isArray: true,
|
|
62
|
+
isOptional: true
|
|
61
63
|
},
|
|
62
64
|
forceRefresh: {
|
|
63
|
-
type:
|
|
64
|
-
isOptional:
|
|
65
|
+
type: ScalarTypeEnum.Boolean(),
|
|
66
|
+
isOptional: true
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
});
|
|
70
|
+
const OpenBankingRefreshBalancesOutput = new SchemaModel({
|
|
71
|
+
name: "OpenBankingRefreshBalancesOutput",
|
|
72
|
+
description: "Result of a balance refresh against the open banking provider.",
|
|
70
73
|
fields: {
|
|
71
74
|
balances: {
|
|
72
|
-
type:
|
|
73
|
-
isOptional:
|
|
74
|
-
isArray:
|
|
75
|
+
type: AccountBalanceRecord,
|
|
76
|
+
isOptional: false,
|
|
77
|
+
isArray: true
|
|
75
78
|
},
|
|
76
79
|
refreshedAt: {
|
|
77
|
-
type:
|
|
78
|
-
isOptional:
|
|
80
|
+
type: ScalarTypeEnum.DateTime(),
|
|
81
|
+
isOptional: false
|
|
79
82
|
},
|
|
80
83
|
errors: {
|
|
81
|
-
type:
|
|
82
|
-
isArray:
|
|
83
|
-
isOptional:
|
|
84
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
85
|
+
isArray: true,
|
|
86
|
+
isOptional: true
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
|
-
})
|
|
89
|
+
});
|
|
90
|
+
const OpenBankingGetBalances = defineQuery({
|
|
87
91
|
meta: {
|
|
88
|
-
name:
|
|
92
|
+
name: "openbanking.balances.get",
|
|
89
93
|
version: 1,
|
|
90
|
-
description:
|
|
91
|
-
goal:
|
|
92
|
-
context:
|
|
93
|
-
owners: [
|
|
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"],
|
|
94
98
|
tags: [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
"open-banking",
|
|
100
|
+
"powens",
|
|
101
|
+
"balances"
|
|
98
102
|
],
|
|
99
|
-
stability:
|
|
103
|
+
stability: "experimental"
|
|
100
104
|
},
|
|
101
105
|
io: {
|
|
102
|
-
input:
|
|
103
|
-
output:
|
|
106
|
+
input: OpenBankingGetBalancesInput,
|
|
107
|
+
output: OpenBankingGetBalancesOutput
|
|
104
108
|
},
|
|
105
|
-
policy: { auth:
|
|
106
|
-
})
|
|
109
|
+
policy: { auth: "user" }
|
|
110
|
+
});
|
|
111
|
+
const OpenBankingRefreshBalances = defineCommand({
|
|
107
112
|
meta: {
|
|
108
|
-
name:
|
|
113
|
+
name: "openbanking.balances.refresh",
|
|
109
114
|
version: 1,
|
|
110
|
-
description:
|
|
111
|
-
goal:
|
|
112
|
-
context:
|
|
113
|
-
owners: [
|
|
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"],
|
|
114
119
|
tags: [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
"open-banking",
|
|
121
|
+
"powens",
|
|
122
|
+
"balances"
|
|
118
123
|
],
|
|
119
|
-
stability:
|
|
124
|
+
stability: "experimental"
|
|
120
125
|
},
|
|
121
126
|
io: {
|
|
122
|
-
input:
|
|
123
|
-
output:
|
|
127
|
+
input: OpenBankingRefreshBalancesInput,
|
|
128
|
+
output: OpenBankingRefreshBalancesOutput
|
|
124
129
|
},
|
|
125
|
-
policy: { auth:
|
|
130
|
+
policy: { auth: "admin" },
|
|
126
131
|
telemetry: {
|
|
127
132
|
success: {
|
|
128
|
-
event: { name:
|
|
129
|
-
properties: ({ input
|
|
130
|
-
|
|
133
|
+
event: { name: OPENBANKING_TELEMETRY_EVENTS.balancesRefreshed },
|
|
134
|
+
properties: ({ input, output }) => {
|
|
135
|
+
const payload = input;
|
|
136
|
+
const result = output;
|
|
131
137
|
return {
|
|
132
|
-
tenantId:
|
|
133
|
-
accountId:
|
|
134
|
-
refreshedAt:
|
|
135
|
-
balanceCount: Array.isArray(
|
|
138
|
+
tenantId: payload?.tenantId,
|
|
139
|
+
accountId: payload?.accountId,
|
|
140
|
+
refreshedAt: result?.refreshedAt,
|
|
141
|
+
balanceCount: Array.isArray(result?.balances) ? result?.balances.length : void 0
|
|
136
142
|
};
|
|
137
143
|
}
|
|
138
144
|
},
|
|
139
145
|
failure: {
|
|
140
|
-
event: { name:
|
|
141
|
-
properties: ({ input
|
|
142
|
-
|
|
146
|
+
event: { name: OPENBANKING_TELEMETRY_EVENTS.balancesRefreshFailed },
|
|
147
|
+
properties: ({ input, error }) => {
|
|
148
|
+
const payload = input;
|
|
143
149
|
return {
|
|
144
|
-
tenantId:
|
|
145
|
-
accountId:
|
|
146
|
-
error:
|
|
150
|
+
tenantId: payload?.tenantId,
|
|
151
|
+
accountId: payload?.accountId,
|
|
152
|
+
error: error instanceof Error ? error.message : String(error ?? "unknown")
|
|
147
153
|
};
|
|
148
154
|
}
|
|
149
155
|
}
|
|
150
156
|
}
|
|
151
|
-
})
|
|
152
|
-
OpenBankingGetBalances: u,
|
|
153
|
-
OpenBankingRefreshBalances: d
|
|
154
|
-
};
|
|
157
|
+
});
|
|
155
158
|
|
|
156
|
-
//#endregion
|
|
157
|
-
export { d, u };
|
|
159
|
+
//#endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import "./accounts.js";
|
|
2
|
+
import "./transactions.js";
|
|
3
|
+
import "./balances.js";
|