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
@@ -5300,18 +5300,34 @@ var CreateEntityLimitTypeResponse = {
5300
5300
  Absolute: "absolute",
5301
5301
  UsagePercentage: "usage_percentage"
5302
5302
  };
5303
+ var CreateEntitySpendLimitSource = {
5304
+ Customer: "customer",
5305
+ Plan: "plan"
5306
+ };
5303
5307
  var CreateEntityIntervalResponse = {
5304
5308
  Day: "day",
5305
5309
  Week: "week",
5306
5310
  Month: "month",
5307
5311
  Year: "year"
5308
5312
  };
5313
+ var CreateEntityUsageLimitSource = {
5314
+ Customer: "customer",
5315
+ Plan: "plan"
5316
+ };
5309
5317
  var CreateEntityThresholdTypeResponse = {
5310
5318
  Usage: "usage",
5311
5319
  UsagePercentage: "usage_percentage",
5312
5320
  Remaining: "remaining",
5313
5321
  RemainingPercentage: "remaining_percentage"
5314
5322
  };
5323
+ var CreateEntityUsageAlertSource = {
5324
+ Customer: "customer",
5325
+ Plan: "plan"
5326
+ };
5327
+ var CreateEntityOverageAllowedSource = {
5328
+ Customer: "customer",
5329
+ Plan: "plan"
5330
+ };
5315
5331
  var CreateEntityProcessorType = {
5316
5332
  Stripe: "stripe",
5317
5333
  Revenuecat: "revenuecat"
@@ -5566,13 +5582,15 @@ var CreateEntityFlags$inboundSchema = z18.pipe(
5566
5582
  })
5567
5583
  );
5568
5584
  var CreateEntityLimitTypeResponse$inboundSchema = inboundSchema(CreateEntityLimitTypeResponse);
