@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.
@@ -1,55 +1 @@
1
- // src/tenant.ts
2
- var artisanStripeTenantConfig = {
3
- meta: {
4
- id: "tenant-config-artisan-stripe",
5
- tenantId: "artisan-co",
6
- appId: "artisan",
7
- blueprintName: "artisan.payments.stripe",
8
- blueprintVersion: "1.0.0",
9
- environment: "production",
10
- version: "1.0.0",
11
- status: "published",
12
- createdAt: new Date().toISOString(),
13
- updatedAt: new Date().toISOString()
14
- },
15
- integrations: [
16
- {
17
- slotId: "primary-payments",
18
- connectionId: "conn-stripe-live",
19
- scope: {
20
- workflows: ["collectPayment"],
21
- operations: ["payments.stripe.chargeCard"]
22
- }
23
- }
24
- ],
25
- knowledge: [],
26
- locales: {
27
- defaultLocale: "en",
28
- enabledLocales: ["en", "fr"]
29
- },
30
- translationOverrides: {
31
- entries: [
32
- {
33
- key: "artisan.payments.appName",
34
- locale: "en",
35
- value: "Artisan Payments Portal"
36
- }
37
- ]
38
- },
39
- branding: {
40
- appName: { en: "Artisan Payments Portal" },
41
- assets: [
42
- { type: "logo", url: "https://tenant.artisanos.dev/logo.png" },
43
- { type: "logo-dark", url: "https://tenant.artisanos.dev/logo-dark.png" }
44
- ],
45
- colors: {
46
- primary: "#F97316",
47
- secondary: "#1F2937"
48
- },
49
- customDomain: "pay.artisanos.dev"
50
- },
51
- notes: "Stripe connection bound for production payments."
52
- };
53
- export {
54
- artisanStripeTenantConfig
55
- };
1
+ var t={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{t as artisanStripeTenantConfig};
@@ -1,55 +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";
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
- export {
54
- collectPaymentWorkflow
55
- };
1
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as q}from"@contractspec/lib.contracts-spec/ownership";import{defineWorkflow as v}from"@contractspec/lib.contracts-spec/workflow/spec";var A=v({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:[h.PlatformCore],tags:[q.Marketplace,"stripe"],stability:j.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"}]}});export{A as collectPaymentWorkflow};
@@ -1,100 +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
-
78
- // src/connection.sample.ts
79
- var stripeLiveConnection = {
80
- meta: {
81
- id: "conn-stripe-live",
82
- tenantId: "artisan-co",
83
- integrationKey: StripePaymentsIntegrationSpec.meta.key,
84
- integrationVersion: StripePaymentsIntegrationSpec.meta.version,
85
- label: "Stripe Production",
86
- environment: "production",
87
- createdAt: "2026-01-01T00:00:00.000Z",
88
- updatedAt: "2026-01-01T00:00:00.000Z"
89
- },
90
- ownershipMode: "managed",
91
- config: {
92
- accountId: "acct_xxx"
93
- },
94
- secretProvider: "vault",
95
- secretRef: "vault://integrations/artisan-co/conn-stripe-live",
96
- status: "connected"
97
- };
98
- export {
99
- stripeLiveConnection
100
- };
2
+ import{defineIntegration as i}from"@contractspec/lib.contracts-integrations";import{OwnersEnum as e,StabilityEnum as r,TagsEnum as a}from"@contractspec/lib.contracts-spec/ownership";import{defineSchemaModel as o,ScalarTypeEnum as t}from"@contractspec/lib.schema";var s=o({name:"StripePaymentsIntegrationConfig",description:"Managed configuration required to connect a Stripe account.",fields:{accountId:{type:t.String_unsecure(),isOptional:!1},webhookEndpoint:{type:t.String_unsecure(),isOptional:!1}}}),c=o({name:"StripePaymentsIntegrationSecret",description:"Secret material stored out-of-band for the Stripe provider.",fields:{apiKey:{type:t.String_unsecure(),isOptional:!1},webhookSecret:{type:t.String_unsecure(),isOptional:!1}}}),n=i({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:[e.PlatformCore],tags:[a.Marketplace,"stripe","payments"],stability:r.Experimental},supportedModes:["managed","byok"],capabilities:{provides:[{key:"payments.psp",version:"1.0.0"}]},configSchema:{schema:s,example:{accountId:"acct_demo_artisan",webhookEndpoint:"https://pay.artisanos.dev/webhooks/stripe"}},secretSchema:{schema:c,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 I={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"};export{I as stripeLiveConnection};
@@ -1,40 +1,16 @@
1
1
  // @bun
2
- // src/docs/integration-stripe.docblock.ts
3
- import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
4
- var blocks = [
5
- {
6
- id: "docs.examples.integration-stripe",
7
- title: "Integration Example \u2014 Stripe Payments",
8
- summary: "How to wire IntegrationSpec/TenantAppConfig + blueprint + workflow to enable Stripe-backed payments.",
9
- kind: "reference",
10
- visibility: "public",
11
- route: "/docs/examples/integration-stripe",
12
- tags: ["stripe", "payments", "integrations", "example"],
13
- body: `## Included
2
+ import{registerDocBlocks as m}from"@contractspec/lib.contracts-spec/docs";var f=[{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
14
3
  - App blueprint enabling \`payments.psp\` capability.
15
4
  - Workflow invoking Stripe operations (prepare \u2192 charge \u2192 confirm).
16
5
  - Tenant app config binding workflow to an IntegrationConnection.
17
6
 
18
7
  ## Notes
19
8
  - Secrets live in secret providers; connection config is non-secret.
20
- - Use \`ctx.resolvedAppConfig\` in operation executors to access integrations, branding, and translations.`
21
- },
22
- {
23
- id: "docs.examples.integration-stripe.usage",
24
- title: "Stripe Integration Example \u2014 Usage",
25
- summary: "How to use the blueprint, workflow, and tenant config together.",
26
- kind: "usage",
27
- visibility: "public",
28
- route: "/docs/examples/integration-stripe/usage",
29
- tags: ["stripe", "usage"],
30
- 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
31
10
  1) Register the blueprint + workflow + catalog in your registry.
32
11
  2) Persist an IntegrationConnection (see connection sample).
33
12
  3) Bind the tenant app config to the connection.
34
13
 
35
14
  ## Guardrails
36
15
  - Never log secrets.
37
- - Keep payment semantics spec-defined; gate breaking changes behind flags.`
38
- }
39
- ];
40
- registerDocBlocks(blocks);
16
+ - Keep payment semantics spec-defined; gate breaking changes behind flags.`}];m(f);
@@ -1,40 +1,16 @@
1
1
  // @bun
2
- // src/docs/integration-stripe.docblock.ts
3
- import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
4
- var blocks = [
5
- {
6
- id: "docs.examples.integration-stripe",
7
- title: "Integration Example \u2014 Stripe Payments",
8
- summary: "How to wire IntegrationSpec/TenantAppConfig + blueprint + workflow to enable Stripe-backed payments.",
9
- kind: "reference",
10
- visibility: "public",
11
- route: "/docs/examples/integration-stripe",
12
- tags: ["stripe", "payments", "integrations", "example"],
13
- body: `## Included
2
+ import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{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
14
3
  - App blueprint enabling \`payments.psp\` capability.
15
4
  - Workflow invoking Stripe operations (prepare \u2192 charge \u2192 confirm).
16
5
  - Tenant app config binding workflow to an IntegrationConnection.
17
6
 
18
7
  ## Notes
19
8
  - Secrets live in secret providers; connection config is non-secret.
20
- - Use \`ctx.resolvedAppConfig\` in operation executors to access integrations, branding, and translations.`
21
- },
22
- {
23
- id: "docs.examples.integration-stripe.usage",
24
- title: "Stripe Integration Example \u2014 Usage",
25
- summary: "How to use the blueprint, workflow, and tenant config together.",
26
- kind: "usage",
27
- visibility: "public",
28
- route: "/docs/examples/integration-stripe/usage",
29
- tags: ["stripe", "usage"],
30
- 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
31
10
  1) Register the blueprint + workflow + catalog in your registry.
32
11
  2) Persist an IntegrationConnection (see connection sample).
33
12
  3) Bind the tenant app config to the connection.
34
13
 
35
14
  ## Guardrails
36
15
  - Never log secrets.
37
- - Keep payment semantics spec-defined; gate breaking changes behind flags.`
38
- }
39
- ];
40
- registerDocBlocks(blocks);
16
+ - Keep payment semantics spec-defined; gate breaking changes behind flags.`}];f(h);
package/dist/example.js CHANGED
@@ -1,34 +1,2 @@
1
1
  // @bun
