@contractspec/example.integration-stripe 3.7.7 → 3.7.12
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/.turbo/turbo-build.log +36 -33
- package/CHANGELOG.md +48 -0
- package/README.md +6 -3
- package/dist/blueprint.d.ts +1 -2
- package/dist/blueprint.js +62 -9
- package/dist/browser/blueprint.js +62 -9
- package/dist/browser/connection.sample.js +78 -2
- package/dist/browser/index.js +151 -66
- package/dist/browser/integration-stripe.feature.js +139 -3
- package/dist/browser/integration.js +78 -0
- package/dist/browser/workflow.js +4 -3
- package/dist/connection.sample.js +78 -2
- package/dist/contracts.test.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +151 -66
- package/dist/integration-stripe.feature.js +139 -3
- package/dist/integration.d.ts +1 -0
- package/dist/integration.js +79 -0
- package/dist/node/blueprint.js +62 -9
- package/dist/node/connection.sample.js +78 -2
- package/dist/node/index.js +151 -66
- package/dist/node/integration-stripe.feature.js +139 -3
- package/dist/node/integration.js +78 -0
- package/dist/node/workflow.js +4 -3
- package/dist/workflow.d.ts +1 -2
- package/dist/workflow.js +4 -3
- package/package.json +20 -6
- package/src/blueprint.ts +6 -6
- package/src/connection.sample.ts +3 -2
- package/src/contracts.test.ts +34 -0
- package/src/index.ts +1 -0
- package/src/integration-stripe.feature.ts +12 -4
- package/src/integration.ts +79 -0
- package/src/workflow.ts +4 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -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=
|
|
6
|
-
Bundled
|
|
5
|
+
[contractspec-bun-build] transpile target=bun root=src entries=10 noBundle=false
|
|
6
|
+
Bundled 10 modules in 15ms
|
|
7
7
|
|
|
8
|
-
./blueprint.js
|
|
9
|
-
./index.js
|
|
10
|
-
./
|
|
11
|
-
./connection.sample.js
|
|
12
|
-
docs/index.js 1.59 KB
|
|
13
|
-
docs/integration-stripe.docblock.js 1.59 KB
|
|
14
|
-
./example.js 1.0 KB
|
|
15
|
-
./integration-stripe.feature.js
|
|
16
|
-
./
|
|
8
|
+
./blueprint.js 3.35 KB (entry point)
|
|
9
|
+
./index.js 11.20 KB (entry point)
|
|
10
|
+
./tenant.js 1.34 KB (entry point)
|
|
11
|
+
./connection.sample.js 2.93 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.73 KB (entry point)
|
|
16
|
+
./workflow.js 1.51 KB (entry point)
|
|
17
|
+
./integration.js 2.35 KB (entry point)
|
|
17
18
|
|
|
18
|
-
[contractspec-bun-build] transpile target=node root=src entries=
|
|
19
|
-
Bundled
|
|
19
|
+
[contractspec-bun-build] transpile target=node root=src entries=10 noBundle=false
|
|
20
|
+
Bundled 10 modules in 28ms
|
|
20
21
|
|
|
21
|
-
./blueprint.js
|
|
22
|
-
./index.js
|
|
23
|
-
./
|
|
24
|
-
./connection.sample.js
|
|
25
|
-
docs/index.js 1.57 KB
|
|
26
|
-
docs/integration-stripe.docblock.js 1.57 KB
|
|
27
|
-
./example.js 1.0 KB
|
|
28
|
-
./integration-stripe.feature.js
|
|
29
|
-
./
|
|
22
|
+
./blueprint.js 3.34 KB (entry point)
|
|
23
|
+
./index.js 11.18 KB (entry point)
|
|
24
|
+
./tenant.js 1.33 KB (entry point)
|
|
25
|
+
./connection.sample.js 2.92 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.73 KB (entry point)
|
|
30
|
+
./workflow.js 1.51 KB (entry point)
|
|
31
|
+
./integration.js 2.34 KB (entry point)
|
|
30
32
|
|
|
31
|
-
[contractspec-bun-build] transpile target=browser root=src entries=
|
|
32
|
-
Bundled
|
|
33
|
+
[contractspec-bun-build] transpile target=browser root=src entries=10 noBundle=false
|
|
34
|
+
Bundled 10 modules in 27ms
|
|
33
35
|
|
|
34
|
-
./blueprint.js
|
|
35
|
-
./index.js
|
|
36
|
-
./
|
|
37
|
-
./connection.sample.js
|
|
38
|
-
docs/index.js 1.57 KB
|
|
39
|
-
docs/integration-stripe.docblock.js 1.57 KB
|
|
40
|
-
./example.js 1.0 KB
|
|
41
|
-
./integration-stripe.feature.js
|
|
42
|
-
./
|
|
36
|
+
./blueprint.js 3.34 KB (entry point)
|
|
37
|
+
./index.js 11.18 KB (entry point)
|
|
38
|
+
./tenant.js 1.33 KB (entry point)
|
|
39
|
+
./connection.sample.js 2.92 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.73 KB (entry point)
|
|
44
|
+
./workflow.js 1.51 KB (entry point)
|
|
45
|
+
./integration.js 2.34 KB (entry point)
|
|
43
46
|
|
|
44
47
|
$ contractspec-bun-build types
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# @contractspec/example.integration-stripe
|
|
2
2
|
|
|
3
|
+
## 3.7.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [81256ea]
|
|
8
|
+
- Updated dependencies [2619dd8]
|
|
9
|
+
- Updated dependencies [6de2f1c]
|
|
10
|
+
- Updated dependencies [81256ea]
|
|
11
|
+
- Updated dependencies [a4489bb]
|
|
12
|
+
- Updated dependencies [9cb304e]
|
|
13
|
+
- @contractspec/lib.contracts-spec@5.0.0
|
|
14
|
+
- @contractspec/lib.contracts-integrations@3.8.4
|
|
15
|
+
- @contractspec/lib.schema@3.7.10
|
|
16
|
+
|
|
17
|
+
## 3.7.11
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- fix: release
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @contractspec/lib.contracts-integrations@3.8.3
|
|
24
|
+
- @contractspec/lib.contracts-spec@4.1.3
|
|
25
|
+
- @contractspec/lib.schema@3.7.9
|
|
26
|
+
|
|
27
|
+
## 3.7.10
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 1a44cb6: feat: improve examples to increase coverage of Contracts type
|
|
32
|
+
- Updated dependencies [1a44cb6]
|
|
33
|
+
- @contractspec/lib.contracts-integrations@3.8.2
|
|
34
|
+
- @contractspec/lib.contracts-spec@4.1.2
|
|
35
|
+
- @contractspec/lib.schema@3.7.8
|
|
36
|
+
|
|
37
|
+
## 3.7.9
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- fix: release
|
|
42
|
+
- Updated dependencies
|
|
43
|
+
- @contractspec/lib.contracts-integrations@3.8.1
|
|
44
|
+
- @contractspec/lib.contracts-spec@4.1.1
|
|
45
|
+
- @contractspec/lib.schema@3.7.7
|
|
46
|
+
|
|
3
47
|
## 3.7.6
|
|
4
48
|
|
|
5
49
|
### Patch Changes
|
|
@@ -415,6 +459,7 @@
|
|
|
415
459
|
- 7f3203a: fix: make workspace test runs resilient when packages have no tests
|
|
416
460
|
|
|
417
461
|
Updates package test scripts to pass cleanly when no matching test files exist:
|
|
462
|
+
|
|
418
463
|
- Uses `bun test --pass-with-no-tests` in Bun-based packages that currently ship without test files.
|
|
419
464
|
- Uses `jest --passWithNoTests` for the UI kit web package.
|
|
420
465
|
- 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 +794,17 @@
|
|
|
749
794
|
feat: Contract layers support (features, examples, app-configs)
|
|
750
795
|
|
|
751
796
|
### New CLI Commands
|
|
797
|
+
|
|
752
798
|
- `contractspec list layers` - List all contract layers with filtering
|
|
753
799
|
|
|
754
800
|
### Enhanced Commands
|
|
801
|
+
|
|
755
802
|
- `contractspec ci` - New `layers` check category validates features/examples/config
|
|
756
803
|
- `contractspec doctor` - New `layers` health checks
|
|
757
804
|
- `contractspec integrity` - Now shows layer statistics
|
|
758
805
|
|
|
759
806
|
### New APIs
|
|
807
|
+
|
|
760
808
|
- `discoverLayers()` - Scan workspace for all layer files
|
|
761
809
|
- `scanExampleSource()` - Parse ExampleSpec from source code
|
|
762
810
|
- `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
|
-
-
|
|
10
|
-
-
|
|
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
|
|
package/dist/blueprint.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const artisanStripeBlueprint: AppBlueprintSpec;
|
|
1
|
+
export declare const artisanStripeBlueprint: import("@contractspec/lib.contracts-spec/app-config").AppBlueprintSpec;
|
package/dist/blueprint.js
CHANGED
|
@@ -1,11 +1,65 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// src/
|
|
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
|
-
|
|
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: [
|
|
17
|
-
tags: [
|
|
18
|
-
stability:
|
|
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:
|
|
54
|
-
version:
|
|
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/
|
|
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
|
-
|
|
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: [
|
|
16
|
-
tags: [
|
|
17
|
-
stability:
|
|
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:
|
|
53
|
-
version:
|
|
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-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
|
+
|
|
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:
|
|
7
|
-
integrationVersion:
|
|
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",
|