@contractspec/example.integration-stripe 1.57.0 → 1.58.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 (53) hide show
  1. package/.turbo/turbo-build.log +40 -42
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +13 -0
  4. package/dist/blueprint.d.ts +2 -6
  5. package/dist/blueprint.d.ts.map +1 -1
  6. package/dist/blueprint.js +61 -65
  7. package/dist/browser/blueprint.js +61 -0
  8. package/dist/browser/connection.sample.js +23 -0
  9. package/dist/browser/docs/index.js +39 -0
  10. package/dist/browser/docs/integration-stripe.docblock.js +39 -0
  11. package/dist/browser/example.js +33 -0
  12. package/dist/browser/index.js +261 -0
  13. package/dist/browser/tenant.js +55 -0
  14. package/dist/browser/workflow.js +54 -0
  15. package/dist/connection.sample.d.ts +2 -6
  16. package/dist/connection.sample.d.ts.map +1 -1
  17. package/dist/connection.sample.js +23 -21
  18. package/dist/docs/index.d.ts +2 -1
  19. package/dist/docs/index.d.ts.map +1 -0
  20. package/dist/docs/index.js +40 -1
  21. package/dist/docs/integration-stripe.docblock.d.ts +2 -1
  22. package/dist/docs/integration-stripe.docblock.d.ts.map +1 -0
  23. package/dist/docs/integration-stripe.docblock.js +37 -27
  24. package/dist/example.d.ts +2 -6
  25. package/dist/example.d.ts.map +1 -1
  26. package/dist/example.js +32 -44
  27. package/dist/index.d.ts +7 -6
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +262 -8
  30. package/dist/node/blueprint.js +61 -0
  31. package/dist/node/connection.sample.js +23 -0
  32. package/dist/node/docs/index.js +39 -0
  33. package/dist/node/docs/integration-stripe.docblock.js +39 -0
  34. package/dist/node/example.js +33 -0
  35. package/dist/node/index.js +261 -0
  36. package/dist/node/tenant.js +55 -0
  37. package/dist/node/workflow.js +54 -0
  38. package/dist/tenant.d.ts +2 -6
  39. package/dist/tenant.d.ts.map +1 -1
  40. package/dist/tenant.js +55 -52
  41. package/dist/workflow.d.ts +2 -6
  42. package/dist/workflow.d.ts.map +1 -1
  43. package/dist/workflow.js +54 -58
  44. package/package.json +85 -30
  45. package/tsdown.config.js +1 -2
  46. package/.turbo/turbo-build$colon$bundle.log +0 -42
  47. package/dist/blueprint.js.map +0 -1
  48. package/dist/connection.sample.js.map +0 -1
  49. package/dist/docs/integration-stripe.docblock.js.map +0 -1
  50. package/dist/example.js.map +0 -1
  51. package/dist/tenant.js.map +0 -1
  52. package/dist/workflow.js.map +0 -1
  53. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,QAAQ,CAAC"}