5585
+ var CreateEntitySpendLimitSource$inboundSchema = inboundSchema(CreateEntitySpendLimitSource);
5569
5586
  var CreateEntitySpendLimitResponse$inboundSchema = z18.pipe(
5570
5587
  z18.object({
5571
5588
  feature_id: optional3(string4()),
5572
5589
  enabled: z18._default(boolean2(), false),
5573
5590
  limit_type: optional3(CreateEntityLimitTypeResponse$inboundSchema),
5574
5591
  overage_limit: optional3(number2()),
5575
- skip_overage_billing: optional3(boolean2())
5592
+ skip_overage_billing: optional3(boolean2()),
5593
+ source: optional3(CreateEntitySpendLimitSource$inboundSchema)
5576
5594
  }),
5577
5595
  z18.transform((v) => {
5578
5596
  return remap(v, {
@@ -5587,6 +5605,7 @@ var CreateEntityIntervalResponse$inboundSchema = inboundSchema(CreateEntityInter
5587
5605
  var CreateEntityFilterResponse$inboundSchema = z18.object({
5588
5606
  properties: z18.record(z18.string(), z18.any())
5589
5607
  });
5608
+ var CreateEntityUsageLimitSource$inboundSchema = inboundSchema(CreateEntityUsageLimitSource);
5590
5609
  var CreateEntityUsageLimitResponse$inboundSchema = z18.pipe(
5591
5610
  z18.object({
5592
5611
  feature_id: string4(),
@@ -5596,7 +5615,8 @@ var CreateEntityUsageLimitResponse$inboundSchema = z18.pipe(
5596
5615
  filter: optional3(
5597
5616
  z18.lazy(() => CreateEntityFilterResponse$inboundSchema)
5598
5617
  ),
5599
- usage: optional3(number2())
5618
+ usage: optional3(number2()),
5619
+ source: optional3(CreateEntityUsageLimitSource$inboundSchema)
5600
5620
  }),
5601
5621
  z18.transform((v) => {
5602
5622
  return remap(v, {
@@ -5605,13 +5625,15 @@ var CreateEntityUsageLimitResponse$inboundSchema = z18.pipe(
5605
5625
  })
5606
5626
  );
5607
5627
  var CreateEntityThresholdTypeResponse$inboundSchema = inboundSchema(CreateEntityThresholdTypeResponse);
5628
+ var CreateEntityUsageAlertSource$inboundSchema = inboundSchema(CreateEntityUsageAlertSource);
5608
5629
  var CreateEntityUsageAlertResponse$inboundSchema = z18.pipe(
5609
5630
  z18.object({
5610
5631
  feature_id: optional3(string4()),
5611
5632
  enabled: z18._default(boolean2(), true),
5612
5633
  threshold: number2(),
5613
5634
  threshold_type: CreateEntityThresholdTypeResponse$inboundSchema,
5614
- name: optional3(string4())
5635
+ name: optional3(string4()),
5636
+ source: optional3(CreateEntityUsageAlertSource$inboundSchema)
5615
5637
  }),
5616
5638
  z18.transform((v) => {
5617
5639
  return remap(v, {
@@ -5620,10 +5642,12 @@ var CreateEntityUsageAlertResponse$inboundSchema = z18.pipe(
5620
5642
  });
5621
5643
  })
5622
5644
  );
5645
+ var CreateEntityOverageAllowedSource$inboundSchema = inboundSchema(CreateEntityOverageAllowedSource);
5623
5646
  var CreateEntityOverageAllowedResponse$inboundSchema = z18.pipe(
5624
5647
  z18.object({
5625
5648
  feature_id: string4(),
5626
- enabled: z18._default(boolean2(), false)
5649
+ enabled: z18._default(boolean2(), false),
5650
+ source: optional3(CreateEntityOverageAllowedSource$inboundSchema)
5627
5651
  }),
5628
5652
  z18.transform((v) => {
5629
5653
  return remap(v, {
@@ -7995,22 +8019,42 @@ var CustomerPurchaseLimitInterval1 = {
7995
8019
  Week: "week",
7996
8020
  Month: "month"
7997
8021
  };
8022
+ var AutoTopupSource = {
8023
+ Customer: "customer",
8024
+ Plan: "plan"
8025
+ };
7998
8026
  var CustomerLimitType = {
7999
8027
  Absolute: "absolute",
8000
8028
  UsagePercentage: "usage_percentage"
8001
8029
  };
8030
+ var SpendLimitSource = {
8031
+ Customer: "customer",
8032
+ Plan: "plan"
8033
+ };
8002
8034
  var CustomerUsageLimitInterval = {
8003
8035
  Day: "day",
8004
8036
  Week: "week",
8005
8037
  Month: "month",
8006
8038
  Year: "year"
8007
8039
  };
8040
+ var UsageLimitSource = {
8041
+ Customer: "customer",
8042
+ Plan: "plan"
8043
+ };
8008
8044
  var CustomerThresholdType = {
8009
8045
  Usage: "usage",
8010
8046
  UsagePercentage: "usage_percentage",
8011
8047
  Remaining: "remaining",
8012
8048
  RemainingPercentage: "remaining_percentage"
8013
8049
  };
8050
+ var UsageAlertSource = {
8051
+ Customer: "customer",
8052
+ Plan: "plan"
8053
+ };
8054
+ var OverageAllowedSource = {
8055
+ Customer: "customer",
8056
+ Plan: "plan"
8057
+ };
8014
8058
  var CustomerStatus = {
8015
8059
  Active: "active",
8016
8060
  Scheduled: "scheduled"
@@ -8053,36 +8097,37 @@ var CustomerEnv$inboundSchema = inboundSchema(CustomerEnv);
8053
8097
  var CustomerPurchaseLimitInterval2$inboundSchema = inboundSchema(CustomerPurchaseLimitInterval2);
8054
8098
  var CustomerPurchaseLimit2$inboundSchema = z24.pipe(
8055
8099
  z24.object({
8056
- interval: nullable(CustomerPurchaseLimitInterval2$inboundSchema),
8057
- interval_count: nullable(number2()),
8058
- limit: nullable(number2()),
8059
- count: number2(),
8060
- next_reset_at: number2()
8100
+ interval: CustomerPurchaseLimitInterval2$inboundSchema,
8101
+ interval_count: z24._default(number2(), 1),
8102
+ limit: number2()
8061
8103
  }),
8062
8104
  z24.transform((v) => {
8063
8105
  return remap(v, {
8064
- "interval_count": "intervalCount",
8065
- "next_reset_at": "nextResetAt"
8106
+ "interval_count": "intervalCount"
8066
8107
  });
8067
8108
  })
8068
8109
  );
8069
8110
  var CustomerPurchaseLimitInterval1$inboundSchema = inboundSchema(CustomerPurchaseLimitInterval1);
8070
8111
  var CustomerPurchaseLimit1$inboundSchema = z24.pipe(
8071
8112
  z24.object({
8072
- interval: CustomerPurchaseLimitInterval1$inboundSchema,
8073
- interval_count: z24._default(number2(), 1),
8074
- limit: number2()
8113
+ interval: nullable(CustomerPurchaseLimitInterval1$inboundSchema),
8114
+ interval_count: nullable(number2()),
8115
+ limit: nullable(number2()),
8116
+ count: number2(),
8117
+ next_reset_at: number2()
8075
8118
  }),
8076
8119
  z24.transform((v) => {
8077
8120
  return remap(v, {
8078
- "interval_count": "intervalCount"
8121
+ "interval_count": "intervalCount",
8122
+ "next_reset_at": "nextResetAt"
8079
8123
  });
8080
8124
  })
8081
8125
  );
8082
8126
  var CustomerPurchaseLimitUnion$inboundSchema = smartUnion([
8083
- z24.lazy(() => CustomerPurchaseLimit2$inboundSchema),
8084
- z24.lazy(() => CustomerPurchaseLimit1$inboundSchema)
8127
+ z24.lazy(() => CustomerPurchaseLimit1$inboundSchema),
8128
+ z24.lazy(() => CustomerPurchaseLimit2$inboundSchema)
8085
8129
  ]);
8130
+ var AutoTopupSource$inboundSchema = inboundSchema(AutoTopupSource);
8086
8131
  var CustomerAutoTopup$inboundSchema = z24.pipe(
8087
8132
  z24.object({
8088
8133
  feature_id: string4(),
@@ -8090,10 +8135,11 @@ var CustomerAutoTopup$inboundSchema = z24.pipe(
8090
8135
  threshold: number2(),
8091
8136
  quantity: number2(),
8092
8137
  purchase_limit: optional3(smartUnion([
8093
- z24.lazy(() => CustomerPurchaseLimit2$inboundSchema),
8094
- z24.lazy(() => CustomerPurchaseLimit1$inboundSchema)
8138
+ z24.lazy(() => CustomerPurchaseLimit1$inboundSchema),
8139
+ z24.lazy(() => CustomerPurchaseLimit2$inboundSchema)
8095
8140
  ])),
8096
- invoice_mode: optional3(boolean2())
8141
+ invoice_mode: optional3(boolean2()),
8142
+ source: optional3(AutoTopupSource$inboundSchema)
8097
8143
  }),
8098
8144
  z24.transform((v) => {
8099
8145
  return remap(v, {
@@ -8104,13 +8150,15 @@ var CustomerAutoTopup$inboundSchema = z24.pipe(
8104
8150
  })
8105
8151
  );
8106
8152
  var CustomerLimitType$inboundSchema = inboundSchema(CustomerLimitType);
8153
+ var SpendLimitSource$inboundSchema = inboundSchema(SpendLimitSource);
8107
8154
  var CustomerSpendLimit$inboundSchema = z24.pipe(
8108
8155
  z24.object({
8109
8156
  feature_id: optional3(string4()),
8110
8157
  enabled: z24._default(boolean2(), false),
8111
8158
  limit_type: optional3(CustomerLimitType$inboundSchema),
8112
8159
  overage_limit: optional3(number2()),
8113
- skip_overage_billing: optional3(boolean2())
8160
+ skip_overage_billing: optional3(boolean2()),
8161
+ source: optional3(SpendLimitSource$inboundSchema)
8114
8162
  }),
8115
8163
  z24.transform((v) => {
8116
8164
  return remap(v, {
@@ -8125,6 +8173,7 @@ var CustomerUsageLimitInterval$inboundSchema = inboundSchema(CustomerUsageLimitI
8125
8173
  var CustomerFilter$inboundSchema = z24.object({
8126
8174
  properties: z24.record(z24.string(), z24.any())
8127
8175
  });
8176
+ var UsageLimitSource$inboundSchema = inboundSchema(UsageLimitSource);
8128
8177
  var CustomerUsageLimit$inboundSchema = z24.pipe(
8129
8178
  z24.object({
8130
8179
  feature_id: string4(),
@@ -8132,7 +8181,8 @@ var CustomerUsageLimit$inboundSchema = z24.pipe(
8132
8181
  limit: number2(),
8133
8182
  interval: CustomerUsageLimitInterval$inboundSchema,
8134
8183
  filter: optional3(z24.lazy(() => CustomerFilter$inboundSchema)),
8135
- usage: optional3(number2())
8184
+ usage: optional3(number2()),
8185
+ source: optional3(UsageLimitSource$inboundSchema)
8136
8186
  }),
8137
8187
  z24.transform((v) => {
8138
8188
  return remap(v, {
@@ -8141,13 +8191,15 @@ var CustomerUsageLimit$inboundSchema = z24.pipe(
8141
8191
  })
8142
8192
  );
8143
8193
  var CustomerThresholdType$inboundSchema = inboundSchema(CustomerThresholdType);
8194
+ var UsageAlertSource$inboundSchema = inboundSchema(UsageAlertSource);
8144
8195
  var CustomerUsageAlert$inboundSchema = z24.pipe(
8145
8196
  z24.object({
8146
8197
  feature_id: optional3(string4()),
8147
8198
  enabled: z24._default(boolean2(), true),
8148
8199
  threshold: number2(),
8149
8200
  threshold_type: CustomerThresholdType$inboundSchema,
8150
- name: optional3(string4())
8201
+ name: optional3(string4()),
8202
+ source: optional3(UsageAlertSource$inboundSchema)
8151
8203
  }),
8152
8204
  z24.transform((v) => {
8153
8205
  return remap(v, {
@@ -8156,10 +8208,12 @@ var CustomerUsageAlert$inboundSchema = z24.pipe(
8156
8208
  });
8157
8209
  })
8158
8210
  );
8211
+ var OverageAllowedSource$inboundSchema = inboundSchema(OverageAllowedSource);
8159
8212
  var CustomerOverageAllowed$inboundSchema = z24.pipe(
8160
8213
  z24.object({
8161
8214
  feature_id: string4(),
8162
- enabled: z24._default(boolean2(), false)
8215
+ enabled: z24._default(boolean2(), false),
8216
+ source: optional3(OverageAllowedSource$inboundSchema)
8163
8217
  }),
8164
8218
  z24.transform((v) => {
8165
8219
  return remap(v, {
@@ -8664,22 +8718,42 @@ var GetCustomerPurchaseLimitInterval1 = {
8664
8718
  Week: "week",
8665
8719
  Month: "month"
8666
8720
  };
8721
+ var GetCustomerAutoTopupSource = {
8722
+ Customer: "customer",
8723
+ Plan: "plan"
8724
+ };
8667
8725
  var GetCustomerLimitType = {
8668
8726
  Absolute: "absolute",
8669
8727
  UsagePercentage: "usage_percentage"
8670
8728
  };
8729
+ var GetCustomerSpendLimitSource = {
8730
+ Customer: "customer",
8731
+ Plan: "plan"
8732
+ };
8671
8733
  var GetCustomerUsageLimitInterval = {
8672
8734
  Day: "day",
8673
8735
  Week: "week",
8674
8736
  Month: "month",
8675
8737
  Year: "year"
8676
8738
  };
8739
+ var GetCustomerUsageLimitSource = {
8740
+ Customer: "customer",
8741
+ Plan: "plan"
8742
+ };
8677
8743
  var GetCustomerThresholdType = {
8678
8744
  Usage: "usage",
8679
8745
  UsagePercentage: "usage_percentage",
8680
8746
  Remaining: "remaining",
8681
8747
  RemainingPercentage: "remaining_percentage"
8682
8748
  };
8749
+ var GetCustomerUsageAlertSource = {
8750
+ Customer: "customer",
8751
+ Plan: "plan"
8752
+ };
8753
+ var GetCustomerOverageAllowedSource = {
8754
+ Customer: "customer",
8755
+ Plan: "plan"
8756
+ };
8683
8757
  var GetCustomerStatus = {
8684
8758
  Active: "active",
8685
8759
  Scheduled: "scheduled"
@@ -8733,36 +8807,37 @@ var GetCustomerEnv$inboundSchema = inboundSchema(GetCustomerEnv);
8733
8807
  var GetCustomerPurchaseLimitInterval2$inboundSchema = inboundSchema(GetCustomerPurchaseLimitInterval2);
8734
8808
  var GetCustomerPurchaseLimit2$inboundSchema = z31.pipe(
8735
8809
  z31.object({
8736
- interval: nullable(GetCustomerPurchaseLimitInterval2$inboundSchema),
8737
- interval_count: nullable(number2()),
8738
- limit: nullable(number2()),
8739
- count: number2(),
8740
- next_reset_at: number2()
8810
+ interval: GetCustomerPurchaseLimitInterval2$inboundSchema,
8811
+ interval_count: z31._default(number2(), 1),
8812
+ limit: number2()
8741
8813
  }),
8742
8814
  z31.transform((v) => {
8743
8815
  return remap(v, {
8744
- "interval_count": "intervalCount",
8745
- "next_reset_at": "nextResetAt"
8816
+ "interval_count": "intervalCount"
8746
8817
  });
8747
8818
  })
8748
8819
  );
8749
8820
  var GetCustomerPurchaseLimitInterval1$inboundSchema = inboundSchema(GetCustomerPurchaseLimitInterval1);
8750
8821
  var GetCustomerPurchaseLimit1$inboundSchema = z31.pipe(
8751
8822
  z31.object({
8752
- interval: GetCustomerPurchaseLimitInterval1$inboundSchema,
8753
- interval_count: z31._default(number2(), 1),
8754
- limit: number2()
8823
+ interval: nullable(GetCustomerPurchaseLimitInterval1$inboundSchema),
8824
+ interval_count: nullable(number2()),
8825
+ limit: nullable(number2()),
8826
+ count: number2(),
8827
+ next_reset_at: number2()
8755
8828
  }),
8756
8829
  z31.transform((v) => {
8757
8830
  return remap(v, {
8758
- "interval_count": "intervalCount"
8831
+ "interval_count": "intervalCount",
8832
+ "next_reset_at": "nextResetAt"
8759
8833
  });
8760
8834
  })
8761
8835
  );
8762
8836
  var GetCustomerPurchaseLimitUnion$inboundSchema = smartUnion([
8763
- z31.lazy(() => GetCustomerPurchaseLimit2$inboundSchema),
8764
- z31.lazy(() => GetCustomerPurchaseLimit1$inboundSchema)
8837
+ z31.lazy(() => GetCustomerPurchaseLimit1$inboundSchema),
8838
+ z31.lazy(() => GetCustomerPurchaseLimit2$inboundSchema)
8765
8839
  ]);
8840
+ var GetCustomerAutoTopupSource$inboundSchema = inboundSchema(GetCustomerAutoTopupSource);
8766
8841
  var GetCustomerAutoTopup$inboundSchema = z31.pipe(
8767
8842
  z31.object({
8768
8843
  feature_id: string4(),
@@ -8770,10 +8845,11 @@ var GetCustomerAutoTopup$inboundSchema = z31.pipe(
8770
8845
  threshold: number2(),
8771
8846
  quantity: number2(),
8772
8847
  purchase_limit: optional3(smartUnion([
8773
- z31.lazy(() => GetCustomerPurchaseLimit2$inboundSchema),
8774
- z31.lazy(() => GetCustomerPurchaseLimit1$inboundSchema)
8848
+ z31.lazy(() => GetCustomerPurchaseLimit1$inboundSchema),
8849
+ z31.lazy(() => GetCustomerPurchaseLimit2$inboundSchema)
8775
8850
  ])),
8776
- invoice_mode: optional3(boolean2())
8851
+ invoice_mode: optional3(boolean2()),
8852
+ source: optional3(GetCustomerAutoTopupSource$inboundSchema)
8777
8853
  }),
8778
8854
  z31.transform((v) => {
8779
8855
  return remap(v, {
@@ -8784,13 +8860,15 @@ var GetCustomerAutoTopup$inboundSchema = z31.pipe(
8784
8860
  })
8785
8861
  );
8786
8862
  var GetCustomerLimitType$inboundSchema = inboundSchema(GetCustomerLimitType);
8863
+ var GetCustomerSpendLimitSource$inboundSchema = inboundSchema(GetCustomerSpendLimitSource);
8787
8864
  var GetCustomerSpendLimit$inboundSchema = z31.pipe(
8788
8865
  z31.object({
8789
8866
  feature_id: optional3(string4()),
8790
8867
  enabled: z31._default(boolean2(), false),
8791
8868
  limit_type: optional3(GetCustomerLimitType$inboundSchema),
8792
8869
  overage_limit: optional3(number2()),
8793
- skip_overage_billing: optional3(boolean2())
8870
+ skip_overage_billing: optional3(boolean2()),
8871
+ source: optional3(GetCustomerSpendLimitSource$inboundSchema)
8794
8872
  }),
8795
8873
  z31.transform((v) => {
8796
8874
  return remap(v, {
@@ -8805,6 +8883,7 @@ var GetCustomerUsageLimitInterval$inboundSchema = inboundSchema(GetCustomerUsage
8805
8883
  var GetCustomerFilter$inboundSchema = z31.object({
8806
8884
  properties: z31.record(z31.string(), z31.any())
8807
8885
  });
8886
+ var GetCustomerUsageLimitSource$inboundSchema = inboundSchema(GetCustomerUsageLimitSource);
8808
8887
  var GetCustomerUsageLimit$inboundSchema = z31.pipe(
8809
8888
  z31.object({
8810
8889
  feature_id: string4(),
@@ -8812,7 +8891,8 @@ var GetCustomerUsageLimit$inboundSchema = z31.pipe(
8812
8891
  limit: number2(),
8813
8892
  interval: GetCustomerUsageLimitInterval$inboundSchema,
8814
8893
  filter: optional3(z31.lazy(() => GetCustomerFilter$inboundSchema)),
8815
- usage: optional3(number2())
8894
+ usage: optional3(number2()),
8895
+ source: optional3(GetCustomerUsageLimitSource$inboundSchema)
8816
8896
  }),
8817
8897
  z31.transform((v) => {
8818
8898
  return remap(v, {
@@ -8821,13 +8901,15 @@ var GetCustomerUsageLimit$inboundSchema = z31.pipe(
8821
8901
  })
8822
8902
  );
8823
8903
  var GetCustomerThresholdType$inboundSchema = inboundSchema(GetCustomerThresholdType);
8904
+ var GetCustomerUsageAlertSource$inboundSchema = inboundSchema(GetCustomerUsageAlertSource);
8824
8905
  var GetCustomerUsageAlert$inboundSchema = z31.pipe(
8825
8906
  z31.object({
8826
8907
  feature_id: optional3(string4()),
8827
8908
  enabled: z31._default(boolean2(), true),
8828
8909
  threshold: number2(),
8829
8910
  threshold_type: GetCustomerThresholdType$inboundSchema,
8830
- name: optional3(string4())
8911
+ name: optional3(string4()),
8912
+ source: optional3(GetCustomerUsageAlertSource$inboundSchema)
8831
8913
  }),
8832
8914
  z31.transform((v) => {
8833
8915
  return remap(v, {
@@ -8836,10 +8918,12 @@ var GetCustomerUsageAlert$inboundSchema = z31.pipe(
8836
8918
  });
8837
8919
  })
8838
8920
  );
8921
+ var GetCustomerOverageAllowedSource$inboundSchema = inboundSchema(GetCustomerOverageAllowedSource);
8839
8922
  var GetCustomerOverageAllowed$inboundSchema = z31.pipe(
8840
8923
  z31.object({
8841
8924
  feature_id: string4(),
8842
- enabled: z31._default(boolean2(), false)
8925
+ enabled: z31._default(boolean2(), false),
8926
+ source: optional3(GetCustomerOverageAllowedSource$inboundSchema)
8843
8927
  }),
8844
8928
  z31.transform((v) => {
8845
8929
  return remap(v, {
@@ -9228,18 +9312,34 @@ var GetEntityLimitType = {
9228
9312
  Absolute: "absolute",
9229
9313
  UsagePercentage: "usage_percentage"
9230
9314
  };
9315
+ var GetEntitySpendLimitSource = {
9316
+ Customer: "customer",
9317
+ Plan: "plan"
9318
+ };
9231
9319
  var GetEntityInterval = {
9232
9320
  Day: "day",
9233
9321
  Week: "week",
9234
9322
  Month: "month",
9235
9323
  Year: "year"
9236
9324
  };
9325
+ var GetEntityUsageLimitSource = {
9326
+ Customer: "customer",
9327
+ Plan: "plan"
9328
+ };
9237
9329
  var GetEntityThresholdType = {
9238
9330
  Usage: "usage",
9239
9331
  UsagePercentage: "usage_percentage",
9240
9332
  Remaining: "remaining",
9241
9333
  RemainingPercentage: "remaining_percentage"
9242
9334
  };
9335
+ var GetEntityUsageAlertSource = {
9336
+ Customer: "customer",
9337
+ Plan: "plan"
9338
+ };
9339
+ var GetEntityOverageAllowedSource = {
9340
+ Customer: "customer",
9341
+ Plan: "plan"
9342
+ };
9243
9343
  var GetEntityProcessorType = {
9244
9344
  Stripe: "stripe",
9245
9345
  Revenuecat: "revenuecat"
@@ -9394,13 +9494,15 @@ var GetEntityFlags$inboundSchema = z32.pipe(
9394
9494
  })
9395
9495
  );
9396
9496
  var GetEntityLimitType$inboundSchema = inboundSchema(GetEntityLimitType);
9497
+ var GetEntitySpendLimitSource$inboundSchema = inboundSchema(GetEntitySpendLimitSource);
9397
9498
  var GetEntitySpendLimit$inboundSchema = z32.pipe(
9398
9499
  z32.object({
9399
9500
  feature_id: optional3(string4()),
9400
9501
  enabled: z32._default(boolean2(), false),
9401
9502
  limit_type: optional3(GetEntityLimitType$inboundSchema),
9402
9503
  overage_limit: optional3(number2()),
9403
- skip_overage_billing: optional3(boolean2())
9504
+ skip_overage_billing: optional3(boolean2()),
9505
+ source: optional3(GetEntitySpendLimitSource$inboundSchema)
9404
9506
  }),
9405
9507
  z32.transform((v) => {
9406
9508
  return remap(v, {
@@ -9415,6 +9517,7 @@ var GetEntityInterval$inboundSchema = inboundSchema(GetEntityInterval);
9415
9517
  var GetEntityFilter$inboundSchema = z32.object({
9416
9518
  properties: z32.record(z32.string(), z32.any())
9417
9519
  });
9520
+ var GetEntityUsageLimitSource$inboundSchema = inboundSchema(GetEntityUsageLimitSource);
9418
9521
  var GetEntityUsageLimit$inboundSchema = z32.pipe(
9419
9522
  z32.object({
9420
9523
  feature_id: string4(),
@@ -9422,7 +9525,8 @@ var GetEntityUsageLimit$inboundSchema = z32.pipe(
9422
9525
  limit: number2(),
9423
9526
  interval: GetEntityInterval$inboundSchema,
9424
9527
  filter: optional3(z32.lazy(() => GetEntityFilter$inboundSchema)),
9425
- usage: optional3(number2())
9528
+ usage: optional3(number2()),
9529
+ source: optional3(GetEntityUsageLimitSource$inboundSchema)
9426
9530
  }),
9427
9531
  z32.transform((v) => {
9428
9532
  return remap(v, {
@@ -9431,13 +9535,15 @@ var GetEntityUsageLimit$inboundSchema = z32.pipe(
9431
9535
  })
9432
9536
  );
9433
9537
  var GetEntityThresholdType$inboundSchema = inboundSchema(GetEntityThresholdType);
9538
+ var GetEntityUsageAlertSource$inboundSchema = inboundSchema(GetEntityUsageAlertSource);
9434
9539
  var GetEntityUsageAlert$inboundSchema = z32.pipe(
9435
9540
  z32.object({
9436
9541
  feature_id: optional3(string4()),
9437
9542
  enabled: z32._default(boolean2(), true),
9438
9543
  threshold: number2(),
9439
9544
  threshold_type: GetEntityThresholdType$inboundSchema,
9440
- name: optional3(string4())
9545
+ name: optional3(string4()),
9546
+ source: optional3(GetEntityUsageAlertSource$inboundSchema)
9441
9547
  }),
9442
9548
  z32.transform((v) => {
9443
9549
  return remap(v, {
@@ -9446,10 +9552,12 @@ var GetEntityUsageAlert$inboundSchema = z32.pipe(
9446
9552
  });
9447
9553
  })
9448
9554
  );
9555
+ var GetEntityOverageAllowedSource$inboundSchema = inboundSchema(GetEntityOverageAllowedSource);
9449
9556
  var GetEntityOverageAllowed$inboundSchema = z32.pipe(
9450
9557
  z32.object({
9451
9558
  feature_id: string4(),
9452
- enabled: z32._default(boolean2(), false)
9559
+ enabled: z32._default(boolean2(), false),
9560
+ source: optional3(GetEntityOverageAllowedSource$inboundSchema)
9453
9561
  }),
9454
9562
  z32.transform((v) => {
9455
9563
  return remap(v, {
@@ -11056,22 +11164,42 @@ var ListCustomersPurchaseLimitInterval1 = {
11056
11164
  Week: "week",
11057
11165
  Month: "month"
11058
11166
  };
11167
+ var ListCustomersAutoTopupSource = {
11168
+ Customer: "customer",
11169
+ Plan: "plan"
11170
+ };
11059
11171
  var ListCustomersLimitType = {
11060
11172
  Absolute: "absolute",
11061
11173
  UsagePercentage: "usage_percentage"
11062
11174
  };
11175
+ var ListCustomersSpendLimitSource = {
11176
+ Customer: "customer",
11177
+ Plan: "plan"
11178
+ };
11063
11179
  var ListCustomersUsageLimitInterval = {
11064
11180
  Day: "day",
11065
11181
  Week: "week",
11066
11182
  Month: "month",
11067
11183
  Year: "year"
11068
11184
  };
11185
+ var ListCustomersUsageLimitSource = {
11186
+ Customer: "customer",
11187
+ Plan: "plan"
11188
+ };
11069
11189
  var ListCustomersThresholdType = {
11070
11190
  Usage: "usage",
11071
11191
  UsagePercentage: "usage_percentage",
11072
11192
  Remaining: "remaining",
11073
11193
  RemainingPercentage: "remaining_percentage"
11074
11194
  };
11195
+ var ListCustomersUsageAlertSource = {
11196
+ Customer: "customer",
11197
+ Plan: "plan"
11198
+ };
11199
+ var ListCustomersOverageAllowedSource = {
11200
+ Customer: "customer",
11201
+ Plan: "plan"
11202
+ };
11075
11203
  var ListCustomersStatus = {
11076
11204
  Active: "active",
11077
11205
  Scheduled: "scheduled"
@@ -11118,36 +11246,37 @@ var ListCustomersEnv$inboundSchema = inboundSchema(ListCustomersEnv);
11118
11246
  var ListCustomersPurchaseLimitInterval2$inboundSchema = inboundSchema(ListCustomersPurchaseLimitInterval2);
11119
11247
  var ListCustomersPurchaseLimit2$inboundSchema = z39.pipe(
11120
11248
  z39.object({
11121
- interval: nullable(ListCustomersPurchaseLimitInterval2$inboundSchema),
11122
- interval_count: nullable(number2()),
11123
- limit: nullable(number2()),
11124
- count: number2(),
11125
- next_reset_at: number2()
11249
+ interval: ListCustomersPurchaseLimitInterval2$inboundSchema,
11250
+ interval_count: z39._default(number2(), 1),
11251
+ limit: number2()
11126
11252
  }),
11127
11253
  z39.transform((v) => {
11128
11254
  return remap(v, {
11129
- "interval_count": "intervalCount",
11130
- "next_reset_at": "nextResetAt"
11255
+ "interval_count": "intervalCount"
11131
11256
  });
11132
11257
  })
11133
11258
  );
11134
11259
  var ListCustomersPurchaseLimitInterval1$inboundSchema = inboundSchema(ListCustomersPurchaseLimitInterval1);
11135
11260
  var ListCustomersPurchaseLimit1$inboundSchema = z39.pipe(
11136
11261
  z39.object({
11137
- interval: ListCustomersPurchaseLimitInterval1$inboundSchema,
11138
- interval_count: z39._default(number2(), 1),
11139
- limit: number2()
11262
+ interval: nullable(ListCustomersPurchaseLimitInterval1$inboundSchema),
11263
+ interval_count: nullable(number2()),
11264
+ limit: nullable(number2()),
11265
+ count: number2(),
11266
+ next_reset_at: number2()
11140
11267
  }),
11141
11268
  z39.transform((v) => {
11142
11269
  return remap(v, {
11143
- "interval_count": "intervalCount"
11270
+ "interval_count": "intervalCount",
11271
+ "next_reset_at": "nextResetAt"
11144
11272
  });
11145
11273
  })
11146
11274
  );
11147
11275
  var ListCustomersPurchaseLimitUnion$inboundSchema = smartUnion([
11148
- z39.lazy(() => ListCustomersPurchaseLimit2$inboundSchema),
11149
- z39.lazy(() => ListCustomersPurchaseLimit1$inboundSchema)
11276
+ z39.lazy(() => ListCustomersPurchaseLimit1$inboundSchema),
11277
+ z39.lazy(() => ListCustomersPurchaseLimit2$inboundSchema)
11150
11278
  ]);
11279
+ var ListCustomersAutoTopupSource$inboundSchema = inboundSchema(ListCustomersAutoTopupSource);
11151
11280
  var ListCustomersAutoTopup$inboundSchema = z39.pipe(
11152
11281
  z39.object({
11153
11282
  feature_id: string4(),
@@ -11155,10 +11284,11 @@ var ListCustomersAutoTopup$inboundSchema = z39.pipe(
11155
11284
  threshold: number2(),
11156
11285
  quantity: number2(),
11157
11286
  purchase_limit: optional3(smartUnion([
11158
- z39.lazy(() => ListCustomersPurchaseLimit2$inboundSchema),
11159
- z39.lazy(() => ListCustomersPurchaseLimit1$inboundSchema)
11287
+ z39.lazy(() => ListCustomersPurchaseLimit1$inboundSchema),
11288
+ z39.lazy(() => ListCustomersPurchaseLimit2$inboundSchema)
11160
11289
  ])),
11161
- invoice_mode: optional3(boolean2())
11290
+ invoice_mode: optional3(boolean2()),
11291
+ source: optional3(ListCustomersAutoTopupSource$inboundSchema)
11162
11292
  }),
11163
11293
  z39.transform((v) => {
11164
11294
  return remap(v, {
@@ -11169,13 +11299,15 @@ var ListCustomersAutoTopup$inboundSchema = z39.pipe(
11169
11299
  })
11170
11300
  );
11171
11301
  var ListCustomersLimitType$inboundSchema = inboundSchema(ListCustomersLimitType);
11302
+ var ListCustomersSpendLimitSource$inboundSchema = inboundSchema(ListCustomersSpendLimitSource);
11172
11303
  var ListCustomersSpendLimit$inboundSchema = z39.pipe(
11173
11304
  z39.object({
11174
11305
  feature_id: optional3(string4()),
11175
11306
  enabled: z39._default(boolean2(), false),
11176
11307
  limit_type: optional3(ListCustomersLimitType$inboundSchema),
11177
11308
  overage_limit: optional3(number2()),
11178
- skip_overage_billing: optional3(boolean2())
11309
+ skip_overage_billing: optional3(boolean2()),
11310
+ source: optional3(ListCustomersSpendLimitSource$inboundSchema)
11179
11311
  }),
11180
11312
  z39.transform((v) => {
11181
11313
  return remap(v, {
@@ -11190,6 +11322,7 @@ var ListCustomersUsageLimitInterval$inboundSchema = inboundSchema(ListCustomersU
11190
11322
  var ListCustomersFilter$inboundSchema = z39.object({
11191
11323
  properties: z39.record(z39.string(), z39.any())
11192
11324
  });
11325
+ var ListCustomersUsageLimitSource$inboundSchema = inboundSchema(ListCustomersUsageLimitSource);
11193
11326
  var ListCustomersUsageLimit$inboundSchema = z39.pipe(
11194
11327
  z39.object({
11195
11328
  feature_id: string4(),
@@ -11197,7 +11330,8 @@ var ListCustomersUsageLimit$inboundSchema = z39.pipe(
11197
11330
  limit: number2(),
11198
11331
  interval: ListCustomersUsageLimitInterval$inboundSchema,
11199
11332
  filter: optional3(z39.lazy(() => ListCustomersFilter$inboundSchema)),
11200
- usage: optional3(number2())
11333
+ usage: optional3(number2()),
11334
+ source: optional3(ListCustomersUsageLimitSource$inboundSchema)
11201
11335
  }),
11202
11336
  z39.transform((v) => {
11203
11337
  return remap(v, {
@@ -11206,13 +11340,15 @@ var ListCustomersUsageLimit$inboundSchema = z39.pipe(
11206
11340
  })
11207
11341
  );
11208
11342
  var ListCustomersThresholdType$inboundSchema = inboundSchema(ListCustomersThresholdType);
11343
+ var ListCustomersUsageAlertSource$inboundSchema = inboundSchema(ListCustomersUsageAlertSource);
11209
11344
  var ListCustomersUsageAlert$inboundSchema = z39.pipe(
11210
11345
  z39.object({
11211
11346
  feature_id: optional3(string4()),
11212
11347
  enabled: z39._default(boolean2(), true),
11213
11348
  threshold: number2(),
11214
11349
  threshold_type: ListCustomersThresholdType$inboundSchema,
11215
- name: optional3(string4())
11350
+ name: optional3(string4()),
11351
+ source: optional3(ListCustomersUsageAlertSource$inboundSchema)
11216
11352
  }),
11217
11353
  z39.transform((v) => {
11218
11354
  return remap(v, {
@@ -11221,10 +11357,12 @@ var ListCustomersUsageAlert$inboundSchema = z39.pipe(
11221
11357
  });
11222
11358
  })
11223
11359
  );
11360
+ var ListCustomersOverageAllowedSource$inboundSchema = inboundSchema(ListCustomersOverageAllowedSource);
11224
11361
  var ListCustomersOverageAllowed$inboundSchema = z39.pipe(
11225
11362
  z39.object({
11226
11363
  feature_id: string4(),
11227
- enabled: z39._default(boolean2(), false)
11364
+ enabled: z39._default(boolean2(), false),
11365
+ source: optional3(ListCustomersOverageAllowedSource$inboundSchema)
11228
11366
  }),
11229
11367
  z39.transform((v) => {
11230
11368
  return remap(v, {
@@ -11514,18 +11652,34 @@ var ListEntitiesLimitType = {
11514
11652
  Absolute: "absolute",
11515
11653
  UsagePercentage: "usage_percentage"
11516
11654
  };
11655
+ var ListEntitiesSpendLimitSource = {
11656
+ Customer: "customer",
11657
+ Plan: "plan"
11658
+ };
11517
11659
  var ListEntitiesInterval = {
11518
11660
  Day: "day",
11519
11661
  Week: "week",
11520
11662
  Month: "month",
11521
11663
  Year: "year"
11522
11664
  };
11665
+ var ListEntitiesUsageLimitSource = {
11666
+ Customer: "customer",
11667
+ Plan: "plan"
11668
+ };
11523
11669
  var ListEntitiesThresholdType = {
11524
11670
  Usage: "usage",
11525
11671
  UsagePercentage: "usage_percentage",
11526
11672
  Remaining: "remaining",
11527
11673
  RemainingPercentage: "remaining_percentage"
11528
11674
  };
11675
+ var ListEntitiesUsageAlertSource = {
11676
+ Customer: "customer",
11677
+ Plan: "plan"
11678
+ };
11679
+ var ListEntitiesOverageAllowedSource = {
11680
+ Customer: "customer",
11681
+ Plan: "plan"
11682
+ };
11529
11683
  var ListEntitiesProcessorType = {
11530
11684
  Stripe: "stripe",
11531
11685
  Revenuecat: "revenuecat"
@@ -11694,13 +11848,15 @@ var ListEntitiesFlags$inboundSchema = z40.pipe(
11694
11848
  })
11695
11849
  );
11696
11850
  var ListEntitiesLimitType$inboundSchema = inboundSchema(ListEntitiesLimitType);
11851
+ var ListEntitiesSpendLimitSource$inboundSchema = inboundSchema(ListEntitiesSpendLimitSource);
11697
11852
  var ListEntitiesSpendLimit$inboundSchema = z40.pipe(
11698
11853
  z40.object({
11699
11854
  feature_id: optional3(string4()),
11700
11855
  enabled: z40._default(boolean2(), false),
11701
11856
  limit_type: optional3(ListEntitiesLimitType$inboundSchema),
11702
11857
  overage_limit: optional3(number2()),
11703
- skip_overage_billing: optional3(boolean2())
11858
+ skip_overage_billing: optional3(boolean2()),
11859
+ source: optional3(ListEntitiesSpendLimitSource$inboundSchema)
11704
11860
  }),
11705
11861
  z40.transform((v) => {
11706
11862
  return remap(v, {
@@ -11715,6 +11871,7 @@ var ListEntitiesInterval$inboundSchema = inboundSchema(ListEntitiesInterval);
11715
11871
  var ListEntitiesFilter$inboundSchema = z40.object({
11716
11872
  properties: z40.record(z40.string(), z40.any())
11717
11873
  });
11874
+ var ListEntitiesUsageLimitSource$inboundSchema = inboundSchema(ListEntitiesUsageLimitSource);
11718
11875
  var ListEntitiesUsageLimit$inboundSchema = z40.pipe(
11719
11876
  z40.object({
11720
11877
  feature_id: string4(),
@@ -11722,7 +11879,8 @@ var ListEntitiesUsageLimit$inboundSchema = z40.pipe(
11722
11879
  limit: number2(),
11723
11880
  interval: ListEntitiesInterval$inboundSchema,
11724
11881
  filter: optional3(z40.lazy(() => ListEntitiesFilter$inboundSchema)),
11725
- usage: optional3(number2())
11882
+ usage: optional3(number2()),
11883
+ source: optional3(ListEntitiesUsageLimitSource$inboundSchema)
11726
11884
  }),
11727
11885
  z40.transform((v) => {
11728
11886
  return remap(v, {
@@ -11731,13 +11889,15 @@ var ListEntitiesUsageLimit$inboundSchema = z40.pipe(
11731
11889
  })
11732
11890
  );
11733
11891
  var ListEntitiesThresholdType$inboundSchema = inboundSchema(ListEntitiesThresholdType);
11892
+ var ListEntitiesUsageAlertSource$inboundSchema = inboundSchema(ListEntitiesUsageAlertSource);
11734
11893
  var ListEntitiesUsageAlert$inboundSchema = z40.pipe(
11735
11894
  z40.object({
11736
11895
  feature_id: optional3(string4()),
11737
11896
  enabled: z40._default(boolean2(), true),
11738
11897
  threshold: number2(),
11739
11898
  threshold_type: ListEntitiesThresholdType$inboundSchema,
11740
- name: optional3(string4())
11899
+ name: optional3(string4()),
11900
+ source: optional3(ListEntitiesUsageAlertSource$inboundSchema)
11741
11901
  }),
11742
11902
  z40.transform((v) => {
11743
11903
  return remap(v, {
@@ -11746,10 +11906,12 @@ var ListEntitiesUsageAlert$inboundSchema = z40.pipe(
11746
11906
  });
11747
11907
  })
11748
11908
  );
11909
+ var ListEntitiesOverageAllowedSource$inboundSchema = inboundSchema(ListEntitiesOverageAllowedSource);
11749
11910
  var ListEntitiesOverageAllowed$inboundSchema = z40.pipe(
11750
11911
  z40.object({
11751
11912
  feature_id: string4(),
11752
- enabled: z40._default(boolean2(), false)
11913
+ enabled: z40._default(boolean2(), false),
11914
+ source: optional3(ListEntitiesOverageAllowedSource$inboundSchema)
11753
11915
  }),
11754
11916
  z40.transform((v) => {
11755
11917
  return remap(v, {
@@ -17844,7 +18006,8 @@ var UpdateBalanceParams$outboundSchema = z61.pipe(
17844
18006
  interval: z61.optional(UpdateBalanceInterval$outboundSchema),
17845
18007
  includedGrant: z61.optional(z61.number()),
17846
18008
  balanceId: z61.optional(z61.string()),
17847
- nextResetAt: z61.optional(z61.number())
18009
+ nextResetAt: z61.optional(z61.number()),
18010
+ expiresAt: z61.optional(z61.number())
17848
18011
  }),
17849
18012
  z61.transform((v) => {
17850
18013
  return remap(v, {
@@ -17854,7 +18017,8 @@ var UpdateBalanceParams$outboundSchema = z61.pipe(
17854
18017
  addToBalance: "add_to_balance",
17855
18018
  includedGrant: "included_grant",
17856
18019
  balanceId: "balance_id",
17857
- nextResetAt: "next_reset_at"
18020
+ nextResetAt: "next_reset_at",
18021
+ expiresAt: "expires_at"
17858
18022
  });
17859
18023
  })
17860
18024
  );
@@ -17902,22 +18066,42 @@ var UpdateCustomerPurchaseLimitIntervalResponse1 = {
17902
18066
  Week: "week",
17903
18067
  Month: "month"
17904
18068
  };
18069
+ var UpdateCustomerAutoTopupSource = {
18070
+ Customer: "customer",
18071
+ Plan: "plan"
18072
+ };
17905
18073
  var UpdateCustomerLimitTypeResponse = {
17906
18074
  Absolute: "absolute",
17907
18075
  UsagePercentage: "usage_percentage"
17908
18076
  };
18077
+ var UpdateCustomerSpendLimitSource = {
18078
+ Customer: "customer",
18079
+ Plan: "plan"
18080
+ };
17909
18081
  var UpdateCustomerUsageLimitIntervalResponse = {
17910
18082
  Day: "day",
17911
18083
  Week: "week",
17912
18084
  Month: "month",
17913
18085
  Year: "year"
17914
18086
  };
18087
+ var UpdateCustomerUsageLimitSource = {
18088
+ Customer: "customer",
18089
+ Plan: "plan"
18090
+ };
17915
18091
  var UpdateCustomerThresholdTypeResponse = {
17916
18092
  Usage: "usage",
17917
18093
  UsagePercentage: "usage_percentage",
17918
18094
  Remaining: "remaining",
17919
18095
  RemainingPercentage: "remaining_percentage"
17920
18096
  };
18097
+ var UpdateCustomerUsageAlertSource = {
18098
+ Customer: "customer",
18099
+ Plan: "plan"
18100
+ };
18101
+ var UpdateCustomerOverageAllowedSource = {
18102
+ Customer: "customer",
18103
+ Plan: "plan"
18104
+ };
17921
18105
  var UpdateCustomerStatus = {
17922
18106
  Active: "active",
17923
18107
  Scheduled: "scheduled"
@@ -18114,38 +18298,39 @@ var UpdateCustomerEnv$inboundSchema = inboundSchema(UpdateCustomerEnv);
18114
18298
  var UpdateCustomerPurchaseLimitIntervalResponse2$inboundSchema = inboundSchema(UpdateCustomerPurchaseLimitIntervalResponse2);
18115
18299
  var UpdateCustomerPurchaseLimitResponse2$inboundSchema = z62.pipe(
18116
18300
  z62.object({
18117
- interval: nullable(
18118
- UpdateCustomerPurchaseLimitIntervalResponse2$inboundSchema
18119
- ),
18120
- interval_count: nullable(number2()),
18121
- limit: nullable(number2()),
18122
- count: number2(),
18123
- next_reset_at: number2()
18301
+ interval: UpdateCustomerPurchaseLimitIntervalResponse2$inboundSchema,
18302
+ interval_count: z62._default(number2(), 1),
18303
+ limit: number2()
18124
18304
  }),
18125
18305
  z62.transform((v) => {
18126
18306
  return remap(v, {
18127
- "interval_count": "intervalCount",
18128
- "next_reset_at": "nextResetAt"
18307
+ "interval_count": "intervalCount"
18129
18308
  });
18130
18309
  })
18131
18310
  );
18132
18311
  var UpdateCustomerPurchaseLimitIntervalResponse1$inboundSchema = inboundSchema(UpdateCustomerPurchaseLimitIntervalResponse1);
18133
18312
  var UpdateCustomerPurchaseLimitResponse1$inboundSchema = z62.pipe(
18134
18313
  z62.object({
18135
- interval: UpdateCustomerPurchaseLimitIntervalResponse1$inboundSchema,
18136
- interval_count: z62._default(number2(), 1),
18137
- limit: number2()
18314
+ interval: nullable(
18315
+ UpdateCustomerPurchaseLimitIntervalResponse1$inboundSchema
18316
+ ),
18317
+ interval_count: nullable(number2()),
18318
+ limit: nullable(number2()),
18319
+ count: number2(),
18320
+ next_reset_at: number2()
18138
18321
  }),
18139
18322
  z62.transform((v) => {
18140
18323
  return remap(v, {
18141
- "interval_count": "intervalCount"
18324
+ "interval_count": "intervalCount",
18325
+ "next_reset_at": "nextResetAt"
18142
18326
  });
18143
18327
  })
18144
18328
  );
18145
18329
  var UpdateCustomerPurchaseLimitUnion$inboundSchema = smartUnion([
18146
- z62.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema),
18147
- z62.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema)
18330
+ z62.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema),
18331
+ z62.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema)
18148
18332
  ]);
18333
+ var UpdateCustomerAutoTopupSource$inboundSchema = inboundSchema(UpdateCustomerAutoTopupSource);
18149
18334
  var UpdateCustomerAutoTopupResponse$inboundSchema = z62.pipe(
18150
18335
  z62.object({
18151
18336
  feature_id: string4(),
@@ -18153,10 +18338,11 @@ var UpdateCustomerAutoTopupResponse$inboundSchema = z62.pipe(
18153
18338
  threshold: number2(),
18154
18339
  quantity: number2(),
18155
18340
  purchase_limit: optional3(smartUnion([
18156
- z62.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema),
18157
- z62.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema)
18341
+ z62.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema),
18342
+ z62.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema)
18158
18343
  ])),
18159
- invoice_mode: optional3(boolean2())
18344
+ invoice_mode: optional3(boolean2()),
18345
+ source: optional3(UpdateCustomerAutoTopupSource$inboundSchema)
18160
18346
  }),
18161
18347
  z62.transform((v) => {
18162
18348
  return remap(v, {
@@ -18167,13 +18353,15 @@ var UpdateCustomerAutoTopupResponse$inboundSchema = z62.pipe(
18167
18353
  })
18168
18354
  );
18169
18355
  var UpdateCustomerLimitTypeResponse$inboundSchema = inboundSchema(UpdateCustomerLimitTypeResponse);
18356
+ var UpdateCustomerSpendLimitSource$inboundSchema = inboundSchema(UpdateCustomerSpendLimitSource);
18170
18357
  var UpdateCustomerSpendLimitResponse$inboundSchema = z62.pipe(
18171
18358
  z62.object({
18172
18359
  feature_id: optional3(string4()),
18173
18360
  enabled: z62._default(boolean2(), false),
18174
18361
  limit_type: optional3(UpdateCustomerLimitTypeResponse$inboundSchema),
18175
18362
  overage_limit: optional3(number2()),
18176
- skip_overage_billing: optional3(boolean2())
18363
+ skip_overage_billing: optional3(boolean2()),
18364
+ source: optional3(UpdateCustomerSpendLimitSource$inboundSchema)
18177
18365
  }),
18178
18366
  z62.transform((v) => {
18179
18367
  return remap(v, {
@@ -18188,6 +18376,7 @@ var UpdateCustomerUsageLimitIntervalResponse$inboundSchema = inboundSchema(Updat
18188
18376
  var UpdateCustomerFilterResponse$inboundSchema = z62.object({
18189
18377
  properties: z62.record(z62.string(), z62.any())
18190
18378
  });
18379
+ var UpdateCustomerUsageLimitSource$inboundSchema = inboundSchema(UpdateCustomerUsageLimitSource);
18191
18380
  var UpdateCustomerUsageLimitResponse$inboundSchema = z62.pipe(
18192
18381
  z62.object({
18193
18382
  feature_id: string4(),
@@ -18197,7 +18386,8 @@ var UpdateCustomerUsageLimitResponse$inboundSchema = z62.pipe(
18197
18386
  filter: optional3(
18198
18387
  z62.lazy(() => UpdateCustomerFilterResponse$inboundSchema)
18199
18388
  ),
18200
- usage: optional3(number2())
18389
+ usage: optional3(number2()),
18390
+ source: optional3(UpdateCustomerUsageLimitSource$inboundSchema)
18201
18391
  }),
18202
18392
  z62.transform((v) => {
18203
18393
  return remap(v, {
@@ -18206,13 +18396,15 @@ var UpdateCustomerUsageLimitResponse$inboundSchema = z62.pipe(
18206
18396
  })
18207
18397
  );
18208
18398
  var UpdateCustomerThresholdTypeResponse$inboundSchema = inboundSchema(UpdateCustomerThresholdTypeResponse);
18399
+ var UpdateCustomerUsageAlertSource$inboundSchema = inboundSchema(UpdateCustomerUsageAlertSource);
18209
18400
  var UpdateCustomerUsageAlertResponse$inboundSchema = z62.pipe(
18210
18401
  z62.object({
18211
18402
  feature_id: optional3(string4()),
18212
18403
  enabled: z62._default(boolean2(), true),
18213
18404
  threshold: number2(),
18214
18405
  threshold_type: UpdateCustomerThresholdTypeResponse$inboundSchema,
18215
- name: optional3(string4())
18406
+ name: optional3(string4()),
18407
+ source: optional3(UpdateCustomerUsageAlertSource$inboundSchema)
18216
18408
  }),
18217
18409
  z62.transform((v) => {
18218
18410
  return remap(v, {
@@ -18221,10 +18413,12 @@ var UpdateCustomerUsageAlertResponse$inboundSchema = z62.pipe(
18221
18413
  });
18222
18414
  })
18223
18415
  );
18416
+ var UpdateCustomerOverageAllowedSource$inboundSchema = inboundSchema(UpdateCustomerOverageAllowedSource);
18224
18417
  var UpdateCustomerOverageAllowedResponse$inboundSchema = z62.pipe(
18225
18418
  z62.object({
18226
18419
  feature_id: string4(),
18227
- enabled: z62._default(boolean2(), false)
18420
+ enabled: z62._default(boolean2(), false),
18421
+ source: optional3(UpdateCustomerOverageAllowedSource$inboundSchema)
18228
18422
  }),
18229
18423
  z62.transform((v) => {
18230
18424
  return remap(v, {
@@ -18517,18 +18711,34 @@ var UpdateEntityLimitTypeResponse = {
18517
18711
  Absolute: "absolute",
18518
18712
  UsagePercentage: "usage_percentage"
18519
18713
  };
18714
+ var UpdateEntitySpendLimitSource = {
18715
+ Customer: "customer",
18716
+ Plan: "plan"
18717
+ };
18520
18718
  var UpdateEntityIntervalResponse = {
18521
18719
  Day: "day",
18522
18720
  Week: "week",
18523
18721
  Month: "month",
18524
18722
  Year: "year"
18525
18723
  };
18724
+ var UpdateEntityUsageLimitSource = {
18725
+ Customer: "customer",
18726
+ Plan: "plan"
18727
+ };
18526
18728
  var UpdateEntityThresholdTypeResponse = {
18527
18729
  Usage: "usage",
18528
18730
  UsagePercentage: "usage_percentage",
18529
18731
  Remaining: "remaining",
18530
18732
  RemainingPercentage: "remaining_percentage"
18531
18733
  };
18734
+ var UpdateEntityUsageAlertSource = {
18735
+ Customer: "customer",
18736
+ Plan: "plan"
18737
+ };
18738
+ var UpdateEntityOverageAllowedSource = {
18739
+ Customer: "customer",
18740
+ Plan: "plan"
18741
+ };
18532
18742
  var UpdateEntityProcessorType = {
18533
18743
  Stripe: "stripe",
18534
18744
  Revenuecat: "revenuecat"
@@ -18778,13 +18988,15 @@ var UpdateEntityFlags$inboundSchema = z63.pipe(
18778
18988
  })
18779
18989
  );
18780
18990
  var UpdateEntityLimitTypeResponse$inboundSchema = inboundSchema(UpdateEntityLimitTypeResponse);
18991
+ var UpdateEntitySpendLimitSource$inboundSchema = inboundSchema(UpdateEntitySpendLimitSource);
18781
18992
  var UpdateEntitySpendLimitResponse$inboundSchema = z63.pipe(
18782
18993
  z63.object({
18783
18994
  feature_id: optional3(string4()),
18784
18995
  enabled: z63._default(boolean2(), false),
18785
18996
  limit_type: optional3(UpdateEntityLimitTypeResponse$inboundSchema),
18786
18997
  overage_limit: optional3(number2()),
18787
- skip_overage_billing: optional3(boolean2())
18998
+ skip_overage_billing: optional3(boolean2()),
18999
+ source: optional3(UpdateEntitySpendLimitSource$inboundSchema)
18788
19000
  }),
18789
19001
  z63.transform((v) => {
18790
19002
  return remap(v, {
@@ -18799,6 +19011,7 @@ var UpdateEntityIntervalResponse$inboundSchema = inboundSchema(UpdateEntityInter
18799
19011
  var UpdateEntityFilterResponse$inboundSchema = z63.object({
18800
19012
  properties: z63.record(z63.string(), z63.any())
18801
19013
  });
19014
+ var UpdateEntityUsageLimitSource$inboundSchema = inboundSchema(UpdateEntityUsageLimitSource);
18802
19015
  var UpdateEntityUsageLimitResponse$inboundSchema = z63.pipe(
18803
19016
  z63.object({
18804
19017
  feature_id: string4(),
@@ -18808,7 +19021,8 @@ var UpdateEntityUsageLimitResponse$inboundSchema = z63.pipe(
18808
19021
  filter: optional3(
18809
19022
  z63.lazy(() => UpdateEntityFilterResponse$inboundSchema)
18810
19023
  ),
18811
- usage: optional3(number2())
19024
+ usage: optional3(number2()),
19025
+ source: optional3(UpdateEntityUsageLimitSource$inboundSchema)
18812
19026
  }),
18813
19027
  z63.transform((v) => {
18814
19028
  return remap(v, {
@@ -18817,13 +19031,15 @@ var UpdateEntityUsageLimitResponse$inboundSchema = z63.pipe(
18817
19031
  })
18818
19032
  );
18819
19033
  var UpdateEntityThresholdTypeResponse$inboundSchema = inboundSchema(UpdateEntityThresholdTypeResponse);
19034
+ var UpdateEntityUsageAlertSource$inboundSchema = inboundSchema(UpdateEntityUsageAlertSource);
18820
19035
  var UpdateEntityUsageAlertResponse$inboundSchema = z63.pipe(
18821
19036
  z63.object({
18822
19037
  feature_id: optional3(string4()),
18823
19038
  enabled: z63._default(boolean2(), true),
18824
19039
  threshold: number2(),
18825
19040
  threshold_type: UpdateEntityThresholdTypeResponse$inboundSchema,
18826
- name: optional3(string4())
19041
+ name: optional3(string4()),
19042
+ source: optional3(UpdateEntityUsageAlertSource$inboundSchema)
18827
19043
  }),
18828
19044
  z63.transform((v) => {
18829
19045
  return remap(v, {
@@ -18832,10 +19048,12 @@ var UpdateEntityUsageAlertResponse$inboundSchema = z63.pipe(
18832
19048
  });
18833
19049
  })
18834
19050
  );
19051
+ var UpdateEntityOverageAllowedSource$inboundSchema = inboundSchema(UpdateEntityOverageAllowedSource);
18835
19052
  var UpdateEntityOverageAllowedResponse$inboundSchema = z63.pipe(
18836
19053
  z63.object({
18837
19054
  feature_id: string4(),
18838
- enabled: z63._default(boolean2(), false)
19055
+ enabled: z63._default(boolean2(), false),
19056
+ source: optional3(UpdateEntityOverageAllowedSource$inboundSchema)
18839
19057
  }),
18840
19058
  z63.transform((v) => {
18841
19059
  return remap(v, {
@@ -23208,7 +23426,7 @@ var Billing = class extends ClientSDK {
23208
23426
  * @example
23209
23427
  * ```typescript
23210
23428
  * // Schedule a transition from a trial plan to a paid plan
23211
- * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1783590814052,"plans":[{"planId":"trial_plan"}]},{"startsAt":1784800414052,"plans":[{"planId":"pro_plan"}]}] });
23429
+ * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1783701939170,"plans":[{"planId":"trial_plan"}]},{"startsAt":1784911539170,"plans":[{"planId":"pro_plan"}]}] });
23212
23430
  * ```
23213
23431
  *
23214
23432
  * @param customerId - The ID of the customer to create the schedule for.