@stripe/extensibility-dev-tools 0.23.5 → 0.23.7
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/README.md +28 -0
- package/dist/api-surface.d.ts.map +1 -0
- package/dist/bin/build-custom-object-definitions.cjs +21 -24
- package/dist/bin/build-custom-object-definitions.js +21 -24
- package/dist/bin/create-upload-image.cjs +21 -24
- package/dist/bin/create-upload-image.js +21 -24
- package/dist/bin/dev-tools-rpc.cjs +35 -25
- package/dist/bin/dev-tools-rpc.js +35 -25
- package/dist/bin/gen-workspace.cjs +35 -25
- package/dist/bin/gen-workspace.js +35 -25
- package/dist/bin/template-info.cjs +21 -24
- package/dist/bin/template-info.js +21 -24
- package/dist/dependencies/index.d.ts +7 -7
- package/dist/index.cjs +35 -25
- package/dist/index.js +35 -25
- package/dist/manifest/manifest-v2.d.ts +3 -8
- package/dist/templates/diff-viewer/types.d.ts +2 -2
- package/dist/templates/extensions/base.d.ts +3 -5
- package/dist/templates/extensions/base.d.ts.map +1 -1
- package/dist/templates/extensions/types.d.ts +3 -9
- package/dist/templates/file-writer.d.ts +2 -2
- package/dist/templates/index.cjs +35 -25
- package/dist/templates/index.js +35 -25
- package/dist/templates/root/index.d.ts +1 -1
- package/dist/templates/root/index.d.ts.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/workspace/index.cjs +35 -25
- package/dist/workspace/index.d.ts +30 -34
- package/dist/workspace/index.js +35 -25
- package/package.json +4 -4
- package/templates/extensions/billing.bill.discount_calculation/index.ts +1 -2
- package/templates/extensions/billing.customer_balance_application/index.test.ts +5 -5
- package/templates/extensions/billing.customer_balance_application/index.ts +4 -4
- package/templates/extensions/billing.invoice_collection_setting/index.ts +1 -1
- package/templates/extensions/billing.prorations/index.ts +1 -1
- package/templates/extensions/billing.recurring_billing_item_handling/index.ts +1 -1
- package/templates/extensions/core.workflows.custom_action/index.ts +1 -2
- package/templates/extensions/extend.workflows.custom_action/index.ts +1 -2
- package/templates/root/custom-objects/{package.json → package.json.mustache} +4 -4
- package/dist/extensibility-dev-tools-alpha.d.ts +0 -199
- package/dist/extensibility-dev-tools-beta.d.ts +0 -199
- package/dist/extensibility-dev-tools-dependencies-alpha.d.ts +0 -51
- package/dist/extensibility-dev-tools-dependencies-beta.d.ts +0 -51
- package/dist/extensibility-dev-tools-dependencies-internal.d.ts +0 -372
- package/dist/extensibility-dev-tools-dependencies-public.d.ts +0 -51
- package/dist/extensibility-dev-tools-internal.d.ts +0 -1722
- package/dist/extensibility-dev-tools-jsonschema-tools-alpha.d.ts +0 -57
- package/dist/extensibility-dev-tools-jsonschema-tools-beta.d.ts +0 -57
- package/dist/extensibility-dev-tools-jsonschema-tools-internal.d.ts +0 -123
- package/dist/extensibility-dev-tools-jsonschema-tools-public.d.ts +0 -57
- package/dist/extensibility-dev-tools-manifest-alpha.d.ts +0 -31
- package/dist/extensibility-dev-tools-manifest-beta.d.ts +0 -31
- package/dist/extensibility-dev-tools-manifest-internal.d.ts +0 -461
- package/dist/extensibility-dev-tools-manifest-public.d.ts +0 -31
- package/dist/extensibility-dev-tools-public.d.ts +0 -199
- package/dist/extensibility-dev-tools-schemas-alpha.d.ts +0 -9
- package/dist/extensibility-dev-tools-schemas-beta.d.ts +0 -9
- package/dist/extensibility-dev-tools-schemas-internal.d.ts +0 -41
- package/dist/extensibility-dev-tools-schemas-public.d.ts +0 -9
- package/dist/extensibility-dev-tools-templates-alpha.d.ts +0 -67
- package/dist/extensibility-dev-tools-templates-beta.d.ts +0 -67
- package/dist/extensibility-dev-tools-templates-internal.d.ts +0 -554
- package/dist/extensibility-dev-tools-templates-public.d.ts +0 -67
- package/dist/extensibility-dev-tools-workspace-alpha.d.ts +0 -51
- package/dist/extensibility-dev-tools-workspace-beta.d.ts +0 -51
- package/dist/extensibility-dev-tools-workspace-internal.d.ts +0 -410
- package/dist/extensibility-dev-tools-workspace-public.d.ts +0 -51
|
@@ -73,8 +73,7 @@ describe('MyDiscountCalculation', () => {
|
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
76
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
77
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
76
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
78
77
|
|
|
79
78
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
80
79
|
interface MyDiscountCalculationConfig extends Record<string, unknown> {}
|
|
@@ -99,32 +98,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
99
98
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
100
99
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
101
100
|
|
|
102
|
-
import
|
|
101
|
+
import MyBalanceApp from './index.js';
|
|
103
102
|
|
|
104
|
-
describe('
|
|
105
|
-
let instance:
|
|
103
|
+
describe('MyBalanceApp', () => {
|
|
104
|
+
let instance: MyBalanceApp;
|
|
106
105
|
|
|
107
106
|
beforeEach(() => {
|
|
108
|
-
instance = new
|
|
107
|
+
instance = new MyBalanceApp();
|
|
109
108
|
});
|
|
110
109
|
|
|
111
110
|
it('should be constructable', () => {
|
|
112
|
-
expect(instance).toBeInstanceOf(
|
|
111
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
113
112
|
});
|
|
114
113
|
});
|
|
115
114
|
`
|
|
116
115
|
},
|
|
117
116
|
{
|
|
118
117
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
119
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
118
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
120
119
|
|
|
121
120
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
122
|
-
interface
|
|
121
|
+
interface MyBalanceAppConfig extends Record<string, unknown> {}
|
|
123
122
|
|
|
124
|
-
export default class
|
|
123
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
125
124
|
computeAppliedCustomerBalance(
|
|
126
125
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
127
|
-
_config:
|
|
126
|
+
_config: MyBalanceAppConfig,
|
|
128
127
|
_context: Context
|
|
129
128
|
) {
|
|
130
129
|
// TODO: implement your customer balance logic here
|
|
@@ -157,7 +156,7 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
157
156
|
},
|
|
158
157
|
{
|
|
159
158
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
160
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
159
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
161
160
|
|
|
162
161
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
163
162
|
interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
|
|
@@ -196,7 +195,7 @@ describe('MyProrations', () => {
|
|
|
196
195
|
},
|
|
197
196
|
{
|
|
198
197
|
path: "extensions/billing.prorations/index.ts",
|
|
199
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
198
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
200
199
|
|
|
201
200
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
202
201
|
interface MyProrationsConfig extends Record<string, unknown> {}
|
|
@@ -237,7 +236,7 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
237
236
|
},
|
|
238
237
|
{
|
|
239
238
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
240
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
239
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
241
240
|
|
|
242
241
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
243
242
|
interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
@@ -487,8 +486,7 @@ describe('MyCustomAction', () => {
|
|
|
487
486
|
},
|
|
488
487
|
{
|
|
489
488
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
490
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
491
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
489
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
492
490
|
|
|
493
491
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
494
492
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -551,8 +549,7 @@ describe('MyCustomAction', () => {
|
|
|
551
549
|
},
|
|
552
550
|
{
|
|
553
551
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
554
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
555
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
552
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
556
553
|
|
|
557
554
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
558
555
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -642,7 +639,7 @@ generated
|
|
|
642
639
|
`
|
|
643
640
|
},
|
|
644
641
|
{
|
|
645
|
-
path: "root/custom-objects/package.json",
|
|
642
|
+
path: "root/custom-objects/package.json.mustache",
|
|
646
643
|
content: `{
|
|
647
644
|
"name": "custom-objects",
|
|
648
645
|
"type": "module",
|
|
@@ -655,12 +652,12 @@ generated
|
|
|
655
652
|
"test": "vitest run"
|
|
656
653
|
},
|
|
657
654
|
"dependencies": {
|
|
658
|
-
"@stripe/extensibility-custom-objects": "
|
|
659
|
-
"@stripe/extensibility-sdk": "
|
|
655
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
656
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
660
657
|
},
|
|
661
658
|
"devDependencies": {
|
|
662
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
663
|
-
"@stripe/extensibility-test-helpers": "
|
|
659
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
660
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
664
661
|
}
|
|
665
662
|
}
|
|
666
663
|
`
|
|
@@ -1017,7 +1014,7 @@ function _devNpmDep(name, version) {
|
|
|
1017
1014
|
var import_extensibility_tool_utils4 = require("@stripe/extensibility-tool-utils");
|
|
1018
1015
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
1019
1016
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
1020
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
1017
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${(0, import_extensibility_tool_utils4._workspaceVersion)(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
1021
1018
|
function _createExtensionEslintConfigFile(params, context) {
|
|
1022
1019
|
const { id, extensionInterfaceId } = params;
|
|
1023
1020
|
const { fs: fs2 } = context;
|
|
@@ -50,8 +50,7 @@ describe('MyDiscountCalculation', () => {
|
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
53
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
54
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
53
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
55
54
|
|
|
56
55
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
57
56
|
interface MyDiscountCalculationConfig extends Record<string, unknown> {}
|
|
@@ -76,32 +75,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
76
75
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
77
76
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
78
77
|
|
|
79
|
-
import
|
|
78
|
+
import MyBalanceApp from './index.js';
|
|
80
79
|
|
|
81
|
-
describe('
|
|
82
|
-
let instance:
|
|
80
|
+
describe('MyBalanceApp', () => {
|
|
81
|
+
let instance: MyBalanceApp;
|
|
83
82
|
|
|
84
83
|
beforeEach(() => {
|
|
85
|
-
instance = new
|
|
84
|
+
instance = new MyBalanceApp();
|
|
86
85
|
});
|
|
87
86
|
|
|
88
87
|
it('should be constructable', () => {
|
|
89
|
-
expect(instance).toBeInstanceOf(
|
|
88
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
90
89
|
});
|
|
91
90
|
});
|
|
92
91
|
`
|
|
93
92
|
},
|
|
94
93
|
{
|
|
95
94
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
96
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
95
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
97
96
|
|
|
98
97
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
99
|
-
interface
|
|
98
|
+
interface MyBalanceAppConfig extends Record<string, unknown> {}
|
|
100
99
|
|
|
101
|
-
export default class
|
|
100
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
102
101
|
computeAppliedCustomerBalance(
|
|
103
102
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
104
|
-
_config:
|
|
103
|
+
_config: MyBalanceAppConfig,
|
|
105
104
|
_context: Context
|
|
106
105
|
) {
|
|
107
106
|
// TODO: implement your customer balance logic here
|
|
@@ -134,7 +133,7 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
134
133
|
},
|
|
135
134
|
{
|
|
136
135
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
137
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
136
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
138
137
|
|
|
139
138
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
140
139
|
interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
|
|
@@ -173,7 +172,7 @@ describe('MyProrations', () => {
|
|
|
173
172
|
},
|
|
174
173
|
{
|
|
175
174
|
path: "extensions/billing.prorations/index.ts",
|
|
176
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
175
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
177
176
|
|
|
178
177
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
179
178
|
interface MyProrationsConfig extends Record<string, unknown> {}
|
|
@@ -214,7 +213,7 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
214
213
|
},
|
|
215
214
|
{
|
|
216
215
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
217
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
216
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
218
217
|
|
|
219
218
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
220
219
|
interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
@@ -464,8 +463,7 @@ describe('MyCustomAction', () => {
|
|
|
464
463
|
},
|
|
465
464
|
{
|
|
466
465
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
467
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
468
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
466
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
469
467
|
|
|
470
468
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
471
469
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -528,8 +526,7 @@ describe('MyCustomAction', () => {
|
|
|
528
526
|
},
|
|
529
527
|
{
|
|
530
528
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
531
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
532
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
529
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
533
530
|
|
|
534
531
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
535
532
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -619,7 +616,7 @@ generated
|
|
|
619
616
|
`
|
|
620
617
|
},
|
|
621
618
|
{
|
|
622
|
-
path: "root/custom-objects/package.json",
|
|
619
|
+
path: "root/custom-objects/package.json.mustache",
|
|
623
620
|
content: `{
|
|
624
621
|
"name": "custom-objects",
|
|
625
622
|
"type": "module",
|
|
@@ -632,12 +629,12 @@ generated
|
|
|
632
629
|
"test": "vitest run"
|
|
633
630
|
},
|
|
634
631
|
"dependencies": {
|
|
635
|
-
"@stripe/extensibility-custom-objects": "
|
|
636
|
-
"@stripe/extensibility-sdk": "
|
|
632
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
633
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
637
634
|
},
|
|
638
635
|
"devDependencies": {
|
|
639
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
640
|
-
"@stripe/extensibility-test-helpers": "
|
|
636
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
637
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
641
638
|
}
|
|
642
639
|
}
|
|
643
640
|
`
|
|
@@ -994,7 +991,7 @@ function _devNpmDep(name, version) {
|
|
|
994
991
|
import { _workspaceVersion } from "@stripe/extensibility-tool-utils";
|
|
995
992
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
996
993
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
997
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
994
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${_workspaceVersion(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
998
995
|
function _createExtensionEslintConfigFile(params, context) {
|
|
999
996
|
const { id, extensionInterfaceId } = params;
|
|
1000
997
|
const { fs: fs2 } = context;
|
|
@@ -50,7 +50,7 @@ export interface _StripeCliPluginDependency {
|
|
|
50
50
|
* A dependency that the workspace needs: npm runtime, npm dev, or Stripe CLI plugin.
|
|
51
51
|
* @internal
|
|
52
52
|
*/
|
|
53
|
-
export type _Dependency =
|
|
53
|
+
export type _Dependency = _DevNpmDependency | _NpmDependency | _StripeCliPluginDependency;
|
|
54
54
|
/**
|
|
55
55
|
* Create a runtime npm dependency descriptor.
|
|
56
56
|
* @internal
|
|
@@ -96,7 +96,7 @@ export interface _ConflictResult {
|
|
|
96
96
|
* The action to take for a dependency: add new, update existing, no-op, or flag a conflict.
|
|
97
97
|
* @internal
|
|
98
98
|
*/
|
|
99
|
-
export type _DependencyAction = 'add' | '
|
|
99
|
+
export type _DependencyAction = 'add' | 'already-satisfied' | 'conflict' | 'update';
|
|
100
100
|
/**
|
|
101
101
|
* A pending dependency change accumulated by the dependency manager before commit.
|
|
102
102
|
* @internal
|
|
@@ -147,7 +147,7 @@ export interface _CommitResult {
|
|
|
147
147
|
* Package manager detected in the workspace.
|
|
148
148
|
* @internal
|
|
149
149
|
*/
|
|
150
|
-
export type _PackageManager = '
|
|
150
|
+
export type _PackageManager = 'npm' | 'pnpm' | 'yarn';
|
|
151
151
|
/**
|
|
152
152
|
* Detect the package manager used in the workspace by looking for lockfiles.
|
|
153
153
|
* @internal
|
|
@@ -197,16 +197,16 @@ export declare class _NpmDependencyHandler implements _DependencyHandler<_NpmDep
|
|
|
197
197
|
private get dependencyKey();
|
|
198
198
|
private get dependencyLabel();
|
|
199
199
|
/** Check whether the npm dependency is already present in package.json. */
|
|
200
|
-
check(dep:
|
|
200
|
+
check(dep: _DevNpmDependency | _NpmDependency): Promise<_CheckResult>;
|
|
201
201
|
/** Check whether the requested version conflicts with the currently installed version. */
|
|
202
|
-
checkConflict(dep:
|
|
202
|
+
checkConflict(dep: _DevNpmDependency | _NpmDependency): Promise<_ConflictResult>;
|
|
203
203
|
/** Add or update the npm dependency in package.json. */
|
|
204
|
-
add(dep:
|
|
204
|
+
add(dep: _DevNpmDependency | _NpmDependency): Promise<{
|
|
205
205
|
action: 'add' | 'update';
|
|
206
206
|
message: string;
|
|
207
207
|
}>;
|
|
208
208
|
/** Run the package manager install command in the working directory. */
|
|
209
|
-
install(_deps: (
|
|
209
|
+
install(_deps: (_DevNpmDependency | _NpmDependency)[]): Promise<void>;
|
|
210
210
|
private versionsCompatible;
|
|
211
211
|
private extractMajorVersion;
|
|
212
212
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -91,8 +91,7 @@ describe('MyDiscountCalculation', () => {
|
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
94
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
95
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
94
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
96
95
|
|
|
97
96
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
98
97
|
interface MyDiscountCalculationConfig extends Record<string, unknown> {}
|
|
@@ -117,32 +116,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
117
116
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
118
117
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
119
118
|
|
|
120
|
-
import
|
|
119
|
+
import MyBalanceApp from './index.js';
|
|
121
120
|
|
|
122
|
-
describe('
|
|
123
|
-
let instance:
|
|
121
|
+
describe('MyBalanceApp', () => {
|
|
122
|
+
let instance: MyBalanceApp;
|
|
124
123
|
|
|
125
124
|
beforeEach(() => {
|
|
126
|
-
instance = new
|
|
125
|
+
instance = new MyBalanceApp();
|
|
127
126
|
});
|
|
128
127
|
|
|
129
128
|
it('should be constructable', () => {
|
|
130
|
-
expect(instance).toBeInstanceOf(
|
|
129
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
131
130
|
});
|
|
132
131
|
});
|
|
133
132
|
`
|
|
134
133
|
},
|
|
135
134
|
{
|
|
136
135
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
137
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
136
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
138
137
|
|
|
139
138
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
140
|
-
interface
|
|
139
|
+
interface MyBalanceAppConfig extends Record<string, unknown> {}
|
|
141
140
|
|
|
142
|
-
export default class
|
|
141
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
143
142
|
computeAppliedCustomerBalance(
|
|
144
143
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
145
|
-
_config:
|
|
144
|
+
_config: MyBalanceAppConfig,
|
|
146
145
|
_context: Context
|
|
147
146
|
) {
|
|
148
147
|
// TODO: implement your customer balance logic here
|
|
@@ -175,7 +174,7 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
175
174
|
},
|
|
176
175
|
{
|
|
177
176
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
178
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
177
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
179
178
|
|
|
180
179
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
181
180
|
interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
|
|
@@ -214,7 +213,7 @@ describe('MyProrations', () => {
|
|
|
214
213
|
},
|
|
215
214
|
{
|
|
216
215
|
path: "extensions/billing.prorations/index.ts",
|
|
217
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
216
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
218
217
|
|
|
219
218
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
220
219
|
interface MyProrationsConfig extends Record<string, unknown> {}
|
|
@@ -255,7 +254,7 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
255
254
|
},
|
|
256
255
|
{
|
|
257
256
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
258
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
257
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
259
258
|
|
|
260
259
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
261
260
|
interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
@@ -505,8 +504,7 @@ describe('MyCustomAction', () => {
|
|
|
505
504
|
},
|
|
506
505
|
{
|
|
507
506
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
508
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
509
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
507
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
510
508
|
|
|
511
509
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
512
510
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -569,8 +567,7 @@ describe('MyCustomAction', () => {
|
|
|
569
567
|
},
|
|
570
568
|
{
|
|
571
569
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
572
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
573
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
570
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
574
571
|
|
|
575
572
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
576
573
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -660,7 +657,7 @@ generated
|
|
|
660
657
|
`
|
|
661
658
|
},
|
|
662
659
|
{
|
|
663
|
-
path: "root/custom-objects/package.json",
|
|
660
|
+
path: "root/custom-objects/package.json.mustache",
|
|
664
661
|
content: `{
|
|
665
662
|
"name": "custom-objects",
|
|
666
663
|
"type": "module",
|
|
@@ -673,12 +670,12 @@ generated
|
|
|
673
670
|
"test": "vitest run"
|
|
674
671
|
},
|
|
675
672
|
"dependencies": {
|
|
676
|
-
"@stripe/extensibility-custom-objects": "
|
|
677
|
-
"@stripe/extensibility-sdk": "
|
|
673
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
674
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
678
675
|
},
|
|
679
676
|
"devDependencies": {
|
|
680
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
681
|
-
"@stripe/extensibility-test-helpers": "
|
|
677
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
678
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
682
679
|
}
|
|
683
680
|
}
|
|
684
681
|
`
|
|
@@ -2199,7 +2196,7 @@ var _DependencyManager = class {
|
|
|
2199
2196
|
var import_extensibility_tool_utils7 = require("@stripe/extensibility-tool-utils");
|
|
2200
2197
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
2201
2198
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
2202
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
2199
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${(0, import_extensibility_tool_utils7._workspaceVersion)(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
2203
2200
|
function _createExtensionEslintConfigFile(params, context) {
|
|
2204
2201
|
const { id, extensionInterfaceId } = params;
|
|
2205
2202
|
const { fs: fs2 } = context;
|
|
@@ -2719,7 +2716,20 @@ var _rootWorkspaceTemplate = {
|
|
|
2719
2716
|
},
|
|
2720
2717
|
{
|
|
2721
2718
|
path: "custom-objects/package.json",
|
|
2722
|
-
content: fs2.
|
|
2719
|
+
content: fs2.mustache(
|
|
2720
|
+
{
|
|
2721
|
+
customObjectsVersion: (0, import_extensibility_tool_utils8._workspaceVersion)(
|
|
2722
|
+
"@stripe/extensibility-custom-objects"
|
|
2723
|
+
),
|
|
2724
|
+
sdkVersion: (0, import_extensibility_tool_utils8._workspaceVersion)("@stripe/extensibility-sdk"),
|
|
2725
|
+
customObjectsToolsVersion: (0, import_extensibility_tool_utils8._workspaceVersion)(
|
|
2726
|
+
"@stripe/extensibility-custom-objects-tools"
|
|
2727
|
+
),
|
|
2728
|
+
testHelpersVersion: (0, import_extensibility_tool_utils8._workspaceVersion)("@stripe/extensibility-test-helpers")
|
|
2729
|
+
},
|
|
2730
|
+
"custom-objects",
|
|
2731
|
+
"package.json.mustache"
|
|
2732
|
+
),
|
|
2723
2733
|
precious: true
|
|
2724
2734
|
},
|
|
2725
2735
|
{
|
package/dist/index.js
CHANGED
|
@@ -27,8 +27,7 @@ describe('MyDiscountCalculation', () => {
|
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
30
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
31
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
30
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
32
31
|
|
|
33
32
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
34
33
|
interface MyDiscountCalculationConfig extends Record<string, unknown> {}
|
|
@@ -53,32 +52,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
53
52
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
54
53
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
55
54
|
|
|
56
|
-
import
|
|
55
|
+
import MyBalanceApp from './index.js';
|
|
57
56
|
|
|
58
|
-
describe('
|
|
59
|
-
let instance:
|
|
57
|
+
describe('MyBalanceApp', () => {
|
|
58
|
+
let instance: MyBalanceApp;
|
|
60
59
|
|
|
61
60
|
beforeEach(() => {
|
|
62
|
-
instance = new
|
|
61
|
+
instance = new MyBalanceApp();
|
|
63
62
|
});
|
|
64
63
|
|
|
65
64
|
it('should be constructable', () => {
|
|
66
|
-
expect(instance).toBeInstanceOf(
|
|
65
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
67
66
|
});
|
|
68
67
|
});
|
|
69
68
|
`
|
|
70
69
|
},
|
|
71
70
|
{
|
|
72
71
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
73
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
72
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
74
73
|
|
|
75
74
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
76
|
-
interface
|
|
75
|
+
interface MyBalanceAppConfig extends Record<string, unknown> {}
|
|
77
76
|
|
|
78
|
-
export default class
|
|
77
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
79
78
|
computeAppliedCustomerBalance(
|
|
80
79
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
81
|
-
_config:
|
|
80
|
+
_config: MyBalanceAppConfig,
|
|
82
81
|
_context: Context
|
|
83
82
|
) {
|
|
84
83
|
// TODO: implement your customer balance logic here
|
|
@@ -111,7 +110,7 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
111
110
|
},
|
|
112
111
|
{
|
|
113
112
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
114
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
113
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
115
114
|
|
|
116
115
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
117
116
|
interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
|
|
@@ -150,7 +149,7 @@ describe('MyProrations', () => {
|
|
|
150
149
|
},
|
|
151
150
|
{
|
|
152
151
|
path: "extensions/billing.prorations/index.ts",
|
|
153
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
152
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
154
153
|
|
|
155
154
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
156
155
|
interface MyProrationsConfig extends Record<string, unknown> {}
|
|
@@ -191,7 +190,7 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
191
190
|
},
|
|
192
191
|
{
|
|
193
192
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
194
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
193
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
195
194
|
|
|
196
195
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
197
196
|
interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
@@ -441,8 +440,7 @@ describe('MyCustomAction', () => {
|
|
|
441
440
|
},
|
|
442
441
|
{
|
|
443
442
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
444
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
445
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
443
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
446
444
|
|
|
447
445
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
448
446
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -505,8 +503,7 @@ describe('MyCustomAction', () => {
|
|
|
505
503
|
},
|
|
506
504
|
{
|
|
507
505
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
508
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
509
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
506
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
510
507
|
|
|
511
508
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
512
509
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -596,7 +593,7 @@ generated
|
|
|
596
593
|
`
|
|
597
594
|
},
|
|
598
595
|
{
|
|
599
|
-
path: "root/custom-objects/package.json",
|
|
596
|
+
path: "root/custom-objects/package.json.mustache",
|
|
600
597
|
content: `{
|
|
601
598
|
"name": "custom-objects",
|
|
602
599
|
"type": "module",
|
|
@@ -609,12 +606,12 @@ generated
|
|
|
609
606
|
"test": "vitest run"
|
|
610
607
|
},
|
|
611
608
|
"dependencies": {
|
|
612
|
-
"@stripe/extensibility-custom-objects": "
|
|
613
|
-
"@stripe/extensibility-sdk": "
|
|
609
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
610
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
614
611
|
},
|
|
615
612
|
"devDependencies": {
|
|
616
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
617
|
-
"@stripe/extensibility-test-helpers": "
|
|
613
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
614
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
618
615
|
}
|
|
619
616
|
}
|
|
620
617
|
`
|
|
@@ -2139,7 +2136,7 @@ var _DependencyManager = class {
|
|
|
2139
2136
|
import { _workspaceVersion } from "@stripe/extensibility-tool-utils";
|
|
2140
2137
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
2141
2138
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
2142
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
2139
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${_workspaceVersion(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
2143
2140
|
function _createExtensionEslintConfigFile(params, context) {
|
|
2144
2141
|
const { id, extensionInterfaceId } = params;
|
|
2145
2142
|
const { fs: fs2 } = context;
|
|
@@ -2659,7 +2656,20 @@ var _rootWorkspaceTemplate = {
|
|
|
2659
2656
|
},
|
|
2660
2657
|
{
|
|
2661
2658
|
path: "custom-objects/package.json",
|
|
2662
|
-
content: fs2.
|
|
2659
|
+
content: fs2.mustache(
|
|
2660
|
+
{
|
|
2661
|
+
customObjectsVersion: _workspaceVersion2(
|
|
2662
|
+
"@stripe/extensibility-custom-objects"
|
|
2663
|
+
),
|
|
2664
|
+
sdkVersion: _workspaceVersion2("@stripe/extensibility-sdk"),
|
|
2665
|
+
customObjectsToolsVersion: _workspaceVersion2(
|
|
2666
|
+
"@stripe/extensibility-custom-objects-tools"
|
|
2667
|
+
),
|
|
2668
|
+
testHelpersVersion: _workspaceVersion2("@stripe/extensibility-test-helpers")
|
|
2669
|
+
},
|
|
2670
|
+
"custom-objects",
|
|
2671
|
+
"package.json.mustache"
|
|
2672
|
+
),
|
|
2663
2673
|
precious: true
|
|
2664
2674
|
},
|
|
2665
2675
|
{
|
|
@@ -39,8 +39,8 @@ export interface _CustomObjectDefinitionYaml {
|
|
|
39
39
|
id: string;
|
|
40
40
|
/** Specification describing the type and source file for the definition. */
|
|
41
41
|
specification: {
|
|
42
|
-
type: string;
|
|
43
42
|
content: string;
|
|
43
|
+
type: string;
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
@@ -119,8 +119,8 @@ export interface _ExtensionConfig {
|
|
|
119
119
|
script_entry_point?: string;
|
|
120
120
|
/** Inline script definition (type + content path). */
|
|
121
121
|
script?: {
|
|
122
|
-
type: string;
|
|
123
122
|
content: string;
|
|
123
|
+
type: string;
|
|
124
124
|
};
|
|
125
125
|
/** Required permissions for the extension. */
|
|
126
126
|
permissions: string[];
|
|
@@ -130,16 +130,11 @@ export interface _ExtensionConfig {
|
|
|
130
130
|
configuration?: _ExtensionConfiguration;
|
|
131
131
|
/** Remote function endpoints for the extension. */
|
|
132
132
|
endpoints?: {
|
|
133
|
-
/** The unique identifier for the endpoint. */
|
|
134
133
|
id: string;
|
|
135
|
-
/** The type of endpoint. */
|
|
136
|
-
type: 'remote_function' | 'custom_http';
|
|
137
|
-
/** Configuration for the live environment. */
|
|
138
134
|
live?: _EndpointDefinition;
|
|
139
|
-
/** Configuration for the managed sandbox environment. */
|
|
140
135
|
managed_sandbox?: _EndpointDefinition;
|
|
141
|
-
/** Configuration for the test environment. */
|
|
142
136
|
test?: _EndpointDefinition;
|
|
137
|
+
type: 'custom_http' | 'remote_function';
|
|
143
138
|
}[];
|
|
144
139
|
}
|
|
145
140
|
/**
|