autumn-js 1.2.38 → 1.2.40

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 (108) hide show
  1. package/dist/backend/adapters/express.js +319 -101
  2. package/dist/backend/adapters/express.mjs +8 -8
  3. package/dist/backend/adapters/fetch.js +319 -101
  4. package/dist/backend/adapters/fetch.mjs +8 -8
  5. package/dist/backend/adapters/hono.js +319 -101
  6. package/dist/backend/adapters/hono.mjs +8 -8
  7. package/dist/backend/adapters/index.js +319 -101
  8. package/dist/backend/adapters/index.mjs +11 -11
  9. package/dist/backend/adapters/next.js +319 -101
  10. package/dist/backend/adapters/next.mjs +8 -8
  11. package/dist/backend/{chunk-CEUAUTNB.mjs → chunk-BXGUUY7P.mjs} +1 -1
  12. package/dist/backend/{chunk-TIFFBW34.mjs → chunk-ONQXDLOV.mjs} +1 -1
  13. package/dist/backend/{chunk-ZR5K6VMA.mjs → chunk-PA7JVFRP.mjs} +1 -1
  14. package/dist/backend/{chunk-PKM7CEE3.mjs → chunk-RHDPT37C.mjs} +6 -6
  15. package/dist/backend/{chunk-N52JKSJ7.mjs → chunk-TOVDM235.mjs} +4 -4
  16. package/dist/backend/{chunk-5C7KP2BU.mjs → chunk-UQRKOR63.mjs} +319 -101
  17. package/dist/backend/{chunk-Y3AJLHVL.mjs → chunk-W3Y77RLS.mjs} +1 -1
  18. package/dist/backend/core/handlers/coreHandler.d.mts +1 -1
  19. package/dist/backend/core/handlers/coreHandler.d.ts +1 -1
  20. package/dist/backend/core/handlers/coreHandler.js +319 -101
  21. package/dist/backend/core/handlers/coreHandler.mjs +6 -6
  22. package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
  23. package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
  24. package/dist/backend/core/handlers/executeRoute.mjs +4 -4
  25. package/dist/backend/core/handlers/handleRouteByName.js +319 -101
  26. package/dist/backend/core/handlers/handleRouteByName.mjs +6 -6
  27. package/dist/backend/core/handlers/index.d.mts +1 -1
  28. package/dist/backend/core/handlers/index.d.ts +1 -1
  29. package/dist/backend/core/handlers/index.js +319 -101
  30. package/dist/backend/core/handlers/index.mjs +10 -10
  31. package/dist/backend/core/index.d.mts +1 -1
  32. package/dist/backend/core/index.d.ts +1 -1
  33. package/dist/backend/core/index.js +319 -101
  34. package/dist/backend/core/index.mjs +9 -9
  35. package/dist/backend/core/routes/index.d.mts +1 -1
  36. package/dist/backend/core/routes/index.d.ts +1 -1
  37. package/dist/backend/core/routes/index.mjs +1 -1
  38. package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
  39. package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
  40. package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
  41. package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
  42. package/dist/backend/core/routes/routeConfigs.mjs +1 -1
  43. package/dist/backend/core/types/handlerTypes.d.mts +1 -1
  44. package/dist/backend/core/types/handlerTypes.d.ts +1 -1
  45. package/dist/backend/core/types/index.d.mts +1 -1
  46. package/dist/backend/core/types/index.d.ts +1 -1
  47. package/dist/backend/core/types/routeTypes.d.mts +1 -1
  48. package/dist/backend/core/types/routeTypes.d.ts +1 -1
  49. package/dist/backend/core/utils/index.mjs +3 -3
  50. package/dist/backend/index.d.mts +2 -2
  51. package/dist/backend/index.d.ts +2 -2
  52. package/dist/backend/index.js +319 -101
  53. package/dist/backend/index.mjs +9 -9
  54. package/dist/backend/{routeTypes-gWhxv6xo.d.mts → routeTypes-BSYpcqUh.d.mts} +641 -97
  55. package/dist/backend/{routeTypes-C8YKwtFL.d.ts → routeTypes-D4BWkDI8.d.ts} +641 -97
  56. package/dist/better-auth/{chunk-A3ZOJU54.mjs → chunk-QHRMGNGT.mjs} +319 -101
  57. package/dist/better-auth/index.js +319 -101
  58. package/dist/better-auth/index.mjs +1 -1
  59. package/dist/better-auth/utils/handleBetterAuthRoute.js +319 -101
  60. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +1 -1
  61. package/dist/better-auth/utils/index.js +319 -101
  62. package/dist/better-auth/utils/index.mjs +1 -1
  63. package/dist/react/AutumnContext.d.mts +2 -2
  64. package/dist/react/AutumnContext.d.ts +2 -2
  65. package/dist/react/client/AutumnClient.d.mts +2 -2
  66. package/dist/react/client/AutumnClient.d.ts +2 -2
  67. package/dist/react/client/IAutumnClient.d.mts +2 -2
  68. package/dist/react/client/IAutumnClient.d.ts +2 -2
  69. package/dist/react/client/index.d.mts +2 -2
  70. package/dist/react/client/index.d.ts +2 -2
  71. package/dist/react/{customer-D811_jP2.d.ts → customer-CrxRrY4o.d.ts} +99 -24
  72. package/dist/react/{customer-CkuydPCd.d.mts → customer-DM044m1a.d.mts} +99 -24
  73. package/dist/react/hooks/index.d.mts +2 -2
  74. package/dist/react/hooks/index.d.ts +2 -2
  75. package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +1 -1
  76. package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +1 -1
  77. package/dist/react/hooks/internal/check/customerToFeatures.d.mts +1 -1
  78. package/dist/react/hooks/internal/check/customerToFeatures.d.ts +1 -1
  79. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +1 -1
  80. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +1 -1
  81. package/dist/react/hooks/internal/check/getCreditCost.d.mts +1 -1
  82. package/dist/react/hooks/internal/check/getCreditCost.d.ts +1 -1
  83. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +2 -2
  84. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +2 -2
  85. package/dist/react/hooks/internal/useCustomerActions.d.mts +2 -2
  86. package/dist/react/hooks/internal/useCustomerActions.d.ts +2 -2
  87. package/dist/react/hooks/useAggregateEvents.d.mts +1 -1
  88. package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
  89. package/dist/react/hooks/useCustomer.d.mts +2 -2
  90. package/dist/react/hooks/useCustomer.d.ts +2 -2
  91. package/dist/react/hooks/useEntity.d.mts +1 -1
  92. package/dist/react/hooks/useEntity.d.ts +1 -1
  93. package/dist/react/hooks/useListEvents.d.mts +1 -1
  94. package/dist/react/hooks/useListEvents.d.ts +1 -1
  95. package/dist/react/hooks/useListPlans.d.mts +1 -1
  96. package/dist/react/hooks/useListPlans.d.ts +1 -1
  97. package/dist/react/hooks/useReferrals.d.mts +1 -1
  98. package/dist/react/hooks/useReferrals.d.ts +1 -1
  99. package/dist/react/index.d.mts +2 -2
  100. package/dist/react/index.d.ts +2 -2
  101. package/dist/react/{params-CaUBdt-x.d.ts → params-B-1vi9za.d.ts} +60 -0
  102. package/dist/react/{params-C0cH2cYK.d.mts → params-Bf18ATYi.d.mts} +60 -0
  103. package/dist/sdk/index.d.mts +723 -106
  104. package/dist/sdk/index.d.ts +723 -106
  105. package/dist/sdk/index.js +391 -101
  106. package/dist/sdk/index.mjs +320 -102
  107. package/package.json +1 -1
  108. package/dist/backend/{chunk-MOHYGUMA.mjs → chunk-IXUCY7AU.mjs} +3 -3
@@ -5383,18 +5383,34 @@ var CreateEntityLimitTypeResponse = {
5383
5383
  Absolute: "absolute",
5384
5384
  UsagePercentage: "usage_percentage"
5385
5385
  };
5386
+ var CreateEntitySpendLimitSource = {
5387
+ Customer: "customer",
5388
+ Plan: "plan"
5389
+ };
5386
5390
  var CreateEntityIntervalResponse = {
5387
5391
  Day: "day",
5388
5392
  Week: "week",
5389
5393
  Month: "month",
5390
5394
  Year: "year"
5391
5395
  };
5396
+ var CreateEntityUsageLimitSource = {
5397
+ Customer: "customer",
5398
+ Plan: "plan"
5399
+ };
5392
5400
  var CreateEntityThresholdTypeResponse = {
5393
5401
  Usage: "usage",
5394
5402
  UsagePercentage: "usage_percentage",
5395
5403
  Remaining: "remaining",
5396
5404
  RemainingPercentage: "remaining_percentage"
5397
5405
  };
