@contractspec/example.integration-stripe 3.7.16 → 3.7.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,372 +1,16 @@
1
1
  // @bun
2
- // src/workflow.ts
3
- import {
4
- OwnersEnum,
5
- StabilityEnum,
6
- TagsEnum
7
- } from "@contractspec/lib.contracts-spec/ownership";
8
- import { defineWorkflow } from "@contractspec/lib.contracts-spec/workflow";
9
- var collectPaymentWorkflow = defineWorkflow({
10
- meta: {
11
- key: "integration-stripe.workflow.payment",
12
- version: "1.0.0",
13
- title: "Collect Card Payment",
14
- description: "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.0.0" }
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.0.0" }
37
- }
38
- },
39
- {
40
- id: "confirm",
41
- type: "automation",
42
- label: "Confirm settlement",
43
- action: {
44
- operation: { key: "payments.recordSettlement", version: "1.0.0" }
45
- }
46
- }
47
- ],
48
- transitions: [
49
- { from: "prepare", to: "charge" },
50
- { from: "charge", to: "confirm", condition: "output.success === true" }
51
- ]
52
- }
53
- });
54
-
55
- // src/blueprint.ts
56
- import { defineAppConfig } from "@contractspec/lib.contracts-spec/app-config/spec";
57
- import {
58
- OwnersEnum as OwnersEnum2,
59
- StabilityEnum as StabilityEnum2,
60
- TagsEnum as TagsEnum2
61
- } from "@contractspec/lib.contracts-spec/ownership";
62
- var artisanStripeBlueprint = defineAppConfig({
63
- meta: {
64
- key: "artisan.payments.stripe",
65
- version: "1.0.0",
66
- appId: "artisan",
67
- title: "ArtisanOS Stripe Payments",
68
- description: "Blueprint enabling card payments for ArtisanOS merchants via the Stripe integration.",
69
- domain: "payments",
70
- owners: [OwnersEnum2.PlatformCore],
71
- tags: [TagsEnum2.Marketplace, "stripe", "payments"],
72
- stability: StabilityEnum2.Experimental
73
- },
74
- capabilities: {
75
- enabled: [{ key: "payments.psp", version: "1.0.0" }]
76
- },
77
- integrationSlots: [
78
- {
79
- slotId: "primary-payments",
80
- requiredCategory: "payments",
81
- allowedModes: ["managed", "byok"],
82
- requiredCapabilities: [{ key: "payments.psp", version: "1.0.0" }],
83
- required: true,
84
- description: "Primary card processor slot. Bind the tenant Stripe connection here."
85
- }
86
- ],
87
- branding: {
88
- appNameKey: "artisan.payments.appName",
89
- assets: [
90
- { type: "logo", url: "https://cdn.artisanos.dev/branding/logo.png" },
91
- {
92
- type: "favicon",
93
- url: "https://cdn.artisanos.dev/branding/favicon.ico"
94
- }
95
- ],
96
- colorTokens: {
97
- primary: "colors.brand.primary",
98
- secondary: "colors.brand.secondary"
99
- }
100
- },
101
- translationCatalog: {
102
- key: "artisan.payments.catalog",
103
- version: "1.0.0"
104
- },
105
- workflows: {
106
- collectPayment: {
107
- key: collectPaymentWorkflow.meta.key,
108
- version: collectPaymentWorkflow.meta.version
109
- }
110
- },
111
- notes: "Install this blueprint and pair it with the Stripe integration connection to enable card collection."
112
- });
113
-
114
- // src/integration.ts
115
- import { defineIntegration } from "@contractspec/lib.contracts-integrations";
116
- import {
117
- OwnersEnum as OwnersEnum3,
118
- StabilityEnum as StabilityEnum3,
119
- TagsEnum as TagsEnum3
120
- } from "@contractspec/lib.contracts-spec/ownership";
121
- import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
122
- var StripeConfigModel = defineSchemaModel({
123
- name: "StripePaymentsIntegrationConfig",
124
- description: "Managed configuration required to connect a Stripe account.",
125
- fields: {
126
- accountId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
127
- webhookEndpoint: {
128
- type: ScalarTypeEnum.String_unsecure(),
129
- isOptional: false
130
- }
131
- }
132
- });
133
- var StripeSecretModel = defineSchemaModel({
134
- name: "StripePaymentsIntegrationSecret",
135
- description: "Secret material stored out-of-band for the Stripe provider.",
136
- fields: {
137
- apiKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
138
- webhookSecret: {
139
- type: ScalarTypeEnum.String_unsecure(),
140
- isOptional: false
141
- }
142
- }
143
- });
144
- var StripePaymentsIntegrationSpec = defineIntegration({
145
- meta: {
146
- key: "integration-stripe.integration.psp",
147
- version: "1.0.0",
148
- title: "Stripe Payments Integration",
149
- description: "Integration contract for managed or BYOK Stripe card processing.",
150
- domain: "payments",
151
- category: "payments",
152
- owners: [OwnersEnum3.PlatformCore],
153
- tags: [TagsEnum3.Marketplace, "stripe", "payments"],
154
- stability: StabilityEnum3.Experimental
155
- },
156
- supportedModes: ["managed", "byok"],
157
- capabilities: {
158
- provides: [{ key: "payments.psp", version: "1.0.0" }]
159
- },
160
- configSchema: {
161
- schema: StripeConfigModel,
162
- example: {
163
- accountId: "acct_demo_artisan",
164
- webhookEndpoint: "https://pay.artisanos.dev/webhooks/stripe"
165
- }
166
- },
167
- secretSchema: {
168
- schema: StripeSecretModel,
169
- example: {
170
- apiKey: "sk_live_redacted",
171
- webhookSecret: "whsec_redacted"
172
- }
173
- },
174
- healthCheck: {
175
- method: "ping",
176
- timeoutMs: 5000
177
- },
178
- docsUrl: "https://docs.stripe.com",
179
- constraints: {
180
- rateLimit: {
181
- rpm: 1000
182
- }
183
- },
184
- byokSetup: {
185
- setupInstructions: "Create a restricted API key and webhook endpoint, then bind the secret reference to the tenant connection.",
186
- requiredScopes: ["charges:write", "customers:read", "webhooks:write"]
187
- }
188
- });
189
-
190
- // src/connection.sample.ts
191
- var stripeLiveConnection = {
192
- meta: {
193
- id: "conn-stripe-live",
194
- tenantId: "artisan-co",
195
- integrationKey: StripePaymentsIntegrationSpec.meta.key,
196
- integrationVersion: StripePaymentsIntegrationSpec.meta.version,
197
- label: "Stripe Production",
198
- environment: "production",
199
- createdAt: "2026-01-01T00:00:00.000Z",
200
- updatedAt: "2026-01-01T00:00:00.000Z"
201
- },
202
- ownershipMode: "managed",
203
- config: {
204
- accountId: "acct_xxx"
205
- },
206
- secretProvider: "vault",
207
- secretRef: "vault://integrations/artisan-co/conn-stripe-live",
208
- status: "connected"
209
- };
210
-
211
- // src/docs/integration-stripe.docblock.ts
212
- import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
213
- var blocks = [
214
- {
215
- id: "docs.examples.integration-stripe",
216
- title: "Integration Example \u2014 Stripe Payments",
217
- summary: "How to wire IntegrationSpec/TenantAppConfig + blueprint + workflow to enable Stripe-backed payments.",
218
- kind: "reference",
219
- visibility: "public",
220
- route: "/docs/examples/integration-stripe",
221
- tags: ["stripe", "payments", "integrations", "example"],
222
- body: `## Included
2
+ import{OwnersEnum as a,StabilityEnum as r,TagsEnum as i}from"@contractspec/lib.contracts-spec/ownership";import{defineWorkflow as p}from"@contractspec/lib.contracts-spec/workflow/spec";var t=p({meta:{key:"integration-stripe.workflow.payment",version:"1.0.0",title:"Collect Card Payment",description:"Charge a customer using the tenant Stripe connection and record settlement details.",domain:"payments",owners:[a.PlatformCore],tags:[i.Marketplace,"stripe"],stability:r.Experimental},definition:{entryStepId:"prepare",steps:[{id:"prepare",type:"automation",label:"Prepare charge parameters",action:{operation:{key:"payments.prepareCharge",version:"1.0.0"}}},{id:"charge",type:"automation",label:"Charge card via Stripe",action:{operation:{key:"payments.stripe.chargeCard",version:"1.0.0"}}},{id:"confirm",type:"automation",label:"Confirm settlement",action:{operation:{key:"payments.recordSettlement",version:"1.0.0"}}}],transitions:[{from:"prepare",to:"charge"},{from:"charge",to:"confirm",condition:"output.success === true"}]}});import{defineAppConfig as s}from"@contractspec/lib.contracts-spec/app-config/spec";import{OwnersEnum as d,StabilityEnum as g,TagsEnum as v}from"@contractspec/lib.contracts-spec/ownership";var h=s({meta:{key:"artisan.payments.stripe",version:"1.0.0",appId:"artisan",title:"ArtisanOS Stripe Payments",description:"Blueprint enabling card payments for ArtisanOS merchants via the Stripe integration.",domain:"payments",owners:[d.PlatformCore],tags:[v.Marketplace,"stripe","payments"],stability:g.Experimental},capabilities:{enabled:[{key:"payments.psp",version:"1.0.0"}]},integrationSlots:[{slotId:"primary-payments",requiredCategory:"payments",allowedModes:["managed","byok"],requiredCapabilities:[{key:"payments.psp",version:"1.0.0"}],required:!0,description:"Primary card processor slot. Bind the tenant Stripe connection here."}],branding:{appNameKey:"artisan.payments.appName",assets:[{type:"logo",url:"https://cdn.artisanos.dev/branding/logo.png"},{type:"favicon",url:"https://cdn.artisanos.dev/branding/favicon.ico"}],colorTokens:{primary:"colors.brand.primary",secondary:"colors.brand.secondary"}},translationCatalog:{key:"artisan.payments.catalog",version:"1.0.0"},workflows:{collectPayment:{key:t.meta.key,version:t.meta.version}},notes:"Install this blueprint and pair it with the Stripe integration connection to enable card collection."});import{defineIntegration as m}from"@contractspec/lib.contracts-integrations";import{OwnersEnum as x,StabilityEnum as I,TagsEnum as u}from"@contractspec/lib.contracts-spec/ownership";import{defineSchemaModel as e,ScalarTypeEnum as o}from"@contractspec/lib.schema";var y=e({name:"StripePaymentsIntegrationConfig",description:"Managed configuration required to connect a Stripe account.",fields:{accountId:{type:o.String_unsecure(),isOptional:!1},webhookEndpoint:{type:o.String_unsecure(),isOptional:!1}}}),A=e({name:"StripePaymentsIntegrationSecret",description:"Secret material stored out-of-band for the Stripe provider.",fields:{apiKey:{type:o.String_unsecure(),isOptional:!1},webhookSecret:{type:o.String_unsecure(),isOptional:!1}}}),n=m({meta:{key:"integration-stripe.integration.psp",version:"1.0.0",title:"Stripe Payments Integration",description:"Integration contract for managed or BYOK Stripe card processing.",domain:"payments",category:"payments",owners:[x.PlatformCore],tags:[u.Marketplace,"stripe","payments"],stability:I.Experimental},supportedModes:["managed","byok"],capabilities:{provides:[{key:"payments.psp",version:"1.0.0"}]},configSchema:{schema:y,example:{accountId:"acct_demo_artisan",webhookEndpoint:"https://pay.artisanos.dev/webhooks/stripe"}},secretSchema:{schema:A,example:{apiKey:"sk_live_redacted",webhookSecret:"whsec_redacted"}},healthCheck:{method:"ping",timeoutMs:5000},docsUrl:"https://docs.stripe.com",constraints:{rateLimit:{rpm:1000}},byokSetup:{setupInstructions:"Create a restricted API key and webhook endpoint, then bind the secret reference to the tenant connection.",requiredScopes:["charges:write","customers:read","webhooks:write"]}});var J={meta:{id:"conn-stripe-live",tenantId:"artisan-co",integrationKey:n.meta.key,integrationVersion:n.meta.version,label:"Stripe Production",environment:"production",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:00:00.000Z"},ownershipMode:"managed",config:{accountId:"acct_xxx"},secretProvider:"vault",secretRef:"vault://integrations/artisan-co/conn-stripe-live",status:"connected"};import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var C=[{id:"docs.examples.integration-stripe",title:"Integration Example \u2014 Stripe Payments",summary:"How to wire IntegrationSpec/TenantAppConfig + blueprint + workflow to enable Stripe-backed payments.",kind:"reference",visibility:"public",route:"/docs/examples/integration-stripe",tags:["stripe","payments","integrations","example"],body:`## Included
223
3
  - App blueprint enabling \`payments.psp\` capability.
224
4
  - Workflow invoking Stripe operations (prepare \u2192 charge \u2192 confirm).
225
5
  - Tenant app config binding workflow to an IntegrationConnection.
226
6
 
227
7
  ## Notes
228
8
  - Secrets live in secret providers; connection config is non-secret.
229
- - Use \`ctx.resolvedAppConfig\` in operation executors to access integrations, branding, and translations.`
230
- },
231
- {
232
- id: "docs.examples.integration-stripe.usage",
233
- title: "Stripe Integration Example \u2014 Usage",
234
- summary: "How to use the blueprint, workflow, and tenant config together.",
235
- kind: "usage",
236
- visibility: "public",
237
- route: "/docs/examples/integration-stripe/usage",
238
- tags: ["stripe", "usage"],
239
- body: `## Usage
9
+ - Use \`ctx.resolvedAppConfig\` in operation executors to access integrations, branding, and translations.`},{id:"docs.examples.integration-stripe.usage",title:"Stripe Integration Example \u2014 Usage",summary:"How to use the blueprint, workflow, and tenant config together.",kind:"usage",visibility:"public",route:"/docs/examples/integration-stripe/usage",tags:["stripe","usage"],body:`## Usage
240
10
  1) Register the blueprint + workflow + catalog in your registry.
241
11
  2) Persist an IntegrationConnection (see connection sample).
242
12
  3) Bind the tenant app config to the connection.
243
13
 
244
14
  ## Guardrails
245
15
  - Never log secrets.
246
- - Keep payment semantics spec-defined; gate breaking changes behind flags.`
247
- }
248
- ];
249
- registerDocBlocks(blocks);
250
- // src/example.ts
251
- import { defineExample } from "@contractspec/lib.contracts-spec";
252
- var example = defineExample({
253
- meta: {
254
- key: "integration-stripe",
255
- version: "1.0.0",
256
- title: "Integration \u2014 Stripe Payments",
257
- description: "Wire AppBlueprint + Workflow + TenantAppConfig to enable Stripe-backed payments (spec-first integration pattern).",
258
- kind: "integration",
259
- visibility: "public",
260
- stability: "experimental",
261
- owners: ["@platform.core"],
262
- tags: ["stripe", "payments", "integration", "blueprint", "workflow"]
263
- },
264
- docs: {
265
- rootDocId: "docs.examples.integration-stripe",
266
- usageDocId: "docs.examples.integration-stripe.usage"
267
- },
268
- entrypoints: {
269
- packageName: "@contractspec/example.integration-stripe",
270
- docs: "./docs"
271
- },
272
- surfaces: {
273
- templates: true,
274
- sandbox: { enabled: true, modes: ["markdown", "specs"] },
275
- studio: { enabled: true, installable: true },
276
- mcp: { enabled: true }
277
- }
278
- });
279
- var example_default = example;
280
-
281
- // src/integration-stripe.feature.ts
282
- import { defineFeature } from "@contractspec/lib.contracts-spec";
283
- var IntegrationStripeFeature = defineFeature({
284
- meta: {
285
- key: "integration-stripe",
286
- version: "1.0.0",
287
- title: "Stripe Payments Integration",
288
- description: "Stripe payments integration with blueprint, workflow, and tenant configuration",
289
- domain: "integration",
290
- owners: ["@integration-team"],
291
- tags: ["integration", "stripe", "payments"],
292
- stability: "experimental"
293
- },
294
- integrations: [
295
- {
296
- key: StripePaymentsIntegrationSpec.meta.key,
297
- version: StripePaymentsIntegrationSpec.meta.version
298
- }
299
- ],
300
- workflows: [
301
- {
302
- key: collectPaymentWorkflow.meta.key,
303
- version: collectPaymentWorkflow.meta.version
304
- }
305
- ],
306
- docs: [
307
- "docs.examples.integration-stripe",
308
- "docs.examples.integration-stripe.usage"
309
- ]
310
- });
311
-
312
- // src/tenant.ts
313
- var artisanStripeTenantConfig = {
314
- meta: {
315
- id: "tenant-config-artisan-stripe",
316
- tenantId: "artisan-co",
317
- appId: "artisan",
318
- blueprintName: "artisan.payments.stripe",
319
- blueprintVersion: "1.0.0",
320
- environment: "production",
321
- version: "1.0.0",
322
- status: "published",
323
- createdAt: new Date().toISOString(),
324
- updatedAt: new Date().toISOString()
325
- },
326
- integrations: [
327
- {
328
- slotId: "primary-payments",
329
- connectionId: "conn-stripe-live",
330
- scope: {
331
- workflows: ["collectPayment"],
332
- operations: ["payments.stripe.chargeCard"]
333
- }
334
- }
335
- ],
336
- knowledge: [],
337
- locales: {
338
- defaultLocale: "en",
339
- enabledLocales: ["en", "fr"]
340
- },
341
- translationOverrides: {
342
- entries: [
343
- {
344
- key: "artisan.payments.appName",
345
- locale: "en",
346
- value: "Artisan Payments Portal"
347
- }
348
- ]
349
- },
350
- branding: {
351
- appName: { en: "Artisan Payments Portal" },
352
- assets: [
353
- { type: "logo", url: "https://tenant.artisanos.dev/logo.png" },
354
- { type: "logo-dark", url: "https://tenant.artisanos.dev/logo-dark.png" }
355
- ],
356
- colors: {
357
- primary: "#F97316",
358
- secondary: "#1F2937"
359
- },
360
- customDomain: "pay.artisanos.dev"
361
- },
362
- notes: "Stripe connection bound for production payments."
363
- };
364
- export {
365
- stripeLiveConnection,
366
- example_default as example,
367
- collectPaymentWorkflow,
368
- artisanStripeTenantConfig,
369
- artisanStripeBlueprint,
370
- StripePaymentsIntegrationSpec,
371
- IntegrationStripeFeature
372
- };
16
+ - Keep payment semantics spec-defined; gate breaking changes behind flags.`}];f(C);import{defineExample as L}from"@contractspec/lib.contracts-spec";var N=L({meta:{key:"integration-stripe",version:"1.0.0",title:"Integration \u2014 Stripe Payments",description:"Wire AppBlueprint + Workflow + TenantAppConfig to enable Stripe-backed payments (spec-first integration pattern).",kind:"integration",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["stripe","payments","integration","blueprint","workflow"]},docs:{rootDocId:"docs.examples.integration-stripe",usageDocId:"docs.examples.integration-stripe.usage"},entrypoints:{packageName:"@contractspec/example.integration-stripe",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown","specs"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),D=N;import{defineFeature as P}from"@contractspec/lib.contracts-spec";var T=P({meta:{key:"integration-stripe",version:"1.0.0",title:"Stripe Payments Integration",description:"Stripe payments integration with blueprint, workflow, and tenant configuration",domain:"integration",owners:["@integration-team"],tags:["integration","stripe","payments"],stability:"experimental"},integrations:[{key:n.meta.key,version:n.meta.version}],workflows:[{key:t.meta.key,version:t.meta.version}],docs:["docs.examples.integration-stripe","docs.examples.integration-stripe.usage"]});var k={meta:{id:"tenant-config-artisan-stripe",tenantId:"artisan-co",appId:"artisan",blueprintName:"artisan.payments.stripe",blueprintVersion:"1.0.0",environment:"production",version:"1.0.0",status:"published",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},integrations:[{slotId:"primary-payments",connectionId:"conn-stripe-live",scope:{workflows:["collectPayment"],operations:["payments.stripe.chargeCard"]}}],knowledge:[],locales:{defaultLocale:"en",enabledLocales:["en","fr"]},translationOverrides:{entries:[{key:"artisan.payments.appName",locale:"en",value:"Artisan Payments Portal"}]},branding:{appName:{en:"Artisan Payments Portal"},assets:[{type:"logo",url:"https://tenant.artisanos.dev/logo.png"},{type:"logo-dark",url:"https://tenant.artisanos.dev/logo-dark.png"}],colors:{primary:"#F97316",secondary:"#1F2937"},customDomain:"pay.artisanos.dev"},notes:"Stripe connection bound for production payments."};export{J as stripeLiveConnection,D as example,t as collectPaymentWorkflow,k as artisanStripeTenantConfig,h as artisanStripeBlueprint,n as StripePaymentsIntegrationSpec,T as IntegrationStripeFeature};
@@ -1,163 +1,2 @@
1
1
  // @bun
2
- // src/workflow.ts
3
- import {
4
- OwnersEnum,
5
- StabilityEnum,
6
- TagsEnum
7
- } from "@contractspec/lib.contracts-spec/ownership";
8
- import { defineWorkflow } from "@contractspec/lib.contracts-spec/workflow";
9
- var collectPaymentWorkflow = defineWorkflow({
10
- meta: {
11
- key: "integration-stripe.workflow.payment",
12
- version: "1.0.0",
13
- title: "Collect Card Payment",
14
- description: "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.0.0" }
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.0.0" }
37
- }
38
- },
39
- {
40
- id: "confirm",
41
- type: "automation",
42
- label: "Confirm settlement",
43
- action: {
44
- operation: { key: "payments.recordSettlement", version: "1.0.0" }
45
- }
46
- }
47
- ],
48
- transitions: [
49
- { from: "prepare", to: "charge" },
50
- { from: "charge", to: "confirm", condition: "output.success === true" }
51
- ]
52
- }
53
- });
54
-
55
- // src/integration.ts
56
- import { defineIntegration } from "@contractspec/lib.contracts-integrations";
57
- import {
58
- OwnersEnum as OwnersEnum2,
59
- StabilityEnum as StabilityEnum2,
60
- TagsEnum as TagsEnum2
61
- } from "@contractspec/lib.contracts-spec/ownership";
62
- import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
63
- var StripeConfigModel = defineSchemaModel({
64
- name: "StripePaymentsIntegrationConfig",
65
- description: "Managed configuration required to connect a Stripe account.",
66
- fields: {
67
- accountId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
68
- webhookEndpoint: {
69
- type: ScalarTypeEnum.String_unsecure(),
70
- isOptional: false
71
- }
72
- }
73
- });
74
- var StripeSecretModel = defineSchemaModel({
75
- name: "StripePaymentsIntegrationSecret",
76
- description: "Secret material stored out-of-band for the Stripe provider.",
77
- fields: {
78
- apiKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
79
- webhookSecret: {
80
- type: ScalarTypeEnum.String_unsecure(),
81
- isOptional: false
82
- }
83
- }
84
- });
85
- var StripePaymentsIntegrationSpec = defineIntegration({
86
- meta: {
87
- key: "integration-stripe.integration.psp",
88
- version: "1.0.0",
89
- title: "Stripe Payments Integration",
90
- description: "Integration contract for managed or BYOK Stripe card processing.",
91
- domain: "payments",
92
- category: "payments",
93
- owners: [OwnersEnum2.PlatformCore],
94
- tags: [TagsEnum2.Marketplace, "stripe", "payments"],
95
- stability: StabilityEnum2.Experimental
96
- },
97
- supportedModes: ["managed", "byok"],
98
- capabilities: {
99
- provides: [{ key: "payments.psp", version: "1.0.0" }]
100
- },
101
- configSchema: {
102
- schema: StripeConfigModel,
103
- example: {
104
- accountId: "acct_demo_artisan",
105
- webhookEndpoint: "https://pay.artisanos.dev/webhooks/stripe"
106
- }
107
- },
108
- secretSchema: {
109
- schema: StripeSecretModel,
110
- example: {
111
- apiKey: "sk_live_redacted",
112
- webhookSecret: "whsec_redacted"
113
- }
114
- },
115
- healthCheck: {
116
- method: "ping",
117
- timeoutMs: 5000
118
- },
119
- docsUrl: "https://docs.stripe.com",
120
- constraints: {
121
- rateLimit: {
122
- rpm: 1000
123
- }
124
- },
125
- byokSetup: {
126
- setupInstructions: "Create a restricted API key and webhook endpoint, then bind the secret reference to the tenant connection.",
127
- requiredScopes: ["charges:write", "customers:read", "webhooks:write"]
128
- }
129
- });
130
-
131
- // src/integration-stripe.feature.ts
132
- import { defineFeature } from "@contractspec/lib.contracts-spec";
133
- var IntegrationStripeFeature = defineFeature({
134
- meta: {
135
- key: "integration-stripe",
136
- version: "1.0.0",
137
- title: "Stripe Payments Integration",
138
- description: "Stripe payments integration with blueprint, workflow, and tenant configuration",
139
- domain: "integration",
140
- owners: ["@integration-team"],
141
- tags: ["integration", "stripe", "payments"],
142
- stability: "experimental"
143
- },
144
- integrations: [
145
- {
146
- key: StripePaymentsIntegrationSpec.meta.key,
147
- version: StripePaymentsIntegrationSpec.meta.version
148
- }
149
- ],
150
- workflows: [
151
- {
152
- key: collectPaymentWorkflow.meta.key,
153
- version: collectPaymentWorkflow.meta.version
154
- }
155
- ],
156
- docs: [
157
- "docs.examples.integration-stripe",
158
- "docs.examples.integration-stripe.usage"
159
- ]
160
- });
161
- export {
162
- IntegrationStripeFeature
163
- };
2
+ import{OwnersEnum as z,StabilityEnum as A,TagsEnum as B}from"@contractspec/lib.contracts-spec/ownership";import{defineWorkflow as D}from"@contractspec/lib.contracts-spec/workflow/spec";var q=D({meta:{key:"integration-stripe.workflow.payment",version:"1.0.0",title:"Collect Card Payment",description:"Charge a customer using the tenant Stripe connection and record settlement details.",domain:"payments",owners:[z.PlatformCore],tags:[B.Marketplace,"stripe"],stability:A.Experimental},definition:{entryStepId:"prepare",steps:[{id:"prepare",type:"automation",label:"Prepare charge parameters",action:{operation:{key:"payments.prepareCharge",version:"1.0.0"}}},{id:"charge",type:"automation",label:"Charge card via Stripe",action:{operation:{key:"payments.stripe.chargeCard",version:"1.0.0"}}},{id:"confirm",type:"automation",label:"Confirm settlement",action:{operation:{key:"payments.recordSettlement",version:"1.0.0"}}}],transitions:[{from:"prepare",to:"charge"},{from:"charge",to:"confirm",condition:"output.success === true"}]}});import{defineIntegration as G}from"@contractspec/lib.contracts-integrations";import{OwnersEnum as H,StabilityEnum as J,TagsEnum as K}from"@contractspec/lib.contracts-spec/ownership";import{defineSchemaModel as x,ScalarTypeEnum as j}from"@contractspec/lib.schema";var L=x({name:"StripePaymentsIntegrationConfig",description:"Managed configuration required to connect a Stripe account.",fields:{accountId:{type:j.String_unsecure(),isOptional:!1},webhookEndpoint:{type:j.String_unsecure(),isOptional:!1}}}),N=x({name:"StripePaymentsIntegrationSecret",description:"Secret material stored out-of-band for the Stripe provider.",fields:{apiKey:{type:j.String_unsecure(),isOptional:!1},webhookSecret:{type:j.String_unsecure(),isOptional:!1}}}),v=G({meta:{key:"integration-stripe.integration.psp",version:"1.0.0",title:"Stripe Payments Integration",description:"Integration contract for managed or BYOK Stripe card processing.",domain:"payments",category:"payments",owners:[H.PlatformCore],tags:[K.Marketplace,"stripe","payments"],stability:J.Experimental},supportedModes:["managed","byok"],capabilities:{provides:[{key:"payments.psp",version:"1.0.0"}]},configSchema:{schema:L,example:{accountId:"acct_demo_artisan",webhookEndpoint:"https://pay.artisanos.dev/webhooks/stripe"}},secretSchema:{schema:N,example:{apiKey:"sk_live_redacted",webhookSecret:"whsec_redacted"}},healthCheck:{method:"ping",timeoutMs:5000},docsUrl:"https://docs.stripe.com",constraints:{rateLimit:{rpm:1000}},byokSetup:{setupInstructions:"Create a restricted API key and webhook endpoint, then bind the secret reference to the tenant connection.",requiredScopes:["charges:write","customers:read","webhooks:write"]}});import{defineFeature as Q}from"@contractspec/lib.contracts-spec";var O=Q({meta:{key:"integration-stripe",version:"1.0.0",title:"Stripe Payments Integration",description:"Stripe payments integration with blueprint, workflow, and tenant configuration",domain:"integration",owners:["@integration-team"],tags:["integration","stripe","payments"],stability:"experimental"},integrations:[{key:v.meta.key,version:v.meta.version}],workflows:[{key:q.meta.key,version:q.meta.version}],docs:["docs.examples.integration-stripe","docs.examples.integration-stripe.usage"]});export{O as IntegrationStripeFeature};
@@ -1,79 +1,2 @@
1
1
  // @bun
2
- // src/integration.ts
3
- import { defineIntegration } from "@contractspec/lib.contracts-integrations";
4
- import {
5
- OwnersEnum,
6
- StabilityEnum,
7
- TagsEnum
8
- } from "@contractspec/lib.contracts-spec/ownership";
9
- import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
10
- var StripeConfigModel = defineSchemaModel({
11
- name: "StripePaymentsIntegrationConfig",
12
- description: "Managed configuration required to connect a Stripe account.",
13
- fields: {
14
- accountId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
15
- webhookEndpoint: {
16
- type: ScalarTypeEnum.String_unsecure(),
17
- isOptional: false
18
- }
19
- }
20
- });
21
- var StripeSecretModel = defineSchemaModel({
22
- name: "StripePaymentsIntegrationSecret",
23
- description: "Secret material stored out-of-band for the Stripe provider.",
24
- fields: {
25
- apiKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
26
- webhookSecret: {
27
- type: ScalarTypeEnum.String_unsecure(),
28
- isOptional: false
29
- }
30
- }
31
- });
32
- var StripePaymentsIntegrationSpec = defineIntegration({
33
- meta: {
34
- key: "integration-stripe.integration.psp",
35
- version: "1.0.0",
36
- title: "Stripe Payments Integration",
37
- description: "Integration contract for managed or BYOK Stripe card processing.",
38
- domain: "payments",
39
- category: "payments",
40
- owners: [OwnersEnum.PlatformCore],
41
- tags: [TagsEnum.Marketplace, "stripe", "payments"],
42
- stability: StabilityEnum.Experimental
43
- },
44
- supportedModes: ["managed", "byok"],
45
- capabilities: {
46
- provides: [{ key: "payments.psp", version: "1.0.0" }]
47
- },
48
- configSchema: {
49
- schema: StripeConfigModel,
50
- example: {
51
- accountId: "acct_demo_artisan",
52
- webhookEndpoint: "https://pay.artisanos.dev/webhooks/stripe"
53
- }
54
- },
55
- secretSchema: {
56
- schema: StripeSecretModel,
57
- example: {
58
- apiKey: "sk_live_redacted",
59
- webhookSecret: "whsec_redacted"
60
- }
61
- },
62
- healthCheck: {
63
- method: "ping",
64
- timeoutMs: 5000
65
- },
66
- docsUrl: "https://docs.stripe.com",
67
- constraints: {
68
- rateLimit: {
69
- rpm: 1000
70
- }
71
- },
72
- byokSetup: {
73
- setupInstructions: "Create a restricted API key and webhook endpoint, then bind the secret reference to the tenant connection.",
74
- requiredScopes: ["charges:write", "customers:read", "webhooks:write"]
75
- }
76
- });
77
- export {
78
- StripePaymentsIntegrationSpec
79
- };
2
+ import{defineIntegration as q}from"@contractspec/lib.contracts-integrations";import{OwnersEnum as v,StabilityEnum as x,TagsEnum as z}from"@contractspec/lib.contracts-spec/ownership";import{defineSchemaModel as k,ScalarTypeEnum as j}from"@contractspec/lib.schema";var A=k({name:"StripePaymentsIntegrationConfig",description:"Managed configuration required to connect a Stripe account.",fields:{accountId:{type:j.String_unsecure(),isOptional:!1},webhookEndpoint:{type:j.String_unsecure(),isOptional:!1}}}),B=k({name:"StripePaymentsIntegrationSecret",description:"Secret material stored out-of-band for the Stripe provider.",fields:{apiKey:{type:j.String_unsecure(),isOptional:!1},webhookSecret:{type:j.String_unsecure(),isOptional:!1}}}),H=q({meta:{key:"integration-stripe.integration.psp",version:"1.0.0",title:"Stripe Payments Integration",description:"Integration contract for managed or BYOK Stripe card processing.",domain:"payments",category:"payments",owners:[v.PlatformCore],tags:[z.Marketplace,"stripe","payments"],stability:x.Experimental},supportedModes:["managed","byok"],capabilities:{provides:[{key:"payments.psp",version:"1.0.0"}]},configSchema:{schema:A,example:{accountId:"acct_demo_artisan",webhookEndpoint:"https://pay.artisanos.dev/webhooks/stripe"}},secretSchema:{schema:B,example:{apiKey:"sk_live_redacted",webhookSecret:"whsec_redacted"}},healthCheck:{method:"ping",timeoutMs:5000},docsUrl:"https://docs.stripe.com",constraints:{rateLimit:{rpm:1000}},byokSetup:{setupInstructions:"Create a restricted API key and webhook endpoint, then bind the secret reference to the tenant connection.",requiredScopes:["charges:write","customers:read","webhooks:write"]}});export{H as StripePaymentsIntegrationSpec};