@contractspec/example.openbanking-powens 3.7.6 → 3.7.10

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.
@@ -2,26 +2,30 @@ $ contractspec-bun-build prebuild
2
2
  $ bun run prebuild && bun run build:bundle && bun run build:types
3
3
  $ contractspec-bun-build prebuild
4
4
  $ contractspec-bun-build transpile
5
- [contractspec-bun-build] transpile target=bun root=src entries=7 noBundle=false
6
- Bundled 7 modules in 33ms
5
+ [contractspec-bun-build] transpile target=bun root=src entries=9 noBundle=false
6
+ Bundled 9 modules in 15ms
7
7
 
8
- docs/index.js 1.58 KB (entry point)
9
- ./index.js 8.80 KB (entry point)
10
- docs/openbanking-powens.docblock.js 1.58 KB (entry point)
11
- ./example.js 1.0 KB (entry point)
12
- handlers/oauth-callback.js 2.26 KB (entry point)
13
- handlers/webhook-handler.js 3.22 KB (entry point)
14
- ./openbanking-powens.feature.js 0.72 KB (entry point)
8
+ docs/index.js 1.58 KB (entry point)
9
+ ./index.js 10.38 KB (entry point)
10
+ ./openbanking-powens.feature.js 0.72 KB (entry point)
11
+ docs/openbanking-powens.docblock.js 1.58 KB (entry point)
12
+ ./example.js 1.0 KB (entry point)
13
+ handlers/oauth-callback.js 2.26 KB (entry point)
14
+ handlers/webhook-handler.js 3.22 KB (entry point)
15
+ jobs/index.js 1.60 KB (entry point)
16
+ jobs/powens-sync-dispatch.job.js 1.60 KB (entry point)
15
17
 
16
- [contractspec-bun-build] transpile target=node root=src entries=7 noBundle=false
17
- Bundled 7 modules in 41ms
18
+ [contractspec-bun-build] transpile target=node root=src entries=9 noBundle=false
19
+ Bundled 9 modules in 31ms
18
20
 
19
- docs/index.js 1.56 KB (entry point)
20
- ./index.js 8.78 KB (entry point)
21
- docs/openbanking-powens.docblock.js 1.56 KB (entry point)
22
- ./example.js 1.0 KB (entry point)
23
- handlers/oauth-callback.js 2.26 KB (entry point)
24
- handlers/webhook-handler.js 3.21 KB (entry point)
25
- ./openbanking-powens.feature.js 0.72 KB (entry point)
21
+ docs/index.js 1.56 KB (entry point)
22
+ ./index.js 10.36 KB (entry point)
23
+ ./openbanking-powens.feature.js 0.72 KB (entry point)
24
+ docs/openbanking-powens.docblock.js 1.56 KB (entry point)
25
+ ./example.js 1.0 KB (entry point)
26
+ handlers/oauth-callback.js 2.26 KB (entry point)
27
+ handlers/webhook-handler.js 3.21 KB (entry point)
28
+ jobs/index.js 1.59 KB (entry point)
29
+ jobs/powens-sync-dispatch.job.js 1.59 KB (entry point)
26
30
 
27
31
  $ contractspec-bun-build types
package/AGENTS.md CHANGED
@@ -1,30 +1,53 @@
1
- # AI Agent Guide -- `@contractspec/example.openbanking-powens`
1
+ # AI Agent Guide `@contractspec/example.openbanking-powens`
2
2
 
3
3
  Scope: `packages/examples/openbanking-powens/*`
4
4
 
5
- OpenBanking Powens example: OAuth callback + webhook handler patterns for provider integration.
5
+ OpenBanking Powens example: OAuth callback + webhook handler patterns (provider + workflows).
6
6
 
7
7
  ## Quick Context
8
8
 
9
- - **Layer**: example
10
- - **Related Packages**: `integration.providers-impls`, `lib.contracts-spec`
9
+ - Layer: `example`.
10
+ - Package visibility: published package.
11
+ - Primary consumers are example explorers, template authors, and documentation readers.
12
+ - Related packages: `@contractspec/integration.providers-impls`, `@contractspec/lib.contracts-spec`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
11
13
 
12
- ## What This Demonstrates
14
+ ## Architecture
13
15
 