5406
+ var CreateEntityUsageAlertSource = {
5407
+ Customer: "customer",
5408
+ Plan: "plan"
5409
+ };
5410
+ var CreateEntityOverageAllowedSource = {
5411
+ Customer: "customer",
5412
+ Plan: "plan"
5413
+ };
5398
5414
  var CreateEntityProcessorType = {
5399
5415
  Stripe: "stripe",
5400
5416
  Revenuecat: "revenuecat"
@@ -5649,13 +5665,15 @@ var CreateEntityFlags$inboundSchema = z18.pipe(
5649
5665
  })
5650
5666
  );
5651
5667
  var CreateEntityLimitTypeResponse$inboundSchema = inboundSchema(CreateEntityLimitTypeResponse);
5668
+ var CreateEntitySpendLimitSource$inboundSchema = inboundSchema(CreateEntitySpendLimitSource);
5652
5669
  var CreateEntitySpendLimitResponse$inboundSchema = z18.pipe(
5653
5670
  z18.object({
5654
5671
  feature_id: optional3(string4()),
5655
5672
  enabled: z18._default(boolean2(), false),
5656
5673
  limit_type: optional3(CreateEntityLimitTypeResponse$inboundSchema),
5657
5674
  overage_limit: optional3(number2()),
5658
- skip_overage_billing: optional3(boolean2())
5675
+ skip_overage_billing: optional3(boolean2()),
5676
+ source: optional3(CreateEntitySpendLimitSource$inboundSchema)
5659
5677
  }),
5660
5678
  z18.transform((v) => {
5661
5679
  return remap(v, {
@@ -5670,6 +5688,7 @@ var CreateEntityIntervalResponse$inboundSchema = inboundSchema(CreateEntityInter
5670
5688
  var CreateEntityFilterResponse$inboundSchema = z18.object({
5671
5689
  properties: z18.record(z18.string(), z18.any())
5672
5690
  });
5691
+ var CreateEntityUsageLimitSource$inboundSchema = inboundSchema(CreateEntityUsageLimitSource);
5673
5692
  var CreateEntityUsageLimitResponse$inboundSchema = z18.pipe(
5674
5693
  z18.object({
5675
5694
  feature_id: string4(),
@@ -5679,7 +5698,8 @@ var CreateEntityUsageLimitResponse$inboundSchema = z18.pipe(
5679
5698
  filter: optional3(
5680
5699
  z18.lazy(() => CreateEntityFilterResponse$inboundSchema)
5681
5700
  ),
5682
- usage: optional3(number2())
5701
+ usage: optional3(number2()),
5702
+ source: optional3(CreateEntityUsageLimitSource$inboundSchema)
5683
5703
  }),
5684
5704
  z18.transform((v) => {
5685
5705
  return remap(v, {
@@ -5688,13 +5708,15 @@ var CreateEntityUsageLimitResponse$inboundSchema = z18.pipe(
5688
5708
  })
5689
5709
  );
5690
5710
  var CreateEntityThresholdTypeResponse$inboundSchema = inboundSchema(CreateEntityThresholdTypeResponse);
5711
+ var CreateEntityUsageAlertSource$inboundSchema = inboundSchema(CreateEntityUsageAlertSource);
5691
5712
  var CreateEntityUsageAlertResponse$inboundSchema = z18.pipe(
5692
5713
  z18.object({
5693
5714
  feature_id: optional3(string4()),
5694
5715
  enabled: z18._default(boolean2(), true),
5695
5716
  threshold: number2(),
5696
5717
  threshold_type: CreateEntityThresholdTypeResponse$inboundSchema,
5697
- name: optional3(string4())
5718
+ name: optional3(string4()),
5719
+ source: optional3(CreateEntityUsageAlertSource$inboundSchema)
5698
5720
  }),
5699
5721
  z18.transform((v) => {
5700
5722
  return remap(v, {
@@ -5703,10 +5725,12 @@ var CreateEntityUsageAlertResponse$inboundSchema = z18.pipe(
5703
5725
  });
5704
5726
  })
5705
5727
  );
5728
+ var CreateEntityOverageAllowedSource$inboundSchema = inboundSchema(CreateEntityOverageAllowedSource);
5706
5729
  var CreateEntityOverageAllowedResponse$inboundSchema = z18.pipe(
5707
5730
  z18.object({
5708
5731
  feature_id: string4(),
5709
- enabled: z18._default(boolean2(), false)
5732
+ enabled: z18._default(boolean2(), false),
5733
+ source: optional3(CreateEntityOverageAllowedSource$inboundSchema)
5710
5734
  }),
5711
5735
  z18.transform((v) => {
5712
5736
  return remap(v, {
@@ -8078,22 +8102,42 @@ var CustomerPurchaseLimitInterval1 = {
8078
8102
  Week: "week",
8079
8103
  Month: "month"
8080
8104
  };
8105
+ var AutoTopupSource = {
8106
+ Customer: "customer",
8107
+ Plan: "plan"
8108
+ };
8081
8109
  var CustomerLimitType = {
8082
8110
  Absolute: "absolute",
8083
8111
  UsagePercentage: "usage_percentage"
8084
8112
  };
8113
+ var SpendLimitSource = {
8114
+ Customer: "customer",
8115
+ Plan: "plan"
8116
+ };
8085
8117
  var CustomerUsageLimitInterval = {
8086
8118
  Day: "day",
8087
8119
  Week: "week",
8088
8120
  Month: "month",
8089
8121
  Year: "year"
8090
8122
  };
8123
+ var UsageLimitSource = {
8124
+ Customer: "customer",
8125
+ Plan: "plan"
8126
+ };
8091
8127
  var CustomerThresholdType = {
8092
8128
  Usage: "usage",
8093
8129
  UsagePercentage: "usage_percentage",
8094
8130
  Remaining: "remaining",
8095
8131
  RemainingPercentage: "remaining_percentage"
8096
8132
  };
8133
+ var UsageAlertSource = {
8134
+ Customer: "customer",
8135
+ Plan: "plan"
8136
+ };
8137
+ var OverageAllowedSource = {
8138
+ Customer: "customer",
8139
+ Plan: "plan"
8140
+ };
8097
8141
  var CustomerStatus = {
8098
8142
  Active: "active",
8099
8143
  Scheduled: "scheduled"
@@ -8136,36 +8180,37 @@ var CustomerEnv$inboundSchema = inboundSchema(CustomerEnv);
8136
8180
  var CustomerPurchaseLimitInterval2$inboundSchema = inboundSchema(CustomerPurchaseLimitInterval2);
8137
8181
  var CustomerPurchaseLimit2$inboundSchema = z24.pipe(
8138
8182
  z24.object({
8139
- interval: nullable(CustomerPurchaseLimitInterval2$inboundSchema),
8140
- interval_count: nullable(number2()),
8141
- limit: nullable(number2()),
8142
- count: number2(),
8143
- next_reset_at: number2()
8183
+ interval: CustomerPurchaseLimitInterval2$inboundSchema,
8184
+ interval_count: z24._default(number2(), 1),
8185
+ limit: number2()
8144
8186
  }),
8145
8187
  z24.transform((v) => {
8146
8188
  return remap(v, {
8147
- "interval_count": "intervalCount",
8148
- "next_reset_at": "nextResetAt"
8189
+ "interval_count": "intervalCount"
8149
8190
  });
8150
8191
  })
8151
8192
  );
8152
8193
  var CustomerPurchaseLimitInterval1$inboundSchema = inboundSchema(CustomerPurchaseLimitInterval1);
8153
8194
  var CustomerPurchaseLimit1$inboundSchema = z24.pipe(
8154
8195
  z24.object({
8155
- interval: CustomerPurchaseLimitInterval1$inboundSchema,
8156
- interval_count: z24._default(number2(), 1),
8157
- limit: number2()
8196
+ interval: nullable(CustomerPurchaseLimitInterval1$inboundSchema),
8197
+ interval_count: nullable(number2()),
8198
+ limit: nullable(number2()),
8199
+ count: number2(),
8200
+ next_reset_at: number2()
8158
8201
  }),
8159
8202
  z24.transform((v) => {
8160
8203
  return remap(v, {
8161
- "interval_count": "intervalCount"
8204
+ "interval_count": "intervalCount",
8205
+ "next_reset_at": "nextResetAt"
8162
8206
  });
8163
8207
  })
8164
8208
  );
8165
8209
  var CustomerPurchaseLimitUnion$inboundSchema = smartUnion([
8166
- z24.lazy(() => CustomerPurchaseLimit2$inboundSchema),
8167
- z24.lazy(() => CustomerPurchaseLimit1$inboundSchema)
8210
+ z24.lazy(() => CustomerPurchaseLimit1$inboundSchema),
8211
+ z24.lazy(() => CustomerPurchaseLimit2$inboundSchema)
8168
8212
  ]);
8213
+ var AutoTopupSource$inboundSchema = inboundSchema(AutoTopupSource);
8169
8214
  var CustomerAutoTopup$inboundSchema = z24.pipe(
8170
8215
  z24.object({
8171
8216
  feature_id: string4(),
@@ -8173,10 +8218,11 @@ var CustomerAutoTopup$inboundSchema = z24.pipe(
8173
8218
  threshold: number2(),
8174
8219
  quantity: number2(),
8175
8220
  purchase_limit: optional3(smartUnion([
8176
- z24.lazy(() => CustomerPurchaseLimit2$inboundSchema),
8177
- z24.lazy(() => CustomerPurchaseLimit1$inboundSchema)
8221
+ z24.lazy(() => CustomerPurchaseLimit1$inboundSchema),
8222
+ z24.lazy(() => CustomerPurchaseLimit2$inboundSchema)
8178
8223
  ])),
8179
- invoice_mode: optional3(boolean2())
8224
+ invoice_mode: optional3(boolean2()),
8225
+ source: optional3(AutoTopupSource$inboundSchema)
8180
8226
  }),
8181
8227
  z24.transform((v) => {
8182
8228
  return remap(v, {
@@ -8187,13 +8233,15 @@ var CustomerAutoTopup$inboundSchema = z24.pipe(
8187
8233
  })
8188
8234
  );
8189
8235
  var CustomerLimitType$inboundSchema = inboundSchema(CustomerLimitType);
8236
+ var SpendLimitSource$inboundSchema = inboundSchema(SpendLimitSource);
8190
8237
  var CustomerSpendLimit$inboundSchema = z24.pipe(
8191
8238
  z24.object({
8192
8239
  feature_id: optional3(string4()),
8193
8240
  enabled: z24._default(boolean2(), false),
8194
8241
  limit_type: optional3(CustomerLimitType$inboundSchema),
8195
8242
  overage_limit: optional3(number2()),
8196
- skip_overage_billing: optional3(boolean2())
8243
+ skip_overage_billing: optional3(boolean2()),
8244
+ source: optional3(SpendLimitSource$inboundSchema)
8197
8245
  }),
8198
8246
  z24.transform((v) => {
8199
8247
  return remap(v, {
@@ -8208,6 +8256,7 @@ var CustomerUsageLimitInterval$inboundSchema = inboundSchema(CustomerUsageLimitI
8208
8256
  var CustomerFilter$inboundSchema = z24.object({
8209
8257
  properties: z24.record(z24.string(), z24.any())
8210
8258
  });
8259
+ var UsageLimitSource$inboundSchema = inboundSchema(UsageLimitSource);
8211
8260
  var CustomerUsageLimit$inboundSchema = z24.pipe(
8212
8261
  z24.object({
8213
8262
  feature_id: string4(),
@@ -8215,7 +8264,8 @@ var CustomerUsageLimit$inboundSchema = z24.pipe(
8215
8264
  limit: number2(),
8216
8265
  interval: CustomerUsageLimitInterval$inboundSchema,
8217
8266
  filter: optional3(z24.lazy(() => CustomerFilter$inboundSchema)),
8218
- usage: optional3(number2())
8267
+ usage: optional3(number2()),
8268
+ source: optional3(UsageLimitSource$inboundSchema)
8219
8269
  }),
8220
8270
  z24.transform((v) => {
8221
8271
  return remap(v, {
@@ -8224,13 +8274,15 @@ var CustomerUsageLimit$inboundSchema = z24.pipe(
8224
8274
  })
8225
8275
  );
8226
8276
  var CustomerThresholdType$inboundSchema = inboundSchema(CustomerThresholdType);
8277
+ var UsageAlertSource$inboundSchema = inboundSchema(UsageAlertSource);
8227
8278
  var CustomerUsageAlert$inboundSchema = z24.pipe(
8228
8279
  z24.object({
8229
8280
  feature_id: optional3(string4()),
8230
8281
  enabled: z24._default(boolean2(), true),
8231
8282
  threshold: number2(),
8232
8283
  threshold_type: CustomerThresholdType$inboundSchema,
8233
- name: optional3(string4())
8284
+ name: optional3(string4()),
8285
+ source: optional3(UsageAlertSource$inboundSchema)
8234
8286
  }),
8235
8287
  z24.transform((v) => {
8236
8288
  return remap(v, {
@@ -8239,10 +8291,12 @@ var CustomerUsageAlert$inboundSchema = z24.pipe(
8239
8291
  });
8240
8292
  })
8241
8293
  );
8294
+ var OverageAllowedSource$inboundSchema = inboundSchema(OverageAllowedSource);
8242
8295
  var CustomerOverageAllowed$inboundSchema = z24.pipe(
8243
8296
  z24.object({
8244
8297
  feature_id: string4(),
8245
- enabled: z24._default(boolean2(), false)
8298
+ enabled: z24._default(boolean2(), false),
8299
+ source: optional3(OverageAllowedSource$inboundSchema)
8246
8300
  }),
8247
8301
  z24.transform((v) => {
8248
8302
  return remap(v, {
@@ -8747,22 +8801,42 @@ var GetCustomerPurchaseLimitInterval1 = {
8747
8801
  Week: "week",
8748
8802
  Month: "month"
8749
8803
  };
8804
+ var GetCustomerAutoTopupSource = {
8805
+ Customer: "customer",
8806
+ Plan: "plan"
8807
+ };
8750
8808
  var GetCustomerLimitType = {
8751
8809
  Absolute: "absolute",
8752
8810
  UsagePercentage: "usage_percentage"
8753
8811
  };
8812
+ var GetCustomerSpendLimitSource = {
8813
+ Customer: "customer",
8814
+ Plan: "plan"
8815
+ };
8754
8816
  var GetCustomerUsageLimitInterval = {
8755
8817
  Day: "day",
8756
8818
  Week: "week",
8757
8819
  Month: "month",
8758
8820
  Year: "year"
8759
8821
  };
8822
+ var GetCustomerUsageLimitSource = {
8823
+ Customer: "customer",
8824
+ Plan: "plan"
8825
+ };
8760
8826
  var GetCustomerThresholdType = {
8761
8827
  Usage: "usage",
8762
8828
  UsagePercentage: "usage_percentage",
8763
8829
  Remaining: "remaining",
8764
8830
  RemainingPercentage: "remaining_percentage"
8765
8831
  };
8832
+ var GetCustomerUsageAlertSource = {
8833
+ Customer: "customer",
8834
+ Plan: "plan"
8835
+ };
8836
+ var GetCustomerOverageAllowedSource = {
8837
+ Customer: "customer",
8838
+ Plan: "plan"
8839
+ };
8766
8840
  var GetCustomerStatus = {
8767
8841
  Active: "active",
8768
8842
  Scheduled: "scheduled"
@@ -8816,36 +8890,37 @@ var GetCustomerEnv$inboundSchema = inboundSchema(GetCustomerEnv);
8816
8890
  var GetCustomerPurchaseLimitInterval2$inboundSchema = inboundSchema(GetCustomerPurchaseLimitInterval2);
8817
8891
  var GetCustomerPurchaseLimit2$inboundSchema = z31.pipe(
8818
8892
  z31.object({
8819
- interval: nullable(GetCustomerPurchaseLimitInterval2$inboundSchema),
8820
- interval_count: nullable(number2()),
8821
- limit: nullable(number2()),
8822
- count: number2(),
8823
- next_reset_at: number2()
8893
+ interval: GetCustomerPurchaseLimitInterval2$inboundSchema,
8894
+ interval_count: z31._default(number2(), 1),
8895
+ limit: number2()
8824
8896
  }),
8825
8897
  z31.transform((v) => {
8826
8898
  return remap(v, {
8827
- "interval_count": "intervalCount",
8828
- "next_reset_at": "nextResetAt"
8899
+ "interval_count": "intervalCount"
8829
8900
  });
8830
8901
  })
8831
8902
  );
8832
8903
  var GetCustomerPurchaseLimitInterval1$inboundSchema = inboundSchema(GetCustomerPurchaseLimitInterval1);
8833
8904
  var GetCustomerPurchaseLimit1$inboundSchema = z31.pipe(
8834
8905
  z31.object({
8835
- interval: GetCustomerPurchaseLimitInterval1$inboundSchema,
8836
- interval_count: z31._default(number2(), 1),
8837
- limit: number2()
8906
+ interval: nullable(GetCustomerPurchaseLimitInterval1$inboundSchema),
8907
+ interval_count: nullable(number2()),
8908
+ limit: nullable(number2()),
8909
+ count: number2(),
8910
+ next_reset_at: number2()
8838
8911
  }),
8839
8912
  z31.transform((v) => {
8840
8913
  return remap(v, {
8841
- "interval_count": "intervalCount"
8914
+ "interval_count": "intervalCount",
8915
+ "next_reset_at": "nextResetAt"
8842
8916
  });
8843
8917
  })
8844
8918
  );
8845
8919
  var GetCustomerPurchaseLimitUnion$inboundSchema = smartUnion([
8846
- z31.lazy(() => GetCustomerPurchaseLimit2$inboundSchema),
8847
- z31.lazy(() => GetCustomerPurchaseLimit1$inboundSchema)
8920
+ z31.lazy(() => GetCustomerPurchaseLimit1$inboundSchema),
8921
+ z31.lazy(() => GetCustomerPurchaseLimit2$inboundSchema)
8848
8922
  ]);
8923
+ var GetCustomerAutoTopupSource$inboundSchema = inboundSchema(GetCustomerAutoTopupSource);
8849
8924
  var GetCustomerAutoTopup$inboundSchema = z31.pipe(
8850
8925
  z31.object({
8851
8926
  feature_id: string4(),
@@ -8853,10 +8928,11 @@ var GetCustomerAutoTopup$inboundSchema = z31.pipe(
8853
8928
  threshold: number2(),
8854
8929
  quantity: number2(),
8855
8930
  purchase_limit: optional3(smartUnion([
8856
- z31.lazy(() => GetCustomerPurchaseLimit2$inboundSchema),
8857
- z31.lazy(() => GetCustomerPurchaseLimit1$inboundSchema)
8931
+ z31.lazy(() => GetCustomerPurchaseLimit1$inboundSchema),
8932
+ z31.lazy(() => GetCustomerPurchaseLimit2$inboundSchema)
8858
8933
  ])),
8859
- invoice_mode: optional3(boolean2())
8934
+ invoice_mode: optional3(boolean2()),
8935
+ source: optional3(GetCustomerAutoTopupSource$inboundSchema)
8860
8936
  }),
8861
8937
  z31.transform((v) => {
8862
8938
  return remap(v, {
@@ -8867,13 +8943,15 @@ var GetCustomerAutoTopup$inboundSchema = z31.pipe(
8867
8943
  })
8868
8944
  );
8869
8945
  var GetCustomerLimitType$inboundSchema = inboundSchema(GetCustomerLimitType);
8946
+ var GetCustomerSpendLimitSource$inboundSchema = inboundSchema(GetCustomerSpendLimitSource);
8870
8947
  var GetCustomerSpendLimit$inboundSchema = z31.pipe(
8871
8948
  z31.object({
8872
8949
  feature_id: optional3(string4()),
8873
8950
  enabled: z31._default(boolean2(), false),
8874
8951
  limit_type: optional3(GetCustomerLimitType$inboundSchema),
8875
8952
  overage_limit: optional3(number2()),
8876
- skip_overage_billing: optional3(boolean2())
8953
+ skip_overage_billing: optional3(boolean2()),
8954
+ source: optional3(GetCustomerSpendLimitSource$inboundSchema)
8877
8955
  }),
8878
8956
  z31.transform((v) => {
8879
8957
  return remap(v, {
@@ -8888,6 +8966,7 @@ var GetCustomerUsageLimitInterval$inboundSchema = inboundSchema(GetCustomerUsage
8888
8966
  var GetCustomerFilter$inboundSchema = z31.object({
8889
8967
  properties: z31.record(z31.string(), z31.any())
8890
8968
  });
8969
+ var GetCustomerUsageLimitSource$inboundSchema = inboundSchema(GetCustomerUsageLimitSource);
8891
8970
  var GetCustomerUsageLimit$inboundSchema = z31.pipe(
8892
8971
  z31.object({
8893
8972
  feature_id: string4(),
@@ -8895,7 +8974,8 @@ var GetCustomerUsageLimit$inboundSchema = z31.pipe(
8895
8974
  limit: number2(),
8896
8975
  interval: GetCustomerUsageLimitInterval$inboundSchema,
8897
8976
  filter: optional3(z31.lazy(() => GetCustomerFilter$inboundSchema)),
8898
- usage: optional3(number2())
8977
+ usage: optional3(number2()),
8978
+ source: optional3(GetCustomerUsageLimitSource$inboundSchema)
8899
8979
  }),
8900
8980
  z31.transform((v) => {
8901
8981
  return remap(v, {
@@ -8904,13 +8984,15 @@ var GetCustomerUsageLimit$inboundSchema = z31.pipe(
8904
8984
  })
8905
8985
  );
8906
8986
  var GetCustomerThresholdType$inboundSchema = inboundSchema(GetCustomerThresholdType);
8987
+ var GetCustomerUsageAlertSource$inboundSchema = inboundSchema(GetCustomerUsageAlertSource);
8907
8988
  var GetCustomerUsageAlert$inboundSchema = z31.pipe(
8908
8989
  z31.object({
8909
8990
  feature_id: optional3(string4()),
8910
8991
  enabled: z31._default(boolean2(), true),
8911
8992
  threshold: number2(),
8912
8993
  threshold_type: GetCustomerThresholdType$inboundSchema,
8913
- name: optional3(string4())
8994
+ name: optional3(string4()),
8995
+ source: optional3(GetCustomerUsageAlertSource$inboundSchema)
8914
8996
  }),
8915
8997
  z31.transform((v) => {
8916
8998
  return remap(v, {
@@ -8919,10 +9001,12 @@ var GetCustomerUsageAlert$inboundSchema = z31.pipe(
8919
9001
  });
8920
9002
  })
8921
9003
  );
9004
+ var GetCustomerOverageAllowedSource$inboundSchema = inboundSchema(GetCustomerOverageAllowedSource);
8922
9005
  var GetCustomerOverageAllowed$inboundSchema = z31.pipe(
8923
9006
  z31.object({
8924
9007
  feature_id: string4(),
8925
- enabled: z31._default(boolean2(), false)
9008
+ enabled: z31._default(boolean2(), false),
9009
+ source: optional3(GetCustomerOverageAllowedSource$inboundSchema)
8926
9010
  }),
8927
9011
  z31.transform((v) => {
8928
9012
  return remap(v, {
@@ -9311,18 +9395,34 @@ var GetEntityLimitType = {
9311
9395
  Absolute: "absolute",
9312
9396
  UsagePercentage: "usage_percentage"
9313
9397
  };
9398
+ var GetEntitySpendLimitSource = {
9399
+ Customer: "customer",
9400
+ Plan: "plan"
9401
+ };
9314
9402
  var GetEntityInterval = {
9315
9403
  Day: "day",
9316
9404
  Week: "week",
9317
9405
  Month: "month",
9318
9406
  Year: "year"
9319
9407
  };
9408
+ var GetEntityUsageLimitSource = {
9409
+ Customer: "customer",
9410
+ Plan: "plan"
9411
+ };
9320
9412
  var GetEntityThresholdType = {
9321
9413
  Usage: "usage",
9322
9414
  UsagePercentage: "usage_percentage",
9323
9415
  Remaining: "remaining",
9324
9416
  RemainingPercentage: "remaining_percentage"
9325
9417
  };
9418
+ var GetEntityUsageAlertSource = {
9419
+ Customer: "customer",
9420
+ Plan: "plan"
9421
+ };
9422
+ var GetEntityOverageAllowedSource = {
9423
+ Customer: "customer",
9424
+ Plan: "plan"
9425
+ };
9326
9426
  var GetEntityProcessorType = {
9327
9427
  Stripe: "stripe",
9328
9428
  Revenuecat: "revenuecat"
@@ -9477,13 +9577,15 @@ var GetEntityFlags$inboundSchema = z32.pipe(
9477
9577
  })
9478
9578
  );
9479
9579
  var GetEntityLimitType$inboundSchema = inboundSchema(GetEntityLimitType);
9580
+ var GetEntitySpendLimitSource$inboundSchema = inboundSchema(GetEntitySpendLimitSource);
9480
9581
  var GetEntitySpendLimit$inboundSchema = z32.pipe(
9481
9582
  z32.object({
9482
9583
  feature_id: optional3(string4()),
9483
9584
  enabled: z32._default(boolean2(), false),
9484
9585
  limit_type: optional3(GetEntityLimitType$inboundSchema),
9485
9586
  overage_limit: optional3(number2()),
9486
- skip_overage_billing: optional3(boolean2())
9587
+ skip_overage_billing: optional3(boolean2()),
9588
+ source: optional3(GetEntitySpendLimitSource$inboundSchema)
9487
9589
  }),
9488
9590
  z32.transform((v) => {
9489
9591
  return remap(v, {
@@ -9498,6 +9600,7 @@ var GetEntityInterval$inboundSchema = inboundSchema(GetEntityInterval);
9498
9600
  var GetEntityFilter$inboundSchema = z32.object({
9499
9601
  properties: z32.record(z32.string(), z32.any())
9500
9602
  });
9603
+ var GetEntityUsageLimitSource$inboundSchema = inboundSchema(GetEntityUsageLimitSource);
9501
9604
  var GetEntityUsageLimit$inboundSchema = z32.pipe(
9502
9605
  z32.object({
9503
9606
  feature_id: string4(),
@@ -9505,7 +9608,8 @@ var GetEntityUsageLimit$inboundSchema = z32.pipe(
9505
9608
  limit: number2(),
9506
9609
  interval: GetEntityInterval$inboundSchema,
9507
9610
  filter: optional3(z32.lazy(() => GetEntityFilter$inboundSchema)),
9508
- usage: optional3(number2())
9611
+ usage: optional3(number2()),
9612
+ source: optional3(GetEntityUsageLimitSource$inboundSchema)
9509
9613
  }),
9510
9614
  z32.transform((v) => {
9511
9615
  return remap(v, {
@@ -9514,13 +9618,15 @@ var GetEntityUsageLimit$inboundSchema = z32.pipe(
9514
9618
  })
9515
9619
  );
9516
9620
  var GetEntityThresholdType$inboundSchema = inboundSchema(GetEntityThresholdType);
9621
+ var GetEntityUsageAlertSource$inboundSchema = inboundSchema(GetEntityUsageAlertSource);
9517
9622
  var GetEntityUsageAlert$inboundSchema = z32.pipe(
9518
9623
  z32.object({
9519
9624
  feature_id: optional3(string4()),
9520
9625
  enabled: z32._default(boolean2(), true),
9521
9626
  threshold: number2(),
9522
9627
  threshold_type: GetEntityThresholdType$inboundSchema,
9523
- name: optional3(string4())
9628
+ name: optional3(string4()),
9629
+ source: optional3(GetEntityUsageAlertSource$inboundSchema)
9524
9630
  }),
9525
9631
  z32.transform((v) => {
9526
9632
  return remap(v, {
@@ -9529,10 +9635,12 @@ var GetEntityUsageAlert$inboundSchema = z32.pipe(
9529
9635
  });
9530
9636
  })
9531
9637
  );
9638
+ var GetEntityOverageAllowedSource$inboundSchema = inboundSchema(GetEntityOverageAllowedSource);
9532
9639
  var GetEntityOverageAllowed$inboundSchema = z32.pipe(
9533
9640
  z32.object({
9534
9641
  feature_id: string4(),
9535
- enabled: z32._default(boolean2(), false)
9642
+ enabled: z32._default(boolean2(), false),
9643
+ source: optional3(GetEntityOverageAllowedSource$inboundSchema)
9536
9644
  }),
9537
9645
  z32.transform((v) => {
9538
9646
  return remap(v, {
@@ -11139,22 +11247,42 @@ var ListCustomersPurchaseLimitInterval1 = {
11139
11247
  Week: "week",
11140
11248
  Month: "month"
11141
11249
  };
11250
+ var ListCustomersAutoTopupSource = {
11251
+ Customer: "customer",
11252
+ Plan: "plan"
11253
+ };
11142
11254
  var ListCustomersLimitType = {
11143
11255
  Absolute: "absolute",
11144
11256
  UsagePercentage: "usage_percentage"
11145
11257
  };
11258
+ var ListCustomersSpendLimitSource = {
11259
+ Customer: "customer",
11260
+ Plan: "plan"
11261
+ };
11146
11262
  var ListCustomersUsageLimitInterval = {
11147
11263
  Day: "day",
11148
11264
  Week: "week",
11149
11265
  Month: "month",
11150
11266
  Year: "year"
11151
11267
  };
11268
+ var ListCustomersUsageLimitSource = {
11269
+ Customer: "customer",
11270
+ Plan: "plan"
11271
+ };
11152
11272
  var ListCustomersThresholdType = {
11153
11273
  Usage: "usage",
11154
11274
  UsagePercentage: "usage_percentage",
11155
11275
  Remaining: "remaining",
11156
11276
  RemainingPercentage: "remaining_percentage"
11157
11277
  };
11278
+ var ListCustomersUsageAlertSource = {
11279
+ Customer: "customer",
11280
+ Plan: "plan"
11281
+ };
11282
+ var ListCustomersOverageAllowedSource = {
11283
+ Customer: "customer",
11284
+ Plan: "plan"
11285
+ };
11158
11286
  var ListCustomersStatus = {
11159
11287
  Active: "active",
11160
11288
  Scheduled: "scheduled"
@@ -11201,36 +11329,37 @@ var ListCustomersEnv$inboundSchema = inboundSchema(ListCustomersEnv);
11201
11329
  var ListCustomersPurchaseLimitInterval2$inboundSchema = inboundSchema(ListCustomersPurchaseLimitInterval2);
11202
11330
  var ListCustomersPurchaseLimit2$inboundSchema = z39.pipe(
11203
11331
  z39.object({
11204
- interval: nullable(ListCustomersPurchaseLimitInterval2$inboundSchema),
11205
- interval_count: nullable(number2()),
11206
- limit: nullable(number2()),
11207
- count: number2(),
11208
- next_reset_at: number2()
11332
+ interval: ListCustomersPurchaseLimitInterval2$inboundSchema,
11333
+ interval_count: z39._default(number2(), 1),
11334
+ limit: number2()
11209
11335
  }),
11210
11336
  z39.transform((v) => {
11211
11337
  return remap(v, {
11212
- "interval_count": "intervalCount",
11213
- "next_reset_at": "nextResetAt"
11338
+ "interval_count": "intervalCount"
11214
11339
  });
11215
11340
  })
11216
11341
  );
11217
11342
  var ListCustomersPurchaseLimitInterval1$inboundSchema = inboundSchema(ListCustomersPurchaseLimitInterval1);
11218
11343
  var ListCustomersPurchaseLimit1$inboundSchema = z39.pipe(
11219
11344
  z39.object({
11220
- interval: ListCustomersPurchaseLimitInterval1$inboundSchema,
11221
- interval_count: z39._default(number2(), 1),
11222
- limit: number2()
11345
+ interval: nullable(ListCustomersPurchaseLimitInterval1$inboundSchema),
11346
+ interval_count: nullable(number2()),
11347
+ limit: nullable(number2()),
11348
+ count: number2(),
11349
+ next_reset_at: number2()
11223
11350
  }),
11224
11351
  z39.transform((v) => {
11225
11352
  return remap(v, {
11226
- "interval_count": "intervalCount"
11353
+ "interval_count": "intervalCount",
11354
+ "next_reset_at": "nextResetAt"
11227
11355
  });
11228
11356
  })
11229
11357
  );
11230
11358
  var ListCustomersPurchaseLimitUnion$inboundSchema = smartUnion([
11231
- z39.lazy(() => ListCustomersPurchaseLimit2$inboundSchema),
11232
- z39.lazy(() => ListCustomersPurchaseLimit1$inboundSchema)
11359
+ z39.lazy(() => ListCustomersPurchaseLimit1$inboundSchema),
11360
+ z39.lazy(() => ListCustomersPurchaseLimit2$inboundSchema)
11233
11361
  ]);
11362
+ var ListCustomersAutoTopupSource$inboundSchema = inboundSchema(ListCustomersAutoTopupSource);
11234
11363
  var ListCustomersAutoTopup$inboundSchema = z39.pipe(
11235
11364
  z39.object({
11236
11365
  feature_id: string4(),
@@ -11238,10 +11367,11 @@ var ListCustomersAutoTopup$inboundSchema = z39.pipe(
11238
11367
  threshold: number2(),
11239
11368
  quantity: number2(),
11240
11369
  purchase_limit: optional3(smartUnion([
11241
- z39.lazy(() => ListCustomersPurchaseLimit2$inboundSchema),
11242
- z39.lazy(() => ListCustomersPurchaseLimit1$inboundSchema)
11370
+ z39.lazy(() => ListCustomersPurchaseLimit1$inboundSchema),
11371
+ z39.lazy(() => ListCustomersPurchaseLimit2$inboundSchema)
11243
11372
  ])),
11244
- invoice_mode: optional3(boolean2())
11373
+ invoice_mode: optional3(boolean2()),
11374
+ source: optional3(ListCustomersAutoTopupSource$inboundSchema)
11245
11375
  }),
11246
11376
  z39.transform((v) => {
11247
11377
  return remap(v, {
@@ -11252,13 +11382,15 @@ var ListCustomersAutoTopup$inboundSchema = z39.pipe(
11252
11382
  })
11253
11383
  );
11254
11384
  var ListCustomersLimitType$inboundSchema = inboundSchema(ListCustomersLimitType);
11385
+ var ListCustomersSpendLimitSource$inboundSchema = inboundSchema(ListCustomersSpendLimitSource);
11255
11386
  var ListCustomersSpendLimit$inboundSchema = z39.pipe(
11256
11387
  z39.object({
11257
11388
  feature_id: optional3(string4()),
11258
11389
  enabled: z39._default(boolean2(), false),
11259
11390
  limit_type: optional3(ListCustomersLimitType$inboundSchema),
11260
11391
  overage_limit: optional3(number2()),
11261
- skip_overage_billing: optional3(boolean2())
11392
+ skip_overage_billing: optional3(boolean2()),
11393
+ source: optional3(ListCustomersSpendLimitSource$inboundSchema)
11262
11394
  }),
11263
11395
  z39.transform((v) => {
11264
11396
  return remap(v, {
@@ -11273,6 +11405,7 @@ var ListCustomersUsageLimitInterval$inboundSchema = inboundSchema(ListCustomersU
11273
11405
  var ListCustomersFilter$inboundSchema = z39.object({
11274
11406
  properties: z39.record(z39.string(), z39.any())
11275
11407
  });
11408
+ var ListCustomersUsageLimitSource$inboundSchema = inboundSchema(ListCustomersUsageLimitSource);
11276
11409
  var ListCustomersUsageLimit$inboundSchema = z39.pipe(
11277
11410
  z39.object({
11278
11411
  feature_id: string4(),
@@ -11280,7 +11413,8 @@ var ListCustomersUsageLimit$inboundSchema = z39.pipe(
11280
11413
  limit: number2(),
11281
11414
  interval: ListCustomersUsageLimitInterval$inboundSchema,
11282
11415
  filter: optional3(z39.lazy(() => ListCustomersFilter$inboundSchema)),
11283
- usage: optional3(number2())
11416
+ usage: optional3(number2()),
11417
+ source: optional3(ListCustomersUsageLimitSource$inboundSchema)
11284
11418
  }),
11285
11419
  z39.transform((v) => {
11286
11420
  return remap(v, {
@@ -11289,13 +11423,15 @@ var ListCustomersUsageLimit$inboundSchema = z39.pipe(
11289
11423
  })
11290
11424
  );
11291
11425
  var ListCustomersThresholdType$inboundSchema = inboundSchema(ListCustomersThresholdType);
11426
+ var ListCustomersUsageAlertSource$inboundSchema = inboundSchema(ListCustomersUsageAlertSource);
11292
11427
  var ListCustomersUsageAlert$inboundSchema = z39.pipe(
11293
11428
  z39.object({
11294
11429
  feature_id: optional3(string4()),
11295
11430
  enabled: z39._default(boolean2(), true),
11296
11431
  threshold: number2(),
11297
11432
  threshold_type: ListCustomersThresholdType$inboundSchema,
11298
- name: optional3(string4())
11433
+ name: optional3(string4()),
11434
+ source: optional3(ListCustomersUsageAlertSource$inboundSchema)
11299
11435
  }),
11300
11436
  z39.transform((v) => {
11301
11437
  return remap(v, {
@@ -11304,10 +11440,12 @@ var ListCustomersUsageAlert$inboundSchema = z39.pipe(
11304
11440
  });
11305
11441
  })
11306
11442
  );
11443
+ var ListCustomersOverageAllowedSource$inboundSchema = inboundSchema(ListCustomersOverageAllowedSource);
11307
11444
  var ListCustomersOverageAllowed$inboundSchema = z39.pipe(
11308
11445
  z39.object({
11309
11446
  feature_id: string4(),
11310
- enabled: z39._default(boolean2(), false)
11447
+ enabled: z39._default(boolean2(), false),
11448
+ source: optional3(ListCustomersOverageAllowedSource$inboundSchema)
11311
11449
  }),
11312
11450
  z39.transform((v) => {
11313
11451
  return remap(v, {
@@ -11597,18 +11735,34 @@ var ListEntitiesLimitType = {
11597
11735
  Absolute: "absolute",
11598
11736
  UsagePercentage: "usage_percentage"
11599
11737
  };
11738
+ var ListEntitiesSpendLimitSource = {
11739
+ Customer: "customer",
11740
+ Plan: "plan"
11741
+ };
11600
11742
  var ListEntitiesInterval = {
11601
11743
  Day: "day",
11602
11744
  Week: "week",
11603
11745
  Month: "month",
11604
11746
  Year: "year"
11605
11747
  };
11748
+ var ListEntitiesUsageLimitSource = {
11749
+ Customer: "customer",
11750
+ Plan: "plan"
11751
+ };
11606
11752
  var ListEntitiesThresholdType = {
11607
11753
  Usage: "usage",
11608
11754
  UsagePercentage: "usage_percentage",
11609
11755
  Remaining: "remaining",
11610
11756
  RemainingPercentage: "remaining_percentage"
11611
11757
  };
11758
+ var ListEntitiesUsageAlertSource = {
11759
+ Customer: "customer",
11760
+ Plan: "plan"
11761
+ };
11762
+ var ListEntitiesOverageAllowedSource = {
11763
+ Customer: "customer",
11764
+ Plan: "plan"
11765
+ };
11612
11766
  var ListEntitiesProcessorType = {
11613
11767
  Stripe: "stripe",
11614
11768
  Revenuecat: "revenuecat"
@@ -11777,13 +11931,15 @@ var ListEntitiesFlags$inboundSchema = z40.pipe(
11777
11931
  })
11778
11932
  );
11779
11933
  var ListEntitiesLimitType$inboundSchema = inboundSchema(ListEntitiesLimitType);
11934
+ var ListEntitiesSpendLimitSource$inboundSchema = inboundSchema(ListEntitiesSpendLimitSource);
11780
11935
  var ListEntitiesSpendLimit$inboundSchema = z40.pipe(
11781
11936
  z40.object({
11782
11937
  feature_id: optional3(string4()),
11783
11938
  enabled: z40._default(boolean2(), false),
11784
11939
  limit_type: optional3(ListEntitiesLimitType$inboundSchema),
11785
11940
  overage_limit: optional3(number2()),
11786
- skip_overage_billing: optional3(boolean2())
11941
+ skip_overage_billing: optional3(boolean2()),
11942
+ source: optional3(ListEntitiesSpendLimitSource$inboundSchema)
11787
11943
  }),
11788
11944
  z40.transform((v) => {
11789
11945
  return remap(v, {
@@ -11798,6 +11954,7 @@ var ListEntitiesInterval$inboundSchema = inboundSchema(ListEntitiesInterval);
11798
11954
  var ListEntitiesFilter$inboundSchema = z40.object({
11799
11955
  properties: z40.record(z40.string(), z40.any())
11800
11956
  });
11957
+ var ListEntitiesUsageLimitSource$inboundSchema = inboundSchema(ListEntitiesUsageLimitSource);
11801
11958
  var ListEntitiesUsageLimit$inboundSchema = z40.pipe(
11802
11959
  z40.object({
11803
11960
  feature_id: string4(),
@@ -11805,7 +11962,8 @@ var ListEntitiesUsageLimit$inboundSchema = z40.pipe(
11805
11962
  limit: number2(),
11806
11963
  interval: ListEntitiesInterval$inboundSchema,
11807
11964
  filter: optional3(z40.lazy(() => ListEntitiesFilter$inboundSchema)),
11808
- usage: optional3(number2())
11965
+ usage: optional3(number2()),
11966
+ source: optional3(ListEntitiesUsageLimitSource$inboundSchema)
11809
11967
  }),
11810
11968
  z40.transform((v) => {
11811
11969
  return remap(v, {
@@ -11814,13 +11972,15 @@ var ListEntitiesUsageLimit$inboundSchema = z40.pipe(
11814
11972
  })
11815
11973
  );
11816
11974
  var ListEntitiesThresholdType$inboundSchema = inboundSchema(ListEntitiesThresholdType);
11975
+ var ListEntitiesUsageAlertSource$inboundSchema = inboundSchema(ListEntitiesUsageAlertSource);
11817
11976
  var ListEntitiesUsageAlert$inboundSchema = z40.pipe(
11818
11977
  z40.object({
11819
11978
  feature_id: optional3(string4()),
11820
11979
  enabled: z40._default(boolean2(), true),
11821
11980
  threshold: number2(),
11822
11981
  threshold_type: ListEntitiesThresholdType$inboundSchema,
11823
- name: optional3(string4())
11982
+ name: optional3(string4()),
11983
+ source: optional3(ListEntitiesUsageAlertSource$inboundSchema)
11824
11984
  }),
11825
11985
  z40.transform((v) => {
11826
11986
  return remap(v, {
@@ -11829,10 +11989,12 @@ var ListEntitiesUsageAlert$inboundSchema = z40.pipe(
11829
11989
  });
11830
11990
  })
11831
11991
  );
11992
+ var ListEntitiesOverageAllowedSource$inboundSchema = inboundSchema(ListEntitiesOverageAllowedSource);
11832
11993
  var ListEntitiesOverageAllowed$inboundSchema = z40.pipe(
11833
11994
  z40.object({
11834
11995
  feature_id: string4(),
11835
- enabled: z40._default(boolean2(), false)
11996
+ enabled: z40._default(boolean2(), false),
11997
+ source: optional3(ListEntitiesOverageAllowedSource$inboundSchema)
11836
11998
  }),
11837
11999
  z40.transform((v) => {
11838
12000
  return remap(v, {
@@ -17927,7 +18089,8 @@ var UpdateBalanceParams$outboundSchema = z61.pipe(
17927
18089
  interval: z61.optional(UpdateBalanceInterval$outboundSchema),
17928
18090
  includedGrant: z61.optional(z61.number()),
17929
18091
  balanceId: z61.optional(z61.string()),
17930
- nextResetAt: z61.optional(z61.number())
18092
+ nextResetAt: z61.optional(z61.number()),
18093
+ expiresAt: z61.optional(z61.number())
17931
18094
  }),
17932
18095
  z61.transform((v) => {
17933
18096
  return remap(v, {
@@ -17937,7 +18100,8 @@ var UpdateBalanceParams$outboundSchema = z61.pipe(
17937
18100
  addToBalance: "add_to_balance",
17938
18101
  includedGrant: "included_grant",
17939
18102
  balanceId: "balance_id",
17940
- nextResetAt: "next_reset_at"
18103
+ nextResetAt: "next_reset_at",
18104
+ expiresAt: "expires_at"
17941
18105
  });
17942
18106
  })
17943
18107
  );
@@ -17985,22 +18149,42 @@ var UpdateCustomerPurchaseLimitIntervalResponse1 = {
17985
18149
  Week: "week",
17986
18150
  Month: "month"
17987
18151
  };
18152
+ var UpdateCustomerAutoTopupSource = {
18153
+ Customer: "customer",
18154
+ Plan: "plan"
18155
+ };
17988
18156
  var UpdateCustomerLimitTypeResponse = {
17989
18157
  Absolute: "absolute",
17990
18158
  UsagePercentage: "usage_percentage"
17991
18159
  };
18160
+ var UpdateCustomerSpendLimitSource = {
18161
+ Customer: "customer",
18162
+ Plan: "plan"
18163
+ };
17992
18164
  var UpdateCustomerUsageLimitIntervalResponse = {
17993
18165
  Day: "day",
17994
18166
  Week: "week",
17995
18167
  Month: "month",
17996
18168
  Year: "year"
17997
18169
  };
18170
+ var UpdateCustomerUsageLimitSource = {
18171
+ Customer: "customer",
18172
+ Plan: "plan"
18173
+ };
17998
18174
  var UpdateCustomerThresholdTypeResponse = {
17999
18175
  Usage: "usage",
18000
18176
  UsagePercentage: "usage_percentage",
18001
18177
  Remaining: "remaining",
18002
18178
  RemainingPercentage: "remaining_percentage"
18003
18179
  };
18180
+ var UpdateCustomerUsageAlertSource = {
18181
+ Customer: "customer",
18182
+ Plan: "plan"
18183
+ };
18184
+ var UpdateCustomerOverageAllowedSource = {
18185
+ Customer: "customer",
18186
+ Plan: "plan"
18187
+ };
18004
18188
  var UpdateCustomerStatus = {
18005
18189
  Active: "active",
18006
18190
  Scheduled: "scheduled"
@@ -18197,38 +18381,39 @@ var UpdateCustomerEnv$inboundSchema = inboundSchema(UpdateCustomerEnv);
18197
18381
  var UpdateCustomerPurchaseLimitIntervalResponse2$inboundSchema = inboundSchema(UpdateCustomerPurchaseLimitIntervalResponse2);
18198
18382
  var UpdateCustomerPurchaseLimitResponse2$inboundSchema = z62.pipe(
18199
18383
  z62.object({
18200
- interval: nullable(
18201
- UpdateCustomerPurchaseLimitIntervalResponse2$inboundSchema
18202
- ),
18203
- interval_count: nullable(number2()),
18204
- limit: nullable(number2()),
18205
- count: number2(),
18206
- next_reset_at: number2()
18384
+ interval: UpdateCustomerPurchaseLimitIntervalResponse2$inboundSchema,
18385
+ interval_count: z62._default(number2(), 1),
18386
+ limit: number2()
18207
18387
  }),
18208
18388
  z62.transform((v) => {
18209
18389
  return remap(v, {
18210
- "interval_count": "intervalCount",
18211
- "next_reset_at": "nextResetAt"
18390
+ "interval_count": "intervalCount"
18212
18391
  });
18213
18392
  })
18214
18393
  );
18215
18394
  var UpdateCustomerPurchaseLimitIntervalResponse1$inboundSchema = inboundSchema(UpdateCustomerPurchaseLimitIntervalResponse1);
18216
18395
  var UpdateCustomerPurchaseLimitResponse1$inboundSchema = z62.pipe(
18217
18396
  z62.object({
18218
- interval: UpdateCustomerPurchaseLimitIntervalResponse1$inboundSchema,
18219
- interval_count: z62._default(number2(), 1),
18220
- limit: number2()
18397
+ interval: nullable(
18398
+ UpdateCustomerPurchaseLimitIntervalResponse1$inboundSchema
18399
+ ),
18400
+ interval_count: nullable(number2()),
18401
+ limit: nullable(number2()),
18402
+ count: number2(),
18403
+ next_reset_at: number2()
18221
18404
  }),
18222
18405
  z62.transform((v) => {
18223
18406
  return remap(v, {
18224
- "interval_count": "intervalCount"
18407
+ "interval_count": "intervalCount",
18408
+ "next_reset_at": "nextResetAt"
18225
18409
  });
18226
18410
  })
18227
18411
  );
18228
18412
  var UpdateCustomerPurchaseLimitUnion$inboundSchema = smartUnion([
18229
- z62.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema),
18230
- z62.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema)
18413
+ z62.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema),
18414
+ z62.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema)
18231
18415
  ]);
18416
+ var UpdateCustomerAutoTopupSource$inboundSchema = inboundSchema(UpdateCustomerAutoTopupSource);
18232
18417
  var UpdateCustomerAutoTopupResponse$inboundSchema = z62.pipe(
18233
18418
  z62.object({
18234
18419
  feature_id: string4(),
@@ -18236,10 +18421,11 @@ var UpdateCustomerAutoTopupResponse$inboundSchema = z62.pipe(
18236
18421
  threshold: number2(),
18237
18422
  quantity: number2(),
18238
18423
  purchase_limit: optional3(smartUnion([
18239
- z62.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema),
18240
- z62.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema)
18424
+ z62.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema),
18425
+ z62.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema)
18241
18426
  ])),
18242
- invoice_mode: optional3(boolean2())
18427
+ invoice_mode: optional3(boolean2()),
18428
+ source: optional3(UpdateCustomerAutoTopupSource$inboundSchema)
18243
18429
  }),
18244
18430
  z62.transform((v) => {
18245
18431
  return remap(v, {
@@ -18250,13 +18436,15 @@ var UpdateCustomerAutoTopupResponse$inboundSchema = z62.pipe(
18250
18436
  })
18251
18437
  );
18252
18438
  var UpdateCustomerLimitTypeResponse$inboundSchema = inboundSchema(UpdateCustomerLimitTypeResponse);
18439
+ var UpdateCustomerSpendLimitSource$inboundSchema = inboundSchema(UpdateCustomerSpendLimitSource);
18253
18440
  var UpdateCustomerSpendLimitResponse$inboundSchema = z62.pipe(
18254
18441
  z62.object({
18255
18442
  feature_id: optional3(string4()),
18256
18443
  enabled: z62._default(boolean2(), false),
18257
18444
  limit_type: optional3(UpdateCustomerLimitTypeResponse$inboundSchema),
18258
18445
  overage_limit: optional3(number2()),
18259
- skip_overage_billing: optional3(boolean2())
18446
+ skip_overage_billing: optional3(boolean2()),
18447
+ source: optional3(UpdateCustomerSpendLimitSource$inboundSchema)
18260
18448
  }),
18261
18449
  z62.transform((v) => {
18262
18450
  return remap(v, {
@@ -18271,6 +18459,7 @@ var UpdateCustomerUsageLimitIntervalResponse$inboundSchema = inboundSchema(Updat
18271
18459
  var UpdateCustomerFilterResponse$inboundSchema = z62.object({
18272
18460
  properties: z62.record(z62.string(), z62.any())
18273
18461
  });
18462
+ var UpdateCustomerUsageLimitSource$inboundSchema = inboundSchema(UpdateCustomerUsageLimitSource);
18274
18463
  var UpdateCustomerUsageLimitResponse$inboundSchema = z62.pipe(
18275
18464
  z62.object({
18276
18465
  feature_id: string4(),
@@ -18280,7 +18469,8 @@ var UpdateCustomerUsageLimitResponse$inboundSchema = z62.pipe(
18280
18469
  filter: optional3(
18281
18470
  z62.lazy(() => UpdateCustomerFilterResponse$inboundSchema)
18282
18471
  ),
18283
- usage: optional3(number2())
18472
+ usage: optional3(number2()),
18473
+ source: optional3(UpdateCustomerUsageLimitSource$inboundSchema)
18284
18474
  }),
18285
18475
  z62.transform((v) => {
18286
18476
  return remap(v, {
@@ -18289,13 +18479,15 @@ var UpdateCustomerUsageLimitResponse$inboundSchema = z62.pipe(
18289
18479
  })
18290
18480
  );
18291
18481
  var UpdateCustomerThresholdTypeResponse$inboundSchema = inboundSchema(UpdateCustomerThresholdTypeResponse);
18482
+ var UpdateCustomerUsageAlertSource$inboundSchema = inboundSchema(UpdateCustomerUsageAlertSource);
18292
18483
  var UpdateCustomerUsageAlertResponse$inboundSchema = z62.pipe(
18293
18484
  z62.object({
18294
18485
  feature_id: optional3(string4()),
18295
18486
  enabled: z62._default(boolean2(), true),
18296
18487
  threshold: number2(),
18297
18488
  threshold_type: UpdateCustomerThresholdTypeResponse$inboundSchema,
18298
- name: optional3(string4())
18489
+ name: optional3(string4()),
18490
+ source: optional3(UpdateCustomerUsageAlertSource$inboundSchema)
18299
18491
  }),
18300
18492
  z62.transform((v) => {
18301
18493
  return remap(v, {
@@ -18304,10 +18496,12 @@ var UpdateCustomerUsageAlertResponse$inboundSchema = z62.pipe(
18304
18496
  });
18305
18497
  })
18306
18498
  );
18499
+ var UpdateCustomerOverageAllowedSource$inboundSchema = inboundSchema(UpdateCustomerOverageAllowedSource);
18307
18500
  var UpdateCustomerOverageAllowedResponse$inboundSchema = z62.pipe(
18308
18501
  z62.object({
18309
18502
  feature_id: string4(),
18310
- enabled: z62._default(boolean2(), false)
18503
+ enabled: z62._default(boolean2(), false),
18504
+ source: optional3(UpdateCustomerOverageAllowedSource$inboundSchema)
18311
18505
  }),
18312
18506
  z62.transform((v) => {
18313
18507
  return remap(v, {
@@ -18600,18 +18794,34 @@ var UpdateEntityLimitTypeResponse = {
18600
18794
  Absolute: "absolute",
18601
18795
  UsagePercentage: "usage_percentage"
18602
18796
  };
18797
+ var UpdateEntitySpendLimitSource = {
18798
+ Customer: "customer",
18799
+ Plan: "plan"
18800
+ };
18603
18801
  var UpdateEntityIntervalResponse = {
18604
18802
  Day: "day",
18605
18803
  Week: "week",
18606
18804
  Month: "month",
18607
18805
  Year: "year"
18608
18806
  };
18807
+ var UpdateEntityUsageLimitSource = {
18808
+ Customer: "customer",
18809
+ Plan: "plan"
18810
+ };
18609
18811
  var UpdateEntityThresholdTypeResponse = {
18610
18812
  Usage: "usage",
18611
18813
  UsagePercentage: "usage_percentage",
18612
18814
  Remaining: "remaining",
18613
18815
  RemainingPercentage: "remaining_percentage"
18614
18816
  };
18817
+ var UpdateEntityUsageAlertSource = {
18818
+ Customer: "customer",
18819
+ Plan: "plan"
18820
+ };
18821
+ var UpdateEntityOverageAllowedSource = {
18822
+ Customer: "customer",
18823
+ Plan: "plan"
18824
+ };
18615
18825
  var UpdateEntityProcessorType = {
18616
18826
  Stripe: "stripe",
18617
18827
  Revenuecat: "revenuecat"
@@ -18861,13 +19071,15 @@ var UpdateEntityFlags$inboundSchema = z63.pipe(
18861
19071
  })
18862
19072
  );
18863
19073
  var UpdateEntityLimitTypeResponse$inboundSchema = inboundSchema(UpdateEntityLimitTypeResponse);
19074
+ var UpdateEntitySpendLimitSource$inboundSchema = inboundSchema(UpdateEntitySpendLimitSource);
18864
19075
  var UpdateEntitySpendLimitResponse$inboundSchema = z63.pipe(
18865
19076
  z63.object({
18866
19077
  feature_id: optional3(string4()),
18867
19078
  enabled: z63._default(boolean2(), false),
18868
19079
  limit_type: optional3(UpdateEntityLimitTypeResponse$inboundSchema),
18869
19080
  overage_limit: optional3(number2()),
18870
- skip_overage_billing: optional3(boolean2())
19081
+ skip_overage_billing: optional3(boolean2()),
19082
+ source: optional3(UpdateEntitySpendLimitSource$inboundSchema)
18871
19083
  }),
18872
19084
  z63.transform((v) => {
18873
19085
  return remap(v, {
@@ -18882,6 +19094,7 @@ var UpdateEntityIntervalResponse$inboundSchema = inboundSchema(UpdateEntityInter
18882
19094
  var UpdateEntityFilterResponse$inboundSchema = z63.object({
18883
19095
  properties: z63.record(z63.string(), z63.any())
18884
19096
  });
19097
+ var UpdateEntityUsageLimitSource$inboundSchema = inboundSchema(UpdateEntityUsageLimitSource);
18885
19098
  var UpdateEntityUsageLimitResponse$inboundSchema = z63.pipe(
18886
19099
  z63.object({
18887
19100
  feature_id: string4(),
@@ -18891,7 +19104,8 @@ var UpdateEntityUsageLimitResponse$inboundSchema = z63.pipe(
18891
19104
  filter: optional3(
18892
19105
  z63.lazy(() => UpdateEntityFilterResponse$inboundSchema)
18893
19106
  ),
18894
- usage: optional3(number2())
19107
+ usage: optional3(number2()),
19108
+ source: optional3(UpdateEntityUsageLimitSource$inboundSchema)
18895
19109
  }),
18896
19110
  z63.transform((v) => {
18897
19111
  return remap(v, {
@@ -18900,13 +19114,15 @@ var UpdateEntityUsageLimitResponse$inboundSchema = z63.pipe(
18900
19114
  })
18901
19115
  );
18902
19116
  var UpdateEntityThresholdTypeResponse$inboundSchema = inboundSchema(UpdateEntityThresholdTypeResponse);
19117
+ var UpdateEntityUsageAlertSource$inboundSchema = inboundSchema(UpdateEntityUsageAlertSource);
18903
19118
  var UpdateEntityUsageAlertResponse$inboundSchema = z63.pipe(
18904
19119
  z63.object({
18905
19120
  feature_id: optional3(string4()),
18906
19121
  enabled: z63._default(boolean2(), true),
18907
19122
  threshold: number2(),
18908
19123
  threshold_type: UpdateEntityThresholdTypeResponse$inboundSchema,
18909
- name: optional3(string4())
19124
+ name: optional3(string4()),
19125
+ source: optional3(UpdateEntityUsageAlertSource$inboundSchema)
18910
19126
  }),
18911
19127
  z63.transform((v) => {
18912
19128
  return remap(v, {
@@ -18915,10 +19131,12 @@ var UpdateEntityUsageAlertResponse$inboundSchema = z63.pipe(
18915
19131
  });
18916
19132
  })
18917
19133
  );
19134
+ var UpdateEntityOverageAllowedSource$inboundSchema = inboundSchema(UpdateEntityOverageAllowedSource);
18918
19135
  var UpdateEntityOverageAllowedResponse$inboundSchema = z63.pipe(
18919
19136
  z63.object({
18920
19137
  feature_id: string4(),
18921
- enabled: z63._default(boolean2(), false)
19138
+ enabled: z63._default(boolean2(), false),
19139
+ source: optional3(UpdateEntityOverageAllowedSource$inboundSchema)
18922
19140
  }),
18923
19141
  z63.transform((v) => {
18924
19142
  return remap(v, {
@@ -23263,7 +23481,7 @@ var Billing = class extends ClientSDK {
23263
23481
  * @example
23264
23482
  * ```typescript
23265
23483
  * // Schedule a transition from a trial plan to a paid plan
23266
- * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1783590814052,"plans":[{"planId":"trial_plan"}]},{"startsAt":1784800414052,"plans":[{"planId":"pro_plan"}]}] });
23484
+ * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1783704557304,"plans":[{"planId":"trial_plan"}]},{"startsAt":1784914157304,"plans":[{"planId":"pro_plan"}]}] });
23267
23485
  * ```
23268
23486
  *
23269
23487
  * @param customerId - The ID of the customer to create the schedule for.