@lssm/example.pocket-family-office 0.0.0-canary-20251217083314 → 0.0.0-canary-20251219202229
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/LICENSE +21 -0
- package/dist/blueprint.d.ts +2 -1
- package/dist/blueprint.d.ts.map +1 -0
- package/dist/blueprint.js +2 -1
- package/dist/blueprint.js.map +1 -0
- package/dist/connections/samples.d.ts +2 -1
- package/dist/connections/samples.d.ts.map +1 -0
- package/dist/connections/samples.js +2 -1
- package/dist/connections/samples.js.map +1 -0
- package/dist/contracts/index.d.ts +2 -1
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +2 -1
- package/dist/contracts/index.js.map +1 -0
- package/dist/knowledge/sources.sample.d.ts +2 -1
- package/dist/knowledge/sources.sample.d.ts.map +1 -0
- package/dist/knowledge/sources.sample.js +2 -1
- package/dist/knowledge/sources.sample.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +31 -32
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +18 -19
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +32 -33
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +60 -61
- package/dist/libs/contracts/dist/integrations/openbanking/models.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +2 -1
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/gmail.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/mistral.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/postmark.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/powens.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/powens.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/stripe.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +2 -1
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js.map +1 -0
- package/dist/libs/contracts/dist/ownership.js +6 -6
- package/dist/libs/contracts/dist/ownership.js.map +1 -0
- package/dist/libs/contracts/dist/schema/dist/index.js +3873 -6
- package/dist/libs/contracts/dist/schema/dist/index.js.map +1 -0
- package/dist/libs/contracts/dist/spec.js +2 -1
- package/dist/libs/contracts/dist/spec.js.map +1 -0
- package/dist/pocket-family-office.feature.d.ts +2 -1
- package/dist/pocket-family-office.feature.d.ts.map +1 -0
- package/dist/pocket-family-office.feature.js +2 -1
- package/dist/pocket-family-office.feature.js.map +1 -0
- package/dist/telemetry.d.ts +2 -1
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +2 -1
- package/dist/telemetry.js.map +1 -0
- package/dist/tenant.sample.d.ts +2 -1
- package/dist/tenant.sample.d.ts.map +1 -0
- package/dist/tenant.sample.js +2 -1
- package/dist/tenant.sample.js.map +1 -0
- package/dist/workflows/generate-financial-summary.d.ts +2 -1
- package/dist/workflows/generate-financial-summary.d.ts.map +1 -0
- package/dist/workflows/generate-financial-summary.js +2 -1
- package/dist/workflows/generate-financial-summary.js.map +1 -0
- package/dist/workflows/generate-openbanking-overview.d.ts +2 -1
- package/dist/workflows/generate-openbanking-overview.d.ts.map +1 -0
- package/dist/workflows/generate-openbanking-overview.js +2 -1
- package/dist/workflows/generate-openbanking-overview.js.map +1 -0
- package/dist/workflows/ingest-email-threads.d.ts +2 -1
- package/dist/workflows/ingest-email-threads.d.ts.map +1 -0
- package/dist/workflows/ingest-email-threads.js +2 -1
- package/dist/workflows/ingest-email-threads.js.map +1 -0
- package/dist/workflows/process-uploaded-document.d.ts +2 -1
- package/dist/workflows/process-uploaded-document.d.ts.map +1 -0
- package/dist/workflows/process-uploaded-document.js +2 -1
- package/dist/workflows/process-uploaded-document.js.map +1 -0
- package/dist/workflows/refresh-openbanking-balances.d.ts +2 -1
- package/dist/workflows/refresh-openbanking-balances.d.ts.map +1 -0
- package/dist/workflows/refresh-openbanking-balances.js +2 -1
- package/dist/workflows/refresh-openbanking-balances.js.map +1 -0
- package/dist/workflows/sync-openbanking-accounts.d.ts +2 -1
- package/dist/workflows/sync-openbanking-accounts.d.ts.map +1 -0
- package/dist/workflows/sync-openbanking-accounts.js +2 -1
- package/dist/workflows/sync-openbanking-accounts.js.map +1 -0
- package/dist/workflows/sync-openbanking-transactions.d.ts +2 -1
- package/dist/workflows/sync-openbanking-transactions.d.ts.map +1 -0
- package/dist/workflows/sync-openbanking-transactions.js +2 -1
- package/dist/workflows/sync-openbanking-transactions.js.map +1 -0
- package/dist/workflows/upcoming-payments-reminder.d.ts +2 -1
- package/dist/workflows/upcoming-payments-reminder.d.ts.map +1 -0
- package/dist/workflows/upcoming-payments-reminder.js +2 -1
- package/dist/workflows/upcoming-payments-reminder.js.map +1 -0
- package/package.json +7 -6
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Chaman Ventures, SASU
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/blueprint.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ import { AppBlueprintRegistry, AppBlueprintSpec } from "@lssm/lib.contracts/app-
|
|
|
4
4
|
declare const pocketFamilyOfficeBlueprint: AppBlueprintSpec;
|
|
5
5
|
declare function registerPocketFamilyOfficeBlueprint(registry: AppBlueprintRegistry): AppBlueprintRegistry;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { pocketFamilyOfficeBlueprint, registerPocketFamilyOfficeBlueprint };
|
|
7
|
+
export { pocketFamilyOfficeBlueprint, registerPocketFamilyOfficeBlueprint };
|
|
8
|
+
//# sourceMappingURL=blueprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprint.d.ts","names":[],"sources":["../src/blueprint.ts"],"sourcesContent":[],"mappings":";;;cAWa,6BAA6B;AAA7B,iBAkMG,mCAAA,CAlM0B,QAgMzC,EAGW,oBAHX,CAAA,EAIE,oBAJF"}
|
package/dist/blueprint.js
CHANGED
|
@@ -197,4 +197,5 @@ function registerPocketFamilyOfficeBlueprint(registry) {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
//#endregion
|
|
200
|
-
export { pocketFamilyOfficeBlueprint, registerPocketFamilyOfficeBlueprint };
|
|
200
|
+
export { pocketFamilyOfficeBlueprint, registerPocketFamilyOfficeBlueprint };
|
|
201
|
+
//# sourceMappingURL=blueprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprint.js","names":["pocketFamilyOfficeBlueprint: AppBlueprintSpec"],"sources":["../src/blueprint.ts"],"sourcesContent":["import type { AppBlueprintSpec } from '@lssm/lib.contracts/app-config/spec';\nimport type { CapabilityRef } from '@lssm/lib.contracts/capabilities';\nimport {\n OwnersEnum,\n StabilityEnum,\n TagsEnum,\n} from '@lssm/lib.contracts/ownership';\nimport type { AppBlueprintRegistry } from '@lssm/lib.contracts/app-config/spec';\n\nconst cap = (key: string, version: number): CapabilityRef => ({ key, version });\n\nexport const pocketFamilyOfficeBlueprint: AppBlueprintSpec = {\n meta: {\n name: 'pocket-family-office.app',\n version: 1,\n appId: 'pocket-family-office',\n title: 'Pocket Family Office',\n description:\n 'Household finance automation: ingest documents, track bills, remind payments, and summarise cashflow.',\n domain: 'finance',\n owners: [OwnersEnum.PlatformFinance],\n tags: [TagsEnum.Guide, 'finance', 'automation'],\n stability: StabilityEnum.Experimental,\n },\n capabilities: {\n enabled: [\n cap('ai.chat', 1),\n cap('ai.embeddings', 1),\n cap('vector-db.search', 1),\n cap('vector-db.storage', 1),\n cap('storage.objects', 1),\n cap('email.inbound', 1),\n cap('email.transactional', 1),\n cap('calendar.events', 1),\n cap('sms.outbound', 1),\n cap('ai.voice.synthesis', 1),\n cap('payments.psp', 1),\n cap('openbanking.accounts.read', 1),\n cap('openbanking.transactions.read', 1),\n cap('openbanking.balances.read', 1),\n ],\n },\n integrationSlots: [\n {\n slotId: 'primaryLLM',\n requiredCategory: 'ai-llm',\n allowedModes: ['managed', 'byok'],\n requiredCapabilities: [cap('ai.chat', 1)],\n required: true,\n description:\n 'Chat completion provider powering summarisation, explanations, and insights.',\n },\n {\n slotId: 'primaryVectorDb',\n requiredCategory: 'vector-db',\n allowedModes: ['managed', 'byok'],\n requiredCapabilities: [cap('vector-db.search', 1)],\n required: true,\n description:\n 'Vector database storing embeddings for financial documents and email threads.',\n },\n {\n slotId: 'primaryStorage',\n requiredCategory: 'storage',\n allowedModes: ['managed', 'byok'],\n requiredCapabilities: [cap('storage.objects', 1)],\n required: true,\n description:\n 'Object storage used for raw uploads and normalised documents.',\n },\n {\n slotId: 'primaryOpenBanking',\n requiredCategory: 'open-banking',\n allowedModes: ['byok'],\n requiredCapabilities: [\n cap('openbanking.accounts.read', 1),\n cap('openbanking.transactions.read', 1),\n cap('openbanking.balances.read', 1),\n ],\n required: true,\n description:\n 'Powens BYOK connection powering bank account, transaction, and balance synchronisation.',\n },\n {\n slotId: 'emailInbound',\n requiredCategory: 'email',\n allowedModes: ['managed', 'byok'],\n requiredCapabilities: [cap('email.inbound', 1)],\n required: true,\n description:\n 'Inbound email/thread sync (Gmail) feeding the knowledge corpus.',\n },\n {\n slotId: 'emailOutbound',\n requiredCategory: 'email',\n allowedModes: ['managed', 'byok'],\n requiredCapabilities: [cap('email.transactional', 1)],\n required: true,\n description: 'Transactional email delivery for reminders and summaries.',\n },\n {\n slotId: 'calendarScheduling',\n requiredCategory: 'calendar',\n allowedModes: ['managed', 'byok'],\n requiredCapabilities: [cap('calendar.events', 1)],\n required: true,\n description:\n 'Creates calendar holds for bill reviews and handoff meetings.',\n },\n {\n slotId: 'voicePlayback',\n requiredCategory: 'ai-voice',\n allowedModes: ['managed', 'byok'],\n requiredCapabilities: [cap('ai.voice.synthesis', 1)],\n required: false,\n description:\n 'Optional voice synthesis for spoken summaries (ElevenLabs).',\n },\n {\n slotId: 'smsNotifications',\n requiredCategory: 'sms',\n allowedModes: ['managed', 'byok'],\n requiredCapabilities: [cap('sms.outbound', 1)],\n required: false,\n description: 'SMS provider used for urgent reminders.',\n },\n {\n slotId: 'paymentsProcessing',\n requiredCategory: 'payments',\n allowedModes: ['managed', 'byok'],\n requiredCapabilities: [cap('payments.psp', 1)],\n required: false,\n description: 'Optional payments processor enabling bill pay automations.',\n },\n ],\n workflows: {\n processUploadedDocument: {\n name: 'pfo.workflow.process-uploaded-document',\n version: 1,\n },\n upcomingPaymentsReminder: {\n name: 'pfo.workflow.upcoming-payments-reminder',\n version: 1,\n },\n generateFinancialSummary: {\n name: 'pfo.workflow.generate-financial-summary',\n version: 1,\n },\n ingestEmailThreads: {\n name: 'pfo.workflow.ingest-email-threads',\n version: 1,\n },\n syncOpenBankingAccounts: {\n name: 'pfo.workflow.sync-openbanking-accounts',\n version: 1,\n },\n syncOpenBankingTransactions: {\n name: 'pfo.workflow.sync-openbanking-transactions',\n version: 1,\n },\n refreshOpenBankingBalances: {\n name: 'pfo.workflow.refresh-openbanking-balances',\n version: 1,\n },\n generateOpenBankingOverview: {\n name: 'pfo.workflow.generate-openbanking-overview',\n version: 1,\n },\n },\n policies: [\n { name: 'pfo.policy.tenancy', version: 1 },\n { name: 'knowledge.access.financial-docs', version: 1 },\n ],\n telemetry: {\n spec: { name: 'pfo.telemetry', version: 1 },\n },\n featureFlags: [\n {\n key: 'voice-summaries',\n enabled: false,\n description:\n 'Enable ElevenLabs spoken summaries in addition to email distribution.',\n },\n ],\n routes: [\n {\n path: '/dashboard',\n label: 'Overview',\n workflow: 'pfo.workflow.generate-financial-summary',\n },\n {\n path: '/documents/upload',\n label: 'Upload Document',\n workflow: 'pfo.workflow.process-uploaded-document',\n },\n {\n path: '/communications',\n label: 'Inbox',\n workflow: 'pfo.workflow.ingest-email-threads',\n },\n ],\n notes:\n 'Pocket Family Office blueprint pulling together finance automations for the hackathon reference implementation.',\n};\n\nexport function registerPocketFamilyOfficeBlueprint(\n registry: AppBlueprintRegistry\n): AppBlueprintRegistry {\n return registry.register(pocketFamilyOfficeBlueprint);\n}\n"],"mappings":";;;AASA,MAAM,OAAO,KAAa,aAAoC;CAAE;CAAK;CAAS;AAE9E,MAAaA,8BAAgD;CAC3D,MAAM;EACJ,MAAM;EACN,SAAS;EACT,OAAO;EACP,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,WAAW,gBAAgB;EACpC,MAAM;GAAC,SAAS;GAAO;GAAW;GAAa;EAC/C,WAAW,cAAc;EAC1B;CACD,cAAc,EACZ,SAAS;EACP,IAAI,WAAW,EAAE;EACjB,IAAI,iBAAiB,EAAE;EACvB,IAAI,oBAAoB,EAAE;EAC1B,IAAI,qBAAqB,EAAE;EAC3B,IAAI,mBAAmB,EAAE;EACzB,IAAI,iBAAiB,EAAE;EACvB,IAAI,uBAAuB,EAAE;EAC7B,IAAI,mBAAmB,EAAE;EACzB,IAAI,gBAAgB,EAAE;EACtB,IAAI,sBAAsB,EAAE;EAC5B,IAAI,gBAAgB,EAAE;EACtB,IAAI,6BAA6B,EAAE;EACnC,IAAI,iCAAiC,EAAE;EACvC,IAAI,6BAA6B,EAAE;EACpC,EACF;CACD,kBAA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,UAAU;GACV,aAAa;GACd;EACD;GACE,QAAQ;GACR,kBAAkB;GAClB,cAAc,CAAC,WAAW,OAAO;GACjC,sBAAsB,CAAC,IAAI,gBAAgB,EAAE,CAAC;GAC9C,UAAU;GACV,aAAa;GACd;EACF;CACD,WAAW;EACT,yBAAyB;GACvB,MAAM;GACN,SAAS;GACV;EACD,0BAA0B;GACxB,MAAM;GACN,SAAS;GACV;EACD,0BAA0B;GACxB,MAAM;GACN,SAAS;GACV;EACD,oBAAoB;GAClB,MAAM;GACN,SAAS;GACV;EACD,yBAAyB;GACvB,MAAM;GACN,SAAS;GACV;EACD,6BAA6B;GAC3B,MAAM;GACN,SAAS;GACV;EACD,4BAA4B;GAC1B,MAAM;GACN,SAAS;GACV;EACD,6BAA6B;GAC3B,MAAM;GACN,SAAS;GACV;EACF;CACD,UAAU,CACR;EAAE,MAAM;EAAsB,SAAS;EAAG,EAC1C;EAAE,MAAM;EAAmC,SAAS;EAAG,CACxD;CACD,WAAW,EACT,MAAM;EAAE,MAAM;EAAiB,SAAS;EAAG,EAC5C;CACD,cAAc,CACZ;EACE,KAAK;EACL,SAAS;EACT,aACE;EACH,CACF;CACD,QAAQ;EACN;GACE,MAAM;GACN,OAAO;GACP,UAAU;GACX;EACD;GACE,MAAM;GACN,OAAO;GACP,UAAU;GACX;EACD;GACE,MAAM;GACN,OAAO;GACP,UAAU;GACX;EACF;CACD,OACE;CACH;AAED,SAAgB,oCACd,UACsB;AACtB,QAAO,SAAS,SAAS,4BAA4B"}
|
|
@@ -4,4 +4,5 @@ import { IntegrationConnection } from "@lssm/lib.contracts/integrations/connecti
|
|
|
4
4
|
declare const pocketFamilyOfficeConnections: IntegrationConnection[];
|
|
5
5
|
declare function getPocketFamilyOfficeConnection(connectionId: string): IntegrationConnection | undefined;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { getPocketFamilyOfficeConnection, pocketFamilyOfficeConnections };
|
|
7
|
+
export { getPocketFamilyOfficeConnection, pocketFamilyOfficeConnections };
|
|
8
|
+
//# sourceMappingURL=samples.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"samples.d.ts","names":[],"sources":["../../src/connections/samples.ts"],"sourcesContent":[],"mappings":";;;cAUa,+BAA+B;iBAkM5B,+BAAA,wBAEb"}
|
|
@@ -223,4 +223,5 @@ function getPocketFamilyOfficeConnection(connectionId) {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
//#endregion
|
|
226
|
-
export { getPocketFamilyOfficeConnection, pocketFamilyOfficeConnections };
|
|
226
|
+
export { getPocketFamilyOfficeConnection, pocketFamilyOfficeConnections };
|
|
227
|
+
//# sourceMappingURL=samples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"samples.js","names":["pocketFamilyOfficeConnections: IntegrationConnection[]"],"sources":["../../src/connections/samples.ts"],"sourcesContent":["import type { IntegrationConnection } from '@lssm/lib.contracts/integrations/connection';\n\nconst now = new Date();\n\nconst baseMeta = {\n tenantId: 'tenant.family-office',\n createdAt: now,\n updatedAt: now,\n} as const;\n\nexport const pocketFamilyOfficeConnections: IntegrationConnection[] = [\n {\n meta: {\n ...baseMeta,\n id: 'conn-mistral-primary',\n integrationKey: 'ai-llm.mistral',\n integrationVersion: 1,\n label: 'Mistral Primary',\n },\n ownershipMode: 'managed',\n config: {\n model: 'mistral-large-latest',\n embeddingModel: 'mistral-embed',\n },\n secretProvider: 'gcp-secret-manager',\n secretRef:\n 'gcp://projects/pfo-hackathon/secrets/mistral-api-key/versions/latest',\n status: 'connected',\n health: {\n status: 'connected',\n checkedAt: now,\n latencyMs: 180,\n },\n },\n {\n meta: {\n ...baseMeta,\n id: 'conn-qdrant-finance',\n integrationKey: 'vectordb.qdrant',\n integrationVersion: 1,\n label: 'Qdrant Finance Cluster',\n },\n ownershipMode: 'managed',\n config: {\n apiUrl: 'https://qdrant.pfo.internal',\n collectionPrefix: 'tenant-family-office',\n },\n secretProvider: 'gcp-secret-manager',\n secretRef:\n 'gcp://projects/pfo-hackathon/secrets/qdrant-api-key/versions/latest',\n status: 'connected',\n health: { status: 'connected', checkedAt: now, latencyMs: 95 },\n },\n {\n meta: {\n ...baseMeta,\n id: 'conn-gcs-documents',\n integrationKey: 'storage.gcs',\n integrationVersion: 1,\n label: 'GCS Documents Bucket',\n },\n ownershipMode: 'managed',\n config: {\n bucket: 'pfo-uploads',\n prefix: 'financial-docs/',\n },\n secretProvider: 'gcp-secret-manager',\n secretRef:\n 'gcp://projects/pfo-hackathon/secrets/gcs-service-account/versions/latest',\n status: 'connected',\n health: { status: 'connected', checkedAt: now, latencyMs: 60 },\n },\n {\n meta: {\n ...baseMeta,\n id: 'conn-gmail-threads',\n integrationKey: 'email.gmail',\n integrationVersion: 1,\n label: 'Gmail Household Threads',\n },\n ownershipMode: 'byok',\n config: {\n labelIds: ['FINANCE', 'INBOX'],\n includeSpamTrash: false,\n },\n secretProvider: 'gcp-secret-manager',\n secretRef:\n 'gcp://projects/pfo-hackathon/secrets/gmail-refresh-token/versions/latest',\n status: 'connected',\n health: { status: 'connected', checkedAt: now, latencyMs: 320 },\n },\n {\n meta: {\n ...baseMeta,\n id: 'conn-postmark-outbound',\n integrationKey: 'email.postmark',\n integrationVersion: 1,\n label: 'Postmark Transactional',\n },\n ownershipMode: 'managed',\n config: {\n messageStream: 'outbound',\n fromEmail: 'family.office@pfo.dev',\n },\n secretProvider: 'gcp-secret-manager',\n secretRef:\n 'gcp://projects/pfo-hackathon/secrets/postmark-server-token/versions/latest',\n status: 'connected',\n health: { status: 'connected', checkedAt: now, latencyMs: 210 },\n },\n {\n meta: {\n ...baseMeta,\n id: 'conn-google-calendar',\n integrationKey: 'calendar.google',\n integrationVersion: 1,\n label: 'Household Calendar',\n },\n ownershipMode: 'managed',\n config: {\n calendarId: 'primary',\n },\n secretProvider: 'gcp-secret-manager',\n secretRef:\n 'gcp://projects/pfo-hackathon/secrets/google-calendar-service-account/versions/latest',\n status: 'connected',\n health: { status: 'connected', checkedAt: now, latencyMs: 140 },\n },\n {\n meta: {\n ...baseMeta,\n id: 'conn-elevenlabs-voice',\n integrationKey: 'ai-voice.elevenlabs',\n integrationVersion: 1,\n label: 'ElevenLabs Voice',\n },\n ownershipMode: 'byok',\n config: {\n defaultVoiceId: 'pNInz6obpgDQGcFmaJgB',\n },\n secretProvider: 'gcp-secret-manager',\n secretRef:\n 'gcp://projects/pfo-hackathon/secrets/elevenlabs-api-key/versions/latest',\n status: 'connected',\n health: { status: 'connected', checkedAt: now, latencyMs: 250 },\n },\n {\n meta: {\n ...baseMeta,\n id: 'conn-twilio-sms',\n integrationKey: 'sms.twilio',\n integrationVersion: 1,\n label: 'Twilio SMS',\n },\n ownershipMode: 'managed',\n config: {\n fromNumber: '+15552340000',\n },\n secretProvider: 'gcp-secret-manager',\n secretRef:\n 'gcp://projects/pfo-hackathon/secrets/twilio-auth-token/versions/latest',\n status: 'connected',\n health: { status: 'connected', checkedAt: now, latencyMs: 180 },\n },\n {\n meta: {\n ...baseMeta,\n id: 'conn-stripe-recurring',\n integrationKey: 'payments.stripe',\n integrationVersion: 1,\n label: 'Stripe Recurring Billing',\n },\n ownershipMode: 'managed',\n config: {\n accountId: 'acct_1PFOHACKATHON',\n region: 'eu-west-1',\n },\n secretProvider: 'gcp-secret-manager',\n secretRef:\n 'gcp://projects/pfo-hackathon/secrets/stripe-secret-key/versions/latest',\n status: 'connected',\n health: { status: 'connected', checkedAt: now, latencyMs: 220 },\n },\n {\n meta: {\n ...baseMeta,\n id: 'conn-powens-primary',\n integrationKey: 'openbanking.powens',\n integrationVersion: 1,\n label: 'Powens Open Banking',\n },\n ownershipMode: 'byok',\n config: {\n environment: 'sandbox',\n baseUrl: 'https://api-sandbox.powens.com/v2',\n },\n secretProvider: 'gcp-secret-manager',\n secretRef:\n 'gcp://projects/pfo-hackathon/secrets/powens-credentials/versions/latest',\n status: 'connected',\n health: { status: 'connected', checkedAt: now, latencyMs: 410 },\n },\n];\n\nexport function getPocketFamilyOfficeConnection(\n connectionId: string\n): IntegrationConnection | undefined {\n return pocketFamilyOfficeConnections.find(\n (connection) => connection.meta.id === connectionId\n );\n}\n"],"mappings":";AAEA,MAAM,sBAAM,IAAI,MAAM;AAEtB,MAAM,WAAW;CACf,UAAU;CACV,WAAW;CACX,WAAW;CACZ;AAED,MAAaA,gCAAyD;CACpE;EACE,MAAM;GACJ,GAAG;GACH,IAAI;GACJ,gBAAgB;GAChB,oBAAoB;GACpB,OAAO;GACR;EACD,eAAe;EACf,QAAQ;GACN,OAAO;GACP,gBAAgB;GACjB;EACD,gBAAgB;EAChB,WACE;EACF,QAAQ;EACR,QAAQ;GACN,QAAQ;GACR,WAAW;GACX,WAAW;GACZ;EACF;CACD;EACE,MAAM;GACJ,GAAG;GACH,IAAI;GACJ,gBAAgB;GAChB,oBAAoB;GACpB,OAAO;GACR;EACD,eAAe;EACf,QAAQ;GACN,QAAQ;GACR,kBAAkB;GACnB;EACD,gBAAgB;EAChB,WACE;EACF,QAAQ;EACR,QAAQ;GAAE,QAAQ;GAAa,WAAW;GAAK,WAAW;GAAI;EAC/D;CACD;EACE,MAAM;GACJ,GAAG;GACH,IAAI;GACJ,gBAAgB;GAChB,oBAAoB;GACpB,OAAO;GACR;EACD,eAAe;EACf,QAAQ;GACN,QAAQ;GACR,QAAQ;GACT;EACD,gBAAgB;EAChB,WACE;EACF,QAAQ;EACR,QAAQ;GAAE,QAAQ;GAAa,WAAW;GAAK,WAAW;GAAI;EAC/D;CACD;EACE,MAAM;GACJ,GAAG;GACH,IAAI;GACJ,gBAAgB;GAChB,oBAAoB;GACpB,OAAO;GACR;EACD,eAAe;EACf,QAAQ;GACN,UAAU,CAAC,WAAW,QAAQ;GAC9B,kBAAkB;GACnB;EACD,gBAAgB;EAChB,WACE;EACF,QAAQ;EACR,QAAQ;GAAE,QAAQ;GAAa,WAAW;GAAK,WAAW;GAAK;EAChE;CACD;EACE,MAAM;GACJ,GAAG;GACH,IAAI;GACJ,gBAAgB;GAChB,o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,QAAQ;EACR,QAAQ;GAAE,QAAQ;GAAa,WAAW;GAAK,WAAW;GAAK;EAChE;CACF;AAED,SAAgB,gCACd,cACmC;AACnC,QAAO,8BAA8B,MAClC,eAAe,WAAW,KAAK,OAAO,aACxC"}
|
|
@@ -115,4 +115,5 @@ type OpenBankingOverviewOutput = z.infer<typeof OpenBankingOverviewOutput>;
|
|
|
115
115
|
declare const generateOpenBankingOverviewContract: ContractSpec<OpenBankingOverviewInput, OpenBankingOverviewOutput>;
|
|
116
116
|
declare const pocketFamilyOfficeContracts: Record<string, ContractSpec<any, any>>;
|
|
117
117
|
//#endregion
|
|
118
|
-
export { FinancialSummaryInput, FinancialSummaryOutput, OpenBankingOverviewInput, OpenBankingOverviewOutput, PaymentReminderInput, PaymentReminderOutput, SummaryDispatchInput, SummaryDispatchOutput, SyncEmailThreadsInput, SyncEmailThreadsOutput, UploadDocumentInput, UploadDocumentOutput, dispatchFinancialSummaryContract, generateFinancialSummaryContract, generateOpenBankingOverviewContract, pocketFamilyOfficeContracts, schedulePaymentReminderContract, syncEmailThreadsContract, uploadDocumentContract };
|
|
118
|
+
export { FinancialSummaryInput, FinancialSummaryOutput, OpenBankingOverviewInput, OpenBankingOverviewOutput, PaymentReminderInput, PaymentReminderOutput, SummaryDispatchInput, SummaryDispatchOutput, SyncEmailThreadsInput, SyncEmailThreadsOutput, UploadDocumentInput, UploadDocumentOutput, dispatchFinancialSummaryContract, generateFinancialSummaryContract, generateOpenBankingOverviewContract, pocketFamilyOfficeContracts, schedulePaymentReminderContract, syncEmailThreadsContract, uploadDocumentContract };
|
|
119
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/contracts/index.ts"],"sourcesContent":[],"mappings":";;;;cASM,qBAAmB,CAAA,CAAA;;EAAnB,SAAA,aAQJ;;;;;;;;;;;cAEI,sBAAoB,CAAA,CAAA;EAVD,UAAA,aAAA;EAAA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FinancialSummaryContract, generateFinancialSummaryContract, generateOpenBankingOverviewContract, pocketFamilyOfficeContracts, schedulePaymentReminderContract, syncEmailThreadsContract, uploadDocumentContract };
|
|
270
|
+
export { dispatchFinancialSummaryContract, generateFinancialSummaryContract, generateOpenBankingOverviewContract, pocketFamilyOfficeContracts, schedulePaymentReminderContract, syncEmailThreadsContract, uploadDocumentContract };
|
|
271
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["uploadDocumentContract: ContractSpec<\n UploadDocumentInput,\n UploadDocumentOutput\n>","schedulePaymentReminderContract: ContractSpec<\n PaymentReminderInput,\n PaymentReminderOutput\n>","generateFinancialSummaryContract: ContractSpec<\n FinancialSummaryInput,\n FinancialSummaryOutput\n>","syncEmailThreadsContract: ContractSpec<\n SyncEmailThreadsInput,\n SyncEmailThreadsOutput\n>","dispatchFinancialSummaryContract: ContractSpec<\n SummaryDispatchInput,\n SummaryDispatchOutput\n>","generateOpenBankingOverviewContract: ContractSpec<\n OpenBankingOverviewInput,\n OpenBankingOverviewOutput\n>","pocketFamilyOfficeContracts: Record<\n string,\n ContractSpec<any, any>\n>"],"sources":["../../src/contracts/index.ts"],"sourcesContent":["import * as z from 'zod';\nimport type { ContractSpec } from '@lssm/lib.contracts/spec';\nimport {\n OwnersEnum,\n StabilityEnum,\n TagsEnum,\n} from '@lssm/lib.contracts/ownership';\nimport { OPENBANKING_TELEMETRY_EVENTS } from '@lssm/lib.contracts/integrations';\n\nconst UploadDocumentInput = z.object({\n bucket: z.string().min(1),\n objectKey: z.string().min(1),\n mimeType: z.string().min(1),\n bytes: z.number().int().nonnegative(),\n tags: z.array(z.string()).default([]),\n uploadedAt: z.coerce.date(),\n source: z.enum(['upload', 'email', 'sync']).default('upload'),\n});\n\nconst UploadDocumentOutput = z.object({\n documentId: z.string(),\n ingestionJobId: z.string(),\n});\n\nexport type UploadDocumentInput = z.infer<typeof UploadDocumentInput>;\nexport type UploadDocumentOutput = z.infer<typeof UploadDocumentOutput>;\n\nexport const uploadDocumentContract: ContractSpec<\n UploadDocumentInput,\n UploadDocumentOutput\n> = {\n meta: {\n name: 'pfo.documents.upload',\n version: 1,\n kind: 'command',\n title: 'Upload Financial Document',\n description:\n 'Stores an object in tenant storage and schedules ingestion into the knowledge base.',\n domain: 'finance',\n owners: [OwnersEnum.PlatformFinance],\n tags: ['documents', 'ingestion', TagsEnum.Guide],\n stability: StabilityEnum.Experimental,\n },\n io: {\n input: UploadDocumentInput,\n output: UploadDocumentOutput,\n },\n policy: {\n auth: {\n scopes: ['documents:ingest'],\n },\n rateLimit: {\n points: 30,\n windowSeconds: 60,\n },\n },\n telemetry: {\n events: [\n {\n name: 'pfo.documents.uploaded',\n description: 'Document queued for ingestion',\n },\n ],\n },\n};\n\nconst PaymentReminderInput = z.object({\n billId: z.string(),\n recipientEmail: z.string().email(),\n recipientPhone: z.string().optional(),\n dueDate: z.coerce.date(),\n amountCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n channel: z.enum(['email', 'sms', 'both']).default('email'),\n memo: z.string().max(280).optional(),\n});\n\nconst PaymentReminderOutput = z.object({\n reminderId: z.string(),\n scheduledAt: z.coerce.date(),\n});\n\nexport type PaymentReminderInput = z.infer<typeof PaymentReminderInput>;\nexport type PaymentReminderOutput = z.infer<typeof PaymentReminderOutput>;\n\nexport const schedulePaymentReminderContract: ContractSpec<\n PaymentReminderInput,\n PaymentReminderOutput\n> = {\n meta: {\n name: 'pfo.reminders.schedule-payment',\n version: 1,\n kind: 'command',\n title: 'Schedule Payment Reminder',\n description:\n 'Queues outbound email/SMS reminders for upcoming bills and adds an optional calendar hold.',\n domain: 'finance',\n owners: [OwnersEnum.PlatformFinance],\n tags: ['payments', 'reminders', TagsEnum.Automation],\n stability: StabilityEnum.Beta,\n },\n io: {\n input: PaymentReminderInput,\n output: PaymentReminderOutput,\n },\n policy: {\n auth: {\n scopes: ['reminders:write'],\n },\n },\n telemetry: {\n events: [\n {\n name: 'pfo.reminders.scheduled',\n description: 'Reminder scheduled for delivery',\n },\n ],\n },\n};\n\nconst FinancialSummaryInput = z.object({\n period: z.enum(['7d', '30d', '90d']).default('30d'),\n includeVoiceSummary: z.boolean().default(false),\n});\n\nconst FinancialSummaryOutput = z.object({\n summaryId: z.string(),\n generatedAt: z.coerce.date(),\n markdown: z.string(),\n highlights: z.array(\n z.object({\n label: z.string(),\n value: z.string(),\n })\n ),\n cashflowDelta: z.number(),\n});\n\nexport type FinancialSummaryInput = z.infer<typeof FinancialSummaryInput>;\nexport type FinancialSummaryOutput = z.infer<typeof FinancialSummaryOutput>;\n\nexport const generateFinancialSummaryContract: ContractSpec<\n FinancialSummaryInput,\n FinancialSummaryOutput\n> = {\n meta: {\n name: 'pfo.summary.generate',\n version: 1,\n kind: 'query',\n title: 'Generate Financial Summary',\n description:\n 'Runs RAG over financial documents and email threads to provide a natural-language summary with key metrics.',\n domain: 'finance',\n owners: [OwnersEnum.PlatformFinance],\n tags: ['summary', 'ai', TagsEnum.Automation],\n stability: StabilityEnum.Beta,\n },\n io: {\n input: FinancialSummaryInput,\n output: FinancialSummaryOutput,\n },\n telemetry: {\n events: [\n {\n name: 'pfo.summary.generated',\n description: 'Financial summary generated for a tenant',\n },\n ],\n },\n};\n\nconst SyncEmailThreadsInput = z.object({\n labelIds: z.array(z.string()).default(['INBOX']),\n maxThreads: z.number().int().positive().max(500).default(50),\n syncSinceMinutes: z\n .number()\n .int()\n .positive()\n .default(60 * 24),\n});\n\nconst SyncEmailThreadsOutput = z.object({\n syncedThreads: z.number().int().nonnegative(),\n lastMessageAt: z.coerce.date().optional(),\n});\n\nexport type SyncEmailThreadsInput = z.infer<typeof SyncEmailThreadsInput>;\nexport type SyncEmailThreadsOutput = z.infer<typeof SyncEmailThreadsOutput>;\n\nexport const syncEmailThreadsContract: ContractSpec<\n SyncEmailThreadsInput,\n SyncEmailThreadsOutput\n> = {\n meta: {\n name: 'pfo.email.sync-threads',\n version: 1,\n kind: 'command',\n title: 'Sync Gmail Threads',\n description:\n 'Triggers ingestion of Gmail threads into the operational knowledge space.',\n domain: 'communications',\n owners: [OwnersEnum.PlatformMessaging],\n tags: ['gmail', 'knowledge', TagsEnum.Automation],\n stability: StabilityEnum.Beta,\n },\n io: {\n input: SyncEmailThreadsInput,\n output: SyncEmailThreadsOutput,\n },\n telemetry: {\n events: [\n {\n name: 'pfo.email.synced',\n description: 'Gmail threads synced into knowledge base',\n },\n ],\n },\n};\n\nconst SummaryDispatchInput = z.object({\n summaryId: z.string(),\n recipientEmail: z.string().email(),\n recipientName: z.string().optional(),\n includeVoice: z.boolean().default(false),\n voiceRecipient: z.string().optional(),\n});\n\nconst SummaryDispatchOutput = z.object({\n dispatchId: z.string(),\n emailSent: z.boolean(),\n voiceUrl: z.string().optional(),\n});\n\nexport type SummaryDispatchInput = z.infer<typeof SummaryDispatchInput>;\nexport type SummaryDispatchOutput = z.infer<typeof SummaryDispatchOutput>;\n\nexport const dispatchFinancialSummaryContract: ContractSpec<\n SummaryDispatchInput,\n SummaryDispatchOutput\n> = {\n meta: {\n name: 'pfo.summary.dispatch',\n version: 1,\n kind: 'command',\n title: 'Dispatch Financial Summary',\n description:\n 'Delivers the generated summary via email and optionally synthesises a voice note.',\n domain: 'finance',\n owners: [OwnersEnum.PlatformMessaging],\n tags: ['summary', 'communications', TagsEnum.Automation],\n stability: StabilityEnum.Experimental,\n },\n io: {\n input: SummaryDispatchInput,\n output: SummaryDispatchOutput,\n },\n policy: {\n auth: {\n scopes: ['summary:dispatch'],\n },\n },\n telemetry: {\n events: [\n {\n name: 'pfo.summary.dispatched',\n description: 'Financial summary delivered to designated recipients',\n },\n ],\n },\n};\n\nconst OpenBankingOverviewInput = z.object({\n tenantId: z.string().min(1),\n accountIds: z.array(z.string().min(1)).optional(),\n period: z.enum(['week', 'month', 'quarter']).default('month'),\n asOf: z.coerce.date().optional(),\n includeCategories: z.boolean().default(true),\n includeCashflowTrend: z.boolean().default(true),\n});\n\nconst OpenBankingOverviewOutput = z.object({\n knowledgeEntryId: z.string(),\n periodStart: z.coerce.date(),\n periodEnd: z.coerce.date(),\n generatedAt: z.coerce.date(),\n summaryPath: z.string().optional(),\n});\n\nexport type OpenBankingOverviewInput = z.infer<typeof OpenBankingOverviewInput>;\nexport type OpenBankingOverviewOutput = z.infer<\n typeof OpenBankingOverviewOutput\n>;\n\nexport const generateOpenBankingOverviewContract: ContractSpec<\n OpenBankingOverviewInput,\n OpenBankingOverviewOutput\n> = {\n meta: {\n name: 'pfo.openbanking.generate-overview',\n version: 1,\n kind: 'command',\n title: 'Generate Open Banking Overview',\n description:\n 'Aggregates balances and transactions into a derived financial overview stored in the knowledge layer.',\n domain: 'finance',\n owners: [OwnersEnum.PlatformFinance],\n tags: ['open-banking', 'summary', TagsEnum.Automation],\n stability: StabilityEnum.Experimental,\n },\n io: {\n input: OpenBankingOverviewInput,\n output: OpenBankingOverviewOutput,\n },\n policy: {\n auth: {\n scopes: ['openbanking:derive'],\n },\n },\n telemetry: {\n events: [\n {\n name: OPENBANKING_TELEMETRY_EVENTS.overviewGenerated,\n description:\n 'Derived financial overview generated from Powens banking data.',\n },\n ],\n },\n};\n\nexport const pocketFamilyOfficeContracts: Record<\n string,\n ContractSpec<any, any>\n> = {\n 'pfo.documents.upload': uploadDocumentContract,\n 'pfo.reminders.schedule-payment': schedulePaymentReminderContract,\n 'pfo.summary.generate': generateFinancialSummaryContract,\n 'pfo.summary.dispatch': dispatchFinancialSummaryContract,\n 'pfo.email.sync-threads': syncEmailThreadsContract,\n 'pfo.openbanking.generate-overview': generateOpenBankingOverviewContract,\n};\n"],"mappings":";;;;;;AASA,MAAM,sBAAsB,EAAE,OAAO;CACnC,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE;CACzB,WAAW,EAAE,QAAQ,CAAC,IAAI,EAAE;CAC5B,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE;CAC3B,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,aAA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are const pocketFamilyOfficeKnowledgeSources: KnowledgeSourceConfig[];
|
|
5
5
|
//#endregion
|
|
6
|
-
export { pocketFamilyOfficeKnowledgeSources };
|
|
6
|
+
export { pocketFamilyOfficeKnowledgeSources };
|
|
7
|
+
//# sourceMappingURL=sources.sample.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.sample.d.ts","names":[],"sources":["../../src/knowledge/sources.sample.ts"],"sourcesContent":[],"mappings":";;;cAIa,oCAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.sample.js","names":["pocketFamilyOfficeKnowledgeSources: KnowledgeSourceConfig[]"],"sources":["../../src/knowledge/sources.sample.ts"],"sourcesContent":["import type { KnowledgeSourceConfig } from '@lssm/lib.contracts/knowledge/source';\n\nconst now = new Date();\n\nexport const pocketFamilyOfficeKnowledgeSources: KnowledgeSourceConfig[] = [\n {\n meta: {\n id: 'source-financial-uploads',\n tenantId: 'tenant.family-office',\n spaceKey: 'knowledge.financial-docs',\n spaceVersion: 1,\n label: 'Uploaded Financial Documents',\n sourceType: 'file_upload',\n createdAt: now,\n updatedAt: now,\n },\n config: {\n bucket: 'pfo-uploads',\n prefix: 'financial-docs/',\n },\n syncSchedule: {\n enabled: true,\n intervalMs: 15 * 60 * 1000,\n },\n lastSync: {\n timestamp: now,\n success: true,\n },\n },\n {\n meta: {\n id: 'source-gmail-threads',\n tenantId: 'tenant.family-office',\n spaceKey: 'knowledge.email-threads',\n spaceVersion: 1,\n label: 'Household Gmail Threads',\n sourceType: 'email',\n createdAt: now,\n updatedAt: now,\n },\n config: {\n labelIds: ['INBOX', 'FINANCE'],\n },\n syncSchedule: {\n enabled: true,\n intervalMs: 5 * 60 * 1000,\n },\n lastSync: {\n timestamp: now,\n success: true,\n },\n },\n];\n"],"mappings":";AAEA,MAAM,sBAAM,IAAI,MAAM;AAEtB,MAAaA,qCAA8D,CACzE;CACE,MAAM;EACJ,IAAI;EACJ,UAAU;EACV,UAAU;EACV,cAAc;EACd,OAAO;EACP,YAAY;EACZ,WAAW;EACX,WAAW;EACZ;CACD,QAAQ;EACN,QAAQ;EACR,QAAQ;EACT;CACD,cAAc;EACZ,SAAS;EACT,YAAY,MAAU;EACvB;CACD,UAAU;EACR,WAAW;EACX,SAAS;EACV;CACF,EACD;CACE,MAAM;EACJ,IAAI;EACJ,UAAU;EACV,UAAU;EACV,cAAc;EACd,OAAO;EACP,YAAY;EACZ,WAAW;EACX,WAAW;EACZ;CACD,QAAQ,EACN,UAAU,CAAC,SAAS,UAAU,EAC/B;CACD,cAAc;EACZ,SAAS;EACT,YAAY,MAAS;EACtB;CACD,UAAU;EACR,WAAW;EACX,SAAS;EACV;CACF,CACF"}
|
|
@@ -1,46 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SchemaModel } from "../../../schema/dist/SchemaModel.js";
|
|
3
|
-
import "../../../schema/dist/index.js";
|
|
1
|
+
import { E5, x8 } from "../../../schema/dist/index.js";
|
|
4
2
|
import { BankAccountRecord } from "../models.js";
|
|
5
3
|
import { OPENBANKING_TELEMETRY_EVENTS } from "../telemetry.js";
|
|
6
4
|
import { defineCommand, defineQuery } from "../../../spec.js";
|
|
7
5
|
|
|
8
6
|
//#region ../../libs/contracts/dist/integrations/openbanking/contracts/accounts.js
|
|
9
|
-
const OpenBankingListAccountsInput = new
|
|
7
|
+
const OpenBankingListAccountsInput = new x8({
|
|
10
8
|
name: "OpenBankingListAccountsInput",
|
|
11
9
|
description: "Parameters for listing bank accounts through the open banking provider.",
|
|
12
10
|
fields: {
|
|
13
11
|
tenantId: {
|
|
14
|
-
type:
|
|
12
|
+
type: E5.ID(),
|
|
15
13
|
isOptional: false
|
|
16
14
|
},
|
|
17
15
|
userId: {
|
|
18
|
-
type:
|
|
16
|
+
type: E5.ID(),
|
|
19
17
|
isOptional: false
|
|
20
18
|
},
|
|
21
19
|
connectionId: {
|
|
22
|
-
type:
|
|
20
|
+
type: E5.ID(),
|
|
23
21
|
isOptional: true
|
|
24
22
|
},
|
|
25
23
|
includeBalances: {
|
|
26
|
-
type:
|
|
24
|
+
type: E5.Boolean(),
|
|
27
25
|
isOptional: true
|
|
28
26
|
},
|
|
29
27
|
institutionId: {
|
|
30
|
-
type:
|
|
28
|
+
type: E5.String_unsecure(),
|
|
31
29
|
isOptional: true
|
|
32
30
|
},
|
|
33
31
|
cursor: {
|
|
34
|
-
type:
|
|
32
|
+
type: E5.String_unsecure(),
|
|
35
33
|
isOptional: true
|
|
36
34
|
},
|
|
37
35
|
pageSize: {
|
|
38
|
-
type:
|
|
36
|
+
type: E5.Int_unsecure(),
|
|
39
37
|
isOptional: true
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
});
|
|
43
|
-
const OpenBankingListAccountsOutput = new
|
|
41
|
+
const OpenBankingListAccountsOutput = new x8({
|
|
44
42
|
name: "OpenBankingListAccountsOutput",
|
|
45
43
|
description: "Paginated list of bank accounts available to the tenant and user.",
|
|
46
44
|
fields: {
|
|
@@ -50,87 +48,87 @@ const OpenBankingListAccountsOutput = new SchemaModel({
|
|
|
50
48
|
isArray: true
|
|
51
49
|
},
|
|
52
50
|
nextCursor: {
|
|
53
|
-
type:
|
|
51
|
+
type: E5.String_unsecure(),
|
|
54
52
|
isOptional: true
|
|
55
53
|
},
|
|
56
54
|
hasMore: {
|
|
57
|
-
type:
|
|
55
|
+
type: E5.Boolean(),
|
|
58
56
|
isOptional: true
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
59
|
});
|
|
62
|
-
const OpenBankingGetAccountInput = new
|
|
60
|
+
const OpenBankingGetAccountInput = new x8({
|
|
63
61
|
name: "OpenBankingGetAccountInput",
|
|
64
62
|
description: "Parameters for retrieving a specific bank account.",
|
|
65
63
|
fields: {
|
|
66
64
|
tenantId: {
|
|
67
|
-
type:
|
|
65
|
+
type: E5.ID(),
|
|
68
66
|
isOptional: false
|
|
69
67
|
},
|
|
70
68
|
accountId: {
|
|
71
|
-
type:
|
|
69
|
+
type: E5.ID(),
|
|
72
70
|
isOptional: false
|
|
73
71
|
},
|
|
74
72
|
includeBalances: {
|
|
75
|
-
type:
|
|
73
|
+
type: E5.Boolean(),
|
|
76
74
|
isOptional: true
|
|
77
75
|
},
|
|
78
76
|
includeLatestTransactions: {
|
|
79
|
-
type:
|
|
77
|
+
type: E5.Boolean(),
|
|
80
78
|
isOptional: true
|
|
81
79
|
}
|
|
82
80
|
}
|
|
83
81
|
});
|
|
84
|
-
const OpenBankingSyncAccountsInput = new
|
|
82
|
+
const OpenBankingSyncAccountsInput = new x8({
|
|
85
83
|
name: "OpenBankingSyncAccountsInput",
|
|
86
84
|
description: "Command payload to trigger an account synchronisation against the open banking provider.",
|
|
87
85
|
fields: {
|
|
88
86
|
tenantId: {
|
|
89
|
-
type:
|
|
87
|
+
type: E5.ID(),
|
|
90
88
|
isOptional: false
|
|
91
89
|
},
|
|
92
90
|
userId: {
|
|
93
|
-
type:
|
|
91
|
+
type: E5.ID(),
|
|
94
92
|
isOptional: true
|
|
95
93
|
},
|
|
96
94
|
connectionId: {
|
|
97
|
-
type:
|
|
95
|
+
type: E5.ID(),
|
|
98
96
|
isOptional: false
|
|
99
97
|
},
|
|
100
98
|
accountIds: {
|
|
101
|
-
type:
|
|
99
|
+
type: E5.ID(),
|
|
102
100
|
isArray: true,
|
|
103
101
|
isOptional: true
|
|
104
102
|
},
|
|
105
103
|
forceFullRefresh: {
|
|
106
|
-
type:
|
|
104
|
+
type: E5.Boolean(),
|
|
107
105
|
isOptional: true
|
|
108
106
|
},
|
|
109
107
|
triggerWorkflows: {
|
|
110
|
-
type:
|
|
108
|
+
type: E5.Boolean(),
|
|
111
109
|
isOptional: true
|
|
112
110
|
}
|
|
113
111
|
}
|
|
114
112
|
});
|
|
115
|
-
const OpenBankingSyncAccountsOutput = new
|
|
113
|
+
const OpenBankingSyncAccountsOutput = new x8({
|
|
116
114
|
name: "OpenBankingSyncAccountsOutput",
|
|
117
115
|
description: "Result of a bank account synchronisation run.",
|
|
118
116
|
fields: {
|
|
119
117
|
synced: {
|
|
120
|
-
type:
|
|
118
|
+
type: E5.Int_unsecure(),
|
|
121
119
|
isOptional: false
|
|
122
120
|
},
|
|
123
121
|
failed: {
|
|
124
|
-
type:
|
|
122
|
+
type: E5.Int_unsecure(),
|
|
125
123
|
isOptional: false
|
|
126
124
|
},
|
|
127
125
|
errors: {
|
|
128
|
-
type:
|
|
126
|
+
type: E5.String_unsecure(),
|
|
129
127
|
isArray: true,
|
|
130
128
|
isOptional: true
|
|
131
129
|
},
|
|
132
130
|
nextSyncSuggestedAt: {
|
|
133
|
-
type:
|
|
131
|
+
type: E5.DateTime(),
|
|
134
132
|
isOptional: true
|
|
135
133
|
}
|
|
136
134
|
}
|
|
@@ -225,4 +223,5 @@ const OpenBankingSyncAccounts = defineCommand({
|
|
|
225
223
|
}
|
|
226
224
|
});
|
|
227
225
|
|
|
228
|
-
//#endregion
|
|
226
|
+
//#endregion
|
|
227
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.js","names":[],"sources":["../../../../../../../../../libs/contracts/dist/integrations/openbanking/contracts/accounts.js"],"sourcesContent":["import { E5, x8 } from \"../../../schema/dist/index.js\";\nimport { defineCommand, defineQuery } from \"../../../spec.js\";\nimport { BankAccountRecord } from \"../models.js\";\nimport { OPENBANKING_TELEMETRY_EVENTS } from \"../telemetry.js\";\n\n//#region src/integrations/openbanking/contracts/accounts.ts\nconst OpenBankingListAccountsInput = new x8({\n\tname: \"OpenBankingListAccountsInput\",\n\tdescription: \"Parameters for listing bank accounts through the open banking provider.\",\n\tfields: {\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tuserId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tconnectionId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t},\n\t\tincludeBalances: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: true\n\t\t},\n\t\tinstitutionId: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tcursor: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tpageSize: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst OpenBankingListAccountsOutput = new x8({\n\tname: \"OpenBankingListAccountsOutput\",\n\tdescription: \"Paginated list of bank accounts available to the tenant and user.\",\n\tfields: {\n\t\taccounts: {\n\t\t\ttype: BankAccountRecord,\n\t\t\tisOptional: false,\n\t\t\tisArray: true\n\t\t},\n\t\tnextCursor: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\thasMore: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst OpenBankingGetAccountInput = new x8({\n\tname: \"OpenBankingGetAccountInput\",\n\tdescription: \"Parameters for retrieving a specific bank account.\",\n\tfields: {\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\taccountId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tincludeBalances: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: true\n\t\t},\n\t\tincludeLatestTransactions: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst OpenBankingSyncAccountsInput = new x8({\n\tname: \"OpenBankingSyncAccountsInput\",\n\tdescription: \"Command payload to trigger an account synchronisation against the open banking provider.\",\n\tfields: {\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tuserId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t},\n\t\tconnectionId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\taccountIds: {\n\t\t\ttype: E5.ID(),\n\t\t\tisArray: true,\n\t\t\tisOptional: true\n\t\t},\n\t\tforceFullRefresh: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: true\n\t\t},\n\t\ttriggerWorkflows: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst OpenBankingSyncAccountsOutput = new x8({\n\tname: \"OpenBankingSyncAccountsOutput\",\n\tdescription: \"Result of a bank account synchronisation run.\",\n\tfields: {\n\t\tsynced: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tfailed: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\terrors: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisArray: true,\n\t\t\tisOptional: true\n\t\t},\n\t\tnextSyncSuggestedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst OpenBankingListAccounts = defineQuery({\n\tmeta: {\n\t\tname: \"openbanking.accounts.list\",\n\t\tversion: 1,\n\t\tdescription: \"List bank accounts available to a tenant/user via Powens Open Banking.\",\n\t\tgoal: \"Provide downstream workflows with the set of accounts accessible via the configured open banking connection.\",\n\t\tcontext: \"Used by Pocket Family Office dashboards and sync workflows to enumerate bank accounts prior to syncing balances or transactions.\",\n\t\towners: [\"platform.finance\"],\n\t\ttags: [\n\t\t\t\"open-banking\",\n\t\t\t\"powens\",\n\t\t\t\"accounts\"\n\t\t],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: OpenBankingListAccountsInput,\n\t\toutput: OpenBankingListAccountsOutput\n\t},\n\tpolicy: { auth: \"user\" }\n});\nconst OpenBankingGetAccount = defineQuery({\n\tmeta: {\n\t\tname: \"openbanking.accounts.get\",\n\t\tversion: 1,\n\t\tdescription: \"Retrieve the canonical bank account record for the given account identifier.\",\n\t\tgoal: \"Allow user-facing experiences and automations to display up-to-date account metadata.\",\n\t\tcontext: \"Invoked by UI surfaces and workflow automation steps that require detailed metadata for a specific bank account.\",\n\t\towners: [\"platform.finance\"],\n\t\ttags: [\n\t\t\t\"open-banking\",\n\t\t\t\"powens\",\n\t\t\t\"accounts\"\n\t\t],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: OpenBankingGetAccountInput,\n\t\toutput: BankAccountRecord\n\t},\n\tpolicy: { auth: \"user\" }\n});\nconst OpenBankingSyncAccounts = defineCommand({\n\tmeta: {\n\t\tname: \"openbanking.accounts.sync\",\n\t\tversion: 1,\n\t\tdescription: \"Initiate a synchronisation run to refresh bank account metadata from Powens.\",\n\t\tgoal: \"Keep canonical bank account records aligned with the external open banking provider.\",\n\t\tcontext: \"Triggered by scheduled workflows or manual operator actions to reconcile account metadata prior to transaction/balance syncs.\",\n\t\towners: [\"platform.finance\"],\n\t\ttags: [\n\t\t\t\"open-banking\",\n\t\t\t\"powens\",\n\t\t\t\"accounts\"\n\t\t],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: OpenBankingSyncAccountsInput,\n\t\toutput: OpenBankingSyncAccountsOutput\n\t},\n\tpolicy: { auth: \"admin\" },\n\ttelemetry: {\n\t\tsuccess: {\n\t\t\tevent: { name: OPENBANKING_TELEMETRY_EVENTS.accountsSynced },\n\t\t\tproperties: ({ input, output }) => {\n\t\t\t\tconst payload = input;\n\t\t\t\tconst result = output;\n\t\t\t\treturn {\n\t\t\t\t\ttenantId: payload?.tenantId,\n\t\t\t\t\tconnectionId: payload?.connectionId,\n\t\t\t\t\tsynced: result?.synced,\n\t\t\t\t\tfailed: result?.failed\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\tfailure: {\n\t\t\tevent: { name: OPENBANKING_TELEMETRY_EVENTS.accountsSyncFailed },\n\t\t\tproperties: ({ input, error }) => {\n\t\t\t\tconst payload = input;\n\t\t\t\treturn {\n\t\t\t\t\ttenantId: payload?.tenantId,\n\t\t\t\t\tconnectionId: payload?.connectionId,\n\t\t\t\t\terror: error instanceof Error ? error.message : String(error ?? \"unknown\")\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n});\nconst openBankingAccountContracts = {\n\tOpenBankingListAccounts,\n\tOpenBankingGetAccount,\n\tOpenBankingSyncAccounts\n};\nfunction registerOpenBankingAccountContracts(registry) {\n\treturn registry.register(OpenBankingListAccounts).register(OpenBankingGetAccount).register(OpenBankingSyncAccounts);\n}\n\n//#endregion\nexport { OpenBankingGetAccount, OpenBankingListAccounts, OpenBankingSyncAccounts, openBankingAccountContracts, registerOpenBankingAccountContracts };\n//# sourceMappingURL=accounts.js.map"],"mappings":";;;;;;AAMA,MAAM,+BAA+B,IAAI,GAAG;CAC3C,MAAM;CACN,aAAa;CACb,QAAQ;EACP,UAAU;GACT,MAAM,GAAG,IAAI;GACb,YAAY;GACZ;EACD,QAAQ;GACP,MAAM,GAAG,IAAI;GACb,YAAY;GACZ;EACD,cAAc;GACb,MAAM,GAAG,IAAI;GACb,YAAY;GACZ;EACD,iBAAiB;GAChB,MAAM,GAAG,SAAS;GAClB,YAAY;GACZ;EACD,eAAe;GACd,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,QAAQ;GACP,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,UAAU;GACT,MAAM,GAAG,cAAc;GACvB,YAAY;GACZ;EACD;CACD,CAAC;AACF,MAAM,gCAAgC,IAAI,GAAG;CAC5C,MAAM;CACN,aAAa;CACb,QAAQ;EACP,UAAU;GACT,MAAM;GACN,YAAY;GACZ,SAAS;GACT;EACD,YAAY;GACX,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,SAAS;GACR,MAAM,GAAG,SAAS;GAClB,YAAY;GACZ;EACD;CACD,CAAC;AACF,MAAM,6BAA6B,IAAI,GAAG;CACzC,MAAM;CACN,aAAa;CACb,QAAQ;EACP,UAAU;GACT,MAAM,GAA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ACT,aAAa;EACb,MAAM;EACN,SAAS;EACT,QAAQ,CAAC,mBAAmB;EAC5B,MAAM;GACL;GACA;GACA;GACA;EACD,WAAW;EACX;CACD,IAAI;EACH,OAAO;EACP,QAAQ;EACR;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,CAAC;AACF,MAAM,0BAA0B,cAAc;CAC7C,MAAM;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,SAAS;EACT,QAAQ,CAAC,mBAAmB;EAC5B,MAAM;GACL;GACA;GACA;GACA;EACD,WAAW;EACX;CACD,IAAI;EACH,OAAO;EACP,QAAQ;EACR;CACD,QAAQ,EAAE,MAAM,SAAS;CACzB,WAAW;EACV,SAAS;GACR,OAAO,EAAE,MAAM,6BAA6B,gBAAgB;GAC5D,aAAa,EAAE,OAAO,aAAa;IAClC,MAAM,UAAU;IAChB,MAAM,SAAS;AACf,WAAO;KACN,UAAU,SAAS;KACnB,cAAc,SAAS;KACvB,QAAQ,QAAQ;KAChB,QAAQ,QAAQ;KAChB;;GAEF;EACD,SAAS;GACR,OAAO,EAAE,MAAM,6BAA6B,oBAAoB;GAChE,aAAa,EAAE,OAAO,YAAY;IACjC,MAAM,UAAU;AAChB,WAAO;KACN,UAAU,SAAS;KACnB,cAAc,SAAS;KACvB,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,SAAS,UAAU;KAC1E;;GAEF;EACD;CACD,CAAC"}
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SchemaModel } from "../../../schema/dist/SchemaModel.js";
|
|
3
|
-
import "../../../schema/dist/index.js";
|
|
1
|
+
import { E5, x8 } from "../../../schema/dist/index.js";
|
|
4
2
|
import { AccountBalanceRecord } from "../models.js";
|
|
5
3
|
import { OPENBANKING_TELEMETRY_EVENTS } from "../telemetry.js";
|
|
6
4
|
import { defineCommand, defineQuery } from "../../../spec.js";
|
|
7
5
|
|
|
8
6
|
//#region ../../libs/contracts/dist/integrations/openbanking/contracts/balances.js
|
|
9
|
-
const OpenBankingGetBalancesInput = new
|
|
7
|
+
const OpenBankingGetBalancesInput = new x8({
|
|
10
8
|
name: "OpenBankingGetBalancesInput",
|
|
11
9
|
description: "Parameters for retrieving bank account balances from the canonical ledger.",
|
|
12
10
|
fields: {
|
|
13
11
|
tenantId: {
|
|
14
|
-
type:
|
|
12
|
+
type: E5.ID(),
|
|
15
13
|
isOptional: false
|
|
16
14
|
},
|
|
17
15
|
accountId: {
|
|
18
|
-
type:
|
|
16
|
+
type: E5.ID(),
|
|
19
17
|
isOptional: false
|
|
20
18
|
},
|
|
21
19
|
balanceTypes: {
|
|
22
|
-
type:
|
|
20
|
+
type: E5.String_unsecure(),
|
|
23
21
|
isArray: true,
|
|
24
22
|
isOptional: true
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
});
|
|
28
|
-
const OpenBankingGetBalancesOutput = new
|
|
26
|
+
const OpenBankingGetBalancesOutput = new x8({
|
|
29
27
|
name: "OpenBankingGetBalancesOutput",
|
|
30
28
|
description: "Canonical balances for a bank account.",
|
|
31
29
|
fields: {
|
|
@@ -35,39 +33,39 @@ const OpenBankingGetBalancesOutput = new SchemaModel({
|
|
|
35
33
|
isArray: true
|
|
36
34
|
},
|
|
37
35
|
asOf: {
|
|
38
|
-
type:
|
|
36
|
+
type: E5.DateTime(),
|
|
39
37
|
isOptional: true
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
});
|
|
43
|
-
const OpenBankingRefreshBalancesInput = new
|
|
41
|
+
const OpenBankingRefreshBalancesInput = new x8({
|
|
44
42
|
name: "OpenBankingRefreshBalancesInput",
|
|
45
43
|
description: "Command payload to refresh balances for a bank account via the open banking provider.",
|
|
46
44
|
fields: {
|
|
47
45
|
tenantId: {
|
|
48
|
-
type:
|
|
46
|
+
type: E5.ID(),
|
|
49
47
|
isOptional: false
|
|
50
48
|
},
|
|
51
49
|
accountId: {
|
|
52
|
-
type:
|
|
50
|
+
type: E5.ID(),
|
|
53
51
|
isOptional: false
|
|
54
52
|
},
|
|
55
53
|
connectionId: {
|
|
56
|
-
type:
|
|
54
|
+
type: E5.ID(),
|
|
57
55
|
isOptional: true
|
|
58
56
|
},
|
|
59
57
|
balanceTypes: {
|
|
60
|
-
type:
|
|
58
|
+
type: E5.String_unsecure(),
|
|
61
59
|
isArray: true,
|
|
62
60
|
isOptional: true
|
|
63
61
|
},
|
|
64
62
|
forceRefresh: {
|
|
65
|
-
type:
|
|
63
|
+
type: E5.Boolean(),
|
|
66
64
|
isOptional: true
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
});
|
|
70
|
-
const OpenBankingRefreshBalancesOutput = new
|
|
68
|
+
const OpenBankingRefreshBalancesOutput = new x8({
|
|
71
69
|
name: "OpenBankingRefreshBalancesOutput",
|
|
72
70
|
description: "Result of a balance refresh against the open banking provider.",
|
|
73
71
|
fields: {
|
|
@@ -77,11 +75,11 @@ const OpenBankingRefreshBalancesOutput = new SchemaModel({
|
|
|
77
75
|
isArray: true
|
|
78
76
|
},
|
|
79
77
|
refreshedAt: {
|
|
80
|
-
type:
|
|
78
|
+
type: E5.DateTime(),
|
|
81
79
|
isOptional: false
|
|
82
80
|
},
|
|
83
81
|
errors: {
|
|
84
|
-
type:
|
|
82
|
+
type: E5.String_unsecure(),
|
|
85
83
|
isArray: true,
|
|
86
84
|
isOptional: true
|
|
87
85
|
}
|
|
@@ -156,4 +154,5 @@ const OpenBankingRefreshBalances = defineCommand({
|
|
|
156
154
|
}
|
|
157
155
|
});
|
|
158
156
|
|
|
159
|
-
//#endregion
|
|
157
|
+
//#endregion
|
|
158
|
+
//# sourceMappingURL=balances.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balances.js","names":[],"sources":["../../../../../../../../../libs/contracts/dist/integrations/openbanking/contracts/balances.js"],"sourcesContent":["import { E5, x8 } from \"../../../schema/dist/index.js\";\nimport { defineCommand, defineQuery } from \"../../../spec.js\";\nimport { AccountBalanceRecord } from \"../models.js\";\nimport { OPENBANKING_TELEMETRY_EVENTS } from \"../telemetry.js\";\n\n//#region src/integrations/openbanking/contracts/balances.ts\nconst OpenBankingGetBalancesInput = new x8({\n\tname: \"OpenBankingGetBalancesInput\",\n\tdescription: \"Parameters for retrieving bank account balances from the canonical ledger.\",\n\tfields: {\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\taccountId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tbalanceTypes: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisArray: true,\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst OpenBankingGetBalancesOutput = new x8({\n\tname: \"OpenBankingGetBalancesOutput\",\n\tdescription: \"Canonical balances for a bank account.\",\n\tfields: {\n\t\tbalances: {\n\t\t\ttype: AccountBalanceRecord,\n\t\t\tisOptional: false,\n\t\t\tisArray: true\n\t\t},\n\t\tasOf: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst OpenBankingRefreshBalancesInput = new x8({\n\tname: \"OpenBankingRefreshBalancesInput\",\n\tdescription: \"Command payload to refresh balances for a bank account via the open banking provider.\",\n\tfields: {\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\taccountId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tconnectionId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t},\n\t\tbalanceTypes: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisArray: true,\n\t\t\tisOptional: true\n\t\t},\n\t\tforceRefresh: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst OpenBankingRefreshBalancesOutput = new x8({\n\tname: \"OpenBankingRefreshBalancesOutput\",\n\tdescription: \"Result of a balance refresh against the open banking provider.\",\n\tfields: {\n\t\tbalances: {\n\t\t\ttype: AccountBalanceRecord,\n\t\t\tisOptional: false,\n\t\t\tisArray: true\n\t\t},\n\t\trefreshedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: false\n\t\t},\n\t\terrors: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisArray: true,\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst OpenBankingGetBalances = defineQuery({\n\tmeta: {\n\t\tname: \"openbanking.balances.get\",\n\t\tversion: 1,\n\t\tdescription: \"Retrieve the latest cached balances for a bank account.\",\n\t\tgoal: \"Expose current and available balances required by dashboards and analytics.\",\n\t\tcontext: \"Used by Pocket Family Office UI surfaces and automation steps that require balance totals prior to generating summaries.\",\n\t\towners: [\"platform.finance\"],\n\t\ttags: [\n\t\t\t\"open-banking\",\n\t\t\t\"powens\",\n\t\t\t\"balances\"\n\t\t],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: OpenBankingGetBalancesInput,\n\t\toutput: OpenBankingGetBalancesOutput\n\t},\n\tpolicy: { auth: \"user\" }\n});\nconst OpenBankingRefreshBalances = defineCommand({\n\tmeta: {\n\t\tname: \"openbanking.balances.refresh\",\n\t\tversion: 1,\n\t\tdescription: \"Refresh balances for a bank account via the configured open banking provider.\",\n\t\tgoal: \"Ensure canonical balance records reflect the latest values from Powens.\",\n\t\tcontext: \"Triggered by scheduled workflows before generating summaries or forecasting cashflow.\",\n\t\towners: [\"platform.finance\"],\n\t\ttags: [\n\t\t\t\"open-banking\",\n\t\t\t\"powens\",\n\t\t\t\"balances\"\n\t\t],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: OpenBankingRefreshBalancesInput,\n\t\toutput: OpenBankingRefreshBalancesOutput\n\t},\n\tpolicy: { auth: \"admin\" },\n\ttelemetry: {\n\t\tsuccess: {\n\t\t\tevent: { name: OPENBANKING_TELEMETRY_EVENTS.balancesRefreshed },\n\t\t\tproperties: ({ input, output }) => {\n\t\t\t\tconst payload = input;\n\t\t\t\tconst result = output;\n\t\t\t\treturn {\n\t\t\t\t\ttenantId: payload?.tenantId,\n\t\t\t\t\taccountId: payload?.accountId,\n\t\t\t\t\trefreshedAt: result?.refreshedAt,\n\t\t\t\t\tbalanceCount: Array.isArray(result?.balances) ? result?.balances.length : void 0\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\tfailure: {\n\t\t\tevent: { name: OPENBANKING_TELEMETRY_EVENTS.balancesRefreshFailed },\n\t\t\tproperties: ({ input, error }) => {\n\t\t\t\tconst payload = input;\n\t\t\t\treturn {\n\t\t\t\t\ttenantId: payload?.tenantId,\n\t\t\t\t\taccountId: payload?.accountId,\n\t\t\t\t\terror: error instanceof Error ? error.message : String(error ?? \"unknown\")\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n});\nconst openBankingBalanceContracts = {\n\tOpenBankingGetBalances,\n\tOpenBankingRefreshBalances\n};\nfunction registerOpenBankingBalanceContracts(registry) {\n\treturn registry.register(OpenBankingGetBalances).register(OpenBankingRefreshBalances);\n}\n\n//#endregion\nexport { OpenBankingGetBalances, OpenBankingRefreshBalances, openBankingBalanceContracts, registerOpenBankingBalanceContracts };\n//# sourceMappingURL=balances.js.map"],"mappings":";;;;;;AAMA,MAAM,8BAA8B,IAAI,GAAG;CAC1C,MAAM;CACN,aAAa;CACb,QAAQ;EACP,UAAU;GACT,MAAM,GAAG,IAAI;GACb,YAAY;GACZ;EACD,WAAW;GACV,MAAM,GAAG,IAAI;GACb,YAAY;GACZ;EACD,cAAc;GACb,MAAM,GAAG,iBAAiB;GAC1B,SAAS;GACT,YAAY;GACZ;EACD;CACD,CAAC;AACF,MAAM,+BAA+B,IAAI,GAAG;CAC3C,MAAM;CACN,aAAa;CACb,QAAQ;EACP,UAAU;GACT,MAAM;GACN,YAAY;GACZ,SAAS;GACT;EACD,MAAM;GACL,MAAM,GAAG,UAAU;GACnB,YAAY;GACZ;EACD;CACD,CAAC;AACF,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