2
- // src/example.ts
3
- import { defineExample } from "@contractspec/lib.contracts-spec";
4
- var example = defineExample({
5
- meta: {
6
- key: "integration-stripe",
7
- version: "1.0.0",
8
- title: "Integration \u2014 Stripe Payments",
9
- description: "Wire AppBlueprint + Workflow + TenantAppConfig to enable Stripe-backed payments (spec-first integration pattern).",
10
- kind: "integration",
11
- visibility: "public",
12
- stability: "experimental",
13
- owners: ["@platform.core"],
14
- tags: ["stripe", "payments", "integration", "blueprint", "workflow"]
15
- },
16
- docs: {
17
- rootDocId: "docs.examples.integration-stripe",
18
- usageDocId: "docs.examples.integration-stripe.usage"
19
- },
20
- entrypoints: {
21
- packageName: "@contractspec/example.integration-stripe",
22
- docs: "./docs"
23
- },
24
- surfaces: {
25
- templates: true,
26
- sandbox: { enabled: true, modes: ["markdown", "specs"] },
27
- studio: { enabled: true, installable: true },
28
- mcp: { enabled: true }
29
- }
30
- });
31
- var example_default = example;
32
- export {
33
- example_default as default
34
- };
2
+ import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({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}}}),q=h;export{q as default};