@stripe/extensibility-dev-tools 0.23.5 → 0.24.2
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/bin/build-custom-object-definitions.cjs +42 -36
- package/dist/bin/build-custom-object-definitions.js +42 -36
- package/dist/bin/create-upload-image.cjs +42 -36
- package/dist/bin/create-upload-image.js +42 -36
- package/dist/bin/dev-tools-rpc.cjs +42 -31
- package/dist/bin/dev-tools-rpc.js +42 -31
- package/dist/bin/gen-workspace.cjs +42 -31
- package/dist/bin/gen-workspace.js +42 -31
- package/dist/bin/template-info.cjs +28 -30
- package/dist/bin/template-info.js +28 -30
- package/dist/custom-objects/to-proto-json.d.ts +2 -1
- package/dist/custom-objects/to-proto-json.d.ts.map +1 -1
- package/dist/index.cjs +42 -31
- package/dist/index.js +42 -31
- package/dist/templates/extensions/base.d.ts +1 -1
- package/dist/templates/extensions/base.d.ts.map +1 -1
- package/dist/templates/extensions/core.workflows.custom_action.d.ts.map +1 -1
- package/dist/templates/index.cjs +42 -31
- package/dist/templates/index.js +42 -31
- package/dist/templates/root/index.d.ts.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/workspace/index.cjs +42 -31
- package/dist/workspace/index.js +42 -31
- package/package.json +4 -4
- package/templates/extensions/billing.bill.discount_calculation/index.ts +2 -3
- 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 +2 -2
- package/templates/extensions/billing.prorations/index.ts +2 -2
- package/templates/extensions/billing.recurring_billing_item_handling/index.ts +2 -2
- package/templates/extensions/core.workflows.custom_action/index.ts +2 -3
- package/templates/extensions/extend.workflows.custom_action/index.ts +2 -3
- 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
|
@@ -305,11 +305,10 @@ describe('MyDiscountCalculation', () => {
|
|
|
305
305
|
},
|
|
306
306
|
{
|
|
307
307
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
308
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
309
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
308
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
310
309
|
|
|
311
310
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
312
|
-
interface MyDiscountCalculationConfig
|
|
311
|
+
interface MyDiscountCalculationConfig {}
|
|
313
312
|
|
|
314
313
|
export default class MyDiscountCalculation implements Billing.Bill
|
|
315
314
|
.DiscountCalculation<MyDiscountCalculationConfig> {
|
|
@@ -331,32 +330,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
331
330
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
332
331
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
333
332
|
|
|
334
|
-
import
|
|
333
|
+
import MyBalanceApp from './index.js';
|
|
335
334
|
|
|
336
|
-
describe('
|
|
337
|
-
let instance:
|
|
335
|
+
describe('MyBalanceApp', () => {
|
|
336
|
+
let instance: MyBalanceApp;
|
|
338
337
|
|
|
339
338
|
beforeEach(() => {
|
|
340
|
-
instance = new
|
|
339
|
+
instance = new MyBalanceApp();
|
|
341
340
|
});
|
|
342
341
|
|
|
343
342
|
it('should be constructable', () => {
|
|
344
|
-
expect(instance).toBeInstanceOf(
|
|
343
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
345
344
|
});
|
|
346
345
|
});
|
|
347
346
|
`
|
|
348
347
|
},
|
|
349
348
|
{
|
|
350
349
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
351
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
350
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
352
351
|
|
|
353
352
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
354
|
-
interface
|
|
353
|
+
interface MyBalanceAppConfig {}
|
|
355
354
|
|
|
356
|
-
export default class
|
|
355
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
357
356
|
computeAppliedCustomerBalance(
|
|
358
357
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
359
|
-
_config:
|
|
358
|
+
_config: MyBalanceAppConfig,
|
|
360
359
|
_context: Context
|
|
361
360
|
) {
|
|
362
361
|
// TODO: implement your customer balance logic here
|
|
@@ -389,10 +388,10 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
389
388
|
},
|
|
390
389
|
{
|
|
391
390
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
392
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
391
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
393
392
|
|
|
394
393
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
395
|
-
interface MyInvoiceCollectionSettingConfig
|
|
394
|
+
interface MyInvoiceCollectionSettingConfig {}
|
|
396
395
|
|
|
397
396
|
export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
|
|
398
397
|
collectionOverride(
|
|
@@ -428,10 +427,10 @@ describe('MyProrations', () => {
|
|
|
428
427
|
},
|
|
429
428
|
{
|
|
430
429
|
path: "extensions/billing.prorations/index.ts",
|
|
431
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
430
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
432
431
|
|
|
433
432
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
434
|
-
interface MyProrationsConfig
|
|
433
|
+
interface MyProrationsConfig {}
|
|
435
434
|
|
|
436
435
|
export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
|
|
437
436
|
prorateItems(
|
|
@@ -469,10 +468,10 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
469
468
|
},
|
|
470
469
|
{
|
|
471
470
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
472
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
471
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
473
472
|
|
|
474
473
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
475
|
-
interface MyRecurringBillingItemHandlingConfig
|
|
474
|
+
interface MyRecurringBillingItemHandlingConfig {}
|
|
476
475
|
|
|
477
476
|
export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
|
|
478
477
|
beforeItemCreation(
|
|
@@ -719,11 +718,10 @@ describe('MyCustomAction', () => {
|
|
|
719
718
|
},
|
|
720
719
|
{
|
|
721
720
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
722
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
723
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
721
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
724
722
|
|
|
725
723
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
726
|
-
interface MyCustomActionConfig
|
|
724
|
+
interface MyCustomActionConfig {}
|
|
727
725
|
|
|
728
726
|
export default class MyCustomAction implements Core.Workflows
|
|
729
727
|
.CustomAction<MyCustomActionConfig> {
|
|
@@ -783,11 +781,10 @@ describe('MyCustomAction', () => {
|
|
|
783
781
|
},
|
|
784
782
|
{
|
|
785
783
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
786
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
787
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
784
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
788
785
|
|
|
789
786
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
790
|
-
interface MyCustomActionConfig
|
|
787
|
+
interface MyCustomActionConfig {}
|
|
791
788
|
|
|
792
789
|
export default class MyCustomAction implements Extend.Workflows
|
|
793
790
|
.CustomAction<MyCustomActionConfig> {
|
|
@@ -874,7 +871,7 @@ generated
|
|
|
874
871
|
`
|
|
875
872
|
},
|
|
876
873
|
{
|
|
877
|
-
path: "root/custom-objects/package.json",
|
|
874
|
+
path: "root/custom-objects/package.json.mustache",
|
|
878
875
|
content: `{
|
|
879
876
|
"name": "custom-objects",
|
|
880
877
|
"type": "module",
|
|
@@ -887,12 +884,12 @@ generated
|
|
|
887
884
|
"test": "vitest run"
|
|
888
885
|
},
|
|
889
886
|
"dependencies": {
|
|
890
|
-
"@stripe/extensibility-custom-objects": "
|
|
891
|
-
"@stripe/extensibility-sdk": "
|
|
887
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
888
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
892
889
|
},
|
|
893
890
|
"devDependencies": {
|
|
894
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
895
|
-
"@stripe/extensibility-test-helpers": "
|
|
891
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
892
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
896
893
|
}
|
|
897
894
|
}
|
|
898
895
|
`
|
|
@@ -1249,7 +1246,7 @@ function _devNpmDep(name, version) {
|
|
|
1249
1246
|
import { _workspaceVersion } from "@stripe/extensibility-tool-utils";
|
|
1250
1247
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
1251
1248
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
1252
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
1249
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${_workspaceVersion(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
1253
1250
|
function _createExtensionEslintConfigFile(params, context) {
|
|
1254
1251
|
const { id, extensionInterfaceId } = params;
|
|
1255
1252
|
const { fs: fs4 } = context;
|
|
@@ -1311,6 +1308,7 @@ function _createBaseOutput(params, context) {
|
|
|
1311
1308
|
// src/templates/extensions/core.workflows.custom_action.ts
|
|
1312
1309
|
var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
|
|
1313
1310
|
var customActionTemplate = {
|
|
1311
|
+
deprecated: true,
|
|
1314
1312
|
methods: {
|
|
1315
1313
|
execute: { implementation_types: ["script", "remote-function"] },
|
|
1316
1314
|
get_form_state: { implementation_types: ["script", "remote-function"] }
|
|
@@ -1814,7 +1812,12 @@ function toFieldSchema(schema, required) {
|
|
|
1814
1812
|
fieldSchema.valuesPresence = FieldPresence.PRESENT;
|
|
1815
1813
|
}
|
|
1816
1814
|
if (schema.default !== void 0) {
|
|
1817
|
-
|
|
1815
|
+
if (dataType === DataType.ENUM_TYPE && enumValues && (typeof schema.default !== "string" || !enumValues.includes(schema.default))) {
|
|
1816
|
+
throw new Error(
|
|
1817
|
+
`Default value ${JSON.stringify(schema.default)} is not a valid enum value. Expected one of: ${enumValues.join(", ")}`
|
|
1818
|
+
);
|
|
1819
|
+
}
|
|
1820
|
+
fieldSchema.default = toDefaultValue(schema.default, dataType);
|
|
1818
1821
|
}
|
|
1819
1822
|
return fieldSchema;
|
|
1820
1823
|
}
|
|
@@ -1877,19 +1880,22 @@ function toValueBoundary(value) {
|
|
|
1877
1880
|
`ValueBoundary only supports integers, got ${String(value)}. Custom object numeric fields are integer-only.`
|
|
1878
1881
|
);
|
|
1879
1882
|
}
|
|
1880
|
-
return {
|
|
1883
|
+
return { integerBoundary: value };
|
|
1881
1884
|
}
|
|
1882
1885
|
function toDefaultValue(value, dataType) {
|
|
1883
1886
|
if (dataType === DataType.STRING_TYPE && typeof value === "string") {
|
|
1884
|
-
return {
|
|
1887
|
+
return { stringDefault: value };
|
|
1888
|
+
}
|
|
1889
|
+
if (dataType === DataType.ENUM_TYPE && typeof value === "string") {
|
|
1890
|
+
return { stringDefault: value };
|
|
1885
1891
|
}
|
|
1886
1892
|
if (dataType === DataType.INTEGER_TYPE && typeof value === "number") {
|
|
1887
|
-
return {
|
|
1893
|
+
return { integerDefault: value };
|
|
1888
1894
|
}
|
|
1889
1895
|
if (dataType === DataType.BOOLEAN_TYPE && typeof value === "boolean") {
|
|
1890
|
-
return {
|
|
1896
|
+
return { booleanDefault: value };
|
|
1891
1897
|
}
|
|
1892
|
-
return {
|
|
1898
|
+
return {};
|
|
1893
1899
|
}
|
|
1894
1900
|
|
|
1895
1901
|
// src/custom-objects/build-definitions.ts
|
|
@@ -125,11 +125,10 @@ describe('MyDiscountCalculation', () => {
|
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
128
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
129
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
128
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
130
129
|
|
|
131
130
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
132
|
-
interface MyDiscountCalculationConfig
|
|
131
|
+
interface MyDiscountCalculationConfig {}
|
|
133
132
|
|
|
134
133
|
export default class MyDiscountCalculation implements Billing.Bill
|
|
135
134
|
.DiscountCalculation<MyDiscountCalculationConfig> {
|
|
@@ -151,32 +150,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
151
150
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
152
151
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
153
152
|
|
|
154
|
-
import
|
|
153
|
+
import MyBalanceApp from './index.js';
|
|
155
154
|
|
|
156
|
-
describe('
|
|
157
|
-
let instance:
|
|
155
|
+
describe('MyBalanceApp', () => {
|
|
156
|
+
let instance: MyBalanceApp;
|
|
158
157
|
|
|
159
158
|
beforeEach(() => {
|
|
160
|
-
instance = new
|
|
159
|
+
instance = new MyBalanceApp();
|
|
161
160
|
});
|
|
162
161
|
|
|
163
162
|
it('should be constructable', () => {
|
|
164
|
-
expect(instance).toBeInstanceOf(
|
|
163
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
165
164
|
});
|
|
166
165
|
});
|
|
167
166
|
`
|
|
168
167
|
},
|
|
169
168
|
{
|
|
170
169
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
171
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
170
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
172
171
|
|
|
173
172
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
174
|
-
interface
|
|
173
|
+
interface MyBalanceAppConfig {}
|
|
175
174
|
|
|
176
|
-
export default class
|
|
175
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
177
176
|
computeAppliedCustomerBalance(
|
|
178
177
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
179
|
-
_config:
|
|
178
|
+
_config: MyBalanceAppConfig,
|
|
180
179
|
_context: Context
|
|
181
180
|
) {
|
|
182
181
|
// TODO: implement your customer balance logic here
|
|
@@ -209,10 +208,10 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
209
208
|
},
|
|
210
209
|
{
|
|
211
210
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
212
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
211
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
213
212
|
|
|
214
213
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
215
|
-
interface MyInvoiceCollectionSettingConfig
|
|
214
|
+
interface MyInvoiceCollectionSettingConfig {}
|
|
216
215
|
|
|
217
216
|
export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
|
|
218
217
|
collectionOverride(
|
|
@@ -248,10 +247,10 @@ describe('MyProrations', () => {
|
|
|
248
247
|
},
|
|
249
248
|
{
|
|
250
249
|
path: "extensions/billing.prorations/index.ts",
|
|
251
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
250
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
252
251
|
|
|
253
252
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
254
|
-
interface MyProrationsConfig
|
|
253
|
+
interface MyProrationsConfig {}
|
|
255
254
|
|
|
256
255
|
export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
|
|
257
256
|
prorateItems(
|
|
@@ -289,10 +288,10 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
289
288
|
},
|
|
290
289
|
{
|
|
291
290
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
292
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
291
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
293
292
|
|
|
294
293
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
295
|
-
interface MyRecurringBillingItemHandlingConfig
|
|
294
|
+
interface MyRecurringBillingItemHandlingConfig {}
|
|
296
295
|
|
|
297
296
|
export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
|
|
298
297
|
beforeItemCreation(
|
|
@@ -539,11 +538,10 @@ describe('MyCustomAction', () => {
|
|
|
539
538
|
},
|
|
540
539
|
{
|
|
541
540
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
542
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
543
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
541
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
544
542
|
|
|
545
543
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
546
|
-
interface MyCustomActionConfig
|
|
544
|
+
interface MyCustomActionConfig {}
|
|
547
545
|
|
|
548
546
|
export default class MyCustomAction implements Core.Workflows
|
|
549
547
|
.CustomAction<MyCustomActionConfig> {
|
|
@@ -603,11 +601,10 @@ describe('MyCustomAction', () => {
|
|
|
603
601
|
},
|
|
604
602
|
{
|
|
605
603
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
606
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
607
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
604
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
608
605
|
|
|
609
606
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
610
|
-
interface MyCustomActionConfig
|
|
607
|
+
interface MyCustomActionConfig {}
|
|
611
608
|
|
|
612
609
|
export default class MyCustomAction implements Extend.Workflows
|
|
613
610
|
.CustomAction<MyCustomActionConfig> {
|
|
@@ -694,7 +691,7 @@ generated
|
|
|
694
691
|
`
|
|
695
692
|
},
|
|
696
693
|
{
|
|
697
|
-
path: "root/custom-objects/package.json",
|
|
694
|
+
path: "root/custom-objects/package.json.mustache",
|
|
698
695
|
content: `{
|
|
699
696
|
"name": "custom-objects",
|
|
700
697
|
"type": "module",
|
|
@@ -707,12 +704,12 @@ generated
|
|
|
707
704
|
"test": "vitest run"
|
|
708
705
|
},
|
|
709
706
|
"dependencies": {
|
|
710
|
-
"@stripe/extensibility-custom-objects": "
|
|
711
|
-
"@stripe/extensibility-sdk": "
|
|
707
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
708
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
712
709
|
},
|
|
713
710
|
"devDependencies": {
|
|
714
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
715
|
-
"@stripe/extensibility-test-helpers": "
|
|
711
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
712
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
716
713
|
}
|
|
717
714
|
}
|
|
718
715
|
`
|
|
@@ -1602,7 +1599,7 @@ var _DependencyManager = class {
|
|
|
1602
1599
|
var import_extensibility_tool_utils4 = require("@stripe/extensibility-tool-utils");
|
|
1603
1600
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
1604
1601
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
1605
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
1602
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${(0, import_extensibility_tool_utils4._workspaceVersion)(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
1606
1603
|
function _createExtensionEslintConfigFile(params, context) {
|
|
1607
1604
|
const { id, extensionInterfaceId } = params;
|
|
1608
1605
|
const { fs: fs2 } = context;
|
|
@@ -1664,6 +1661,7 @@ function _createBaseOutput(params, context) {
|
|
|
1664
1661
|
// src/templates/extensions/core.workflows.custom_action.ts
|
|
1665
1662
|
var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
|
|
1666
1663
|
var customActionTemplate = {
|
|
1664
|
+
deprecated: true,
|
|
1667
1665
|
methods: {
|
|
1668
1666
|
execute: { implementation_types: ["script", "remote-function"] },
|
|
1669
1667
|
get_form_state: { implementation_types: ["script", "remote-function"] }
|
|
@@ -3310,7 +3308,20 @@ var _rootWorkspaceTemplate = {
|
|
|
3310
3308
|
},
|
|
3311
3309
|
{
|
|
3312
3310
|
path: "custom-objects/package.json",
|
|
3313
|
-
content: fs2.
|
|
3311
|
+
content: fs2.mustache(
|
|
3312
|
+
{
|
|
3313
|
+
customObjectsVersion: (0, import_extensibility_tool_utils10._workspaceVersion)(
|
|
3314
|
+
"@stripe/extensibility-custom-objects"
|
|
3315
|
+
),
|
|
3316
|
+
sdkVersion: (0, import_extensibility_tool_utils10._workspaceVersion)("@stripe/extensibility-sdk"),
|
|
3317
|
+
customObjectsToolsVersion: (0, import_extensibility_tool_utils10._workspaceVersion)(
|
|
3318
|
+
"@stripe/extensibility-custom-objects-tools"
|
|
3319
|
+
),
|
|
3320
|
+
testHelpersVersion: (0, import_extensibility_tool_utils10._workspaceVersion)("@stripe/extensibility-test-helpers")
|
|
3321
|
+
},
|
|
3322
|
+
"custom-objects",
|
|
3323
|
+
"package.json.mustache"
|
|
3324
|
+
),
|
|
3314
3325
|
precious: true
|
|
3315
3326
|
},
|
|
3316
3327
|
{
|
|
@@ -102,11 +102,10 @@ describe('MyDiscountCalculation', () => {
|
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
105
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
106
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
105
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
107
106
|
|
|
108
107
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
109
|
-
interface MyDiscountCalculationConfig
|
|
108
|
+
interface MyDiscountCalculationConfig {}
|
|
110
109
|
|
|
111
110
|
export default class MyDiscountCalculation implements Billing.Bill
|
|
112
111
|
.DiscountCalculation<MyDiscountCalculationConfig> {
|
|
@@ -128,32 +127,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
128
127
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
129
128
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
130
129
|
|
|
131
|
-
import
|
|
130
|
+
import MyBalanceApp from './index.js';
|
|
132
131
|
|
|
133
|
-
describe('
|
|
134
|
-
let instance:
|
|
132
|
+
describe('MyBalanceApp', () => {
|
|
133
|
+
let instance: MyBalanceApp;
|
|
135
134
|
|
|
136
135
|
beforeEach(() => {
|
|
137
|
-
instance = new
|
|
136
|
+
instance = new MyBalanceApp();
|
|
138
137
|
});
|
|
139
138
|
|
|
140
139
|
it('should be constructable', () => {
|
|
141
|
-
expect(instance).toBeInstanceOf(
|
|
140
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
142
141
|
});
|
|
143
142
|
});
|
|
144
143
|
`
|
|
145
144
|
},
|
|
146
145
|
{
|
|
147
146
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
148
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
147
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
149
148
|
|
|
150
149
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
151
|
-
interface
|
|
150
|
+
interface MyBalanceAppConfig {}
|
|
152
151
|
|
|
153
|
-
export default class
|
|
152
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
154
153
|
computeAppliedCustomerBalance(
|
|
155
154
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
156
|
-
_config:
|
|
155
|
+
_config: MyBalanceAppConfig,
|
|
157
156
|
_context: Context
|
|
158
157
|
) {
|
|
159
158
|
// TODO: implement your customer balance logic here
|
|
@@ -186,10 +185,10 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
186
185
|
},
|
|
187
186
|
{
|
|
188
187
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
189
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
188
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
190
189
|
|
|
191
190
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
192
|
-
interface MyInvoiceCollectionSettingConfig
|
|
191
|
+
interface MyInvoiceCollectionSettingConfig {}
|
|
193
192
|
|
|
194
193
|
export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
|
|
195
194
|
collectionOverride(
|
|
@@ -225,10 +224,10 @@ describe('MyProrations', () => {
|
|
|
225
224
|
},
|
|
226
225
|
{
|
|
227
226
|
path: "extensions/billing.prorations/index.ts",
|
|
228
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
227
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
229
228
|
|
|
230
229
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
231
|
-
interface MyProrationsConfig
|
|
230
|
+
interface MyProrationsConfig {}
|
|
232
231
|
|
|
233
232
|
export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
|
|
234
233
|
prorateItems(
|
|
@@ -266,10 +265,10 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
266
265
|
},
|
|
267
266
|
{
|
|
268
267
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
269
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
268
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
270
269
|
|
|
271
270
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
272
|
-
interface MyRecurringBillingItemHandlingConfig
|
|
271
|
+
interface MyRecurringBillingItemHandlingConfig {}
|
|
273
272
|
|
|
274
273
|
export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
|
|
275
274
|
beforeItemCreation(
|
|
@@ -516,11 +515,10 @@ describe('MyCustomAction', () => {
|
|
|
516
515
|
},
|
|
517
516
|
{
|
|
518
517
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
519
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
520
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
518
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
521
519
|
|
|
522
520
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
523
|
-
interface MyCustomActionConfig
|
|
521
|
+
interface MyCustomActionConfig {}
|
|
524
522
|
|
|
525
523
|
export default class MyCustomAction implements Core.Workflows
|
|
526
524
|
.CustomAction<MyCustomActionConfig> {
|
|
@@ -580,11 +578,10 @@ describe('MyCustomAction', () => {
|
|
|
580
578
|
},
|
|
581
579
|
{
|
|
582
580
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
583
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
584
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
581
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
585
582
|
|
|
586
583
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
587
|
-
interface MyCustomActionConfig
|
|
584
|
+
interface MyCustomActionConfig {}
|
|
588
585
|
|
|
589
586
|
export default class MyCustomAction implements Extend.Workflows
|
|
590
587
|
.CustomAction<MyCustomActionConfig> {
|
|
@@ -671,7 +668,7 @@ generated
|
|
|
671
668
|
`
|
|
672
669
|
},
|
|
673
670
|
{
|
|
674
|
-
path: "root/custom-objects/package.json",
|
|
671
|
+
path: "root/custom-objects/package.json.mustache",
|
|
675
672
|
content: `{
|
|
676
673
|
"name": "custom-objects",
|
|
677
674
|
"type": "module",
|
|
@@ -684,12 +681,12 @@ generated
|
|
|
684
681
|
"test": "vitest run"
|
|
685
682
|
},
|
|
686
683
|
"dependencies": {
|
|
687
|
-
"@stripe/extensibility-custom-objects": "
|
|
688
|
-
"@stripe/extensibility-sdk": "
|
|
684
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
685
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
689
686
|
},
|
|
690
687
|
"devDependencies": {
|
|
691
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
692
|
-
"@stripe/extensibility-test-helpers": "
|
|
688
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
689
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
693
690
|
}
|
|
694
691
|
}
|
|
695
692
|
`
|
|
@@ -1579,7 +1576,7 @@ var _DependencyManager = class {
|
|
|
1579
1576
|
import { _workspaceVersion } from "@stripe/extensibility-tool-utils";
|
|
1580
1577
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
1581
1578
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
1582
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
1579
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${_workspaceVersion(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
1583
1580
|
function _createExtensionEslintConfigFile(params, context) {
|
|
1584
1581
|
const { id, extensionInterfaceId } = params;
|
|
1585
1582
|
const { fs: fs2 } = context;
|
|
@@ -1641,6 +1638,7 @@ function _createBaseOutput(params, context) {
|
|
|
1641
1638
|
// src/templates/extensions/core.workflows.custom_action.ts
|
|
1642
1639
|
var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
|
|
1643
1640
|
var customActionTemplate = {
|
|
1641
|
+
deprecated: true,
|
|
1644
1642
|
methods: {
|
|
1645
1643
|
execute: { implementation_types: ["script", "remote-function"] },
|
|
1646
1644
|
get_form_state: { implementation_types: ["script", "remote-function"] }
|
|
@@ -3300,7 +3298,20 @@ var _rootWorkspaceTemplate = {
|
|
|
3300
3298
|
},
|
|
3301
3299
|
{
|
|
3302
3300
|
path: "custom-objects/package.json",
|
|
3303
|
-
content: fs2.
|
|
3301
|
+
content: fs2.mustache(
|
|
3302
|
+
{
|
|
3303
|
+
customObjectsVersion: _workspaceVersion2(
|
|
3304
|
+
"@stripe/extensibility-custom-objects"
|
|
3305
|
+
),
|
|
3306
|
+
sdkVersion: _workspaceVersion2("@stripe/extensibility-sdk"),
|
|
3307
|
+
customObjectsToolsVersion: _workspaceVersion2(
|
|
3308
|
+
"@stripe/extensibility-custom-objects-tools"
|
|
3309
|
+
),
|
|
3310
|
+
testHelpersVersion: _workspaceVersion2("@stripe/extensibility-test-helpers")
|
|
3311
|
+
},
|
|
3312
|
+
"custom-objects",
|
|
3313
|
+
"package.json.mustache"
|
|
3314
|
+
),
|
|
3304
3315
|
precious: true
|
|
3305
3316
|
},
|
|
3306
3317
|
{
|