@contractspec/example.integration-stripe 1.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +37 -0
  2. package/.turbo/turbo-build.log +38 -0
  3. package/CHANGELOG.md +161 -0
  4. package/LICENSE +21 -0
  5. package/README.md +29 -0
  6. package/dist/blueprint.d.ts +7 -0
  7. package/dist/blueprint.d.ts.map +1 -0
  8. package/dist/blueprint.js +66 -0
  9. package/dist/blueprint.js.map +1 -0
  10. package/dist/connection.sample.d.ts +7 -0
  11. package/dist/connection.sample.d.ts.map +1 -0
  12. package/dist/connection.sample.js +22 -0
  13. package/dist/connection.sample.js.map +1 -0
  14. package/dist/docs/index.d.ts +1 -0
  15. package/dist/docs/index.js +1 -0
  16. package/dist/docs/integration-stripe.docblock.d.ts +1 -0
  17. package/dist/docs/integration-stripe.docblock.js +30 -0
  18. package/dist/docs/integration-stripe.docblock.js.map +1 -0
  19. package/dist/example.d.ts +34 -0
  20. package/dist/example.d.ts.map +1 -0
  21. package/dist/example.js +40 -0
  22. package/dist/example.js.map +1 -0
  23. package/dist/index.d.ts +6 -0
  24. package/dist/index.js +8 -0
  25. package/dist/tenant.d.ts +7 -0
  26. package/dist/tenant.d.ts.map +1 -0
  27. package/dist/tenant.js +53 -0
  28. package/dist/tenant.js.map +1 -0
  29. package/dist/workflow.d.ts +7 -0
  30. package/dist/workflow.d.ts.map +1 -0
  31. package/dist/workflow.js +59 -0
  32. package/dist/workflow.js.map +1 -0
  33. package/package.json +65 -0
  34. package/src/blueprint.ts +59 -0
  35. package/src/connection.sample.ts +21 -0
  36. package/src/docs/index.ts +1 -0
  37. package/src/docs/integration-stripe.docblock.ts +28 -0
  38. package/src/example.ts +25 -0
  39. package/src/index.ts +6 -0
  40. package/src/tenant.ts +53 -0
  41. package/src/workflow.ts +53 -0
  42. package/translation.catalog.json +21 -0
  43. package/tsconfig.json +11 -0
  44. package/tsdown.config.js +6 -0