14
- - OAuth callback handler pattern for open banking
15
- - Webhook handler for asynchronous bank event ingestion
16
- - Provider integration via contracts-integrations
16
+ - `src/docs/` contains docblocks and documentation-facing exports.
17
+ - `src/example.ts` is the runnable example entrypoint.
18
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
19
+ - `src/index.ts` is the root public barrel and package entrypoint.
20
+ - `src/openbanking-powens.feature.ts` defines a feature entrypoint.
17
21
 
18
- ## Public Exports
22
+ ## Public Surface
19
23
 
20
- - `.` -- root barrel
21
- - `./handlers/oauth-callback` -- OAuth flow handler
22
- - `./handlers/webhook-handler` -- webhook ingestion
23
- - `./docs`, `./example`
24
+ - Export `.` resolves through `./src/index.ts`.
25
+ - Export `./docs` resolves through `./src/docs/index.ts`.
26
+ - Export `./docs/openbanking-powens.docblock` resolves through `./src/docs/openbanking-powens.docblock.ts`.
27
+ - Export `./example` resolves through `./src/example.ts`.
28
+ - Export `./handlers/oauth-callback` resolves through `./src/handlers/oauth-callback.ts`.
29
+ - Export `./handlers/webhook-handler` resolves through `./src/handlers/webhook-handler.ts`.
30
+ - Export `./openbanking-powens.feature` resolves through `./src/openbanking-powens.feature.ts`.
31
+
32
+ ## Guardrails
33
+
34
+ - Keep the example package demonstrative, buildable, and aligned with the exported feature surface.
35
+ - Do not add hidden production assumptions that are not actually implemented in the example.
36
+ - Changes here can affect downstream packages such as `@contractspec/integration.providers-impls`, `@contractspec/lib.contracts-spec`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
37
+ - Changes here can affect downstream packages such as `@contractspec/integration.providers-impls`, `@contractspec/lib.contracts-spec`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
24
38
 
25
39
  ## Local Commands
26
40
 
27
- - Build: `bun run build`
28
- - Dev: `bun run dev`
29
- - Test: `bun test --pass-with-no-tests`
30
- - Typecheck: `bun run typecheck`
41
+ - `bun run dev` — contractspec-bun-build dev
42
+ - `bun run build`bun run prebuild && bun run build:bundle && bun run build:types
43
+ - `bun run test`bun test --pass-with-no-tests
44
+ - `bun run lint` — bun lint:fix
45
+ - `bun run lint:check` — biome check .
46
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
47
+ - `bun run typecheck` — tsc --noEmit
48
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
49
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
50
+ - `bun run clean` — rimraf dist .turbo
51
+ - `bun run build:bundle` — contractspec-bun-build transpile
52
+ - `bun run build:types` — contractspec-bun-build types
53
+ - `bun run prebuild` — contractspec-bun-build prebuild
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @contractspec/example.openbanking-powens
2
2
 
3
+ ## 3.7.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 1a44cb6: feat: improve examples to increase coverage of Contracts type
8
+ - Updated dependencies [1a44cb6]
9
+ - @contractspec/integration.providers-impls@3.8.2
10
+ - @contractspec/lib.contracts-spec@4.1.2
11
+
12
+ ## 3.7.9
13
+
14
+ ### Patch Changes
15
+
16
+ - fix: release
17
+ - Updated dependencies
18
+ - @contractspec/integration.providers-impls@3.8.1
19
+ - @contractspec/lib.contracts-spec@4.1.1
20
+
3
21
  ## 3.7.6
4
22
 
5
23
  ### Patch Changes
@@ -383,6 +401,7 @@
383
401
  - 7f3203a: fix: make workspace test runs resilient when packages have no tests
384
402
 
385
403
  Updates package test scripts to pass cleanly when no matching test files exist:
404
+
386
405
  - Uses `bun test --pass-with-no-tests` in Bun-based packages that currently ship without test files.
387
406
  - Uses `jest --passWithNoTests` for the UI kit web package.
388
407
  - Adds `.vscode-test.mjs` for `vscode-contractspec` so VS Code extension test runs have an explicit config and stop failing on missing default configuration.
@@ -717,14 +736,17 @@
717
736
  feat: Contract layers support (features, examples, app-configs)