package/dist/index.js CHANGED
@@ -1,8 +1,262 @@
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
- import "./docs/index.js";
7
-
8
- export { artisanStripeBlueprint, artisanStripeTenantConfig, collectPaymentWorkflow, example, stripeLiveConnection };
1
+ // @bun
2
+ // src/blueprint.ts
3
+ import {
4
+ OwnersEnum,
5
+ StabilityEnum,
6
+ TagsEnum
7
+ } from "@contractspec/lib.contracts/ownership";
8
+ var artisanStripeBlueprint = {
9
+ meta: {
10
+ key: "artisan.payments.stripe",
11
+ version: "1.0.0",
12
+ appId: "artisan",
13
+ title: "ArtisanOS Stripe Payments",
14
+ description: "Blueprint enabling card payments for ArtisanOS merchants via the Stripe integration.",
15
+ domain: "payments",
16
+ owners: [OwnersEnum.PlatformCore],
17
+ tags: [TagsEnum.Marketplace, "stripe", "payments"],
18
+ stability: StabilityEnum.Experimental
19
+ },
20
+ capabilities: {
21
+ enabled: [{ key: "payments.psp", version: "1.0.0" }]
22
+ },
23
+ integrationSlots: [
24
+ {
25
+ slotId: "primary-payments",
26
+ requiredCategory: "payments",
27
+ allowedModes: ["managed", "byok"],
28
+ requiredCapabilities: [{ key: "payments.psp", version: "1.0.0" }],
29
+ required: true,
30
+ description: "Primary card processor slot. Bind the tenant Stripe connection here."
31
+ }
32
+ ],
33
+ branding: {
34
+ appNameKey: "artisan.payments.appName",
35
+ assets: [
36
+ { type: "logo", url: "https://cdn.artisanos.dev/branding/logo.png" },
37
+ {
38
+ type: "favicon",
39
+ url: "https://cdn.artisanos.dev/branding/favicon.ico"
40
+ }
41
+ ],
42
+ colorTokens: {
43
+ primary: "colors.brand.primary",
44
+ secondary: "colors.brand.secondary"
45
+ }
46
+ },
47
+ translationCatalog: {
48
+ key: "artisan.payments.catalog",
49
+ version: "1.0.0"
50
+ },
51
+ workflows: {
52
+ collectPayment: {
53
+ key: "artisan.payments.collectPayment",
54
+ version: "1.0.0"
55
+ }
56
+ },
57
+ policies: [{ key: "artisan.payments.default", version: "1.0.0" }],
58
+ notes: "Install this blueprint and pair it with the Stripe integration connection to enable card collection."
59
+ };
60
+
61
+ // src/connection.sample.ts
62
+ var stripeLiveConnection = {
63
+ meta: {
64
+ id: "conn-stripe-live",
65
+ tenantId: "artisan-co",
66
+ integrationKey: "payments.stripe",
67
+ integrationVersion: "1",
68
+ label: "Stripe Production",
69
+ environment: "production",
70
+ createdAt: "2026-01-01T00:00:00.000Z",
71
+ updatedAt: "2026-01-01T00:00:00.000Z"
72
+ },
73
+ ownershipMode: "managed",
74
+ config: {
75
+ accountId: "acct_xxx"
76
+ },
77
+ secretProvider: "vault",
78
+ secretRef: "vault://integrations/artisan-co/conn-stripe-live",
79
+ status: "connected"
80
+ };
81
+
82
+ // src/docs/integration-stripe.docblock.ts
83
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
84
+ var blocks = [
85
+ {
86
+ id: "docs.examples.integration-stripe",
87
+ title: "Integration Example \u2014 Stripe Payments",
88
+ summary: "How to wire IntegrationSpec/TenantAppConfig + blueprint + workflow to enable Stripe-backed payments.",
89
+ kind: "reference",
90
+ visibility: "public",
91
+ route: "/docs/examples/integration-stripe",
92
+ tags: ["stripe", "payments", "integrations", "example"],
93
+ body: `## Included
94
+ - App blueprint enabling \`payments.psp\` capability.
95
+ - Workflow invoking Stripe operations (prepare \u2192 charge \u2192 confirm).
96
+ - Tenant app config binding workflow to an IntegrationConnection.
97
+
98
+ ## Notes
99
+ - Secrets live in secret providers; connection config is non-secret.
100
+ - Use \`ctx.resolvedAppConfig\` in operation executors to access integrations, branding, and translations.`
101
+ },
102
+ {
103
+ id: "docs.examples.integration-stripe.usage",
104
+ title: "Stripe Integration Example \u2014 Usage",
105
+ summary: "How to use the blueprint, workflow, and tenant config together.",
106
+ kind: "usage",
107
+ visibility: "public",
108
+ route: "/docs/examples/integration-stripe/usage",
109
+ tags: ["stripe", "usage"],
110
+ body: `## Usage
111
+ 1) Register the blueprint + workflow + catalog in your registry.
112
+ 2) Persist an IntegrationConnection (see connection sample).
113
+ 3) Bind the tenant app config to the connection.
114
+
115
+ ## Guardrails
116
+ - Never log secrets.
117
+ - Keep payment semantics spec-defined; gate breaking changes behind flags.`
118
+ }
119
+ ];
120
+ registerDocBlocks(blocks);
121
+ // src/example.ts
122
+ import { defineExample } from "@contractspec/lib.contracts";
123
+ var example = defineExample({
124
+ meta: {
125
+ key: "integration-stripe",
126
+ version: "1.0.0",
127
+ title: "Integration \u2014 Stripe Payments",
128
+ description: "Wire AppBlueprint + Workflow + TenantAppConfig to enable Stripe-backed payments (spec-first integration pattern).",
129
+ kind: "integration",
130
+ visibility: "public",
131
+ stability: "experimental",
132
+ owners: ["@platform.core"],
133
+ tags: ["stripe", "payments", "integration", "blueprint", "workflow"]
134
+ },
135
+ docs: {
136
+ rootDocId: "docs.examples.integration-stripe",
137
+ usageDocId: "docs.examples.integration-stripe.usage"
138
+ },
139
+ entrypoints: {
140
+ packageName: "@contractspec/example.integration-stripe",
141
+ docs: "./docs"
142
+ },
143
+ surfaces: {
144
+ templates: true,
145
+ sandbox: { enabled: true, modes: ["markdown", "specs"] },
146
+ studio: { enabled: true, installable: true },
147
+ mcp: { enabled: true }
148
+ }
149
+ });
150
+ var example_default = example;
151
+
152
+ // src/workflow.ts
153
+ import {
154
+ OwnersEnum as OwnersEnum2,
155
+ StabilityEnum as StabilityEnum2,
156
+ TagsEnum as TagsEnum2
157
+ } from "@contractspec/lib.contracts/ownership";
158
+ var collectPaymentWorkflow = {
159
+ meta: {
160
+ key: "artisan.payments.collectPayment",
161
+ version: "1.0.0",
162
+ title: "Collect Card Payment",
163
+ description: "Charge a customer using the tenant Stripe connection and record settlement details.",
164
+ domain: "payments",
165
+ owners: [OwnersEnum2.PlatformCore],
166
+ tags: [TagsEnum2.Marketplace, "stripe"],
167
+ stability: StabilityEnum2.Experimental
168
+ },
169
+ definition: {
170
+ entryStepId: "prepare",
171
+ steps: [
172
+ {
173
+ id: "prepare",
174
+ type: "automation",
175
+ label: "Prepare charge parameters",
176
+ action: {
177
+ operation: { key: "payments.prepareCharge", version: "1.0.0" }
178
+ }
179
+ },
180
+ {
181
+ id: "charge",
182
+ type: "automation",
183
+ label: "Charge card via Stripe",
184
+ action: {
185
+ operation: { key: "payments.stripe.chargeCard", version: "1.0.0" }
186
+ }
187
+ },
188
+ {
189
+ id: "confirm",
190
+ type: "automation",
191
+ label: "Confirm settlement",
192
+ action: {
193
+ operation: { key: "payments.recordSettlement", version: "1.0.0" }
194
+ }
195
+ }
196
+ ],
197
+ transitions: [
198
+ { from: "prepare", to: "charge" },
199
+ { from: "charge", to: "confirm", condition: "output.success === true" }
200
+ ]
201
+ }
202
+ };
203
+
204
+ // src/tenant.ts
205
+ var artisanStripeTenantConfig = {
206
+ meta: {
207
+ id: "tenant-config-artisan-stripe",
208
+ tenantId: "artisan-co",
209
+ appId: "artisan",
210
+ blueprintName: "artisan.payments.stripe",
211
+ blueprintVersion: "1.0.0",
212
+ environment: "production",
213
+ version: "1.0.0",
214
+ status: "published",
215
+ createdAt: new Date().toISOString(),
216
+ updatedAt: new Date().toISOString()
217
+ },
218
+ integrations: [
219
+ {
220
+ slotId: "primary-payments",
221
+ connectionId: "conn-stripe-live",
222
+ scope: {
223
+ workflows: ["collectPayment"],
224
+ operations: ["payments.stripe.chargeCard"]
225
+ }
226
+ }
227
+ ],
228
+ knowledge: [],
229
+ locales: {
230
+ defaultLocale: "en",
231
+ enabledLocales: ["en", "fr"]
232
+ },
233
+ translationOverrides: {
234
+ entries: [
235
+ {
236
+ key: "artisan.payments.appName",
237
+ locale: "en",
238
+ value: "Artisan Payments Portal"
239
+ }
240
+ ]
241
+ },
242
+ branding: {
243
+ appName: { en: "Artisan Payments Portal" },
244
+ assets: [
245
+ { type: "logo", url: "https://tenant.artisanos.dev/logo.png" },
246
+ { type: "logo-dark", url: "https://tenant.artisanos.dev/logo-dark.png" }
247
+ ],
248
+ colors: {
249
+ primary: "#F97316",
250
+ secondary: "#1F2937"
251
+ },
252
+ customDomain: "pay.artisanos.dev"
253
+ },
254
+ notes: "Stripe connection bound for production payments."
255
+ };
256
+ export {
257
+ stripeLiveConnection,
258
+ example_default as example,
259
+ collectPaymentWorkflow,
260
+ artisanStripeTenantConfig,
261
+ artisanStripeBlueprint
262
+ };
@@ -0,0 +1,61 @@
1
+ // src/blueprint.ts
2
+ import {
3
+ OwnersEnum,
4
+ StabilityEnum,
5
+ TagsEnum
6
+ } from "@contractspec/lib.contracts/ownership";
7
+ var artisanStripeBlueprint = {
8
+ meta: {
9
+ key: "artisan.payments.stripe",
10
+ version: "1.0.0",
11
+ appId: "artisan",
12
+ title: "ArtisanOS Stripe Payments",
13
+ description: "Blueprint enabling card payments for ArtisanOS merchants via the Stripe integration.",
14
+ domain: "payments",
15
+ owners: [OwnersEnum.PlatformCore],
16
+ tags: [TagsEnum.Marketplace, "stripe", "payments"],
17
+ stability: StabilityEnum.Experimental
18
+ },
19
+ capabilities: {
20
+ enabled: [{ key: "payments.psp", version: "1.0.0" }]
21
+ },
22
+ integrationSlots: [
23
+ {
24
+ slotId: "primary-payments",
25
+ requiredCategory: "payments",
26
+ allowedModes: ["managed", "byok"],
27
+ requiredCapabilities: [{ key: "payments.psp", version: "1.0.0" }],
28
+ required: true,
29
+ description: "Primary card processor slot. Bind the tenant Stripe connection here."
30
+ }
31
+ ],
32
+ branding: {
33
+ appNameKey: "artisan.payments.appName",
34
+ assets: [
35
+ { type: "logo", url: "https://cdn.artisanos.dev/branding/logo.png" },
36
+ {
37
+ type: "favicon",
38
+ url: "https://cdn.artisanos.dev/branding/favicon.ico"
39
+ }
40
+ ],
41
+ colorTokens: {
42
+ primary: "colors.brand.primary",
43
+ secondary: "colors.brand.secondary"
44
+ }
45
+ },
46
+ translationCatalog: {
47
+ key: "artisan.payments.catalog",
48
+ version: "1.0.0"
49
+ },
50
+ workflows: {
51
+ collectPayment: {
52
+ key: "artisan.payments.collectPayment",
53
+ version: "1.0.0"
54
+ }
55
+ },
56
+ policies: [{ key: "artisan.payments.default", version: "1.0.0" }],
57
+ notes: "Install this blueprint and pair it with the Stripe integration connection to enable card collection."
58
+ };
59
+ export {
60
+ artisanStripeBlueprint
61
+ };
@@ -0,0 +1,23 @@
1
+ // src/connection.sample.ts
2
+ var 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: {
15
+ accountId: "acct_xxx"
16
+ },
17
+ secretProvider: "vault",
18
+ secretRef: "vault://integrations/artisan-co/conn-stripe-live",
19
+ status: "connected"
20
+ };
21
+ export {
22
+ stripeLiveConnection
23
+ };
@@ -0,0 +1,39 @@
1
+ // src/docs/integration-stripe.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var blocks = [
4
+ {
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: ["stripe", "payments", "integrations", "example"],
12
+ body: `## Included
13
+ - App blueprint enabling \`payments.psp\` capability.
14
+ - Workflow invoking Stripe operations (prepare → charge → confirm).
15
+ - Tenant app config binding workflow to an IntegrationConnection.
16
+
17
+ ## Notes
18
+ - Secrets live in secret providers; connection config is non-secret.
19
+ - Use \`ctx.resolvedAppConfig\` in operation executors to access integrations, branding, and translations.`
20
+ },
21
+ {
22
+ id: "docs.examples.integration-stripe.usage",
23
+ title: "Stripe Integration Example — Usage",
24
+ summary: "How to use the blueprint, workflow, and tenant config together.",
25
+ kind: "usage",
26
+ visibility: "public",
27
+ route: "/docs/examples/integration-stripe/usage",
28
+ tags: ["stripe", "usage"],
29
+ body: `## Usage
30
+ 1) Register the blueprint + workflow + catalog in your registry.
31
+ 2) Persist an IntegrationConnection (see connection sample).
32
+ 3) Bind the tenant app config to the connection.
33
+
34
+ ## Guardrails
35
+ - Never log secrets.
36
+ - Keep payment semantics spec-defined; gate breaking changes behind flags.`
37
+ }
38
+ ];
39
+ registerDocBlocks(blocks);
@@ -0,0 +1,39 @@
1
+ // src/docs/integration-stripe.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var blocks = [
4
+ {
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: ["stripe", "payments", "integrations", "example"],
12
+ body: `## Included
13
+ - App blueprint enabling \`payments.psp\` capability.
14
+ - Workflow invoking Stripe operations (prepare → charge → confirm).
15
+ - Tenant app config binding workflow to an IntegrationConnection.
16
+
17
+ ## Notes
18
+ - Secrets live in secret providers; connection config is non-secret.
19
+ - Use \`ctx.resolvedAppConfig\` in operation executors to access integrations, branding, and translations.`
20
+ },
21
+ {
22
+ id: "docs.examples.integration-stripe.usage",
23
+ title: "Stripe Integration Example — Usage",
24
+ summary: "How to use the blueprint, workflow, and tenant config together.",
25
+ kind: "usage",
26
+ visibility: "public",
27
+ route: "/docs/examples/integration-stripe/usage",
28
+ tags: ["stripe", "usage"],
29
+ body: `## Usage
30
+ 1) Register the blueprint + workflow + catalog in your registry.
31
+ 2) Persist an IntegrationConnection (see connection sample).
32
+ 3) Bind the tenant app config to the connection.
33
+
34
+ ## Guardrails
35
+ - Never log secrets.
36
+ - Keep payment semantics spec-defined; gate breaking changes behind flags.`
37
+ }
38
+ ];
39
+ registerDocBlocks(blocks);
@@ -0,0 +1,33 @@
1
+ // src/example.ts
2
+ import { defineExample } from "@contractspec/lib.contracts";
3
+ var example = defineExample({
4
+ meta: {
5
+ key: "integration-stripe",
6
+ version: "1.0.0",
7
+ title: "Integration — Stripe Payments",
8
+ description: "Wire AppBlueprint + Workflow + TenantAppConfig to enable Stripe-backed payments (spec-first integration pattern).",
9
+ kind: "integration",
10
+ visibility: "public",
11
+ stability: "experimental",
12
+ owners: ["@platform.core"],
13
+ tags: ["stripe", "payments", "integration", "blueprint", "workflow"]
14
+ },
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: { enabled: true, modes: ["markdown", "specs"] },
26
+ studio: { enabled: true, installable: true },
27
+ mcp: { enabled: true }
28
+ }
29
+ });
30
+ var example_default = example;
31
+ export {
32
+ example_default as default
33
+ };