autumn-js 1.3.73 → 1.4.0

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 (67) hide show
  1. package/dist/backend/adapters/express.js +9 -10
  2. package/dist/backend/adapters/express.mjs +5 -5
  3. package/dist/backend/adapters/fetch.js +9 -10
  4. package/dist/backend/adapters/fetch.mjs +5 -5
  5. package/dist/backend/adapters/hono.js +9 -10
  6. package/dist/backend/adapters/hono.mjs +5 -5
  7. package/dist/backend/adapters/index.js +9 -10
  8. package/dist/backend/adapters/index.mjs +8 -8
  9. package/dist/backend/adapters/next.js +9 -10
  10. package/dist/backend/adapters/next.mjs +5 -5
  11. package/dist/backend/{chunk-QD5VNLGH.mjs → chunk-2JZN2A5Z.mjs} +1 -1
  12. package/dist/backend/{chunk-MIDKK6HE.mjs → chunk-572QTWBN.mjs} +1 -1
  13. package/dist/backend/{chunk-P46GFHFB.mjs → chunk-ETP3OECB.mjs} +1 -1
  14. package/dist/backend/{chunk-CFBX64LG.mjs → chunk-FJYYK3KF.mjs} +1 -1
  15. package/dist/backend/{chunk-5NZXLCLY.mjs → chunk-HKLICPAL.mjs} +9 -10
  16. package/dist/backend/{chunk-I75WCVDU.mjs → chunk-MSWCEKV6.mjs} +1 -1
  17. package/dist/backend/{chunk-4D2MGLMK.mjs → chunk-QQFPLVJO.mjs} +1 -1
  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 +9 -10
  21. package/dist/backend/core/handlers/coreHandler.mjs +3 -3
  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 +1 -1
  25. package/dist/backend/core/handlers/handleRouteByName.js +9 -10
  26. package/dist/backend/core/handlers/handleRouteByName.mjs +3 -3
  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 +9 -10
  30. package/dist/backend/core/handlers/index.mjs +6 -6
  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 +9 -10
  34. package/dist/backend/core/index.mjs +8 -8
  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 +9 -10
  53. package/dist/backend/index.mjs +6 -6
  54. package/dist/backend/{routeTypes-Bq2o3T9X.d.mts → routeTypes-C0SK3Woi.d.mts} +9 -13
  55. package/dist/backend/{routeTypes-B9shWqn_.d.ts → routeTypes-eswiz8Fx.d.ts} +9 -13
  56. package/dist/better-auth/{chunk-TOUOQM4M.mjs → chunk-HJ7J37RU.mjs} +9 -10
  57. package/dist/better-auth/index.js +9 -10
  58. package/dist/better-auth/index.mjs +1 -1
  59. package/dist/better-auth/utils/handleBetterAuthRoute.js +9 -10
  60. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +1 -1
  61. package/dist/better-auth/utils/index.js +9 -10
  62. package/dist/better-auth/utils/index.mjs +1 -1
  63. package/dist/sdk/index.d.mts +11 -16
  64. package/dist/sdk/index.d.ts +11 -16
  65. package/dist/sdk/index.js +9 -10
  66. package/dist/sdk/index.mjs +9 -10
  67. package/package.json +2 -2
@@ -109,10 +109,10 @@ type SDKOptions = {
109
109
  declare function serverURLFromOptions(options: SDKOptions): URL | null;
110
110
  declare const SDK_METADATA: {
111
111
  readonly language: "typescript";
112
- readonly openapiDocVersion: "2.4.0";
112
+ readonly openapiDocVersion: "2.5.0";
113
113
  readonly sdkVersion: "0.10.18";
114
114
  readonly genVersion: "2.884.13";
115
- readonly userAgent: "speakeasy-sdk/typescript 0.10.18 2.884.13 2.4.0 @useautumn/sdk";
115
+ readonly userAgent: "speakeasy-sdk/typescript 0.10.18 2.884.13 2.5.0 @useautumn/sdk";
116
116
  };
117
117
 
118
118
  /**
@@ -5522,10 +5522,6 @@ type RequestBody = {
5522
5522
  * 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.
5523
5523
  */
5524
5524
  overageBehavior?: BatchTrackOverageBehavior | undefined;
5525
- /**
5526
- * If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
5527
- */
5528
- async?: boolean | undefined;
5529
5525
  };