718
737
 
719
738
  ### New CLI Commands
739
+
720
740
  - `contractspec list layers` - List all contract layers with filtering
721
741
 
722
742
  ### Enhanced Commands
743
+
723
744
  - `contractspec ci` - New `layers` check category validates features/examples/config
724
745
  - `contractspec doctor` - New `layers` health checks
725
746
  - `contractspec integrity` - Now shows layer statistics
726
747
 
727
748
  ### New APIs
749
+
728
750
  - `discoverLayers()` - Scan workspace for all layer files
729
751
  - `scanExampleSource()` - Parse ExampleSpec from source code
730
752
  - `isExampleFile()` - Check if file is an example spec
package/README.md CHANGED
@@ -1,32 +1,73 @@
1
1
  # @contractspec/example.openbanking-powens
2
2
 
3
- Website: https://contractspec.io/
3
+ Website: https://contractspec.io
4
4
 
5
- **OAuth callback + webhook handler patterns**
6
-
7
- OpenBanking Powens example: OAuth callback + webhook handler patterns. Framework-neutral handlers operate on standard `Request` for use in Next.js, Elysia, or any fetch-compatible runtime.
5
+ **OpenBanking Powens example: OAuth callback + webhook handler patterns (provider + workflows).**
8
6
 
9
7
  ## What This Demonstrates
10
8
 
11
- - OAuth callback handler for Powens open banking
12
- - Webhook handler for Powens events
13
- - Example spec with provider and workflow orchestration
9
+ - OAuth callback handler pattern for open banking.
10
+ - Webhook handler for asynchronous bank event ingestion.
11
+ - Canonical `job` export via `PowensSyncDispatchJob`.
12
+ - Provider integration via contracts-integrations.
13
+ - `src/docs/` contains docblocks and documentation-facing exports.
14
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
14
15
 
15
- ## Exports
16
+ ## Running Locally
16
17
 
17
- - `.` — main entry (registers docs, exports example and handlers)
18
- - `./docs` doc blocks
19
- - `./example` example metadata
20
- - `./handlers/oauth-callback` OAuth callback handler
21
- - `./handlers/webhook-handler` webhook handler
18
+ From `packages/examples/openbanking-powens`:
19
+ - `bun run dev`
20
+ - `bun run build`
21
+ - `bun run test`
22
+ - `bun run typecheck`
22
23
 
23
24
  ## Usage
24
25
 
25
- ```ts
26
- import { powensOAuthCallbackHandler } from "@contractspec/example.openbanking-powens/handlers/oauth-callback";
27
- import { powensWebhookHandler } from "@contractspec/example.openbanking-powens/handlers/webhook-handler";
26
+ Use `@contractspec/example.openbanking-powens` as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
27
+
28
+ ## Architecture
29
+
30
+ - `src/docs/` contains docblocks and documentation-facing exports.
31
+ - `src/example.ts` is the runnable example entrypoint.
32
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
33
+ - `src/index.ts` is the root public barrel and package entrypoint.
34
+ - `src/jobs/` contains the exported Powens dispatch job spec.
35
+ - `src/openbanking-powens.feature.ts` defines a feature entrypoint.
36
+
37
+ ## Public Entry Points
38
+
39
+ - Export `.` resolves through `./src/index.ts`.
40
+ - Export `./docs` resolves through `./src/docs/index.ts`.
41
+ - Export `./docs/openbanking-powens.docblock` resolves through `./src/docs/openbanking-powens.docblock.ts`.
42
+ - Export `./example` resolves through `./src/example.ts`.
43
+ - Export `./handlers/oauth-callback` resolves through `./src/handlers/oauth-callback.ts`.
44
+ - Export `./handlers/webhook-handler` resolves through `./src/handlers/webhook-handler.ts`.
45
+ - Export `./jobs` resolves through `./src/jobs/index.ts`.
46
+ - Export `./jobs/powens-sync-dispatch.job` resolves through `./src/jobs/powens-sync-dispatch.job.ts`.
47
+ - Export `./openbanking-powens.feature` resolves through `./src/openbanking-powens.feature.ts`.
48
+ - The package publishes 8 total export subpaths; keep docs aligned with `package.json`.
49
+
50
+ ## Local Commands
51
+
52
+ - `bun run dev` — contractspec-bun-build dev
53
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
54
+ - `bun run test` — bun test --pass-with-no-tests
55
+ - `bun run lint` — bun lint:fix
56
+ - `bun run lint:check` — biome check .
57
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
58
+ - `bun run typecheck` — tsc --noEmit
59
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
60
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
61
+ - `bun run clean` — rimraf dist .turbo
62
+ - `bun run build:bundle` — contractspec-bun-build transpile
63
+ - `bun run build:types` — contractspec-bun-build types
64
+ - `bun run prebuild` — contractspec-bun-build prebuild
65
+
66
+ ## Recent Updates
67
+
68
+ - Replace eslint+prettier by biomejs to optimize speed.
69
+ - Missing contract layers.
70
+
71
+ ## Notes
28
72
 
29
- // Wire into your framework (Next.js, Elysia, etc.)
30
- // GET /api/oauth/callback → powensOAuthCallbackHandler
31
- // POST /api/webhooks/powens → powensWebhookHandler
32
- ```
73
+ - Works alongside `@contractspec/integration.providers-impls`, `@contractspec/lib.contracts-spec`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,7 @@
1
+ /**
2
+ * Example OAuth callback handler for Powens (open banking).
3
+ *
4
+ * This example stays framework-neutral: it operates on the standard `Request`
5
+ * type so it can be used in Next.js, Elysia, or any fetch-compatible runtime.
6
+ */
1
7
  export declare function powensOAuthCallbackHandler(req: Request): Promise<Response>;
