@contractspec/example.integration-stripe 3.7.7 → 3.7.10

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.
@@ -2,43 +2,46 @@ $ contractspec-bun-build prebuild
2
2
  $ bun run prebuild && bun run build:bundle && bun run build:types
3
3
  $ contractspec-bun-build prebuild
4
4
  $ contractspec-bun-build transpile
5
- [contractspec-bun-build] transpile target=bun root=src entries=9 noBundle=false
6
- Bundled 9 modules in 13ms
5
+ [contractspec-bun-build] transpile target=bun root=src entries=10 noBundle=false
6
+ Bundled 10 modules in 33ms
7
7
 
8
- ./blueprint.js 1.77 KB (entry point)
9
- ./index.js 8.59 KB (entry point)
10
- ./workflow.js 1.42 KB (entry point)
11
- ./connection.sample.js 0.58 KB (entry point)
12
- docs/index.js 1.59 KB (entry point)
13
- docs/integration-stripe.docblock.js 1.59 KB (entry point)
14
- ./example.js 1.0 KB (entry point)
15
- ./integration-stripe.feature.js 0.90 KB (entry point)
16
- ./tenant.js 1.34 KB (entry point)
8
+ ./blueprint.js 3.35 KB (entry point)
9
+ ./index.js 11.21 KB (entry point)
10
+ ./tenant.js 1.34 KB (entry point)
11
+ ./connection.sample.js 2.94 KB (entry point)
12
+ docs/index.js 1.59 KB (entry point)
13
+ docs/integration-stripe.docblock.js 1.59 KB (entry point)
14
+ ./example.js 1.0 KB (entry point)
15
+ ./integration-stripe.feature.js 4.74 KB (entry point)
16
+ ./workflow.js 1.51 KB (entry point)
17
+ ./integration.js 2.36 KB (entry point)
17
18
 
18
- [contractspec-bun-build] transpile target=node root=src entries=9 noBundle=false
19
- Bundled 9 modules in 24ms
19
+ [contractspec-bun-build] transpile target=node root=src entries=10 noBundle=false
20
+ Bundled 10 modules in 24ms
20
21
 
21
- ./blueprint.js 1.77 KB (entry point)
22
- ./index.js 8.57 KB (entry point)
23
- ./workflow.js 1.41 KB (entry point)
24
- ./connection.sample.js 0.57 KB (entry point)
25
- docs/index.js 1.57 KB (entry point)
26
- docs/integration-stripe.docblock.js 1.57 KB (entry point)
27
- ./example.js 1.0 KB (entry point)
28
- ./integration-stripe.feature.js 0.89 KB (entry point)
29
- ./tenant.js 1.33 KB (entry point)
22
+ ./blueprint.js 3.34 KB (entry point)
23
+ ./index.js 11.19 KB (entry point)
24
+ ./tenant.js 1.33 KB (entry point)
25
+ ./connection.sample.js 2.93 KB (entry point)
26
+ docs/index.js 1.57 KB (entry point)
27
+ docs/integration-stripe.docblock.js 1.57 KB (entry point)
28
+ ./example.js 1.0 KB (entry point)
29
+ ./integration-stripe.feature.js 4.74 KB (entry point)
30
+ ./workflow.js 1.51 KB (entry point)
31
+ ./integration.js 2.35 KB (entry point)
30
32
 
31
- [contractspec-bun-build] transpile target=browser root=src entries=9 noBundle=false
32
- Bundled 9 modules in 24ms
33
+ [contractspec-bun-build] transpile target=browser root=src entries=10 noBundle=false
34
+ Bundled 10 modules in 21ms
33
35
 
34
- ./blueprint.js 1.77 KB (entry point)
35
- ./index.js 8.57 KB (entry point)
36
- ./workflow.js 1.41 KB (entry point)
37
- ./connection.sample.js 0.57 KB (entry point)
38
- docs/index.js 1.57 KB (entry point)
39
- docs/integration-stripe.docblock.js 1.57 KB (entry point)
40
- ./example.js 1.0 KB (entry point)
41
- ./integration-stripe.feature.js 0.89 KB (entry point)
42
- ./tenant.js 1.33 KB (entry point)
36
+ ./blueprint.js 3.34 KB (entry point)
37
+ ./index.js 11.19 KB (entry point)
38
+ ./tenant.js 1.33 KB (entry point)
39
+ ./connection.sample.js 2.93 KB (entry point)
40
+ docs/index.js 1.57 KB (entry point)
41
+ docs/integration-stripe.docblock.js 1.57 KB (entry point)
42
+ ./example.js 1.0 KB (entry point)
43
+ ./integration-stripe.feature.js 4.74 KB (entry point)
44
+ ./workflow.js 1.51 KB (entry point)
45
+ ./integration.js 2.35 KB (entry point)
43
46
 