5530
5526
  /**
5531
5527
  * 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.
@@ -5555,7 +5551,6 @@ type RequestBody$Outbound = {
5555
5551
  idempotency_key?: string | undefined;
5556
5552
  timestamp?: number | undefined;
5557
5553
  overage_behavior?: string | undefined;
5558
- async?: boolean | undefined;
5559
5554
  };
5560
5555
  /** @internal */
5561
5556
  declare const RequestBody$outboundSchema: z$1.ZodMiniType<RequestBody$Outbound, RequestBody>;
@@ -77801,7 +77796,7 @@ type TrackParams = {
77801
77796
  */
77802
77797
  overageBehavior?: TrackOverageBehavior | undefined;
77803
77798
  /**
77804
- * If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
77799
+ * Defaults to true: the event is queued and the response is a 202 with balance: null. Set to false to apply the usage before responding with a 200 and the updated balance.
77805
77800
  */
77806
77801
  async?: boolean | undefined;
77807
77802
  };
@@ -77858,7 +77853,7 @@ type TrackDeduction2 = {
77858
77853
  value: number;
77859
77854
  };
77860
77855
  /**
77861
- * Accepted. Autumn is experiencing degraded service from a downstream provider, so the event was accepted for replay and will be tracked as soon as the service is restored.
77856
+ * Accepted. The event was queued and will be applied shortly, so balance is null. Returned by default unless async is false, and when Autumn is experiencing degraded service.
77862
77857
  */
77863
77858
  type TrackResponseBody2 = {
77864
77859
  /**
@@ -78105,7 +78100,7 @@ type TrackTokensParams = {
78105
78100
  */
78106
78101
  overageBehavior?: TrackTokensOverageBehavior | undefined;
78107
78102
  /**
78108
- * If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
78103
+ * Defaults to true: the event is queued and the response is a 202 with balance: null. Set to false to apply the usage before responding with a 200 and the updated balance.
78109
78104
  */
78110
78105
  async?: boolean | undefined;
78111
78106
  };
@@ -78162,7 +78157,7 @@ type TrackTokensDeduction2 = {
78162
78157
  value: number;
78163
78158
  };
78164
78159
  /**
78165
- * Accepted. Autumn is experiencing degraded service from a downstream provider, so the token usage event was accepted for replay and will be tracked as soon as the service is restored.
78160
+ * Accepted. The token usage event was queued and will be applied shortly, so balance is null. Returned by default unless async is false, and when Autumn is experiencing degraded service.
78166
78161
  */