@@ -1 +1,7 @@
1
+ /**
2
+ * Example Powens webhook handler (fetch-compatible).
3
+ *
4
+ * Verifies signature, then enqueues the canonical workflows to keep the ledger
5
+ * in sync. Unknown events are ignored (or can be recorded by the app layer).
6
+ */
1
7
  export declare function powensWebhookHandler(req: Request): Promise<Response>;
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // src/handlers/webhook-handler.ts
3
- import { createHmac, timingSafeEqual } from "crypto";
4
3
  import { PowensOpenBankingProvider } from "@contractspec/integration.providers-impls/impls/powens-openbanking";
4
+ import { createHmac, timingSafeEqual } from "crypto";
5
5
  async function powensWebhookHandler(req) {
6
6
  const signature = req.headers.get("x-powens-signature");
7
7
  const stateHeader = req.headers.get("x-powens-state");
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ export { default as example } from './example';
1
2
  export * from './handlers/oauth-callback';
2
3
  export * from './handlers/webhook-handler';
4
+ export * from './jobs';
3
5
  export * from './openbanking-powens.feature';
4
- export { default as example } from './example';
5
6
  import './docs';
package/dist/index.js CHANGED
@@ -131,8 +131,8 @@ var fakeWorkflowQueue = {
131
131
  };
132
132
 
133
133
  // src/handlers/webhook-handler.ts
134
- import { createHmac, timingSafeEqual } from "crypto";
135
134
  import { PowensOpenBankingProvider as PowensOpenBankingProvider2 } from "@contractspec/integration.providers-impls/impls/powens-openbanking";
135
+ import { createHmac, timingSafeEqual } from "crypto";
136
136
  async function powensWebhookHandler(req) {
137
137
  const signature = req.headers.get("x-powens-signature");
138
138
  const stateHeader = req.headers.get("x-powens-state");
@@ -223,6 +223,47 @@ var fakeTelemetryLogger = {
223
223
  record: async (_payload) => {}
224
224
  };
225
225
 
226
+ // src/jobs/powens-sync-dispatch.job.ts
227
+ import { defineJob } from "@contractspec/lib.contracts-spec/jobs/spec";
228
+ import {
229
+ OwnersEnum,
230
+ StabilityEnum
231
+ } from "@contractspec/lib.contracts-spec/ownership";
232
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
233
+ var PowensSyncDispatchPayloadModel = defineSchemaModel({
234
+ name: "PowensSyncDispatchPayload",
235
+ description: "Payload enqueued from Powens OAuth callbacks or webhooks before dispatching sync workflows.",
236
+ fields: {
237
+ tenantId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
238
+ connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
239
+ eventType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
240
+ userUuid: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
241
+ accountUuid: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
242
+ }
243
+ });
244
+ var PowensSyncDispatchJob = defineJob({
245
+ meta: {
246
+ key: "openbanking-powens.job.sync-dispatch",
247
+ version: "1.0.0",
248
+ title: "Powens Sync Dispatch Job",
249
+ description: "Queues the canonical open banking sync workflows after Powens callbacks and webhooks are verified.",
250
+ domain: "open-banking",
251
+ owners: [OwnersEnum.PlatformFinance],
252
+ tags: ["openbanking", "powens", "job", "webhook"],
253
+ stability: StabilityEnum.Experimental
254
+ },
255
+ payload: {
256
+ schema: PowensSyncDispatchPayloadModel
257
+ },
258
+ retry: {
259
+ maxRetries: 5,
260
+ initialBackoffMs: 30000,
261
+ maxBackoffMs: 300000,
262
+ multiplier: 2,
263
+ jitter: true
264
+ },
265
+ timeoutMs: 60000
266
+ });
226
267
  // src/openbanking-powens.feature.ts
227
268
  import { defineFeature } from "@contractspec/lib.contracts-spec";
228
269
  var OpenbankingPowensFeature = defineFeature({
@@ -248,5 +289,6 @@ export {
248
289
  powensWebhookHandler,
249
290
  powensOAuthCallbackHandler,
250
291
  example_default as example,
292
+ PowensSyncDispatchJob,
251
293
  OpenbankingPowensFeature
252
294
  };
@@ -0,0 +1 @@
1
+ export * from './powens-sync-dispatch.job';
@@ -0,0 +1,45 @@
1
+ // @bun
2
+ // src/jobs/powens-sync-dispatch.job.ts
3
+ import { defineJob } from "@contractspec/lib.contracts-spec/jobs/spec";
4
+ import {
5
+ OwnersEnum,
6
+ StabilityEnum
7
+ } from "@contractspec/lib.contracts-spec/ownership";
8
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
9
+ var PowensSyncDispatchPayloadModel = defineSchemaModel({
10
+ name: "PowensSyncDispatchPayload",
11
+ description: "Payload enqueued from Powens OAuth callbacks or webhooks before dispatching sync workflows.",
12
+ fields: {
13
+ tenantId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
14
+ connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
15
+ eventType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
16
+ userUuid: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
17
+ accountUuid: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
18
+ }
19
+ });
20
+ var PowensSyncDispatchJob = defineJob({
21
+ meta: {
22
+ key: "openbanking-powens.job.sync-dispatch",
23
+ version: "1.0.0",
24
+ title: "Powens Sync Dispatch Job",
25
+ description: "Queues the canonical open banking sync workflows after Powens callbacks and webhooks are verified.",
26
+ domain: "open-banking",
27
+ owners: [OwnersEnum.PlatformFinance],
28
+ tags: ["openbanking", "powens", "job", "webhook"],
29
+ stability: StabilityEnum.Experimental
30
+ },
31
+ payload: {
32
+ schema: PowensSyncDispatchPayloadModel
33
+ },
34
+ retry: {
35
+ maxRetries: 5,
36
+ initialBackoffMs: 30000,
37
+ maxBackoffMs: 300000,
38
+ multiplier: 2,
39
+ jitter: true
40
+ },
41
+ timeoutMs: 60000
42
+ });
43
+ export {
44
+ PowensSyncDispatchJob
45
+ };
@@ -0,0 +1 @@
1
+ export declare const PowensSyncDispatchJob: import("@contractspec/lib.contracts-spec/jobs/spec").JobSpec;
@@ -0,0 +1,45 @@
1
+ // @bun
2
+ // src/jobs/powens-sync-dispatch.job.ts
3
+ import { defineJob } from "@contractspec/lib.contracts-spec/jobs/spec";
4
+ import {
5
+ OwnersEnum,
6
+ StabilityEnum
7
+ } from "@contractspec/lib.contracts-spec/ownership";
8
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
9
+ var PowensSyncDispatchPayloadModel = defineSchemaModel({
10
+ name: "PowensSyncDispatchPayload",
11
+ description: "Payload enqueued from Powens OAuth callbacks or webhooks before dispatching sync workflows.",
12
+ fields: {
13
+ tenantId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
14
+ connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
15
+ eventType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
16
+ userUuid: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
17
+ accountUuid: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
18
+ }
19
+ });
20
+ var PowensSyncDispatchJob = defineJob({
21
+ meta: {
22
+ key: "openbanking-powens.job.sync-dispatch",
23
+ version: "1.0.0",
24
+ title: "Powens Sync Dispatch Job",
25
+ description: "Queues the canonical open banking sync workflows after Powens callbacks and webhooks are verified.",
26
+ domain: "open-banking",
27
+ owners: [OwnersEnum.PlatformFinance],
28
+ tags: ["openbanking", "powens", "job", "webhook"],
29
+ stability: StabilityEnum.Experimental
30
+ },
31
+ payload: {
32
+ schema: PowensSyncDispatchPayloadModel
33
+ },
34
+ retry: {
35
+ maxRetries: 5,
36
+ initialBackoffMs: 30000,
37
+ maxBackoffMs: 300000,
38
+ multiplier: 2,
39
+ jitter: true
40
+ },
41
+ timeoutMs: 60000
42
+ });
43
+ export {
44
+ PowensSyncDispatchJob
45
+ };
@@ -1,6 +1,6 @@
1
1
  // src/handlers/webhook-handler.ts
2
- import { createHmac, timingSafeEqual } from "crypto";
3
2
  import { PowensOpenBankingProvider } from "@contractspec/integration.providers-impls/impls/powens-openbanking";
3
+ import { createHmac, timingSafeEqual } from "crypto";
4
4
  async function powensWebhookHandler(req) {
5
5
  const signature = req.headers.get("x-powens-signature");
6
6
  const stateHeader = req.headers.get("x-powens-state");
@@ -130,8 +130,8 @@ var fakeWorkflowQueue = {
130
130
  };
131
131
 
132
132
  // src/handlers/webhook-handler.ts
133
- import { createHmac, timingSafeEqual } from "crypto";
134
133
  import { PowensOpenBankingProvider as PowensOpenBankingProvider2 } from "@contractspec/integration.providers-impls/impls/powens-openbanking";
134
+ import { createHmac, timingSafeEqual } from "crypto";
135
135
  async function powensWebhookHandler(req) {
136
136
  const signature = req.headers.get("x-powens-signature");
137
137
  const stateHeader = req.headers.get("x-powens-state");
@@ -222,6 +222,47 @@ var fakeTelemetryLogger = {
222
222
  record: async (_payload) => {}
223
223
  };
224
224
 
225
+ // src/jobs/powens-sync-dispatch.job.ts
226
+ import { defineJob } from "@contractspec/lib.contracts-spec/jobs/spec";
227
+ import {
228
+ OwnersEnum,
229
+ StabilityEnum
230
+ } from "@contractspec/lib.contracts-spec/ownership";
231
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
232
+ var PowensSyncDispatchPayloadModel = defineSchemaModel({
233
+ name: "PowensSyncDispatchPayload",
234
+ description: "Payload enqueued from Powens OAuth callbacks or webhooks before dispatching sync workflows.",
235
+ fields: {
236
+ tenantId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
237
+ connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
238
+ eventType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
239
+ userUuid: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
240
+ accountUuid: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
241
+ }
242
+ });
243
+ var PowensSyncDispatchJob = defineJob({
244
+ meta: {
245
+ key: "openbanking-powens.job.sync-dispatch",
246
+ version: "1.0.0",
247
+ title: "Powens Sync Dispatch Job",
248
+ description: "Queues the canonical open banking sync workflows after Powens callbacks and webhooks are verified.",
249
+ domain: "open-banking",
250
+ owners: [OwnersEnum.PlatformFinance],
251
+ tags: ["openbanking", "powens", "job", "webhook"],
252
+ stability: StabilityEnum.Experimental
253
+ },
254
+ payload: {
255
+ schema: PowensSyncDispatchPayloadModel
256
+ },
257
+ retry: {
258
+ maxRetries: 5,
259
+ initialBackoffMs: 30000,
260
+ maxBackoffMs: 300000,
261
+ multiplier: 2,
262
+ jitter: true
263
+ },
264
+ timeoutMs: 60000
265
+ });
225
266
  // src/openbanking-powens.feature.ts
226
267
  import { defineFeature } from "@contractspec/lib.contracts-spec";
227
268
  var OpenbankingPowensFeature = defineFeature({
@@ -247,5 +288,6 @@ export {
247
288
  powensWebhookHandler,
248
289
  powensOAuthCallbackHandler,
249
290
  example_default as example,
291
+ PowensSyncDispatchJob,
250
292
  OpenbankingPowensFeature
251
293
  };
@@ -0,0 +1,44 @@
1
+ // src/jobs/powens-sync-dispatch.job.ts
2
+ import { defineJob } from "@contractspec/lib.contracts-spec/jobs/spec";
3
+ import {
4
+ OwnersEnum,
5
+ StabilityEnum
6
+ } from "@contractspec/lib.contracts-spec/ownership";
7
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
8
+ var PowensSyncDispatchPayloadModel = defineSchemaModel({
9
+ name: "PowensSyncDispatchPayload",
10
+ description: "Payload enqueued from Powens OAuth callbacks or webhooks before dispatching sync workflows.",
11
+ fields: {
12
+ tenantId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
13
+ connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
14
+ eventType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
15
+ userUuid: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
16
+ accountUuid: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
17
+ }
18
+ });
19
+ var PowensSyncDispatchJob = defineJob({
20
+ meta: {
21
+ key: "openbanking-powens.job.sync-dispatch",
22
+ version: "1.0.0",
23
+ title: "Powens Sync Dispatch Job",
24
+ description: "Queues the canonical open banking sync workflows after Powens callbacks and webhooks are verified.",
25
+ domain: "open-banking",
26
+ owners: [OwnersEnum.PlatformFinance],
27
+ tags: ["openbanking", "powens", "job", "webhook"],
28
+ stability: StabilityEnum.Experimental
29
+ },
30
+ payload: {
31
+ schema: PowensSyncDispatchPayloadModel
32
+ },
33
+ retry: {
34
+ maxRetries: 5,
35
+ initialBackoffMs: 30000,
36
+ maxBackoffMs: 300000,
37
+ multiplier: 2,
38
+ jitter: true
39
+ },
40
+ timeoutMs: 60000
41
+ });
42
+ export {
43
+ PowensSyncDispatchJob
44
+ };
@@ -0,0 +1,44 @@
1
+ // src/jobs/powens-sync-dispatch.job.ts
2
+ import { defineJob } from "@contractspec/lib.contracts-spec/jobs/spec";
3
+ import {
4
+ OwnersEnum,
5
+ StabilityEnum
6
+ } from "@contractspec/lib.contracts-spec/ownership";
7
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
8
+ var PowensSyncDispatchPayloadModel = defineSchemaModel({
9
+ name: "PowensSyncDispatchPayload",
10
+ description: "Payload enqueued from Powens OAuth callbacks or webhooks before dispatching sync workflows.",
11
+ fields: {
12
+ tenantId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
13
+ connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
14
+ eventType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
15
+ userUuid: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
16
+ accountUuid: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
17
+ }
18
+ });
19
+ var PowensSyncDispatchJob = defineJob({
20
+ meta: {
21
+ key: "openbanking-powens.job.sync-dispatch",
22
+ version: "1.0.0",
23
+ title: "Powens Sync Dispatch Job",
24
+ description: "Queues the canonical open banking sync workflows after Powens callbacks and webhooks are verified.",
25
+ domain: "open-banking",
26
+ owners: [OwnersEnum.PlatformFinance],
27
+ tags: ["openbanking", "powens", "job", "webhook"],
28
+ stability: StabilityEnum.Experimental
29
+ },
30
+ payload: {
31
+ schema: PowensSyncDispatchPayloadModel
32
+ },
33
+ retry: {
34
+ maxRetries: 5,
35
+ initialBackoffMs: 30000,
36
+ maxBackoffMs: 300000,
37
+ multiplier: 2,
38
+ jitter: true
39
+ },
40
+ timeoutMs: 60000
41
+ });
42
+ export {
43
+ PowensSyncDispatchJob
44
+ };