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
@@ -9688,18 +9688,34 @@ var CreateEntityLimitTypeResponse = {
9688
9688
  Absolute: "absolute",
9689
9689
  UsagePercentage: "usage_percentage"
9690
9690
  };
9691
+ var CreateEntitySpendLimitSource = {
9692
+ Customer: "customer",
9693
+ Plan: "plan"
9694
+ };
9691
9695
  var CreateEntityIntervalResponse = {
9692
9696
  Day: "day",
9693
9697
  Week: "week",
9694
9698
  Month: "month",
9695
9699
  Year: "year"
9696
9700
  };
9701
+ var CreateEntityUsageLimitSource = {
9702
+ Customer: "customer",
9703
+ Plan: "plan"
9704
+ };
9697
9705
  var CreateEntityThresholdTypeResponse = {
9698
9706
  Usage: "usage",
9699
9707
  UsagePercentage: "usage_percentage",
9700
9708
  Remaining: "remaining",
9701
9709
  RemainingPercentage: "remaining_percentage"
9702
9710
  };
9711
+ var CreateEntityUsageAlertSource = {
9712
+ Customer: "customer",
9713
+ Plan: "plan"
9714
+ };
9715
+ var CreateEntityOverageAllowedSource = {
9716
+ Customer: "customer",
9717
+ Plan: "plan"
9718
+ };
9703
9719
  var CreateEntityProcessorType = {
9704
9720
  Stripe: "stripe",
9705
9721
  Revenuecat: "revenuecat"
@@ -9954,13 +9970,15 @@ var CreateEntityFlags$inboundSchema = z34.pipe(
9954
9970
  })
9955
9971
  );
9956
9972
  var CreateEntityLimitTypeResponse$inboundSchema = inboundSchema(CreateEntityLimitTypeResponse);
