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