@contractspec/example.openbanking-powens 0.0.0-canary-20260113170453

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.
@@ -0,0 +1,39 @@
1
+ $ tsdown
2
+ ℹ tsdown v0.19.0 powered by rolldown v1.0.0-beta.59
3
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/openbanking-powens/tsdown.config.js
4
+ ℹ entry: src/example.ts, src/index.ts, src/docs/index.ts, src/docs/openbanking-powens.docblock.ts, src/handlers/oauth-callback.ts, src/handlers/webhook-handler.ts
5
+ ℹ target: esnext
6
+ ℹ tsconfig: tsconfig.json
7
+ ℹ Build start
8
+ ℹ Cleaning 21 files
9
+ ℹ dist/handlers/webhook-handler.js 3.32 kB │ gzip: 1.23 kB
10
+ ℹ dist/handlers/oauth-callback.js 2.42 kB │ gzip: 1.02 kB
11
+ ℹ dist/docs/openbanking-powens.docblock.js 1.57 kB │ gzip: 0.76 kB
12
+ ℹ dist/example.js 1.07 kB │ gzip: 0.55 kB
13
+ ℹ dist/index.js 0.30 kB │ gzip: 0.16 kB
14
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
15
+ ℹ dist/handlers/webhook-handler.js.map 6.40 kB │ gzip: 2.17 kB
16
+ ℹ dist/handlers/oauth-callback.js.map 4.79 kB │ gzip: 1.80 kB
17
+ ℹ dist/docs/openbanking-powens.docblock.js.map 2.07 kB │ gzip: 0.94 kB
18
+ ℹ dist/example.js.map 1.51 kB │ gzip: 0.74 kB
19
+ ℹ dist/handlers/webhook-handler.d.ts.map 0.17 kB │ gzip: 0.14 kB
20
+ ℹ dist/handlers/oauth-callback.d.ts.map 0.17 kB │ gzip: 0.15 kB
21
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
22
+ ℹ dist/example.d.ts 0.25 kB │ gzip: 0.17 kB
23
+ ℹ dist/index.d.ts 0.25 kB │ gzip: 0.13 kB
24
+ ℹ dist/handlers/oauth-callback.d.ts 0.22 kB │ gzip: 0.17 kB
25
+ ℹ dist/handlers/webhook-handler.d.ts 0.21 kB │ gzip: 0.16 kB
26
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
27
+ ℹ dist/docs/openbanking-powens.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
28
+ ℹ 19 files, total: 24.91 kB
29
+ src/handlers/webhook-handler.ts (7:44) [UNRESOLVED_IMPORT] Warning: Could not resolve 'crypto' in src/handlers/webhook-handler.ts
30
+ ╭─[ src/handlers/webhook-handler.ts:7:45 ]
31
+ │
32
+ 7 │ import { createHmac, timingSafeEqual } from 'crypto';
33
+  │ ────┬───
34
+  │ ╰───── Module not found, treating it as an external dependency
35
+  │
36
+  │ Help: The "main" field here was ignored. Main fields must be configured explicitly when using the "neutral" platform.
37
+ ───╯
38
+
39
+ ✔ Build complete in 18051ms
@@ -0,0 +1,40 @@
1
+ $ bun build:types && bun build:bundle
2
+ $ tsc --noEmit
3
+ $ tsdown
4
+ ℹ tsdown v0.19.0 powered by rolldown v1.0.0-beta.59
5
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/openbanking-powens/tsdown.config.js
6
+ ℹ entry: src/example.ts, src/index.ts, src/docs/index.ts, src/docs/openbanking-powens.docblock.ts, src/handlers/oauth-callback.ts, src/handlers/webhook-handler.ts
7
+ ℹ target: esnext
8
+ ℹ tsconfig: tsconfig.json
9
+ ℹ Build start
10
+ ℹ dist/handlers/webhook-handler.js 3.32 kB │ gzip: 1.23 kB
11
+ ℹ dist/handlers/oauth-callback.js 2.42 kB │ gzip: 1.02 kB
12
+ ℹ dist/docs/openbanking-powens.docblock.js 1.57 kB │ gzip: 0.76 kB
13
+ ℹ dist/example.js 1.07 kB │ gzip: 0.55 kB
14
+ ℹ dist/index.js 0.30 kB │ gzip: 0.16 kB
15
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
16
+ ℹ dist/handlers/webhook-handler.js.map 6.40 kB │ gzip: 2.17 kB
17
+ ℹ dist/handlers/oauth-callback.js.map 4.79 kB │ gzip: 1.80 kB
18
+ ℹ dist/docs/openbanking-powens.docblock.js.map 2.07 kB │ gzip: 0.94 kB
19
+ ℹ dist/example.js.map 1.51 kB │ gzip: 0.74 kB
20
+ ℹ dist/handlers/webhook-handler.d.ts.map 0.17 kB │ gzip: 0.14 kB
21
+ ℹ dist/handlers/oauth-callback.d.ts.map 0.17 kB │ gzip: 0.15 kB
22
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
23
+ ℹ dist/example.d.ts 0.25 kB │ gzip: 0.17 kB
24
+ ℹ dist/index.d.ts 0.25 kB │ gzip: 0.13 kB
25
+ ℹ dist/handlers/oauth-callback.d.ts 0.22 kB │ gzip: 0.17 kB
26
+ ℹ dist/handlers/webhook-handler.d.ts 0.21 kB │ gzip: 0.16 kB
27
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
28
+ ℹ dist/docs/openbanking-powens.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
29
+ ℹ 19 files, total: 24.91 kB
30
+ src/handlers/webhook-handler.ts (7:44) [UNRESOLVED_IMPORT] Warning: Could not resolve 'crypto' in src/handlers/webhook-handler.ts
31
+ ╭─[ src/handlers/webhook-handler.ts:7:45 ]
32
+ │
33
+ 7 │ import { createHmac, timingSafeEqual } from 'crypto';
34
+  │ ────┬───
35
+  │ ╰───── Module not found, treating it as an external dependency
36
+  │
37
+  │ Help: The "main" field here was ignored. Main fields must be configured explicitly when using the "neutral" platform.
38
+ ───╯
39
+
40
+ ✔ Build complete in 19714ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,322 @@
1
+ # @contractspec/example.openbanking-powens
2
+
3
+ ## 0.0.0-canary-20260113170453
4
+
5
+ ### Minor Changes
6
+
7
+ - caf8701: feat: add cli vibe command to run workflow
8
+ - c69b849: feat: add api web services (mcp & website)
9
+ - 42b8d78: feat: add cli `contractspec vibe` workflow to simplify usage
10
+ - fd38e85: feat: auto-fix contractspec issues
11
+
12
+ ### Patch Changes
13
+
14
+ - e7ded36: feat: improve stability (adding ts-morph)
15
+ - c231a8b: test: improve workspace stability
16
+ - Updated dependencies [e7ded36]
17
+ - Updated dependencies [caf8701]
18
+ - Updated dependencies [c69b849]
19
+ - Updated dependencies [c231a8b]
20
+ - Updated dependencies [42b8d78]
21
+ - Updated dependencies [fd38e85]
22
+ - @contractspec/integration.providers-impls@0.0.0-canary-20260113170453
23
+ - @contractspec/lib.contracts@0.0.0-canary-20260113170453
24
+
25
+ ## 1.46.2
26
+
27
+ ### Patch Changes
28
+
29
+ - 7e21625: feat: library services (landing page & api)
30
+ - Updated dependencies [7e21625]
31
+ - @contractspec/integration.providers-impls@1.46.2
32
+ - @contractspec/lib.contracts@1.46.2
33
+
34
+ ## 1.46.1
35
+
36
+ ### Patch Changes
37
+
38
+ - 2d8a72b: fix: mcp for presentation
39
+ - Updated dependencies [2d8a72b]
40
+ - @contractspec/integration.providers-impls@1.46.1
41
+ - @contractspec/lib.contracts@1.46.1
42
+
43
+ ## 1.46.0
44
+
45
+ ### Minor Changes
46
+
47
+ - 07cb19b: feat: feat: cleaude code & opencode integrations
48
+
49
+ ### Patch Changes
50
+
51
+ - Updated dependencies [07cb19b]
52
+ - @contractspec/integration.providers-impls@1.46.0
53
+ - @contractspec/lib.contracts@1.46.0
54
+
55
+ ## 1.45.6
56
+
57
+ ### Patch Changes
58
+
59
+ - a913074: feat: improve ai agents rules management"
60
+ - Updated dependencies [a913074]
61
+ - @contractspec/integration.providers-impls@1.45.6
62
+ - @contractspec/lib.contracts@1.45.6
63
+
64
+ ## 1.45.5
65
+
66
+ ### Patch Changes
67
+
68
+ - 9ddd7fa: feat: improve versioning
69
+ - Updated dependencies [9ddd7fa]
70
+ - @contractspec/integration.providers-impls@1.45.5
71
+ - @contractspec/lib.contracts@1.45.5
72
+
73
+ ## 1.45.4
74
+
75
+ ### Patch Changes
76
+
77
+ - fix: github action
78
+ - Updated dependencies
79
+ - @contractspec/integration.providers-impls@1.45.4
80
+ - @contractspec/lib.contracts@1.45.4
81
+
82
+ ## 1.45.3
83
+
84
+ ### Patch Changes
85
+
86
+ - e74ea9e: feat: version management
87
+ - Updated dependencies [e74ea9e]
88
+ - @contractspec/integration.providers-impls@1.45.3
89
+ - @contractspec/lib.contracts@1.45.3
90
+
91
+ ## 1.45.2
92
+
93
+ ### Patch Changes
94
+
95
+ - 39ca241: code cleaning
96
+ - Updated dependencies [39ca241]
97
+ - @contractspec/integration.providers-impls@1.45.2
98
+ - @contractspec/lib.contracts@1.45.2
99
+
100
+ ## 1.45.1
101
+
102
+ ### Patch Changes
103
+
104
+ - feat: improve app config and examples contracts
105
+ - Updated dependencies
106
+ - @contractspec/integration.providers-impls@1.45.1
107
+ - @contractspec/lib.contracts@1.45.1
108
+ - @contractspec/lib.schema@1.45.1
109
+
110
+ ## 1.45.0
111
+
112
+ ### Minor Changes
113
+
114
+ - e73ca1d: feat: improve app config and examples contracts
115
+ feat: Contract layers support (features, examples, app-configs)
116
+
117
+ ### New CLI Commands
118
+ - `contractspec list layers` - List all contract layers with filtering
119
+
120
+ ### Enhanced Commands
121
+ - `contractspec ci` - New `layers` check category validates features/examples/config
122
+ - `contractspec doctor` - New `layers` health checks
123
+ - `contractspec integrity` - Now shows layer statistics
124
+
125
+ ### New APIs
126
+ - `discoverLayers()` - Scan workspace for all layer files
127
+ - `scanExampleSource()` - Parse ExampleSpec from source code
128
+ - `isExampleFile()` - Check if file is an example spec
129
+
130
+ ### Patch Changes
131
+
132
+ - Updated dependencies [e73ca1d]
133
+ - @contractspec/integration.providers-impls@1.45.0
134
+ - @contractspec/lib.contracts@1.45.0
135
+ - @contractspec/lib.schema@1.45.0
136
+
137
+ ## 1.44.1
138
+
139
+ ### Patch Changes
140
+
141
+ - 3c594fb: fix
142
+ - Updated dependencies [3c594fb]
143
+ - @contractspec/integration.providers-impls@1.44.1
144
+ - @contractspec/lib.contracts@1.44.1
145
+ - @contractspec/lib.schema@1.44.1
146
+
147
+ ## 1.44.0
148
+
149
+ ### Minor Changes
150
+
151
+ - 5f3a868: chore: isolate branding to contractspec.io
152
+
153
+ ### Patch Changes
154
+
155
+ - Updated dependencies [5f3a868]
156
+ - @contractspec/integration.providers-impls@1.44.0
157
+ - @contractspec/lib.contracts@1.44.0
158
+ - @contractspec/lib.schema@1.44.0
159
+
160
+ ## 1.43.4
161
+
162
+ ### Patch Changes
163
+
164
+ - 9216062: fix: cross-platform compatibility
165
+ - Updated dependencies [9216062]
166
+ - @contractspec/integration.providers-impls@1.43.4
167
+ - @contractspec/lib.contracts@1.43.4
168
+ - @contractspec/lib.schema@1.43.3
169
+
170
+ ## 1.43.3
171
+
172
+ ### Patch Changes
173
+
174
+ - 24d9759: improve documentation
175
+ - Updated dependencies [24d9759]
176
+ - @contractspec/integration.providers-impls@1.43.3
177
+ - @contractspec/lib.contracts@1.43.3
178
+ - @contractspec/lib.schema@1.43.2
179
+
180
+ ## 1.43.2
181
+
182
+ ### Patch Changes
183
+
184
+ - e147271: fix: improve stability
185
+ - Updated dependencies [e147271]
186
+ - @contractspec/integration.providers-impls@1.43.2
187
+ - @contractspec/lib.contracts@1.43.2
188
+ - @contractspec/lib.schema@1.43.1
189
+
190
+ ## 1.43.1
191
+
192
+ ### Patch Changes
193
+
194
+ - Updated dependencies [f28fdad]
195
+ - @contractspec/lib.contracts@1.43.1
196
+ - @contractspec/integration.providers-impls@1.43.1
197
+
198
+ ## 1.43.0
199
+
200
+ ### Minor Changes
201
+
202
+ - 042d072: feat: schema declaration using json schema, including zod
203
+
204
+ ### Patch Changes
205
+
206
+ - Updated dependencies [042d072]
207
+ - @contractspec/integration.providers-impls@1.43.0
208
+ - @contractspec/lib.contracts@1.43.0
209
+ - @contractspec/lib.schema@1.43.0
210
+
211
+ ## 1.42.10
212
+
213
+ ### Patch Changes
214
+
215
+ - 1e6a0f1: fix: mcp server
216
+ - Updated dependencies [1e6a0f1]
217
+ - @contractspec/integration.providers-impls@1.42.10
218
+ - @contractspec/lib.contracts@1.42.10
219
+ - @contractspec/lib.schema@1.42.10
220
+
221
+ ## 1.42.9
222
+
223
+ ### Patch Changes
224
+
225
+ - 9281db7: fix ModelRegistry
226
+ - Updated dependencies [9281db7]
227
+ - @contractspec/integration.providers-impls@1.42.9
228
+ - @contractspec/lib.contracts@1.42.9
229
+ - @contractspec/lib.schema@1.42.9
230
+
231
+ ## 1.42.8
232
+
233
+ ### Patch Changes
234
+
235
+ - e07b5ac: fix
236
+ - Updated dependencies [e07b5ac]
237
+ - @contractspec/integration.providers-impls@1.42.8
238
+ - @contractspec/lib.contracts@1.42.8
239
+ - @contractspec/lib.schema@1.42.8
240
+
241
+ ## 1.42.7
242
+
243
+ ### Patch Changes
244
+
245
+ - e9b575d: fix release
246
+ - Updated dependencies [e9b575d]
247
+ - @contractspec/integration.providers-impls@1.42.7
248
+ - @contractspec/lib.contracts@1.42.7
249
+ - @contractspec/lib.schema@1.42.7
250
+
251
+ ## 1.42.6
252
+
253
+ ### Patch Changes
254
+
255
+ - 1500242: fix tooling
256
+ - Updated dependencies [1500242]
257
+ - @contractspec/integration.providers-impls@1.42.6
258
+ - @contractspec/lib.contracts@1.42.6
259
+ - @contractspec/lib.schema@1.42.6
260
+
261
+ ## 1.42.5
262
+
263
+ ### Patch Changes
264
+
265
+ - 1299719: fix vscode
266
+ - Updated dependencies [1299719]
267
+ - @contractspec/integration.providers-impls@1.42.5
268
+ - @contractspec/lib.contracts@1.42.5
269
+ - @contractspec/lib.schema@1.42.5
270
+
271
+ ## 1.42.4
272
+
273
+ ### Patch Changes
274
+
275
+ - ac28b99: fix: generate from openapi
276
+ - Updated dependencies [ac28b99]
277
+ - @contractspec/integration.providers-impls@1.42.4
278
+ - @contractspec/lib.contracts@1.42.4
279
+ - @contractspec/lib.schema@1.42.4
280
+
281
+ ## 1.42.3
282
+
283
+ ### Patch Changes
284
+
285
+ - 3f5d015: fix(tooling): cicd
286
+ - Updated dependencies [3f5d015]
287
+ - @contractspec/integration.providers-impls@1.42.3
288
+ - @contractspec/lib.contracts@1.42.3
289
+ - @contractspec/lib.schema@1.42.3
290
+
291
+ ## 1.42.2
292
+
293
+ ### Patch Changes
294
+
295
+ - 1f9ac4c: fix
296
+ - Updated dependencies [1f9ac4c]
297
+ - @contractspec/integration.providers-impls@1.42.2
298
+ - @contractspec/lib.contracts@1.42.2
299
+ - @contractspec/lib.schema@1.42.2
300
+
301
+ ## 1.42.1
302
+
303
+ ### Patch Changes
304
+
305
+ - f043995: Fix release
306
+ - Updated dependencies [f043995]
307
+ - @contractspec/integration.providers-impls@1.42.1
308
+ - @contractspec/lib.contracts@1.42.1
309
+ - @contractspec/lib.schema@1.42.1
310
+
311
+ ## 1.42.0
312
+
313
+ ### Minor Changes
314
+
315
+ - 8eefd9c: initial release
316
+
317
+ ### Patch Changes
318
+
319
+ - Updated dependencies [8eefd9c]
320
+ - @contractspec/integration.providers-impls@1.42.0
321
+ - @contractspec/lib.contracts@1.42.0
322
+ - @contractspec/lib.schema@1.42.0
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.
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ import "./openbanking-powens.docblock.js";
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,30 @@
1
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
2
+
3
+ //#region src/docs/openbanking-powens.docblock.ts
4
+ registerDocBlocks([{
5
+ id: "docs.examples.openbanking-powens",
6
+ title: "Open Banking — Powens (example)",
7
+ summary: "Framework-neutral OAuth callback + webhook handler patterns for Powens, orchestrating canonical sync workflows.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/openbanking-powens",
11
+ tags: [
12
+ "openbanking",
13
+ "powens",
14
+ "integration",
15
+ "example"
16
+ ],
17
+ body: `## What this example shows\n- OAuth callback handler: exchange auth code, map powens user, enqueue sync workflow.\n- Webhook handler: verify signature, route event → workflow, optionally refresh balances.\n\n## Guardrails\n- Secrets via secret providers/env only.\n- Verify webhook signatures.\n- Keep side effects explicit: enqueue workflows instead of mutating canonical stores inline.`
18
+ }, {
19
+ id: "docs.examples.openbanking-powens.usage",
20
+ title: "Open Banking — Powens — Usage",
21
+ summary: "How to integrate the handlers in a fetch-compatible runtime.",
22
+ kind: "usage",
23
+ visibility: "public",
24
+ route: "/docs/examples/openbanking-powens/usage",
25
+ tags: ["openbanking", "usage"],
26
+ body: `## Usage\n- Wire \`powensOAuthCallbackHandler(req)\` at your OAuth redirect route.\n- Wire \`powensWebhookHandler(req)\` at your webhook route.\n\n## Notes\n- Replace the fake stores with your app-layer persistence.\n- Enqueue ContractSpec workflows for canonical upserts and telemetry.`
27
+ }]);
28
+
29
+ //#endregion
30
+ //# sourceMappingURL=openbanking-powens.docblock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openbanking-powens.docblock.js","names":[],"sources":["../../src/docs/openbanking-powens.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst blocks: DocBlock[] = [\n {\n id: 'docs.examples.openbanking-powens',\n title: 'Open Banking — Powens (example)',\n summary:\n 'Framework-neutral OAuth callback + webhook handler patterns for Powens, orchestrating canonical sync workflows.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/openbanking-powens',\n tags: ['openbanking', 'powens', 'integration', 'example'],\n body: `## What this example shows\\n- OAuth callback handler: exchange auth code, map powens user, enqueue sync workflow.\\n- Webhook handler: verify signature, route event → workflow, optionally refresh balances.\\n\\n## Guardrails\\n- Secrets via secret providers/env only.\\n- Verify webhook signatures.\\n- Keep side effects explicit: enqueue workflows instead of mutating canonical stores inline.`,\n },\n {\n id: 'docs.examples.openbanking-powens.usage',\n title: 'Open Banking — Powens — Usage',\n summary: 'How to integrate the handlers in a fetch-compatible runtime.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/openbanking-powens/usage',\n tags: ['openbanking', 'usage'],\n body: `## Usage\\n- Wire \\`powensOAuthCallbackHandler(req)\\` at your OAuth redirect route.\\n- Wire \\`powensWebhookHandler(req)\\` at your webhook route.\\n\\n## Notes\\n- Replace the fake stores with your app-layer persistence.\\n- Enqueue ContractSpec workflows for canonical upserts and telemetry.`,\n },\n];\n\nregisterDocBlocks(blocks);\n"],"mappings":";;;AA2BA,kBAxB2B,CACzB;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAe;EAAU;EAAe;EAAU;CACzD,MAAM;CACP,EACD;CACE,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM,CAAC,eAAe,QAAQ;CAC9B,MAAM;CACP,CACF,CAEwB"}
@@ -0,0 +1,7 @@
1
+ import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
+
3
+ //#region src/example.d.ts
4
+ declare const example: _contractspec_lib_contracts0.ExampleSpec;
5
+ //#endregion
6
+ export { example as default };
7
+ //# sourceMappingURL=example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";;;cAEM,SA2BJ,4BAAA,CA3BW"}
@@ -0,0 +1,47 @@
1
+ import { defineExample } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/example.ts
4
+ const example = defineExample({
5
+ meta: {
6
+ key: "openbanking-powens",
7
+ version: "1.0.0",
8
+ title: "Open Banking — Powens",
9
+ description: "OAuth callback + webhook handler patterns for Powens open banking integration (provider + workflow orchestration).",
10
+ kind: "integration",
11
+ visibility: "public",
12
+ stability: "experimental",
13
+ owners: ["@platform.core"],
14
+ tags: [
15
+ "openbanking",
16
+ "powens",
17
+ "oauth",
18
+ "webhooks",
19
+ "integrations"
20
+ ]
21
+ },
22
+ docs: {
23
+ rootDocId: "docs.examples.openbanking-powens",
24
+ usageDocId: "docs.examples.openbanking-powens.usage"
25
+ },
26
+ entrypoints: {
27
+ packageName: "@contractspec/example.openbanking-powens",
28
+ docs: "./docs"
29
+ },
30
+ surfaces: {
31
+ templates: true,
32
+ sandbox: {
33
+ enabled: true,
34
+ modes: ["markdown", "specs"]
35
+ },
36
+ studio: {
37
+ enabled: true,
38
+ installable: true
39
+ },
40
+ mcp: { enabled: true }
41
+ }
42
+ });
43
+ var example_default = example;
44
+
45
+ //#endregion
46
+ export { example_default as default };
47
+ //# sourceMappingURL=example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["import { defineExample } from '@contractspec/lib.contracts';\n\nconst example = defineExample({\n meta: {\n key: 'openbanking-powens',\n version: '1.0.0',\n title: 'Open Banking — Powens',\n description:\n 'OAuth callback + webhook handler patterns for Powens open banking integration (provider + workflow orchestration).',\n kind: 'integration',\n visibility: 'public',\n stability: 'experimental',\n owners: ['@platform.core'],\n tags: ['openbanking', 'powens', 'oauth', 'webhooks', 'integrations'],\n },\n docs: {\n rootDocId: 'docs.examples.openbanking-powens',\n usageDocId: 'docs.examples.openbanking-powens.usage',\n },\n entrypoints: {\n packageName: '@contractspec/example.openbanking-powens',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: { enabled: true, modes: ['markdown', 'specs'] },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n});\n\nexport default example;\n"],"mappings":";;;AAEA,MAAM,UAAU,cAAc;CAC5B,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,YAAY;EACZ,WAAW;EACX,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAe;GAAU;GAAS;GAAY;GAAe;EACrE;CACD,MAAM;EACJ,WAAW;EACX,YAAY;EACb;CACD,aAAa;EACX,aAAa;EACb,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GAAE,SAAS;GAAM,OAAO,CAAC,YAAY,QAAQ;GAAE;EACxD,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF,CAAC;AAEF,sBAAe"}
@@ -0,0 +1,5 @@
1
+ //#region src/handlers/oauth-callback.d.ts
2
+ declare function powensOAuthCallbackHandler(req: Request): Promise<Response>;
3
+ //#endregion
4
+ export { powensOAuthCallbackHandler };
5
+ //# sourceMappingURL=oauth-callback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-callback.d.ts","names":[],"sources":["../../src/handlers/oauth-callback.ts"],"sourcesContent":[],"mappings":";iBASsB,0BAAA,MAAgC,UAAO,QAAA"}
@@ -0,0 +1,64 @@
1
+ import { PowensOpenBankingProvider } from "@contractspec/integration.providers-impls/impls/powens-openbanking";
2
+
3
+ //#region src/handlers/oauth-callback.ts
4
+ /**
5
+ * Example OAuth callback handler for Powens (open banking).
6
+ *
7
+ * This example stays framework-neutral: it operates on the standard `Request`
8
+ * type so it can be used in Next.js, Elysia, or any fetch-compatible runtime.
9
+ */
10
+ async function powensOAuthCallbackHandler(req) {
11
+ const url = new URL(req.url);
12
+ const code = url.searchParams.get("code");
13
+ const state = url.searchParams.get("state");
14
+ const userUuid = url.searchParams.get("user_uuid");
15
+ if (!code || !state || !userUuid) return new Response("Missing Powens OAuth params", { status: 400 });
16
+ const connection = await getConnectionByState(state);
17
+ if (!connection) return new Response("Unknown Powens OAuth state", { status: 404 });
18
+ const secrets = await getPowensSecretsForConnection(connection.meta.id);
19
+ const preview = await new PowensOpenBankingProvider({
20
+ clientId: secrets.clientId,
21
+ clientSecret: secrets.clientSecret,
22
+ apiKey: secrets.apiKey,
23
+ environment: connection.config.environment,
24
+ baseUrl: connection.config.baseUrl
25
+ }).listAccounts({
26
+ tenantId: connection.meta.tenantId,
27
+ connectionId: connection.meta.id,
28
+ userId: userUuid
29
+ });
30
+ await connection.storePowensUser({
31
+ tenantUserId: connection.meta.tenantUserId,
32
+ powensUserUuid: userUuid,
33
+ authCode: code
34
+ });
35
+ await enqueueWorkflow("pfo.workflow.sync-openbanking-accounts", {
36
+ tenantId: connection.meta.tenantId,
37
+ userUuid,
38
+ connectionId: connection.meta.id,
39
+ previewAccounts: preview.accounts
40
+ });
41
+ const redirectBase = process.env.APP_DASHBOARD_URL ?? "";
42
+ return Response.redirect(`${redirectBase}/banking/linked?tenant=${connection.meta.tenantId}`, 302);
43
+ }
44
+ async function getConnectionByState(state) {
45
+ return fakeDatabase.connections.find((conn) => conn.state === state) ?? null;
46
+ }
47
+ async function getPowensSecretsForConnection(connectionId) {
48
+ const secret = fakeSecretStore[connectionId];
49
+ if (!secret) throw new Error(`Missing Powens secrets for ${connectionId}`);
50
+ return secret;
51
+ }
52
+ async function enqueueWorkflow(name, input) {
53
+ await fakeWorkflowQueue.enqueue({
54
+ name,
55
+ input
56
+ });
57
+ }
58
+ const fakeDatabase = { connections: [] };
59
+ const fakeSecretStore = {};
60
+ const fakeWorkflowQueue = { enqueue: async (_payload) => {} };
61
+
62
+ //#endregion
63
+ export { powensOAuthCallbackHandler };
64
+ //# sourceMappingURL=oauth-callback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-callback.js","names":[],"sources":["../../src/handlers/oauth-callback.ts"],"sourcesContent":["/**\n * Example OAuth callback handler for Powens (open banking).\n *\n * This example stays framework-neutral: it operates on the standard `Request`\n * type so it can be used in Next.js, Elysia, or any fetch-compatible runtime.\n */\nimport { PowensOpenBankingProvider } from '@contractspec/integration.providers-impls/impls/powens-openbanking';\nimport type { PowensEnvironment } from '@contractspec/integration.providers-impls/impls/powens-client';\n\nexport async function powensOAuthCallbackHandler(req: Request) {\n const url = new URL(req.url);\n const code = url.searchParams.get('code');\n const state = url.searchParams.get('state');\n const userUuid = url.searchParams.get('user_uuid');\n\n if (!code || !state || !userUuid) {\n return new Response('Missing Powens OAuth params', { status: 400 });\n }\n\n const connection = await getConnectionByState(state);\n if (!connection) {\n return new Response('Unknown Powens OAuth state', { status: 404 });\n }\n\n const secrets = await getPowensSecretsForConnection(connection.meta.id);\n\n const provider = new PowensOpenBankingProvider({\n clientId: secrets.clientId,\n clientSecret: secrets.clientSecret,\n apiKey: secrets.apiKey,\n environment: connection.config.environment as PowensEnvironment,\n baseUrl: connection.config.baseUrl as string | undefined,\n });\n\n const preview = await provider.listAccounts({\n tenantId: connection.meta.tenantId,\n connectionId: connection.meta.id,\n userId: userUuid,\n });\n\n await connection.storePowensUser({\n tenantUserId: connection.meta.tenantUserId,\n powensUserUuid: userUuid,\n authCode: code,\n });\n\n await enqueueWorkflow('pfo.workflow.sync-openbanking-accounts', {\n tenantId: connection.meta.tenantId,\n userUuid,\n connectionId: connection.meta.id,\n previewAccounts: preview.accounts,\n });\n\n const redirectBase = process.env.APP_DASHBOARD_URL ?? '';\n return Response.redirect(\n `${redirectBase}/banking/linked?tenant=${connection.meta.tenantId}`,\n 302\n );\n}\n\ninterface ExamplePowensSecrets {\n clientId: string;\n clientSecret: string;\n apiKey?: string;\n}\n\ninterface ExampleIntegrationConnection {\n meta: {\n id: string;\n tenantId: string;\n tenantUserId: string;\n };\n config: {\n environment: PowensEnvironment;\n baseUrl?: string;\n };\n storePowensUser(input: {\n tenantUserId: string;\n powensUserUuid: string;\n authCode: string;\n }): Promise<void>;\n}\n\nasync function getConnectionByState(\n state: string\n): Promise<ExampleIntegrationConnection | null> {\n const record = fakeDatabase.connections.find((conn) => conn.state === state);\n return record ?? null;\n}\n\nasync function getPowensSecretsForConnection(\n connectionId: string\n): Promise<ExamplePowensSecrets> {\n const secret = fakeSecretStore[connectionId];\n if (!secret) throw new Error(`Missing Powens secrets for ${connectionId}`);\n return secret;\n}\n\nasync function enqueueWorkflow(name: string, input: Record<string, unknown>) {\n await fakeWorkflowQueue.enqueue({ name, input });\n}\n\nconst fakeDatabase = {\n connections: [] as (ExampleIntegrationConnection & { state: string })[],\n};\n\nconst fakeSecretStore: Record<string, ExamplePowensSecrets> = {};\n\nconst fakeWorkflowQueue = {\n enqueue: async (_payload: Record<string, unknown>) => {\n /* no-op */\n },\n};\n"],"mappings":";;;;;;;;;AASA,eAAsB,2BAA2B,KAAc;CAC7D,MAAM,MAAM,IAAI,IAAI,IAAI,IAAI;CAC5B,MAAM,OAAO,IAAI,aAAa,IAAI,OAAO;CACzC,MAAM,QAAQ,IAAI,aAAa,IAAI,QAAQ;CAC3C,MAAM,WAAW,IAAI,aAAa,IAAI,YAAY;AAElD,KAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,SACtB,QAAO,IAAI,SAAS,+BAA+B,EAAE,QAAQ,KAAK,CAAC;CAGrE,MAAM,aAAa,MAAM,qBAAqB,MAAM;AACpD,KAAI,CAAC,WACH,QAAO,IAAI,SAAS,8BAA8B,EAAE,QAAQ,KAAK,CAAC;CAGpE,MAAM,UAAU,MAAM,8BAA8B,WAAW,KAAK,GAAG;CAUvE,MAAM,UAAU,MARC,IAAI,0BAA0B;EAC7C,UAAU,QAAQ;EAClB,cAAc,QAAQ;EACtB,QAAQ,QAAQ;EAChB,aAAa,WAAW,OAAO;EAC/B,SAAS,WAAW,OAAO;EAC5B,CAAC,CAE6B,aAAa;EAC1C,UAAU,WAAW,KAAK;EAC1B,cAAc,WAAW,KAAK;EAC9B,QAAQ;EACT,CAAC;AAEF,OAAM,WAAW,gBAAgB;EAC/B,cAAc,WAAW,KAAK;EAC9B,gBAAgB;EAChB,UAAU;EACX,CAAC;AAEF,OAAM,gBAAgB,0CAA0C;EAC9D,UAAU,WAAW,KAAK;EAC1B;EACA,cAAc,WAAW,KAAK;EAC9B,iBAAiB,QAAQ;EAC1B,CAAC;CAEF,MAAM,eAAe,QAAQ,IAAI,qBAAqB;AACtD,QAAO,SAAS,SACd,GAAG,aAAa,yBAAyB,WAAW,KAAK,YACzD,IACD;;AA0BH,eAAe,qBACb,OAC8C;AAE9C,QADe,aAAa,YAAY,MAAM,SAAS,KAAK,UAAU,MAAM,IAC3D;;AAGnB,eAAe,8BACb,cAC+B;CAC/B,MAAM,SAAS,gBAAgB;AAC/B,KAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,8BAA8B,eAAe;AAC1E,QAAO;;AAGT,eAAe,gBAAgB,MAAc,OAAgC;AAC3E,OAAM,kBAAkB,QAAQ;EAAE;EAAM;EAAO,CAAC;;AAGlD,MAAM,eAAe,EACnB,aAAa,EAAE,EAChB;AAED,MAAM,kBAAwD,EAAE;AAEhE,MAAM,oBAAoB,EACxB,SAAS,OAAO,aAAsC,IAGvD"}
@@ -0,0 +1,5 @@
1
+ //#region src/handlers/webhook-handler.d.ts
2
+ declare function powensWebhookHandler(req: Request): Promise<Response>;
3
+ //#endregion
4
+ export { powensWebhookHandler };
5
+ //# sourceMappingURL=webhook-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-handler.d.ts","names":[],"sources":["../../src/handlers/webhook-handler.ts"],"sourcesContent":[],"mappings":";iBAUsB,oBAAA,MAA0B,UAAO,QAAA"}