@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
|
@@ -1184,11 +1184,10 @@ describe('MyDiscountCalculation', () => {
|
|
|
1184
1184
|
},
|
|
1185
1185
|
{
|
|
1186
1186
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
1187
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
1188
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1187
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1189
1188
|
|
|
1190
1189
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1191
|
-
interface MyDiscountCalculationConfig
|
|
1190
|
+
interface MyDiscountCalculationConfig {}
|
|
1192
1191
|
|
|
1193
1192
|
export default class MyDiscountCalculation implements Billing.Bill
|
|
1194
1193
|
.DiscountCalculation<MyDiscountCalculationConfig> {
|
|
@@ -1210,32 +1209,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
1210
1209
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
1211
1210
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
1212
1211
|
|
|
1213
|
-
import
|
|
1212
|
+
import MyBalanceApp from './index.js';
|
|
1214
1213
|
|
|
1215
|
-
describe('
|
|
1216
|
-
let instance:
|
|
1214
|
+
describe('MyBalanceApp', () => {
|
|
1215
|
+
let instance: MyBalanceApp;
|
|
1217
1216
|
|
|
1218
1217
|
beforeEach(() => {
|
|
1219
|
-
instance = new
|
|
1218
|
+
instance = new MyBalanceApp();
|
|
1220
1219
|
});
|
|
1221
1220
|
|
|
1222
1221
|
it('should be constructable', () => {
|
|
1223
|
-
expect(instance).toBeInstanceOf(
|
|
1222
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
1224
1223
|
});
|
|
1225
1224
|
});
|
|
1226
1225
|
`
|
|
1227
1226
|
},
|
|
1228
1227
|
{
|
|
1229
1228
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
1230
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1229
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1231
1230
|
|
|
1232
1231
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1233
|
-
interface
|
|
1232
|
+
interface MyBalanceAppConfig {}
|
|
1234
1233
|
|
|
1235
|
-
export default class
|
|
1234
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
1236
1235
|
computeAppliedCustomerBalance(
|
|
1237
1236
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
1238
|
-
_config:
|
|
1237
|
+
_config: MyBalanceAppConfig,
|
|
1239
1238
|
_context: Context
|
|
1240
1239
|
) {
|
|
1241
1240
|
// TODO: implement your customer balance logic here
|
|
@@ -1268,10 +1267,10 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
1268
1267
|
},
|
|
1269
1268
|
{
|
|
1270
1269
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
1271
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1270
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1272
1271
|
|
|
1273
1272
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1274
|
-
interface MyInvoiceCollectionSettingConfig
|
|
1273
|
+
interface MyInvoiceCollectionSettingConfig {}
|
|
1275
1274
|
|
|
1276
1275
|
export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
|
|
1277
1276
|
collectionOverride(
|
|
@@ -1307,10 +1306,10 @@ describe('MyProrations', () => {
|
|
|
1307
1306
|
},
|
|
1308
1307
|
{
|
|
1309
1308
|
path: "extensions/billing.prorations/index.ts",
|
|
1310
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1309
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1311
1310
|
|
|
1312
1311
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1313
|
-
interface MyProrationsConfig
|
|
1312
|
+
interface MyProrationsConfig {}
|
|
1314
1313
|
|
|
1315
1314
|
export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
|
|
1316
1315
|
prorateItems(
|
|
@@ -1348,10 +1347,10 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
1348
1347
|
},
|
|
1349
1348
|
{
|
|
1350
1349
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
1351
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1350
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1352
1351
|
|
|
1353
1352
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1354
|
-
interface MyRecurringBillingItemHandlingConfig
|
|
1353
|
+
interface MyRecurringBillingItemHandlingConfig {}
|
|
1355
1354
|
|
|
1356
1355
|
export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
|
|
1357
1356
|
beforeItemCreation(
|
|
@@ -1598,11 +1597,10 @@ describe('MyCustomAction', () => {
|
|
|
1598
1597
|
},
|
|
1599
1598
|
{
|
|
1600
1599
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
1601
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
1602
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1600
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
1603
1601
|
|
|
1604
1602
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1605
|
-
interface MyCustomActionConfig
|
|
1603
|
+
interface MyCustomActionConfig {}
|
|
1606
1604
|
|
|
1607
1605
|
export default class MyCustomAction implements Core.Workflows
|
|
1608
1606
|
.CustomAction<MyCustomActionConfig> {
|
|
@@ -1662,11 +1660,10 @@ describe('MyCustomAction', () => {
|
|
|
1662
1660
|
},
|
|
1663
1661
|
{
|
|
1664
1662
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
1665
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
1666
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1663
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
1667
1664
|
|
|
1668
1665
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1669
|
-
interface MyCustomActionConfig
|
|
1666
|
+
interface MyCustomActionConfig {}
|
|
1670
1667
|
|
|
1671
1668
|
export default class MyCustomAction implements Extend.Workflows
|
|
1672
1669
|
.CustomAction<MyCustomActionConfig> {
|
|
@@ -1753,7 +1750,7 @@ generated
|
|
|
1753
1750
|
`
|
|
1754
1751
|
},
|
|
1755
1752
|
{
|
|
1756
|
-
path: "root/custom-objects/package.json",
|
|
1753
|
+
path: "root/custom-objects/package.json.mustache",
|
|
1757
1754
|
content: `{
|
|
1758
1755
|
"name": "custom-objects",
|
|
1759
1756
|
"type": "module",
|
|
@@ -1766,12 +1763,12 @@ generated
|
|
|
1766
1763
|
"test": "vitest run"
|
|
1767
1764
|
},
|
|
1768
1765
|
"dependencies": {
|
|
1769
|
-
"@stripe/extensibility-custom-objects": "
|
|
1770
|
-
"@stripe/extensibility-sdk": "
|
|
1766
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
1767
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
1771
1768
|
},
|
|
1772
1769
|
"devDependencies": {
|
|
1773
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
1774
|
-
"@stripe/extensibility-test-helpers": "
|
|
1770
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
1771
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
1775
1772
|
}
|
|
1776
1773
|
}
|
|
1777
1774
|
`
|
|
@@ -2740,7 +2737,7 @@ var _ExtensionTemplateManager = class extends import_extensibility_tool_utils4._
|
|
|
2740
2737
|
var import_extensibility_tool_utils9 = require("@stripe/extensibility-tool-utils");
|
|
2741
2738
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
2742
2739
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
2743
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
2740
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${(0, import_extensibility_tool_utils9._workspaceVersion)(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
2744
2741
|
function _createExtensionEslintConfigFile(params, context) {
|
|
2745
2742
|
const { id, extensionInterfaceId } = params;
|
|
2746
2743
|
const { fs: fs2 } = context;
|
|
@@ -2802,6 +2799,7 @@ function _createBaseOutput(params, context) {
|
|
|
2802
2799
|
// src/templates/extensions/core.workflows.custom_action.ts
|
|
2803
2800
|
var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
|
|
2804
2801
|
var customActionTemplate = {
|
|
2802
|
+
deprecated: true,
|
|
2805
2803
|
methods: {
|
|
2806
2804
|
execute: { implementation_types: ["script", "remote-function"] },
|
|
2807
2805
|
get_form_state: { implementation_types: ["script", "remote-function"] }
|
|
@@ -3260,7 +3258,20 @@ var _rootWorkspaceTemplate = {
|
|
|
3260
3258
|
},
|
|
3261
3259
|
{
|
|
3262
3260
|
path: "custom-objects/package.json",
|
|
3263
|
-
content: fs2.
|
|
3261
|
+
content: fs2.mustache(
|
|
3262
|
+
{
|
|
3263
|
+
customObjectsVersion: (0, import_extensibility_tool_utils10._workspaceVersion)(
|
|
3264
|
+
"@stripe/extensibility-custom-objects"
|
|
3265
|
+
),
|
|
3266
|
+
sdkVersion: (0, import_extensibility_tool_utils10._workspaceVersion)("@stripe/extensibility-sdk"),
|
|
3267
|
+
customObjectsToolsVersion: (0, import_extensibility_tool_utils10._workspaceVersion)(
|
|
3268
|
+
"@stripe/extensibility-custom-objects-tools"
|
|
3269
|
+
),
|
|
3270
|
+
testHelpersVersion: (0, import_extensibility_tool_utils10._workspaceVersion)("@stripe/extensibility-test-helpers")
|
|
3271
|
+
},
|
|
3272
|
+
"custom-objects",
|
|
3273
|
+
"package.json.mustache"
|
|
3274
|
+
),
|
|
3264
3275
|
precious: true
|
|
3265
3276
|
},
|
|
3266
3277
|
{
|
|
@@ -1174,11 +1174,10 @@ describe('MyDiscountCalculation', () => {
|
|
|
1174
1174
|
},
|
|
1175
1175
|
{
|
|
1176
1176
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
1177
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
1178
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1177
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1179
1178
|
|
|
1180
1179
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1181
|
-
interface MyDiscountCalculationConfig
|
|
1180
|
+
interface MyDiscountCalculationConfig {}
|
|
1182
1181
|
|
|
1183
1182
|
export default class MyDiscountCalculation implements Billing.Bill
|
|
1184
1183
|
.DiscountCalculation<MyDiscountCalculationConfig> {
|
|
@@ -1200,32 +1199,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
1200
1199
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
1201
1200
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
1202
1201
|
|
|
1203
|
-
import
|
|
1202
|
+
import MyBalanceApp from './index.js';
|
|
1204
1203
|
|
|
1205
|
-
describe('
|
|
1206
|
-
let instance:
|
|
1204
|
+
describe('MyBalanceApp', () => {
|
|
1205
|
+
let instance: MyBalanceApp;
|
|
1207
1206
|
|
|
1208
1207
|
beforeEach(() => {
|
|
1209
|
-
instance = new
|
|
1208
|
+
instance = new MyBalanceApp();
|
|
1210
1209
|
});
|
|
1211
1210
|
|
|
1212
1211
|
it('should be constructable', () => {
|
|
1213
|
-
expect(instance).toBeInstanceOf(
|
|
1212
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
1214
1213
|
});
|
|
1215
1214
|
});
|
|
1216
1215
|
`
|
|
1217
1216
|
},
|
|
1218
1217
|
{
|
|
1219
1218
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
1220
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1219
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1221
1220
|
|
|
1222
1221
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1223
|
-
interface
|
|
1222
|
+
interface MyBalanceAppConfig {}
|
|
1224
1223
|
|
|
1225
|
-
export default class
|
|
1224
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
1226
1225
|
computeAppliedCustomerBalance(
|
|
1227
1226
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
1228
|
-
_config:
|
|
1227
|
+
_config: MyBalanceAppConfig,
|
|
1229
1228
|
_context: Context
|
|
1230
1229
|
) {
|
|
1231
1230
|
// TODO: implement your customer balance logic here
|
|
@@ -1258,10 +1257,10 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
1258
1257
|
},
|
|
1259
1258
|
{
|
|
1260
1259
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
1261
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1260
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1262
1261
|
|
|
1263
1262
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1264
|
-
interface MyInvoiceCollectionSettingConfig
|
|
1263
|
+
interface MyInvoiceCollectionSettingConfig {}
|
|
1265
1264
|
|
|
1266
1265
|
export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
|
|
1267
1266
|
collectionOverride(
|
|
@@ -1297,10 +1296,10 @@ describe('MyProrations', () => {
|
|
|
1297
1296
|
},
|
|
1298
1297
|
{
|
|
1299
1298
|
path: "extensions/billing.prorations/index.ts",
|
|
1300
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1299
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1301
1300
|
|
|
1302
1301
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1303
|
-
interface MyProrationsConfig
|
|
1302
|
+
interface MyProrationsConfig {}
|
|
1304
1303
|
|
|
1305
1304
|
export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
|
|
1306
1305
|
prorateItems(
|
|
@@ -1338,10 +1337,10 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
1338
1337
|
},
|
|
1339
1338
|
{
|
|
1340
1339
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
1341
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1340
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1342
1341
|
|
|
1343
1342
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1344
|
-
interface MyRecurringBillingItemHandlingConfig
|
|
1343
|
+
interface MyRecurringBillingItemHandlingConfig {}
|
|
1345
1344
|
|
|
1346
1345
|
export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
|
|
1347
1346
|
beforeItemCreation(
|
|
@@ -1588,11 +1587,10 @@ describe('MyCustomAction', () => {
|
|
|
1588
1587
|
},
|
|
1589
1588
|
{
|
|
1590
1589
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
1591
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
1592
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1590
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
1593
1591
|
|
|
1594
1592
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1595
|
-
interface MyCustomActionConfig
|
|
1593
|
+
interface MyCustomActionConfig {}
|
|
1596
1594
|
|
|
1597
1595
|
export default class MyCustomAction implements Core.Workflows
|
|
1598
1596
|
.CustomAction<MyCustomActionConfig> {
|
|
@@ -1652,11 +1650,10 @@ describe('MyCustomAction', () => {
|
|
|
1652
1650
|
},
|
|
1653
1651
|
{
|
|
1654
1652
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
1655
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
1656
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
1653
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
1657
1654
|
|
|
1658
1655
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1659
|
-
interface MyCustomActionConfig
|
|
1656
|
+
interface MyCustomActionConfig {}
|
|
1660
1657
|
|
|
1661
1658
|
export default class MyCustomAction implements Extend.Workflows
|
|
1662
1659
|
.CustomAction<MyCustomActionConfig> {
|
|
@@ -1743,7 +1740,7 @@ generated
|
|
|
1743
1740
|
`
|
|
1744
1741
|
},
|
|
1745
1742
|
{
|
|
1746
|
-
path: "root/custom-objects/package.json",
|
|
1743
|
+
path: "root/custom-objects/package.json.mustache",
|
|
1747
1744
|
content: `{
|
|
1748
1745
|
"name": "custom-objects",
|
|
1749
1746
|
"type": "module",
|
|
@@ -1756,12 +1753,12 @@ generated
|
|
|
1756
1753
|
"test": "vitest run"
|
|
1757
1754
|
},
|
|
1758
1755
|
"dependencies": {
|
|
1759
|
-
"@stripe/extensibility-custom-objects": "
|
|
1760
|
-
"@stripe/extensibility-sdk": "
|
|
1756
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
1757
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
1761
1758
|
},
|
|
1762
1759
|
"devDependencies": {
|
|
1763
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
1764
|
-
"@stripe/extensibility-test-helpers": "
|
|
1760
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
1761
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
1765
1762
|
}
|
|
1766
1763
|
}
|
|
1767
1764
|
`
|
|
@@ -2734,7 +2731,7 @@ var _ExtensionTemplateManager = class extends _TemplateManager {
|
|
|
2734
2731
|
import { _workspaceVersion } from "@stripe/extensibility-tool-utils";
|
|
2735
2732
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
2736
2733
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
2737
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
2734
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${_workspaceVersion(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
2738
2735
|
function _createExtensionEslintConfigFile(params, context) {
|
|
2739
2736
|
const { id, extensionInterfaceId } = params;
|
|
2740
2737
|
const { fs: fs2 } = context;
|
|
@@ -2796,6 +2793,7 @@ function _createBaseOutput(params, context) {
|
|
|
2796
2793
|
// src/templates/extensions/core.workflows.custom_action.ts
|
|
2797
2794
|
var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
|
|
2798
2795
|
var customActionTemplate = {
|
|
2796
|
+
deprecated: true,
|
|
2799
2797
|
methods: {
|
|
2800
2798
|
execute: { implementation_types: ["script", "remote-function"] },
|
|
2801
2799
|
get_form_state: { implementation_types: ["script", "remote-function"] }
|
|
@@ -3254,7 +3252,20 @@ var _rootWorkspaceTemplate = {
|
|
|
3254
3252
|
},
|
|
3255
3253
|
{
|
|
3256
3254
|
path: "custom-objects/package.json",
|
|
3257
|
-
content: fs2.
|
|
3255
|
+
content: fs2.mustache(
|
|
3256
|
+
{
|
|
3257
|
+
customObjectsVersion: _workspaceVersion2(
|
|
3258
|
+
"@stripe/extensibility-custom-objects"
|
|
3259
|
+
),
|
|
3260
|
+
sdkVersion: _workspaceVersion2("@stripe/extensibility-sdk"),
|
|
3261
|
+
customObjectsToolsVersion: _workspaceVersion2(
|
|
3262
|
+
"@stripe/extensibility-custom-objects-tools"
|
|
3263
|
+
),
|
|
3264
|
+
testHelpersVersion: _workspaceVersion2("@stripe/extensibility-test-helpers")
|
|
3265
|
+
},
|
|
3266
|
+
"custom-objects",
|
|
3267
|
+
"package.json.mustache"
|
|
3268
|
+
),
|
|
3258
3269
|
precious: true
|
|
3259
3270
|
},
|
|
3260
3271
|
{
|
|
@@ -73,11 +73,10 @@ describe('MyDiscountCalculation', () => {
|
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
path: "extensions/billing.bill.discount_calculation/index.ts",
|
|
76
|
-
content: `import type { Billing } from '@stripe/extensibility-sdk
|
|
77
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
76
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
78
77
|
|
|
79
78
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
80
|
-
interface MyDiscountCalculationConfig
|
|
79
|
+
interface MyDiscountCalculationConfig {}
|
|
81
80
|
|
|
82
81
|
export default class MyDiscountCalculation implements Billing.Bill
|
|
83
82
|
.DiscountCalculation<MyDiscountCalculationConfig> {
|
|
@@ -99,32 +98,32 @@ export default class MyDiscountCalculation implements Billing.Bill
|
|
|
99
98
|
path: "extensions/billing.customer_balance_application/index.test.ts",
|
|
100
99
|
content: `import { beforeEach, describe, it, expect } from 'vitest';
|
|
101
100
|
|
|
102
|
-
import
|
|
101
|
+
import MyBalanceApp from './index.js';
|
|
103
102
|
|
|
104
|
-
describe('
|
|
105
|
-
let instance:
|
|
103
|
+
describe('MyBalanceApp', () => {
|
|
104
|
+
let instance: MyBalanceApp;
|
|
106
105
|
|
|
107
106
|
beforeEach(() => {
|
|
108
|
-
instance = new
|
|
107
|
+
instance = new MyBalanceApp();
|
|
109
108
|
});
|
|
110
109
|
|
|
111
110
|
it('should be constructable', () => {
|
|
112
|
-
expect(instance).toBeInstanceOf(
|
|
111
|
+
expect(instance).toBeInstanceOf(MyBalanceApp);
|
|
113
112
|
});
|
|
114
113
|
});
|
|
115
114
|
`
|
|
116
115
|
},
|
|
117
116
|
{
|
|
118
117
|
path: "extensions/billing.customer_balance_application/index.ts",
|
|
119
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
118
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
120
119
|
|
|
121
120
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
122
|
-
interface
|
|
121
|
+
interface MyBalanceAppConfig {}
|
|
123
122
|
|
|
124
|
-
export default class
|
|
123
|
+
export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
125
124
|
computeAppliedCustomerBalance(
|
|
126
125
|
request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
127
|
-
_config:
|
|
126
|
+
_config: MyBalanceAppConfig,
|
|
128
127
|
_context: Context
|
|
129
128
|
) {
|
|
130
129
|
// TODO: implement your customer balance logic here
|
|
@@ -157,10 +156,10 @@ describe('MyInvoiceCollectionSetting', () => {
|
|
|
157
156
|
},
|
|
158
157
|
{
|
|
159
158
|
path: "extensions/billing.invoice_collection_setting/index.ts",
|
|
160
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
159
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
161
160
|
|
|
162
161
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
163
|
-
interface MyInvoiceCollectionSettingConfig
|
|
162
|
+
interface MyInvoiceCollectionSettingConfig {}
|
|
164
163
|
|
|
165
164
|
export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
|
|
166
165
|
collectionOverride(
|
|
@@ -196,10 +195,10 @@ describe('MyProrations', () => {
|
|
|
196
195
|
},
|
|
197
196
|
{
|
|
198
197
|
path: "extensions/billing.prorations/index.ts",
|
|
199
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
198
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
200
199
|
|
|
201
200
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
202
|
-
interface MyProrationsConfig
|
|
201
|
+
interface MyProrationsConfig {}
|
|
203
202
|
|
|
204
203
|
export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
|
|
205
204
|
prorateItems(
|
|
@@ -237,10 +236,10 @@ describe('MyRecurringBillingItemHandling', () => {
|
|
|
237
236
|
},
|
|
238
237
|
{
|
|
239
238
|
path: "extensions/billing.recurring_billing_item_handling/index.ts",
|
|
240
|
-
content: `import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
239
|
+
content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
241
240
|
|
|
242
241
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
243
|
-
interface MyRecurringBillingItemHandlingConfig
|
|
242
|
+
interface MyRecurringBillingItemHandlingConfig {}
|
|
244
243
|
|
|
245
244
|
export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
|
|
246
245
|
beforeItemCreation(
|
|
@@ -487,11 +486,10 @@ describe('MyCustomAction', () => {
|
|
|
487
486
|
},
|
|
488
487
|
{
|
|
489
488
|
path: "extensions/core.workflows.custom_action/index.ts",
|
|
490
|
-
content: `import type { Core } from '@stripe/extensibility-sdk
|
|
491
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
489
|
+
content: `import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
492
490
|
|
|
493
491
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
494
|
-
interface MyCustomActionConfig
|
|
492
|
+
interface MyCustomActionConfig {}
|
|
495
493
|
|
|
496
494
|
export default class MyCustomAction implements Core.Workflows
|
|
497
495
|
.CustomAction<MyCustomActionConfig> {
|
|
@@ -551,11 +549,10 @@ describe('MyCustomAction', () => {
|
|
|
551
549
|
},
|
|
552
550
|
{
|
|
553
551
|
path: "extensions/extend.workflows.custom_action/index.ts",
|
|
554
|
-
content: `import type { Extend } from '@stripe/extensibility-sdk
|
|
555
|
-
import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
552
|
+
content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
556
553
|
|
|
557
554
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
558
|
-
interface MyCustomActionConfig
|
|
555
|
+
interface MyCustomActionConfig {}
|
|
559
556
|
|
|
560
557
|
export default class MyCustomAction implements Extend.Workflows
|
|
561
558
|
.CustomAction<MyCustomActionConfig> {
|
|
@@ -642,7 +639,7 @@ generated
|
|
|
642
639
|
`
|
|
643
640
|
},
|
|
644
641
|
{
|
|
645
|
-
path: "root/custom-objects/package.json",
|
|
642
|
+
path: "root/custom-objects/package.json.mustache",
|
|
646
643
|
content: `{
|
|
647
644
|
"name": "custom-objects",
|
|
648
645
|
"type": "module",
|
|
@@ -655,12 +652,12 @@ generated
|
|
|
655
652
|
"test": "vitest run"
|
|
656
653
|
},
|
|
657
654
|
"dependencies": {
|
|
658
|
-
"@stripe/extensibility-custom-objects": "
|
|
659
|
-
"@stripe/extensibility-sdk": "
|
|
655
|
+
"@stripe/extensibility-custom-objects": "{{ customObjectsVersion }}",
|
|
656
|
+
"@stripe/extensibility-sdk": "{{ sdkVersion }}"
|
|
660
657
|
},
|
|
661
658
|
"devDependencies": {
|
|
662
|
-
"@stripe/extensibility-custom-objects-tools": "
|
|
663
|
-
"@stripe/extensibility-test-helpers": "
|
|
659
|
+
"@stripe/extensibility-custom-objects-tools": "{{ customObjectsToolsVersion }}",
|
|
660
|
+
"@stripe/extensibility-test-helpers": "{{ testHelpersVersion }}"
|
|
664
661
|
}
|
|
665
662
|
}
|
|
666
663
|
`
|
|
@@ -1017,7 +1014,7 @@ function _devNpmDep(name, version) {
|
|
|
1017
1014
|
var import_extensibility_tool_utils4 = require("@stripe/extensibility-tool-utils");
|
|
1018
1015
|
var SDK_PACKAGE_NAME = "@stripe/extensibility-sdk";
|
|
1019
1016
|
var LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
1020
|
-
var LANGUAGE_SERVER_PACKAGE_VERSION =
|
|
1017
|
+
var LANGUAGE_SERVER_PACKAGE_VERSION = `^${(0, import_extensibility_tool_utils4._workspaceVersion)(LANGUAGE_SERVER_PACKAGE_NAME)}`;
|
|
1021
1018
|
function _createExtensionEslintConfigFile(params, context) {
|
|
1022
1019
|
const { id, extensionInterfaceId } = params;
|
|
1023
1020
|
const { fs: fs2 } = context;
|
|
@@ -1079,6 +1076,7 @@ function _createBaseOutput(params, context) {
|
|
|
1079
1076
|
// src/templates/extensions/core.workflows.custom_action.ts
|
|
1080
1077
|
var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
|
|
1081
1078
|
var customActionTemplate = {
|
|
1079
|
+
deprecated: true,
|
|
1082
1080
|
methods: {
|
|
1083
1081
|
execute: { implementation_types: ["script", "remote-function"] },
|
|
1084
1082
|
get_form_state: { implementation_types: ["script", "remote-function"] }
|