@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
package/dist/workspace/index.cjs
CHANGED
|
@@ -1191,8 +1191,7 @@ describe('MyDiscountCalculation', () => {
|
|
|
1191
1191
|
},
|
|
1192
1192
|
{
|
|
1193
1193
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
1194
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
1195
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1194
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1196
1195
|
|
|
1197
1196
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1198
1197
|
interface MyDiscountCalculationConfig extends Record<string, unknown> {}
|
|
@@ -1217,32 +1216,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
1217
1216
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
1218
1217
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
1219
1218
|
|
|
1220
|
-
import
|
|
1219
|
+
import MyBalanceApp from './index.js';
|
|
1221
1220
|
|
|
1222
|
-
describe('
|
|
1223
|
-
let instance:
|
|
1221
|
+
describe('MyBalanceApp', () => {
|
|
1222
|
+
let instance: MyBalanceApp;
|
|
1224
1223
|
|
|
1225
1224
|
beforeEach(() => {
|
|
1226
|
-
instance = new
|
|
1225
|
+
instance = new MyBalanceApp();
|
|
1227
1226
|
});
|
|
1228
1227
|
|
|
1229
1228
|
it('should be constructable', () => {
|
|
1230
|
-
expect(instance).toBeInstanceOf(
|
|
1229
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
1231
1230
|
});
|
|
1232
1231
|
});
|
|
1233
1232
|
`
|
|
1234
1233
|
},
|
|
1235
1234
|
{
|
|
1236
1235
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
1237
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1236
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1238
1237
|
|
|
1239
1238
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1240
|
-
interface
|
|
1239
|
+
interface MyBalanceAppConfig extends Record<string, unknown> {}
|
|
1241
1240
|
|
|
1242
|
-
export default class
|
|
1241
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
1243
1242
|
computeAppliedCustomerBalance(
|
|
1244
1243
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
1245
|
-
_config:
|
|
1244
|
+
_config: MyBalanceAppConfig,
|
|
1246
1245
|
_context: Context
|
|
1247
1246
|
) {
|
|
1248
1247
|
// TODO: implement your customer balance logic here
|
|
@@ -1275,7 +1274,7 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
1275
1274
|
},
|
|
1276
1275
|
{
|
|
1277
1276
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
1278
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1277
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1279
1278
|
|
|
1280
1279
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1281
1280
|
interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
|
|
@@ -1314,7 +1313,7 @@ describe('MyProrations', () => {
|
|
|
1314
1313
|
},
|
|
1315
1314
|
{
|
|
1316
1315
|
path: "extensions/billing.prorations/index.ts",
|
|
1317
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1316
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1318
1317
|
|
|
1319
1318
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1320
1319
|
interface MyProrationsConfig extends Record<string, unknown> {}
|
|
@@ -1355,7 +1354,7 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
1355
1354
|
},
|
|
1356
1355
|
{
|
|
1357
1356
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
1358
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1357
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1359
1358
|
|
|
1360
1359
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1361
1360
|
interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
@@ -1605,8 +1604,7 @@ describe('MyCustomAction', () => {
|
|
|
1605
1604
|
},
|
|
1606
1605
|
{
|
|
1607
1606
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
1608
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
1609
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1607
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
1610
1608
|
|
|
1611
1609
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1612
1610
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -1669,8 +1667,7 @@ describe('MyCustomAction', () => {
|
|
|
1669
1667
|
},
|
|
1670
1668
|
{
|
|
1671
1669
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
1672
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
1673
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1670
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
1674
1671
|
|
|
1675
1672
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1676
1673
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -1760,7 +1757,7 @@ generated
|
|
|
1760
1757
|
`
|
|
1761
1758
|
},
|
|
1762
1759
|
{
|
|
1763
|
-
path: "root/custom-objects/package.json",
|
|
1760
|
+
path: "root/custom-objects/package.json.mustache",
|
|
1764
1761
|
content: `{
|
|
1765
1762
|
"name": "custom-objects",
|
|
1766
1763
|
"type": "module",
|
|
@@ -1773,12 +1770,12 @@ generated
|
|
|
1773
1770
|
"test": "vitest run"
|
|
1774
1771
|
},
|
|
1775
1772
|
"dependencies": {
|
|
1776
|
-
"@stripe/extensibility-custom-objects": "
|
|
1777
|
-
"@stripe/extensibility-sdk": "
|
|
1773
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
1774
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
1778
1775
|
},
|
|
1779
1776
|
"devDependencies": {
|
|
1780
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
1781
|
-
"@stripe/extensibility-test-helpers": "
|
|
1777
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
1778
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
1782
1779
|
}
|
|
1783
1780
|
}
|
|
1784
1781
|
`
|
|
@@ -2747,7 +2744,7 @@ var _ExtensionTemplateManager = class extends import_extensibility_tool_utils4._
|
|
|
2747
2744
|
var import_extensibility_tool_utils9 = require("@stripe/extensibility-tool-utils");
|
|
2748
2745
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
2749
2746
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
2750
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
2747
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${(0, import_extensibility_tool_utils9._workspaceVersion)(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
2751
2748
|
function _createExtensionEslintConfigFile(params, context) {
|
|
2752
2749
|
const { id, extensionInterfaceId } = params;
|
|
2753
2750
|
const { fs: fs2 } = context;
|
|
@@ -3267,7 +3264,20 @@ var _rootWorkspaceTemplate = {
|
|
|
3267
3264
|
},
|
|
3268
3265
|
{
|
|
3269
3266
|
path: "custom-objects/package.json",
|
|
3270
|
-
content: fs2.
|
|
3267
|
+
content: fs2.mustache(
|
|
3268
|
+
{
|
|
3269
|
+
customObjectsVersion: (0, import_extensibility_tool_utils10._workspaceVersion)(
|
|
3270
|
+
"@stripe/extensibility-custom-objects"
|
|
3271
|
+
),
|
|
3272
|
+
sdkVersion: (0, import_extensibility_tool_utils10._workspaceVersion)("@stripe/extensibility-sdk"),
|
|
3273
|
+
customObjectsToolsVersion: (0, import_extensibility_tool_utils10._workspaceVersion)(
|
|
3274
|
+
"@stripe/extensibility-custom-objects-tools"
|
|
3275
|
+
),
|
|
3276
|
+
testHelpersVersion: (0, import_extensibility_tool_utils10._workspaceVersion)("@stripe/extensibility-test-helpers")
|
|
3277
|
+
},
|
|
3278
|
+
"custom-objects",
|
|
3279
|
+
"package.json.mustache"
|
|
3280
|
+
),
|
|
3271
3281
|
precious: true
|
|
3272
3282
|
},
|
|
3273
3283
|
{
|
|
@@ -26,19 +26,19 @@ export interface _PackageMetadata {
|
|
|
26
26
|
* @internal
|
|
27
27
|
*/
|
|
28
28
|
export declare const _regenWorkspaceOptionsSchema: z.ZodObject<{
|
|
29
|
-
templateId: z.ZodOptional<z.ZodString>;
|
|
30
|
-
root: z.ZodOptional<z.ZodString>;
|
|
31
|
-
packageDir: z.ZodOptional<z.ZodString>;
|
|
32
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
33
|
-
workspaceName: z.ZodOptional<z.ZodString>;
|
|
34
|
-
skipDependencies: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
-
skipHooks: z.ZodOptional<z.ZodBoolean>;
|
|
36
29
|
force: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
-
name: z.ZodOptional<z.ZodString>;
|
|
38
30
|
implementationType: z.ZodOptional<z.ZodEnum<{
|
|
39
|
-
script: "script";
|
|
40
31
|
"remote-function": "remote-function";
|
|
32
|
+
script: "script";
|
|
41
33
|
}>>;
|
|
34
|
+
name: z.ZodOptional<z.ZodString>;
|
|
35
|
+
packageDir: z.ZodOptional<z.ZodString>;
|
|
36
|
+
root: z.ZodOptional<z.ZodString>;
|
|
37
|
+
skipDependencies: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
skipHooks: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
templateId: z.ZodOptional<z.ZodString>;
|
|
40
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
41
|
+
workspaceName: z.ZodOptional<z.ZodString>;
|
|
42
42
|
}, z.core.$strip>;
|
|
43
43
|
/**
|
|
44
44
|
* Options for regenerating a workspace from templates.
|
|
@@ -62,28 +62,28 @@ export interface _WorkspaceGeneratedFile {
|
|
|
62
62
|
* @internal
|
|
63
63
|
*/
|
|
64
64
|
export type _WorkspaceDependency = {
|
|
65
|
-
|
|
65
|
+
minVersion?: string;
|
|
66
66
|
name: string;
|
|
67
|
-
|
|
67
|
+
type: 'stripe-cli-plugin';
|
|
68
68
|
} | {
|
|
69
|
-
type: 'dev-npm';
|
|
70
69
|
name: string;
|
|
70
|
+
type: 'dev-npm';
|
|
71
71
|
version: string;
|
|
72
72
|
} | {
|
|
73
|
-
type: 'stripe-cli-plugin';
|
|
74
73
|
name: string;
|
|
75
|
-
|
|
74
|
+
type: 'npm';
|
|
75
|
+
version: string;
|
|
76
76
|
};
|
|
77
77
|
/**
|
|
78
78
|
* A post-generation hook to run after files are written: either a pnpm script or a direct exec.
|
|
79
79
|
* @internal
|
|
80
80
|
*/
|
|
81
81
|
export type _WorkspacePostGenerationHook = {
|
|
82
|
-
script: string;
|
|
83
82
|
description?: string;
|
|
84
|
-
} | {
|
|
85
83
|
exec: string;
|
|
84
|
+
} | {
|
|
86
85
|
description?: string;
|
|
86
|
+
script: string;
|
|
87
87
|
};
|
|
88
88
|
/**
|
|
89
89
|
* Result returned by a workspace template generator.
|
|
@@ -94,8 +94,8 @@ export interface _WorkspaceGenerateResult {
|
|
|
94
94
|
files: _WorkspaceGeneratedFile[];
|
|
95
95
|
/** Dependencies to install after file generation. */
|
|
96
96
|
dependencies?: {
|
|
97
|
-
runtime?: _WorkspaceDependency[];
|
|
98
97
|
dev?: _WorkspaceDependency[];
|
|
98
|
+
runtime?: _WorkspaceDependency[];
|
|
99
99
|
};
|
|
100
100
|
/** Hooks to run after dependencies are installed. */
|
|
101
101
|
postGenerationHooks?: _WorkspacePostGenerationHook[];
|
|
@@ -106,7 +106,7 @@ export interface _WorkspaceGenerateResult {
|
|
|
106
106
|
* Decision returned by an overwrite prompt callback when a file already exists.
|
|
107
107
|
* @internal
|
|
108
108
|
*/
|
|
109
|
-
export type _WorkspaceOverwriteDecision = '
|
|
109
|
+
export type _WorkspaceOverwriteDecision = 'abort' | 'overwrite-all' | 'overwrite' | 'skip';
|
|
110
110
|
/**
|
|
111
111
|
* Callback invoked when a file to be written already exists, prompting for an overwrite decision.
|
|
112
112
|
* @internal
|
|
@@ -116,7 +116,7 @@ export type _WorkspaceOverwritePromptCallback = (path: string, cwd: string, newC
|
|
|
116
116
|
* Controls how the file writer handles existing files.
|
|
117
117
|
* @internal
|
|
118
118
|
*/
|
|
119
|
-
export type _WorkspaceWriteMode =
|
|
119
|
+
export type _WorkspaceWriteMode = _WorkspaceOverwritePromptCallback | 'abort-if-existing' | 'if-missing' | 'overwrite-all';
|
|
120
120
|
/**
|
|
121
121
|
* Options for writing workspace generated files to disk.
|
|
122
122
|
* @internal
|
|
@@ -155,7 +155,7 @@ export interface _WorkspacePendingChange {
|
|
|
155
155
|
/** The dependency this change applies to. */
|
|
156
156
|
dependency: _WorkspaceDependency;
|
|
157
157
|
/** The action that will be taken. */
|
|
158
|
-
action: 'add' | '
|
|
158
|
+
action: 'add' | 'already-satisfied' | 'conflict' | 'update';
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
161
|
* Interface for managing workspace dependency installation.
|
|
@@ -164,8 +164,8 @@ export interface _WorkspacePendingChange {
|
|
|
164
164
|
export interface _WorkspaceDependencyManager {
|
|
165
165
|
/** Analyze and queue the given dependencies for installation. */
|
|
166
166
|
ensureDependencies(input: {
|
|
167
|
-
required: _WorkspaceDependency[];
|
|
168
167
|
optional?: _WorkspaceDependency[];
|
|
168
|
+
required: _WorkspaceDependency[];
|
|
169
169
|
}): Promise<_WorkspacePendingChange[]>;
|
|
170
170
|
/** Mark a conflicting dependency as resolved so it will be force-installed. */
|
|
171
171
|
resolveConflict(dep: _WorkspaceDependency): void;
|
|
@@ -189,8 +189,8 @@ export interface _WorkspaceExtensionConfig {
|
|
|
189
189
|
script_entry_point?: string;
|
|
190
190
|
/** Inline script definition. */
|
|
191
191
|
script?: {
|
|
192
|
-
type: string;
|
|
193
192
|
content: string;
|
|
193
|
+
type: string;
|
|
194
194
|
};
|
|
195
195
|
/** Required permissions for the extension. */
|
|
196
196
|
permissions: string[];
|
|
@@ -199,21 +199,21 @@ export interface _WorkspaceExtensionConfig {
|
|
|
199
199
|
/** Optional configuration schemas. */
|
|
200
200
|
configuration?: {
|
|
201
201
|
input_schema: {
|
|
202
|
-
type: 'json_schema' | 'jsonforms';
|
|
203
202
|
content: string;
|
|
203
|
+
type: 'json_schema' | 'jsonforms';
|
|
204
204
|
};
|
|
205
205
|
ui_schema: {
|
|
206
|
-
type: 'json_schema' | 'jsonforms';
|
|
207
206
|
content: string;
|
|
207
|
+
type: 'json_schema' | 'jsonforms';
|
|
208
208
|
};
|
|
209
209
|
};
|
|
210
210
|
/** Remote function endpoints. */
|
|
211
211
|
endpoints?: {
|
|
212
212
|
id: string;
|
|
213
|
-
type: 'remote_function' | 'custom_http';
|
|
214
213
|
live?: _EndpointDefinition;
|
|
215
214
|
managed_sandbox?: _EndpointDefinition;
|
|
216
215
|
test?: _EndpointDefinition;
|
|
216
|
+
type: 'custom_http' | 'remote_function';
|
|
217
217
|
}[];
|
|
218
218
|
}
|
|
219
219
|
/**
|
|
@@ -227,13 +227,13 @@ export interface _WorkspaceManifest {
|
|
|
227
227
|
getExtensions(): readonly Readonly<_WorkspaceExtensionConfig>[];
|
|
228
228
|
/** Check whether a custom object entry is already registered in the manifest. */
|
|
229
229
|
hasCustomObject(entry: {
|
|
230
|
-
filePath: string;
|
|
231
230
|
className: string;
|
|
231
|
+
filePath: string;
|
|
232
232
|
}): boolean;
|
|
233
233
|
/** Add a custom object entry to the manifest; returns true if added, false if already present. */
|
|
234
234
|
addCustomObject(entry: {
|
|
235
|
-
filePath: string;
|
|
236
235
|
className: string;
|
|
236
|
+
filePath: string;
|
|
237
237
|
}): boolean;
|
|
238
238
|
/** Persist the manifest to disk. */
|
|
239
239
|
save(): Promise<void>;
|
|
@@ -260,17 +260,13 @@ export interface _WorkspaceServices {
|
|
|
260
260
|
writeFiles: (files: _WorkspaceGeneratedFile[], options?: _WorkspaceFileWriterOptions) => Promise<_WorkspaceFileWriteResult>;
|
|
261
261
|
/** Create a dependency manager scoped to the given working directory. */
|
|
262
262
|
createDepManager: (opts: {
|
|
263
|
-
cwd: string;
|
|
264
263
|
context?: _CliContext;
|
|
264
|
+
cwd: string;
|
|
265
265
|
}) => _WorkspaceDependencyManager;
|
|
266
266
|
/** Generate custom object files (definition and test) from a name. */
|
|
267
|
-
generateCustomObject: (vars: {
|
|
268
|
-
name: string;
|
|
269
|
-
}) => Promise<_WorkspaceGenerateResult>;
|
|
267
|
+
generateCustomObject: (vars: { name: string }) => Promise<_WorkspaceGenerateResult>;
|
|
270
268
|
/** Generate the custom-objects workspace scaffolding (package.json, tsconfig.json). */
|
|
271
|
-
generateCustomObjectsWorkspace: (vars: {
|
|
272
|
-
packagesSubfolder?: string;
|
|
273
|
-
}) => Promise<_WorkspaceGenerateResult>;
|
|
269
|
+
generateCustomObjectsWorkspace: (vars: { packagesSubfolder?: string }) => Promise<_WorkspaceGenerateResult>;
|
|
274
270
|
/** Load the stripe-app.yaml manifest from the given path. */
|
|
275
271
|
loadManifest: (manifestPath: string) => Promise<_WorkspaceManifest>;
|
|
276
272
|
/** Run post-generation hooks in the given working directory. */
|
package/dist/workspace/index.js
CHANGED
|
@@ -1163,8 +1163,7 @@ describe('MyDiscountCalculation', () => {
|
|
|
1163
1163
|
},
|
|
1164
1164
|
{
|
|
1165
1165
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
1166
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
1167
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1166
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1168
1167
|
|
|
1169
1168
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1170
1169
|
interface MyDiscountCalculationConfig extends Record<string, unknown> {}
|
|
@@ -1189,32 +1188,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
1189
1188
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
1190
1189
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
1191
1190
|
|
|
1192
|
-
import
|
|
1191
|
+
import MyBalanceApp from './index.js';
|
|
1193
1192
|
|
|
1194
|
-
describe('
|
|
1195
|
-
let instance:
|
|
1193
|
+
describe('MyBalanceApp', () => {
|
|
1194
|
+
let instance: MyBalanceApp;
|
|
1196
1195
|
|
|
1197
1196
|
beforeEach(() => {
|
|
1198
|
-
instance = new
|
|
1197
|
+
instance = new MyBalanceApp();
|
|
1199
1198
|
});
|
|
1200
1199
|
|
|
1201
1200
|
it('should be constructable', () => {
|
|
1202
|
-
expect(instance).toBeInstanceOf(
|
|
1201
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
1203
1202
|
});
|
|
1204
1203
|
});
|
|
1205
1204
|
`
|
|
1206
1205
|
},
|
|
1207
1206
|
{
|
|
1208
1207
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
1209
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1208
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1210
1209
|
|
|
1211
1210
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1212
|
-
interface
|
|
1211
|
+
interface MyBalanceAppConfig extends Record<string, unknown> {}
|
|
1213
1212
|
|
|
1214
|
-
export default class
|
|
1213
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
1215
1214
|
computeAppliedCustomerBalance(
|
|
1216
1215
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
1217
|
-
_config:
|
|
1216
|
+
_config: MyBalanceAppConfig,
|
|
1218
1217
|
_context: Context
|
|
1219
1218
|
) {
|
|
1220
1219
|
// TODO: implement your customer balance logic here
|
|
@@ -1247,7 +1246,7 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
1247
1246
|
},
|
|
1248
1247
|
{
|
|
1249
1248
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
1250
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1249
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1251
1250
|
|
|
1252
1251
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1253
1252
|
interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
|
|
@@ -1286,7 +1285,7 @@ describe('MyProrations', () => {
|
|
|
1286
1285
|
},
|
|
1287
1286
|
{
|
|
1288
1287
|
path: "extensions/billing.prorations/index.ts",
|
|
1289
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1288
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1290
1289
|
|
|
1291
1290
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1292
1291
|
interface MyProrationsConfig extends Record<string, unknown> {}
|
|
@@ -1327,7 +1326,7 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
1327
1326
|
},
|
|
1328
1327
|
{
|
|
1329
1328
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
1330
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1329
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1331
1330
|
|
|
1332
1331
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1333
1332
|
interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
@@ -1577,8 +1576,7 @@ describe('MyCustomAction', () => {
|
|
|
1577
1576
|
},
|
|
1578
1577
|
{
|
|
1579
1578
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
1580
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
1581
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1579
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
1582
1580
|
|
|
1583
1581
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1584
1582
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -1641,8 +1639,7 @@ describe('MyCustomAction', () => {
|
|
|
1641
1639
|
},
|
|
1642
1640
|
{
|
|
1643
1641
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
1644
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
1645
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1642
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
1646
1643
|
|
|
1647
1644
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1648
1645
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -1732,7 +1729,7 @@ generated
|
|
|
1732
1729
|
`
|
|
1733
1730
|
},
|
|
1734
1731
|
{
|
|
1735
|
-
path: "root/custom-objects/package.json",
|
|
1732
|
+
path: "root/custom-objects/package.json.mustache",
|
|
1736
1733
|
content: `{
|
|
1737
1734
|
"name": "custom-objects",
|
|
1738
1735
|
"type": "module",
|
|
@@ -1745,12 +1742,12 @@ generated
|
|
|
1745
1742
|
"test": "vitest run"
|
|
1746
1743
|
},
|
|
1747
1744
|
"dependencies": {
|
|
1748
|
-
"@stripe/extensibility-custom-objects": "
|
|
1749
|
-
"@stripe/extensibility-sdk": "
|
|
1745
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
1746
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
1750
1747
|
},
|
|
1751
1748
|
"devDependencies": {
|
|
1752
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
1753
|
-
"@stripe/extensibility-test-helpers": "
|
|
1749
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
1750
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
1754
1751
|
}
|
|
1755
1752
|
}
|
|
1756
1753
|
`
|
|
@@ -2723,7 +2720,7 @@ var _ExtensionTemplateManager = class extends _TemplateManager {
|
|
|
2723
2720
|
import { _workspaceVersion } from "@stripe/extensibility-tool-utils";
|
|
2724
2721
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
2725
2722
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
2726
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
2723
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${_workspaceVersion(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
2727
2724
|
function _createExtensionEslintConfigFile(params, context) {
|
|
2728
2725
|
const { id, extensionInterfaceId } = params;
|
|
2729
2726
|
const { fs: fs2 } = context;
|
|
@@ -3243,7 +3240,20 @@ var _rootWorkspaceTemplate = {
|
|
|
3243
3240
|
},
|
|
3244
3241
|
{
|
|
3245
3242
|
path: "custom-objects/package.json",
|
|
3246
|
-
content: fs2.
|
|
3243
|
+
content: fs2.mustache(
|
|
3244
|
+
{
|
|
3245
|
+
customObjectsVersion: _workspaceVersion2(
|
|
3246
|
+
"@stripe/extensibility-custom-objects"
|
|
3247
|
+
),
|
|
3248
|
+
sdkVersion: _workspaceVersion2("@stripe/extensibility-sdk"),
|
|
3249
|
+
customObjectsToolsVersion: _workspaceVersion2(
|
|
3250
|
+
"@stripe/extensibility-custom-objects-tools"
|
|
3251
|
+
),
|
|
3252
|
+
testHelpersVersion: _workspaceVersion2("@stripe/extensibility-test-helpers")
|
|
3253
|
+
},
|
|
3254
|
+
"custom-objects",
|
|
3255
|
+
"package.json.mustache"
|
|
3256
|
+
),
|
|
3247
3257
|
precious: true
|
|
3248
3258
|
},
|
|
3249
3259
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/extensibility-dev-tools",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"yaml": "^2.8.3",
|
|
73
73
|
"yargs": "^17.7.2",
|
|
74
74
|
"zod": "^4.3.6",
|
|
75
|
-
"@stripe/extensibility-custom-objects-tools": "0.
|
|
76
|
-
"@stripe/extensibility-tool-utils": "0.6.
|
|
75
|
+
"@stripe/extensibility-custom-objects-tools": "0.41.0",
|
|
76
|
+
"@stripe/extensibility-tool-utils": "0.6.5"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@protobuf-ts/protoc": "^2.8.2",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@types/yargs": "^17.0.35",
|
|
84
84
|
"ts-proto": "^2.11.2",
|
|
85
85
|
"tsd": "^0.33.0",
|
|
86
|
-
"@stripe/extensibility-jsonschema-tools": "0.6.
|
|
86
|
+
"@stripe/extensibility-jsonschema-tools": "0.6.6"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"typescript": "^5.8.0"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Billing } from '@stripe/extensibility-sdk
|
|
2
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1
|
+
import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
3
2
|
|
|
4
3
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
5
4
|
interface MyDiscountCalculationConfig extends Record<string, unknown> {}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { beforeEach, describe, it, expect } from 'vitest';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import MyBalanceApp from './index.js';
|
|
4
4
|
|
|
5
|
-
describe('
|
|
6
|
-
let instance:
|
|
5
|
+
describe('MyBalanceApp', () => {
|
|
6
|
+
let instance: MyBalanceApp;
|
|
7
7
|
|
|
8
8
|
beforeEach(() => {
|
|
9
|
-
instance = new
|
|
9
|
+
instance = new MyBalanceApp();
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
it('should be constructable', () => {
|
|
13
|
-
expect(instance).toBeInstanceOf(
|
|
13
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
14
14
|
});
|
|
15
15
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1
|
+
import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
4
|
-
interface
|
|
4
|
+
interface MyBalanceAppConfig extends Record<string, unknown> {}
|
|
5
5
|
|
|
6
|
-
export default class
|
|
6
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
7
7
|
computeAppliedCustomerBalance(
|
|
8
8
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
9
|
-
_config:
|
|
9
|
+
_config: MyBalanceAppConfig,
|
|
10
10
|
_context: Context
|
|
11
11
|
) {
|
|
12
12
|
// TODO: implement your customer balance logic here
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1
|
+
import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
4
4
|
interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1
|
+
import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
4
4
|
interface MyProrationsConfig extends Record<string, unknown> {}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1
|
+
import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
4
4
|
interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Core } from '@stripe/extensibility-sdk
|
|
2
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1
|
+
import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
3
2
|
|
|
4
3
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
5
4
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Extend } from '@stripe/extensibility-sdk
|
|
2
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1
|
+
import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
3
2
|
|
|
4
3
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
5
4
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"test": "vitest run"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@stripe/extensibility-custom-objects": "
|
|
14
|
-
"@stripe/extensibility-sdk": "
|
|
13
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
14
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
18
|
-
"@stripe/extensibility-test-helpers": "
|
|
17
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
18
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
19
19
|
}
|
|
20
20
|
}
|