@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/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @stripe/extensibility-dev-tools
|
|
2
|
+
|
|
3
|
+
Development toolkit for Stripe Apps. Provides template generation, manifest parsing, workspace management, schema handling, and CLI tools.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @stripe/extensibility-dev-tools
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## CLI tools
|
|
12
|
+
|
|
13
|
+
| Command | Description |
|
|
14
|
+
| --------------- | ------------------------------------------- |
|
|
15
|
+
| `gen-workspace` | Generate a Stripe Apps workspace |
|
|
16
|
+
| `gen-schemas` | Generate schemas from extension definitions |
|
|
17
|
+
|
|
18
|
+
## Subpath exports
|
|
19
|
+
|
|
20
|
+
| Subpath | Description |
|
|
21
|
+
| -------------------------------------------------- | ------------------------------------ |
|
|
22
|
+
| `@stripe/extensibility-dev-tools` | Main entry (re-exports below) |
|
|
23
|
+
| `@stripe/extensibility-dev-tools/templates` | Template generation system |
|
|
24
|
+
| `@stripe/extensibility-dev-tools/dependencies` | Dependency management |
|
|
25
|
+
| `@stripe/extensibility-dev-tools/manifest` | Manifest parsing (`stripe-app.yaml`) |
|
|
26
|
+
| `@stripe/extensibility-dev-tools/workspace` | Workspace regeneration |
|
|
27
|
+
| `@stripe/extensibility-dev-tools/jsonschema-tools` | JSON Schema utilities |
|
|
28
|
+
| `@stripe/extensibility-dev-tools/schemas` | Schema definitions |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-surface.d.ts","sourceRoot":"","sources":["../src/api-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,YAAY,CAAC"}
|
|
@@ -325,8 +325,7 @@ describe('MyDiscountCalculation', () => {
|
|
|
325
325
|
},
|
|
326
326
|
{
|
|
327
327
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
328
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
329
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
328
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
330
329
|
|
|
331
330
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
332
331
|
interface MyDiscountCalculationConfig extends Record<string, unknown> {}
|
|
@@ -351,32 +350,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
351
350
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
352
351
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
353
352
|
|
|
354
|
-
import
|
|
353
|
+
import MyBalanceApp from './index.js';
|
|
355
354
|
|
|
356
|
-
describe('
|
|
357
|
-
let instance:
|
|
355
|
+
describe('MyBalanceApp', () => {
|
|
356
|
+
let instance: MyBalanceApp;
|
|
358
357
|
|
|
359
358
|
beforeEach(() => {
|
|
360
|
-
instance = new
|
|
359
|
+
instance = new MyBalanceApp();
|
|
361
360
|
});
|
|
362
361
|
|
|
363
362
|
it('should be constructable', () => {
|
|
364
|
-
expect(instance).toBeInstanceOf(
|
|
363
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
365
364
|
});
|
|
366
365
|
});
|
|
367
366
|
`
|
|
368
367
|
},
|
|
369
368
|
{
|
|
370
369
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
371
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
370
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
372
371
|
|
|
373
372
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
374
|
-
interface
|
|
373
|
+
interface MyBalanceAppConfig extends Record<string, unknown> {}
|
|
375
374
|
|
|
376
|
-
export default class
|
|
375
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
377
376
|
computeAppliedCustomerBalance(
|
|
378
377
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
379
|
-
_config:
|
|
378
|
+
_config: MyBalanceAppConfig,
|
|
380
379
|
_context: Context
|
|
381
380
|
) {
|
|
382
381
|
// TODO: implement your customer balance logic here
|
|
@@ -409,7 +408,7 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
409
408
|
},
|
|
410
409
|
{
|
|
411
410
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
412
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
411
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
413
412
|
|
|
414
413
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
415
414
|
interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
|
|
@@ -448,7 +447,7 @@ describe('MyProrations', () => {
|
|
|
448
447
|
},
|
|
449
448
|
{
|
|
450
449
|
path: "extensions/billing.prorations/index.ts",
|
|
451
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
450
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
452
451
|
|
|
453
452
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
454
453
|
interface MyProrationsConfig extends Record<string, unknown> {}
|
|
@@ -489,7 +488,7 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
489
488
|
},
|
|
490
489
|
{
|
|
491
490
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
492
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
491
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
493
492
|
|
|
494
493
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
495
494
|
interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
@@ -739,8 +738,7 @@ describe('MyCustomAction', () => {
|
|
|
739
738
|
},
|
|
740
739
|
{
|
|
741
740
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
742
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
743
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
741
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
744
742
|
|
|
745
743
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
746
744
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -803,8 +801,7 @@ describe('MyCustomAction', () => {
|
|
|
803
801
|
},
|
|
804
802
|
{
|
|
805
803
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
806
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
807
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
804
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
808
805
|
|
|
809
806
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
810
807
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -894,7 +891,7 @@ generated
|
|
|
894
891
|
`
|
|
895
892
|
},
|
|
896
893
|
{
|
|
897
|
-
path: "root/custom-objects/package.json",
|
|
894
|
+
path: "root/custom-objects/package.json.mustache",
|
|
898
895
|
content: `{
|
|
899
896
|
"name": "custom-objects",
|
|
900
897
|
"type": "module",
|
|
@@ -907,12 +904,12 @@ generated
|
|
|
907
904
|
"test": "vitest run"
|
|
908
905
|
},
|
|
909
906
|
"dependencies": {
|
|
910
|
-
"@stripe/extensibility-custom-objects": "
|
|
911
|
-
"@stripe/extensibility-sdk": "
|
|
907
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
908
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
912
909
|
},
|
|
913
910
|
"devDependencies": {
|
|
914
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
915
|
-
"@stripe/extensibility-test-helpers": "
|
|
911
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
912
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
916
913
|
}
|
|
917
914
|
}
|
|
918
915
|
`
|
|
@@ -1269,7 +1266,7 @@ function _devNpmDep(name, version) {
|
|
|
1269
1266
|
var import_extensibility_tool_utils6 = require("@stripe/extensibility-tool-utils");
|
|
1270
1267
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
1271
1268
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
1272
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
1269
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${(0, import_extensibility_tool_utils6._workspaceVersion)(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
1273
1270
|
function _createExtensionEslintConfigFile(params, context) {
|
|
1274
1271
|
const { id, extensionInterfaceId } = params;
|
|
1275
1272
|
const { fs: fs3 } = context;
|
|
@@ -302,8 +302,7 @@ describe('MyDiscountCalculation', () => {
|
|
|
302
302
|
},
|
|
303
303
|
{
|
|
304
304
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
305
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
306
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
305
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
307
306
|
|
|
308
307
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
309
308
|
interface MyDiscountCalculationConfig extends Record<string, unknown> {}
|
|
@@ -328,32 +327,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
328
327
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
329
328
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
330
329
|
|
|
331
|
-
import
|
|
330
|
+
import MyBalanceApp from './index.js';
|
|
332
331
|
|
|
333
|
-
describe('
|
|
334
|
-
let instance:
|
|
332
|
+
describe('MyBalanceApp', () => {
|
|
333
|
+
let instance: MyBalanceApp;
|
|
335
334
|
|
|
336
335
|
beforeEach(() => {
|
|
337
|
-
instance = new
|
|
336
|
+
instance = new MyBalanceApp();
|
|
338
337
|
});
|
|
339
338
|
|
|
340
339
|
it('should be constructable', () => {
|
|
341
|
-
expect(instance).toBeInstanceOf(
|
|
340
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
342
341
|
});
|
|
343
342
|
});
|
|
344
343
|
`
|
|
345
344
|
},
|
|
346
345
|
{
|
|
347
346
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
348
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
347
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
349
348
|
|
|
350
349
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
351
|
-
interface
|
|
350
|
+
interface MyBalanceAppConfig extends Record<string, unknown> {}
|
|
352
351
|
|
|
353
|
-
export default class
|
|
352
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
354
353
|
computeAppliedCustomerBalance(
|
|
355
354
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
356
|
-
_config:
|
|
355
|
+
_config: MyBalanceAppConfig,
|
|
357
356
|
_context: Context
|
|
358
357
|
) {
|
|
359
358
|
// TODO: implement your customer balance logic here
|
|
@@ -386,7 +385,7 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
386
385
|
},
|
|
387
386
|
{
|
|
388
387
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
389
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
388
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
390
389
|
|
|
391
390
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
392
391
|
interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
|
|
@@ -425,7 +424,7 @@ describe('MyProrations', () => {
|
|
|
425
424
|
},
|
|
426
425
|
{
|
|
427
426
|
path: "extensions/billing.prorations/index.ts",
|
|
428
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
427
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
429
428
|
|
|
430
429
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
431
430
|
interface MyProrationsConfig extends Record<string, unknown> {}
|
|
@@ -466,7 +465,7 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
466
465
|
},
|
|
467
466
|
{
|
|
468
467
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
469
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
468
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
470
469
|
|
|
471
470
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
472
471
|
interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
@@ -716,8 +715,7 @@ describe('MyCustomAction', () => {
|
|
|
716
715
|
},
|
|
717
716
|
{
|
|
718
717
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
719
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
720
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
718
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
721
719
|
|
|
722
720
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
723
721
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -780,8 +778,7 @@ describe('MyCustomAction', () => {
|
|
|
780
778
|
},
|
|
781
779
|
{
|
|
782
780
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
783
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
784
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
781
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
785
782
|
|
|
786
783
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
787
784
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -871,7 +868,7 @@ generated
|
|
|
871
868
|
`
|
|
872
869
|
},
|
|
873
870
|
{
|
|
874
|
-
path: "root/custom-objects/package.json",
|
|
871
|
+
path: "root/custom-objects/package.json.mustache",
|
|
875
872
|
content: `{
|
|
876
873
|
"name": "custom-objects",
|
|
877
874
|
"type": "module",
|
|
@@ -884,12 +881,12 @@ generated
|
|
|
884
881
|
"test": "vitest run"
|
|
885
882
|
},
|
|
886
883
|
"dependencies": {
|
|
887
|
-
"@stripe/extensibility-custom-objects": "
|
|
888
|
-
"@stripe/extensibility-sdk": "
|
|
884
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
885
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
889
886
|
},
|
|
890
887
|
"devDependencies": {
|
|
891
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
892
|
-
"@stripe/extensibility-test-helpers": "
|
|
888
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
889
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
893
890
|
}
|
|
894
891
|
}
|
|
895
892
|
`
|
|
@@ -1246,7 +1243,7 @@ function _devNpmDep(name, version) {
|
|
|
1246
1243
|
import { _workspaceVersion } from "@stripe/extensibility-tool-utils";
|
|
1247
1244
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
1248
1245
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
1249
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
1246
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${_workspaceVersion(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
1250
1247
|
function _createExtensionEslintConfigFile(params, context) {
|
|
1251
1248
|
const { id, extensionInterfaceId } = params;
|
|
1252
1249
|
const { fs: fs3 } = context;
|
|
@@ -328,8 +328,7 @@ describe('MyDiscountCalculation', () => {
|
|
|
328
328
|
},
|
|
329
329
|
{
|
|
330
330
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
331
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
332
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
331
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
333
332
|
|
|
334
333
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
335
334
|
interface MyDiscountCalculationConfig extends Record<string, unknown> {}
|
|
@@ -354,32 +353,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
354
353
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
355
354
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
356
355
|
|
|
357
|
-
import
|
|
356
|
+
import MyBalanceApp from './index.js';
|
|
358
357
|
|
|
359
|
-
describe('
|
|
360
|
-
let instance:
|
|
358
|
+
describe('MyBalanceApp', () => {
|
|
359
|
+
let instance: MyBalanceApp;
|
|
361
360
|
|
|
362
361
|
beforeEach(() => {
|
|
363
|
-
instance = new
|
|
362
|
+
instance = new MyBalanceApp();
|
|
364
363
|
});
|
|
365
364
|
|
|
366
365
|
it('should be constructable', () => {
|
|
367
|
-
expect(instance).toBeInstanceOf(
|
|
366
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
368
367
|
});
|
|
369
368
|
});
|
|
370
369
|
`
|
|
371
370
|
},
|
|
372
371
|
{
|
|
373
372
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
374
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
373
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
375
374
|
|
|
376
375
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
377
|
-
interface
|
|
376
|
+
interface MyBalanceAppConfig extends Record<string, unknown> {}
|
|
378
377
|
|
|
379
|
-
export default class
|
|
378
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
380
379
|
computeAppliedCustomerBalance(
|
|
381
380
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
382
|
-
_config:
|
|
381
|
+
_config: MyBalanceAppConfig,
|
|
383
382
|
_context: Context
|
|
384
383
|
) {
|
|
385
384
|
// TODO: implement your customer balance logic here
|
|
@@ -412,7 +411,7 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
412
411
|
},
|
|
413
412
|
{
|
|
414
413
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
415
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
414
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
416
415
|
|
|
417
416
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
418
417
|
interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
|
|
@@ -451,7 +450,7 @@ describe('MyProrations', () => {
|
|
|
451
450
|
},
|
|
452
451
|
{
|
|
453
452
|
path: "extensions/billing.prorations/index.ts",
|
|
454
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
453
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
455
454
|
|
|
456
455
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
457
456
|
interface MyProrationsConfig extends Record<string, unknown> {}
|
|
@@ -492,7 +491,7 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
492
491
|
},
|
|
493
492
|
{
|
|
494
493
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
495
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
494
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
496
495
|
|
|
497
496
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
498
497
|
interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
@@ -742,8 +741,7 @@ describe('MyCustomAction', () => {
|
|
|
742
741
|
},
|
|
743
742
|
{
|
|
744
743
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
745
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
746
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
744
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
747
745
|
|
|
748
746
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
749
747
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -806,8 +804,7 @@ describe('MyCustomAction', () => {
|
|
|
806
804
|
},
|
|
807
805
|
{
|
|
808
806
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
809
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
810
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
807
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
811
808
|
|
|
812
809
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
813
810
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -897,7 +894,7 @@ generated
|
|
|
897
894
|
`
|
|
898
895
|
},
|
|
899
896
|
{
|
|
900
|
-
path: "root/custom-objects/package.json",
|
|
897
|
+
path: "root/custom-objects/package.json.mustache",
|
|
901
898
|
content: `{
|
|
902
899
|
"name": "custom-objects",
|
|
903
900
|
"type": "module",
|
|
@@ -910,12 +907,12 @@ generated
|
|
|
910
907
|
"test": "vitest run"
|
|
911
908
|
},
|
|
912
909
|
"dependencies": {
|
|
913
|
-
"@stripe/extensibility-custom-objects": "
|
|
914
|
-
"@stripe/extensibility-sdk": "
|
|
910
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
911
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
915
912
|
},
|
|
916
913
|
"devDependencies": {
|
|
917
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
918
|
-
"@stripe/extensibility-test-helpers": "
|
|
914
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
915
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
919
916
|
}
|
|
920
917
|
}
|
|
921
918
|
`
|
|
@@ -1272,7 +1269,7 @@ function _devNpmDep(name, version) {
|
|
|
1272
1269
|
var import_extensibility_tool_utils6 = require("@stripe/extensibility-tool-utils");
|
|
1273
1270
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
1274
1271
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
1275
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
1272
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${(0, import_extensibility_tool_utils6._workspaceVersion)(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
1276
1273
|
function _createExtensionEslintConfigFile(params, context) {
|
|
1277
1274
|
const { id, extensionInterfaceId } = params;
|
|
1278
1275
|
const { fs: fs4 } = context;
|
|
@@ -305,8 +305,7 @@ 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
311
|
interface MyDiscountCalculationConfig extends Record<string, unknown> {}
|
|
@@ -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 extends Record<string, unknown> {}
|
|
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,7 +388,7 @@ 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
394
|
interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
|
|
@@ -428,7 +427,7 @@ 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
433
|
interface MyProrationsConfig extends Record<string, unknown> {}
|
|
@@ -469,7 +468,7 @@ 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
474
|
interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
@@ -719,8 +718,7 @@ 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
724
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -783,8 +781,7 @@ 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
787
|
interface MyCustomActionConfig extends Record<string, unknown> {}
|
|
@@ -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;
|