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
@@ -4117,19 +4117,6 @@ var BatchTrackOverageBehavior = {
4117
4117
  Overflow: "overflow"
4118
4118
  };
4119
4119
  var BatchTrackOverageBehavior$outboundSchema = z16.enum(BatchTrackOverageBehavior);
4120
- var BatchTrackLock$outboundSchema = z16.pipe(
4121
- z16.object({
4122
- lockId: z16.string(),
4123
- enabled: z16.literal(true),
4124
- expiresAt: z16.optional(z16.number())
4125
- }),
4126
- z16.transform((v) => {
4127
- return remap(v, {
4128
- lockId: "lock_id",
4129
- expiresAt: "expires_at"
4130
- });
4131
- })
4132
- );
4133
4120
  var RequestBody$outboundSchema = z16.pipe(
4134
4121
  z16.object({
4135
4122
  customerId: z16.string(),
@@ -4141,8 +4128,7 @@ var RequestBody$outboundSchema = z16.pipe(
4141
4128
  idempotencyKey: z16.optional(z16.string()),
4142
4129
  timestamp: z16.optional(z16.int()),
4143
4130
  overageBehavior: z16.optional(BatchTrackOverageBehavior$outboundSchema),
4144
- async: z16.optional(z16.boolean()),
4145
- lock: z16.optional(z16.lazy(() => BatchTrackLock$outboundSchema))
4131
+ async: z16.optional(z16.boolean())
4146
4132
  }),
4147
4133
  z16.transform((v) => {
4148
4134
  return remap(v, {
@@ -6531,7 +6517,7 @@ var ProductScenario1 = {
6531
6517
  PastDue: "past_due"
6532
6518
  };
6533
6519
  var CheckOverageBehavior$outboundSchema = z19.enum(CheckOverageBehavior);
6534
- var CheckLock$outboundSchema = z19.pipe(
6520
+ var Lock$outboundSchema = z19.pipe(
6535
6521
  z19.object({
6536
6522
  lockId: z19.string(),
6537
6523
  enabled: z19.literal(true),
@@ -6554,7 +6540,7 @@ var CheckParams$outboundSchema = z19.pipe(
6554
6540
  requiredBalance: z19.optional(z19.number()),
6555
6541
  properties: z19.optional(z19.record(z19.string(), z19.any())),
6556
6542
  sendEvent: z19.optional(z19.boolean()),
6557
- lock: z19.optional(z19.lazy(() => CheckLock$outboundSchema)),
6543
+ lock: z19.optional(z19.lazy(() => Lock$outboundSchema)),
6558
6544
  withPreview: z19.optional(z19.boolean())
6559
6545
  }),
6560
6546
  z19.transform((v) => {
@@ -39016,10 +39002,40 @@ var PreviewSyncWebhooksWebhookRequest$outboundSchema = z88.object({
39016
39002
  description: z88.optional(z88.string()),
39017
39003
  disabled: z88.optional(z88.boolean())
39018
39004
  });
39019
- var PreviewSyncWebhooksSyncWebhooksParams$outboundSchema = z88.object({
39020
- webhooks: z88.array(
39021
- z88.lazy(() => PreviewSyncWebhooksWebhookRequest$outboundSchema)
39022
- )
39005
+ var PreviewSyncWebhooksSyncWebhooksParams$outboundSchema = z88.pipe(
39006
+ z88.object({
39007
+ webhooks: z88.array(
39008
+ z88.lazy(() => PreviewSyncWebhooksWebhookRequest$outboundSchema)
39009
+ ),
39010
+ skipDeletions: z88._default(z88.boolean(), true)
39011
+ }),
39012
+ z88.transform((v) => {
39013
+ return remap(v, {
39014
+ skipDeletions: "skip_deletions"
39015
+ });
39016
+ })
39017
+ );
39018
+ var ChangeWebhook3$inboundSchema = z88.pipe(
39019
+ z88.object({
39020
+ id: string5(),
39021
+ url: string5(),
39022
+ description: nullable(string5()),
39023
+ events: z88.array(string5()),
39024
+ disabled: boolean2(),
39025
+ created_at: number2(),
39026
+ updated_at: number2()
39027
+ }),
39028
+ z88.transform((v) => {
39029
+ return remap(v, {
39030
+ "created_at": "createdAt",
39031
+ "updated_at": "updatedAt"
39032
+ });
39033
+ })
39034
+ );
39035
+ var Change5$inboundSchema = z88.object({
39036
+ action: literal3("delete"),
39037
+ id: string5(),
39038
+ webhook: z88.lazy(() => ChangeWebhook3$inboundSchema)
39023
39039
  });
39024
39040
  var ChangeWebhook2$inboundSchema = z88.pipe(
39025
39041
  z88.object({
@@ -39149,7 +39165,8 @@ var ChangeUnion$inboundSchema = discriminatedUnion("action", {
39149
39165
  create: z88.lazy(() => Change1$inboundSchema),
39150
39166
  update: z88.lazy(() => Change2$inboundSchema),
39151
39167
  adopt: z88.lazy(() => Change3$inboundSchema),
39152
- unmanaged: z88.lazy(() => Change4$inboundSchema)
39168
+ unmanaged: z88.lazy(() => Change4$inboundSchema),
39169
+ delete: z88.lazy(() => Change5$inboundSchema)
39153
39170
  });
39154
39171
  var PreviewSyncWebhooksError$inboundSchema = z88.object({
39155
39172
  id: string5(),
@@ -39160,7 +39177,8 @@ var PreviewSyncWebhooksResponse$inboundSchema = z88.object({
39160
39177
  create: z88.lazy(() => Change1$inboundSchema),
39161
39178
  update: z88.lazy(() => Change2$inboundSchema),
39162
39179
  adopt: z88.lazy(() => Change3$inboundSchema),
39163
- unmanaged: z88.lazy(() => Change4$inboundSchema)
39180
+ unmanaged: z88.lazy(() => Change4$inboundSchema),
39181
+ delete: z88.lazy(() => Change5$inboundSchema)
39164
39182
  })),
39165
39183
  errors: z88.array(z88.lazy(() => PreviewSyncWebhooksError$inboundSchema))
39166
39184
  });
@@ -44682,9 +44700,17 @@ var SyncWebhooksWebhookRequest$outboundSchema = z102.object({
44682
44700
  description: z102.optional(z102.string()),
44683
44701
  disabled: z102.optional(z102.boolean())
44684
44702
  });
44685
- var SyncWebhooksSyncWebhooksParams$outboundSchema = z102.object({
44686
- webhooks: z102.array(z102.lazy(() => SyncWebhooksWebhookRequest$outboundSchema))
44687
- });
44703
+ var SyncWebhooksSyncWebhooksParams$outboundSchema = z102.pipe(
44704
+ z102.object({
44705
+ webhooks: z102.array(z102.lazy(() => SyncWebhooksWebhookRequest$outboundSchema)),
44706
+ skipDeletions: z102._default(z102.boolean(), true)
44707
+ }),
44708
+ z102.transform((v) => {
44709
+ return remap(v, {
44710
+ skipDeletions: "skip_deletions"
44711
+ });
44712
+ })
44713
+ );
44688
44714
  var SyncWebhooksWebhookResponse$inboundSchema = z102.pipe(
44689
44715
  z102.object({
44690
44716
  id: string5(),
@@ -44745,19 +44771,6 @@ var TrackIntervalEnum1 = {
44745
44771
  Year: "year"
44746
44772
  };
44747
44773
  var TrackOverageBehavior$outboundSchema = z103.enum(TrackOverageBehavior);
44748
- var TrackLock$outboundSchema = z103.pipe(
44749
- z103.object({
44750
- lockId: z103.string(),
44751
- enabled: z103.literal(true),
44752
- expiresAt: z103.optional(z103.number())
44753
- }),
44754
- z103.transform((v) => {
44755
- return remap(v, {
44756
- lockId: "lock_id",
44757
- expiresAt: "expires_at"
44758
- });
44759
- })
44760
- );
44761
44774
  var TrackParams$outboundSchema = z103.pipe(
44762
44775
  z103.object({
44763
44776
  customerId: z103.string(),
@@ -44768,8 +44781,7 @@ var TrackParams$outboundSchema = z103.pipe(
44768
44781
  properties: z103.optional(z103.record(z103.string(), z103.any())),
44769
44782
  timestamp: z103.optional(z103.int()),
44770
44783
  overageBehavior: z103.optional(TrackOverageBehavior$outboundSchema),
44771
- async: z103.optional(z103.boolean()),
44772
- lock: z103.optional(z103.lazy(() => TrackLock$outboundSchema))
44784
+ async: z103.optional(z103.boolean())
44773
44785
  }),
44774
44786
  z103.transform((v) => {
44775
44787
  return remap(v, {
@@ -62825,7 +62837,7 @@ var Webhooks = class extends ClientSDK {
62825
62837
  ));
62826
62838
  }
62827
62839
  /**
62828
- * 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.
62840
+ * 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.
62829
62841
  */
62830
62842
  async previewSync(request, options) {
62831
62843
  return unwrapAsync(webhooksPreviewSync(
@@ -62835,7 +62847,7 @@ var Webhooks = class extends ClientSDK {
62835
62847
  ));
62836
62848
  }
62837
62849
  /**
62838
- * 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.
62850
+ * 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.
62839
62851
  */
62840
62852
  async sync(request, options) {
62841
62853
  return unwrapAsync(webhooksSync(
@@ -1,29 +1,29 @@
1
1
  import {
2
2
  autumnHandler
3
- } from "../chunk-SAUYRKWO.mjs";
3
+ } from "../chunk-GKWJ3V2B.mjs";
4
4
  import {
5
5
  autumnHandler as autumnHandler2
6
- } from "../chunk-OWSZPOV7.mjs";
6
+ } from "../chunk-GSZMTPZW.mjs";
7
7
  import {
8
8
  autumnHandler as autumnHandler3
9
- } from "../chunk-MRFQEKBR.mjs";
9
+ } from "../chunk-4ZTDDMTF.mjs";
10
10
  import {
11
11
  autumnHandler as autumnHandler4
12
- } from "../chunk-SESSECCJ.mjs";
12
+ } from "../chunk-LGGW6YZU.mjs";
13
13
  import "../chunk-WYDGEDEU.mjs";
14
14
  import "../chunk-VXND2UDT.mjs";
15
- import "../chunk-YFZ7FT2F.mjs";
16
- import "../chunk-N4L4DLFM.mjs";
15
+ import "../chunk-ZO23CKLL.mjs";
16
+ import "../chunk-6V2J4NU5.mjs";
17
+ import "../chunk-HRNHS5CH.mjs";
18
+ import "../chunk-MOHYGUMA.mjs";
19
+ import "../chunk-TBQ27LIK.mjs";
20
+ import "../chunk-J44WR3QZ.mjs";
17
21
  import "../chunk-TSF4YCUO.mjs";
18
22
  import "../chunk-UAR3TMWI.mjs";
19
- import "../chunk-QRJFDPO4.mjs";
20
23
  import "../chunk-IQQQ5P6R.mjs";
21
- import "../chunk-IXUCY7AU.mjs";
22
24
  import "../chunk-OTXV5FY7.mjs";
23
- import "../chunk-I7CD6EB6.mjs";
24
25
  import "../chunk-VZIMT7AO.mjs";
25
- import "../chunk-TBQ27LIK.mjs";
26
- import "../chunk-J44WR3QZ.mjs";
26
+ import "../chunk-I7CD6EB6.mjs";
27
27
  import "../chunk-N7NFYY54.mjs";
28
28
  export {
29
29
  autumnHandler as expressAutumnHandler,
@@ -4115,19 +4115,6 @@ var BatchTrackOverageBehavior = {
4115
4115
  Overflow: "overflow"
4116
4116
  };
4117
4117
  var BatchTrackOverageBehavior$outboundSchema = z16.enum(BatchTrackOverageBehavior);
4118
- var BatchTrackLock$outboundSchema = z16.pipe(
4119
- z16.object({
4120
- lockId: z16.string(),
4121
- enabled: z16.literal(true),
4122
- expiresAt: z16.optional(z16.number())
4123
- }),
4124
- z16.transform((v) => {
4125
- return remap(v, {
4126
- lockId: "lock_id",
4127
- expiresAt: "expires_at"
4128
- });
4129
- })
4130
- );
4131
4118
  var RequestBody$outboundSchema = z16.pipe(
4132
4119
  z16.object({
4133
4120
  customerId: z16.string(),
@@ -4139,8 +4126,7 @@ var RequestBody$outboundSchema = z16.pipe(
4139
4126
  idempotencyKey: z16.optional(z16.string()),
4140
4127
  timestamp: z16.optional(z16.int()),
4141
4128
  overageBehavior: z16.optional(BatchTrackOverageBehavior$outboundSchema),
4142
- async: z16.optional(z16.boolean()),
4143
- lock: z16.optional(z16.lazy(() => BatchTrackLock$outboundSchema))
4129
+ async: z16.optional(z16.boolean())
4144
4130
  }),
4145
4131
  z16.transform((v) => {
4146
4132
  return remap(v, {
@@ -6529,7 +6515,7 @@ var ProductScenario1 = {
6529
6515
  PastDue: "past_due"
6530
6516
  };
6531
6517
  var CheckOverageBehavior$outboundSchema = z19.enum(CheckOverageBehavior);
6532
- var CheckLock$outboundSchema = z19.pipe(
6518
+ var Lock$outboundSchema = z19.pipe(
6533
6519
  z19.object({
6534
6520
  lockId: z19.string(),
6535
6521
  enabled: z19.literal(true),
@@ -6552,7 +6538,7 @@ var CheckParams$outboundSchema = z19.pipe(
6552
6538
  requiredBalance: z19.optional(z19.number()),
6553
6539
  properties: z19.optional(z19.record(z19.string(), z19.any())),
6554
6540
  sendEvent: z19.optional(z19.boolean()),
6555
- lock: z19.optional(z19.lazy(() => CheckLock$outboundSchema)),
6541
+ lock: z19.optional(z19.lazy(() => Lock$outboundSchema)),
6556
6542
  withPreview: z19.optional(z19.boolean())
6557
6543
  }),
6558
6544
  z19.transform((v) => {
@@ -39014,10 +39000,40 @@ var PreviewSyncWebhooksWebhookRequest$outboundSchema = z88.object({
39014
39000
  description: z88.optional(z88.string()),
39015
39001
  disabled: z88.optional(z88.boolean())
39016
39002
  });
39017
- var PreviewSyncWebhooksSyncWebhooksParams$outboundSchema = z88.object({
39018
- webhooks: z88.array(
39019
- z88.lazy(() => PreviewSyncWebhooksWebhookRequest$outboundSchema)
39020
- )
39003
+ var PreviewSyncWebhooksSyncWebhooksParams$outboundSchema = z88.pipe(
39004
+ z88.object({
39005
+ webhooks: z88.array(
39006
+ z88.lazy(() => PreviewSyncWebhooksWebhookRequest$outboundSchema)
39007
+ ),
39008
+ skipDeletions: z88._default(z88.boolean(), true)
39009
+ }),
39010
+ z88.transform((v) => {
39011
+ return remap(v, {
39012
+ skipDeletions: "skip_deletions"
39013
+ });
39014
+ })
39015
+ );
39016
+ var ChangeWebhook3$inboundSchema = z88.pipe(
39017
+ z88.object({
39018
+ id: string5(),
39019
+ url: string5(),
39020
+ description: nullable(string5()),
39021
+ events: z88.array(string5()),
39022
+ disabled: boolean2(),
39023
+ created_at: number2(),
39024
+ updated_at: number2()
39025
+ }),
39026
+ z88.transform((v) => {
39027
+ return remap(v, {
39028
+ "created_at": "createdAt",
39029
+ "updated_at": "updatedAt"
39030
+ });
39031
+ })
39032
+ );
39033
+ var Change5$inboundSchema = z88.object({
39034
+ action: literal3("delete"),
39035
+ id: string5(),
39036
+ webhook: z88.lazy(() => ChangeWebhook3$inboundSchema)
39021
39037
  });
39022
39038
  var ChangeWebhook2$inboundSchema = z88.pipe(
39023
39039
  z88.object({
@@ -39147,7 +39163,8 @@ var ChangeUnion$inboundSchema = discriminatedUnion("action", {
39147
39163
  create: z88.lazy(() => Change1$inboundSchema),
39148
39164
  update: z88.lazy(() => Change2$inboundSchema),
39149
39165
  adopt: z88.lazy(() => Change3$inboundSchema),
39150
- unmanaged: z88.lazy(() => Change4$inboundSchema)
39166
+ unmanaged: z88.lazy(() => Change4$inboundSchema),
39167
+ delete: z88.lazy(() => Change5$inboundSchema)
39151
39168
  });
39152
39169
  var PreviewSyncWebhooksError$inboundSchema = z88.object({
39153
39170
  id: string5(),
@@ -39158,7 +39175,8 @@ var PreviewSyncWebhooksResponse$inboundSchema = z88.object({
39158
39175
  create: z88.lazy(() => Change1$inboundSchema),
39159
39176
  update: z88.lazy(() => Change2$inboundSchema),
39160
39177
  adopt: z88.lazy(() => Change3$inboundSchema),
39161
- unmanaged: z88.lazy(() => Change4$inboundSchema)
39178
+ unmanaged: z88.lazy(() => Change4$inboundSchema),
39179
+ delete: z88.lazy(() => Change5$inboundSchema)
39162
39180
  })),
39163
39181
  errors: z88.array(z88.lazy(() => PreviewSyncWebhooksError$inboundSchema))
39164
39182
  });
@@ -44680,9 +44698,17 @@ var SyncWebhooksWebhookRequest$outboundSchema = z102.object({
44680
44698
  description: z102.optional(z102.string()),
44681
44699
  disabled: z102.optional(z102.boolean())
44682
44700
  });
44683
- var SyncWebhooksSyncWebhooksParams$outboundSchema = z102.object({
44684
- webhooks: z102.array(z102.lazy(() => SyncWebhooksWebhookRequest$outboundSchema))
44685
- });
44701
+ var SyncWebhooksSyncWebhooksParams$outboundSchema = z102.pipe(
44702
+ z102.object({
44703
+ webhooks: z102.array(z102.lazy(() => SyncWebhooksWebhookRequest$outboundSchema)),
44704
+ skipDeletions: z102._default(z102.boolean(), true)
44705
+ }),
44706
+ z102.transform((v) => {
44707
+ return remap(v, {
44708
+ skipDeletions: "skip_deletions"
44709
+ });
44710
+ })
44711
+ );
44686
44712
  var SyncWebhooksWebhookResponse$inboundSchema = z102.pipe(
44687
44713
  z102.object({
44688
44714
  id: string5(),
@@ -44743,19 +44769,6 @@ var TrackIntervalEnum1 = {
44743
44769
  Year: "year"
44744
44770
  };
44745
44771
  var TrackOverageBehavior$outboundSchema = z103.enum(TrackOverageBehavior);
44746
- var TrackLock$outboundSchema = z103.pipe(
44747
- z103.object({
44748
- lockId: z103.string(),
44749
- enabled: z103.literal(true),
44750
- expiresAt: z103.optional(z103.number())
44751
- }),
44752
- z103.transform((v) => {
44753
- return remap(v, {
44754
- lockId: "lock_id",
44755
- expiresAt: "expires_at"
44756
- });
44757
- })
44758
- );
44759
44772
  var TrackParams$outboundSchema = z103.pipe(
44760
44773
  z103.object({
44761
44774
  customerId: z103.string(),
@@ -44766,8 +44779,7 @@ var TrackParams$outboundSchema = z103.pipe(
44766
44779
  properties: z103.optional(z103.record(z103.string(), z103.any())),
44767
44780
  timestamp: z103.optional(z103.int()),
44768
44781
  overageBehavior: z103.optional(TrackOverageBehavior$outboundSchema),
44769
- async: z103.optional(z103.boolean()),
44770
- lock: z103.optional(z103.lazy(() => TrackLock$outboundSchema))
44782
+ async: z103.optional(z103.boolean())
44771
44783
  }),
44772
44784
  z103.transform((v) => {
44773
44785
  return remap(v, {
@@ -62823,7 +62835,7 @@ var Webhooks = class extends ClientSDK {
62823
62835
  ));
62824
62836
  }
62825
62837
  /**
62826
- * 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.
62838
+ * 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.
62827
62839
  */
62828
62840
  async previewSync(request, options) {
62829
62841
  return unwrapAsync(webhooksPreviewSync(
@@ -62833,7 +62845,7 @@ var Webhooks = class extends ClientSDK {
62833
62845
  ));
62834
62846
  }
62835
62847
  /**
62836
- * 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.
62848
+ * 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.
62837
62849
  */
62838
62850
  async sync(request, options) {
62839
62851
  return unwrapAsync(webhooksSync(
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  autumnHandler
3
- } from "../chunk-SESSECCJ.mjs";
3
+ } from "../chunk-LGGW6YZU.mjs";
4
4
  import "../chunk-WYDGEDEU.mjs";
5
5
  import "../chunk-VXND2UDT.mjs";
6
- import "../chunk-YFZ7FT2F.mjs";
7
- import "../chunk-N4L4DLFM.mjs";
6
+ import "../chunk-ZO23CKLL.mjs";
7
+ import "../chunk-6V2J4NU5.mjs";
8
+ import "../chunk-HRNHS5CH.mjs";
9
+ import "../chunk-MOHYGUMA.mjs";
10
+ import "../chunk-TBQ27LIK.mjs";
11
+ import "../chunk-J44WR3QZ.mjs";
8
12
  import "../chunk-TSF4YCUO.mjs";
9
13
  import "../chunk-UAR3TMWI.mjs";
10
- import "../chunk-QRJFDPO4.mjs";
11
14
  import "../chunk-IQQQ5P6R.mjs";
12
- import "../chunk-IXUCY7AU.mjs";
13
15
  import "../chunk-OTXV5FY7.mjs";
14
- import "../chunk-I7CD6EB6.mjs";
15
16
  import "../chunk-VZIMT7AO.mjs";
16
- import "../chunk-TBQ27LIK.mjs";
17
- import "../chunk-J44WR3QZ.mjs";
17
+ import "../chunk-I7CD6EB6.mjs";
18
18
  import "../chunk-N7NFYY54.mjs";
19
19
  export {
20
20
  autumnHandler
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-N4L4DLFM.mjs";
3
+ } from "./chunk-6V2J4NU5.mjs";
4
4
 
5
5
  // src/backend/adapters/hono.ts
6
6
  function autumnHandler(options) {
@@ -1,15 +1,15 @@
1
+ import {
2
+ Autumn
3
+ } from "./chunk-HRNHS5CH.mjs";
4
+ import {
5
+ executeRoute
6
+ } from "./chunk-MOHYGUMA.mjs";
1
7
  import {
2
8
  buildRouter
3
9
  } from "./chunk-UAR3TMWI.mjs";
4
- import {
5
- Autumn
6
- } from "./chunk-QRJFDPO4.mjs";
7
10
  import {
8
11
  routeConfigs
9
12
  } from "./chunk-IQQQ5P6R.mjs";
10
- import {
11
- executeRoute
12
- } from "./chunk-IXUCY7AU.mjs";
13
13
  import {
14
14
  secretKeyCheck
15
15
  } from "./chunk-VZIMT7AO.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-N4L4DLFM.mjs";
3
+ } from "./chunk-6V2J4NU5.mjs";
4
4
 
5
5
  // src/backend/adapters/express.ts
6
6
  function autumnHandler(options) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-N4L4DLFM.mjs";
3
+ } from "./chunk-6V2J4NU5.mjs";
4
4
 
5
5
  // src/backend/adapters/fetch.ts
6
6
  function autumnHandler(options) {
@@ -4031,19 +4031,6 @@ var BatchTrackOverageBehavior = {
4031
4031
  Overflow: "overflow"
4032
4032
  };
4033
4033
  var BatchTrackOverageBehavior$outboundSchema = z16.enum(BatchTrackOverageBehavior);
4034
- var BatchTrackLock$outboundSchema = z16.pipe(
4035
- z16.object({
4036
- lockId: z16.string(),
4037
- enabled: z16.literal(true),
4038
- expiresAt: z16.optional(z16.number())
4039
- }),
4040
- z16.transform((v) => {
4041
- return remap(v, {
4042
- lockId: "lock_id",
4043
- expiresAt: "expires_at"
4044
- });
4045
- })
4046
- );
4047
4034
  var RequestBody$outboundSchema = z16.pipe(
4048
4035
  z16.object({
4049
4036
  customerId: z16.string(),
@@ -4055,8 +4042,7 @@ var RequestBody$outboundSchema = z16.pipe(
4055
4042
  idempotencyKey: z16.optional(z16.string()),
4056
4043
  timestamp: z16.optional(z16.int()),
4057
4044
  overageBehavior: z16.optional(BatchTrackOverageBehavior$outboundSchema),
4058
- async: z16.optional(z16.boolean()),
4059
- lock: z16.optional(z16.lazy(() => BatchTrackLock$outboundSchema))
4045
+ async: z16.optional(z16.boolean())
4060
4046
  }),
4061
4047
  z16.transform((v) => {
4062
4048
  return remap(v, {
@@ -6445,7 +6431,7 @@ var ProductScenario1 = {
6445
6431
  PastDue: "past_due"
6446
6432
  };
6447
6433
  var CheckOverageBehavior$outboundSchema = z19.enum(CheckOverageBehavior);
6448
- var CheckLock$outboundSchema = z19.pipe(
6434
+ var Lock$outboundSchema = z19.pipe(
6449
6435
  z19.object({
6450
6436
  lockId: z19.string(),
6451
6437
  enabled: z19.literal(true),
@@ -6468,7 +6454,7 @@ var CheckParams$outboundSchema = z19.pipe(
6468
6454
  requiredBalance: z19.optional(z19.number()),
6469
6455
  properties: z19.optional(z19.record(z19.string(), z19.any())),
6470
6456
  sendEvent: z19.optional(z19.boolean()),
6471
- lock: z19.optional(z19.lazy(() => CheckLock$outboundSchema)),
6457
+ lock: z19.optional(z19.lazy(() => Lock$outboundSchema)),
6472
6458
  withPreview: z19.optional(z19.boolean())
6473
6459
  }),
6474
6460
  z19.transform((v) => {
@@ -38930,10 +38916,40 @@ var PreviewSyncWebhooksWebhookRequest$outboundSchema = z88.object({
38930
38916
  description: z88.optional(z88.string()),
38931
38917
  disabled: z88.optional(z88.boolean())
38932
38918
  });
38933
- var PreviewSyncWebhooksSyncWebhooksParams$outboundSchema = z88.object({
38934
- webhooks: z88.array(
38935
- z88.lazy(() => PreviewSyncWebhooksWebhookRequest$outboundSchema)
38936
- )
38919
+ var PreviewSyncWebhooksSyncWebhooksParams$outboundSchema = z88.pipe(
38920
+ z88.object({
38921
+ webhooks: z88.array(
38922
+ z88.lazy(() => PreviewSyncWebhooksWebhookRequest$outboundSchema)
38923
+ ),
38924
+ skipDeletions: z88._default(z88.boolean(), true)
38925
+ }),
38926
+ z88.transform((v) => {
38927
+ return remap(v, {
38928
+ skipDeletions: "skip_deletions"
38929
+ });
38930
+ })
38931
+ );
38932
+ var ChangeWebhook3$inboundSchema = z88.pipe(
38933
+ z88.object({
38934
+ id: string5(),
38935
+ url: string5(),
38936
+ description: nullable(string5()),
38937
+ events: z88.array(string5()),
38938
+ disabled: boolean2(),
38939
+ created_at: number2(),
38940
+ updated_at: number2()
38941
+ }),
38942
+ z88.transform((v) => {
38943
+ return remap(v, {
38944
+ "created_at": "createdAt",
38945
+ "updated_at": "updatedAt"
38946
+ });
38947
+ })
38948
+ );
38949
+ var Change5$inboundSchema = z88.object({
38950
+ action: literal3("delete"),
38951
+ id: string5(),
38952
+ webhook: z88.lazy(() => ChangeWebhook3$inboundSchema)
38937
38953
  });
38938
38954
  var ChangeWebhook2$inboundSchema = z88.pipe(
38939
38955
  z88.object({
@@ -39063,7 +39079,8 @@ var ChangeUnion$inboundSchema = discriminatedUnion("action", {
39063
39079
  create: z88.lazy(() => Change1$inboundSchema),
39064
39080
  update: z88.lazy(() => Change2$inboundSchema),
39065
39081
  adopt: z88.lazy(() => Change3$inboundSchema),
39066
- unmanaged: z88.lazy(() => Change4$inboundSchema)
39082
+ unmanaged: z88.lazy(() => Change4$inboundSchema),
39083
+ delete: z88.lazy(() => Change5$inboundSchema)
39067
39084
  });
39068
39085
  var PreviewSyncWebhooksError$inboundSchema = z88.object({
39069
39086
  id: string5(),
@@ -39074,7 +39091,8 @@ var PreviewSyncWebhooksResponse$inboundSchema = z88.object({
39074
39091
  create: z88.lazy(() => Change1$inboundSchema),
39075
39092
  update: z88.lazy(() => Change2$inboundSchema),
39076
39093
  adopt: z88.lazy(() => Change3$inboundSchema),
39077
- unmanaged: z88.lazy(() => Change4$inboundSchema)
39094
+ unmanaged: z88.lazy(() => Change4$inboundSchema),
39095
+ delete: z88.lazy(() => Change5$inboundSchema)
39078
39096
  })),
39079
39097
  errors: z88.array(z88.lazy(() => PreviewSyncWebhooksError$inboundSchema))
39080
39098
  });
@@ -44596,9 +44614,17 @@ var SyncWebhooksWebhookRequest$outboundSchema = z102.object({
44596
44614
  description: z102.optional(z102.string()),
44597
44615
  disabled: z102.optional(z102.boolean())
44598
44616
  });
44599
- var SyncWebhooksSyncWebhooksParams$outboundSchema = z102.object({
44600
- webhooks: z102.array(z102.lazy(() => SyncWebhooksWebhookRequest$outboundSchema))
44601
- });
44617
+ var SyncWebhooksSyncWebhooksParams$outboundSchema = z102.pipe(
44618
+ z102.object({
44619
+ webhooks: z102.array(z102.lazy(() => SyncWebhooksWebhookRequest$outboundSchema)),
44620
+ skipDeletions: z102._default(z102.boolean(), true)
44621
+ }),
44622
+ z102.transform((v) => {
44623
+ return remap(v, {
44624
+ skipDeletions: "skip_deletions"
44625
+ });
44626
+ })
44627
+ );
44602
44628
  var SyncWebhooksWebhookResponse$inboundSchema = z102.pipe(
44603
44629
  z102.object({
44604
44630
  id: string5(),
@@ -44659,19 +44685,6 @@ var TrackIntervalEnum1 = {
44659
44685
  Year: "year"
44660
44686
  };
44661
44687
  var TrackOverageBehavior$outboundSchema = z103.enum(TrackOverageBehavior);
44662
- var TrackLock$outboundSchema = z103.pipe(
44663
- z103.object({
44664
- lockId: z103.string(),
44665
- enabled: z103.literal(true),
44666
- expiresAt: z103.optional(z103.number())
44667
- }),
44668
- z103.transform((v) => {
44669
- return remap(v, {
44670
- lockId: "lock_id",
44671
- expiresAt: "expires_at"
44672
- });
44673
- })
44674
- );
44675
44688
  var TrackParams$outboundSchema = z103.pipe(
44676
44689
  z103.object({
44677
44690
  customerId: z103.string(),
@@ -44682,8 +44695,7 @@ var TrackParams$outboundSchema = z103.pipe(
44682
44695
  properties: z103.optional(z103.record(z103.string(), z103.any())),
44683
44696
  timestamp: z103.optional(z103.int()),
44684
44697
  overageBehavior: z103.optional(TrackOverageBehavior$outboundSchema),
44685
- async: z103.optional(z103.boolean()),
44686
- lock: z103.optional(z103.lazy(() => TrackLock$outboundSchema))
44698
+ async: z103.optional(z103.boolean())
44687
44699
  }),
44688
44700
  z103.transform((v) => {
44689
44701
  return remap(v, {
@@ -62767,7 +62779,7 @@ var Webhooks = class extends ClientSDK {
62767
62779
  ));
62768
62780
  }
62769
62781
  /**
62770
- * 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.
62782
+ * 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.
62771
62783
  */
62772
62784
  async previewSync(request, options) {
62773
62785
  return unwrapAsync(webhooksPreviewSync(
@@ -62777,7 +62789,7 @@ var Webhooks = class extends ClientSDK {
62777
62789
  ));
62778
62790
  }
62779
62791
  /**
62780
- * 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.
62792
+ * 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.
62781
62793
  */
62782
62794
  async sync(request, options) {
62783
62795
  return unwrapAsync(webhooksSync(
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-N4L4DLFM.mjs";
3
+ } from "./chunk-6V2J4NU5.mjs";
4
4
 
5
5
  // src/backend/adapters/next.ts
6
6
  import { NextResponse } from "next/server";