@stripe/extensibility-dev-tools 0.23.7 → 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.
Files changed (37) hide show
  1. package/dist/bin/build-custom-object-definitions.cjs +22 -13
  2. package/dist/bin/build-custom-object-definitions.js +22 -13
  3. package/dist/bin/create-upload-image.cjs +22 -13
  4. package/dist/bin/create-upload-image.js +22 -13
  5. package/dist/bin/dev-tools-rpc.cjs +8 -7
  6. package/dist/bin/dev-tools-rpc.js +8 -7
  7. package/dist/bin/gen-workspace.cjs +8 -7
  8. package/dist/bin/gen-workspace.js +8 -7
  9. package/dist/bin/template-info.cjs +8 -7
  10. package/dist/bin/template-info.js +8 -7
  11. package/dist/custom-objects/to-proto-json.d.ts +2 -1
  12. package/dist/custom-objects/to-proto-json.d.ts.map +1 -1
  13. package/dist/dependencies/index.d.ts +7 -7
  14. package/dist/index.cjs +8 -7
  15. package/dist/index.js +8 -7
  16. package/dist/manifest/manifest-v2.d.ts +8 -3
  17. package/dist/templates/diff-viewer/types.d.ts +2 -2
  18. package/dist/templates/extensions/base.d.ts +4 -2
  19. package/dist/templates/extensions/core.workflows.custom_action.d.ts.map +1 -1
  20. package/dist/templates/extensions/types.d.ts +9 -3
  21. package/dist/templates/file-writer.d.ts +2 -2
  22. package/dist/templates/index.cjs +8 -7
  23. package/dist/templates/index.js +8 -7
  24. package/dist/templates/root/index.d.ts +1 -1
  25. package/dist/tsconfig.build.tsbuildinfo +1 -1
  26. package/dist/workspace/index.cjs +8 -7
  27. package/dist/workspace/index.d.ts +34 -30
  28. package/dist/workspace/index.js +8 -7
  29. package/package.json +2 -2
  30. package/templates/extensions/billing.bill.discount_calculation/index.ts +1 -1
  31. package/templates/extensions/billing.customer_balance_application/index.ts +1 -1
  32. package/templates/extensions/billing.invoice_collection_setting/index.ts +1 -1
  33. package/templates/extensions/billing.prorations/index.ts +1 -1
  34. package/templates/extensions/billing.recurring_billing_item_handling/index.ts +1 -1
  35. package/templates/extensions/core.workflows.custom_action/index.ts +1 -1
  36. package/templates/extensions/extend.workflows.custom_action/index.ts +1 -1
  37. package/dist/api-surface.d.ts.map +0 -1