@@ -0,0 +1,37 @@
1
+ $ tsdown
2
+ ℹ tsdown v0.18.3 powered by rolldown v1.0.0-beta.57
3
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/integration-stripe/tsdown.config.js
4
+ ℹ entry: src/blueprint.ts, src/connection.sample.ts, src/example.ts, src/index.ts, src/tenant.ts, src/workflow.ts, src/docs/index.ts, src/docs/integration-stripe.docblock.ts
5
+ ℹ target: esnext
6
+ ℹ tsconfig: tsconfig.json
7
+ ℹ Build start
8
+ ℹ Cleaning 28 files
9
+ ℹ dist/blueprint.js 1.68 kB │ gzip: 0.73 kB
10
+ ℹ dist/docs/integration-stripe.docblock.js 1.59 kB │ gzip: 0.74 kB
11
+ ℹ dist/workflow.js 1.33 kB │ gzip: 0.57 kB
12
+ ℹ dist/tenant.js 1.28 kB │ gzip: 0.63 kB
13
+ ℹ dist/example.js 0.89 kB │ gzip: 0.47 kB
14
+ ℹ dist/connection.sample.js 0.60 kB │ gzip: 0.35 kB
15
+ ℹ dist/index.js 0.44 kB │ gzip: 0.20 kB
16
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
17
+ ℹ dist/blueprint.js.map 2.68 kB │ gzip: 1.10 kB
18
+ ℹ dist/workflow.js.map 2.22 kB │ gzip: 0.84 kB
19
+ ℹ dist/tenant.js.map 2.20 kB │ gzip: 0.97 kB
20
+ ℹ dist/docs/integration-stripe.docblock.js.map 2.09 kB │ gzip: 0.93 kB
21
+ ℹ dist/example.js.map 1.25 kB │ gzip: 0.64 kB
22
+ ℹ dist/connection.sample.js.map 1.03 kB │ gzip: 0.52 kB
23
+ ℹ dist/connection.sample.d.ts.map 0.15 kB │ gzip: 0.13 kB
24
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
25
+ ℹ dist/blueprint.d.ts.map 0.13 kB │ gzip: 0.12 kB
26
+ ℹ dist/workflow.d.ts.map 0.13 kB │ gzip: 0.12 kB
27
+ ℹ dist/tenant.d.ts.map 0.12 kB │ gzip: 0.12 kB
28
+ ℹ dist/example.d.ts 1.12 kB │ gzip: 0.47 kB
29
+ ℹ dist/index.d.ts 0.39 kB │ gzip: 0.17 kB
30
+ ℹ dist/connection.sample.d.ts 0.28 kB │ gzip: 0.17 kB
31
+ ℹ dist/blueprint.d.ts 0.25 kB │ gzip: 0.17 kB
32
+ ℹ dist/tenant.d.ts 0.25 kB │ gzip: 0.17 kB
33
+ ℹ dist/workflow.d.ts 0.24 kB │ gzip: 0.16 kB
34
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
35
+ ℹ dist/docs/integration-stripe.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
36
+ ℹ 27 files, total: 22.55 kB
37
+ ✔ Build complete in 14500ms
@@ -0,0 +1,38 @@
1
+ $ bun build:types && bun build:bundle
2
+ $ tsc --noEmit
3
+ $ tsdown
4
+ ℹ tsdown v0.18.3 powered by rolldown v1.0.0-beta.57
5
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/integration-stripe/tsdown.config.js (unrun)
6
+ ℹ entry: src/blueprint.ts, src/connection.sample.ts, src/example.ts, src/index.ts, src/tenant.ts, src/workflow.ts, src/docs/index.ts, src/docs/integration-stripe.docblock.ts
7
+ ℹ target: esnext
8
+ ℹ tsconfig: tsconfig.json
9
+ ℹ Build start
10
+ ℹ dist/blueprint.js 1.68 kB │ gzip: 0.73 kB
11
+ ℹ dist/docs/integration-stripe.docblock.js 1.59 kB │ gzip: 0.74 kB
12
+ ℹ dist/workflow.js 1.33 kB │ gzip: 0.57 kB
13
+ ℹ dist/tenant.js 1.28 kB │ gzip: 0.63 kB
14
+ ℹ dist/example.js 0.89 kB │ gzip: 0.47 kB
15
+ ℹ dist/connection.sample.js 0.60 kB │ gzip: 0.35 kB
16
+ ℹ dist/index.js 0.44 kB │ gzip: 0.20 kB
17
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
18
+ ℹ dist/blueprint.js.map 2.68 kB │ gzip: 1.10 kB
19
+ ℹ dist/workflow.js.map 2.22 kB │ gzip: 0.84 kB
20
+ ℹ dist/tenant.js.map 2.20 kB │ gzip: 0.97 kB
21
+ ℹ dist/docs/integration-stripe.docblock.js.map 2.09 kB │ gzip: 0.93 kB
22
+ ℹ dist/example.js.map 1.25 kB │ gzip: 0.64 kB
23
+ ℹ dist/connection.sample.js.map 1.03 kB │ gzip: 0.52 kB
24
+ ℹ dist/connection.sample.d.ts.map 0.15 kB │ gzip: 0.13 kB
25
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
26
+ ℹ dist/blueprint.d.ts.map 0.13 kB │ gzip: 0.12 kB
27
+ ℹ dist/workflow.d.ts.map 0.13 kB │ gzip: 0.12 kB
28
+ ℹ dist/tenant.d.ts.map 0.12 kB │ gzip: 0.12 kB
29
+ ℹ dist/example.d.ts 1.12 kB │ gzip: 0.47 kB
30
+ ℹ dist/index.d.ts 0.39 kB │ gzip: 0.17 kB
31
+ ℹ dist/connection.sample.d.ts 0.28 kB │ gzip: 0.17 kB
32
+ ℹ dist/blueprint.d.ts 0.25 kB │ gzip: 0.17 kB
33
+ ℹ dist/tenant.d.ts 0.25 kB │ gzip: 0.17 kB
34
+ ℹ dist/workflow.d.ts 0.24 kB │ gzip: 0.16 kB
35
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
36
+ ℹ dist/docs/integration-stripe.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
37
+ ℹ 27 files, total: 22.55 kB
38
+ ✔ Build complete in 16986ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,161 @@
1
+ # @contractspec/example.integration-stripe
2
+
3
+ ## 1.44.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5f3a868: chore: isolate branding to contractspec.io
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [5f3a868]
12
+ - @contractspec/lib.contracts@1.44.0
13
+ - @contractspec/lib.schema@1.44.0
14
+
15
+ ## 1.43.4
16
+
17
+ ### Patch Changes
18
+
19
+ - 9216062: fix: cross-platform compatibility
20
+ - Updated dependencies [9216062]
21
+ - @contractspec/lib.contracts@1.43.4
22
+ - @contractspec/lib.schema@1.43.3
23
+
24
+ ## 1.43.3
25
+
26
+ ### Patch Changes
27
+
28
+ - 24d9759: improve documentation
29
+ - Updated dependencies [24d9759]
30
+ - @contractspec/lib.contracts@1.43.3
31
+ - @contractspec/lib.schema@1.43.2
32
+
33
+ ## 1.43.2
34
+
35
+ ### Patch Changes
36
+
37
+ - e147271: fix: improve stability
38
+ - Updated dependencies [e147271]
39
+ - @contractspec/lib.contracts@1.43.2
40
+ - @contractspec/lib.schema@1.43.1
41
+
42
+ ## 1.43.1
43
+
44
+ ### Patch Changes
45
+
46
+ - Updated dependencies [f28fdad]
47
+ - @contractspec/lib.contracts@1.43.1
48
+
49
+ ## 1.43.0
50
+
51
+ ### Minor Changes
52
+
53
+ - 042d072: feat: schema declaration using json schema, including zod
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies [042d072]
58
+ - @contractspec/lib.contracts@1.43.0
59
+ - @contractspec/lib.schema@1.43.0
60
+
61
+ ## 1.42.10
62
+
63
+ ### Patch Changes
64
+
65
+ - 1e6a0f1: fix: mcp server
66
+ - Updated dependencies [1e6a0f1]
67
+ - @contractspec/lib.contracts@1.42.10
68
+ - @contractspec/lib.schema@1.42.10
69
+
70
+ ## 1.42.9
71
+
72
+ ### Patch Changes
73
+
74
+ - 9281db7: fix ModelRegistry
75
+ - Updated dependencies [9281db7]
76
+ - @contractspec/lib.contracts@1.42.9
77
+ - @contractspec/lib.schema@1.42.9
78
+
79
+ ## 1.42.8
80
+
81
+ ### Patch Changes
82
+
83
+ - e07b5ac: fix
84
+ - Updated dependencies [e07b5ac]
85
+ - @contractspec/lib.contracts@1.42.8
86
+ - @contractspec/lib.schema@1.42.8
87
+
88
+ ## 1.42.7
89
+
90
+ ### Patch Changes
91
+
92
+ - e9b575d: fix release
93
+ - Updated dependencies [e9b575d]
94
+ - @contractspec/lib.contracts@1.42.7
95
+ - @contractspec/lib.schema@1.42.7
96
+
97
+ ## 1.42.6
98
+
99
+ ### Patch Changes
100
+
101
+ - 1500242: fix tooling
102
+ - Updated dependencies [1500242]
103
+ - @contractspec/lib.contracts@1.42.6
104
+ - @contractspec/lib.schema@1.42.6
105
+
106
+ ## 1.42.5
107
+
108
+ ### Patch Changes
109
+
110
+ - 1299719: fix vscode
111
+ - Updated dependencies [1299719]
112
+ - @contractspec/lib.contracts@1.42.5
113
+ - @contractspec/lib.schema@1.42.5
114
+
115
+ ## 1.42.4
116
+
117
+ ### Patch Changes
118
+
119
+ - ac28b99: fix: generate from openapi
120
+ - Updated dependencies [ac28b99]
121
+ - @contractspec/lib.contracts@1.42.4
122
+ - @contractspec/lib.schema@1.42.4
123
+
124
+ ## 1.42.3
125
+
126
+ ### Patch Changes
127
+
128
+ - 3f5d015: fix(tooling): cicd
129
+ - Updated dependencies [3f5d015]
130
+ - @contractspec/lib.contracts@1.42.3
131
+ - @contractspec/lib.schema@1.42.3
132
+
133
+ ## 1.42.2
134
+
135
+ ### Patch Changes
136
+
137
+ - 1f9ac4c: fix
138
+ - Updated dependencies [1f9ac4c]
139
+ - @contractspec/lib.contracts@1.42.2
140
+ - @contractspec/lib.schema@1.42.2
141
+
142
+ ## 1.42.1
143
+
144
+ ### Patch Changes
145
+
146
+ - f043995: Fix release
147
+ - Updated dependencies [f043995]
148
+ - @contractspec/lib.contracts@1.42.1
149
+ - @contractspec/lib.schema@1.42.1
150
+
151
+ ## 1.42.0
152
+
153
+ ### Minor Changes
154
+
155
+ - 8eefd9c: initial release
156
+
157
+ ### Patch Changes
158
+
159
+ - Updated dependencies [8eefd9c]
160
+ - @contractspec/lib.contracts@1.42.0
161
+ - @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.
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ ### Integration Example – Stripe Payments
2
+
3
+ Website: https://contractspec.io/
4
+
5
+
6
+ This example shows how to wire the `IntegrationSpec`/`TenantAppConfig` layers together to enable Stripe-backed payments for ArtisanOS.
7
+
8
+ Files included:
9
+
10
+ - `blueprint.ts` – declares the `AppBlueprintSpec` enabling the `payments.psp` capability and mapping the payment workflow.
11
+ - `workflow.ts` – minimal `WorkflowSpec` that invokes Stripe operations (`payments.stripe.chargeCard`).
12
+ - `tenant.ts` – tenant configuration binding the workflow to a concrete Stripe `IntegrationConnection`.
13
+ - `connection.sample.ts` – sample connection payload illustrating the data saved by the integrations service.
14
+ - `translation.catalog.json` *(optional)* – canonical strings referenced by `branding.appNameKey`.
15
+
16
+ When the workflow runner executes the `charge` step, the `WorkflowRunner` now surfaces the tenant `ResolvedAppConfig` (including integrations, branding, and translations) through `OperationExecutorContext.resolvedAppConfig`. An implementation of `opExecutor` can:
17
+
18
+ - Pull the connection via `context.integrations[0]` and ask a `secretProvider` for Stripe keys.
19
+ - Resolve tenant-specific branding via `context.branding` for emails or receipts.
20
+ - Resolve localized copy using `context.translationResolver` (if provided by the host).
21
+
22
+ Recommended next steps:
23
+
24
+ 1. Persist the sample connection through the integration CRUD contracts (`integrations.connection.create`).
25
+ 2. Register the blueprint + workflow + translation catalog in your registry.
26
+ 3. Use `registerIntegrationContracts` and `registerAppConfigContracts` to expose the connection, branding, and translation management operations.
27
+ 4. Implement the payment contract handlers to read `ctx.integrations`, fetch secrets through `ctx.secretProvider`, and execute Stripe calls.
28
+ 5. Render receipts or notifications by combining `ctx.branding` (logos/domain) and `ctx.translation.resolve(key, locale)` for localized copy.
29
+
@@ -0,0 +1,7 @@
1
+ import { AppBlueprintSpec } from "@contractspec/lib.contracts/app-config/spec";
2
+
3
+ //#region src/blueprint.d.ts
4
+ declare const artisanStripeBlueprint: AppBlueprintSpec;
5
+ //#endregion
6
+ export { artisanStripeBlueprint };
7
+ //# sourceMappingURL=blueprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blueprint.d.ts","names":[],"sources":["../src/blueprint.ts"],"sourcesContent":[],"mappings":";;;cAOa,wBAAwB"}
@@ -0,0 +1,66 @@
1
+ import { OwnersEnum, StabilityEnum, TagsEnum } from "@contractspec/lib.contracts/ownership";
2
+
3
+ //#region src/blueprint.ts
4
+ const artisanStripeBlueprint = {
5
+ meta: {
6
+ key: "artisan.payments.stripe",
7
+ version: 1,
8
+ appId: "artisan",
9
+ title: "ArtisanOS Stripe Payments",
10
+ description: "Blueprint enabling card payments for ArtisanOS merchants via the Stripe integration.",
11
+ domain: "payments",
12
+ owners: [OwnersEnum.PlatformCore],
13
+ tags: [
14
+ TagsEnum.Marketplace,
15
+ "stripe",
16
+ "payments"
17
+ ],
18
+ stability: StabilityEnum.Experimental
19
+ },
20
+ capabilities: { enabled: [{
21
+ key: "payments.psp",
22
+ version: 1
23
+ }] },
24
+ integrationSlots: [{
25
+ slotId: "primary-payments",
26
+ requiredCategory: "payments",
27
+ allowedModes: ["managed", "byok"],
28
+ requiredCapabilities: [{
29
+ key: "payments.psp",
30
+ version: 1
31
+ }],
32
+ required: true,
33
+ description: "Primary card processor slot. Bind the tenant Stripe connection here."
34
+ }],
35
+ branding: {
36
+ appNameKey: "artisan.payments.appName",
37
+ assets: [{
38
+ type: "logo",
39
+ url: "https://cdn.artisanos.dev/branding/logo.png"
40
+ }, {
41
+ type: "favicon",
42
+ url: "https://cdn.artisanos.dev/branding/favicon.ico"
43
+ }],
44
+ colorTokens: {
45
+ primary: "colors.brand.primary",
46
+ secondary: "colors.brand.secondary"
47
+ }
48
+ },
49
+ translationCatalog: {
50
+ key: "artisan.payments.catalog",
51
+ version: 1
52
+ },
53
+ workflows: { collectPayment: {
54
+ key: "artisan.payments.collectPayment",
55
+ version: 1
56
+ } },
57
+ policies: [{
58
+ key: "artisan.payments.default",
59
+ version: 1
60
+ }],
61
+ notes: "Install this blueprint and pair it with the Stripe integration connection to enable card collection."
62
+ };
63
+
64
+ //#endregion
65
+ export { artisanStripeBlueprint };
66
+ //# sourceMappingURL=blueprint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blueprint.js","names":["artisanStripeBlueprint: AppBlueprintSpec"],"sources":["../src/blueprint.ts"],"sourcesContent":["import type { AppBlueprintSpec } from '@contractspec/lib.contracts/app-config/spec';\nimport {\n OwnersEnum,\n StabilityEnum,\n TagsEnum,\n} from '@contractspec/lib.contracts/ownership';\n\nexport const artisanStripeBlueprint: AppBlueprintSpec = {\n meta: {\n key: 'artisan.payments.stripe',\n version: 1,\n appId: 'artisan',\n title: 'ArtisanOS Stripe Payments',\n description:\n 'Blueprint enabling card payments for ArtisanOS merchants via the Stripe integration.',\n domain: 'payments',\n owners: [OwnersEnum.PlatformCore],\n tags: [TagsEnum.Marketplace, 'stripe', 'payments'],\n stability: StabilityEnum.Experimental,\n },\n capabilities: {\n enabled: [{ key: 'payments.psp', version: 1 }],\n },\n integrationSlots: [\n {\n slotId: 'primary-payments',\n requiredCategory: 'payments',\n allowedModes: ['managed', 'byok'],\n requiredCapabilities: [{ key: 'payments.psp', version: 1 }],\n required: true,\n description:\n 'Primary card processor slot. Bind the tenant Stripe connection here.',\n },\n ],\n branding: {\n appNameKey: 'artisan.payments.appName',\n assets: [\n { type: 'logo', url: 'https://cdn.artisanos.dev/branding/logo.png' },\n {\n type: 'favicon',\n url: 'https://cdn.artisanos.dev/branding/favicon.ico',\n },\n ],\n colorTokens: {\n primary: 'colors.brand.primary',\n secondary: 'colors.brand.secondary',\n },\n },\n translationCatalog: {\n key: 'artisan.payments.catalog',\n version: 1,\n },\n workflows: {\n collectPayment: { key: 'artisan.payments.collectPayment', version: 1 },\n },\n policies: [{ key: 'artisan.payments.default', version: 1 }],\n notes:\n 'Install this blueprint and pair it with the Stripe integration connection to enable card collection.',\n};\n"],"mappings":";;;AAOA,MAAaA,yBAA2C;CACtD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,WAAW,aAAa;EACjC,MAAM;GAAC,SAAS;GAAa;GAAU;GAAW;EAClD,WAAW,cAAc;EAC1B;CACD,cAAc,EACZ,SAAS,CAAC;EAAE,KAAK;EAAgB,SAAS;EAAG,CAAC,EAC/C;CACD,kBAAkB,CAChB;EACE,QAAQ;EACR,kBAAkB;EAClB,cAAc,CAAC,WAAW,OAAO;EACjC,sBAAsB,CAAC;GAAE,KAAK;GAAgB,SAAS;GAAG,CAAC;EAC3D,UAAU;EACV,aACE;EACH,CACF;CACD,UAAU;EACR,YAAY;EACZ,QAAQ,CACN;GAAE,MAAM;GAAQ,KAAK;GAA+C,EACpE;GACE,MAAM;GACN,KAAK;GACN,CACF;EACD,aAAa;GACX,SAAS;GACT,WAAW;GACZ;EACF;CACD,oBAAoB;EAClB,KAAK;EACL,SAAS;EACV;CACD,WAAW,EACT,gBAAgB;EAAE,KAAK;EAAmC,SAAS;EAAG,EACvE;CACD,UAAU,CAAC;EAAE,KAAK;EAA4B,SAAS;EAAG,CAAC;CAC3D,OACE;CACH"}
@@ -0,0 +1,7 @@
1
+ import { IntegrationConnection } from "@contractspec/lib.contracts/integrations/connection";
2
+
3
+ //#region src/connection.sample.d.ts
4
+ declare const stripeLiveConnection: IntegrationConnection;
5
+ //#endregion
6
+ export { stripeLiveConnection };
7
+ //# sourceMappingURL=connection.sample.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.sample.d.ts","names":[],"sources":["../src/connection.sample.ts"],"sourcesContent":[],"mappings":";;;cAEa,sBAAsB"}
@@ -0,0 +1,22 @@
1
+ //#region src/connection.sample.ts
2
+ const stripeLiveConnection = {
3
+ meta: {
4
+ id: "conn-stripe-live",
5
+ tenantId: "artisan-co",
6
+ integrationKey: "payments.stripe",
7
+ integrationVersion: 1,
8
+ label: "Stripe Production",
9
+ environment: "production",
10
+ createdAt: "2026-01-01T00:00:00.000Z",
11
+ updatedAt: "2026-01-01T00:00:00.000Z"
12
+ },
13
+ ownershipMode: "managed",
14
+ config: { accountId: "acct_xxx" },
15
+ secretProvider: "vault",
16
+ secretRef: "vault://integrations/artisan-co/conn-stripe-live",
17
+ status: "connected"
18
+ };
19
+
20
+ //#endregion
21
+ export { stripeLiveConnection };
22
+ //# sourceMappingURL=connection.sample.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.sample.js","names":["stripeLiveConnection: IntegrationConnection"],"sources":["../src/connection.sample.ts"],"sourcesContent":["import type { IntegrationConnection } from '@contractspec/lib.contracts/integrations/connection';\n\nexport const stripeLiveConnection: IntegrationConnection = {\n meta: {\n id: 'conn-stripe-live',\n tenantId: 'artisan-co',\n integrationKey: 'payments.stripe',\n integrationVersion: 1,\n label: 'Stripe Production',\n environment: 'production',\n createdAt: '2026-01-01T00:00:00.000Z',\n updatedAt: '2026-01-01T00:00:00.000Z',\n },\n ownershipMode: 'managed',\n config: {\n accountId: 'acct_xxx',\n },\n secretProvider: 'vault',\n secretRef: 'vault://integrations/artisan-co/conn-stripe-live',\n status: 'connected',\n};\n"],"mappings":";AAEA,MAAaA,uBAA8C;CACzD,MAAM;EACJ,IAAI;EACJ,UAAU;EACV,gBAAgB;EAChB,oBAAoB;EACpB,OAAO;EACP,aAAa;EACb,WAAW;EACX,WAAW;EACZ;CACD,eAAe;CACf,QAAQ,EACN,WAAW,YACZ;CACD,gBAAgB;CAChB,WAAW;CACX,QAAQ;CACT"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ import "./integration-stripe.docblock.js";
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,30 @@
1
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
2
+
3
+ //#region src/docs/integration-stripe.docblock.ts
4
+ registerDocBlocks([{
5
+ id: "docs.examples.integration-stripe",
6
+ title: "Integration Example — Stripe Payments",
7
+ summary: "How to wire IntegrationSpec/TenantAppConfig + blueprint + workflow to enable Stripe-backed payments.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/integration-stripe",
11
+ tags: [
12
+ "stripe",
13
+ "payments",
14
+ "integrations",
15
+ "example"
16
+ ],
17
+ body: `## Included\n- App blueprint enabling \`payments.psp\` capability.\n- Workflow invoking Stripe operations (prepare → charge → confirm).\n- Tenant app config binding workflow to an IntegrationConnection.\n\n## Notes\n- Secrets live in secret providers; connection config is non-secret.\n- Use \`ctx.resolvedAppConfig\` in operation executors to access integrations, branding, and translations.`
18
+ }, {
19
+ id: "docs.examples.integration-stripe.usage",
20
+ title: "Stripe Integration Example — Usage",
21
+ summary: "How to use the blueprint, workflow, and tenant config together.",
22
+ kind: "usage",
23
+ visibility: "public",
24
+ route: "/docs/examples/integration-stripe/usage",
25
+ tags: ["stripe", "usage"],
26
+ body: `## Usage\n1) Register the blueprint + workflow + catalog in your registry.\n2) Persist an IntegrationConnection (see connection sample).\n3) Bind the tenant app config to the connection.\n\n## Guardrails\n- Never log secrets.\n- Keep payment semantics spec-defined; gate breaking changes behind flags.`
27
+ }]);
28
+
29
+ //#endregion
30
+ //# sourceMappingURL=integration-stripe.docblock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-stripe.docblock.js","names":[],"sources":["../../src/docs/integration-stripe.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.integration-stripe',\n title: 'Integration Example — Stripe Payments',\n summary:\n 'How to wire IntegrationSpec/TenantAppConfig + blueprint + workflow to enable Stripe-backed payments.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/integration-stripe',\n tags: ['stripe', 'payments', 'integrations', 'example'],\n body: `## Included\\n- App blueprint enabling \\`payments.psp\\` capability.\\n- Workflow invoking Stripe operations (prepare → charge → confirm).\\n- Tenant app config binding workflow to an IntegrationConnection.\\n\\n## Notes\\n- Secrets live in secret providers; connection config is non-secret.\\n- Use \\`ctx.resolvedAppConfig\\` in operation executors to access integrations, branding, and translations.`,\n },\n {\n id: 'docs.examples.integration-stripe.usage',\n title: 'Stripe Integration Example — Usage',\n summary: 'How to use the blueprint, workflow, and tenant config together.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/integration-stripe/usage',\n tags: ['stripe', 'usage'],\n body: `## Usage\\n1) Register the blueprint + workflow + catalog in your registry.\\n2) Persist an IntegrationConnection (see connection sample).\\n3) Bind the tenant app config to the connection.\\n\\n## Guardrails\\n- Never log secrets.\\n- Keep payment semantics spec-defined; gate breaking changes behind flags.`,\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;EAAU;EAAY;EAAgB;EAAU;CACvD,MAAM;CACP,EACD;CACE,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM,CAAC,UAAU,QAAQ;CACzB,MAAM;CACP,CACF,CAEwB"}
@@ -0,0 +1,34 @@
1
+ //#region src/example.d.ts
2
+ declare const example: {
3
+ readonly id: "integration-stripe";
4
+ readonly title: "Integration — Stripe Payments";
5
+ readonly summary: "Wire AppBlueprint + Workflow + TenantAppConfig to enable Stripe-backed payments (spec-first integration pattern).";
6
+ readonly tags: readonly ["stripe", "payments", "integration", "blueprint", "workflow"];
7
+ readonly kind: "integration";
8
+ readonly visibility: "public";
9
+ readonly docs: {
10
+ readonly rootDocId: "docs.examples.integration-stripe";
11
+ readonly usageDocId: "docs.examples.integration-stripe.usage";
12
+ };
13
+ readonly entrypoints: {
14
+ readonly packageName: "@contractspec/example.integration-stripe";
15
+ readonly docs: "./docs";
16
+ };
17
+ readonly surfaces: {
18
+ readonly templates: true;
19
+ readonly sandbox: {
20
+ readonly enabled: true;
21
+ readonly modes: readonly ["markdown", "specs"];
22
+ };
23
+ readonly studio: {
24
+ readonly enabled: true;
25
+ readonly installable: true;
26
+ };
27
+ readonly mcp: {
28
+ readonly enabled: true;
29
+ };
30
+ };
31
+ };
32
+ //#endregion
33
+ export { example as default };
34
+ //# sourceMappingURL=example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";cAAM;EAAA,SAAA,EAsBI,EAAA,oBAAA"}
@@ -0,0 +1,40 @@
1
+ //#region src/example.ts
2
+ const example = {
3
+ id: "integration-stripe",
4
+ title: "Integration — Stripe Payments",
5
+ summary: "Wire AppBlueprint + Workflow + TenantAppConfig to enable Stripe-backed payments (spec-first integration pattern).",
6
+ tags: [
7
+ "stripe",
8
+ "payments",
9
+ "integration",
10
+ "blueprint",
11
+ "workflow"
12
+ ],
13
+ kind: "integration",
14
+ visibility: "public",
15
+ docs: {
16
+ rootDocId: "docs.examples.integration-stripe",
17
+ usageDocId: "docs.examples.integration-stripe.usage"
18
+ },
19
+ entrypoints: {
20
+ packageName: "@contractspec/example.integration-stripe",
21
+ docs: "./docs"
22
+ },
23
+ surfaces: {
24
+ templates: true,
25
+ sandbox: {
26
+ enabled: true,
27
+ modes: ["markdown", "specs"]
28
+ },
29
+ studio: {
30
+ enabled: true,
31
+ installable: true
32
+ },
33
+ mcp: { enabled: true }
34
+ }
35
+ };
36
+ var example_default = example;
37
+
38
+ //#endregion
39
+ export { example_default as default };
40
+ //# sourceMappingURL=example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["const example = {\n id: 'integration-stripe',\n title: 'Integration — Stripe Payments',\n summary:\n 'Wire AppBlueprint + Workflow + TenantAppConfig to enable Stripe-backed payments (spec-first integration pattern).',\n tags: ['stripe', 'payments', 'integration', 'blueprint', 'workflow'],\n kind: 'integration',\n visibility: 'public',\n docs: {\n rootDocId: 'docs.examples.integration-stripe',\n usageDocId: 'docs.examples.integration-stripe.usage',\n },\n entrypoints: {\n packageName: '@contractspec/example.integration-stripe',\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} as const;\n\nexport default example;\n"],"mappings":";AAAA,MAAM,UAAU;CACd,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;EAAC;EAAU;EAAY;EAAe;EAAa;EAAW;CACpE,MAAM;CACN,YAAY;CACZ,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;AAED,sBAAe"}
@@ -0,0 +1,6 @@
1
+ import { artisanStripeBlueprint } from "./blueprint.js";
2
+ import { stripeLiveConnection } from "./connection.sample.js";
3
+ import example from "./example.js";
4
+ import { collectPaymentWorkflow } from "./workflow.js";
5
+ import { artisanStripeTenantConfig } from "./tenant.js";
6
+ export { artisanStripeBlueprint, artisanStripeTenantConfig, collectPaymentWorkflow, example, stripeLiveConnection };
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ import { artisanStripeBlueprint } from "./blueprint.js";
2
+ import { stripeLiveConnection } from "./connection.sample.js";
3
+ import example_default from "./example.js";
4
+ import { collectPaymentWorkflow } from "./workflow.js";
5
+ import { artisanStripeTenantConfig } from "./tenant.js";
6
+ import "./docs/index.js";
7
+
8
+ export { artisanStripeBlueprint, artisanStripeTenantConfig, collectPaymentWorkflow, example_default as example, stripeLiveConnection };
@@ -0,0 +1,7 @@
1
+ import { TenantAppConfig } from "@contractspec/lib.contracts/app-config/spec";
2
+
3
+ //#region src/tenant.d.ts
4
+ declare const artisanStripeTenantConfig: TenantAppConfig;
5
+ //#endregion
6
+ export { artisanStripeTenantConfig };
7
+ //# sourceMappingURL=tenant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenant.d.ts","names":[],"sources":["../src/tenant.ts"],"sourcesContent":[],"mappings":";;;cAEa,2BAA2B"}
package/dist/tenant.js ADDED
@@ -0,0 +1,53 @@
1
+ //#region src/tenant.ts
2
+ const artisanStripeTenantConfig = {
3
+ meta: {
4
+ id: "tenant-config-artisan-stripe",
5
+ tenantId: "artisan-co",
6
+ appId: "artisan",
7
+ blueprintName: "artisan.payments.stripe",
8
+ blueprintVersion: 1,
9
+ environment: "production",
10
+ version: 1,
11
+ status: "published",
12
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
13
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
14
+ },
15
+ integrations: [{
16
+ slotId: "primary-payments",
17
+ connectionId: "conn-stripe-live",
18
+ scope: {
19
+ workflows: ["collectPayment"],
20
+ operations: ["payments.stripe.chargeCard"]
21
+ }
22
+ }],
23
+ knowledge: [],
24
+ locales: {
25
+ defaultLocale: "en",
26
+ enabledLocales: ["en", "fr"]
27
+ },
28
+ translationOverrides: { entries: [{
29
+ key: "artisan.payments.appName",
30
+ locale: "en",
31
+ value: "Artisan Payments Portal"
32
+ }] },
33
+ branding: {
34
+ appName: { en: "Artisan Payments Portal" },
35
+ assets: [{
36
+ type: "logo",
37
+ url: "https://tenant.artisanos.dev/logo.png"
38
+ }, {
39
+ type: "logo-dark",
40
+ url: "https://tenant.artisanos.dev/logo-dark.png"
41
+ }],
42
+ colors: {
43
+ primary: "#F97316",
44
+ secondary: "#1F2937"
45
+ },
46
+ customDomain: "pay.artisanos.dev"
47
+ },
48
+ notes: "Stripe connection bound for production payments."
49
+ };
50
+
51
+ //#endregion
52
+ export { artisanStripeTenantConfig };
53
+ //# sourceMappingURL=tenant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenant.js","names":["artisanStripeTenantConfig: TenantAppConfig"],"sources":["../src/tenant.ts"],"sourcesContent":["import type { TenantAppConfig } from '@contractspec/lib.contracts/app-config/spec';\n\nexport const artisanStripeTenantConfig: TenantAppConfig = {\n meta: {\n id: 'tenant-config-artisan-stripe',\n tenantId: 'artisan-co',\n appId: 'artisan',\n blueprintName: 'artisan.payments.stripe',\n blueprintVersion: 1,\n environment: 'production',\n version: 1,\n status: 'published',\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n },\n integrations: [\n {\n slotId: 'primary-payments',\n connectionId: 'conn-stripe-live',\n scope: {\n workflows: ['collectPayment'],\n operations: ['payments.stripe.chargeCard'],\n },\n },\n ],\n knowledge: [],\n locales: {\n defaultLocale: 'en',\n enabledLocales: ['en', 'fr'],\n },\n translationOverrides: {\n entries: [\n {\n key: 'artisan.payments.appName',\n locale: 'en',\n value: 'Artisan Payments Portal',\n },\n ],\n },\n branding: {\n appName: { en: 'Artisan Payments Portal' },\n assets: [\n { type: 'logo', url: 'https://tenant.artisanos.dev/logo.png' },\n { type: 'logo-dark', url: 'https://tenant.artisanos.dev/logo-dark.png' },\n ],\n colors: {\n primary: '#F97316',\n secondary: '#1F2937',\n },\n customDomain: 'pay.artisanos.dev',\n },\n notes: 'Stripe connection bound for production payments.',\n};\n"],"mappings":";AAEA,MAAaA,4BAA6C;CACxD,MAAM;EACJ,IAAI;EACJ,UAAU;EACV,OAAO;EACP,eAAe;EACf,kBAAkB;EAClB,aAAa;EACb,SAAS;EACT,QAAQ;EACR,4BAAW,IAAI,MAAM,EAAC,aAAa;EACnC,4BAAW,IAAI,MAAM,EAAC,aAAa;EACpC;CACD,cAAc,CACZ;EACE,QAAQ;EACR,cAAc;EACd,OAAO;GACL,WAAW,CAAC,iBAAiB;GAC7B,YAAY,CAAC,6BAA6B;GAC3C;EACF,CACF;CACD,WAAW,EAAE;CACb,SAAS;EACP,eAAe;EACf,gBAAgB,CAAC,MAAM,KAAK;EAC7B;CACD,sBAAsB,EACpB,SAAS,CACP;EACE,KAAK;EACL,QAAQ;EACR,OAAO;EACR,CACF,EACF;CACD,UAAU;EACR,SAAS,EAAE,IAAI,2BAA2B;EAC1C,QAAQ,CACN;GAAE,MAAM;GAAQ,KAAK;GAAyC,EAC9D;GAAE,MAAM;GAAa,KAAK;GAA8C,CACzE;EACD,QAAQ;GACN,SAAS;GACT,WAAW;GACZ;EACD,cAAc;EACf;CACD,OAAO;CACR"}
@@ -0,0 +1,7 @@
1
+ import { WorkflowSpec } from "@contractspec/lib.contracts/workflow/spec";
2
+
3
+ //#region src/workflow.d.ts
4
+ declare const collectPaymentWorkflow: WorkflowSpec;
5
+ //#endregion
6
+ export { collectPaymentWorkflow };
7
+ //# sourceMappingURL=workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.d.ts","names":[],"sources":["../src/workflow.ts"],"sourcesContent":[],"mappings":";;;cAOa,wBAAwB"}
@@ -0,0 +1,59 @@
1
+ import { OwnersEnum, StabilityEnum, TagsEnum } from "@contractspec/lib.contracts/ownership";
2
+
3
+ //#region src/workflow.ts
4
+ const collectPaymentWorkflow = {
5
+ meta: {
6
+ key: "artisan.payments.collectPayment",
7
+ version: 1,
8
+ title: "Collect Card Payment",
9
+ description: "Charge a customer using the tenant Stripe connection and record settlement details.",
10
+ domain: "payments",
11
+ owners: [OwnersEnum.PlatformCore],
12
+ tags: [TagsEnum.Marketplace, "stripe"],
13
+ stability: StabilityEnum.Experimental
14
+ },
15
+ definition: {
16
+ entryStepId: "prepare",
17
+ steps: [
18
+ {
19
+ id: "prepare",
20
+ type: "automation",
21
+ label: "Prepare charge parameters",
22
+ action: { operation: {
23
+ key: "payments.prepareCharge",
24
+ version: 1
25
+ } }
26
+ },
27
+ {
28
+ id: "charge",
29
+ type: "automation",
30
+ label: "Charge card via Stripe",
31
+ action: { operation: {
32
+ key: "payments.stripe.chargeCard",
33
+ version: 1
34
+ } }
35
+ },
36
+ {
37
+ id: "confirm",
38
+ type: "automation",
39
+ label: "Confirm settlement",
40
+ action: { operation: {
41
+ key: "payments.recordSettlement",
42
+ version: 1
43
+ } }
44
+ }
45
+ ],
46
+ transitions: [{
47
+ from: "prepare",
48
+ to: "charge"
49
+ }, {
50
+ from: "charge",
51
+ to: "confirm",
52
+ condition: "output.success === true"
53
+ }]
54
+ }
55
+ };
56
+
57
+ //#endregion
58
+ export { collectPaymentWorkflow };
59
+ //# sourceMappingURL=workflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.js","names":["collectPaymentWorkflow: WorkflowSpec"],"sources":["../src/workflow.ts"],"sourcesContent":["import type { WorkflowSpec } from '@contractspec/lib.contracts/workflow/spec';\nimport {\n OwnersEnum,\n StabilityEnum,\n TagsEnum,\n} from '@contractspec/lib.contracts/ownership';\n\nexport const collectPaymentWorkflow: WorkflowSpec = {\n meta: {\n key: 'artisan.payments.collectPayment',\n version: 1,\n title: 'Collect Card Payment',\n description:\n 'Charge a customer using the tenant Stripe connection and record settlement details.',\n domain: 'payments',\n owners: [OwnersEnum.PlatformCore],\n tags: [TagsEnum.Marketplace, 'stripe'],\n stability: StabilityEnum.Experimental,\n },\n definition: {\n entryStepId: 'prepare',\n steps: [\n {\n id: 'prepare',\n type: 'automation',\n label: 'Prepare charge parameters',\n action: {\n operation: { key: 'payments.prepareCharge', version: 1 },\n },\n },\n {\n id: 'charge',\n type: 'automation',\n label: 'Charge card via Stripe',\n action: {\n operation: { key: 'payments.stripe.chargeCard', version: 1 },\n },\n },\n {\n id: 'confirm',\n type: 'automation',\n label: 'Confirm settlement',\n action: {\n operation: { key: 'payments.recordSettlement', version: 1 },\n },\n },\n ],\n transitions: [\n { from: 'prepare', to: 'charge' },\n { from: 'charge', to: 'confirm', condition: 'output.success === true' },\n ],\n },\n};\n"],"mappings":";;;AAOA,MAAaA,yBAAuC;CAClD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,WAAW,aAAa;EACjC,MAAM,CAAC,SAAS,aAAa,SAAS;EACtC,WAAW,cAAc;EAC1B;CACD,YAAY;EACV,aAAa;EACb,OAAO;GACL;IACE,IAAI;IACJ,MAAM;IACN,OAAO;IACP,QAAQ,EACN,WAAW;KAAE,KAAK;KAA0B,SAAS;KAAG,EACzD;IACF;GACD;IACE,IAAI;IACJ,MAAM;IACN,OAAO;IACP,QAAQ,EACN,WAAW;KAAE,KAAK;KAA8B,SAAS;KAAG,EAC7D;IACF;GACD;IACE,IAAI;IACJ,MAAM;IACN,OAAO;IACP,QAAQ,EACN,WAAW;KAAE,KAAK;KAA6B,SAAS;KAAG,EAC5D;IACF;GACF;EACD,aAAa,CACX;GAAE,MAAM;GAAW,IAAI;GAAU,EACjC;GAAE,MAAM;GAAU,IAAI;GAAW,WAAW;GAA2B,CACxE;EACF;CACF"}
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@contractspec/example.integration-stripe",
3
+ "version": "1.44.0",
4
+ "description": "Integration example – Stripe Payments (blueprint + workflow + tenant config).",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": "./dist/index.js",
10
+ "./blueprint": "./dist/blueprint.js",
11
+ "./connection.sample": "./dist/connection.sample.js",
12
+ "./docs": "./dist/docs/index.js",
13
+ "./docs/integration-stripe.docblock": "./dist/docs/integration-stripe.docblock.js",
14
+ "./example": "./dist/example.js",
15
+ "./tenant": "./dist/tenant.js",
16
+ "./workflow": "./dist/workflow.js",
17
+ "./*": "./*"
18
+ },
19
+ "scripts": {
20
+ "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
21
+ "publish:pkg:canary": "bun publish:pkg --tag canary",
22
+ "build": "bun build:types && bun build:bundle",
23
+ "build:bundle": "tsdown",
24
+ "build:types": "tsc --noEmit",
25
+ "dev": "bun build:bundle --watch",
26
+ "clean": "rimraf dist .turbo",
27
+ "lint": "bun lint:fix",
28
+ "lint:fix": "eslint src --fix",
29
+ "lint:check": "eslint src",
30
+ "test": "bun test"
31
+ },
32
+ "dependencies": {
33
+ "@contractspec/lib.schema": "1.44.0",
34
+ "@contractspec/lib.contracts": "1.44.0"
35
+ },
36
+ "devDependencies": {
37
+ "@contractspec/tool.tsdown": "1.44.0",
38
+ "@contractspec/tool.typescript": "1.44.0",
39
+ "tsdown": "^0.18.3",
40
+ "typescript": "^5.9.3"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public",
44
+ "exports": {
45
+ ".": "./dist/index.js",
46
+ "./blueprint": "./dist/blueprint.js",
47
+ "./connection.sample": "./dist/connection.sample.js",
48
+ "./docs": "./dist/docs/index.js",
49
+ "./docs/integration-stripe.docblock": "./dist/docs/integration-stripe.docblock.js",
50
+ "./example": "./dist/example.js",
51
+ "./tenant": "./dist/tenant.js",
52
+ "./workflow": "./dist/workflow.js",
53
+ "./*": "./*"
54
+ },
55
+ "registry": "https://registry.npmjs.org/"
56
+ },
57
+ "module": "./dist/index.js",
58
+ "license": "MIT",
59
+ "repository": {
60
+ "type": "git",
61
+ "url": "https://github.com/lssm-tech/contractspec.git",
62
+ "directory": "packages/examples/integration-stripe"
63
+ },
64
+ "homepage": "https://contractspec.io"
65
+ }
@@ -0,0 +1,59 @@
1
+ import type { AppBlueprintSpec } from '@contractspec/lib.contracts/app-config/spec';
2
+ import {
3
+ OwnersEnum,
4
+ StabilityEnum,
5
+ TagsEnum,
6
+ } from '@contractspec/lib.contracts/ownership';
7
+
8
+ export const artisanStripeBlueprint: AppBlueprintSpec = {
9
+ meta: {
10
+ key: 'artisan.payments.stripe',
11
+ version: 1,
12
+ appId: 'artisan',
13
+ title: 'ArtisanOS Stripe Payments',
14
+ description:
15
+ 'Blueprint enabling card payments for ArtisanOS merchants via the Stripe integration.',
16
+ domain: 'payments',
17
+ owners: [OwnersEnum.PlatformCore],
18
+ tags: [TagsEnum.Marketplace, 'stripe', 'payments'],
19
+ stability: StabilityEnum.Experimental,
20
+ },
21
+ capabilities: {
22
+ enabled: [{ key: 'payments.psp', version: 1 }],
23
+ },
24
+ integrationSlots: [
25
+ {
26
+ slotId: 'primary-payments',
27
+ requiredCategory: 'payments',
28
+ allowedModes: ['managed', 'byok'],
29
+ requiredCapabilities: [{ key: 'payments.psp', version: 1 }],
30
+ required: true,
31
+ description:
32
+ 'Primary card processor slot. Bind the tenant Stripe connection here.',
33
+ },
34
+ ],
35
+ branding: {
36
+ appNameKey: 'artisan.payments.appName',
37
+ assets: [
38
+ { type: 'logo', url: 'https://cdn.artisanos.dev/branding/logo.png' },
39
+ {
40
+ type: 'favicon',
41
+ url: 'https://cdn.artisanos.dev/branding/favicon.ico',
42
+ },
43
+ ],
44
+ colorTokens: {
45
+ primary: 'colors.brand.primary',
46
+ secondary: 'colors.brand.secondary',
47
+ },
48
+ },
49
+ translationCatalog: {
50
+ key: 'artisan.payments.catalog',
51
+ version: 1,
52
+ },
53
+ workflows: {
54
+ collectPayment: { key: 'artisan.payments.collectPayment', version: 1 },
55
+ },
56
+ policies: [{ key: 'artisan.payments.default', version: 1 }],
57
+ notes:
58
+ 'Install this blueprint and pair it with the Stripe integration connection to enable card collection.',
59
+ };
@@ -0,0 +1,21 @@
1
+ import type { IntegrationConnection } from '@contractspec/lib.contracts/integrations/connection';
2
+
3
+ export const stripeLiveConnection: IntegrationConnection = {
4
+ meta: {
5
+ id: 'conn-stripe-live',
6
+ tenantId: 'artisan-co',
7
+ integrationKey: 'payments.stripe',
8
+ integrationVersion: 1,
9
+ label: 'Stripe Production',
10
+ environment: 'production',
11
+ createdAt: '2026-01-01T00:00:00.000Z',
12
+ updatedAt: '2026-01-01T00:00:00.000Z',
13
+ },
14
+ ownershipMode: 'managed',
15
+ config: {
16
+ accountId: 'acct_xxx',
17
+ },
18
+ secretProvider: 'vault',
19
+ secretRef: 'vault://integrations/artisan-co/conn-stripe-live',
20
+ status: 'connected',
21
+ };
@@ -0,0 +1 @@
1
+ import './integration-stripe.docblock';
@@ -0,0 +1,28 @@
1
+ import type { DocBlock } from '@contractspec/lib.contracts/docs';
2
+ import { registerDocBlocks } from '@contractspec/lib.contracts/docs';
3
+
4
+ const blocks: DocBlock[] = [
5
+ {
6
+ id: 'docs.examples.integration-stripe',
7
+ title: 'Integration Example — Stripe Payments',
8
+ summary:
9
+ 'How to wire IntegrationSpec/TenantAppConfig + blueprint + workflow to enable Stripe-backed payments.',
10
+ kind: 'reference',
11
+ visibility: 'public',
12
+ route: '/docs/examples/integration-stripe',
13
+ tags: ['stripe', 'payments', 'integrations', 'example'],
14
+ body: `## Included\n- App blueprint enabling \`payments.psp\` capability.\n- Workflow invoking Stripe operations (prepare → charge → confirm).\n- Tenant app config binding workflow to an IntegrationConnection.\n\n## Notes\n- Secrets live in secret providers; connection config is non-secret.\n- Use \`ctx.resolvedAppConfig\` in operation executors to access integrations, branding, and translations.`,
15
+ },
16
+ {
17
+ id: 'docs.examples.integration-stripe.usage',
18
+ title: 'Stripe Integration Example — Usage',
19
+ summary: 'How to use the blueprint, workflow, and tenant config together.',
20
+ kind: 'usage',
21
+ visibility: 'public',
22
+ route: '/docs/examples/integration-stripe/usage',
23
+ tags: ['stripe', 'usage'],
24
+ body: `## Usage\n1) Register the blueprint + workflow + catalog in your registry.\n2) Persist an IntegrationConnection (see connection sample).\n3) Bind the tenant app config to the connection.\n\n## Guardrails\n- Never log secrets.\n- Keep payment semantics spec-defined; gate breaking changes behind flags.`,
25
+ },
26
+ ];
27
+
28
+ registerDocBlocks(blocks);
package/src/example.ts ADDED
@@ -0,0 +1,25 @@
1
+ const example = {
2
+ id: 'integration-stripe',
3
+ title: 'Integration — Stripe Payments',
4
+ summary:
5
+ 'Wire AppBlueprint + Workflow + TenantAppConfig to enable Stripe-backed payments (spec-first integration pattern).',
6
+ tags: ['stripe', 'payments', 'integration', 'blueprint', 'workflow'],
7
+ kind: 'integration',
8
+ visibility: 'public',
9
+ docs: {
10
+ rootDocId: 'docs.examples.integration-stripe',
11
+ usageDocId: 'docs.examples.integration-stripe.usage',
12
+ },
13
+ entrypoints: {
14
+ packageName: '@contractspec/example.integration-stripe',
15
+ docs: './docs',
16
+ },
17
+ surfaces: {
18
+ templates: true,
19
+ sandbox: { enabled: true, modes: ['markdown', 'specs'] },
20
+ studio: { enabled: true, installable: true },
21
+ mcp: { enabled: true },
22
+ },
23
+ } as const;
24
+
25
+ export default example;
package/src/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ export * from './blueprint';
2
+ export * from './workflow';
3
+ export * from './tenant';
4
+ export * from './connection.sample';
5
+ export { default as example } from './example';
6
+ import './docs';
package/src/tenant.ts ADDED
@@ -0,0 +1,53 @@
1
+ import type { TenantAppConfig } from '@contractspec/lib.contracts/app-config/spec';
2
+
3
+ export const artisanStripeTenantConfig: TenantAppConfig = {
4
+ meta: {
5
+ id: 'tenant-config-artisan-stripe',
6
+ tenantId: 'artisan-co',
7
+ appId: 'artisan',
8
+ blueprintName: 'artisan.payments.stripe',
9
+ blueprintVersion: 1,
10
+ environment: 'production',
11
+ version: 1,
12
+ status: 'published',
13
+ createdAt: new Date().toISOString(),
14
+ updatedAt: new Date().toISOString(),
15
+ },
16
+ integrations: [
17
+ {
18
+ slotId: 'primary-payments',
19
+ connectionId: 'conn-stripe-live',
20
+ scope: {
21
+ workflows: ['collectPayment'],
22
+ operations: ['payments.stripe.chargeCard'],
23
+ },
24
+ },
25
+ ],
26
+ knowledge: [],
27
+ locales: {
28
+ defaultLocale: 'en',
29
+ enabledLocales: ['en', 'fr'],
30
+ },
31
+ translationOverrides: {
32
+ entries: [
33
+ {
34
+ key: 'artisan.payments.appName',
35
+ locale: 'en',
36
+ value: 'Artisan Payments Portal',
37
+ },
38
+ ],
39
+ },
40
+ branding: {
41
+ appName: { en: 'Artisan Payments Portal' },
42
+ assets: [
43
+ { type: 'logo', url: 'https://tenant.artisanos.dev/logo.png' },
44
+ { type: 'logo-dark', url: 'https://tenant.artisanos.dev/logo-dark.png' },
45
+ ],
46
+ colors: {
47
+ primary: '#F97316',
48
+ secondary: '#1F2937',
49
+ },
50
+ customDomain: 'pay.artisanos.dev',
51
+ },
52
+ notes: 'Stripe connection bound for production payments.',
53
+ };
@@ -0,0 +1,53 @@
1
+ import type { WorkflowSpec } from '@contractspec/lib.contracts/workflow/spec';
2
+ import {
3
+ OwnersEnum,
4
+ StabilityEnum,
5
+ TagsEnum,
6
+ } from '@contractspec/lib.contracts/ownership';
7
+
8
+ export const collectPaymentWorkflow: WorkflowSpec = {
9
+ meta: {
10
+ key: 'artisan.payments.collectPayment',
11
+ version: 1,
12
+ title: 'Collect Card Payment',
13
+ description:
14
+ 'Charge a customer using the tenant Stripe connection and record settlement details.',
15
+ domain: 'payments',
16
+ owners: [OwnersEnum.PlatformCore],
17
+ tags: [TagsEnum.Marketplace, 'stripe'],
18
+ stability: StabilityEnum.Experimental,
19
+ },
20
+ definition: {
21
+ entryStepId: 'prepare',
22
+ steps: [
23
+ {
24
+ id: 'prepare',
25
+ type: 'automation',
26
+ label: 'Prepare charge parameters',
27
+ action: {
28
+ operation: { key: 'payments.prepareCharge', version: 1 },
29
+ },
30
+ },
31
+ {
32
+ id: 'charge',
33
+ type: 'automation',
34
+ label: 'Charge card via Stripe',
35
+ action: {
36
+ operation: { key: 'payments.stripe.chargeCard', version: 1 },
37
+ },
38
+ },
39
+ {
40
+ id: 'confirm',
41
+ type: 'automation',
42
+ label: 'Confirm settlement',
43
+ action: {
44
+ operation: { key: 'payments.recordSettlement', version: 1 },
45
+ },
46
+ },
47
+ ],
48
+ transitions: [
49
+ { from: 'prepare', to: 'charge' },
50
+ { from: 'charge', to: 'confirm', condition: 'output.success === true' },
51
+ ],
52
+ },
53
+ };
@@ -0,0 +1,21 @@
1
+ {
2
+ "meta": {
3
+ "name": "artisan.payments.catalog",
4
+ "version": 1
5
+ },
6
+ "defaultLocale": "en",
7
+ "supportedLocales": ["en", "fr"],
8
+ "entries": [
9
+ {
10
+ "key": "artisan.payments.appName",
11
+ "locale": "en",
12
+ "value": "Artisan Payments Portal"
13
+ },
14
+ {
15
+ "key": "artisan.payments.appName",
16
+ "locale": "fr",
17
+ "value": "Portail de paiement Artisan"
18
+ }
19
+ ]
20
+ }
21
+
package/tsconfig.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "@contractspec/tool.typescript/react-library.json",
3
+ "include": ["src"],
4
+ "exclude": ["node_modules", "dist"],
5
+ "compilerOptions": {
6
+ "rootDir": "src",
7
+ "outDir": "dist"
8
+ }
9
+ }
10
+
11
+
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from 'tsdown';
2
+ import { moduleLibrary } from '@contractspec/tool.tsdown';
3
+
4
+ export default defineConfig(() => ({
5
+ ...moduleLibrary,
6
+ }));