9973
+ var CreateEntitySpendLimitSource$inboundSchema = inboundSchema(CreateEntitySpendLimitSource);
9957
9974
  var CreateEntitySpendLimitResponse$inboundSchema = z34.pipe(
9958
9975
  z34.object({
9959
9976
  feature_id: optional3(string4()),
9960
9977
  enabled: z34._default(boolean2(), false),
9961
9978
  limit_type: optional3(CreateEntityLimitTypeResponse$inboundSchema),
9962
9979
  overage_limit: optional3(number2()),
9963
- skip_overage_billing: optional3(boolean2())
9980
+ skip_overage_billing: optional3(boolean2()),
9981
+ source: optional3(CreateEntitySpendLimitSource$inboundSchema)
9964
9982
  }),
9965
9983
  z34.transform((v) => {
9966
9984
  return remap(v, {
@@ -9975,6 +9993,7 @@ var CreateEntityIntervalResponse$inboundSchema = inboundSchema(CreateEntityInter
9975
9993
  var CreateEntityFilterResponse$inboundSchema = z34.object({
9976
9994
  properties: z34.record(z34.string(), z34.any())
9977
9995
  });
9996
+ var CreateEntityUsageLimitSource$inboundSchema = inboundSchema(CreateEntityUsageLimitSource);
9978
9997
  var CreateEntityUsageLimitResponse$inboundSchema = z34.pipe(
9979
9998
  z34.object({
9980
9999
  feature_id: string4(),
@@ -9984,7 +10003,8 @@ var CreateEntityUsageLimitResponse$inboundSchema = z34.pipe(
9984
10003
  filter: optional3(
9985
10004
  z34.lazy(() => CreateEntityFilterResponse$inboundSchema)
9986
10005
  ),
9987
- usage: optional3(number2())
10006
+ usage: optional3(number2()),
10007
+ source: optional3(CreateEntityUsageLimitSource$inboundSchema)
9988
10008
  }),
9989
10009
  z34.transform((v) => {
9990
10010
  return remap(v, {
@@ -9993,13 +10013,15 @@ var CreateEntityUsageLimitResponse$inboundSchema = z34.pipe(
9993
10013
  })
9994
10014
  );
9995
10015
  var CreateEntityThresholdTypeResponse$inboundSchema = inboundSchema(CreateEntityThresholdTypeResponse);
10016
+ var CreateEntityUsageAlertSource$inboundSchema = inboundSchema(CreateEntityUsageAlertSource);
9996
10017
  var CreateEntityUsageAlertResponse$inboundSchema = z34.pipe(
9997
10018
  z34.object({
9998
10019
  feature_id: optional3(string4()),
9999
10020
  enabled: z34._default(boolean2(), true),
10000
10021
  threshold: number2(),
10001
10022
  threshold_type: CreateEntityThresholdTypeResponse$inboundSchema,
10002
- name: optional3(string4())
10023
+ name: optional3(string4()),
10024
+ source: optional3(CreateEntityUsageAlertSource$inboundSchema)
10003
10025
  }),
10004
10026
  z34.transform((v) => {
10005
10027
  return remap(v, {
@@ -10008,10 +10030,12 @@ var CreateEntityUsageAlertResponse$inboundSchema = z34.pipe(
10008
10030
  });
10009
10031
  })
10010
10032
  );
10033
+ var CreateEntityOverageAllowedSource$inboundSchema = inboundSchema(CreateEntityOverageAllowedSource);
10011
10034
  var CreateEntityOverageAllowedResponse$inboundSchema = z34.pipe(
10012
10035
  z34.object({
10013
10036
  feature_id: string4(),
10014
- enabled: z34._default(boolean2(), false)
10037
+ enabled: z34._default(boolean2(), false),
10038
+ source: optional3(CreateEntityOverageAllowedSource$inboundSchema)
10015
10039
  }),
10016
10040
  z34.transform((v) => {
10017
10041
  return remap(v, {
@@ -12383,22 +12407,42 @@ var CustomerPurchaseLimitInterval1 = {
12383
12407
  Week: "week",
12384
12408
  Month: "month"
12385
12409
  };
12410
+ var AutoTopupSource = {
12411
+ Customer: "customer",
12412
+ Plan: "plan"
12413
+ };
12386
12414
  var CustomerLimitType = {
12387
12415
  Absolute: "absolute",
12388
12416
  UsagePercentage: "usage_percentage"
12389
12417
  };
12418
+ var SpendLimitSource = {
12419
+ Customer: "customer",
12420
+ Plan: "plan"
12421
+ };
12390
12422
  var CustomerUsageLimitInterval = {
12391
12423
  Day: "day",
12392
12424
  Week: "week",
12393
12425
  Month: "month",
12394
12426
  Year: "year"
12395
12427
  };
12428
+ var UsageLimitSource = {
12429
+ Customer: "customer",
12430
+ Plan: "plan"
12431
+ };
12396
12432
  var CustomerThresholdType = {
12397
12433
  Usage: "usage",
12398
12434
  UsagePercentage: "usage_percentage",
12399
12435
  Remaining: "remaining",
12400
12436
  RemainingPercentage: "remaining_percentage"
12401
12437
  };
12438
+ var UsageAlertSource = {
12439
+ Customer: "customer",
12440
+ Plan: "plan"
12441
+ };
12442
+ var OverageAllowedSource = {
12443
+ Customer: "customer",
12444
+ Plan: "plan"
12445
+ };
12402
12446
  var CustomerStatus = {
12403
12447
  Active: "active",
12404
12448
  Scheduled: "scheduled"
@@ -12441,36 +12485,37 @@ var CustomerEnv$inboundSchema = inboundSchema(CustomerEnv);
12441
12485
  var CustomerPurchaseLimitInterval2$inboundSchema = inboundSchema(CustomerPurchaseLimitInterval2);
12442
12486
  var CustomerPurchaseLimit2$inboundSchema = z40.pipe(
12443
12487
  z40.object({
12444
- interval: nullable(CustomerPurchaseLimitInterval2$inboundSchema),
12445
- interval_count: nullable(number2()),
12446
- limit: nullable(number2()),
12447
- count: number2(),
12448
- next_reset_at: number2()
12488
+ interval: CustomerPurchaseLimitInterval2$inboundSchema,
12489
+ interval_count: z40._default(number2(), 1),
12490
+ limit: number2()
12449
12491
  }),
12450
12492
  z40.transform((v) => {
12451
12493
  return remap(v, {
12452
- "interval_count": "intervalCount",
12453
- "next_reset_at": "nextResetAt"
12494
+ "interval_count": "intervalCount"
12454
12495
  });
12455
12496
  })
12456
12497
  );
12457
12498
  var CustomerPurchaseLimitInterval1$inboundSchema = inboundSchema(CustomerPurchaseLimitInterval1);
12458
12499
  var CustomerPurchaseLimit1$inboundSchema = z40.pipe(
12459
12500
  z40.object({
12460
- interval: CustomerPurchaseLimitInterval1$inboundSchema,
12461
- interval_count: z40._default(number2(), 1),
12462
- limit: number2()
12501
+ interval: nullable(CustomerPurchaseLimitInterval1$inboundSchema),
12502
+ interval_count: nullable(number2()),
12503
+ limit: nullable(number2()),
12504
+ count: number2(),
12505
+ next_reset_at: number2()
12463
12506
  }),
12464
12507
  z40.transform((v) => {
12465
12508
  return remap(v, {
12466
- "interval_count": "intervalCount"
12509
+ "interval_count": "intervalCount",
12510
+ "next_reset_at": "nextResetAt"
12467
12511
  });
12468
12512
  })
12469
12513
  );
12470
12514
  var CustomerPurchaseLimitUnion$inboundSchema = smartUnion([
12471
- z40.lazy(() => CustomerPurchaseLimit2$inboundSchema),
12472
- z40.lazy(() => CustomerPurchaseLimit1$inboundSchema)
12515
+ z40.lazy(() => CustomerPurchaseLimit1$inboundSchema),
12516
+ z40.lazy(() => CustomerPurchaseLimit2$inboundSchema)
12473
12517
  ]);
12518
+ var AutoTopupSource$inboundSchema = inboundSchema(AutoTopupSource);
12474
12519
  var CustomerAutoTopup$inboundSchema = z40.pipe(
12475
12520
  z40.object({
12476
12521
  feature_id: string4(),
@@ -12478,10 +12523,11 @@ var CustomerAutoTopup$inboundSchema = z40.pipe(
12478
12523
  threshold: number2(),
12479
12524
  quantity: number2(),
12480
12525
  purchase_limit: optional3(smartUnion([
12481
- z40.lazy(() => CustomerPurchaseLimit2$inboundSchema),
12482
- z40.lazy(() => CustomerPurchaseLimit1$inboundSchema)
12526
+ z40.lazy(() => CustomerPurchaseLimit1$inboundSchema),
12527
+ z40.lazy(() => CustomerPurchaseLimit2$inboundSchema)
12483
12528
  ])),
12484
- invoice_mode: optional3(boolean2())
12529
+ invoice_mode: optional3(boolean2()),
12530
+ source: optional3(AutoTopupSource$inboundSchema)
12485
12531
  }),
12486
12532
  z40.transform((v) => {
12487
12533
  return remap(v, {
@@ -12492,13 +12538,15 @@ var CustomerAutoTopup$inboundSchema = z40.pipe(
12492
12538
  })
12493
12539
  );
12494
12540
  var CustomerLimitType$inboundSchema = inboundSchema(CustomerLimitType);
12541
+ var SpendLimitSource$inboundSchema = inboundSchema(SpendLimitSource);
12495
12542
  var CustomerSpendLimit$inboundSchema = z40.pipe(
12496
12543
  z40.object({
12497
12544
  feature_id: optional3(string4()),
12498
12545
  enabled: z40._default(boolean2(), false),
12499
12546
  limit_type: optional3(CustomerLimitType$inboundSchema),
12500
12547
  overage_limit: optional3(number2()),
12501
- skip_overage_billing: optional3(boolean2())
12548
+ skip_overage_billing: optional3(boolean2()),
12549
+ source: optional3(SpendLimitSource$inboundSchema)
12502
12550
  }),
12503
12551
  z40.transform((v) => {
12504
12552
  return remap(v, {
@@ -12513,6 +12561,7 @@ var CustomerUsageLimitInterval$inboundSchema = inboundSchema(CustomerUsageLimitI
12513
12561
  var CustomerFilter$inboundSchema = z40.object({
12514
12562
  properties: z40.record(z40.string(), z40.any())
12515
12563
  });
12564
+ var UsageLimitSource$inboundSchema = inboundSchema(UsageLimitSource);
12516
12565
  var CustomerUsageLimit$inboundSchema = z40.pipe(
12517
12566
  z40.object({
12518
12567
  feature_id: string4(),
@@ -12520,7 +12569,8 @@ var CustomerUsageLimit$inboundSchema = z40.pipe(
12520
12569
  limit: number2(),
12521
12570
  interval: CustomerUsageLimitInterval$inboundSchema,
12522
12571
  filter: optional3(z40.lazy(() => CustomerFilter$inboundSchema)),
12523
- usage: optional3(number2())
12572
+ usage: optional3(number2()),
12573
+ source: optional3(UsageLimitSource$inboundSchema)
12524
12574
  }),
12525
12575
  z40.transform((v) => {
12526
12576
  return remap(v, {
@@ -12529,13 +12579,15 @@ var CustomerUsageLimit$inboundSchema = z40.pipe(
12529
12579
  })
12530
12580
  );
12531
12581
  var CustomerThresholdType$inboundSchema = inboundSchema(CustomerThresholdType);
12582
+ var UsageAlertSource$inboundSchema = inboundSchema(UsageAlertSource);
12532
12583
  var CustomerUsageAlert$inboundSchema = z40.pipe(
12533
12584
  z40.object({
12534
12585
  feature_id: optional3(string4()),
12535
12586
  enabled: z40._default(boolean2(), true),
12536
12587
  threshold: number2(),
12537
12588
  threshold_type: CustomerThresholdType$inboundSchema,
12538
- name: optional3(string4())
12589
+ name: optional3(string4()),
12590
+ source: optional3(UsageAlertSource$inboundSchema)
12539
12591
  }),
12540
12592
  z40.transform((v) => {
12541
12593
  return remap(v, {
@@ -12544,10 +12596,12 @@ var CustomerUsageAlert$inboundSchema = z40.pipe(
12544
12596
  });
12545
12597
  })
12546
12598
  );
12599
+ var OverageAllowedSource$inboundSchema = inboundSchema(OverageAllowedSource);
12547
12600
  var CustomerOverageAllowed$inboundSchema = z40.pipe(
12548
12601
  z40.object({
12549
12602
  feature_id: string4(),
12550
- enabled: z40._default(boolean2(), false)
12603
+ enabled: z40._default(boolean2(), false),
12604
+ source: optional3(OverageAllowedSource$inboundSchema)
12551
12605
  }),
12552
12606
  z40.transform((v) => {
12553
12607
  return remap(v, {
@@ -13052,22 +13106,42 @@ var GetCustomerPurchaseLimitInterval1 = {
13052
13106
  Week: "week",
13053
13107
  Month: "month"
13054
13108
  };
13109
+ var GetCustomerAutoTopupSource = {
13110
+ Customer: "customer",
13111
+ Plan: "plan"
13112
+ };
13055
13113
  var GetCustomerLimitType = {
13056
13114
  Absolute: "absolute",
13057
13115
  UsagePercentage: "usage_percentage"
13058
13116
  };
13117
+ var GetCustomerSpendLimitSource = {
13118
+ Customer: "customer",
13119
+ Plan: "plan"
13120
+ };
13059
13121
  var GetCustomerUsageLimitInterval = {
13060
13122
  Day: "day",
13061
13123
  Week: "week",
13062
13124
  Month: "month",
13063
13125
  Year: "year"
13064
13126
  };
13127
+ var GetCustomerUsageLimitSource = {
13128
+ Customer: "customer",
13129
+ Plan: "plan"
13130
+ };
13065
13131
  var GetCustomerThresholdType = {
13066
13132
  Usage: "usage",
13067
13133
  UsagePercentage: "usage_percentage",
13068
13134
  Remaining: "remaining",
13069
13135
  RemainingPercentage: "remaining_percentage"
13070
13136
  };
13137
+ var GetCustomerUsageAlertSource = {
13138
+ Customer: "customer",
13139
+ Plan: "plan"
13140
+ };
13141
+ var GetCustomerOverageAllowedSource = {
13142
+ Customer: "customer",
13143
+ Plan: "plan"
13144
+ };
13071
13145
  var GetCustomerStatus = {
13072
13146
  Active: "active",
13073
13147
  Scheduled: "scheduled"
@@ -13121,36 +13195,37 @@ var GetCustomerEnv$inboundSchema = inboundSchema(GetCustomerEnv);
13121
13195
  var GetCustomerPurchaseLimitInterval2$inboundSchema = inboundSchema(GetCustomerPurchaseLimitInterval2);
13122
13196
  var GetCustomerPurchaseLimit2$inboundSchema = z47.pipe(
13123
13197
  z47.object({
13124
- interval: nullable(GetCustomerPurchaseLimitInterval2$inboundSchema),
13125
- interval_count: nullable(number2()),
13126
- limit: nullable(number2()),
13127
- count: number2(),
13128
- next_reset_at: number2()
13198
+ interval: GetCustomerPurchaseLimitInterval2$inboundSchema,
13199
+ interval_count: z47._default(number2(), 1),
13200
+ limit: number2()
13129
13201
  }),
13130
13202
  z47.transform((v) => {
13131
13203
  return remap(v, {
13132
- "interval_count": "intervalCount",
13133
- "next_reset_at": "nextResetAt"
13204
+ "interval_count": "intervalCount"
13134
13205
  });
13135
13206
  })
13136
13207
  );
13137
13208
  var GetCustomerPurchaseLimitInterval1$inboundSchema = inboundSchema(GetCustomerPurchaseLimitInterval1);
13138
13209
  var GetCustomerPurchaseLimit1$inboundSchema = z47.pipe(
13139
13210
  z47.object({
13140
- interval: GetCustomerPurchaseLimitInterval1$inboundSchema,
13141
- interval_count: z47._default(number2(), 1),
13142
- limit: number2()
13211
+ interval: nullable(GetCustomerPurchaseLimitInterval1$inboundSchema),
13212
+ interval_count: nullable(number2()),
13213
+ limit: nullable(number2()),
13214
+ count: number2(),
13215
+ next_reset_at: number2()
13143
13216
  }),
13144
13217
  z47.transform((v) => {
13145
13218
  return remap(v, {
13146
- "interval_count": "intervalCount"
13219
+ "interval_count": "intervalCount",
13220
+ "next_reset_at": "nextResetAt"
13147
13221
  });
13148
13222
  })
13149
13223
  );
13150
13224
  var GetCustomerPurchaseLimitUnion$inboundSchema = smartUnion([
13151
- z47.lazy(() => GetCustomerPurchaseLimit2$inboundSchema),
13152
- z47.lazy(() => GetCustomerPurchaseLimit1$inboundSchema)
13225
+ z47.lazy(() => GetCustomerPurchaseLimit1$inboundSchema),
13226
+ z47.lazy(() => GetCustomerPurchaseLimit2$inboundSchema)
13153
13227
  ]);
13228
+ var GetCustomerAutoTopupSource$inboundSchema = inboundSchema(GetCustomerAutoTopupSource);
13154
13229
  var GetCustomerAutoTopup$inboundSchema = z47.pipe(
13155
13230
  z47.object({
13156
13231
  feature_id: string4(),
@@ -13158,10 +13233,11 @@ var GetCustomerAutoTopup$inboundSchema = z47.pipe(
13158
13233
  threshold: number2(),
13159
13234
  quantity: number2(),
13160
13235
  purchase_limit: optional3(smartUnion([
13161
- z47.lazy(() => GetCustomerPurchaseLimit2$inboundSchema),
13162
- z47.lazy(() => GetCustomerPurchaseLimit1$inboundSchema)
13236
+ z47.lazy(() => GetCustomerPurchaseLimit1$inboundSchema),
13237
+ z47.lazy(() => GetCustomerPurchaseLimit2$inboundSchema)
13163
13238
  ])),
13164
- invoice_mode: optional3(boolean2())
13239
+ invoice_mode: optional3(boolean2()),
13240
+ source: optional3(GetCustomerAutoTopupSource$inboundSchema)
13165
13241
  }),
13166
13242
  z47.transform((v) => {
13167
13243
  return remap(v, {
@@ -13172,13 +13248,15 @@ var GetCustomerAutoTopup$inboundSchema = z47.pipe(
13172
13248
  })
13173
13249
  );
13174
13250
  var GetCustomerLimitType$inboundSchema = inboundSchema(GetCustomerLimitType);
13251
+ var GetCustomerSpendLimitSource$inboundSchema = inboundSchema(GetCustomerSpendLimitSource);
13175
13252
  var GetCustomerSpendLimit$inboundSchema = z47.pipe(
13176
13253
  z47.object({
13177
13254
  feature_id: optional3(string4()),
13178
13255
  enabled: z47._default(boolean2(), false),
13179
13256
  limit_type: optional3(GetCustomerLimitType$inboundSchema),
13180
13257
  overage_limit: optional3(number2()),
13181
- skip_overage_billing: optional3(boolean2())
13258
+ skip_overage_billing: optional3(boolean2()),
13259
+ source: optional3(GetCustomerSpendLimitSource$inboundSchema)
13182
13260
  }),
13183
13261
  z47.transform((v) => {
13184
13262
  return remap(v, {
@@ -13193,6 +13271,7 @@ var GetCustomerUsageLimitInterval$inboundSchema = inboundSchema(GetCustomerUsage
13193
13271
  var GetCustomerFilter$inboundSchema = z47.object({
13194
13272
  properties: z47.record(z47.string(), z47.any())
13195
13273
  });
13274
+ var GetCustomerUsageLimitSource$inboundSchema = inboundSchema(GetCustomerUsageLimitSource);
13196
13275
  var GetCustomerUsageLimit$inboundSchema = z47.pipe(
13197
13276
  z47.object({
13198
13277
  feature_id: string4(),
@@ -13200,7 +13279,8 @@ var GetCustomerUsageLimit$inboundSchema = z47.pipe(
13200
13279
  limit: number2(),
13201
13280
  interval: GetCustomerUsageLimitInterval$inboundSchema,
13202
13281
  filter: optional3(z47.lazy(() => GetCustomerFilter$inboundSchema)),
13203
- usage: optional3(number2())
13282
+ usage: optional3(number2()),
13283
+ source: optional3(GetCustomerUsageLimitSource$inboundSchema)
13204
13284
  }),
13205
13285
  z47.transform((v) => {
13206
13286
  return remap(v, {
@@ -13209,13 +13289,15 @@ var GetCustomerUsageLimit$inboundSchema = z47.pipe(
13209
13289
  })
13210
13290
  );
13211
13291
  var GetCustomerThresholdType$inboundSchema = inboundSchema(GetCustomerThresholdType);
13292
+ var GetCustomerUsageAlertSource$inboundSchema = inboundSchema(GetCustomerUsageAlertSource);
13212
13293
  var GetCustomerUsageAlert$inboundSchema = z47.pipe(
13213
13294
  z47.object({
13214
13295
  feature_id: optional3(string4()),
13215
13296
  enabled: z47._default(boolean2(), true),
13216
13297
  threshold: number2(),
13217
13298
  threshold_type: GetCustomerThresholdType$inboundSchema,
13218
- name: optional3(string4())
13299
+ name: optional3(string4()),
13300
+ source: optional3(GetCustomerUsageAlertSource$inboundSchema)
13219
13301
  }),
13220
13302
  z47.transform((v) => {
13221
13303
  return remap(v, {
@@ -13224,10 +13306,12 @@ var GetCustomerUsageAlert$inboundSchema = z47.pipe(
13224
13306
  });
13225
13307
  })
13226
13308
  );
13309
+ var GetCustomerOverageAllowedSource$inboundSchema = inboundSchema(GetCustomerOverageAllowedSource);
13227
13310
  var GetCustomerOverageAllowed$inboundSchema = z47.pipe(
13228
13311
  z47.object({
13229
13312
  feature_id: string4(),
13230
- enabled: z47._default(boolean2(), false)
13313
+ enabled: z47._default(boolean2(), false),
13314
+ source: optional3(GetCustomerOverageAllowedSource$inboundSchema)
13231
13315
  }),
13232
13316
  z47.transform((v) => {
13233
13317
  return remap(v, {
@@ -13616,18 +13700,34 @@ var GetEntityLimitType = {
13616
13700
  Absolute: "absolute",
13617
13701
  UsagePercentage: "usage_percentage"
13618
13702
  };
13703
+ var GetEntitySpendLimitSource = {
13704
+ Customer: "customer",
13705
+ Plan: "plan"
13706
+ };
13619
13707
  var GetEntityInterval = {
13620
13708
  Day: "day",
13621
13709
  Week: "week",
13622
13710
  Month: "month",
13623
13711
  Year: "year"
13624
13712
  };
13713
+ var GetEntityUsageLimitSource = {
13714
+ Customer: "customer",
13715
+ Plan: "plan"
13716
+ };
13625
13717
  var GetEntityThresholdType = {
13626
13718
  Usage: "usage",
13627
13719
  UsagePercentage: "usage_percentage",
13628
13720
  Remaining: "remaining",
13629
13721
  RemainingPercentage: "remaining_percentage"
13630
13722
  };
13723
+ var GetEntityUsageAlertSource = {
13724
+ Customer: "customer",
13725
+ Plan: "plan"
13726
+ };
13727
+ var GetEntityOverageAllowedSource = {
13728
+ Customer: "customer",
13729
+ Plan: "plan"
13730
+ };
13631
13731
  var GetEntityProcessorType = {
13632
13732
  Stripe: "stripe",
13633
13733
  Revenuecat: "revenuecat"
@@ -13782,13 +13882,15 @@ var GetEntityFlags$inboundSchema = z48.pipe(
13782
13882
  })
13783
13883
  );
13784
13884
  var GetEntityLimitType$inboundSchema = inboundSchema(GetEntityLimitType);
13885
+ var GetEntitySpendLimitSource$inboundSchema = inboundSchema(GetEntitySpendLimitSource);
13785
13886
  var GetEntitySpendLimit$inboundSchema = z48.pipe(
13786
13887
  z48.object({
13787
13888
  feature_id: optional3(string4()),
13788
13889
  enabled: z48._default(boolean2(), false),
13789
13890
  limit_type: optional3(GetEntityLimitType$inboundSchema),
13790
13891
  overage_limit: optional3(number2()),
13791
- skip_overage_billing: optional3(boolean2())
13892
+ skip_overage_billing: optional3(boolean2()),
13893
+ source: optional3(GetEntitySpendLimitSource$inboundSchema)
13792
13894
  }),
13793
13895
  z48.transform((v) => {
13794
13896
  return remap(v, {
@@ -13803,6 +13905,7 @@ var GetEntityInterval$inboundSchema = inboundSchema(GetEntityInterval);
13803
13905
  var GetEntityFilter$inboundSchema = z48.object({
13804
13906
  properties: z48.record(z48.string(), z48.any())
13805
13907
  });
13908
+ var GetEntityUsageLimitSource$inboundSchema = inboundSchema(GetEntityUsageLimitSource);
13806
13909
  var GetEntityUsageLimit$inboundSchema = z48.pipe(
13807
13910
  z48.object({
13808
13911
  feature_id: string4(),
@@ -13810,7 +13913,8 @@ var GetEntityUsageLimit$inboundSchema = z48.pipe(
13810
13913
  limit: number2(),
13811
13914
  interval: GetEntityInterval$inboundSchema,
13812
13915
  filter: optional3(z48.lazy(() => GetEntityFilter$inboundSchema)),
13813
- usage: optional3(number2())
13916
+ usage: optional3(number2()),
13917
+ source: optional3(GetEntityUsageLimitSource$inboundSchema)
13814
13918
  }),
13815
13919
  z48.transform((v) => {
13816
13920
  return remap(v, {
@@ -13819,13 +13923,15 @@ var GetEntityUsageLimit$inboundSchema = z48.pipe(
13819
13923
  })
13820
13924
  );
13821
13925
  var GetEntityThresholdType$inboundSchema = inboundSchema(GetEntityThresholdType);
13926
+ var GetEntityUsageAlertSource$inboundSchema = inboundSchema(GetEntityUsageAlertSource);
13822
13927
  var GetEntityUsageAlert$inboundSchema = z48.pipe(
13823
13928
  z48.object({
13824
13929
  feature_id: optional3(string4()),
13825
13930
  enabled: z48._default(boolean2(), true),
13826
13931
  threshold: number2(),
13827
13932
  threshold_type: GetEntityThresholdType$inboundSchema,
13828
- name: optional3(string4())
13933
+ name: optional3(string4()),
13934
+ source: optional3(GetEntityUsageAlertSource$inboundSchema)
13829
13935
  }),
13830
13936
  z48.transform((v) => {
13831
13937
  return remap(v, {
@@ -13834,10 +13940,12 @@ var GetEntityUsageAlert$inboundSchema = z48.pipe(
13834
13940
  });
13835
13941
  })
13836
13942
  );
13943
+ var GetEntityOverageAllowedSource$inboundSchema = inboundSchema(GetEntityOverageAllowedSource);
13837
13944
  var GetEntityOverageAllowed$inboundSchema = z48.pipe(
13838
13945
  z48.object({
13839
13946
  feature_id: string4(),
13840
- enabled: z48._default(boolean2(), false)
13947
+ enabled: z48._default(boolean2(), false),
13948
+ source: optional3(GetEntityOverageAllowedSource$inboundSchema)
13841
13949
  }),
13842
13950
  z48.transform((v) => {
13843
13951
  return remap(v, {
@@ -15444,22 +15552,42 @@ var ListCustomersPurchaseLimitInterval1 = {
15444
15552
  Week: "week",
15445
15553
  Month: "month"
15446
15554
  };
15555
+ var ListCustomersAutoTopupSource = {
15556
+ Customer: "customer",
15557
+ Plan: "plan"
15558
+ };
15447
15559
  var ListCustomersLimitType = {
15448
15560
  Absolute: "absolute",
15449
15561
  UsagePercentage: "usage_percentage"
15450
15562
  };
15563
+ var ListCustomersSpendLimitSource = {
15564
+ Customer: "customer",
15565
+ Plan: "plan"
15566
+ };
15451
15567
  var ListCustomersUsageLimitInterval = {
15452
15568
  Day: "day",
15453
15569
  Week: "week",
15454
15570
  Month: "month",
15455
15571
  Year: "year"
15456
15572
  };
15573
+ var ListCustomersUsageLimitSource = {
15574
+ Customer: "customer",
15575
+ Plan: "plan"
15576
+ };
15457
15577
  var ListCustomersThresholdType = {
15458
15578
  Usage: "usage",
15459
15579
  UsagePercentage: "usage_percentage",
15460
15580
  Remaining: "remaining",
15461
15581
  RemainingPercentage: "remaining_percentage"
15462
15582
  };
15583
+ var ListCustomersUsageAlertSource = {
15584
+ Customer: "customer",
15585
+ Plan: "plan"
15586
+ };
15587
+ var ListCustomersOverageAllowedSource = {
15588
+ Customer: "customer",
15589
+ Plan: "plan"
15590
+ };
15463
15591
  var ListCustomersStatus = {
15464
15592
  Active: "active",
15465
15593
  Scheduled: "scheduled"
@@ -15506,36 +15634,37 @@ var ListCustomersEnv$inboundSchema = inboundSchema(ListCustomersEnv);
15506
15634
  var ListCustomersPurchaseLimitInterval2$inboundSchema = inboundSchema(ListCustomersPurchaseLimitInterval2);
15507
15635
  var ListCustomersPurchaseLimit2$inboundSchema = z55.pipe(
15508
15636
  z55.object({
15509
- interval: nullable(ListCustomersPurchaseLimitInterval2$inboundSchema),
15510
- interval_count: nullable(number2()),
15511
- limit: nullable(number2()),
15512
- count: number2(),
15513
- next_reset_at: number2()
15637
+ interval: ListCustomersPurchaseLimitInterval2$inboundSchema,
15638
+ interval_count: z55._default(number2(), 1),
15639
+ limit: number2()
15514
15640
  }),
15515
15641
  z55.transform((v) => {
15516
15642
  return remap(v, {
15517
- "interval_count": "intervalCount",
15518
- "next_reset_at": "nextResetAt"
15643
+ "interval_count": "intervalCount"
15519
15644
  });
15520
15645
  })
15521
15646
  );
15522
15647
  var ListCustomersPurchaseLimitInterval1$inboundSchema = inboundSchema(ListCustomersPurchaseLimitInterval1);
15523
15648
  var ListCustomersPurchaseLimit1$inboundSchema = z55.pipe(
15524
15649
  z55.object({
15525
- interval: ListCustomersPurchaseLimitInterval1$inboundSchema,
15526
- interval_count: z55._default(number2(), 1),
15527
- limit: number2()
15650
+ interval: nullable(ListCustomersPurchaseLimitInterval1$inboundSchema),
15651
+ interval_count: nullable(number2()),
15652
+ limit: nullable(number2()),
15653
+ count: number2(),
15654
+ next_reset_at: number2()
15528
15655
  }),
15529
15656
  z55.transform((v) => {
15530
15657
  return remap(v, {
15531
- "interval_count": "intervalCount"
15658
+ "interval_count": "intervalCount",
15659
+ "next_reset_at": "nextResetAt"
15532
15660
  });
15533
15661
  })
15534
15662
  );
15535
15663
  var ListCustomersPurchaseLimitUnion$inboundSchema = smartUnion([
15536
- z55.lazy(() => ListCustomersPurchaseLimit2$inboundSchema),
15537
- z55.lazy(() => ListCustomersPurchaseLimit1$inboundSchema)
15664
+ z55.lazy(() => ListCustomersPurchaseLimit1$inboundSchema),
15665
+ z55.lazy(() => ListCustomersPurchaseLimit2$inboundSchema)
15538
15666
  ]);
15667
+ var ListCustomersAutoTopupSource$inboundSchema = inboundSchema(ListCustomersAutoTopupSource);
15539
15668
  var ListCustomersAutoTopup$inboundSchema = z55.pipe(
15540
15669
  z55.object({
15541
15670
  feature_id: string4(),
@@ -15543,10 +15672,11 @@ var ListCustomersAutoTopup$inboundSchema = z55.pipe(
15543
15672
  threshold: number2(),
15544
15673
  quantity: number2(),
15545
15674
  purchase_limit: optional3(smartUnion([
15546
- z55.lazy(() => ListCustomersPurchaseLimit2$inboundSchema),
15547
- z55.lazy(() => ListCustomersPurchaseLimit1$inboundSchema)
15675
+ z55.lazy(() => ListCustomersPurchaseLimit1$inboundSchema),
15676
+ z55.lazy(() => ListCustomersPurchaseLimit2$inboundSchema)
15548
15677
  ])),
15549
- invoice_mode: optional3(boolean2())
15678
+ invoice_mode: optional3(boolean2()),
15679
+ source: optional3(ListCustomersAutoTopupSource$inboundSchema)
15550
15680
  }),
15551
15681
  z55.transform((v) => {
15552
15682
  return remap(v, {
@@ -15557,13 +15687,15 @@ var ListCustomersAutoTopup$inboundSchema = z55.pipe(
15557
15687
  })
15558
15688
  );
15559
15689
  var ListCustomersLimitType$inboundSchema = inboundSchema(ListCustomersLimitType);
15690
+ var ListCustomersSpendLimitSource$inboundSchema = inboundSchema(ListCustomersSpendLimitSource);
15560
15691
  var ListCustomersSpendLimit$inboundSchema = z55.pipe(
15561
15692
  z55.object({
15562
15693
  feature_id: optional3(string4()),
15563
15694
  enabled: z55._default(boolean2(), false),
15564
15695
  limit_type: optional3(ListCustomersLimitType$inboundSchema),
15565
15696
  overage_limit: optional3(number2()),
15566
- skip_overage_billing: optional3(boolean2())
15697
+ skip_overage_billing: optional3(boolean2()),
15698
+ source: optional3(ListCustomersSpendLimitSource$inboundSchema)
15567
15699
  }),
15568
15700
  z55.transform((v) => {
15569
15701
  return remap(v, {
@@ -15578,6 +15710,7 @@ var ListCustomersUsageLimitInterval$inboundSchema = inboundSchema(ListCustomersU
15578
15710
  var ListCustomersFilter$inboundSchema = z55.object({
15579
15711
  properties: z55.record(z55.string(), z55.any())
15580
15712
  });
15713
+ var ListCustomersUsageLimitSource$inboundSchema = inboundSchema(ListCustomersUsageLimitSource);
15581
15714
  var ListCustomersUsageLimit$inboundSchema = z55.pipe(
15582
15715
  z55.object({
15583
15716
  feature_id: string4(),
@@ -15585,7 +15718,8 @@ var ListCustomersUsageLimit$inboundSchema = z55.pipe(
15585
15718
  limit: number2(),
15586
15719
  interval: ListCustomersUsageLimitInterval$inboundSchema,
15587
15720
  filter: optional3(z55.lazy(() => ListCustomersFilter$inboundSchema)),
15588
- usage: optional3(number2())
15721
+ usage: optional3(number2()),
15722
+ source: optional3(ListCustomersUsageLimitSource$inboundSchema)
15589
15723
  }),
15590
15724
  z55.transform((v) => {
15591
15725
  return remap(v, {
@@ -15594,13 +15728,15 @@ var ListCustomersUsageLimit$inboundSchema = z55.pipe(
15594
15728
  })
15595
15729
  );
15596
15730
  var ListCustomersThresholdType$inboundSchema = inboundSchema(ListCustomersThresholdType);
15731
+ var ListCustomersUsageAlertSource$inboundSchema = inboundSchema(ListCustomersUsageAlertSource);
15597
15732
  var ListCustomersUsageAlert$inboundSchema = z55.pipe(
15598
15733
  z55.object({
15599
15734
  feature_id: optional3(string4()),
15600
15735
  enabled: z55._default(boolean2(), true),
15601
15736
  threshold: number2(),
15602
15737
  threshold_type: ListCustomersThresholdType$inboundSchema,
15603
- name: optional3(string4())
15738
+ name: optional3(string4()),
15739
+ source: optional3(ListCustomersUsageAlertSource$inboundSchema)
15604
15740
  }),
15605
15741
  z55.transform((v) => {
15606
15742
  return remap(v, {
@@ -15609,10 +15745,12 @@ var ListCustomersUsageAlert$inboundSchema = z55.pipe(
15609
15745
  });
15610
15746
  })
15611
15747
  );
15748
+ var ListCustomersOverageAllowedSource$inboundSchema = inboundSchema(ListCustomersOverageAllowedSource);
15612
15749
  var ListCustomersOverageAllowed$inboundSchema = z55.pipe(
15613
15750
  z55.object({
15614
15751
  feature_id: string4(),
15615
- enabled: z55._default(boolean2(), false)
15752
+ enabled: z55._default(boolean2(), false),
15753
+ source: optional3(ListCustomersOverageAllowedSource$inboundSchema)
15616
15754
  }),
15617
15755
  z55.transform((v) => {
15618
15756
  return remap(v, {
@@ -15902,18 +16040,34 @@ var ListEntitiesLimitType = {
15902
16040
  Absolute: "absolute",
15903
16041
  UsagePercentage: "usage_percentage"
15904
16042
  };
16043
+ var ListEntitiesSpendLimitSource = {
16044
+ Customer: "customer",
16045
+ Plan: "plan"
16046
+ };
15905
16047
  var ListEntitiesInterval = {
15906
16048
  Day: "day",
15907
16049
  Week: "week",
15908
16050
  Month: "month",
15909
16051
  Year: "year"
15910
16052
  };
16053
+ var ListEntitiesUsageLimitSource = {
16054
+ Customer: "customer",
16055
+ Plan: "plan"
16056
+ };
15911
16057
  var ListEntitiesThresholdType = {
15912
16058
  Usage: "usage",
15913
16059
  UsagePercentage: "usage_percentage",
15914
16060
  Remaining: "remaining",
15915
16061
  RemainingPercentage: "remaining_percentage"
15916
16062
  };
16063
+ var ListEntitiesUsageAlertSource = {
16064
+ Customer: "customer",
16065
+ Plan: "plan"
16066
+ };
16067
+ var ListEntitiesOverageAllowedSource = {
16068
+ Customer: "customer",
16069
+ Plan: "plan"
16070
+ };
15917
16071
  var ListEntitiesProcessorType = {
15918
16072
  Stripe: "stripe",
15919
16073
  Revenuecat: "revenuecat"
@@ -16082,13 +16236,15 @@ var ListEntitiesFlags$inboundSchema = z56.pipe(
16082
16236
  })
16083
16237
  );
16084
16238
  var ListEntitiesLimitType$inboundSchema = inboundSchema(ListEntitiesLimitType);
16239
+ var ListEntitiesSpendLimitSource$inboundSchema = inboundSchema(ListEntitiesSpendLimitSource);
16085
16240
  var ListEntitiesSpendLimit$inboundSchema = z56.pipe(
16086
16241
  z56.object({
16087
16242
  feature_id: optional3(string4()),
16088
16243
  enabled: z56._default(boolean2(), false),
16089
16244
  limit_type: optional3(ListEntitiesLimitType$inboundSchema),
16090
16245
  overage_limit: optional3(number2()),
16091
- skip_overage_billing: optional3(boolean2())
16246
+ skip_overage_billing: optional3(boolean2()),
16247
+ source: optional3(ListEntitiesSpendLimitSource$inboundSchema)
16092
16248
  }),
16093
16249
  z56.transform((v) => {
16094
16250
  return remap(v, {
@@ -16103,6 +16259,7 @@ var ListEntitiesInterval$inboundSchema = inboundSchema(ListEntitiesInterval);
16103
16259
  var ListEntitiesFilter$inboundSchema = z56.object({
16104
16260
  properties: z56.record(z56.string(), z56.any())
16105
16261
  });
16262
+ var ListEntitiesUsageLimitSource$inboundSchema = inboundSchema(ListEntitiesUsageLimitSource);
16106
16263
  var ListEntitiesUsageLimit$inboundSchema = z56.pipe(
16107
16264
  z56.object({
16108
16265
  feature_id: string4(),
@@ -16110,7 +16267,8 @@ var ListEntitiesUsageLimit$inboundSchema = z56.pipe(
16110
16267
  limit: number2(),
16111
16268
  interval: ListEntitiesInterval$inboundSchema,
16112
16269
  filter: optional3(z56.lazy(() => ListEntitiesFilter$inboundSchema)),
16113
- usage: optional3(number2())
16270
+ usage: optional3(number2()),
16271
+ source: optional3(ListEntitiesUsageLimitSource$inboundSchema)
16114
16272
  }),
16115
16273
  z56.transform((v) => {
16116
16274
  return remap(v, {
@@ -16119,13 +16277,15 @@ var ListEntitiesUsageLimit$inboundSchema = z56.pipe(
16119
16277
  })
16120
16278
  );
16121
16279
  var ListEntitiesThresholdType$inboundSchema = inboundSchema(ListEntitiesThresholdType);
16280
+ var ListEntitiesUsageAlertSource$inboundSchema = inboundSchema(ListEntitiesUsageAlertSource);
16122
16281
  var ListEntitiesUsageAlert$inboundSchema = z56.pipe(
16123
16282
  z56.object({
16124
16283
  feature_id: optional3(string4()),
16125
16284
  enabled: z56._default(boolean2(), true),
16126
16285
  threshold: number2(),
16127
16286
  threshold_type: ListEntitiesThresholdType$inboundSchema,
16128
- name: optional3(string4())
16287
+ name: optional3(string4()),
16288
+ source: optional3(ListEntitiesUsageAlertSource$inboundSchema)
16129
16289
  }),
16130
16290
  z56.transform((v) => {
16131
16291
  return remap(v, {
@@ -16134,10 +16294,12 @@ var ListEntitiesUsageAlert$inboundSchema = z56.pipe(
16134
16294
  });
16135
16295
  })
16136
16296
  );
16297
+ var ListEntitiesOverageAllowedSource$inboundSchema = inboundSchema(ListEntitiesOverageAllowedSource);
16137
16298
  var ListEntitiesOverageAllowed$inboundSchema = z56.pipe(
16138
16299
  z56.object({
16139
16300
  feature_id: string4(),
16140
- enabled: z56._default(boolean2(), false)
16301
+ enabled: z56._default(boolean2(), false),
16302
+ source: optional3(ListEntitiesOverageAllowedSource$inboundSchema)
16141
16303
  }),
16142
16304
  z56.transform((v) => {
16143
16305
  return remap(v, {
@@ -22232,7 +22394,8 @@ var UpdateBalanceParams$outboundSchema = z77.pipe(
22232
22394
  interval: z77.optional(UpdateBalanceInterval$outboundSchema),
22233
22395
  includedGrant: z77.optional(z77.number()),
22234
22396
  balanceId: z77.optional(z77.string()),
22235
- nextResetAt: z77.optional(z77.number())
22397
+ nextResetAt: z77.optional(z77.number()),
22398
+ expiresAt: z77.optional(z77.number())
22236
22399
  }),
22237
22400
  z77.transform((v) => {
22238
22401
  return remap(v, {
@@ -22242,7 +22405,8 @@ var UpdateBalanceParams$outboundSchema = z77.pipe(
22242
22405
  addToBalance: "add_to_balance",
22243
22406
  includedGrant: "included_grant",
22244
22407
  balanceId: "balance_id",
22245
- nextResetAt: "next_reset_at"
22408
+ nextResetAt: "next_reset_at",
22409
+ expiresAt: "expires_at"
22246
22410
  });
22247
22411
  })
22248
22412
  );
@@ -22290,22 +22454,42 @@ var UpdateCustomerPurchaseLimitIntervalResponse1 = {
22290
22454
  Week: "week",
22291
22455
  Month: "month"
22292
22456
  };
22457
+ var UpdateCustomerAutoTopupSource = {
22458
+ Customer: "customer",
22459
+ Plan: "plan"
22460
+ };
22293
22461
  var UpdateCustomerLimitTypeResponse = {
22294
22462
  Absolute: "absolute",
22295
22463
  UsagePercentage: "usage_percentage"
22296
22464
  };
22465
+ var UpdateCustomerSpendLimitSource = {
22466
+ Customer: "customer",
22467
+ Plan: "plan"
22468
+ };
22297
22469
  var UpdateCustomerUsageLimitIntervalResponse = {
22298
22470
  Day: "day",
22299
22471
  Week: "week",
22300
22472
  Month: "month",
22301
22473
  Year: "year"
22302
22474
  };
22475
+ var UpdateCustomerUsageLimitSource = {
22476
+ Customer: "customer",
22477
+ Plan: "plan"
22478
+ };
22303
22479
  var UpdateCustomerThresholdTypeResponse = {
22304
22480
  Usage: "usage",
22305
22481
  UsagePercentage: "usage_percentage",
22306
22482
  Remaining: "remaining",
22307
22483
  RemainingPercentage: "remaining_percentage"
22308
22484
  };
22485
+ var UpdateCustomerUsageAlertSource = {
22486
+ Customer: "customer",
22487
+ Plan: "plan"
22488
+ };
22489
+ var UpdateCustomerOverageAllowedSource = {
22490
+ Customer: "customer",
22491
+ Plan: "plan"
22492
+ };
22309
22493
  var UpdateCustomerStatus = {
22310
22494
  Active: "active",
22311
22495
  Scheduled: "scheduled"
@@ -22502,38 +22686,39 @@ var UpdateCustomerEnv$inboundSchema = inboundSchema(UpdateCustomerEnv);
22502
22686
  var UpdateCustomerPurchaseLimitIntervalResponse2$inboundSchema = inboundSchema(UpdateCustomerPurchaseLimitIntervalResponse2);
22503
22687
  var UpdateCustomerPurchaseLimitResponse2$inboundSchema = z78.pipe(
22504
22688
  z78.object({
22505
- interval: nullable(
22506
- UpdateCustomerPurchaseLimitIntervalResponse2$inboundSchema
22507
- ),
22508
- interval_count: nullable(number2()),
22509
- limit: nullable(number2()),
22510
- count: number2(),
22511
- next_reset_at: number2()
22689
+ interval: UpdateCustomerPurchaseLimitIntervalResponse2$inboundSchema,
22690
+ interval_count: z78._default(number2(), 1),
22691
+ limit: number2()
22512
22692
  }),
22513
22693
  z78.transform((v) => {
22514
22694
  return remap(v, {
22515
- "interval_count": "intervalCount",
22516
- "next_reset_at": "nextResetAt"
22695
+ "interval_count": "intervalCount"
22517
22696
  });
22518
22697
  })
22519
22698
  );
22520
22699
  var UpdateCustomerPurchaseLimitIntervalResponse1$inboundSchema = inboundSchema(UpdateCustomerPurchaseLimitIntervalResponse1);
22521
22700
  var UpdateCustomerPurchaseLimitResponse1$inboundSchema = z78.pipe(
22522
22701
  z78.object({
22523
- interval: UpdateCustomerPurchaseLimitIntervalResponse1$inboundSchema,
22524
- interval_count: z78._default(number2(), 1),
22525
- limit: number2()
22702
+ interval: nullable(
22703
+ UpdateCustomerPurchaseLimitIntervalResponse1$inboundSchema
22704
+ ),
22705
+ interval_count: nullable(number2()),
22706
+ limit: nullable(number2()),
22707
+ count: number2(),
22708
+ next_reset_at: number2()
22526
22709
  }),
22527
22710
  z78.transform((v) => {
22528
22711
  return remap(v, {
22529
- "interval_count": "intervalCount"
22712
+ "interval_count": "intervalCount",
22713
+ "next_reset_at": "nextResetAt"
22530
22714
  });
22531
22715
  })
22532
22716
  );
22533
22717
  var UpdateCustomerPurchaseLimitUnion$inboundSchema = smartUnion([
22534
- z78.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema),
22535
- z78.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema)
22718
+ z78.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema),
22719
+ z78.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema)
22536
22720
  ]);
22721
+ var UpdateCustomerAutoTopupSource$inboundSchema = inboundSchema(UpdateCustomerAutoTopupSource);
22537
22722
  var UpdateCustomerAutoTopupResponse$inboundSchema = z78.pipe(
22538
22723
  z78.object({
22539
22724
  feature_id: string4(),
@@ -22541,10 +22726,11 @@ var UpdateCustomerAutoTopupResponse$inboundSchema = z78.pipe(
22541
22726
  threshold: number2(),
22542
22727
  quantity: number2(),
22543
22728
  purchase_limit: optional3(smartUnion([
22544
- z78.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema),
22545
- z78.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema)
22729
+ z78.lazy(() => UpdateCustomerPurchaseLimitResponse1$inboundSchema),
22730
+ z78.lazy(() => UpdateCustomerPurchaseLimitResponse2$inboundSchema)
22546
22731
  ])),
22547
- invoice_mode: optional3(boolean2())
22732
+ invoice_mode: optional3(boolean2()),
22733
+ source: optional3(UpdateCustomerAutoTopupSource$inboundSchema)
22548
22734
  }),
22549
22735
  z78.transform((v) => {
22550
22736
  return remap(v, {
@@ -22555,13 +22741,15 @@ var UpdateCustomerAutoTopupResponse$inboundSchema = z78.pipe(
22555
22741
  })
22556
22742
  );
22557
22743
  var UpdateCustomerLimitTypeResponse$inboundSchema = inboundSchema(UpdateCustomerLimitTypeResponse);
22744
+ var UpdateCustomerSpendLimitSource$inboundSchema = inboundSchema(UpdateCustomerSpendLimitSource);
22558
22745
  var UpdateCustomerSpendLimitResponse$inboundSchema = z78.pipe(
22559
22746
  z78.object({
22560
22747
  feature_id: optional3(string4()),
22561
22748
  enabled: z78._default(boolean2(), false),
22562
22749
  limit_type: optional3(UpdateCustomerLimitTypeResponse$inboundSchema),
22563
22750
  overage_limit: optional3(number2()),
22564
- skip_overage_billing: optional3(boolean2())
22751
+ skip_overage_billing: optional3(boolean2()),
22752
+ source: optional3(UpdateCustomerSpendLimitSource$inboundSchema)
22565
22753
  }),
22566
22754
  z78.transform((v) => {
22567
22755
  return remap(v, {
@@ -22576,6 +22764,7 @@ var UpdateCustomerUsageLimitIntervalResponse$inboundSchema = inboundSchema(Updat
22576
22764
  var UpdateCustomerFilterResponse$inboundSchema = z78.object({
22577
22765
  properties: z78.record(z78.string(), z78.any())
22578
22766
  });
22767
+ var UpdateCustomerUsageLimitSource$inboundSchema = inboundSchema(UpdateCustomerUsageLimitSource);
22579
22768
  var UpdateCustomerUsageLimitResponse$inboundSchema = z78.pipe(
22580
22769
  z78.object({
22581
22770
  feature_id: string4(),
@@ -22585,7 +22774,8 @@ var UpdateCustomerUsageLimitResponse$inboundSchema = z78.pipe(
22585
22774
  filter: optional3(
22586
22775
  z78.lazy(() => UpdateCustomerFilterResponse$inboundSchema)
22587
22776
  ),
22588
- usage: optional3(number2())
22777
+ usage: optional3(number2()),
22778
+ source: optional3(UpdateCustomerUsageLimitSource$inboundSchema)
22589
22779
  }),
22590
22780
  z78.transform((v) => {
22591
22781
  return remap(v, {
@@ -22594,13 +22784,15 @@ var UpdateCustomerUsageLimitResponse$inboundSchema = z78.pipe(
22594
22784
  })
22595
22785
  );
22596
22786
  var UpdateCustomerThresholdTypeResponse$inboundSchema = inboundSchema(UpdateCustomerThresholdTypeResponse);
22787
+ var UpdateCustomerUsageAlertSource$inboundSchema = inboundSchema(UpdateCustomerUsageAlertSource);
22597
22788
  var UpdateCustomerUsageAlertResponse$inboundSchema = z78.pipe(
22598
22789
  z78.object({
22599
22790
  feature_id: optional3(string4()),
22600
22791
  enabled: z78._default(boolean2(), true),
22601
22792
  threshold: number2(),
22602
22793
  threshold_type: UpdateCustomerThresholdTypeResponse$inboundSchema,
22603
- name: optional3(string4())
22794
+ name: optional3(string4()),
22795
+ source: optional3(UpdateCustomerUsageAlertSource$inboundSchema)
22604
22796
  }),
22605
22797
  z78.transform((v) => {
22606
22798
  return remap(v, {
@@ -22609,10 +22801,12 @@ var UpdateCustomerUsageAlertResponse$inboundSchema = z78.pipe(
22609
22801
  });
22610
22802
  })
22611
22803
  );
22804
+ var UpdateCustomerOverageAllowedSource$inboundSchema = inboundSchema(UpdateCustomerOverageAllowedSource);
22612
22805
  var UpdateCustomerOverageAllowedResponse$inboundSchema = z78.pipe(
22613
22806
  z78.object({
22614
22807
  feature_id: string4(),
22615
- enabled: z78._default(boolean2(), false)
22808
+ enabled: z78._default(boolean2(), false),
22809
+ source: optional3(UpdateCustomerOverageAllowedSource$inboundSchema)
22616
22810
  }),
22617
22811
  z78.transform((v) => {
22618
22812
  return remap(v, {
@@ -22905,18 +23099,34 @@ var UpdateEntityLimitTypeResponse = {
22905
23099
  Absolute: "absolute",
22906
23100
  UsagePercentage: "usage_percentage"
22907
23101
  };
23102
+ var UpdateEntitySpendLimitSource = {
23103
+ Customer: "customer",
23104
+ Plan: "plan"
23105
+ };
22908
23106
  var UpdateEntityIntervalResponse = {
22909
23107
  Day: "day",
22910
23108
  Week: "week",
22911
23109
  Month: "month",
22912
23110
  Year: "year"
22913
23111
  };
23112
+ var UpdateEntityUsageLimitSource = {
23113
+ Customer: "customer",
23114
+ Plan: "plan"
23115
+ };
22914
23116
  var UpdateEntityThresholdTypeResponse = {
22915
23117
  Usage: "usage",
22916
23118
  UsagePercentage: "usage_percentage",
22917
23119
  Remaining: "remaining",
22918
23120
  RemainingPercentage: "remaining_percentage"
22919
23121
  };
23122
+ var UpdateEntityUsageAlertSource = {
23123
+ Customer: "customer",
23124
+ Plan: "plan"
23125
+ };
23126
+ var UpdateEntityOverageAllowedSource = {
23127
+ Customer: "customer",
23128
+ Plan: "plan"
23129
+ };
22920
23130
  var UpdateEntityProcessorType = {
22921
23131
  Stripe: "stripe",
22922
23132
  Revenuecat: "revenuecat"
@@ -23166,13 +23376,15 @@ var UpdateEntityFlags$inboundSchema = z79.pipe(
23166
23376
  })
23167
23377
  );
23168
23378
  var UpdateEntityLimitTypeResponse$inboundSchema = inboundSchema(UpdateEntityLimitTypeResponse);
23379
+ var UpdateEntitySpendLimitSource$inboundSchema = inboundSchema(UpdateEntitySpendLimitSource);
23169
23380
  var UpdateEntitySpendLimitResponse$inboundSchema = z79.pipe(
23170
23381
  z79.object({
23171
23382
  feature_id: optional3(string4()),
23172
23383
  enabled: z79._default(boolean2(), false),
23173
23384
  limit_type: optional3(UpdateEntityLimitTypeResponse$inboundSchema),
23174
23385
  overage_limit: optional3(number2()),
23175
- skip_overage_billing: optional3(boolean2())
23386
+ skip_overage_billing: optional3(boolean2()),
23387
+ source: optional3(UpdateEntitySpendLimitSource$inboundSchema)
23176
23388
  }),
23177
23389
  z79.transform((v) => {
23178
23390
  return remap(v, {
@@ -23187,6 +23399,7 @@ var UpdateEntityIntervalResponse$inboundSchema = inboundSchema(UpdateEntityInter
23187
23399
  var UpdateEntityFilterResponse$inboundSchema = z79.object({
23188
23400
  properties: z79.record(z79.string(), z79.any())
23189
23401
  });
23402
+ var UpdateEntityUsageLimitSource$inboundSchema = inboundSchema(UpdateEntityUsageLimitSource);
23190
23403
  var UpdateEntityUsageLimitResponse$inboundSchema = z79.pipe(
23191
23404
  z79.object({
23192
23405
  feature_id: string4(),
@@ -23196,7 +23409,8 @@ var UpdateEntityUsageLimitResponse$inboundSchema = z79.pipe(
23196
23409
  filter: optional3(
23197
23410
  z79.lazy(() => UpdateEntityFilterResponse$inboundSchema)
23198
23411
  ),
23199
- usage: optional3(number2())
23412
+ usage: optional3(number2()),
23413
+ source: optional3(UpdateEntityUsageLimitSource$inboundSchema)
23200
23414
  }),
23201
23415
  z79.transform((v) => {
23202
23416
  return remap(v, {
@@ -23205,13 +23419,15 @@ var UpdateEntityUsageLimitResponse$inboundSchema = z79.pipe(
23205
23419
  })
23206
23420
  );
23207
23421
  var UpdateEntityThresholdTypeResponse$inboundSchema = inboundSchema(UpdateEntityThresholdTypeResponse);
23422
+ var UpdateEntityUsageAlertSource$inboundSchema = inboundSchema(UpdateEntityUsageAlertSource);
23208
23423
  var UpdateEntityUsageAlertResponse$inboundSchema = z79.pipe(
23209
23424
  z79.object({
23210
23425
  feature_id: optional3(string4()),
23211
23426
  enabled: z79._default(boolean2(), true),
23212
23427
  threshold: number2(),
23213
23428
  threshold_type: UpdateEntityThresholdTypeResponse$inboundSchema,
23214
- name: optional3(string4())
23429
+ name: optional3(string4()),
23430
+ source: optional3(UpdateEntityUsageAlertSource$inboundSchema)
23215
23431
  }),
23216
23432
  z79.transform((v) => {
23217
23433
  return remap(v, {
@@ -23220,10 +23436,12 @@ var UpdateEntityUsageAlertResponse$inboundSchema = z79.pipe(
23220
23436
  });
23221
23437
  })
23222
23438
  );
23439
+ var UpdateEntityOverageAllowedSource$inboundSchema = inboundSchema(UpdateEntityOverageAllowedSource);
23223
23440
  var UpdateEntityOverageAllowedResponse$inboundSchema = z79.pipe(
23224
23441
  z79.object({
23225
23442
  feature_id: string4(),
23226
- enabled: z79._default(boolean2(), false)
23443
+ enabled: z79._default(boolean2(), false),
23444
+ source: optional3(UpdateEntityOverageAllowedSource$inboundSchema)
23227
23445
  }),
23228
23446
  z79.transform((v) => {
23229
23447
  return remap(v, {
@@ -27568,7 +27786,7 @@ var Billing = class extends ClientSDK {
27568
27786
  * @example
27569
27787
  * ```typescript
27570
27788
  * // Schedule a transition from a trial plan to a paid plan
27571
- * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1783590814052,"plans":[{"planId":"trial_plan"}]},{"startsAt":1784800414052,"plans":[{"planId":"pro_plan"}]}] });
27789
+ * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1783701939170,"plans":[{"planId":"trial_plan"}]},{"startsAt":1784911539170,"plans":[{"planId":"pro_plan"}]}] });
27572
27790
  * ```
27573
27791
  *
27574
27792
  * @param customerId - The ID of the customer to create the schedule for.