@@ -328,7 +328,7 @@ describe('MyDiscountCalculation', () => {
328
328
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
329
329
 
330
330
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
331
- interface MyDiscountCalculationConfig extends Record<string, unknown> {}
331
+ interface MyDiscountCalculationConfig {}
332
332
 
333
333
  export default class MyDiscountCalculation implements Billing.Bill
334
334
  .DiscountCalculation<MyDiscountCalculationConfig> {
@@ -370,7 +370,7 @@ describe('MyBalanceApp', () => {
370
370
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
371
371
 
372
372
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
373
- interface MyBalanceAppConfig extends Record<string, unknown> {}
373
+ interface MyBalanceAppConfig {}
374
374
 
375
375
  export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
376
376
  computeAppliedCustomerBalance(
@@ -411,7 +411,7 @@ describe('MyInvoiceCollectionSetting', () => {
411
411
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
412
412
 
413
413
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
414
- interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
414
+ interface MyInvoiceCollectionSettingConfig {}
415
415
 
416
416
  export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
417
417
  collectionOverride(
@@ -450,7 +450,7 @@ describe('MyProrations', () => {
450
450
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
451
451
 
452
452
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
453
- interface MyProrationsConfig extends Record<string, unknown> {}
453
+ interface MyProrationsConfig {}
454
454
 
455
455
  export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
456
456
  prorateItems(
@@ -491,7 +491,7 @@ describe('MyRecurringBillingItemHandling', () => {
491
491
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
492
492
 
493
493
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
494
- interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
494
+ interface MyRecurringBillingItemHandlingConfig {}
495
495
 
496
496
  export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
497
497
  beforeItemCreation(
@@ -741,7 +741,7 @@ describe('MyCustomAction', () => {
741
741
  content: `import type { Core, Context } from '@stripe/extensibility-sdk';
742
742
 
743
743
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
744
- interface MyCustomActionConfig extends Record<string, unknown> {}
744
+ interface MyCustomActionConfig {}
745
745
 
746
746
  export default class MyCustomAction implements Core.Workflows
747
747
  .CustomAction<MyCustomActionConfig> {
@@ -804,7 +804,7 @@ describe('MyCustomAction', () => {
804
804
  content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
805
805
 
806
806
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
807
- interface MyCustomActionConfig extends Record<string, unknown> {}
807
+ interface MyCustomActionConfig {}
808
808
 
809
809
  export default class MyCustomAction implements Extend.Workflows
810
810
  .CustomAction<MyCustomActionConfig> {
@@ -1328,6 +1328,7 @@ function _createBaseOutput(params, context) {
1328
1328
  // src/templates/extensions/core.workflows.custom_action.ts
1329
1329
  var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
1330
1330
  var customActionTemplate = {
1331
+ deprecated: true,
1331
1332
  methods: {
1332
1333
  execute: { implementation_types: ["script", "remote-function"] },
1333
1334
  get_form_state: { implementation_types: ["script", "remote-function"] }
@@ -1831,7 +1832,12 @@ function toFieldSchema(schema, required) {
1831
1832
  fieldSchema.valuesPresence = FieldPresence.PRESENT;
1832
1833
  }
1833
1834
  if (schema.default !== void 0) {
1834
- fieldSchema.default = toDefaultValue(schema.default, fieldSchema.type);
1835
+ if (dataType === DataType.ENUM_TYPE && enumValues && (typeof schema.default !== "string" || !enumValues.includes(schema.default))) {
1836
+ throw new Error(
1837
+ `Default value ${JSON.stringify(schema.default)} is not a valid enum value. Expected one of: ${enumValues.join(", ")}`
1838
+ );
1839
+ }
1840
+ fieldSchema.default = toDefaultValue(schema.default, dataType);
1835
1841
  }
1836
1842
  return fieldSchema;
1837
1843
  }
@@ -1894,19 +1900,22 @@ function toValueBoundary(value) {
1894
1900
  `ValueBoundary only supports integers, got ${String(value)}. Custom object numeric fields are integer-only.`
1895
1901
  );
1896
1902
  }
1897
- return { value: { $case: "integerBoundary", value } };
1903
+ return { integerBoundary: value };
1898
1904
  }
1899
1905
  function toDefaultValue(value, dataType) {
1900
1906
  if (dataType === DataType.STRING_TYPE && typeof value === "string") {
1901
- return { value: { $case: "stringDefault", value } };
1907
+ return { stringDefault: value };
1908
+ }
1909
+ if (dataType === DataType.ENUM_TYPE && typeof value === "string") {
1910
+ return { stringDefault: value };
1902
1911
  }
1903
1912
  if (dataType === DataType.INTEGER_TYPE && typeof value === "number") {
1904
- return { value: { $case: "integerDefault", value } };
1913
+ return { integerDefault: value };
1905
1914
  }
1906
1915
  if (dataType === DataType.BOOLEAN_TYPE && typeof value === "boolean") {
1907
- return { value: { $case: "booleanDefault", value } };
1916
+ return { booleanDefault: value };
1908
1917
  }
1909
- return { value: void 0 };
1918
+ return {};
1910
1919
  }
1911
1920
 
1912
1921
  // src/custom-objects/build-definitions.ts
@@ -305,7 +305,7 @@ describe('MyDiscountCalculation', () => {
305
305
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
306
306
 
307
307
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
308
- interface MyDiscountCalculationConfig extends Record<string, unknown> {}
308
+ interface MyDiscountCalculationConfig {}
309
309
 
310
310
  export default class MyDiscountCalculation implements Billing.Bill
311
311
  .DiscountCalculation<MyDiscountCalculationConfig> {
@@ -347,7 +347,7 @@ describe('MyBalanceApp', () => {
347
347
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
348
348
 
349
349
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
350
- interface MyBalanceAppConfig extends Record<string, unknown> {}
350
+ interface MyBalanceAppConfig {}
351
351
 
352
352
  export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
353
353
  computeAppliedCustomerBalance(
@@ -388,7 +388,7 @@ describe('MyInvoiceCollectionSetting', () => {
388
388
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
389
389
 
390
390
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
391
- interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
391
+ interface MyInvoiceCollectionSettingConfig {}
392
392
 
393
393
  export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
394
394
  collectionOverride(
@@ -427,7 +427,7 @@ describe('MyProrations', () => {
427
427
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
428
428
 
429
429
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
430
- interface MyProrationsConfig extends Record<string, unknown> {}
430
+ interface MyProrationsConfig {}
431
431
 
432
432
  export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
433
433
  prorateItems(
@@ -468,7 +468,7 @@ describe('MyRecurringBillingItemHandling', () => {
468
468
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
469
469
 
470
470
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
471
- interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
471
+ interface MyRecurringBillingItemHandlingConfig {}
472
472
 
473
473
  export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
474
474
  beforeItemCreation(
@@ -718,7 +718,7 @@ describe('MyCustomAction', () => {
718
718
  content: `import type { Core, Context } from '@stripe/extensibility-sdk';
719
719
 
720
720
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
721
- interface MyCustomActionConfig extends Record<string, unknown> {}
721
+ interface MyCustomActionConfig {}
722
722
 
723
723
  export default class MyCustomAction implements Core.Workflows
724
724
  .CustomAction<MyCustomActionConfig> {
@@ -781,7 +781,7 @@ describe('MyCustomAction', () => {
781
781
  content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
782
782
 
783
783
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
784
- interface MyCustomActionConfig extends Record<string, unknown> {}
784
+ interface MyCustomActionConfig {}
785
785
 
786
786
  export default class MyCustomAction implements Extend.Workflows
787
787
  .CustomAction<MyCustomActionConfig> {
@@ -1305,6 +1305,7 @@ function _createBaseOutput(params, context) {
1305
1305
  // src/templates/extensions/core.workflows.custom_action.ts
1306
1306
  var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
1307
1307
  var customActionTemplate = {
1308
+ deprecated: true,
1308
1309
  methods: {
1309
1310
  execute: { implementation_types: ["script", "remote-function"] },
1310
1311
  get_form_state: { implementation_types: ["script", "remote-function"] }
@@ -1808,7 +1809,12 @@ function toFieldSchema(schema, required) {
1808
1809
  fieldSchema.valuesPresence = FieldPresence.PRESENT;
1809
1810
  }
1810
1811
  if (schema.default !== void 0) {
1811
- fieldSchema.default = toDefaultValue(schema.default, fieldSchema.type);
1812
+ if (dataType === DataType.ENUM_TYPE && enumValues && (typeof schema.default !== "string" || !enumValues.includes(schema.default))) {
1813
+ throw new Error(
1814
+ `Default value ${JSON.stringify(schema.default)} is not a valid enum value. Expected one of: ${enumValues.join(", ")}`
1815
+ );
1816
+ }
1817
+ fieldSchema.default = toDefaultValue(schema.default, dataType);
1812
1818
  }
1813
1819
  return fieldSchema;
1814
1820
  }
@@ -1871,19 +1877,22 @@ function toValueBoundary(value) {
1871
1877
  `ValueBoundary only supports integers, got ${String(value)}. Custom object numeric fields are integer-only.`
1872
1878
  );
1873
1879
  }
1874
- return { value: { $case: "integerBoundary", value } };
1880
+ return { integerBoundary: value };
1875
1881
  }
1876
1882
  function toDefaultValue(value, dataType) {
1877
1883
  if (dataType === DataType.STRING_TYPE && typeof value === "string") {
1878
- return { value: { $case: "stringDefault", value } };
1884
+ return { stringDefault: value };
1885
+ }
1886
+ if (dataType === DataType.ENUM_TYPE && typeof value === "string") {
1887
+ return { stringDefault: value };
1879
1888
  }
1880
1889
  if (dataType === DataType.INTEGER_TYPE && typeof value === "number") {
1881
- return { value: { $case: "integerDefault", value } };
1890
+ return { integerDefault: value };
1882
1891
  }
1883
1892
  if (dataType === DataType.BOOLEAN_TYPE && typeof value === "boolean") {
1884
- return { value: { $case: "booleanDefault", value } };
1893
+ return { booleanDefault: value };
1885
1894
  }
1886
- return { value: void 0 };
1895
+ return {};
1887
1896
  }
1888
1897
 
1889
1898
  // src/custom-objects/build-definitions.ts
@@ -331,7 +331,7 @@ describe('MyDiscountCalculation', () => {
331
331
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
332
332
 
333
333
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
334
- interface MyDiscountCalculationConfig extends Record<string, unknown> {}
334
+ interface MyDiscountCalculationConfig {}
335
335
 
336
336
  export default class MyDiscountCalculation implements Billing.Bill
337
337
  .DiscountCalculation<MyDiscountCalculationConfig> {
@@ -373,7 +373,7 @@ describe('MyBalanceApp', () => {
373
373
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
374
374
 
375
375
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
376
- interface MyBalanceAppConfig extends Record<string, unknown> {}
376
+ interface MyBalanceAppConfig {}
377
377
 
378
378
  export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
379
379
  computeAppliedCustomerBalance(
@@ -414,7 +414,7 @@ describe('MyInvoiceCollectionSetting', () => {
414
414
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
415
415
 
416
416
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
417
- interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
417
+ interface MyInvoiceCollectionSettingConfig {}
418
418
 
419
419
  export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
420
420
  collectionOverride(
@@ -453,7 +453,7 @@ describe('MyProrations', () => {
453
453
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
454
454
 
455
455
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
456
- interface MyProrationsConfig extends Record<string, unknown> {}
456
+ interface MyProrationsConfig {}
457
457
 
458
458
  export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
459
459
  prorateItems(
@@ -494,7 +494,7 @@ describe('MyRecurringBillingItemHandling', () => {
494
494
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
495
495
 
496
496
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
497
- interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
497
+ interface MyRecurringBillingItemHandlingConfig {}
498
498
 
499
499
  export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
500
500
  beforeItemCreation(
@@ -744,7 +744,7 @@ describe('MyCustomAction', () => {
744
744
  content: `import type { Core, Context } from '@stripe/extensibility-sdk';
745
745
 
746
746
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
747
- interface MyCustomActionConfig extends Record<string, unknown> {}
747
+ interface MyCustomActionConfig {}
748
748
 
749
749
  export default class MyCustomAction implements Core.Workflows
750
750
  .CustomAction<MyCustomActionConfig> {
@@ -807,7 +807,7 @@ describe('MyCustomAction', () => {
807
807
  content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
808
808
 
809
809
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
810
- interface MyCustomActionConfig extends Record<string, unknown> {}
810
+ interface MyCustomActionConfig {}
811
811
 
812
812
  export default class MyCustomAction implements Extend.Workflows
813
813
  .CustomAction<MyCustomActionConfig> {
@@ -1331,6 +1331,7 @@ function _createBaseOutput(params, context) {
1331
1331
  // src/templates/extensions/core.workflows.custom_action.ts
1332
1332
  var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
1333
1333
  var customActionTemplate = {
1334
+ deprecated: true,
1334
1335
  methods: {
1335
1336
  execute: { implementation_types: ["script", "remote-function"] },
1336
1337
  get_form_state: { implementation_types: ["script", "remote-function"] }
@@ -1834,7 +1835,12 @@ function toFieldSchema(schema, required) {
1834
1835
  fieldSchema.valuesPresence = FieldPresence.PRESENT;
1835
1836
  }
1836
1837
  if (schema.default !== void 0) {
1837
- fieldSchema.default = toDefaultValue(schema.default, fieldSchema.type);
1838
+ if (dataType === DataType.ENUM_TYPE && enumValues && (typeof schema.default !== "string" || !enumValues.includes(schema.default))) {
1839
+ throw new Error(
1840
+ `Default value ${JSON.stringify(schema.default)} is not a valid enum value. Expected one of: ${enumValues.join(", ")}`
1841
+ );
1842
+ }
1843
+ fieldSchema.default = toDefaultValue(schema.default, dataType);
1838
1844
  }
1839
1845
  return fieldSchema;
1840
1846
  }
@@ -1897,19 +1903,22 @@ function toValueBoundary(value) {
1897
1903
  `ValueBoundary only supports integers, got ${String(value)}. Custom object numeric fields are integer-only.`
1898
1904
  );
1899
1905
  }
1900
- return { value: { $case: "integerBoundary", value } };
1906
+ return { integerBoundary: value };
1901
1907
  }
1902
1908
  function toDefaultValue(value, dataType) {
1903
1909
  if (dataType === DataType.STRING_TYPE && typeof value === "string") {
1904
- return { value: { $case: "stringDefault", value } };
1910
+ return { stringDefault: value };
1911
+ }
1912
+ if (dataType === DataType.ENUM_TYPE && typeof value === "string") {
1913
+ return { stringDefault: value };
1905
1914
  }
1906
1915
  if (dataType === DataType.INTEGER_TYPE && typeof value === "number") {
1907
- return { value: { $case: "integerDefault", value } };
1916
+ return { integerDefault: value };
1908
1917
  }
1909
1918
  if (dataType === DataType.BOOLEAN_TYPE && typeof value === "boolean") {
1910
- return { value: { $case: "booleanDefault", value } };
1919
+ return { booleanDefault: value };
1911
1920
  }
1912
- return { value: void 0 };
1921
+ return {};
1913
1922
  }
1914
1923
 
1915
1924
  // src/custom-objects/build-definitions.ts
@@ -308,7 +308,7 @@ describe('MyDiscountCalculation', () => {
308
308
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
309
309
 
310
310
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
311
- interface MyDiscountCalculationConfig extends Record<string, unknown> {}
311
+ interface MyDiscountCalculationConfig {}
312
312
 
313
313
  export default class MyDiscountCalculation implements Billing.Bill
314
314
  .DiscountCalculation<MyDiscountCalculationConfig> {
@@ -350,7 +350,7 @@ describe('MyBalanceApp', () => {
350
350
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
351
351
 
352
352
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
353
- interface MyBalanceAppConfig extends Record<string, unknown> {}
353
+ interface MyBalanceAppConfig {}
354
354
 
355
355
  export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
356
356
  computeAppliedCustomerBalance(
@@ -391,7 +391,7 @@ describe('MyInvoiceCollectionSetting', () => {
391
391
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
392
392
 
393
393
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
394
- interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
394
+ interface MyInvoiceCollectionSettingConfig {}
395
395
 
396
396
  export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
397
397
  collectionOverride(
@@ -430,7 +430,7 @@ describe('MyProrations', () => {
430
430
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
431
431
 
432
432
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
433
- interface MyProrationsConfig extends Record<string, unknown> {}
433
+ interface MyProrationsConfig {}
434
434
 
435
435
  export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
436
436
  prorateItems(
@@ -471,7 +471,7 @@ describe('MyRecurringBillingItemHandling', () => {
471
471
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
472
472
 
473
473
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
474
- interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
474
+ interface MyRecurringBillingItemHandlingConfig {}
475
475
 
476
476
  export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
477
477
  beforeItemCreation(
@@ -721,7 +721,7 @@ describe('MyCustomAction', () => {
721
721
  content: `import type { Core, Context } from '@stripe/extensibility-sdk';
722
722
 
723
723
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
724
- interface MyCustomActionConfig extends Record<string, unknown> {}
724
+ interface MyCustomActionConfig {}
725
725
 
726
726
  export default class MyCustomAction implements Core.Workflows
727
727
  .CustomAction<MyCustomActionConfig> {
@@ -784,7 +784,7 @@ describe('MyCustomAction', () => {
784
784
  content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
785
785
 
786
786
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
787
- interface MyCustomActionConfig extends Record<string, unknown> {}
787
+ interface MyCustomActionConfig {}
788
788
 
789
789
  export default class MyCustomAction implements Extend.Workflows
790
790
  .CustomAction<MyCustomActionConfig> {
@@ -1308,6 +1308,7 @@ function _createBaseOutput(params, context) {
1308
1308
  // src/templates/extensions/core.workflows.custom_action.ts
1309
1309
  var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
1310
1310
  var customActionTemplate = {
1311
+ deprecated: true,
1311
1312
  methods: {
1312
1313
  execute: { implementation_types: ["script", "remote-function"] },
1313
1314
  get_form_state: { implementation_types: ["script", "remote-function"] }
@@ -1811,7 +1812,12 @@ function toFieldSchema(schema, required) {
1811
1812
  fieldSchema.valuesPresence = FieldPresence.PRESENT;
1812
1813
  }
1813
1814
  if (schema.default !== void 0) {
1814
- fieldSchema.default = toDefaultValue(schema.default, fieldSchema.type);
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);
1815
1821
  }
1816
1822
  return fieldSchema;
1817
1823
  }
@@ -1874,19 +1880,22 @@ function toValueBoundary(value) {
1874
1880
  `ValueBoundary only supports integers, got ${String(value)}. Custom object numeric fields are integer-only.`
1875
1881
  );
1876
1882
  }
1877
- return { value: { $case: "integerBoundary", value } };
1883
+ return { integerBoundary: value };
1878
1884
  }
1879
1885
  function toDefaultValue(value, dataType) {
1880
1886
  if (dataType === DataType.STRING_TYPE && typeof value === "string") {
1881
- return { value: { $case: "stringDefault", value } };
1887
+ return { stringDefault: value };
1888
+ }
1889
+ if (dataType === DataType.ENUM_TYPE && typeof value === "string") {
1890
+ return { stringDefault: value };
1882
1891
  }
1883
1892
  if (dataType === DataType.INTEGER_TYPE && typeof value === "number") {
1884
- return { value: { $case: "integerDefault", value } };
1893
+ return { integerDefault: value };
1885
1894
  }
1886
1895
  if (dataType === DataType.BOOLEAN_TYPE && typeof value === "boolean") {
1887
- return { value: { $case: "booleanDefault", value } };
1896
+ return { booleanDefault: value };
1888
1897
  }
1889
- return { value: void 0 };
1898
+ return {};
1890
1899
  }
1891
1900
 
1892
1901
  // src/custom-objects/build-definitions.ts
@@ -128,7 +128,7 @@ describe('MyDiscountCalculation', () => {
128
128
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
129
129
 
130
130
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
131
- interface MyDiscountCalculationConfig extends Record<string, unknown> {}
131
+ interface MyDiscountCalculationConfig {}
132
132
 
133
133
  export default class MyDiscountCalculation implements Billing.Bill
134
134
  .DiscountCalculation<MyDiscountCalculationConfig> {
@@ -170,7 +170,7 @@ describe('MyBalanceApp', () => {
170
170
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
171
171
 
172
172
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
173
- interface MyBalanceAppConfig extends Record<string, unknown> {}
173
+ interface MyBalanceAppConfig {}
174
174
 
175
175
  export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
176
176
  computeAppliedCustomerBalance(
@@ -211,7 +211,7 @@ describe('MyInvoiceCollectionSetting', () => {
211
211
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
212
212
 
213
213
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
214
- interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
214
+ interface MyInvoiceCollectionSettingConfig {}
215
215
 
216
216
  export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
217
217
  collectionOverride(
@@ -250,7 +250,7 @@ describe('MyProrations', () => {
250
250
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
251
251
 
252
252
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
253
- interface MyProrationsConfig extends Record<string, unknown> {}
253
+ interface MyProrationsConfig {}
254
254
 
255
255
  export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
256
256
  prorateItems(
@@ -291,7 +291,7 @@ describe('MyRecurringBillingItemHandling', () => {
291
291
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
292
292
 
293
293
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
294
- interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
294
+ interface MyRecurringBillingItemHandlingConfig {}
295
295
 
296
296
  export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
297
297
  beforeItemCreation(
@@ -541,7 +541,7 @@ describe('MyCustomAction', () => {
541
541
  content: `import type { Core, Context } from '@stripe/extensibility-sdk';
542
542
 
543
543
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
544
- interface MyCustomActionConfig extends Record<string, unknown> {}
544
+ interface MyCustomActionConfig {}
545
545
 
546
546
  export default class MyCustomAction implements Core.Workflows
547
547
  .CustomAction<MyCustomActionConfig> {
@@ -604,7 +604,7 @@ describe('MyCustomAction', () => {
604
604
  content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
605
605
 
606
606
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
607
- interface MyCustomActionConfig extends Record<string, unknown> {}
607
+ interface MyCustomActionConfig {}
608
608
 
609
609
  export default class MyCustomAction implements Extend.Workflows
610
610
  .CustomAction<MyCustomActionConfig> {
@@ -1661,6 +1661,7 @@ function _createBaseOutput(params, context) {
1661
1661
  // src/templates/extensions/core.workflows.custom_action.ts
1662
1662
  var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
1663
1663
  var customActionTemplate = {
1664
+ deprecated: true,
1664
1665
  methods: {
1665
1666
  execute: { implementation_types: ["script", "remote-function"] },
1666
1667
  get_form_state: { implementation_types: ["script", "remote-function"] }
@@ -105,7 +105,7 @@ describe('MyDiscountCalculation', () => {
105
105
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
106
106
 
107
107
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
108
- interface MyDiscountCalculationConfig extends Record<string, unknown> {}
108
+ interface MyDiscountCalculationConfig {}
109
109
 
110
110
  export default class MyDiscountCalculation implements Billing.Bill
111
111
  .DiscountCalculation<MyDiscountCalculationConfig> {
@@ -147,7 +147,7 @@ describe('MyBalanceApp', () => {
147
147
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
148
148
 
149
149
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
150
- interface MyBalanceAppConfig extends Record<string, unknown> {}
150
+ interface MyBalanceAppConfig {}
151
151
 
152
152
  export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
153
153
  computeAppliedCustomerBalance(
@@ -188,7 +188,7 @@ describe('MyInvoiceCollectionSetting', () => {
188
188
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
189
189
 
190
190
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
191
- interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
191
+ interface MyInvoiceCollectionSettingConfig {}
192
192
 
193
193
  export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
194
194
  collectionOverride(
@@ -227,7 +227,7 @@ describe('MyProrations', () => {
227
227
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
228
228
 
229
229
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
230
- interface MyProrationsConfig extends Record<string, unknown> {}
230
+ interface MyProrationsConfig {}
231
231
 
232
232
  export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
233
233
  prorateItems(
@@ -268,7 +268,7 @@ describe('MyRecurringBillingItemHandling', () => {
268
268
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
269
269
 
270
270
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
271
- interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
271
+ interface MyRecurringBillingItemHandlingConfig {}
272
272
 
273
273
  export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
274
274
  beforeItemCreation(
@@ -518,7 +518,7 @@ describe('MyCustomAction', () => {
518
518
  content: `import type { Core, Context } from '@stripe/extensibility-sdk';
519
519
 
520
520
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
521
- interface MyCustomActionConfig extends Record<string, unknown> {}
521
+ interface MyCustomActionConfig {}
522
522
 
523
523
  export default class MyCustomAction implements Core.Workflows
524
524
  .CustomAction<MyCustomActionConfig> {
@@ -581,7 +581,7 @@ describe('MyCustomAction', () => {
581
581
  content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
582
582
 
583
583
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
584
- interface MyCustomActionConfig extends Record<string, unknown> {}
584
+ interface MyCustomActionConfig {}
585
585
 
586
586
  export default class MyCustomAction implements Extend.Workflows
587
587
  .CustomAction<MyCustomActionConfig> {
@@ -1638,6 +1638,7 @@ function _createBaseOutput(params, context) {
1638
1638
  // src/templates/extensions/core.workflows.custom_action.ts
1639
1639
  var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
1640
1640
  var customActionTemplate = {
1641
+ deprecated: true,
1641
1642
  methods: {
1642
1643
  execute: { implementation_types: ["script", "remote-function"] },
1643
1644
  get_form_state: { implementation_types: ["script", "remote-function"] }
@@ -1187,7 +1187,7 @@ describe('MyDiscountCalculation', () => {
1187
1187
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
1188
1188
 
1189
1189
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1190
- interface MyDiscountCalculationConfig extends Record<string, unknown> {}
1190
+ interface MyDiscountCalculationConfig {}
1191
1191
 
1192
1192
  export default class MyDiscountCalculation implements Billing.Bill
1193
1193
  .DiscountCalculation<MyDiscountCalculationConfig> {
@@ -1229,7 +1229,7 @@ describe('MyBalanceApp', () => {
1229
1229
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
1230
1230
 
1231
1231
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1232
- interface MyBalanceAppConfig extends Record<string, unknown> {}
1232
+ interface MyBalanceAppConfig {}
1233
1233
 
1234
1234
  export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
1235
1235
  computeAppliedCustomerBalance(
@@ -1270,7 +1270,7 @@ describe('MyInvoiceCollectionSetting', () => {
1270
1270
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
1271
1271
 
1272
1272
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1273
- interface MyInvoiceCollectionSettingConfig extends Record<string, unknown> {}
1273
+ interface MyInvoiceCollectionSettingConfig {}
1274
1274
 
1275
1275
  export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
1276
1276
  collectionOverride(
@@ -1309,7 +1309,7 @@ describe('MyProrations', () => {
1309
1309
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
1310
1310
 
1311
1311
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1312
- interface MyProrationsConfig extends Record<string, unknown> {}
1312
+ interface MyProrationsConfig {}
1313
1313
 
1314
1314
  export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
1315
1315
  prorateItems(
@@ -1350,7 +1350,7 @@ describe('MyRecurringBillingItemHandling', () => {
1350
1350
  content: `import type { Billing, Context } from '@stripe/extensibility-sdk';
1351
1351
 
1352
1352
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1353
- interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
1353
+ interface MyRecurringBillingItemHandlingConfig {}
1354
1354
 
1355
1355
  export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
1356
1356
  beforeItemCreation(
@@ -1600,7 +1600,7 @@ describe('MyCustomAction', () => {
1600
1600
  content: `import type { Core, Context } from '@stripe/extensibility-sdk';
1601
1601
 
1602
1602
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1603
- interface MyCustomActionConfig extends Record<string, unknown> {}
1603
+ interface MyCustomActionConfig {}
1604
1604
 
1605
1605
  export default class MyCustomAction implements Core.Workflows
1606
1606
  .CustomAction<MyCustomActionConfig> {
@@ -1663,7 +1663,7 @@ describe('MyCustomAction', () => {
1663
1663
  content: `import type { Extend, Context } from '@stripe/extensibility-sdk';
1664
1664
 
1665
1665
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1666
- interface MyCustomActionConfig extends Record<string, unknown> {}
1666
+ interface MyCustomActionConfig {}
1667
1667
 
1668
1668
  export default class MyCustomAction implements Extend.Workflows
1669
1669
  .CustomAction<MyCustomActionConfig> {
@@ -2799,6 +2799,7 @@ function _createBaseOutput(params, context) {
2799
2799
  // src/templates/extensions/core.workflows.custom_action.ts
2800
2800
  var EXTENSION_INTERFACE_ID = "core.workflows.custom_action";
2801
2801
  var customActionTemplate = {
2802
+ deprecated: true,
2802
2803
  methods: {
2803
2804
  execute: { implementation_types: ["script", "remote-function"] },
2804
2805
  get_form_state: { implementation_types: ["script", "remote-function"] }