78167
78162
  type TrackTokensResponseBody2 = {
78168
78163
  /**
@@ -95287,7 +95282,7 @@ declare class Autumn extends ClientSDK {
95287
95282
  */
95288
95283
  check(request: CheckParams, options?: RequestOptions): Promise<CheckResponse>;
95289
95284
  /**
95290
- * Records usage for a customer feature and returns updated balances.
95285
+ * Records usage for a customer feature. Queued by default; pass async: false to apply it before responding with updated balances.
95291
95286
  *
95292
95287
  * Use this after an action happens to decrement usage, or send a negative value to credit balance back.
95293
95288
  *
@@ -95311,9 +95306,9 @@ declare class Autumn extends ClientSDK {
95311
95306
  * @param properties - Additional properties to attach to this usage event. (optional)
95312
95307
  * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
95313
95308
  * @param overageBehavior - 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. (optional)
95314
- * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
95309
+ * @param async - Defaults to true: the event is queued and the response is a 202 with balance: null. Set to false to apply the usage before responding with a 200 and the updated balance. (optional)
95315
95310
  *
95316
- * @returns The usage value recorded, with either a single updated balance or a map of updated balances. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the event for replay so it can be tracked as soon as the service is restored.
95311
+ * @returns The usage value recorded. By default the event is queued and the API returns 202 with balance: null. With async: false it returns 200 with either a single updated balance or a map of updated balances, or 202 if Autumn is experiencing degraded service and accepted the event for replay.
95317
95312
  */
95318
95313
  track(request: TrackParams, options?: RequestOptions): Promise<TrackResponse>;
95319
95314
  /**
@@ -95348,9 +95343,9 @@ declare class Autumn extends ClientSDK {
95348
95343
  * @param properties - Additional properties to attach to this usage event. (optional)
95349
95344
  * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
95350
95345
  * @param overageBehavior - 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. (optional)
95351
- * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
95346
+ * @param async - Defaults to true: the event is queued and the response is a 202 with balance: null. Set to false to apply the usage before responding with a 200 and the updated balance. (optional)
95352
95347
  *
95353
- * @returns The dollar value recorded and the updated AI credit system balance. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the token usage event for replay so it can be tracked as soon as the service is restored.
95348
+ * @returns The dollar value recorded. By default the event is queued and the API returns 202 with balance: null. With async: false it returns 200 with the updated AI credit system balance, or 202 if Autumn is experiencing degraded service and accepted the event for replay.
95354
95349
  */
95355
95350
  trackTokens(request: TrackTokensParams, options?: RequestOptions): Promise<TrackTokensResponse>;
95356
95351
  /**
@@ -109,10 +109,10 @@ type SDKOptions = {
109
109
  declare function serverURLFromOptions(options: SDKOptions): URL | null;
110
110
  declare const SDK_METADATA: {
111
111
  readonly language: "typescript";
112
- readonly openapiDocVersion: "2.4.0";
112
+ readonly openapiDocVersion: "2.5.0";
113
113
  readonly sdkVersion: "0.10.18";
114
114
  readonly genVersion: "2.884.13";
115
- readonly userAgent: "speakeasy-sdk/typescript 0.10.18 2.884.13 2.4.0 @useautumn/sdk";
115
+ readonly userAgent: "speakeasy-sdk/typescript 0.10.18 2.884.13 2.5.0 @useautumn/sdk";
116
116
  };
117
117
 
118
118
  /**
@@ -5522,10 +5522,6 @@ type RequestBody = {
5522
5522
  * 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.
5523
5523
  */
5524
5524
  overageBehavior?: BatchTrackOverageBehavior | undefined;
5525
- /**
5526
- * If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
5527
- */
5528
- async?: boolean | undefined;
5529
5525
  };
5530
5526
  /**
5531
5527
  * 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.
@@ -5555,7 +5551,6 @@ type RequestBody$Outbound = {
5555
5551
  idempotency_key?: string | undefined;
5556
5552
  timestamp?: number | undefined;
5557
5553
  overage_behavior?: string | undefined;
5558
- async?: boolean | undefined;
5559
5554
  };
5560
5555
  /** @internal */
5561
5556
  declare const RequestBody$outboundSchema: z$1.ZodMiniType<RequestBody$Outbound, RequestBody>;
@@ -77801,7 +77796,7 @@ type TrackParams = {
77801
77796
  */
77802
77797
  overageBehavior?: TrackOverageBehavior | undefined;
77803
77798
  /**
77804
- * If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
77799
+ * Defaults to true: the event is queued and the response is a 202 with balance: null. Set to false to apply the usage before responding with a 200 and the updated balance.
77805
77800
  */
77806
77801
  async?: boolean | undefined;
77807
77802
  };
@@ -77858,7 +77853,7 @@ type TrackDeduction2 = {
77858
77853
  value: number;
77859
77854
  };
77860
77855
  /**
77861
- * Accepted. Autumn is experiencing degraded service from a downstream provider, so the event was accepted for replay and will be tracked as soon as the service is restored.
77856
+ * Accepted. The event was queued and will be applied shortly, so balance is null. Returned by default unless async is false, and when Autumn is experiencing degraded service.
77862
77857
  */
77863
77858
  type TrackResponseBody2 = {
77864
77859
  /**
@@ -78105,7 +78100,7 @@ type TrackTokensParams = {
78105
78100
  */
78106
78101
  overageBehavior?: TrackTokensOverageBehavior | undefined;
78107
78102
  /**
78108
- * If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
78103
+ * Defaults to true: the event is queued and the response is a 202 with balance: null. Set to false to apply the usage before responding with a 200 and the updated balance.
78109
78104
  */
78110
78105
  async?: boolean | undefined;
78111
78106
  };
@@ -78162,7 +78157,7 @@ type TrackTokensDeduction2 = {
78162
78157
  value: number;
78163
78158
  };