44
47
  $ contractspec-bun-build types
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @contractspec/example.integration-stripe
2
2
 
3
+ ## 3.7.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 1a44cb6: feat: improve examples to increase coverage of Contracts type
8
+ - Updated dependencies [1a44cb6]
9
+ - @contractspec/lib.contracts-integrations@3.8.2
10
+ - @contractspec/lib.contracts-spec@4.1.2
11
+ - @contractspec/lib.schema@3.7.8
12
+
13
+ ## 3.7.9
14
+
15
+ ### Patch Changes
16
+
17
+ - fix: release
18
+ - Updated dependencies
19
+ - @contractspec/lib.contracts-integrations@3.8.1
20
+ - @contractspec/lib.contracts-spec@4.1.1
21
+ - @contractspec/lib.schema@3.7.7
22
+
3
23
  ## 3.7.6
4
24
 
5
25
  ### Patch Changes
@@ -415,6 +435,7 @@
415
435
  - 7f3203a: fix: make workspace test runs resilient when packages have no tests
416
436
 
417
437
  Updates package test scripts to pass cleanly when no matching test files exist:
438
+
418
439
  - Uses `bun test --pass-with-no-tests` in Bun-based packages that currently ship without test files.
419
440
  - Uses `jest --passWithNoTests` for the UI kit web package.
420
441
  - Adds `.vscode-test.mjs` for `vscode-contractspec` so VS Code extension test runs have an explicit config and stop failing on missing default configuration.
@@ -749,14 +770,17 @@
749
770
  feat: Contract layers support (features, examples, app-configs)
750
771
 
751
772
  ### New CLI Commands
773
+
752
774
  - `contractspec list layers` - List all contract layers with filtering
753
775
 
754
776
  ### Enhanced Commands
777
+
755
778
  - `contractspec ci` - New `layers` check category validates features/examples/config
756
779
  - `contractspec doctor` - New `layers` health checks
757
780
  - `contractspec integrity` - Now shows layer statistics
758
781
 
759
782
  ### New APIs
783
+
760
784
  - `discoverLayers()` - Scan workspace for all layer files
761
785
  - `scanExampleSource()` - Parse ExampleSpec from source code
762
786
  - `isExampleFile()` - Check if file is an example spec
package/README.md CHANGED
@@ -6,12 +6,12 @@ Website: https://contractspec.io
6
6
 
7
7
  ## What This Demonstrates
8
8
 
9
- - Integration blueprint definition for Stripe.
10
- - Payment workflow with typed steps.
9
+ - Canonical `integration` export via `StripePaymentsIntegrationSpec`.
10
+ - Integration-oriented `app-config` example via `defineAppConfig(...)`.
11
+ - Canonical `workflow` export via `defineWorkflow(...)`.
11
12
  - Multi-tenant configuration pattern.
12
13
  - Connection sample for credential wiring.
13
14
  - `src/docs/` contains docblocks and documentation-facing exports.
14
- - `src/docs/` contains docblocks and documentation-facing exports.
15
15
 
16
16
  ## Running Locally
17
17
 
@@ -31,6 +31,7 @@ Use `@contractspec/example.integration-stripe` as a reference implementation, or
31
31
  - `src/connection.sample.ts` is part of the package's public or composition surface.
32
32
  - `src/docs/` contains docblocks and documentation-facing exports.
33
33
  - `src/example.ts` is the runnable example entrypoint.
34
+ - `src/integration.ts` defines the exported integration spec.
34
35
  - `src/index.ts` is the root public barrel and package entrypoint.
35
36
  - `src/integration-stripe.feature.ts` defines a feature entrypoint.
36
37
  - `src/tenant.ts` is part of the package's public or composition surface.
@@ -43,9 +44,11 @@ Use `@contractspec/example.integration-stripe` as a reference implementation, or
43
44
  - Export `./docs` resolves through `./src/docs/index.ts`.
44
45
  - Export `./docs/integration-stripe.docblock` resolves through `./src/docs/integration-stripe.docblock.ts`.
45
46
  - Export `./example` resolves through `./src/example.ts`.
47
+ - Export `./integration` resolves through `./src/integration.ts`.
46
48
  - Export `./integration-stripe.feature` resolves through `./src/integration-stripe.feature.ts`.
47
49
  - Export `./tenant` resolves through `./src/tenant.ts`.
48
50
  - Export `./workflow` resolves through `./src/workflow.ts`.
51
+ - The package publishes 9 total export subpaths; keep docs aligned with `package.json`.
49
52
 
50
53
  ## Local Commands
51
54
 
@@ -1,2 +1 @@
1
- import type { AppBlueprintSpec } from '@contractspec/lib.contracts-spec/app-config/spec';
2
- export declare const artisanStripeBlueprint: AppBlueprintSpec;
1
+ export declare const artisanStripeBlueprint: import("@contractspec/lib.contracts-spec/app-config/spec").AppBlueprintSpec;
package/dist/blueprint.js CHANGED
@@ -1,11 +1,65 @@
1
1
  // @bun
