@contractspec/example.integration-stripe 3.7.6 → 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.
- package/.turbo/turbo-build.log +36 -33
- package/AGENTS.md +44 -21
- package/CHANGELOG.md +24 -0
- package/README.md +66 -19
- 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 +168 -83
- 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 +4 -3
- package/dist/index.js +168 -83
- 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 +168 -83
- 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 +22 -8
- package/src/blueprint.ts +59 -59
- package/src/connection.sample.ts +18 -17
- package/src/contracts.test.ts +34 -0
- package/src/docs/integration-stripe.docblock.ts +21 -21
- package/src/example.ts +26 -26
- package/src/index.ts +4 -3
- package/src/integration-stripe.feature.ts +29 -21
- package/src/integration.ts +79 -0
- package/src/tenant.ts +49 -49
- package/src/workflow.ts +50 -50
- package/translation.catalog.json +18 -19
- package/tsconfig.json +7 -9
- package/tsdown.config.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.integration-stripe",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.10",
|
|
4
4
|
"description": "Integration example – Stripe Payments (blueprint + workflow + tenant config).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -47,6 +47,13 @@
|
|
|
47
47
|
"node": "./dist/node/example.js",
|
|
48
48
|
"default": "./dist/example.js"
|
|
49
49
|
},
|
|
50
|
+
"./integration": {
|
|
51
|
+
"types": "./dist/integration.d.ts",
|
|
52
|
+
"browser": "./dist/browser/integration.js",
|
|
53
|
+
"bun": "./dist/integration.js",
|
|
54
|
+
"node": "./dist/node/integration.js",
|
|
55
|
+
"default": "./dist/integration.js"
|
|
56
|
+
},
|
|
50
57
|
"./integration-stripe.feature": {
|
|
51
58
|
"types": "./dist/integration-stripe.feature.d.ts",
|
|
52
59
|
"browser": "./dist/browser/integration-stripe.feature.js",
|
|
@@ -78,21 +85,21 @@
|
|
|
78
85
|
"dev": "contractspec-bun-build dev",
|
|
79
86
|
"clean": "rimraf dist .turbo",
|
|
80
87
|
"lint": "bun lint:fix",
|
|
81
|
-
"lint:fix": "
|
|
82
|
-
"lint:check": "
|
|
88
|
+
"lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
|
|
89
|
+
"lint:check": "biome check .",
|
|
83
90
|
"test": "bun test --pass-with-no-tests",
|
|
84
91
|
"prebuild": "contractspec-bun-build prebuild",
|
|
85
92
|
"typecheck": "tsc --noEmit"
|
|
86
93
|
},
|
|
87
94
|
"dependencies": {
|
|
88
|
-
"@contractspec/lib.schema": "3.7.
|
|
89
|
-
"@contractspec/lib.contracts-spec": "
|
|
90
|
-
"@contractspec/lib.contracts-integrations": "3.
|
|
95
|
+
"@contractspec/lib.schema": "3.7.8",
|
|
96
|
+
"@contractspec/lib.contracts-spec": "4.1.2",
|
|
97
|
+
"@contractspec/lib.contracts-integrations": "3.8.2"
|
|
91
98
|
},
|
|
92
99
|
"devDependencies": {
|
|
93
|
-
"@contractspec/tool.typescript": "3.7.
|
|
100
|
+
"@contractspec/tool.typescript": "3.7.8",
|
|
94
101
|
"typescript": "^5.9.3",
|
|
95
|
-
"@contractspec/tool.bun": "3.7.
|
|
102
|
+
"@contractspec/tool.bun": "3.7.8"
|
|
96
103
|
},
|
|
97
104
|
"publishConfig": {
|
|
98
105
|
"access": "public",
|
|
@@ -139,6 +146,13 @@
|
|
|
139
146
|
"node": "./dist/node/example.js",
|
|
140
147
|
"default": "./dist/example.js"
|
|
141
148
|
},
|
|
149
|
+
"./integration": {
|
|
150
|
+
"types": "./dist/integration.d.ts",
|
|
151
|
+
"browser": "./dist/browser/integration.js",
|
|
152
|
+
"bun": "./dist/integration.js",
|
|
153
|
+
"node": "./dist/node/integration.js",
|
|
154
|
+
"default": "./dist/integration.js"
|
|
155
|
+
},
|
|
142
156
|
"./integration-stripe.feature": {
|
|
143
157
|
"types": "./dist/integration-stripe.feature.d.ts",
|
|
144
158
|
"browser": "./dist/browser/integration-stripe.feature.js",
|
package/src/blueprint.ts
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineAppConfig } from '@contractspec/lib.contracts-spec/app-config/spec';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
OwnersEnum,
|
|
4
|
+
StabilityEnum,
|
|
5
|
+
TagsEnum,
|
|
6
6
|
} from '@contractspec/lib.contracts-spec/ownership';
|
|
7
|
+
import { collectPaymentWorkflow } from './workflow';
|
|
7
8
|
|
|
8
|
-
export const artisanStripeBlueprint
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
};
|
|
9
|
+
export const artisanStripeBlueprint = defineAppConfig({
|
|
10
|
+
meta: {
|
|
11
|
+
key: 'artisan.payments.stripe',
|
|
12
|
+
version: '1.0.0',
|
|
13
|
+
appId: 'artisan',
|
|
14
|
+
title: 'ArtisanOS Stripe Payments',
|
|
15
|
+
description:
|
|
16
|
+
'Blueprint enabling card payments for ArtisanOS merchants via the Stripe integration.',
|
|
17
|
+
domain: 'payments',
|
|
18
|
+
owners: [OwnersEnum.PlatformCore],
|
|
19
|
+
tags: [TagsEnum.Marketplace, 'stripe', 'payments'],
|
|
20
|
+
stability: StabilityEnum.Experimental,
|
|
21
|
+
},
|
|
22
|
+
capabilities: {
|
|
23
|
+
enabled: [{ key: 'payments.psp', version: '1.0.0' }],
|
|
24
|
+
},
|
|
25
|
+
integrationSlots: [
|
|
26
|
+
{
|
|
27
|
+
slotId: 'primary-payments',
|
|
28
|
+
requiredCategory: 'payments',
|
|
29
|
+
allowedModes: ['managed', 'byok'],
|
|
30
|
+
requiredCapabilities: [{ key: 'payments.psp', version: '1.0.0' }],
|
|
31
|
+
required: true,
|
|
32
|
+
description:
|
|
33
|
+
'Primary card processor slot. Bind the tenant Stripe connection here.',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
branding: {
|
|
37
|
+
appNameKey: 'artisan.payments.appName',
|
|
38
|
+
assets: [
|
|
39
|
+
{ type: 'logo', url: 'https://cdn.artisanos.dev/branding/logo.png' },
|
|
40
|
+
{
|
|
41
|
+
type: 'favicon',
|
|
42
|
+
url: 'https://cdn.artisanos.dev/branding/favicon.ico',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
colorTokens: {
|
|
46
|
+
primary: 'colors.brand.primary',
|
|
47
|
+
secondary: 'colors.brand.secondary',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
translationCatalog: {
|
|
51
|
+
key: 'artisan.payments.catalog',
|
|
52
|
+
version: '1.0.0',
|
|
53
|
+
},
|
|
54
|
+
workflows: {
|
|
55
|
+
collectPayment: {
|
|
56
|
+
key: collectPaymentWorkflow.meta.key,
|
|
57
|
+
version: collectPaymentWorkflow.meta.version,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
notes:
|
|
61
|
+
'Install this blueprint and pair it with the Stripe integration connection to enable card collection.',
|
|
62
|
+
});
|
package/src/connection.sample.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import type { IntegrationConnection } from '@contractspec/lib.contracts-integrations';
|
|
2
|
+
import { StripePaymentsIntegrationSpec } from './integration';
|
|
2
3
|
|
|
3
4
|
export const stripeLiveConnection: IntegrationConnection = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
meta: {
|
|
6
|
+
id: 'conn-stripe-live',
|
|
7
|
+
tenantId: 'artisan-co',
|
|
8
|
+
integrationKey: StripePaymentsIntegrationSpec.meta.key,
|
|
9
|
+
integrationVersion: StripePaymentsIntegrationSpec.meta.version,
|
|
10
|
+
label: 'Stripe Production',
|
|
11
|
+
environment: 'production',
|
|
12
|
+
createdAt: '2026-01-01T00:00:00.000Z',
|
|
13
|
+
updatedAt: '2026-01-01T00:00:00.000Z',
|
|
14
|
+
},
|
|
15
|
+
ownershipMode: 'managed',
|
|
16
|
+
config: {
|
|
17
|
+
accountId: 'acct_xxx',
|
|
18
|
+
},
|
|
19
|
+
secretProvider: 'vault',
|
|
20
|
+
secretRef: 'vault://integrations/artisan-co/conn-stripe-live',
|
|
21
|
+
status: 'connected',
|
|
21
22
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
import {
|
|
3
|
+
artisanStripeBlueprint,
|
|
4
|
+
collectPaymentWorkflow,
|
|
5
|
+
IntegrationStripeFeature,
|
|
6
|
+
StripePaymentsIntegrationSpec,
|
|
7
|
+
stripeLiveConnection,
|
|
8
|
+
} from './index';
|
|
9
|
+
|
|
10
|
+
describe('@contractspec/example.integration-stripe', () => {
|
|
11
|
+
test('exports the canonical integration, workflow, and app config', () => {
|
|
12
|
+
expect(StripePaymentsIntegrationSpec.meta.key).toBe(
|
|
13
|
+
'integration-stripe.integration.psp'
|
|
14
|
+
);
|
|
15
|
+
expect(collectPaymentWorkflow.meta.key).toBe(
|
|
16
|
+
'integration-stripe.workflow.payment'
|
|
17
|
+
);
|
|
18
|
+
expect(artisanStripeBlueprint.workflows).toEqual({
|
|
19
|
+
collectPayment: {
|
|
20
|
+
key: collectPaymentWorkflow.meta.key,
|
|
21
|
+
version: collectPaymentWorkflow.meta.version,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
expect(IntegrationStripeFeature.integrations).toEqual([
|
|
25
|
+
{
|
|
26
|
+
key: StripePaymentsIntegrationSpec.meta.key,
|
|
27
|
+
version: StripePaymentsIntegrationSpec.meta.version,
|
|
28
|
+
},
|
|
29
|
+
]);
|
|
30
|
+
expect(stripeLiveConnection.meta.integrationKey).toBe(
|
|
31
|
+
StripePaymentsIntegrationSpec.meta.key
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -2,27 +2,27 @@ import type { DocBlock } from '@contractspec/lib.contracts-spec/docs';
|
|
|
2
2
|
import { registerDocBlocks } from '@contractspec/lib.contracts-spec/docs';
|
|
3
3
|
|
|
4
4
|
const blocks: DocBlock[] = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
{
|
|
6
|
+
id: 'docs.examples.integration-stripe',
|
|
7
|
+
title: 'Integration Example — Stripe Payments',
|
|
8
|
+
summary:
|
|
9
|
+
'How to wire IntegrationSpec/TenantAppConfig + blueprint + workflow to enable Stripe-backed payments.',
|
|
10
|
+
kind: 'reference',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
route: '/docs/examples/integration-stripe',
|
|
13
|
+
tags: ['stripe', 'payments', 'integrations', 'example'],
|
|
14
|
+
body: `## Included\n- App blueprint enabling \`payments.psp\` capability.\n- Workflow invoking Stripe operations (prepare → charge → confirm).\n- Tenant app config binding workflow to an IntegrationConnection.\n\n## Notes\n- Secrets live in secret providers; connection config is non-secret.\n- Use \`ctx.resolvedAppConfig\` in operation executors to access integrations, branding, and translations.`,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: 'docs.examples.integration-stripe.usage',
|
|
18
|
+
title: 'Stripe Integration Example — Usage',
|
|
19
|
+
summary: 'How to use the blueprint, workflow, and tenant config together.',
|
|
20
|
+
kind: 'usage',
|
|
21
|
+
visibility: 'public',
|
|
22
|
+
route: '/docs/examples/integration-stripe/usage',
|
|
23
|
+
tags: ['stripe', 'usage'],
|
|
24
|
+
body: `## Usage\n1) Register the blueprint + workflow + catalog in your registry.\n2) Persist an IntegrationConnection (see connection sample).\n3) Bind the tenant app config to the connection.\n\n## Guardrails\n- Never log secrets.\n- Keep payment semantics spec-defined; gate breaking changes behind flags.`,
|
|
25
|
+
},
|
|
26
26
|
];
|
|
27
27
|
|
|
28
28
|
registerDocBlocks(blocks);
|
package/src/example.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { defineExample } from '@contractspec/lib.contracts-spec';
|
|
2
2
|
|
|
3
3
|
const example = defineExample({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
meta: {
|
|
5
|
+
key: 'integration-stripe',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
title: 'Integration — Stripe Payments',
|
|
8
|
+
description:
|
|
9
|
+
'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
30
|
});
|
|
31
31
|
|
|
32
32
|
export default example;
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from './blueprint';
|
|
2
|
-
export * from './workflow';
|
|
3
|
-
export * from './tenant';
|
|
4
2
|
export * from './connection.sample';
|
|
5
|
-
export * from './integration-stripe.feature';
|
|
6
3
|
export { default as example } from './example';
|
|
4
|
+
export * from './integration';
|
|
5
|
+
export * from './integration-stripe.feature';
|
|
6
|
+
export * from './tenant';
|
|
7
|
+
export * from './workflow';
|
|
7
8
|
import './docs';
|
|
@@ -1,28 +1,36 @@
|
|
|
1
1
|
import { defineFeature } from '@contractspec/lib.contracts-spec';
|
|
2
|
+
import { StripePaymentsIntegrationSpec } from './integration';
|
|
3
|
+
import { collectPaymentWorkflow } from './workflow';
|
|
2
4
|
|
|
3
5
|
export const IntegrationStripeFeature = defineFeature({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
meta: {
|
|
7
|
+
key: 'integration-stripe',
|
|
8
|
+
version: '1.0.0',
|
|
9
|
+
title: 'Stripe Payments Integration',
|
|
10
|
+
description:
|
|
11
|
+
'Stripe payments integration with blueprint, workflow, and tenant configuration',
|
|
12
|
+
domain: 'integration',
|
|
13
|
+
owners: ['@integration-team'],
|
|
14
|
+
tags: ['integration', 'stripe', 'payments'],
|
|
15
|
+
stability: 'experimental',
|
|
16
|
+
},
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
integrations: [
|
|
19
|
+
{
|
|
20
|
+
key: StripePaymentsIntegrationSpec.meta.key,
|
|
21
|
+
version: StripePaymentsIntegrationSpec.meta.version,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
workflows: [
|
|
26
|
+
{
|
|
27
|
+
key: collectPaymentWorkflow.meta.key,
|
|
28
|
+
version: collectPaymentWorkflow.meta.version,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
21
31
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'docs.examples.integration-stripe.usage',
|
|
27
|
-
],
|
|
32
|
+
docs: [
|
|
33
|
+
'docs.examples.integration-stripe',
|
|
34
|
+
'docs.examples.integration-stripe.usage',
|
|
35
|
+
],
|
|
28
36
|
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { defineIntegration } from '@contractspec/lib.contracts-spec/integrations/spec';
|
|
2
|
+
import {
|
|
3
|
+
OwnersEnum,
|
|
4
|
+
StabilityEnum,
|
|
5
|
+
TagsEnum,
|
|
6
|
+
} from '@contractspec/lib.contracts-spec/ownership';
|
|
7
|
+
import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
|
|
8
|
+
|
|
9
|
+
const 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
|
+
|
|
21
|
+
const 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
|
+
|
|
33
|
+
export const StripePaymentsIntegrationSpec = defineIntegration({
|
|
34
|
+
meta: {
|
|
35
|
+
key: 'integration-stripe.integration.psp',
|
|
36
|
+
version: '1.0.0',
|
|
37
|
+
title: 'Stripe Payments Integration',
|
|
38
|
+
description:
|
|
39
|
+
'Integration contract for managed or BYOK Stripe card processing.',
|
|
40
|
+
domain: 'payments',
|
|
41
|
+
category: 'payments',
|
|
42
|
+
owners: [OwnersEnum.PlatformCore],
|
|
43
|
+
tags: [TagsEnum.Marketplace, 'stripe', 'payments'],
|
|
44
|
+
stability: StabilityEnum.Experimental,
|
|
45
|
+
},
|
|
46
|
+
supportedModes: ['managed', 'byok'],
|
|
47
|
+
capabilities: {
|
|
48
|
+
provides: [{ key: 'payments.psp', version: '1.0.0' }],
|
|
49
|
+
},
|
|
50
|
+
configSchema: {
|
|
51
|
+
schema: StripeConfigModel,
|
|
52
|
+
example: {
|
|
53
|
+
accountId: 'acct_demo_artisan',
|
|
54
|
+
webhookEndpoint: 'https://pay.artisanos.dev/webhooks/stripe',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
secretSchema: {
|
|
58
|
+
schema: StripeSecretModel,
|
|
59
|
+
example: {
|
|
60
|
+
apiKey: 'sk_live_redacted',
|
|
61
|
+
webhookSecret: 'whsec_redacted',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
healthCheck: {
|
|
65
|
+
method: 'ping',
|
|
66
|
+
timeoutMs: 5000,
|
|
67
|
+
},
|
|
68
|
+
docsUrl: 'https://docs.stripe.com',
|
|
69
|
+
constraints: {
|
|
70
|
+
rateLimit: {
|
|
71
|
+
rpm: 1000,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
byokSetup: {
|
|
75
|
+
setupInstructions:
|
|
76
|
+
'Create a restricted API key and webhook endpoint, then bind the secret reference to the tenant connection.',
|
|
77
|
+
requiredScopes: ['charges:write', 'customers:read', 'webhooks:write'],
|
|
78
|
+
},
|
|
79
|
+
});
|
package/src/tenant.ts
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import type { TenantAppConfig } from '@contractspec/lib.contracts-spec/app-config/spec';
|
|
2
2
|
|
|
3
3
|
export const artisanStripeTenantConfig: TenantAppConfig = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
4
|
+
meta: {
|
|
5
|
+
id: 'tenant-config-artisan-stripe',
|
|
6
|
+
tenantId: 'artisan-co',
|
|
7
|
+
appId: 'artisan',
|
|
8
|
+
blueprintName: 'artisan.payments.stripe',
|
|
9
|
+
blueprintVersion: '1.0.0',
|
|
10
|
+
environment: 'production',
|
|
11
|
+
version: '1.0.0',
|
|
12
|
+
status: 'published',
|
|
13
|
+
createdAt: new Date().toISOString(),
|
|
14
|
+
updatedAt: new Date().toISOString(),
|
|
15
|
+
},
|
|
16
|
+
integrations: [
|
|
17
|
+
{
|
|
18
|
+
slotId: 'primary-payments',
|
|
19
|
+
connectionId: 'conn-stripe-live',
|
|
20
|
+
scope: {
|
|
21
|
+
workflows: ['collectPayment'],
|
|
22
|
+
operations: ['payments.stripe.chargeCard'],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
knowledge: [],
|
|
27
|
+
locales: {
|
|
28
|
+
defaultLocale: 'en',
|
|
29
|
+
enabledLocales: ['en', 'fr'],
|
|
30
|
+
},
|
|
31
|
+
translationOverrides: {
|
|
32
|
+
entries: [
|
|
33
|
+
{
|
|
34
|
+
key: 'artisan.payments.appName',
|
|
35
|
+
locale: 'en',
|
|
36
|
+
value: 'Artisan Payments Portal',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
branding: {
|
|
41
|
+
appName: { en: 'Artisan Payments Portal' },
|
|
42
|
+
assets: [
|
|
43
|
+
{ type: 'logo', url: 'https://tenant.artisanos.dev/logo.png' },
|
|
44
|
+
{ type: 'logo-dark', url: 'https://tenant.artisanos.dev/logo-dark.png' },
|
|
45
|
+
],
|
|
46
|
+
colors: {
|
|
47
|
+
primary: '#F97316',
|
|
48
|
+
secondary: '#1F2937',
|
|
49
|
+
},
|
|
50
|
+
customDomain: 'pay.artisanos.dev',
|
|
51
|
+
},
|
|
52
|
+
notes: 'Stripe connection bound for production payments.',
|
|
53
53
|
};
|