autumn-js 1.2.38 → 1.2.39

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-5IUIFE55.mjs} +1 -1
  12. package/dist/backend/{chunk-ZR5K6VMA.mjs → chunk-GL2SBEQ5.mjs} +1 -1
  13. package/dist/backend/{chunk-Y3AJLHVL.mjs → chunk-KJP3DHPM.mjs} +1 -1
  14. package/dist/backend/{chunk-N52JKSJ7.mjs → chunk-KM5AXZWJ.mjs} +4 -4
  15. package/dist/backend/{chunk-5C7KP2BU.mjs → chunk-MSMJS42G.mjs} +319 -101
  16. package/dist/backend/{chunk-TIFFBW34.mjs → chunk-UMTASWZL.mjs} +1 -1
  17. package/dist/backend/{chunk-PKM7CEE3.mjs → chunk-V32P22RC.mjs} +6 -6
  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-CIqS7yVo.d.mts} +641 -97
  55. package/dist/backend/{routeTypes-C8YKwtFL.d.ts → routeTypes-uWaE8YYa.d.ts} +641 -97
  56. package/dist/better-auth/{chunk-A3ZOJU54.mjs → chunk-LLBM6UQN.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
@@ -5365,18 +5365,34 @@ var CreateEntityLimitTypeResponse = {
5365
5365
  Absolute: "absolute",
5366
5366
  UsagePercentage: "usage_percentage"
5367
5367
  };
5368
+ var CreateEntitySpendLimitSource = {
5369
+ Customer: "customer",
5370
+ Plan: "plan"
5371
+ };
5368
5372
  var CreateEntityIntervalResponse = {
5369
5373
  Day: "day",
5370
5374
  Week: "week",
5371
5375
  Month: "month",
5372
5376
  Year: "year"
5373
5377
  };
5378
+ var CreateEntityUsageLimitSource = {
5379
+ Customer: "customer",
5380
+ Plan: "plan"
5381
+ };
5374
5382
  var CreateEntityThresholdTypeResponse = {
5375
5383
  Usage: "usage",
5376
5384
  UsagePercentage: "usage_percentage",
5377
5385
  Remaining: "remaining",
5378
5386
  RemainingPercentage: "remaining_percentage"
5379
5387
  };
5388
+ var CreateEntityUsageAlertSource = {
5389
+ Customer: "customer",
5390
+ Plan: "plan"
5391
+ };
5392
+ var CreateEntityOverageAllowedSource = {
5393
+ Customer: "customer",
5394
+ Plan: "plan"
5395
+ };
5380
5396
  var CreateEntityProcessorType = {
5381
5397
  Stripe: "stripe",
5382
5398
  Revenuecat: "revenuecat"
@@ -5631,13 +5647,15 @@ var CreateEntityFlags$inboundSchema = z18.pipe(
5631
5647
  })
5632
5648
  );
5633
5649
  var CreateEntityLimitTypeResponse$inboundSchema = inboundSchema(CreateEntityLimitTypeResponse);
