autumn-js 1.3.30 → 1.3.32

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 (98) hide show
  1. package/dist/backend/adapters/express.js +55 -43
  2. package/dist/backend/adapters/express.mjs +8 -8
  3. package/dist/backend/adapters/fetch.js +55 -43
  4. package/dist/backend/adapters/fetch.mjs +8 -8
  5. package/dist/backend/adapters/hono.js +55 -43
  6. package/dist/backend/adapters/hono.mjs +8 -8
  7. package/dist/backend/adapters/index.js +55 -43
  8. package/dist/backend/adapters/index.mjs +11 -11
  9. package/dist/backend/adapters/next.js +55 -43
  10. package/dist/backend/adapters/next.mjs +8 -8
  11. package/dist/backend/{chunk-MRFQEKBR.mjs → chunk-4ZTDDMTF.mjs} +1 -1
  12. package/dist/backend/{chunk-N4L4DLFM.mjs → chunk-6V2J4NU5.mjs} +6 -6
  13. package/dist/backend/{chunk-SAUYRKWO.mjs → chunk-GKWJ3V2B.mjs} +1 -1
  14. package/dist/backend/{chunk-OWSZPOV7.mjs → chunk-GSZMTPZW.mjs} +1 -1
  15. package/dist/backend/{chunk-QRJFDPO4.mjs → chunk-HRNHS5CH.mjs} +55 -43
  16. package/dist/backend/{chunk-SESSECCJ.mjs → chunk-LGGW6YZU.mjs} +1 -1
  17. package/dist/backend/{chunk-YFZ7FT2F.mjs → chunk-ZO23CKLL.mjs} +4 -4
  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 +55 -43
  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 +55 -43
  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 +55 -43
  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 +55 -43
  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 +55 -43
  53. package/dist/backend/index.mjs +9 -9
  54. package/dist/backend/{routeTypes-fIoCsrzJ.d.mts → routeTypes-B8u_xPju.d.mts} +52 -39
  55. package/dist/backend/{routeTypes-DoJj_pOC.d.ts → routeTypes-CmQqxy8j.d.ts} +52 -39
  56. package/dist/better-auth/{chunk-FOW6KLFG.mjs → chunk-BFT6LWQE.mjs} +55 -43
  57. package/dist/better-auth/index.js +55 -43
  58. package/dist/better-auth/index.mjs +1 -1
  59. package/dist/better-auth/utils/handleBetterAuthRoute.js +55 -43
  60. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +1 -1
  61. package/dist/better-auth/utils/index.js +55 -43
  62. package/dist/better-auth/utils/index.mjs +1 -1
  63. package/dist/react/AutumnContext.d.mts +1 -1
  64. package/dist/react/AutumnContext.d.ts +1 -1
  65. package/dist/react/client/AutumnClient.d.mts +1 -1
  66. package/dist/react/client/AutumnClient.d.ts +1 -1
  67. package/dist/react/client/IAutumnClient.d.mts +1 -1
  68. package/dist/react/client/IAutumnClient.d.ts +1 -1
  69. package/dist/react/client/index.d.mts +1 -1
  70. package/dist/react/client/index.d.ts +1 -1
  71. package/dist/react/hooks/index.d.mts +1 -1
  72. package/dist/react/hooks/index.d.ts +1 -1
  73. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +1 -1
  74. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +1 -1
  75. package/dist/react/hooks/internal/useCustomerActions.d.mts +1 -1
  76. package/dist/react/hooks/internal/useCustomerActions.d.ts +1 -1
  77. package/dist/react/hooks/useAggregateEvents.d.mts +1 -1
  78. package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
  79. package/dist/react/hooks/useCustomer.d.mts +1 -1
  80. package/dist/react/hooks/useCustomer.d.ts +1 -1
  81. package/dist/react/hooks/useEntity.d.mts +1 -1
  82. package/dist/react/hooks/useEntity.d.ts +1 -1
  83. package/dist/react/hooks/useListEvents.d.mts +1 -1
  84. package/dist/react/hooks/useListEvents.d.ts +1 -1
  85. package/dist/react/hooks/useListPlans.d.mts +1 -1
  86. package/dist/react/hooks/useListPlans.d.ts +1 -1
  87. package/dist/react/hooks/useReferrals.d.mts +1 -1
  88. package/dist/react/hooks/useReferrals.d.ts +1 -1
  89. package/dist/react/index.d.mts +1 -1
  90. package/dist/react/index.d.ts +1 -1
  91. package/dist/react/{params-k6ijFeOE.d.ts → params-DP6BNkc0.d.ts} +2 -2
  92. package/dist/react/{params-Yk7M-n-7.d.mts → params-DZznA-no.d.mts} +2 -2
  93. package/dist/sdk/index.d.mts +66 -65
  94. package/dist/sdk/index.d.ts +66 -65
  95. package/dist/sdk/index.js +78 -58
  96. package/dist/sdk/index.mjs +73 -53
  97. package/package.json +2 -2
  98. package/dist/backend/{chunk-IXUCY7AU.mjs → chunk-MOHYGUMA.mjs} +3 -3
