@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
|
@@ -6,7 +6,7 @@ export type { _OverwriteDecision };
|
|
|
6
6
|
*/
|
|
7
7
|
export interface DiffLine {
|
|
8
8
|
/** The type of change this line represents */
|
|
9
|
-
type: 'add' | '
|
|
9
|
+
type: 'add' | 'context' | 'header' | 'remove';
|
|
10
10
|
/** The text content of the line (including +/- prefix from diff) */
|
|
11
11
|
text: string;
|
|
12
12
|
/** Line number in the old file (for remove/context lines) */
|
|
@@ -54,5 +54,5 @@ export interface ViewerState {
|
|
|
54
54
|
* Internal result from keypress handler.
|
|
55
55
|
* @internal
|
|
56
56
|
*/
|
|
57
|
-
export type KeypressResult = 'continue'
|
|
57
|
+
export type KeypressResult = _OverwriteDecision | 'continue';
|
|
58
58
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -3,9 +3,9 @@ import type { _GeneratedFile, _TemplateContext } from '../types.js';
|
|
|
3
3
|
/** @internal */
|
|
4
4
|
export declare const LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
5
5
|
/** @internal */
|
|
6
|
-
export declare const LANGUAGE_SERVER_PACKAGE_VERSION
|
|
6
|
+
export declare const LANGUAGE_SERVER_PACKAGE_VERSION: string;
|
|
7
7
|
/** @internal */
|
|
8
|
-
export type _ExecutionProfile = '
|
|
8
|
+
export type _ExecutionProfile = 'egress' | 'restricted';
|
|
9
9
|
/** @internal */
|
|
10
10
|
export interface _BaseTemplateParams extends _ExtensionParams {
|
|
11
11
|
extensionInterfaceId: string;
|
|
@@ -15,9 +15,7 @@ export interface _BaseTemplateParams extends _ExtensionParams {
|
|
|
15
15
|
* Generate the ESLint config file for an extension workspace.
|
|
16
16
|
* @internal
|
|
17
17
|
*/
|
|
18
|
-
export declare function _createExtensionEslintConfigFile(params: Pick<_ExtensionParams, 'id'
|
|
19
|
-
extensionInterfaceId: string;
|
|
20
|
-
}, context: _TemplateContext): _GeneratedFile;
|
|
18
|
+
export declare function _createExtensionEslintConfigFile(params: { extensionInterfaceId: string } & Pick<_ExtensionParams, 'id'>, context: _TemplateContext): _GeneratedFile;
|
|
21
19
|
/** @internal */
|
|
22
20
|
export declare function _createBaseOutput(params: _BaseTemplateParams, context: _TemplateContext): _ExtensionTemplateOutput;
|
|
23
21
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMpE,gBAAgB;AAChB,eAAO,MAAM,4BAA4B,0CAA0C,CAAC;AAEpF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMpE,gBAAgB;AAChB,eAAO,MAAM,4BAA4B,0CAA0C,CAAC;AAEpF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,QAAwD,CAAC;AAErG,gBAAgB;AAChB,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAExD,gBAAgB;AAChB,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,iBAAiB,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GAAG;IAAE,oBAAoB,EAAE,MAAM,CAAA;CAAE,EACvE,OAAO,EAAE,gBAAgB,GACxB,cAAc,CAahB;AAED,gBAAgB;AAChB,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,gBAAgB,GACxB,wBAAwB,CA2C1B"}
|
|
@@ -13,15 +13,11 @@ import type { _Template, _TemplateOutput } from '../types.js';
|
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
15
|
export type _PostGenerationHook = {
|
|
16
|
-
/** Script name to run via `pnpm run <script>` */
|
|
17
|
-
script: string;
|
|
18
|
-
/** Optional description of what this hook does */
|
|
19
16
|
description?: string;
|
|
20
|
-
} | {
|
|
21
|
-
/** Command to run via `pnpm exec <command>` */
|
|
22
17
|
exec: string;
|
|
23
|
-
|
|
18
|
+
} | {
|
|
24
19
|
description?: string;
|
|
20
|
+
script: string;
|
|
25
21
|
};
|
|
26
22
|
/**
|
|
27
23
|
* Parameters for extension template generation
|
|
@@ -44,10 +40,8 @@ export interface _ExtensionTemplateOutput extends _TemplateOutput {
|
|
|
44
40
|
methods: Record<string, unknown>;
|
|
45
41
|
/** Dependencies required by the extension */
|
|
46
42
|
dependencies?: {
|
|
47
|
-
/** Regular dependencies (added to dependencies field) */
|
|
48
|
-
runtime?: _NpmDependency[];
|
|
49
|
-
/** Development dependencies (added to devDependencies field) */
|
|
50
43
|
dev?: _DevNpmDependency[];
|
|
44
|
+
runtime?: _NpmDependency[];
|
|
51
45
|
};
|
|
52
46
|
/** Post-generation hooks to run after files are generated and dependencies installed */
|
|
53
47
|
postGenerationHooks?: _PostGenerationHook[];
|
|
@@ -9,7 +9,7 @@ import type { _GeneratedFile } from './types.js';
|
|
|
9
9
|
* User decision when prompted about overwriting a file
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
|
-
export type _OverwriteDecision = '
|
|
12
|
+
export type _OverwriteDecision = 'abort' | 'overwrite-all' | 'overwrite' | 'skip';
|
|
13
13
|
/**
|
|
14
14
|
* Callback function for prompting about file overwrites
|
|
15
15
|
* @param path - Relative path to the file that would be overwritten
|
|
@@ -27,7 +27,7 @@ export type _OverwritePromptCallback = (path: string, cwd: string, newContent: s
|
|
|
27
27
|
* - function: Prompt before overwriting each file (interactive ask mode)
|
|
28
28
|
* @internal
|
|
29
29
|
*/
|
|
30
|
-
export type _WriteMode =
|
|
30
|
+
export type _WriteMode = _OverwritePromptCallback | 'abort-if-existing' | 'if-missing' | 'overwrite-all';
|
|
31
31
|
/**
|
|
32
32
|
* Options for writing generated files
|
|
33
33
|
* @internal
|
package/dist/templates/index.cjs
CHANGED
|
@@ -75,8 +75,7 @@ describe('MyDiscountCalculation', () => {
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
78
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
79
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
78
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
80
79
|
|
|
81
80
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
82
81
|
interface MyDiscountCalculationConfig extends Record<string, unknown> {}
|
|
@@ -101,32 +100,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
101
100
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
102
101
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
103
102
|
|
|
104
|
-
import
|
|
103
|
+
import MyBalanceApp from './index.js';
|
|
105
104
|
|
|
106
|
-
describe('
|
|
107
|
-
let instance:
|
|
105
|
+
describe('MyBalanceApp', () => {
|
|
106
|
+
let instance: MyBalanceApp;
|
|
108
107
|
|
|
109
108
|
beforeEach(() => {
|
|
110
|
-
instance = new
|
|
109
|
+
instance = new MyBalanceApp();
|
|
111
110
|
});
|
|
112
111
|
|
|
113
112
|
it('should be constructable', () => {
|
|
114
|
-
expect(instance).toBeInstanceOf(
|
|
113
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
115
114
|
});
|
|
116
115
|
});
|
|
117
116
|
`
|
|
118
117
|
},
|
|
119
118
|
{
|
|
120
119
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
121
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
120
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
122
121
|
|
|
123
122
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
124
|
-
interface
|
|
123
|
+
interface MyBalanceAppConfig extends Record<string, unknown> {}
|
|
125
124
|
|
|
126
|
-
export default class
|
|
125
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
127
126
|
computeAppliedCustomerBalance(
|
|
128
127
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
129
|
-
_config:
|
|
128
|
+
_config: MyBalanceAppConfig,
|
|
130
129
|
_context: Context
|
|
131
130
|
) {
|
|
132
131
|
// TODO: implement your customer balance logic here
|
|
@@ -159,7 +158,7 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
159
158
|
},
|
|
160
159
|
{
|
|
161
160
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
162
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
161
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
163
162
|
|
|
164
163
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
165
164
|
interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
|
|
@@ -198,7 +197,7 @@ describe('MyProrations', () => {
|
|
|
198
197
|
},
|
|
199
198
|
{
|
|
200
199
|
path: "extensions/billing.prorations/index.ts",
|
|
201
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
200
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
202
201
|
|
|
203
202
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
204
203
|
interface MyProrationsConfig extends Record<string, unknown> {}
|
|
@@ -239,7 +238,7 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
239
238
|
},
|
|
240
239
|
{
|
|
241
240
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
242
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
241
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
243
242
|
|
|
244
243
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
245
244
|
interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
@@ -489,8 +488,7 @@ describe('MyCustomAction', () => {
|
|
|
489
488
|
},
|
|
490
489
|
{
|
|
491
490
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
492
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
493
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
491
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
494
492
|
|
|
495
493
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
496
494
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -553,8 +551,7 @@ describe('MyCustomAction', () => {
|
|
|
553
551
|
},
|
|
554
552
|
{
|
|
555
553
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
556
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
557
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
554
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
558
555
|
|
|
559
556
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
560
557
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -644,7 +641,7 @@ generated
|
|
|
644
641
|
`
|
|
645
642
|
},
|
|
646
643
|
{
|
|
647
|
-
path: "root/custom-objects/package.json",
|
|
644
|
+
path: "root/custom-objects/package.json.mustache",
|
|
648
645
|
content: `{
|
|
649
646
|
"name": "custom-objects",
|
|
650
647
|
"type": "module",
|
|
@@ -657,12 +654,12 @@ generated
|
|
|
657
654
|
"test": "vitest run"
|
|
658
655
|
},
|
|
659
656
|
"dependencies": {
|
|
660
|
-
"@stripe/extensibility-custom-objects": "
|
|
661
|
-
"@stripe/extensibility-sdk": "
|
|
657
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
658
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
662
659
|
},
|
|
663
660
|
"devDependencies": {
|
|
664
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
665
|
-
"@stripe/extensibility-test-helpers": "
|
|
661
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
662
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
666
663
|
}
|
|
667
664
|
}
|
|
668
665
|
`
|
|
@@ -1647,7 +1644,7 @@ function _devNpmDep(name, version) {
|
|
|
1647
1644
|
var import_extensibility_tool_utils7 = require("@stripe/extensibility-tool-utils");
|
|
1648
1645
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
1649
1646
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
1650
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
1647
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${(0, import_extensibility_tool_utils7._workspaceVersion)(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
1651
1648
|
function _createExtensionEslintConfigFile(params, context) {
|
|
1652
1649
|
const { id, extensionInterfaceId } = params;
|
|
1653
1650
|
const { fs: fs2 } = context;
|
|
@@ -2167,7 +2164,20 @@ var _rootWorkspaceTemplate = {
|
|
|
2167
2164
|
},
|
|
2168
2165
|
{
|
|
2169
2166
|
path: "custom-objects/package.json",
|
|
2170
|
-
content: fs2.
|
|
2167
|
+
content: fs2.mustache(
|
|
2168
|
+
{
|
|
2169
|
+
customObjectsVersion: (0, import_extensibility_tool_utils8._workspaceVersion)(
|
|
2170
|
+
"@stripe/extensibility-custom-objects"
|
|
2171
|
+
),
|
|
2172
|
+
sdkVersion: (0, import_extensibility_tool_utils8._workspaceVersion)("@stripe/extensibility-sdk"),
|
|
2173
|
+
customObjectsToolsVersion: (0, import_extensibility_tool_utils8._workspaceVersion)(
|
|
2174
|
+
"@stripe/extensibility-custom-objects-tools"
|
|
2175
|
+
),
|
|
2176
|
+
testHelpersVersion: (0, import_extensibility_tool_utils8._workspaceVersion)("@stripe/extensibility-test-helpers")
|
|
2177
|
+
},
|
|
2178
|
+
"custom-objects",
|
|
2179
|
+
"package.json.mustache"
|
|
2180
|
+
),
|
|
2171
2181
|
precious: true
|
|
2172
2182
|
},
|
|
2173
2183
|
{
|
package/dist/templates/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
|
`
|
|
@@ -1603,7 +1600,7 @@ function _devNpmDep(name, version) {
|
|
|
1603
1600
|
import { _workspaceVersion } from "@stripe/extensibility-tool-utils";
|
|
1604
1601
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
1605
1602
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
1606
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
1603
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${_workspaceVersion(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
1607
1604
|
function _createExtensionEslintConfigFile(params, context) {
|
|
1608
1605
|
const { id, extensionInterfaceId } = params;
|
|
1609
1606
|
const { fs: fs2 } = context;
|
|
@@ -2123,7 +2120,20 @@ var _rootWorkspaceTemplate = {
|
|
|
2123
2120
|
},
|
|
2124
2121
|
{
|
|
2125
2122
|
path: "custom-objects/package.json",
|
|
2126
|
-
content: fs2.
|
|
2123
|
+
content: fs2.mustache(
|
|
2124
|
+
{
|
|
2125
|
+
customObjectsVersion: _workspaceVersion2(
|
|
2126
|
+
"@stripe/extensibility-custom-objects"
|
|
2127
|
+
),
|
|
2128
|
+
sdkVersion: _workspaceVersion2("@stripe/extensibility-sdk"),
|
|
2129
|
+
customObjectsToolsVersion: _workspaceVersion2(
|
|
2130
|
+
"@stripe/extensibility-custom-objects-tools"
|
|
2131
|
+
),
|
|
2132
|
+
testHelpersVersion: _workspaceVersion2("@stripe/extensibility-test-helpers")
|
|
2133
|
+
},
|
|
2134
|
+
"custom-objects",
|
|
2135
|
+
"package.json.mustache"
|
|
2136
|
+
),
|
|
2127
2137
|
precious: true
|
|
2128
2138
|
},
|
|
2129
2139
|
{
|
|
@@ -30,8 +30,8 @@ export interface _RootWorkspaceParams extends Record<string, unknown> {
|
|
|
30
30
|
export interface _RootWorkspaceOutput extends _TemplateOutput {
|
|
31
31
|
/** Dependencies to install after file generation. */
|
|
32
32
|
dependencies?: {
|
|
33
|
-
runtime?: _NpmDependency[];
|
|
34
33
|
dev?: _DevNpmDependency[];
|
|
34
|
+
runtime?: _NpmDependency[];
|
|
35
35
|
};
|
|
36
36
|
/** Hooks to run after dependencies are installed. */
|
|
37
37
|
postGenerationHooks?: _PostGenerationHook[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/root/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAoB,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAIhF,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAMhE,gBAAgB;AAChB,eAAO,MAAM,wCAAwC,wCACd,CAAC;AAExC,gBAAgB;AAChB,eAAO,MAAM,mCAAmC,QAAoE,CAAC;AAErH;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnE,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,qDAAqD;IACrD,YAAY,CAAC,EAAE;QACb,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;QAC3B,GAAG,CAAC,EAAE,iBAAiB,EAAE,CAAC;KAC3B,CAAC;IACF,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC7C;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,CAC5C,oBAAoB,EACpB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/root/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAoB,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAIhF,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAMhE,gBAAgB;AAChB,eAAO,MAAM,wCAAwC,wCACd,CAAC;AAExC,gBAAgB;AAChB,eAAO,MAAM,mCAAmC,QAAoE,CAAC;AAErH;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnE,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,qDAAqD;IACrD,YAAY,CAAC,EAAE;QACb,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;QAC3B,GAAG,CAAC,EAAE,iBAAiB,EAAE,CAAC;KAC3B,CAAC;IACF,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC7C;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,CAC5C,oBAAoB,EACpB,oBAAoB,CAmIrB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,oEAGW,CAAC"}
|