78164
78159
  /**
78165
- * Accepted. Autumn is experiencing degraded service from a downstream provider, so the token usage event was accepted for replay and will be tracked as soon as the service is restored.
78160
+ * Accepted. The token usage event was queued and will be applied shortly, so balance is null. Returned by default unless async is false, and when Autumn is experiencing degraded service.
78166
78161
  */
78167
78162
  type TrackTokensResponseBody2 = {
78168
78163
  /**
@@ -95287,7 +95282,7 @@ declare class Autumn extends ClientSDK {
95287
95282
  */
95288
95283
  check(request: CheckParams, options?: RequestOptions): Promise<CheckResponse>;
95289
95284
  /**
95290
- * Records usage for a customer feature and returns updated balances.
95285
+ * Records usage for a customer feature. Queued by default; pass async: false to apply it before responding with updated balances.
95291
95286
  *
95292
95287
  * Use this after an action happens to decrement usage, or send a negative value to credit balance back.
95293
95288
  *
@@ -95311,9 +95306,9 @@ declare class Autumn extends ClientSDK {
95311
95306
  * @param properties - Additional properties to attach to this usage event. (optional)
95312
95307
  * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
95313
95308
  * @param overageBehavior - 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. (optional)
95314
- * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
95309
+ * @param async - Defaults to true: the event is queued and the response is a 202 with balance: null. Set to false to apply the usage before responding with a 200 and the updated balance. (optional)
95315
95310
  *
95316
- * @returns The usage value recorded, with either a single updated balance or a map of updated balances. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the event for replay so it can be tracked as soon as the service is restored.
95311
+ * @returns The usage value recorded. By default the event is queued and the API returns 202 with balance: null. With async: false it returns 200 with either a single updated balance or a map of updated balances, or 202 if Autumn is experiencing degraded service and accepted the event for replay.
95317
95312
  */
95318
95313
  track(request: TrackParams, options?: RequestOptions): Promise<TrackResponse>;
95319
95314
  /**
@@ -95348,9 +95343,9 @@ declare class Autumn extends ClientSDK {
95348
95343
  * @param properties - Additional properties to attach to this usage event. (optional)
95349
95344
  * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
95350
95345
  * @param overageBehavior - 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. (optional)
95351
- * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
95346
+ * @param async - Defaults to true: the event is queued and the response is a 202 with balance: null. Set to false to apply the usage before responding with a 200 and the updated balance. (optional)
95352
95347
  *
95353
- * @returns The dollar value recorded and the updated AI credit system balance. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the token usage event for replay so it can be tracked as soon as the service is restored.
95348
+ * @returns The dollar value recorded. By default the event is queued and the API returns 202 with balance: null. With async: false it returns 200 with the updated AI credit system balance, or 202 if Autumn is experiencing degraded service and accepted the event for replay.
95354
95349
  */
95355
95350
  trackTokens(request: TrackTokensParams, options?: RequestOptions): Promise<TrackTokensResponse>;
95356
95351
  /**
package/dist/sdk/index.js CHANGED
@@ -82,10 +82,10 @@ function serverURLFromOptions(options) {
82
82
  }
83
83
  var SDK_METADATA = {
84
84
  language: "typescript",
85
- openapiDocVersion: "2.4.0",
85
+ openapiDocVersion: "2.5.0",
86
86
  sdkVersion: "0.10.18",
87
87
  genVersion: "2.884.13",
88
- userAgent: "speakeasy-sdk/typescript 0.10.18 2.884.13 2.4.0 @useautumn/sdk"
88
+ userAgent: "speakeasy-sdk/typescript 0.10.18 2.884.13 2.5.0 @useautumn/sdk"
89
89
  };
90
90
 
91
91
  // ../sdk/src/lib/files.ts
@@ -829,7 +829,7 @@ function dlv(obj, key, def, p, undef) {
829
829
  // ../sdk/src/lib/env.ts
830
830
  var envSchema = z35__namespace.object({
831
831
  AUTUMN_SECRET_KEY: z35__namespace.optional(z35__namespace.string()),
832
- AUTUMN_X_API_VERSION: z35__namespace._default(z35__namespace.string(), "2.4.0"),
832
+ AUTUMN_X_API_VERSION: z35__namespace._default(z35__namespace.string(), "2.5.0"),
833
833
  AUTUMN_FAIL_OPEN: z35__namespace.pipe(
834
834
  z35__namespace._default(z35__namespace.enum(["true", "false"]), "true"),
835
835
  z35__namespace.transform((v) => v === "true")
@@ -5472,8 +5472,7 @@ var RequestBody$outboundSchema = z35__namespace.pipe(
5472
5472
  properties: z35__namespace.optional(z35__namespace.record(z35__namespace.string(), z35__namespace.any())),
5473
5473
  idempotencyKey: z35__namespace.optional(z35__namespace.string()),
5474
5474
  timestamp: z35__namespace.optional(z35__namespace.int()),
5475
- overageBehavior: z35__namespace.optional(BatchTrackOverageBehavior$outboundSchema),
5476
- async: z35__namespace.optional(z35__namespace.boolean())
5475
+ overageBehavior: z35__namespace.optional(BatchTrackOverageBehavior$outboundSchema)
5477
5476
  }),
5478
5477
  z35__namespace.transform((v) => {
5479
5478
  return remap(v, {
@@ -91737,7 +91736,7 @@ var Autumn = class extends ClientSDK {
91737
91736
  ));
91738
91737
  }
91739
91738
  /**
91740
- * Records usage for a customer feature and returns updated balances.
91739
+ * Records usage for a customer feature. Queued by default; pass async: false to apply it before responding with updated balances.
91741
91740
  *
91742
91741
  * Use this after an action happens to decrement usage, or send a negative value to credit balance back.
91743
91742
  *
@@ -91761,9 +91760,9 @@ var Autumn = class extends ClientSDK {
91761
91760
  * @param properties - Additional properties to attach to this usage event. (optional)
91762
91761
  * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
91763
91762
  * @param overageBehavior - 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. (optional)
91764
- * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
91763
+ * @param async - Defaults to true: the event is queued and the response is a 202 with balance: null. Set to false to apply the usage before responding with a 200 and the updated balance. (optional)
91765
91764
  *
91766
- * @returns The usage value recorded, with either a single updated balance or a map of updated balances. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the event for replay so it can be tracked as soon as the service is restored.
91765
+ * @returns The usage value recorded. By default the event is queued and the API returns 202 with balance: null. With async: false it returns 200 with either a single updated balance or a map of updated balances, or 202 if Autumn is experiencing degraded service and accepted the event for replay.
91767
91766
  */
91768
91767
  async track(request, options) {
91769
91768
  return unwrapAsync(track(
@@ -91804,9 +91803,9 @@ var Autumn = class extends ClientSDK {
91804
91803
  * @param properties - Additional properties to attach to this usage event. (optional)
91805
91804
  * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
91806
91805
  * @param overageBehavior - 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. (optional)
91807
- * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
91806
+ * @param async - Defaults to true: the event is queued and the response is a 202 with balance: null. Set to false to apply the usage before responding with a 200 and the updated balance. (optional)
91808
91807
  *
91809
- * @returns The dollar value recorded and the updated AI credit system balance. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the token usage event for replay so it can be tracked as soon as the service is restored.
91808
+ * @returns The dollar value recorded. By default the event is queued and the API returns 202 with balance: null. With async: false it returns 200 with the updated AI credit system balance, or 202 if Autumn is experiencing degraded service and accepted the event for replay.
91810
91809
  */
91811
91810
  async trackTokens(request, options) {
91812
91811
  return unwrapAsync(trackTokens(
@@ -59,10 +59,10 @@ function serverURLFromOptions(options) {
59
59
  }
60
60
  var SDK_METADATA = {
61
61
  language: "typescript",
62
- openapiDocVersion: "2.4.0",
62
+ openapiDocVersion: "2.5.0",
63
63
  sdkVersion: "0.10.18",
64
64
  genVersion: "2.884.13",
65
- userAgent: "speakeasy-sdk/typescript 0.10.18 2.884.13 2.4.0 @useautumn/sdk"
65
+ userAgent: "speakeasy-sdk/typescript 0.10.18 2.884.13 2.5.0 @useautumn/sdk"
66
66
  };
67
67
 
68
68
  // ../sdk/src/lib/files.ts
@@ -806,7 +806,7 @@ function dlv(obj, key, def, p, undef) {
806
806
  // ../sdk/src/lib/env.ts
807
807
  var envSchema = z35.object({
808
808
  AUTUMN_SECRET_KEY: z35.optional(z35.string()),
809
- AUTUMN_X_API_VERSION: z35._default(z35.string(), "2.4.0"),
809
+ AUTUMN_X_API_VERSION: z35._default(z35.string(), "2.5.0"),
810
810
  AUTUMN_FAIL_OPEN: z35.pipe(
811
811
  z35._default(z35.enum(["true", "false"]), "true"),
812
812
  z35.transform((v) => v === "true")
@@ -5449,8 +5449,7 @@ var RequestBody$outboundSchema = z35.pipe(
5449
5449
  properties: z35.optional(z35.record(z35.string(), z35.any())),
5450
5450
  idempotencyKey: z35.optional(z35.string()),
5451
5451
  timestamp: z35.optional(z35.int()),
5452
- overageBehavior: z35.optional(BatchTrackOverageBehavior$outboundSchema),
5453
- async: z35.optional(z35.boolean())
5452
+ overageBehavior: z35.optional(BatchTrackOverageBehavior$outboundSchema)
5454
5453
  }),
5455
5454
  z35.transform((v) => {
5456
5455
  return remap(v, {
@@ -91714,7 +91713,7 @@ var Autumn = class extends ClientSDK {
91714
91713
  ));
91715
91714
  }
91716
91715
  /**
91717
- * Records usage for a customer feature and returns updated balances.
91716
+ * Records usage for a customer feature. Queued by default; pass async: false to apply it before responding with updated balances.
91718
91717
  *
91719
91718
  * Use this after an action happens to decrement usage, or send a negative value to credit balance back.
91720
91719
  *
@@ -91738,9 +91737,9 @@ var Autumn = class extends ClientSDK {
91738
91737
  * @param properties - Additional properties to attach to this usage event. (optional)
91739
91738
  * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
91740
91739
  * @param overageBehavior - 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. (optional)
91741
- * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
91740
+ * @param async - Defaults to true: the event is queued and the response is a 202 with balance: null. Set to false to apply the usage before responding with a 200 and the updated balance. (optional)
91742
91741
  *
91743
- * @returns The usage value recorded, with either a single updated balance or a map of updated balances. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the event for replay so it can be tracked as soon as the service is restored.
91742
+ * @returns The usage value recorded. By default the event is queued and the API returns 202 with balance: null. With async: false it returns 200 with either a single updated balance or a map of updated balances, or 202 if Autumn is experiencing degraded service and accepted the event for replay.
91744
91743
  */
91745
91744
  async track(request, options) {
91746
91745
  return unwrapAsync(track(
@@ -91781,9 +91780,9 @@ var Autumn = class extends ClientSDK {
91781
91780
  * @param properties - Additional properties to attach to this usage event. (optional)
91782
91781
  * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
91783
91782
  * @param overageBehavior - 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. (optional)
91784
- * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
91783
+ * @param async - Defaults to true: the event is queued and the response is a 202 with balance: null. Set to false to apply the usage before responding with a 200 and the updated balance. (optional)
91785
91784
  *
91786
- * @returns The dollar value recorded and the updated AI credit system balance. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the token usage event for replay so it can be tracked as soon as the service is restored.
91785
+ * @returns The dollar value recorded. By default the event is queued and the API returns 202 with balance: null. With async: false it returns 200 with the updated AI credit system balance, or 202 if Autumn is experiencing degraded service and accepted the event for replay.
91787
91786
  */
91788
91787
  async trackTokens(request, options) {
91789
91788
  return unwrapAsync(trackTokens(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "autumn-js",
3
3
  "description": "Autumn JS Library",
4
- "version": "1.3.73",
4
+ "version": "1.4.0",
5
5
  "repository": "github:useautumn/autumn",
6
6
  "homepage": "https://docs.useautumn.com",
7
7
  "main": "./dist/sdk/index.js",
@@ -126,5 +126,5 @@
126
126
  "optional": true
127
127
  }
128
128
  },
129
- "gitHead": "ec93f2978a086ff1cb74c764b4a77c0a679fc3fc"
129
+ "gitHead": "7980cc38c03162bdd630f83eaf617ecad926c565"
130
130
  }