5650
+ var CreateEntitySpendLimitSource$inboundSchema = inboundSchema(CreateEntitySpendLimitSource);
5634
5651
  var CreateEntitySpendLimitResponse$inboundSchema = z18.pipe(
5635
5652
  z18.object({
5636
5653
  feature_id: optional3(string4()),
5637
5654
  enabled: z18._default(boolean2(), false),
5638
5655
  limit_type: optional3(CreateEntityLimitTypeResponse$inboundSchema),
5639
5656
  overage_limit: optional3(number2()),
5640
- skip_overage_billing: optional3(boolean2())
5657
+ skip_overage_billing: optional3(boolean2()),
5658
+ source: optional3(CreateEntitySpendLimitSource$inboundSchema)
5641
5659
  }),
5642
5660
  z18.transform((v) => {
5643
5661
  return remap(v, {
@@ -5652,6 +5670,7 @@ var CreateEntityIntervalResponse$inboundSchema = inboundSchema(CreateEntityInter
5652
5670
  var CreateEntityFilterResponse$inboundSchema = z18.object({
5653
5671
  properties: z18.record(z18.string(), z18.any())
5654
5672
  });
5673
+ var CreateEntityUsageLimitSource$inboundSchema = inboundSchema(CreateEntityUsageLimitSource);
5655
5674
  var CreateEntityUsageLimitResponse$inboundSchema = z18.pipe(
5656
5675
  z18.object({
5657
5676
  feature_id: string4(),
@@ -5661,7 +5680,8 @@ var CreateEntityUsageLimitResponse$inboundSchema = z18.pipe(
5661
5680
  filter: optional3(
5662
5681
  z18.lazy(() => CreateEntityFilterResponse$inboundSchema)
5663
5682
  ),
5664
- usage: optional3(number2())
5683
+ usage: optional3(number2()),
5684
+ source: optional3(CreateEntityUsageLimitSource$inboundSchema)
5665
5685
  }),
5666
5686
  z18.transform((v) => {
5667
5687
  return remap(v, {
@@ -5670,13 +5690,15 @@ var CreateEntityUsageLimitResponse$inboundSchema = z18.pipe(
5670
5690
  })
5671
5691
  );
5672
5692
  var CreateEntityThresholdTypeResponse$inboundSchema = inboundSchema(CreateEntityThresholdTypeResponse);
5693
+ var CreateEntityUsageAlertSource$inboundSchema = inboundSchema(CreateEntityUsageAlertSource);
5673
5694
  var CreateEntityUsageAlertResponse$inboundSchema = z18.pipe(
5674
5695
  z18.object({
5675
5696
  feature_id: optional3(string4()),
5676
5697
  enabled: z18._default(boolean2(), true),
5677
5698
  threshold: number2(),
5678
5699
  threshold_type: CreateEntityThresholdTypeResponse$inboundSchema,
5679
- name: optional3(string4())
5700
+ name: optional3(string4()),
5701
+ source: optional3(CreateEntityUsageAlertSource$inboundSchema)
5680
5702
  }),
5681
5703
  z18.transform((v) => {
5682
5704
  return remap(v, {
@@ -5685,10 +5707,12 @@ var CreateEntityUsageAlertResponse$inboundSchema = z18.pipe(
5685
5707
  });
5686
5708
  })
5687
5709
  );
5710
+ var CreateEntityOverageAllowedSource$inboundSchema = inboundSchema(CreateEntityOverageAllowedSource);
5688
5711
  var CreateEntityOverageAllowedResponse$inboundSchema = z18.pipe(
5689
5712
  z18.object({
5690
5713
  feature_id: string4(),
5691
- enabled: z18._default(boolean2(), false)
5714
+ enabled: z18._default(boolean2(), false),
5715
+ source: optional3(CreateEntityOverageAllowedSource$inboundSchema)
5692
5716
  }),
5693
5717
  z18.transform((v) => {
5694
5718
  return remap(v, {
@@ -8060,22 +8084,42 @@ var CustomerPurchaseLimitInterval1 = {
8060
8084
  Week: "week",
8061
8085
  Month: "month"
8062
8086
  };
8087
+ var AutoTopupSource = {
8088
+ Customer: "customer",
8089
+ Plan: "plan"
8090
+ };
8063
8091
  var CustomerLimitType = {
8064
8092
  Absolute: "absolute",
8065
8093
  UsagePercentage: "usage_percentage"
8066
8094
  };
8095
+ var SpendLimitSource = {
8096
+ Customer: "customer",
8097
+ Plan: "plan"
8098
+ };
8067
8099
  var CustomerUsageLimitInterval = {
8068
8100
  Day: "day",
8069
8101
  Week: "week",
8070
8102
  Month: "month",
8071
8103
  Year: "year"
8072
8104
  };
8105
+ var UsageLimitSource = {
8106
+ Customer: "customer",
8107
+ Plan: "plan"
8108
+ };
8073
8109
  var CustomerThresholdType = {
8074
8110
  Usage: "usage",
8075
8111
  UsagePercentage: "usage_percentage",
8076
8112
  Remaining: "remaining",
8077
8113
  RemainingPercentage: "remaining_percentage"
8078
8114
  };
8115
+ var UsageAlertSource = {
8116
+ Customer: "customer",
8117
+ Plan: "plan"
8118
+ };
8119
+ var OverageAllowedSource = {
8120
+ Customer: "customer",
8121
+ Plan: "plan"
8122
+ };
8079
8123
  var CustomerStatus = {
8080
8124
  Active: "active",
8081
8125
  Scheduled: "scheduled"
@@ -8118,36 +8162,37 @@ var CustomerEnv$inboundSchema = inboundSchema(CustomerEnv);
8118
8162
  var CustomerPurchaseLimitInterval2$inboundSchema = inboundSchema(CustomerPurchaseLimitInterval2);
8119
8163
  var CustomerPurchaseLimit2$inboundSchema = z24.pipe(
8120
8164
  z24.object({
8121
- interval: nullable(CustomerPurchaseLimitInterval2$inboundSchema),
8122
- interval_count: nullable(number2()),
8123
- limit: nullable(number2()),
8124
- count: number2(),
8125
- next_reset_at: number2()
8165
+ interval: CustomerPurchaseLimitInterval2$inboundSchema,
8166
+ interval_count: z24._default(number2(), 1),
8167
+ limit: number2()
8126
8168
  }),
8127
8169
  z24.transform((v) => {
8128
8170
  return remap(v, {
8129
- "interval_count": "intervalCount",
8130
- "next_reset_at": "nextResetAt"
8171
+ "interval_count": "intervalCount"
8131
8172
  });
8132
8173
  })
8133
8174
  );
8134
8175
  var CustomerPurchaseLimitInterval1$inboundSchema = inboundSchema(CustomerPurchaseLimitInterval1);
8135
8176
  var CustomerPurchaseLimit1$inboundSchema = z24.pipe(
8136
8177
  z24.object({
8137
- interval: CustomerPurchaseLimitInterval1$inboundSchema,
8138
- interval_count: z24._default(number2(), 1),
8139
- limit: number2()
8178
+ interval: nullable(CustomerPurchaseLimitInterval1$inboundSchema),
8179
+ interval_count: nullable(number2()),
8180
+ limit: nullable(number2()),
8181
+ count: number2(),
8182
+ next_reset_at: number2()
8140
8183
  }),
8141
8184
  z24.transform((v) => {
8142
8185
  return remap(v, {
8143
- "interval_count": "intervalCount"
8186
+ "interval_count": "intervalCount",
8187
+ "next_reset_at": "nextResetAt"
8144
8188
  });
8145
8189
  })
8146
8190
  );
8147
8191
  var CustomerPurchaseLimitUnion$inboundSchema = smartUnion([
8148
- z24.lazy(() => CustomerPurchaseLimit2$inboundSchema),
8149
- z24.lazy(() => CustomerPurchaseLimit1$inboundSchema)
8192
+ z24.lazy(() => CustomerPurchaseLimit1$inboundSchema),
8193
+ z24.lazy(() => CustomerPurchaseLimit2$inboundSchema)
8150
8194
  ]);
8195
+ var AutoTopupSource$inboundSchema = inboundSchema(AutoTopupSource);
8151
8196
  var CustomerAutoTopup$inboundSchema = z24.pipe(
8152
8197
  z24.object({
8153
8198
  feature_id: string4(),
@@ -8155,10 +8200,11 @@ var CustomerAutoTopup$inboundSchema = z24.pipe(
8155
8200
  threshold: number2(),
8156
8201
  quantity: number2(),
8157
8202
  purchase_limit: optional3(smartUnion([
8158
- z24.lazy(() => CustomerPurchaseLimit2$inboundSchema),
8159
- z24.lazy(() => CustomerPurchaseLimit1$inboundSchema)
8203
+ z24.lazy(() => CustomerPurchaseLimit1$inboundSchema),
8204
+ z24.lazy(() => CustomerPurchaseLimit2$inboundSchema)
8160
8205
  ])),
8161
- invoice_mode: optional3(boolean2())
8206
+ invoice_mode: optional3(boolean2()),
8207
+ source: optional3(AutoTopupSource$inboundSchema)
8162
8208
  }),
8163
8209
  z24.transform((v) => {
8164
8210
  return remap(v, {
@@ -8169,13 +8215,15 @@ var CustomerAutoTopup$inboundSchema = z24.pipe(
8169
8215
  })
8170
8216
  );
8171
8217
  var CustomerLimitType$inboundSchema = inboundSchema(CustomerLimitType);
8218
+ var SpendLimitSource$inboundSchema = inboundSchema(SpendLimitSource);
8172
8219
  var CustomerSpendLimit$inboundSchema = z24.pipe(
8173
8220
  z24.object({
8174
8221
  feature_id: optional3(string4()),
8175
8222
  enabled: z24._default(boolean2(), false),
8176
8223
  limit_type: optional3(CustomerLimitType$inboundSchema),
8177
8224
  overage_limit: optional3(number2()),
8178
- skip_overage_billing: optional3(boolean2())
8225
+ skip_overage_billing: optional3(boolean2()),
8226
+ source: optional3(SpendLimitSource$inboundSchema)
8179
8227
  }),
8180
8228
  z24.transform((v) => {
8181
8229
  return remap(v, {
@@ -8190,6 +8238,7 @@ var CustomerUsageLimitInterval$inboundSchema = inboundSchema(CustomerUsageLimitI
8190
8238
  var CustomerFilter$inboundSchema = z24.object({
8191
8239
  properties: z24.record(z24.string(), z24.any())
8192
8240
  });
8241
+ var UsageLimitSource$inboundSchema = inboundSchema(UsageLimitSource);
8193
8242
  var CustomerUsageLimit$inboundSchema = z24.pipe(
8194
8243
  z24.object({
8195
8244
  feature_id: string4(),
@@ -8197,7 +8246,8 @@ var CustomerUsageLimit$inboundSchema = z24.pipe(
8197
8246
  limit: number2(),
8198
8247
  interval: CustomerUsageLimitInterval$inboundSchema,
8199
8248
  filter: optional3(z24.lazy(() => CustomerFilter$inboundSchema)),
8200
- usage: optional3(number2())
8249
+ usage: optional3(number2()),
8250
+ source: optional3(UsageLimitSource$inboundSchema)
8201
8251
  }),
8202
8252
  z24.transform((v) => {
8203
8253
  return remap(v, {
@@ -8206,13 +8256,15 @@ var CustomerUsageLimit$inboundSchema = z24.pipe(
8206
8256
  })
8207
8257
  );
8208
8258
  var CustomerThresholdType$inboundSchema = inboundSchema(CustomerThresholdType);
8259
+ var UsageAlertSource$inboundSchema = inboundSchema(UsageAlertSource);
8209
8260
  var CustomerUsageAlert$inboundSchema = z24.pipe(
8210
8261
  z24.object({
8211
8262
  feature_id: optional3(string4()),
8212
8263
  enabled: z24._default(boolean2(), true),
8213
8264
  threshold: number2(),
8214
8265
  threshold_type: CustomerThresholdType$inboundSchema,
8215
- name: optional3(string4())
8266
+ name: optional3(string4()),
8267
+ source: optional3(UsageAlertSource$inboundSchema)
8216
8268
  }),
8217
8269
  z24.transform((v) => {
8218
8270
  return remap(v, {
@@ -8221,10 +8273,12 @@ var CustomerUsageAlert$inboundSchema = z24.pipe(
8221
8273
  });
8222
8274
  })
8223
8275
  );
8276
+ var OverageAllowedSource$inboundSchema = inboundSchema(OverageAllowedSource);
8224
8277
  var CustomerOverageAllowed$inboundSchema = z24.pipe(
8225
8278
  z24.object({
8226
8279
  feature_id: string4(),
8227
- enabled: z24._default(boolean2(), false)
8280
+ enabled: z24._default(boolean2(), false),
8281
+ source: optional3(OverageAllowedSource$inboundSchema)
8228
8282
  }),
8229
8283
  z24.transform((v) => {
8230
8284
  return remap(v, {
@@ -8729,22 +8783,42 @@ var GetCustomerPurchaseLimitInterval1 = {
8729
8783
  Week: "week",
8730
8784
  Month: "month"
8731
8785
  };
8786
+ var GetCustomerAutoTopupSource = {
8787
+ Customer: "customer",
8788
+ Plan: "plan"
8789
+ };
8732
8790
  var GetCustomerLimitType = {
8733
8791
  Absolute: "absolute",
8734
8792
  UsagePercentage: "usage_percentage"
8735
8793
  };
8794
+ var GetCustomerSpendLimitSource = {
8795
+ Customer: "customer",
8796
+ Plan: "plan"
8797
+ };
8736
8798
  var GetCustomerUsageLimitInterval = {
8737
8799
  Day: "day",
8738
8800
  Week: "week",
8739
8801
  Month: "month",
8740
8802
  Year: "year"
8741
8803
  };
8804
+ var GetCustomerUsageLimitSource = {
8805
+ Customer: "customer",
8806
+ Plan: "plan"
8807
+ };
8742
8808
  var GetCustomerThresholdType = {
8743
8809
  Usage: "usage",
8744
8810
  UsagePercentage: "usage_percentage",
8745
8811
  Remaining: "remaining",
8746
8812
  RemainingPercentage: "remaining_percentage"
8747
8813
  };
8814
+ var GetCustomerUsageAlertSource = {
8815
+ Customer: "customer",
8816
+ Plan: "plan"
8817
+ };
8818
+ var GetCustomerOverageAllowedSource = {
8819
+ Customer: "customer",
8820
+ Plan: "plan"
8821
+ };
8748
8822
  var GetCustomerStatus = {
8749
8823
  Active: "active",
8750
8824
  Scheduled: "scheduled"
@@ -8798,36 +8872,37 @@ var GetCustomerEnv$inboundSchema = inboundSchema(GetCustomerEnv);
8798
8872
  var GetCustomerPurchaseLimitInterval2$inboundSchema = inboundSchema(GetCustomerPurchaseLimitInterval2);
8799
8873
  var GetCustomerPurchaseLimit2$inboundSchema = z31.pipe(
8800
8874
  z31.object({
8801
- interval: nullable(GetCustomerPurchaseLimitInterval2$inboundSchema),
8802
- interval_count: nullable(number2()),
8803
- limit: nullable(number2()),
8804
- count: number2(),
8805
- next_reset_at: number2()
8875
+ interval: GetCustomerPurchaseLimitInterval2$inboundSchema,
8876
+ interval_count: z31._default(number2(), 1),
8877
+ limit: number2()
8806
8878
  }),
8807
8879
  z31.transform((v) => {
8808
8880
  return remap(v, {
8809
- "interval_count": "intervalCount",
8810
- "next_reset_at": "nextResetAt"
8881
+ "interval_count": "intervalCount"
8811
8882
  });
8812
8883
  })
8813
8884
  );
8814
8885
  var GetCustomerPurchaseLimitInterval1$inboundSchema = inboundSchema(GetCustomerPurchaseLimitInterval1);
8815
8886
  var GetCustomerPurchaseLimit1$inboundSchema = z31.pipe(
8816
8887
  z31.object({
8817
- interval: GetCustomerPurchaseLimitInterval1$inboundSchema,
8818
- interval_count: z31._default(number2(), 1),
8819
- limit: number2()
8888
+ interval: nullable(GetCustomerPurchaseLimitInterval1$inboundSchema),
8889
+ interval_count: nullable(number2()),
8890
+ limit: nullable(number2()),
8891
+ count: number2(),
8892
+ next_reset_at: number2()
8820
8893
  }),
8821
8894
  z31.transform((v) => {
8822
8895
  return remap(v, {
8823
- "interval_count": "intervalCount"
8896
+ "interval_count": "intervalCount",
8897
+ "next_reset_at": "nextResetAt"
8824
8898
  });
8825
8899
  })
8826
8900
  );
8827
8901
  var GetCustomerPurchaseLimitUnion$inboundSchema = smartUnion([
8828
- z31.lazy(() => GetCustomerPurchaseLimit2$inboundSchema),
8829
- z31.lazy(() => GetCustomerPurchaseLimit1$inboundSchema)
8902
+ z31.lazy(() => GetCustomerPurchaseLimit1$inboundSchema),
8903
+ z31.lazy(() => GetCustomerPurchaseLimit2$inboundSchema)
8830
8904
  ]);
8905
+ var GetCustomerAutoTopupSource$inboundSchema = inboundSchema(GetCustomerAutoTopupSource);
8831
8906
  var GetCustomerAutoTopup$inboundSchema = z31.pipe(
8832
8907
  z31.object({
8833
8908
  feature_id: string4(),
@@ -8835,10 +8910,11 @@ var GetCustomerAutoTopup$inboundSchema = z31.pipe(
8835
8910
  threshold: number2(),
8836
8911
  quantity: number2(),
8837
8912
  purchase_limit: optional3(smartUnion([
8838
- z31.lazy(() => GetCustomerPurchaseLimit2$inboundSchema),
8839
- z31.lazy(() => GetCustomerPurchaseLimit1$inboundSchema)
8913
+ z31.lazy(() => GetCustomerPurchaseLimit1$inboundSchema),
8914
+ z31.lazy(() => GetCustomerPurchaseLimit2$inboundSchema)
8840
8915
  ])),
8841
- invoice_mode: optional3(boolean2())
8916
+ invoice_mode: optional3(boolean2()),
8917
+ source: optional3(GetCustomerAutoTopupSource$inboundSchema)
8842
8918
  }),
8843
8919
  z31.transform((v) => {
8844
8920
  return remap(v, {
@@ -8849,13 +8925,15 @@ var GetCustomerAutoTopup$inboundSchema = z31.pipe(
8849
8925
  })
8850
8926
  );
8851
8927
  var GetCustomerLimitType$inboundSchema = inboundSchema(GetCustomerLimitType);
8928
+ var GetCustomerSpendLimitSource$inboundSchema = inboundSchema(GetCustomerSpendLimitSource);
8852
8929
  var GetCustomerSpendLimit$inboundSchema = z31.pipe(
8853
8930
  z31.object({
8854
8931
  feature_id: optional3(string4()),
8855
8932
  enabled: z31._default(boolean2(), false),
8856
8933
  limit_type: optional3(GetCustomerLimitType$inboundSchema),
8857
8934
  overage_limit: optional3(number2()),
8858
- skip_overage_billing: optional3(boolean2())
8935
+ skip_overage_billing: optional3(boolean2()),
8936
+ source: optional3(GetCustomerSpendLimitSource$inboundSchema)
8859
8937
  }),
8860
8938
  z31.transform((v) => {
8861
8939
  return remap(v, {
@@ -8870,6 +8948,7 @@ var GetCustomerUsageLimitInterval$inboundSchema = inboundSchema(GetCustomerUsage
8870
8948
  var GetCustomerFilter$inboundSchema = z31.object({
8871
8949
  properties: z31.record(z31.string(), z31.any())
8872
8950
  });
8951
+ var GetCustomerUsageLimitSource$inboundSchema = inboundSchema(GetCustomerUsageLimitSource);
8873
8952
  var GetCustomerUsageLimit$inboundSchema = z31.pipe(
8874
8953
  z31.object({
8875
8954
  feature_id: string4(),
@@ -8877,7 +8956,8 @@ var GetCustomerUsageLimit$inboundSchema = z31.pipe(
8877
8956
  limit: number2(),
8878
8957
  interval: GetCustomerUsageLimitInterval$inboundSchema,
8879
8958
  filter: optional3(z31.lazy(() => GetCustomerFilter$inboundSchema)),
8880
- usage: optional3(number2())
8959
+ usage: optional3(number2()),
8960
+ source: optional3(GetCustomerUsageLimitSource$inboundSchema)
8881
8961
  }),
8882
8962
  z31.transform((v) => {
8883
8963
  return remap(v, {
@@ -8886,13 +8966,15 @@ var GetCustomerUsageLimit$inboundSchema = z31.pipe(
8886
8966
  })
8887
8967
  );
8888
8968
  var GetCustomerThresholdType$inboundSchema = inboundSchema(GetCustomerThresholdType);
8969
+ var GetCustomerUsageAlertSource$inboundSchema = inboundSchema(GetCustomerUsageAlertSource);
8889
8970
  var GetCustomerUsageAlert$inboundSchema = z31.pipe(
8890
8971
  z31.object({
8891
8972
  feature_id: optional3(string4()),
8892
8973
  enabled: z31._default(boolean2(), true),
8893
8974
  threshold: number2(),
8894
8975
  threshold_type: GetCustomerThresholdType$inboundSchema,
8895
- name: optional3(string4())
8976
+ name: optional3(string4()),
8977
+ source: optional3(GetCustomerUsageAlertSource$inboundSchema)
8896
8978
  }),
8897
8979
  z31.transform((v) => {
8898
8980
  return remap(v, {
@@ -8901,10 +8983,12 @@ var GetCustomerUsageAlert$inboundSchema = z31.pipe(
8901
8983
  });
8902
8984
  })
8903
8985
  );
8986
+ var GetCustomerOverageAllowedSource$inboundSchema = inboundSchema(GetCustomerOverageAllowedSource);
8904
8987
  var GetCustomerOverageAllowed$inboundSchema = z31.pipe(
8905
8988
  z31.object({
8906
8989
  feature_id: string4(),
8907
- enabled: z31._default(boolean2(), false)
8990
+ enabled: z31._default(boolean2(), false),
8991
+ source: optional3(GetCustomerOverageAllowedSource$inboundSchema)
8908
8992
  }),
8909
8993
  z31.transform((v) => {
8910
8994
  return remap(v, {
@@ -9293,18 +9377,34 @@ var GetEntityLimitType = {
9293
9377
  Absolute: "absolute",
9294
9378
  UsagePercentage: "usage_percentage"
9295
9379
  };
9380
+ var GetEntitySpendLimitSource = {
9381
+ Customer: "customer",
9382
+ Plan: "plan"
9383
+ };
9296
9384
  var GetEntityInterval = {
9297
9385
  Day: "day",
9298
9386
  Week: "week",
9299
9387
  Month: "month",
9300
9388
  Year: "year"
9301
9389
  };
9390
+ var GetEntityUsageLimitSource = {
9391
+ Customer: "customer",
9392
+ Plan: "plan"
9393
+ };
9302
9394
  var GetEntityThresholdType = {
9303
9395
  Usage: "usage",
9304
9396
  UsagePercentage: "usage_percentage",
9305
9397
  Remaining: "remaining",
9306
9398
  RemainingPercentage: "remaining_percentage"
9307
9399
  };
9400
+ var GetEntityUsageAlertSource = {
9401
+ Customer: "customer",
9402
+ Plan: "plan"
9403
+ };
9404
+ var GetEntityOverageAllowedSource = {
9405
+ Customer: "customer",
9406
+ Plan: "plan"
9407
+ };
9308
9408
  var GetEntityProcessorType = {
9309
9409
  Stripe: "stripe",
9310
9410
  Revenuecat: "revenuecat"
@@ -9459,13 +9559,15 @@ var GetEntityFlags$inboundSchema = z32.pipe(
9459
9559
  })
9460
9560
  );
9461
9561
  var GetEntityLimitType$inboundSchema = inboundSchema(GetEntityLimitType);
9562
+ var GetEntitySpendLimitSource$inboundSchema = inboundSchema(GetEntitySpendLimitSource);
9462
9563
  var GetEntitySpendLimit$inboundSchema = z32.pipe(
9463
9564
  z32.object({
9464
9565
  feature_id: optional3(string4()),
9465
9566
  enabled: z32._default(boolean2(), false),
9466
9567
  limit_type: optional3(GetEntityLimitType$inboundSchema),
9467
9568
  overage_limit: optional3(number2()),
9468
- skip_overage_billing: optional3(boolean2())
9569
+ skip_overage_billing: optional3(boolean2()),
9570
+ source: optional3(GetEntitySpendLimitSource$inboundSchema)
9469
9571
  }),
9470
9572
  z32.transform((v) => {
9471
9573
  return remap(v, {
@@ -9480,6 +9582,7 @@ var GetEntityInterval$inboundSchema = inboundSchema(GetEntityInterval);
9480
9582
  var GetEntityFilter$inboundSchema = z32.object({
9481
9583
  properties: z32.record(z32.string(), z32.any())
9482
9584
  });
9585
+ var GetEntityUsageLimitSource$inboundSchema = inboundSchema(GetEntityUsageLimitSource);
9483
9586
  var GetEntityUsageLimit$inboundSchema = z32.pipe(
9484
9587
  z32.object({
9485
9588
  feature_id: string4(),
@@ -9487,7 +9590,8 @@ var GetEntityUsageLimit$inboundSchema = z32.pipe(
9487
9590
  limit: number2(),
9488
9591
  interval: GetEntityInterval$inboundSchema,
9489
9592
  filter: optional3(z32.lazy(() => GetEntityFilter$inboundSchema)),
9490
- usage: optional3(number2())
9593
+ usage: optional3(number2()),
9594
+ source: optional3(GetEntityUsageLimitSource$inboundSchema)
9491
9595
  }),
9492
9596
  z32.transform((v) => {
9493
9597
  return remap(v, {
@@ -9496,13 +9600,15 @@ var GetEntityUsageLimit$inboundSchema = z32.pipe(
9496
9600
  })
9497
9601
  );
9498
9602
  var GetEntityThresholdType$inboundSchema = inboundSchema(GetEntityThresholdType);
9603
+ var GetEntityUsageAlertSource$inboundSchema = inboundSchema(GetEntityUsageAlertSource);
9499
9604
  var GetEntityUsageAlert$inboundSchema = z32.pipe(
9500
9605
  z32.object({
9501
9606
  feature_id: optional3(string4()),
9502
9607
  enabled: z32._default(boolean2(), true),
9503
9608
  threshold: number2(),
9504
9609
  threshold_type: GetEntityThresholdType$inboundSchema,
9505
- name: optional3(string4())
9610
+ name: optional3(string4()),
9611
+ source: optional3(GetEntityUsageAlertSource$inboundSchema)
9506
9612
  }),
9507
9613
  z32.transform((v) => {
9508
9614
  return remap(v, {
@@ -9511,10 +9617,12 @@ var GetEntityUsageAlert$inboundSchema = z32.pipe(
9511
9617
  });
9512
9618
  })
9513
9619
  );
9620
+ var GetEntityOverageAllowedSource$inboundSchema = inboundSchema(GetEntityOverageAllowedSource);
9514
9621
  var GetEntityOverageAllowed$inboundSchema = z32.pipe(
9515
9622
  z32.object({
9516
9623
  feature_id: string4(),
9517
- enabled: z32._default(boolean2(), false)
9624
+ enabled: z32._default(boolean2(), false),
9625
+ source: optional3(GetEntityOverageAllowedSource$inboundSchema)
9518
9626
  }),
9519
9627
  z32.transform((v) => {
9520
9628
  return remap(v, {
@@ -11121,22 +11229,42 @@ var ListCustomersPurchaseLimitInterval1 = {
11121
11229
  Week: "week",
11122
11230
  Month: "month"
11123
11231
  };
11232
+ var ListCustomersAutoTopupSource = {
11233
+ Customer: "customer",
11234
+ Plan: "plan"
11235
+ };
11124
11236
  var ListCustomersLimitType = {
11125
11237
  Absolute: "absolute",
11126
11238
  UsagePercentage: "usage_percentage"
11127
11239
  };
11240
+ var ListCustomersSpendLimitSource = {
11241
+ Customer: "customer",
11242
+ Plan: "plan"
11243
+ };
11128
11244
  var ListCustomersUsageLimitInterval = {
11129
11245
  Day: "day",
11130
11246
  Week: "week",
11131
11247
  Month: "month",
11132
11248
  Year: "year"
11133
11249
  };
11250
+ var ListCustomersUsageLimitSource = {
11251
+ Customer: "customer",
11252
+ Plan: "plan"
11253
+ };
11134
11254
  var ListCustomersThresholdType = {
11135
11255
  Usage: "usage",
11136
11256
  UsagePercentage: "usage_percentage",
11137
11257
  Remaining: "remaining",
11138
11258
  RemainingPercentage: "remaining_percentage"
11139
11259
  };
11260
+ var ListCustomersUsageAlertSource = {
11261
+ Customer: "customer",
11262
+ Plan: "plan"
11263
+ };
11264
+ var ListCustomersOverageAllowedSource = {
11265
+ Customer: "customer",
11266
+ Plan: "plan"
11267
+ };
11140
11268
  var ListCustomersStatus = {
11141
11269
  Active: "active",
11142
11270
  Scheduled: "scheduled"
@@ -11183,36 +11311,37 @@ var ListCustomersEnv$inboundSchema = inboundSchema(ListCustomersEnv);
11183
11311
  var ListCustomersPurchaseLimitInterval2$inboundSchema = inboundSchema(ListCustomersPurchaseLimitInterval2);
11184
11312
  var ListCustomersPurchaseLimit2$inboundSchema = z39.pipe(
11185
11313
  z39.object({
11186
- interval: nullable(ListCustomersPurchaseLimitInterval2$inboundSchema),
11187
- interval_count: nullable(number2()),
11188
- limit: nullable(number2()),
11189
- count: number2(),
11190
- next_reset_at: number2()
11314
+ interval: ListCustomersPurchaseLimitInterval2$inboundSchema,
11315
+ interval_count: z39._default(number2(), 1),
11316
+ limit: number2()
11191
11317
  }),
11192
11318
  z39.transform((v) => {
11193
11319
  return remap(v, {
11194
- "interval_count": "intervalCount",
11195
- "next_reset_at": "nextResetAt"
11320
+ "interval_count": "intervalCount"
11196
11321
  });
11197
11322
  })
11198
11323
  );
11199
11324
  var ListCustomersPurchaseLimitInterval1$inboundSchema = inboundSchema(ListCustomersPurchaseLimitInterval1);
11200
11325
  var ListCustomersPurchaseLimit1$inboundSchema = z39.pipe(
11201
11326
  z39.object({
11202
- interval: ListCustomersPurchaseLimitInterval1$inboundSchema,
11203
- interval_count: z39._default(number2(), 1),
11204
- limit: number2()
11327
+ interval: nullable(ListCustomersPurchaseLimitInterval1$inboundSchema),
11328
+ interval_count: nullable(number2()),
11329
+ limit: nullable(number2()),
11330
+ count: number2(),
11331
+ next_reset_at: number2()
11205
11332
  }),
11206
11333
  z39.transform((v) => {
11207
11334
  return remap(v, {
11208
- "interval_count": "intervalCount"
11335
+ "interval_count": "intervalCount",
11336
+ "next_reset_at": "nextResetAt"
11209
11337
  });
11210
11338
  })
11211
11339
  );
11212
11340
  var ListCustomersPurchaseLimitUnion$inboundSchema = smartUnion([
11213
- z39.lazy(() => ListCustomersPurchaseLimit2$inboundSchema),
11214
- z39.lazy(() => ListCustomersPurchaseLimit1$inboundSchema)
11341
+ z39.lazy(() => ListCustomersPurchaseLimit1$inboundSchema),
11342
+ z39.lazy(() => ListCustomersPurchaseLimit2$inboundSchema)
11215
11343
  ]);
11344
+ var ListCustomersAutoTopupSource$inboundSchema = inboundSchema(ListCustomersAutoTopupSource);
11216
11345
  var ListCustomersAutoTopup$inboundSchema = z39.pipe(
11217
11346
  z39.object({
11218
11347
  feature_id: string4(),
@@ -11220,10 +11349,11 @@ var ListCustomersAutoTopup$inboundSchema = z39.pipe(
11220
11349
  threshold: number2(),
11221
11350
  quantity: number2(),
11222
11351
  purchase_limit: optional3(smartUnion([
11223
- z39.lazy(() => ListCustomersPurchaseLimit2$inboundSchema),
11224
- z39.lazy(() => ListCustomersPurchaseLimit1$inboundSchema)
11352
+ z39.lazy(() => ListCustomersPurchaseLimit1$inboundSchema),
11353
+ z39.lazy(() => ListCustomersPurchaseLimit2$inboundSchema)
11225
11354
  ])),
11226
- invoice_mode: optional3(boolean2())
11355
+ invoice_mode: optional3(boolean2()),
11356
+ source: optional3(ListCustomersAutoTopupSource$inboundSchema)
11227
11357
  }),
11228
11358
  z39.transform((v) => {
11229
11359
  return remap(v, {
@@ -11234,13 +11364,15 @@ var ListCustomersAutoTopup$inboundSchema = z39.pipe(
11234
11364
  })
11235
11365
  );
11236
11366
  var ListCustomersLimitType$inboundSchema = inboundSchema(ListCustomersLimitType);
11367
+ var ListCustomersSpendLimitSource$inboundSchema = inboundSchema(ListCustomersSpendLimitSource);
11237
11368
  var ListCustomersSpendLimit$inboundSchema = z39.pipe(
11238
11369
  z39.object({
11239
11370
  feature_id: optional3(string4()),
11240
11371
  enabled: z39._default(boolean2(), false),
11241
11372
  limit_type: optional3(ListCustomersLimitType$inboundSchema),
11242
11373
  overage_limit: optional3(number2()),
11243
- skip_overage_billing: optional3(boolean2())
11374
+ skip_overage_billing: optional3(boolean2()),
11375
+ source: optional3(ListCustomersSpendLimitSource$inboundSchema)
11244
11376
  }),
11245
11377
  z39.transform((v) => {
11246
11378
  return remap(v, {
@@ -11255,6 +11387,7 @@ var ListCustomersUsageLimitInterval$inboundSchema = inboundSchema(ListCustomersU
11255
11387
  var ListCustomersFilter$inboundSchema = z39.object({
11256
11388
  properties: z39.record(z39.string(), z39.any())
11257
11389
  });
11390
+ var ListCustomersUsageLimitSource$inboundSchema = inboundSchema(ListCustomersUsageLimitSource);
11258
11391
  var ListCustomersUsageLimit$inboundSchema = z39.pipe(
11259
11392
  z39.object({
11260
11393
  feature_id: string4(),
@@ -11262,7 +11395,8 @@ var ListCustomersUsageLimit$inboundSchema = z39.pipe(
11262
11395
  limit: number2(),
11263
11396
  interval: ListCustomersUsageLimitInterval$inboundSchema,
11264
11397
  filter: optional3(z39.lazy(() => ListCustomersFilter$inboundSchema)),
11265
- usage: optional3(number2())
11398
+ usage: optional3(number2()),
11399
+ source: optional3(ListCustomersUsageLimitSource$inboundSchema)
11266
11400
  }),
11267
11401
  z39.transform((v) => {
11268
11402
  return remap(v, {
@@ -11271,13 +11405,15 @@ var ListCustomersUsageLimit$inboundSchema = z39.pipe(
11271
11405
  })
11272
11406
  );
11273
11407
  var ListCustomersThresholdType$inboundSchema = inboundSchema(ListCustomersThresholdType);
11408
+ var ListCustomersUsageAlertSource$inboundSchema = inboundSchema(ListCustomersUsageAlertSource);
11274
11409
  var ListCustomersUsageAlert$inboundSchema = z39.pipe(
11275
11410
  z39.object({
11276
11411
  feature_id: optional3(string4()),
11277
11412
  enabled: z39._default(boolean2(), true),
11278
11413
  threshold: number2(),
11279
11414
  threshold_type: ListCustomersThresholdType$inboundSchema,
11280
- name: optional3(string4())
11415
+ name: optional3(string4()),
11416
+ source: optional3(ListCustomersUsageAlertSource$inboundSchema)
11281
11417
  }),
11282
11418
  z39.transform((v) => {
11283
11419
  return remap(v, {
@@ -11286,10 +11422,12 @@ var ListCustomersUsageAlert$inboundSchema = z39.pipe(
11286
11422
  });
11287
11423
  })
11288
11424
  );
11425
+ var ListCustomersOverageAllowedSource$inboundSchema = inboundSchema(ListCustomersOverageAllowedSource);
11289
11426
  var ListCustomersOverageAllowed$inboundSchema = z39.pipe(
11290
11427
  z39.object({
11291
11428
  feature_id: string4(),
11292
- enabled: z39._default(boolean2(), false)
11429
+ enabled: z39._default(boolean2(), false),
11430
+ source: optional3(ListCustomersOverageAllowedSource$inboundSchema)
11293
11431
  }),
11294
11432
  z39.transform((v) => {
11295
11433
  return remap(v, {
@@ -11579,18 +11717,34 @@ var ListEntitiesLimitType = {
11579
11717
  Absolute: "absolute",
11580
11718
  UsagePercentage: "usage_percentage"
11581
11719
  };
11720
+ var ListEntitiesSpendLimitSource = {
11721
+ Customer: "customer",
11722
+ Plan: "plan"
11723
+ };
11582
11724
  var ListEntitiesInterval = {
11583
11725
  Day: "day",
11584
11726
  Week: "week",
11585
11727
  Month: "month",
11586
11728
  Year: "year"
11587
11729
  };
11730
+ var ListEntitiesUsageLimitSource = {
11731
+ Customer: "customer",
11732
+ Plan: "plan"
11733
+ };
11588
11734
  var ListEntitiesThresholdType = {
11589
11735
  Usage: "usage",
11590
11736
  UsagePercentage: "usage_percentage",
11591
11737
  Remaining: "remaining",
11592
11738
  RemainingPercentage: "remaining_percentage"
11593
11739
  };
11740
+ var ListEntitiesUsageAlertSource = {
11741
+ Customer: "customer",
11742
+ Plan: "plan"
11743
+ };
11744
+ var ListEntitiesOverageAllowedSource = {
11745
+ Customer: "customer",
11746
+ Plan: "plan"
11747
+ };
11594
11748
  var ListEntitiesProcessorType = {
11595
11749
  Stripe: "stripe",
11596
11750
  Revenuecat: "revenuecat"
@@ -11759,13 +11913,15 @@ var ListEntitiesFlags$inboundSchema = z40.pipe(
11759
11913
  })
11760
11914
  );
11761
11915
  var ListEntitiesLimitType$inboundSchema = inboundSchema(ListEntitiesLimitType);
11916
+ var ListEntitiesSpendLimitSource$inboundSchema = inboundSchema(ListEntitiesSpendLimitSource);
11762
11917
  var ListEntitiesSpendLimit$inboundSchema = z40.pipe(
11763
11918
  z40.object({
11764
11919
  feature_id: optional3(string4()),
11765
11920
  enabled: z40._default(boolean2(), false),
11766
11921
  limit_type: optional3(ListEntitiesLimitType$inboundSchema),
11767
11922
  overage_limit: optional3(number2()),
11768
- skip_overage_billing: optional3(boolean2())
11923
+ skip_overage_billing: optional3(boolean2()),
11924
+ source: optional3(ListEntitiesSpendLimitSource$inboundSchema)
11769
11925
  }),
11770
11926
  z40.transform((v) => {
11771
11927
  return remap(v, {
@@ -11780,6 +11936,7 @@ var ListEntitiesInterval$inboundSchema = inboundSchema(ListEntitiesInterval);
11780
11936
  var ListEntitiesFilter$inboundSchema = z40.object({
11781
11937
  properties: z40.record(z40.string(), z40.any())
11782
11938
  });
11939
+ var ListEntitiesUsageLimitSource$inboundSchema = inboundSchema(ListEntitiesUsageLimitSource);
11783
11940
  var ListEntitiesUsageLimit$inboundSchema = z40.pipe(
11784
11941
  z40.object({
11785
11942
  feature_id: string4(),
@@ -11787,7 +11944,8 @@ var ListEntitiesUsageLimit$inboundSchema = z40.pipe(
11787
11944
  limit: number2(),
11788
11945
  interval: ListEntitiesInterval$inboundSchema,
11789
11946
  filter: optional3(z40.lazy(() => ListEntitiesFilter$inboundSchema)),
11790
- usage: optional3(number2())
11947
+ usage: optional3(number2()),
11948
+ source: optional3(ListEntitiesUsageLimitSource$inboundSchema)
11791
11949
  }),
11792
11950
  z40.transform((v) => {
11793
11951
  return remap(v, {
@@ -11796,13 +11954,15 @@ var ListEntitiesUsageLimit$inboundSchema = z40.pipe(
11796
11954
  })
11797
11955
  );
11798
11956
  var ListEntitiesThresholdType$inboundSchema = inboundSchema(ListEntitiesThresholdType);
11957
+ var ListEntitiesUsageAlertSource$inboundSchema = inboundSchema(ListEntitiesUsageAlertSource);
11799
11958
  var ListEntitiesUsageAlert$inboundSchema = z40.pipe(
11800
11959
  z40.object({
11801
11960
  feature_id: optional3(string4()),
11802
11961
  enabled: z40._default(boolean2(), true),
11803
11962
  threshold: number2(),
11804
11963
  threshold_type: ListEntitiesThresholdType$inboundSchema,
11805
- name: optional3(string4())
11964
+ name: optional3(string4()),
11965
+ source: optional3(ListEntitiesUsageAlertSource$inboundSchema)
11806
11966
  }),
11807
11967
  z40.transform((v) => {
11808
11968
  return remap(v, {
@@ -11811,10 +11971,12 @@ var ListEntitiesUsageAlert$inboundSchema = z40.pipe(
11811
11971
  });
11812
11972
  })
11813
11973
  );
11974
+ var ListEntitiesOverageAllowedSource$inboundSchema = inboundSchema(ListEntitiesOverageAllowedSource);
11814
11975
  var ListEntitiesOverageAllowed$inboundSchema = z40.pipe(
11815
11976
  z40.object({
11816
11977
  feature_id: string4(),
11817
- enabled: z40._default(boolean2(), false)
11978
+ enabled: z40._default(boolean2(), false),
11979
+ source: optional3(ListEntitiesOverageAllowedSource$inboundSchema)
11818
11980
  }),
11819
11981
  z40.transform((v) => {
11820
11982
  return remap(v, {
@@ -17909,7 +18071,8 @@ var UpdateBalanceParams$outboundSchema = z61.pipe(
17909
18071
  interval: z61.optional(UpdateBalanceInterval$outboundSchema),
17910
18072
  includedGrant: z61.optional(z61.number()),
17911
18073
  balanceId: z61.optional(z61.string()),
17912
- nextResetAt: z61.optional(z61.number())
18074
+ nextResetAt: z61.optional(z61.number()),
18075
+ expiresAt: z61.optional(z61.number())
17913
18076
  }),
17914
18077
  z61.transform((v) => {
17915
18078
  return remap(v, {
@@ -17919,7 +18082,8 @@ var UpdateBalanceParams$outboundSchema = z61.pipe(
17919
18082
  addToBalance: "add_to_balance",
17920
18083
  includedGrant: "included_grant",
17921
18084
  balanceId: "balance_id",
17922
- nextResetAt: "next_reset_at"
18085
+ nextResetAt: "next_reset_at",
18086
+ expiresAt: "expires_at"
17923
18087
  });
17924
18088
  })
17925
18089
  );
@@ -17967,22 +18131,42 @@ var UpdateCustomerPurchaseLimitIntervalResponse1 = {
17967
18131
  Week: "week",
17968
18132
  Month: "month"
17969
18133
  };
18134
+ var UpdateCustomerAutoTopupSource = {
18135
+ Customer: "customer",
18136
+ Plan: "plan"
18137
+ };
17970
18138
  var UpdateCustomerLimitTypeResponse = {
17971
18139
  Absolute: "absolute",
17972
18140
  UsagePercentage: "usage_percentage"
17973
18141
  };
18142
+ var UpdateCustomerSpendLimitSource = {
18143
+ Customer: "customer",
18144
+ Plan: "plan"
18145
+ };
17974
18146
  var UpdateCustomerUsageLimitIntervalResponse = {
17975
18147
  Day: "day",
17976
18148
  Week: "week",
17977
18149
  Month: "month",
17978
18150
  Year: "year"
17979
18151
  };
18152
+ var UpdateCustomerUsageLimitSource = {
18153
+ Customer: "customer",
18154
+ Plan: "plan"
18155
+ };
17980
18156
  var UpdateCustomerThresholdTypeResponse = {
17981
18157
  Usage: "usage",
17982
18158
  UsagePercentage: "usage_percentage",
17983
18159
  Remaining: "remaining",
17984
18160
  RemainingPercentage: "remaining_percentage"
17985
18161
  };
18162
+ var UpdateCustomerUsageAlertSource = {
18163
+ Customer: "customer",
18164
+ Plan: "plan"
18165
+ };
18166
+ var UpdateCustomerOverageAllowedSource = {
18167
+ Customer: "customer",
18168
+ Plan: "plan"
18169
+ };
17986
18170
  var UpdateCustomerStatus = {
17987
18171
  Active: "active",
17988
18172
  Scheduled: "scheduled"
@@ -18179,38 +18363,39 @@ var UpdateCustomerEnv$inboundSchema = inboundSchema(UpdateCustomerEnv);
18179
18363
  var UpdateCustomerPurchaseLimitIntervalResponse2$inboundSchema = inboundSchema(UpdateCustomerPurchaseLimitIntervalResponse2);
18180
18364
  var UpdateCustomerPurchaseLimitResponse2$inboundSchema = z62.pipe(
18181
18365
  z62.object({
18182
- interval: nullable(
18183
- UpdateCustomerPurchaseLimitIntervalResponse2$inboundSchema
18184
- ),
18185
- interval_count: nullable(number2()),
18186
- limit: nullable(number2()),
18187
- count: number2(),
18188
- next_reset_at: number2()
18366
+ interval: UpdateCustomerPurchaseLimitIntervalResponse2$inboundSchema,
18367
+ interval_count: z62._default(number2(), 1),
18368
+ limit: number2()
18189
18369
  }),
18190
18370
  z62.transform((v) => {
18191
18371
  return remap(v, {
18192
- "interval_count": "intervalCount",
18193
- "next_reset_at": "nextResetAt"
18372
+ "interval_count": "intervalCount"
18194
18373
  });
18195
18374
  })
18196
18375
  );
18197
18376
  var UpdateCustomerPurchaseLimitIntervalResponse1$inboundSchema = inboundSchema(UpdateCustomerPurchaseLimitIntervalResponse1);
18198
18377
  var UpdateCustomerPurchaseLimitResponse1$inboundSchema = z62.pipe(
18199
18378
  z62.object({
18200
- interval: UpdateCustomerPurchaseLimitIntervalResponse1$inboundSchema,
18201
- interval_count: z62._default(number2(), 1),
18202
- limit: number2()
18379
+ interval: nullable(
18380
+ UpdateCustomerPurchaseLimitIntervalResponse1$inboundSchema
18381
+ ),
18382
+ interval_count: nullable(number2()),
18383
+ limit: nullable(number2()),
18384
+ count: number2(),
18385
+ next_reset_at: number2()
18203
18386
  }),
18204
18387
  z62.transform((v) => {
18205
18388
  return remap(v, {
18206
- "interval_count": "intervalCount"
18389
+ "interval_count": "intervalCount",
18390
+ "next_reset_at": "nextResetAt"
18207
18391
  });
18208
18392
  })
18209
18393
  );
18210
18394
  var UpdateCustomerPurchaseLimitUnion$inboundSchema = smartUnion([
18211
- z62.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema),
18212
- z62.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema)
18395
+ z62.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema),
18396
+ z62.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema)
18213
18397
  ]);
18398
+ var UpdateCustomerAutoTopupSource$inboundSchema = inboundSchema(UpdateCustomerAutoTopupSource);
18214
18399
  var UpdateCustomerAutoTopupResponse$inboundSchema = z62.pipe(
18215
18400
  z62.object({
18216
18401
  feature_id: string4(),
@@ -18218,10 +18403,11 @@ var UpdateCustomerAutoTopupResponse$inboundSchema = z62.pipe(
18218
18403
  threshold: number2(),
18219
18404
  quantity: number2(),
18220
18405
  purchase_limit: optional3(smartUnion([
18221
- z62.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema),
18222
- z62.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema)
18406
+ z62.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema),
18407
+ z62.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema)
18223
18408
  ])),
18224
- invoice_mode: optional3(boolean2())
18409
+ invoice_mode: optional3(boolean2()),
18410
+ source: optional3(UpdateCustomerAutoTopupSource$inboundSchema)
18225
18411
  }),
18226
18412
  z62.transform((v) => {
18227
18413
  return remap(v, {
@@ -18232,13 +18418,15 @@ var UpdateCustomerAutoTopupResponse$inboundSchema = z62.pipe(
18232
18418
  })
18233
18419
  );
18234
18420
  var UpdateCustomerLimitTypeResponse$inboundSchema = inboundSchema(UpdateCustomerLimitTypeResponse);
18421
+ var UpdateCustomerSpendLimitSource$inboundSchema = inboundSchema(UpdateCustomerSpendLimitSource);
18235
18422
  var UpdateCustomerSpendLimitResponse$inboundSchema = z62.pipe(
18236
18423
  z62.object({
18237
18424
  feature_id: optional3(string4()),
18238
18425
  enabled: z62._default(boolean2(), false),
18239
18426
  limit_type: optional3(UpdateCustomerLimitTypeResponse$inboundSchema),
18240
18427
  overage_limit: optional3(number2()),
18241
- skip_overage_billing: optional3(boolean2())
18428
+ skip_overage_billing: optional3(boolean2()),
18429
+ source: optional3(UpdateCustomerSpendLimitSource$inboundSchema)
18242
18430
  }),
18243
18431
  z62.transform((v) => {
18244
18432
  return remap(v, {
@@ -18253,6 +18441,7 @@ var UpdateCustomerUsageLimitIntervalResponse$inboundSchema = inboundSchema(Updat
18253
18441
  var UpdateCustomerFilterResponse$inboundSchema = z62.object({
18254
18442
  properties: z62.record(z62.string(), z62.any())
18255
18443
  });
18444
+ var UpdateCustomerUsageLimitSource$inboundSchema = inboundSchema(UpdateCustomerUsageLimitSource);
18256
18445
  var UpdateCustomerUsageLimitResponse$inboundSchema = z62.pipe(
18257
18446
  z62.object({
18258
18447
  feature_id: string4(),
@@ -18262,7 +18451,8 @@ var UpdateCustomerUsageLimitResponse$inboundSchema = z62.pipe(
18262
18451
  filter: optional3(
18263
18452
  z62.lazy(() => UpdateCustomerFilterResponse$inboundSchema)
18264
18453
  ),
18265
- usage: optional3(number2())
18454
+ usage: optional3(number2()),
18455
+ source: optional3(UpdateCustomerUsageLimitSource$inboundSchema)
18266
18456
  }),
18267
18457
  z62.transform((v) => {
18268
18458
  return remap(v, {
@@ -18271,13 +18461,15 @@ var UpdateCustomerUsageLimitResponse$inboundSchema = z62.pipe(
18271
18461
  })
18272
18462
  );
18273
18463
  var UpdateCustomerThresholdTypeResponse$inboundSchema = inboundSchema(UpdateCustomerThresholdTypeResponse);
18464
+ var UpdateCustomerUsageAlertSource$inboundSchema = inboundSchema(UpdateCustomerUsageAlertSource);
18274
18465
  var UpdateCustomerUsageAlertResponse$inboundSchema = z62.pipe(
18275
18466
  z62.object({
18276
18467
  feature_id: optional3(string4()),
18277
18468
  enabled: z62._default(boolean2(), true),
18278
18469
  threshold: number2(),
18279
18470
  threshold_type: UpdateCustomerThresholdTypeResponse$inboundSchema,
18280
- name: optional3(string4())
18471
+ name: optional3(string4()),
18472
+ source: optional3(UpdateCustomerUsageAlertSource$inboundSchema)
18281
18473
  }),
18282
18474
  z62.transform((v) => {
18283
18475
  return remap(v, {
@@ -18286,10 +18478,12 @@ var UpdateCustomerUsageAlertResponse$inboundSchema = z62.pipe(
18286
18478
  });
18287
18479
  })
18288
18480
  );
18481
+ var UpdateCustomerOverageAllowedSource$inboundSchema = inboundSchema(UpdateCustomerOverageAllowedSource);
18289
18482
  var UpdateCustomerOverageAllowedResponse$inboundSchema = z62.pipe(
18290
18483
  z62.object({
18291
18484
  feature_id: string4(),
18292
- enabled: z62._default(boolean2(), false)
18485
+ enabled: z62._default(boolean2(), false),
18486
+ source: optional3(UpdateCustomerOverageAllowedSource$inboundSchema)
18293
18487
  }),
18294
18488
  z62.transform((v) => {
18295
18489
  return remap(v, {
@@ -18582,18 +18776,34 @@ var UpdateEntityLimitTypeResponse = {
18582
18776
  Absolute: "absolute",
18583
18777
  UsagePercentage: "usage_percentage"
18584
18778
  };
18779
+ var UpdateEntitySpendLimitSource = {
18780
+ Customer: "customer",
18781
+ Plan: "plan"
18782
+ };
18585
18783
  var UpdateEntityIntervalResponse = {
18586
18784
  Day: "day",
18587
18785
  Week: "week",
18588
18786
  Month: "month",
18589
18787
  Year: "year"
18590
18788
  };
18789
+ var UpdateEntityUsageLimitSource = {
18790
+ Customer: "customer",
18791
+ Plan: "plan"
18792
+ };
18591
18793
  var UpdateEntityThresholdTypeResponse = {
18592
18794
  Usage: "usage",
18593
18795
  UsagePercentage: "usage_percentage",
18594
18796
  Remaining: "remaining",
18595
18797
  RemainingPercentage: "remaining_percentage"
18596
18798
  };
18799
+ var UpdateEntityUsageAlertSource = {
18800
+ Customer: "customer",
18801
+ Plan: "plan"
18802
+ };
18803
+ var UpdateEntityOverageAllowedSource = {
18804
+ Customer: "customer",
18805
+ Plan: "plan"
18806
+ };
18597
18807
  var UpdateEntityProcessorType = {
18598
18808
  Stripe: "stripe",
18599
18809
  Revenuecat: "revenuecat"
@@ -18843,13 +19053,15 @@ var UpdateEntityFlags$inboundSchema = z63.pipe(
18843
19053
  })
18844
19054
  );
18845
19055
  var UpdateEntityLimitTypeResponse$inboundSchema = inboundSchema(UpdateEntityLimitTypeResponse);
19056
+ var UpdateEntitySpendLimitSource$inboundSchema = inboundSchema(UpdateEntitySpendLimitSource);
18846
19057
  var UpdateEntitySpendLimitResponse$inboundSchema = z63.pipe(
18847
19058
  z63.object({
18848
19059
  feature_id: optional3(string4()),
18849
19060
  enabled: z63._default(boolean2(), false),
18850
19061
  limit_type: optional3(UpdateEntityLimitTypeResponse$inboundSchema),
18851
19062
  overage_limit: optional3(number2()),
18852
- skip_overage_billing: optional3(boolean2())
19063
+ skip_overage_billing: optional3(boolean2()),
19064
+ source: optional3(UpdateEntitySpendLimitSource$inboundSchema)
18853
19065
  }),
18854
19066
  z63.transform((v) => {
18855
19067
  return remap(v, {
@@ -18864,6 +19076,7 @@ var UpdateEntityIntervalResponse$inboundSchema = inboundSchema(UpdateEntityInter
18864
19076
  var UpdateEntityFilterResponse$inboundSchema = z63.object({
18865
19077
  properties: z63.record(z63.string(), z63.any())
18866
19078
  });
19079
+ var UpdateEntityUsageLimitSource$inboundSchema = inboundSchema(UpdateEntityUsageLimitSource);
18867
19080
  var UpdateEntityUsageLimitResponse$inboundSchema = z63.pipe(
18868
19081
  z63.object({
18869
19082
  feature_id: string4(),
@@ -18873,7 +19086,8 @@ var UpdateEntityUsageLimitResponse$inboundSchema = z63.pipe(
18873
19086
  filter: optional3(
18874
19087
  z63.lazy(() => UpdateEntityFilterResponse$inboundSchema)
18875
19088
  ),
18876
- usage: optional3(number2())
19089
+ usage: optional3(number2()),
19090
+ source: optional3(UpdateEntityUsageLimitSource$inboundSchema)
18877
19091
  }),
18878
19092
  z63.transform((v) => {
18879
19093
  return remap(v, {
@@ -18882,13 +19096,15 @@ var UpdateEntityUsageLimitResponse$inboundSchema = z63.pipe(
18882
19096
  })
18883
19097
  );
18884
19098
  var UpdateEntityThresholdTypeResponse$inboundSchema = inboundSchema(UpdateEntityThresholdTypeResponse);
19099
+ var UpdateEntityUsageAlertSource$inboundSchema = inboundSchema(UpdateEntityUsageAlertSource);
18885
19100
  var UpdateEntityUsageAlertResponse$inboundSchema = z63.pipe(
18886
19101
  z63.object({
18887
19102
  feature_id: optional3(string4()),
18888
19103
  enabled: z63._default(boolean2(), true),
18889
19104
  threshold: number2(),
18890
19105
  threshold_type: UpdateEntityThresholdTypeResponse$inboundSchema,
18891
- name: optional3(string4())
19106
+ name: optional3(string4()),
19107
+ source: optional3(UpdateEntityUsageAlertSource$inboundSchema)
18892
19108
  }),
18893
19109
  z63.transform((v) => {
18894
19110
  return remap(v, {
@@ -18897,10 +19113,12 @@ var UpdateEntityUsageAlertResponse$inboundSchema = z63.pipe(
18897
19113
  });
18898
19114
  })
18899
19115
  );
19116
+ var UpdateEntityOverageAllowedSource$inboundSchema = inboundSchema(UpdateEntityOverageAllowedSource);
18900
19117
  var UpdateEntityOverageAllowedResponse$inboundSchema = z63.pipe(
18901
19118
  z63.object({
18902
19119
  feature_id: string4(),
18903
- enabled: z63._default(boolean2(), false)
19120
+ enabled: z63._default(boolean2(), false),
19121
+ source: optional3(UpdateEntityOverageAllowedSource$inboundSchema)
18904
19122
  }),
18905
19123
  z63.transform((v) => {
18906
19124
  return remap(v, {
@@ -23245,7 +23463,7 @@ var Billing = class extends ClientSDK {
23245
23463
  * @example
23246
23464
  * ```typescript
23247
23465
  * // Schedule a transition from a trial plan to a paid plan
23248
- * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1783590814052,"plans":[{"planId":"trial_plan"}]},{"startsAt":1784800414052,"plans":[{"planId":"pro_plan"}]}] });
23466
+ * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1783701939170,"plans":[{"planId":"trial_plan"}]},{"startsAt":1784911539170,"plans":[{"planId":"pro_plan"}]}] });
23249
23467
  * ```
23250
23468
  *
23251
23469
  * @param customerId - The ID of the customer to create the schedule for.