@@ -3408,20 +3408,6 @@ declare const BatchTrackOverageBehavior: {
3408
3408
  * How to handle usage that exceeds the available balance. "cap" (default) deducts only what fits, stopping at zero. "overflow" deducts the full value: the balance can go negative and usage limits do not clamp the deduction, though spend limits still apply.
3409
3409
  */
3410
3410
  type BatchTrackOverageBehavior = ClosedEnum<typeof BatchTrackOverageBehavior>;
3411
- type BatchTrackLock = {
3412
- /**
3413
- * A unique identifier for this lock. Used to finalize the lock later via balances.finalize.
3414
- */
3415
- lockId: string;
3416
- /**
3417
- * Must be true to enable locking.
3418
- */
3419
- enabled: true;
3420
- /**
3421
- * Unix timestamp (ms) when the lock automatically expires and releases the held balance.
3422
- */
3423
- expiresAt?: number | undefined;
3424
- };
3425
3411
  type RequestBody = {
3426
3412
  /**
3427
3413
  * The ID of the customer.
@@ -3465,7 +3451,6 @@ type RequestBody = {
3465
3451
  * If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
3466
3452
  */
3467
3453
  async?: boolean | undefined;
3468
- lock?: BatchTrackLock | undefined;
3469
3454
  };
3470
3455
  /**
3471
3456
  * Batch accepted. All items passed synchronous validation. Enqueue is best-effort: partial failures (some items enqueued, some not) are logged server-side and are NOT surfaced in the response body; clients must not retry on success. See the endpoint description for full partial-failure semantics.
@@ -5908,7 +5893,7 @@ type CheckOverageBehavior = ClosedEnum<typeof CheckOverageBehavior>;
5908
5893
  /**
5909
5894
  * Reserve units of a feature upfront by passing a lock_id, then call balances.finalize to confirm or release the hold.
5910
5895
  */
5911
- type CheckLock = {
5896
+ type Lock = {
5912
5897
  /**
5913
5898
  * A unique identifier for this lock. Used to finalize the lock later via balances.finalize.
5914
5899
  */
@@ -5956,7 +5941,7 @@ type CheckParams = {
5956
5941
  /**
5957
5942
  * Reserve units of a feature upfront by passing a lock_id, then call balances.finalize to confirm or release the hold.
5958
5943
  */
5959
- lock?: CheckLock | undefined;
5944
+ lock?: Lock | undefined;
5960
5945
  /**
5961
5946
  * If true, includes upgrade/upsell information in the response when access is denied. Useful for displaying paywalls.
5962
5947
  */
@@ -45589,9 +45574,48 @@ type PreviewSyncWebhooksWebhookRequest = {
45589
45574
  };
45590
45575
  type PreviewSyncWebhooksSyncWebhooksParams = {
45591
45576
  /**
45592
- * The webhooks to create or update. Webhooks not listed are left alone; nothing is deleted.
45577
+ * The webhooks to create or update. Webhooks not listed are left alone unless `skip_deletions` is false.
45593
45578
  */
45594
45579
  webhooks: Array<PreviewSyncWebhooksWebhookRequest>;
45580
+ /**
45581
+ * When false, `webhooks` is the environment's complete set: every webhook not listed is deleted, including ones made in the dashboard. Defaults true, which leaves unlisted webhooks alone.
45582
+ */
45583
+ skipDeletions?: boolean | undefined;
45584
+ };
45585
+ type ChangeWebhook3 = {
45586
+ /**
45587
+ * The webhook's ID. Webhooks made in the dashboard show their `ep_…` ID.
45588
+ */
45589
+ id: string;
45590
+ /**
45591
+ * The URL Autumn sends events to.
45592
+ */
45593
+ url: string;
45594
+ /**
45595
+ * A note for your own reference.
45596
+ */
45597
+ description: string | null;
45598
+ /**
45599
+ * The events sent to this webhook, as `WebhookEventType` names; a type newer than your client is returned as-is. Empty means the webhook receives every event.
45600
+ */
45601
+ events: Array<string>;
45602
+ /**
45603
+ * When true, no events are sent to the webhook.
45604
+ */
45605
+ disabled: boolean;
45606
+ /**
45607
+ * When the webhook was created, ms since epoch.
45608
+ */
45609
+ createdAt: number;
45610
+ /**
45611
+ * When the webhook was last changed, ms since epoch.
45612
+ */
45613
+ updatedAt: number;
45614
+ };
45615
+ type Change5 = {
45616
+ action: "delete";
45617
+ id: string;
45618
+ webhook: ChangeWebhook3;
45595
45619
  };
45596
45620
  type ChangeWebhook2 = {
45597
45621
  /**
@@ -45804,9 +45828,9 @@ type PreviewSyncWebhooksError = {
45804
45828
  */
45805
45829
  type PreviewSyncWebhooksResponse = {
45806
45830
  /**
45807
- * What `webhooks.sync` would do. `adopt` takes over a webhook made in the dashboard with the same URL, keeping its signing secret. `unmanaged` webhooks exist but aren't listed, so sync leaves them alone.
45831
+ * What `webhooks.sync` would do. `adopt` takes over a webhook made in the dashboard with the same URL, keeping its signing secret. `unmanaged` webhooks exist but aren't listed, so sync leaves them alone. `delete` webhooks aren't listed and `skip_deletions` is false, so sync deletes them.
45808
45832
  */
45809
- changes: Array<Change1 | Change2 | Change3 | Change4 | Unknown<"action">>;
45833
+ changes: Array<Change1 | Change2 | Change3 | Change4 | Change5 | Unknown<"action">>;
45810
45834
  /**
45811
45835
  * Listed webhooks `webhooks.sync` would refuse, e.g. when several dashboard webhooks share the URL.
45812
45836
  */
@@ -52145,9 +52169,13 @@ type SyncWebhooksWebhookRequest = {
52145
52169
  };
52146
52170
  type SyncWebhooksSyncWebhooksParams = {
52147
52171
  /**
52148
- * The webhooks to create or update. Webhooks not listed are left alone; nothing is deleted.
52172
+ * The webhooks to create or update. Webhooks not listed are left alone unless `skip_deletions` is false.
52149
52173
  */
52150
52174
  webhooks: Array<SyncWebhooksWebhookRequest>;
52175
+ /**
52176
+ * When false, `webhooks` is the environment's complete set: every webhook not listed is deleted, including ones made in the dashboard. Defaults true, which leaves unlisted webhooks alone.
52177
+ */
52178
+ skipDeletions?: boolean | undefined;
52151
52179
  };
52152
52180
  type SyncWebhooksWebhookResponse = {
52153
52181
  /**
@@ -52203,7 +52231,7 @@ type SyncWebhooksResponse = {
52203
52231
  */
52204
52232
  secrets: Array<Secret>;
52205
52233
  /**
52206
- * Webhooks that couldn't be created or updated. The others were still applied; the request fails only when none could be.
52234
+ * Webhooks that couldn't be created, updated or deleted. The others were still applied; the request fails only when none could be.
52207
52235
  */
52208
52236
  errors: Array<SyncWebhooksError>;
52209
52237
  };
@@ -52219,20 +52247,6 @@ declare const TrackOverageBehavior: {
52219
52247
  * How to handle usage that exceeds the available balance. "cap" (default) deducts only what fits, stopping at zero. "overflow" deducts the full value: the balance can go negative and usage limits do not clamp the deduction, though spend limits still apply.
52220
52248
  */
52221
52249
  type TrackOverageBehavior = ClosedEnum<typeof TrackOverageBehavior>;
52222
- type TrackLock = {
52223
- /**
52224
- * A unique identifier for this lock. Used to finalize the lock later via balances.finalize.
52225
- */
52226
- lockId: string;
52227
- /**
52228
- * Must be true to enable locking.
52229
- */
52230
- enabled: true;
52231
- /**
52232
- * Unix timestamp (ms) when the lock automatically expires and releases the held balance.
52233
- */
52234
- expiresAt?: number | undefined;
52235
- };
52236
52250
  type TrackParams = {
52237
52251
  /**
52238
52252
  * The ID of the customer.
@@ -52272,7 +52286,6 @@ type TrackParams = {
52272
52286
  * If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
52273
52287
  */
52274
52288
  async?: boolean | undefined;
52275
- lock?: TrackLock | undefined;
52276
52289
  };
52277
52290
  declare const TrackIntervalEnum2: {
52278
52291
  readonly OneOff: "one_off";
@@ -64387,11 +64400,11 @@ declare class Webhooks extends ClientSDK {
64387
64400
  */
64388
64401
  delete(request: DeleteWebhookParams, options?: RequestOptions): Promise<DeleteWebhookResponse>;
64389
64402
  /**
64390
- * Shows what `webhooks.sync` would do with the same body, without changing anything: which webhooks it would create or update, and which existing ones it would leave alone because the body doesn't list them.
64403
+ * Shows what `webhooks.sync` would do with the same body, without changing anything: which webhooks it would create, update or delete, and which existing ones it would leave alone because the body doesn't list them.
64391
64404
  */
64392
64405
  previewSync(request: PreviewSyncWebhooksSyncWebhooksParams, options?: RequestOptions): Promise<PreviewSyncWebhooksResponse>;
64393
64406
  /**
64394
- * Makes the listed webhooks exist as described: creates missing ones and updates ones that differ. Webhooks not listed are left alone — sync never deletes. Returns the signing secret of each webhook it created, once. Each webhook is applied on its own: failures are listed in `errors` while the rest still apply, and the request fails only when none could be applied.
64407
+ * Makes the listed webhooks exist as described: creates missing ones and updates ones that differ. Webhooks not listed are left alone, unless `skip_deletions` is false: then every webhook not listed is deleted, including ones made in the dashboard. Returns the signing secret of each webhook it created, once. Each webhook is applied on its own: failures are listed in `errors` while the rest still apply, and the request fails only when none could be applied.
64395
64408
  */
64396
64409
  sync(request: SyncWebhooksSyncWebhooksParams, options?: RequestOptions): Promise<SyncWebhooksResponse>;
64397
64410
  }
@@ -3408,20 +3408,6 @@ declare const BatchTrackOverageBehavior: {
3408
3408
  * How to handle usage that exceeds the available balance. "cap" (default) deducts only what fits, stopping at zero. "overflow" deducts the full value: the balance can go negative and usage limits do not clamp the deduction, though spend limits still apply.
3409
3409
  */
3410
3410
  type BatchTrackOverageBehavior = ClosedEnum<typeof BatchTrackOverageBehavior>;
3411
- type BatchTrackLock = {
3412
- /**
3413
- * A unique identifier for this lock. Used to finalize the lock later via balances.finalize.
3414
- */
3415
- lockId: string;
3416
- /**
3417
- * Must be true to enable locking.
3418
- */
3419
- enabled: true;
3420
- /**
3421
- * Unix timestamp (ms) when the lock automatically expires and releases the held balance.
3422
- */
3423
- expiresAt?: number | undefined;
3424
- };
3425
3411
  type RequestBody = {
3426
3412
  /**
3427
3413
  * The ID of the customer.
@@ -3465,7 +3451,6 @@ type RequestBody = {
3465
3451
  * If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
3466
3452
  */
3467
3453
  async?: boolean | undefined;
3468
- lock?: BatchTrackLock | undefined;
3469
3454
  };
3470
3455
  /**
3471
3456
  * Batch accepted. All items passed synchronous validation. Enqueue is best-effort: partial failures (some items enqueued, some not) are logged server-side and are NOT surfaced in the response body; clients must not retry on success. See the endpoint description for full partial-failure semantics.
@@ -5908,7 +5893,7 @@ type CheckOverageBehavior = ClosedEnum<typeof CheckOverageBehavior>;
5908
5893
  /**
5909
5894
  * Reserve units of a feature upfront by passing a lock_id, then call balances.finalize to confirm or release the hold.
5910
5895
  */
5911
- type CheckLock = {
5896
+ type Lock = {
5912
5897
  /**
5913
5898
  * A unique identifier for this lock. Used to finalize the lock later via balances.finalize.
5914
5899
  */
@@ -5956,7 +5941,7 @@ type CheckParams = {
5956
5941
  /**
5957
5942
  * Reserve units of a feature upfront by passing a lock_id, then call balances.finalize to confirm or release the hold.
5958
5943
  */
5959
- lock?: CheckLock | undefined;
5944
+ lock?: Lock | undefined;
5960
5945
  /**
5961
5946
  * If true, includes upgrade/upsell information in the response when access is denied. Useful for displaying paywalls.
5962
5947
  */
@@ -45589,9 +45574,48 @@ type PreviewSyncWebhooksWebhookRequest = {
45589
45574
  };
45590
45575
  type PreviewSyncWebhooksSyncWebhooksParams = {
45591
45576
  /**
45592
- * The webhooks to create or update. Webhooks not listed are left alone; nothing is deleted.
45577
+ * The webhooks to create or update. Webhooks not listed are left alone unless `skip_deletions` is false.
45593
45578
  */
45594
45579
  webhooks: Array<PreviewSyncWebhooksWebhookRequest>;
45580
+ /**
45581
+ * When false, `webhooks` is the environment's complete set: every webhook not listed is deleted, including ones made in the dashboard. Defaults true, which leaves unlisted webhooks alone.
45582
+ */
45583
+ skipDeletions?: boolean | undefined;
45584
+ };
45585
+ type ChangeWebhook3 = {
45586
+ /**
45587
+ * The webhook's ID. Webhooks made in the dashboard show their `ep_…` ID.
45588
+ */
45589
+ id: string;
45590
+ /**
45591
+ * The URL Autumn sends events to.
45592
+ */
45593
+ url: string;
45594
+ /**
45595
+ * A note for your own reference.
45596
+ */
45597
+ description: string | null;
45598
+ /**
45599
+ * The events sent to this webhook, as `WebhookEventType` names; a type newer than your client is returned as-is. Empty means the webhook receives every event.
45600
+ */
45601
+ events: Array<string>;
45602
+ /**
45603
+ * When true, no events are sent to the webhook.
45604
+ */
45605
+ disabled: boolean;
45606
+ /**
45607
+ * When the webhook was created, ms since epoch.
45608
+ */
45609
+ createdAt: number;
45610
+ /**
45611
+ * When the webhook was last changed, ms since epoch.
45612
+ */
45613
+ updatedAt: number;
45614
+ };
45615
+ type Change5 = {
45616
+ action: "delete";
45617
+ id: string;
45618
+ webhook: ChangeWebhook3;
45595
45619
  };
45596
45620
  type ChangeWebhook2 = {
45597
45621
  /**
@@ -45804,9 +45828,9 @@ type PreviewSyncWebhooksError = {
45804
45828
  */
45805
45829
  type PreviewSyncWebhooksResponse = {
45806
45830
  /**
45807
- * What `webhooks.sync` would do. `adopt` takes over a webhook made in the dashboard with the same URL, keeping its signing secret. `unmanaged` webhooks exist but aren't listed, so sync leaves them alone.
45831
+ * What `webhooks.sync` would do. `adopt` takes over a webhook made in the dashboard with the same URL, keeping its signing secret. `unmanaged` webhooks exist but aren't listed, so sync leaves them alone. `delete` webhooks aren't listed and `skip_deletions` is false, so sync deletes them.
45808
45832
  */
45809
- changes: Array<Change1 | Change2 | Change3 | Change4 | Unknown<"action">>;
45833
+ changes: Array<Change1 | Change2 | Change3 | Change4 | Change5 | Unknown<"action">>;
45810
45834
  /**
45811
45835
  * Listed webhooks `webhooks.sync` would refuse, e.g. when several dashboard webhooks share the URL.
45812
45836
  */
@@ -52145,9 +52169,13 @@ type SyncWebhooksWebhookRequest = {
52145
52169
  };
52146
52170
  type SyncWebhooksSyncWebhooksParams = {
52147
52171
  /**
52148
- * The webhooks to create or update. Webhooks not listed are left alone; nothing is deleted.
52172
+ * The webhooks to create or update. Webhooks not listed are left alone unless `skip_deletions` is false.
52149
52173
  */
52150
52174
  webhooks: Array<SyncWebhooksWebhookRequest>;
52175
+ /**
52176
+ * When false, `webhooks` is the environment's complete set: every webhook not listed is deleted, including ones made in the dashboard. Defaults true, which leaves unlisted webhooks alone.
52177
+ */
52178
+ skipDeletions?: boolean | undefined;
52151
52179
  };
52152
52180
  type SyncWebhooksWebhookResponse = {
52153
52181
  /**
@@ -52203,7 +52231,7 @@ type SyncWebhooksResponse = {
52203
52231
  */
52204
52232
  secrets: Array<Secret>;
52205
52233
  /**
52206
- * Webhooks that couldn't be created or updated. The others were still applied; the request fails only when none could be.
52234
+ * Webhooks that couldn't be created, updated or deleted. The others were still applied; the request fails only when none could be.
52207
52235
  */
52208
52236
  errors: Array<SyncWebhooksError>;
52209
52237
  };
@@ -52219,20 +52247,6 @@ declare const TrackOverageBehavior: {
52219
52247
  * How to handle usage that exceeds the available balance. "cap" (default) deducts only what fits, stopping at zero. "overflow" deducts the full value: the balance can go negative and usage limits do not clamp the deduction, though spend limits still apply.
52220
52248
  */
52221
52249
  type TrackOverageBehavior = ClosedEnum<typeof TrackOverageBehavior>;
52222
- type TrackLock = {
52223
- /**
52224
- * A unique identifier for this lock. Used to finalize the lock later via balances.finalize.
52225
- */
52226
- lockId: string;
52227
- /**
52228
- * Must be true to enable locking.
52229
- */
52230
- enabled: true;
52231
- /**
52232
- * Unix timestamp (ms) when the lock automatically expires and releases the held balance.
52233
- */
52234
- expiresAt?: number | undefined;
52235
- };
52236
52250
  type TrackParams = {
52237
52251
  /**
52238
52252
  * The ID of the customer.
@@ -52272,7 +52286,6 @@ type TrackParams = {
52272
52286
  * If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
52273
52287
  */
52274
52288
  async?: boolean | undefined;
52275
- lock?: TrackLock | undefined;
52276
52289
  };
52277
52290
  declare const TrackIntervalEnum2: {
52278
52291
  readonly OneOff: "one_off";
@@ -64387,11 +64400,11 @@ declare class Webhooks extends ClientSDK {
64387
64400
  */
64388
64401
  delete(request: DeleteWebhookParams, options?: RequestOptions): Promise<DeleteWebhookResponse>;
64389
64402
  /**
64390
- * Shows what `webhooks.sync` would do with the same body, without changing anything: which webhooks it would create or update, and which existing ones it would leave alone because the body doesn't list them.
64403
+ * Shows what `webhooks.sync` would do with the same body, without changing anything: which webhooks it would create, update or delete, and which existing ones it would leave alone because the body doesn't list them.
64391
64404
  */
64392
64405
  previewSync(request: PreviewSyncWebhooksSyncWebhooksParams, options?: RequestOptions): Promise<PreviewSyncWebhooksResponse>;
64393
64406
  /**
64394
- * Makes the listed webhooks exist as described: creates missing ones and updates ones that differ. Webhooks not listed are left alone — sync never deletes. Returns the signing secret of each webhook it created, once. Each webhook is applied on its own: failures are listed in `errors` while the rest still apply, and the request fails only when none could be applied.
64407
+ * Makes the listed webhooks exist as described: creates missing ones and updates ones that differ. Webhooks not listed are left alone, unless `skip_deletions` is false: then every webhook not listed is deleted, including ones made in the dashboard. Returns the signing secret of each webhook it created, once. Each webhook is applied on its own: failures are listed in `errors` while the rest still apply, and the request fails only when none could be applied.
64395
64408
  */
64396
64409
  sync(request: SyncWebhooksSyncWebhooksParams, options?: RequestOptions): Promise<SyncWebhooksResponse>;
64397
64410
  }
@@ -4096,19 +4096,6 @@ var BatchTrackOverageBehavior = {
4096
4096
  Overflow: "overflow"
4097
4097
  };
4098
4098
  var BatchTrackOverageBehavior$outboundSchema = z16.enum(BatchTrackOverageBehavior);
4099
- var BatchTrackLock$outboundSchema = z16.pipe(
4100
- z16.object({
4101
- lockId: z16.string(),
4102
- enabled: z16.literal(true),
4103
- expiresAt: z16.optional(z16.number())
4104
- }),
4105
- z16.transform((v) => {
4106
- return remap(v, {
4107
- lockId: "lock_id",
4108
- expiresAt: "expires_at"
4109
- });
4110
- })
4111
- );
4112
4099
  var RequestBody$outboundSchema = z16.pipe(
4113
4100
  z16.object({
4114
4101
  customerId: z16.string(),
@@ -4120,8 +4107,7 @@ var RequestBody$outboundSchema = z16.pipe(
4120
4107
  idempotencyKey: z16.optional(z16.string()),
4121
4108
  timestamp: z16.optional(z16.int()),
4122
4109
  overageBehavior: z16.optional(BatchTrackOverageBehavior$outboundSchema),
4123
- async: z16.optional(z16.boolean()),
4124
- lock: z16.optional(z16.lazy(() => BatchTrackLock$outboundSchema))
4110
+ async: z16.optional(z16.boolean())
4125
4111
  }),
4126
4112
  z16.transform((v) => {
4127
4113
  return remap(v, {
@@ -6510,7 +6496,7 @@ var ProductScenario1 = {
6510
6496
  PastDue: "past_due"
6511
6497
  };
6512
6498
  var CheckOverageBehavior$outboundSchema = z19.enum(CheckOverageBehavior);
6513
- var CheckLock$outboundSchema = z19.pipe(
6499
+ var Lock$outboundSchema = z19.pipe(
6514
6500
  z19.object({
6515
6501
  lockId: z19.string(),
6516
6502
  enabled: z19.literal(true),
@@ -6533,7 +6519,7 @@ var CheckParams$outboundSchema = z19.pipe(
6533
6519
  requiredBalance: z19.optional(z19.number()),
6534
6520
  properties: z19.optional(z19.record(z19.string(), z19.any())),
6535
6521
  sendEvent: z19.optional(z19.boolean()),
6536
- lock: z19.optional(z19.lazy(() => CheckLock$outboundSchema)),
6522
+ lock: z19.optional(z19.lazy(() => Lock$outboundSchema)),
6537
6523
  withPreview: z19.optional(z19.boolean())
6538
6524
  }),
6539
6525
  z19.transform((v) => {
@@ -38995,10 +38981,40 @@ var PreviewSyncWebhooksWebhookRequest$outboundSchema = z88.object({
38995
38981
  description: z88.optional(z88.string()),
38996
38982
  disabled: z88.optional(z88.boolean())
38997
38983
  });
38998
- var PreviewSyncWebhooksSyncWebhooksParams$outboundSchema = z88.object({
38999
- webhooks: z88.array(
39000
- z88.lazy(() => PreviewSyncWebhooksWebhookRequest$outboundSchema)
39001
- )
38984
+ var PreviewSyncWebhooksSyncWebhooksParams$outboundSchema = z88.pipe(
38985
+ z88.object({
38986
+ webhooks: z88.array(
38987
+ z88.lazy(() => PreviewSyncWebhooksWebhookRequest$outboundSchema)
38988
+ ),
38989
+ skipDeletions: z88._default(z88.boolean(), true)
38990
+ }),
38991
+ z88.transform((v) => {
38992
+ return remap(v, {
38993
+ skipDeletions: "skip_deletions"
38994
+ });
38995
+ })
38996
+ );
38997
+ var ChangeWebhook3$inboundSchema = z88.pipe(
38998
+ z88.object({
38999
+ id: string5(),
39000
+ url: string5(),
39001
+ description: nullable(string5()),
39002
+ events: z88.array(string5()),
39003
+ disabled: boolean2(),
39004
+ created_at: number2(),
39005
+ updated_at: number2()
39006
+ }),
39007
+ z88.transform((v) => {
39008
+ return remap(v, {
39009
+ "created_at": "createdAt",
39010
+ "updated_at": "updatedAt"
39011
+ });
39012
+ })
39013
+ );
39014
+ var Change5$inboundSchema = z88.object({
39015
+ action: literal3("delete"),
39016
+ id: string5(),
39017
+ webhook: z88.lazy(() => ChangeWebhook3$inboundSchema)
39002
39018
  });
39003
39019
  var ChangeWebhook2$inboundSchema = z88.pipe(
39004
39020
  z88.object({
@@ -39128,7 +39144,8 @@ var ChangeUnion$inboundSchema = discriminatedUnion("action", {
39128
39144
  create: z88.lazy(() => Change1$inboundSchema),
39129
39145
  update: z88.lazy(() => Change2$inboundSchema),
39130
39146
  adopt: z88.lazy(() => Change3$inboundSchema),
39131
- unmanaged: z88.lazy(() => Change4$inboundSchema)
39147
+ unmanaged: z88.lazy(() => Change4$inboundSchema),
39148
+ delete: z88.lazy(() => Change5$inboundSchema)
39132
39149
  });
39133
39150
  var PreviewSyncWebhooksError$inboundSchema = z88.object({
39134
39151
  id: string5(),
@@ -39139,7 +39156,8 @@ var PreviewSyncWebhooksResponse$inboundSchema = z88.object({
39139
39156
  create: z88.lazy(() => Change1$inboundSchema),
39140
39157
  update: z88.lazy(() => Change2$inboundSchema),
39141
39158
  adopt: z88.lazy(() => Change3$inboundSchema),
39142
- unmanaged: z88.lazy(() => Change4$inboundSchema)
39159
+ unmanaged: z88.lazy(() => Change4$inboundSchema),
39160
+ delete: z88.lazy(() => Change5$inboundSchema)
39143
39161
  })),
39144
39162
  errors: z88.array(z88.lazy(() => PreviewSyncWebhooksError$inboundSchema))
39145
39163
  });
@@ -44661,9 +44679,17 @@ var SyncWebhooksWebhookRequest$outboundSchema = z102.object({
44661
44679
  description: z102.optional(z102.string()),
44662
44680
  disabled: z102.optional(z102.boolean())
44663
44681
  });
44664
- var SyncWebhooksSyncWebhooksParams$outboundSchema = z102.object({
44665
- webhooks: z102.array(z102.lazy(() => SyncWebhooksWebhookRequest$outboundSchema))
44666
- });
44682
+ var SyncWebhooksSyncWebhooksParams$outboundSchema = z102.pipe(
44683
+ z102.object({
44684
+ webhooks: z102.array(z102.lazy(() => SyncWebhooksWebhookRequest$outboundSchema)),
44685
+ skipDeletions: z102._default(z102.boolean(), true)
44686
+ }),
44687
+ z102.transform((v) => {
44688
+ return remap(v, {
44689
+ skipDeletions: "skip_deletions"
44690
+ });
44691
+ })
44692
+ );
44667
44693
  var SyncWebhooksWebhookResponse$inboundSchema = z102.pipe(
44668
44694
  z102.object({
44669
44695
  id: string5(),
@@ -44724,19 +44750,6 @@ var TrackIntervalEnum1 = {
44724
44750
  Year: "year"
44725
44751
  };
44726
44752
  var TrackOverageBehavior$outboundSchema = z103.enum(TrackOverageBehavior);
44727
- var TrackLock$outboundSchema = z103.pipe(
44728
- z103.object({
44729
- lockId: z103.string(),
44730
- enabled: z103.literal(true),
44731
- expiresAt: z103.optional(z103.number())
44732
- }),
44733
- z103.transform((v) => {
44734
- return remap(v, {
44735
- lockId: "lock_id",
44736
- expiresAt: "expires_at"
44737
- });
44738
- })
44739
- );
44740
44753
  var TrackParams$outboundSchema = z103.pipe(
44741
44754
  z103.object({
44742
44755
  customerId: z103.string(),
@@ -44747,8 +44760,7 @@ var TrackParams$outboundSchema = z103.pipe(
44747
44760
  properties: z103.optional(z103.record(z103.string(), z103.any())),
44748
44761
  timestamp: z103.optional(z103.int()),
44749
44762
  overageBehavior: z103.optional(TrackOverageBehavior$outboundSchema),
44750
- async: z103.optional(z103.boolean()),
44751
- lock: z103.optional(z103.lazy(() => TrackLock$outboundSchema))
44763
+ async: z103.optional(z103.boolean())
44752
44764
  }),
44753
44765
  z103.transform((v) => {
44754
44766
  return remap(v, {
@@ -62804,7 +62816,7 @@ var Webhooks = class extends ClientSDK {
62804
62816
  ));
62805
62817
  }
62806
62818
  /**
62807
- * Shows what `webhooks.sync` would do with the same body, without changing anything: which webhooks it would create or update, and which existing ones it would leave alone because the body doesn't list them.
62819
+ * Shows what `webhooks.sync` would do with the same body, without changing anything: which webhooks it would create, update or delete, and which existing ones it would leave alone because the body doesn't list them.
62808
62820
  */
62809
62821
  async previewSync(request, options) {
62810
62822
  return unwrapAsync(webhooksPreviewSync(
@@ -62814,7 +62826,7 @@ var Webhooks = class extends ClientSDK {
62814
62826
  ));
62815
62827
  }
62816
62828
  /**
62817
- * Makes the listed webhooks exist as described: creates missing ones and updates ones that differ. Webhooks not listed are left alone — sync never deletes. Returns the signing secret of each webhook it created, once. Each webhook is applied on its own: failures are listed in `errors` while the rest still apply, and the request fails only when none could be applied.
62829
+ * Makes the listed webhooks exist as described: creates missing ones and updates ones that differ. Webhooks not listed are left alone, unless `skip_deletions` is false: then every webhook not listed is deleted, including ones made in the dashboard. Returns the signing secret of each webhook it created, once. Each webhook is applied on its own: failures are listed in `errors` while the rest still apply, and the request fails only when none could be applied.
62818
62830
  */
62819
62831
  async sync(request, options) {
62820
62832
  return unwrapAsync(webhooksSync(