2
- // src/blueprint.ts
2
+ // src/workflow.ts
3
3
  import {
4
4
  OwnersEnum,
5
5
  StabilityEnum,
6
6
  TagsEnum
7
7
  } from "@contractspec/lib.contracts-spec/ownership";
8
- var artisanStripeBlueprint = {
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({
9
63
  meta: {
10
64
  key: "artisan.payments.stripe",
11
65
  version: "1.0.0",
@@ -13,9 +67,9 @@ var artisanStripeBlueprint = {
13
67
  title: "ArtisanOS Stripe Payments",
14
68
  description: "Blueprint enabling card payments for ArtisanOS merchants via the Stripe integration.",
15
69
  domain: "payments",
16
- owners: [OwnersEnum.PlatformCore],
17
- tags: [TagsEnum.Marketplace, "stripe", "payments"],
18
- stability: StabilityEnum.Experimental
70
+ owners: [OwnersEnum2.PlatformCore],
71
+ tags: [TagsEnum2.Marketplace, "stripe", "payments"],
72
+ stability: StabilityEnum2.Experimental
19
73
  },
20
74
  capabilities: {
21
75
  enabled: [{ key: "payments.psp", version: "1.0.0" }]
@@ -50,13 +104,12 @@ var artisanStripeBlueprint = {
50
104
  },
51
105
  workflows: {
52
106
  collectPayment: {
53
- key: "artisan.payments.collectPayment",
54
- version: "1.0.0"
107
+ key: collectPaymentWorkflow.meta.key,
108
+ version: collectPaymentWorkflow.meta.version
55
109
  }
56
110
  },
57
- policies: [{ key: "artisan.payments.default", version: "1.0.0" }],
58
111
  notes: "Install this blueprint and pair it with the Stripe integration connection to enable card collection."
59
- };
112
+ });
60
113
  export {
61
114
  artisanStripeBlueprint
62
115
  };
@@ -1,10 +1,64 @@
1
- // src/blueprint.ts
1
+ // src/workflow.ts
2
2
  import {
3
3
  OwnersEnum,
4
4
  StabilityEnum,
5
5
  TagsEnum
6
6
  } from "@contractspec/lib.contracts-spec/ownership";
7
- var artisanStripeBlueprint = {
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
+
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({
8
62
  meta: {
9
63
  key: "artisan.payments.stripe",
10
64
  version: "1.0.0",
@@ -12,9 +66,9 @@ var artisanStripeBlueprint = {
12
66
  title: "ArtisanOS Stripe Payments",
13
67
  description: "Blueprint enabling card payments for ArtisanOS merchants via the Stripe integration.",
14
68
  domain: "payments",
15
- owners: [OwnersEnum.PlatformCore],
16
- tags: [TagsEnum.Marketplace, "stripe", "payments"],
17
- stability: StabilityEnum.Experimental
69
+ owners: [OwnersEnum2.PlatformCore],
70
+ tags: [TagsEnum2.Marketplace, "stripe", "payments"],
71
+ stability: StabilityEnum2.Experimental
18
72
  },
19
73
  capabilities: {
20
74
  enabled: [{ key: "payments.psp", version: "1.0.0" }]
@@ -49,13 +103,12 @@ var artisanStripeBlueprint = {
49
103
  },
50
104
  workflows: {
51
105
  collectPayment: {
52
- key: "artisan.payments.collectPayment",
53
- version: "1.0.0"
106
+ key: collectPaymentWorkflow.meta.key,
107
+ version: collectPaymentWorkflow.meta.version
54
108
  }
55
109
  },
56
- policies: [{ key: "artisan.payments.default", version: "1.0.0" }],
57
110
  notes: "Install this blueprint and pair it with the Stripe integration connection to enable card collection."
58
- };
111
+ });
59
112
  export {
60
113
  artisanStripeBlueprint
61
114
  };
@@ -1,10 +1,86 @@
1
+ // src/integration.ts
2
+ import { defineIntegration } from "@contractspec/lib.contracts-spec/integrations/spec";
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
+
1
77
  // src/connection.sample.ts
2
78
  var stripeLiveConnection = {
3
79
  meta: {
4
80
  id: "conn-stripe-live",
5
81
  tenantId: "artisan-co",
6
- integrationKey: "payments.stripe",
7
- integrationVersion: "1",
82
+ integrationKey: StripePaymentsIntegrationSpec.meta.key,
83
+ integrationVersion: StripePaymentsIntegrationSpec.meta.version,
8
84
  label: "Stripe Production",
9
85
  environment: "production",
10
86
  createdAt: "2026-01-01T00:00:00.000Z",