@upstash/qstash 2.8.0 → 2.8.2

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BaseProvider
3
- } from "./chunk-X3J2ACLT.mjs";
3
+ } from "./chunk-H3E2J2K6.mjs";
4
4
 
5
5
  // src/client/api/email.ts
6
6
  var EmailProvider = class extends BaseProvider {
@@ -768,6 +768,9 @@ function processHeaders(request) {
768
768
  if (request.retries !== void 0) {
769
769
  headers.set("Upstash-Retries", request.retries.toFixed(0));
770
770
  }
771
+ if (request.retryDelay !== void 0) {
772
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
773
+ }
771
774
  if (request.callback !== void 0) {
772
775
  headers.set("Upstash-Callback", request.callback);
773
776
  }
@@ -783,10 +786,12 @@ function processHeaders(request) {
783
786
  }
784
787
  if (request.flowControl?.key) {
785
788
  const parallelism = request.flowControl.parallelism?.toString();
786
- const rate = request.flowControl.ratePerSecond?.toString();
789
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
790
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
787
791
  const controlValue = [
788
792
  parallelism ? `parallelism=${parallelism}` : void 0,
789
- rate ? `rate=${rate}` : void 0
793
+ rate ? `rate=${rate}` : void 0,
794
+ period ? `period=${period}` : void 0
790
795
  ].filter(Boolean);
791
796
  if (controlValue.length === 0) {
792
797
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1001,6 +1006,9 @@ var Schedules = class {
1001
1006
  if (request.retries !== void 0) {
1002
1007
  headers.set("Upstash-Retries", request.retries.toFixed(0));
1003
1008
  }
1009
+ if (request.retryDelay !== void 0) {
1010
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
1011
+ }
1004
1012
  if (request.callback !== void 0) {
1005
1013
  headers.set("Upstash-Callback", request.callback);
1006
1014
  }
@@ -1022,10 +1030,12 @@ var Schedules = class {
1022
1030
  }
1023
1031
  if (request.flowControl?.key) {
1024
1032
  const parallelism = request.flowControl.parallelism?.toString();
1025
- const rate = request.flowControl.ratePerSecond?.toString();
1033
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1034
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1026
1035
  const controlValue = [
1027
1036
  parallelism ? `parallelism=${parallelism}` : void 0,
1028
- rate ? `rate=${rate}` : void 0
1037
+ rate ? `rate=${rate}` : void 0,
1038
+ period ? `period=${period}` : void 0
1029
1039
  ].filter(Boolean);
1030
1040
  if (controlValue.length === 0) {
1031
1041
  throw new QstashError(
@@ -1164,7 +1174,7 @@ var UrlGroups = class {
1164
1174
  };
1165
1175
 
1166
1176
  // version.ts
1167
- var VERSION = "v2.8.0";
1177
+ var VERSION = "v2.8.2";
1168
1178
 
1169
1179
  // src/client/client.ts
1170
1180
  var Client = class {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Receiver,
3
3
  serve
4
- } from "./chunk-X3J2ACLT.mjs";
4
+ } from "./chunk-H3E2J2K6.mjs";
5
5
 
6
6
  // node_modules/defu/dist/defu.mjs
7
7
  function isPlainObject(value) {
@@ -62,6 +62,9 @@ declare class Receiver {
62
62
  private verifyBodyAndUrl;
63
63
  }
64
64
 
65
+ type Unit = "s" | "m" | "h" | "d";
66
+ type Duration = `${bigint}${Unit}`;
67
+
65
68
  type State = "CREATED" | "ACTIVE" | "DELIVERED" | "ERROR" | "RETRY" | "FAILED" | "CANCELED" | "IN_PROGRESS";
66
69
  type HTTPMethods = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
67
70
  type Log = {
@@ -135,8 +138,27 @@ type FlowControl = {
135
138
  parallelism: number;
136
139
  /**
137
140
  * number of requests to activate per second with the same flow control key
141
+ *
142
+ * @deprecated use rate instead
138
143
  */
139
144
  ratePerSecond?: number;
145
+ /**
146
+ * number of requests to activate within the period with the same flow control key.
147
+ *
148
+ * Default period is a second.
149
+ */
150
+ rate?: number;
151
+ /**
152
+ * The time interval for the `rate` limit.
153
+ *
154
+ * For example, if `rate` is 10 and `period` is "1s" (or 1), then 10 requests can be activated per second.
155
+ * If `rate` is 5 and `period` is "1m" (or 60), then 5 requests can be activated per minute.
156
+ *
157
+ * Defaults to "1s" (one second) if not specified.
158
+ *
159
+ * Can be specified as a number (in seconds) or a duration string (e.g., "10s", "5m", "1h", "2d").
160
+ */
161
+ period?: Duration | number;
140
162
  } | {
141
163
  /**
142
164
  * number of requests which can be active with the same flow control key
@@ -144,8 +166,53 @@ type FlowControl = {
144
166
  parallelism?: number;
145
167
  /**
146
168
  * number of requests to activate per second with the same flow control key
169
+ *
170
+ * @deprecated use rate instead
147
171
  */
148
172
  ratePerSecond: number;
173
+ /**
174
+ * number of requests to activate within the period with the same flow control key.
175
+ * Default period is a second.
176
+ */
177
+ rate?: number;
178
+ /**
179
+ * The time interval for the `rate` limit.
180
+ *
181
+ * For example, if `rate` is 10 and `period` is "1s" (or 1), then 10 requests can be activated per second.
182
+ * If `rate` is 5 and `period` is "1m" (or 60), then 5 requests can be activated per minute.
183
+ *
184
+ * Defaults to "1s" (one second) if not specified.
185
+ *
186
+ * Can be specified as a number (in seconds) or a duration string (e.g., "10s", "5m", "1h", "2d").
187
+ */
188
+ period?: Duration | number;
189
+ } | {
190
+ /**
191
+ * number of requests which can be active with the same flow control key
192
+ */
193
+ parallelism?: number;
194
+ /**
195
+ * number of requests to activate per second with the same flow control key
196
+ *
197
+ * @deprecated use rate instead
198
+ */
199
+ ratePerSecond?: number;
200
+ /**
201
+ * number of requests to activate within the period with the same flow control key.
202
+ * Default period is a second.
203
+ */
204
+ rate: number;
205
+ /**
206
+ * The time interval for the `rate` limit.
207
+ *
208
+ * For example, if `rate` is 10 and `period` is "1s" (or 1), then 10 requests can be activated per second.
209
+ * If `rate` is 5 and `period` is "1m" (or 60), then 5 requests can be activated per minute.
210
+ *
211
+ * Defaults to "1s" (one second) if not specified.
212
+ *
213
+ * Can be specified as a number (in seconds) or a duration string (e.g., "10s", "5m", "1h", "2d").
214
+ */
215
+ period?: Duration | number;
149
216
  });
150
217
 
151
218
  type ProviderInfo = {
@@ -472,6 +539,11 @@ type Message = {
472
539
  * Maxmimum number of retries.
473
540
  */
474
541
  maxRetries?: number;
542
+ /**
543
+ * The retry delay expression for this message,
544
+ * if retry_delay was set when publishing the message.
545
+ */
546
+ retryDelayExpression?: PublishRequest["retryDelay"];
475
547
  /**
476
548
  * A unix timestamp (milliseconds) after which this message may get delivered.
477
549
  */
@@ -510,8 +582,22 @@ type Message = {
510
582
  parallelism?: number;
511
583
  /**
512
584
  * number of requests to activate per second with the same flow control key
585
+ *
586
+ * @deprecated use rate instead
513
587
  */
514
588
  ratePerSecond?: number;
589
+ /**
590
+ * number of requests to activate within the period with the same flow control key.
591
+ * Default period is a second.
592
+ */
593
+ rate?: number;
594
+ /**
595
+ * The time interval during which the specified `rate` of requests can be activated
596
+ * using the same flow control key.
597
+ *
598
+ * In seconds.
599
+ */
600
+ period?: number;
515
601
  };
516
602
  type MessagePayload = Omit<Message, "urlGroup"> & {
517
603
  topicName: string;
@@ -625,9 +711,6 @@ declare class DLQ {
625
711
  }>;
626
712
  }
627
713
 
628
- type Unit = "s" | "m" | "h" | "d";
629
- type Duration = `${bigint}${Unit}`;
630
-
631
714
  declare class Chat {
632
715
  private http;
633
716
  private token;
@@ -750,7 +833,23 @@ type Schedule = {
750
833
  queueName?: string;
751
834
  flowControlKey?: string;
752
835
  parallelism?: number;
836
+ rate?: number;
837
+ /**
838
+ * @deprecated use rate instead
839
+ */
753
840
  ratePerSecond?: number;
841
+ /**
842
+ * The time interval during which the specified `rate` of requests can be activated
843
+ * using the same flow control key.
844
+ *
845
+ * In seconds.
846
+ */
847
+ period?: number;
848
+ /**
849
+ * The retry delay expression for this schedule,
850
+ * if retry_delay was set when creating the schedule.
851
+ */
852
+ retryDelayExpression?: PublishRequest["retryDelay"];
754
853
  };
755
854
  type CreateScheduleRequest = {
756
855
  /**
@@ -844,7 +943,7 @@ type CreateScheduleRequest = {
844
943
  * and number of requests per second with the same key.
845
944
  */
846
945
  flowControl?: FlowControl;
847
- };
946
+ } & Pick<PublishRequest, "retryDelay">;
848
947
  declare class Schedules {
849
948
  private readonly http;
850
949
  constructor(http: Requester);
@@ -1734,6 +1833,37 @@ type PublishRequest<TBody = BodyInit> = {
1734
1833
  * @default 3
1735
1834
  */
1736
1835
  retries?: number;
1836
+ /**
1837
+ * Delay between retries.
1838
+ *
1839
+ * By default, the `retryDelay` is exponential backoff.
1840
+ * More details can be found in: https://upstash.com/docs/qstash/features/retry.
1841
+ *
1842
+ * The `retryDelay` option allows you to customize the delay (in milliseconds) between retry attempts when message delivery fails.
1843
+ *
1844
+ * You can use mathematical expressions and the following built-in functions to calculate the delay dynamically.
1845
+ * The special variable `retried` represents the current retry attempt count (starting from 0).
1846
+ *
1847
+ * Supported functions:
1848
+ * - `pow`
1849
+ * - `sqrt`
1850
+ * - `abs`
1851
+ * - `exp`
1852
+ * - `floor`
1853
+ * - `ceil`
1854
+ * - `round`
1855
+ * - `min`
1856
+ * - `max`
1857
+ *
1858
+ * Examples of valid `retryDelay` values:
1859
+ * ```ts
1860
+ * 1000 // 1 second
1861
+ * 1000 * (1 + retried) // 1 second multiplied by the current retry attempt
1862
+ * pow(2, retried) // 2 to the power of the current retry attempt
1863
+ * max(10, pow(2, retried)) // The greater of 10 or 2^retried
1864
+ * ```
1865
+ */
1866
+ retryDelay?: string;
1737
1867
  /**
1738
1868
  * Use a failure callback url to handle messages that could not be delivered.
1739
1869
  *
@@ -62,6 +62,9 @@ declare class Receiver {
62
62
  private verifyBodyAndUrl;
63
63
  }
64
64
 
65
+ type Unit = "s" | "m" | "h" | "d";
66
+ type Duration = `${bigint}${Unit}`;
67
+
65
68
  type State = "CREATED" | "ACTIVE" | "DELIVERED" | "ERROR" | "RETRY" | "FAILED" | "CANCELED" | "IN_PROGRESS";
66
69
  type HTTPMethods = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
67
70
  type Log = {
@@ -135,8 +138,27 @@ type FlowControl = {
135
138
  parallelism: number;
136
139
  /**
137
140
  * number of requests to activate per second with the same flow control key
141
+ *
142
+ * @deprecated use rate instead
138
143
  */
139
144
  ratePerSecond?: number;
145
+ /**
146
+ * number of requests to activate within the period with the same flow control key.
147
+ *
148
+ * Default period is a second.
149
+ */
150
+ rate?: number;
151
+ /**
152
+ * The time interval for the `rate` limit.
153
+ *
154
+ * For example, if `rate` is 10 and `period` is "1s" (or 1), then 10 requests can be activated per second.
155
+ * If `rate` is 5 and `period` is "1m" (or 60), then 5 requests can be activated per minute.
156
+ *
157
+ * Defaults to "1s" (one second) if not specified.
158
+ *
159
+ * Can be specified as a number (in seconds) or a duration string (e.g., "10s", "5m", "1h", "2d").
160
+ */
161
+ period?: Duration | number;
140
162
  } | {
141
163
  /**
142
164
  * number of requests which can be active with the same flow control key
@@ -144,8 +166,53 @@ type FlowControl = {
144
166
  parallelism?: number;
145
167
  /**
146
168
  * number of requests to activate per second with the same flow control key
169
+ *
170
+ * @deprecated use rate instead
147
171
  */
148
172
  ratePerSecond: number;
173
+ /**
174
+ * number of requests to activate within the period with the same flow control key.
175
+ * Default period is a second.
176
+ */
177
+ rate?: number;
178
+ /**
179
+ * The time interval for the `rate` limit.
180
+ *
181
+ * For example, if `rate` is 10 and `period` is "1s" (or 1), then 10 requests can be activated per second.
182
+ * If `rate` is 5 and `period` is "1m" (or 60), then 5 requests can be activated per minute.
183
+ *
184
+ * Defaults to "1s" (one second) if not specified.
185
+ *
186
+ * Can be specified as a number (in seconds) or a duration string (e.g., "10s", "5m", "1h", "2d").
187
+ */
188
+ period?: Duration | number;
189
+ } | {
190
+ /**
191
+ * number of requests which can be active with the same flow control key
192
+ */
193
+ parallelism?: number;
194
+ /**
195
+ * number of requests to activate per second with the same flow control key
196
+ *
197
+ * @deprecated use rate instead
198
+ */
199
+ ratePerSecond?: number;
200
+ /**
201
+ * number of requests to activate within the period with the same flow control key.
202
+ * Default period is a second.
203
+ */
204
+ rate: number;
205
+ /**
206
+ * The time interval for the `rate` limit.
207
+ *
208
+ * For example, if `rate` is 10 and `period` is "1s" (or 1), then 10 requests can be activated per second.
209
+ * If `rate` is 5 and `period` is "1m" (or 60), then 5 requests can be activated per minute.
210
+ *
211
+ * Defaults to "1s" (one second) if not specified.
212
+ *
213
+ * Can be specified as a number (in seconds) or a duration string (e.g., "10s", "5m", "1h", "2d").
214
+ */
215
+ period?: Duration | number;
149
216
  });
150
217
 
151
218
  type ProviderInfo = {
@@ -472,6 +539,11 @@ type Message = {
472
539
  * Maxmimum number of retries.
473
540
  */
474
541
  maxRetries?: number;
542
+ /**
543
+ * The retry delay expression for this message,
544
+ * if retry_delay was set when publishing the message.
545
+ */
546
+ retryDelayExpression?: PublishRequest["retryDelay"];
475
547
  /**
476
548
  * A unix timestamp (milliseconds) after which this message may get delivered.
477
549
  */
@@ -510,8 +582,22 @@ type Message = {
510
582
  parallelism?: number;
511
583
  /**
512
584
  * number of requests to activate per second with the same flow control key
585
+ *
586
+ * @deprecated use rate instead
513
587
  */
514
588
  ratePerSecond?: number;
589
+ /**
590
+ * number of requests to activate within the period with the same flow control key.
591
+ * Default period is a second.
592
+ */
593
+ rate?: number;
594
+ /**
595
+ * The time interval during which the specified `rate` of requests can be activated
596
+ * using the same flow control key.
597
+ *
598
+ * In seconds.
599
+ */
600
+ period?: number;
515
601
  };
516
602
  type MessagePayload = Omit<Message, "urlGroup"> & {
517
603
  topicName: string;
@@ -625,9 +711,6 @@ declare class DLQ {
625
711
  }>;
626
712
  }
627
713
 
628
- type Unit = "s" | "m" | "h" | "d";
629
- type Duration = `${bigint}${Unit}`;
630
-
631
714
  declare class Chat {
632
715
  private http;
633
716
  private token;
@@ -750,7 +833,23 @@ type Schedule = {
750
833
  queueName?: string;
751
834
  flowControlKey?: string;
752
835
  parallelism?: number;
836
+ rate?: number;
837
+ /**
838
+ * @deprecated use rate instead
839
+ */
753
840
  ratePerSecond?: number;
841
+ /**
842
+ * The time interval during which the specified `rate` of requests can be activated
843
+ * using the same flow control key.
844
+ *
845
+ * In seconds.
846
+ */
847
+ period?: number;
848
+ /**
849
+ * The retry delay expression for this schedule,
850
+ * if retry_delay was set when creating the schedule.
851
+ */
852
+ retryDelayExpression?: PublishRequest["retryDelay"];
754
853
  };
755
854
  type CreateScheduleRequest = {
756
855
  /**
@@ -844,7 +943,7 @@ type CreateScheduleRequest = {
844
943
  * and number of requests per second with the same key.
845
944
  */
846
945
  flowControl?: FlowControl;
847
- };
946
+ } & Pick<PublishRequest, "retryDelay">;
848
947
  declare class Schedules {
849
948
  private readonly http;
850
949
  constructor(http: Requester);
@@ -1734,6 +1833,37 @@ type PublishRequest<TBody = BodyInit> = {
1734
1833
  * @default 3
1735
1834
  */
1736
1835
  retries?: number;
1836
+ /**
1837
+ * Delay between retries.
1838
+ *
1839
+ * By default, the `retryDelay` is exponential backoff.
1840
+ * More details can be found in: https://upstash.com/docs/qstash/features/retry.
1841
+ *
1842
+ * The `retryDelay` option allows you to customize the delay (in milliseconds) between retry attempts when message delivery fails.
1843
+ *
1844
+ * You can use mathematical expressions and the following built-in functions to calculate the delay dynamically.
1845
+ * The special variable `retried` represents the current retry attempt count (starting from 0).
1846
+ *
1847
+ * Supported functions:
1848
+ * - `pow`
1849
+ * - `sqrt`
1850
+ * - `abs`
1851
+ * - `exp`
1852
+ * - `floor`
1853
+ * - `ceil`
1854
+ * - `round`
1855
+ * - `min`
1856
+ * - `max`
1857
+ *
1858
+ * Examples of valid `retryDelay` values:
1859
+ * ```ts
1860
+ * 1000 // 1 second
1861
+ * 1000 * (1 + retried) // 1 second multiplied by the current retry attempt
1862
+ * pow(2, retried) // 2 to the power of the current retry attempt
1863
+ * max(10, pow(2, retried)) // The greater of 10 or 2^retried
1864
+ * ```
1865
+ */
1866
+ retryDelay?: string;
1737
1867
  /**
1738
1868
  * Use a failure callback url to handle messages that could not be delivered.
1739
1869
  *
package/cloudflare.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BQXugsxm.mjs';
1
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.mjs';
2
2
  import 'neverthrow';
3
3
 
4
4
  type WorkflowBindings = {
package/cloudflare.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BQXugsxm.js';
1
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.js';
2
2
  import 'neverthrow';
3
3
 
4
4
  type WorkflowBindings = {
package/cloudflare.js CHANGED
@@ -788,6 +788,9 @@ function processHeaders(request) {
788
788
  if (request.retries !== void 0) {
789
789
  headers.set("Upstash-Retries", request.retries.toFixed(0));
790
790
  }
791
+ if (request.retryDelay !== void 0) {
792
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
793
+ }
791
794
  if (request.callback !== void 0) {
792
795
  headers.set("Upstash-Callback", request.callback);
793
796
  }
@@ -803,10 +806,12 @@ function processHeaders(request) {
803
806
  }
804
807
  if (request.flowControl?.key) {
805
808
  const parallelism = request.flowControl.parallelism?.toString();
806
- const rate = request.flowControl.ratePerSecond?.toString();
809
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
810
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
807
811
  const controlValue = [
808
812
  parallelism ? `parallelism=${parallelism}` : void 0,
809
- rate ? `rate=${rate}` : void 0
813
+ rate ? `rate=${rate}` : void 0,
814
+ period ? `period=${period}` : void 0
810
815
  ].filter(Boolean);
811
816
  if (controlValue.length === 0) {
812
817
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1021,6 +1026,9 @@ var Schedules = class {
1021
1026
  if (request.retries !== void 0) {
1022
1027
  headers.set("Upstash-Retries", request.retries.toFixed(0));
1023
1028
  }
1029
+ if (request.retryDelay !== void 0) {
1030
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
1031
+ }
1024
1032
  if (request.callback !== void 0) {
1025
1033
  headers.set("Upstash-Callback", request.callback);
1026
1034
  }
@@ -1042,10 +1050,12 @@ var Schedules = class {
1042
1050
  }
1043
1051
  if (request.flowControl?.key) {
1044
1052
  const parallelism = request.flowControl.parallelism?.toString();
1045
- const rate = request.flowControl.ratePerSecond?.toString();
1053
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1054
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1046
1055
  const controlValue = [
1047
1056
  parallelism ? `parallelism=${parallelism}` : void 0,
1048
- rate ? `rate=${rate}` : void 0
1057
+ rate ? `rate=${rate}` : void 0,
1058
+ period ? `period=${period}` : void 0
1049
1059
  ].filter(Boolean);
1050
1060
  if (controlValue.length === 0) {
1051
1061
  throw new QstashError(
@@ -1184,7 +1194,7 @@ var UrlGroups = class {
1184
1194
  };
1185
1195
 
1186
1196
  // version.ts
1187
- var VERSION = "v2.8.0";
1197
+ var VERSION = "v2.8.2";
1188
1198
 
1189
1199
  // src/client/client.ts
1190
1200
  var Client = class {
package/cloudflare.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  serve
3
- } from "./chunk-X3J2ACLT.mjs";
3
+ } from "./chunk-H3E2J2K6.mjs";
4
4
 
5
5
  // platforms/cloudflare.ts
6
6
  var getArgs = (args) => {
package/h3.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as h3 from 'h3';
2
2
  import { H3Event } from 'h3';
3
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BQXugsxm.mjs';
3
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.mjs';
4
4
  import 'neverthrow';
5
5
 
6
6
  type VerifySignatureConfig = {
package/h3.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as h3 from 'h3';
2
2
  import { H3Event } from 'h3';
3
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BQXugsxm.js';
3
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.js';
4
4
  import 'neverthrow';
5
5
 
6
6
  type VerifySignatureConfig = {
package/h3.js CHANGED
@@ -1112,6 +1112,9 @@ function processHeaders(request) {
1112
1112
  if (request.retries !== void 0) {
1113
1113
  headers.set("Upstash-Retries", request.retries.toFixed(0));
1114
1114
  }
1115
+ if (request.retryDelay !== void 0) {
1116
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
1117
+ }
1115
1118
  if (request.callback !== void 0) {
1116
1119
  headers.set("Upstash-Callback", request.callback);
1117
1120
  }
@@ -1127,10 +1130,12 @@ function processHeaders(request) {
1127
1130
  }
1128
1131
  if (request.flowControl?.key) {
1129
1132
  const parallelism = request.flowControl.parallelism?.toString();
1130
- const rate = request.flowControl.ratePerSecond?.toString();
1133
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1134
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1131
1135
  const controlValue = [
1132
1136
  parallelism ? `parallelism=${parallelism}` : void 0,
1133
- rate ? `rate=${rate}` : void 0
1137
+ rate ? `rate=${rate}` : void 0,
1138
+ period ? `period=${period}` : void 0
1134
1139
  ].filter(Boolean);
1135
1140
  if (controlValue.length === 0) {
1136
1141
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1345,6 +1350,9 @@ var Schedules = class {
1345
1350
  if (request.retries !== void 0) {
1346
1351
  headers.set("Upstash-Retries", request.retries.toFixed(0));
1347
1352
  }
1353
+ if (request.retryDelay !== void 0) {
1354
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
1355
+ }
1348
1356
  if (request.callback !== void 0) {
1349
1357
  headers.set("Upstash-Callback", request.callback);
1350
1358
  }
@@ -1366,10 +1374,12 @@ var Schedules = class {
1366
1374
  }
1367
1375
  if (request.flowControl?.key) {
1368
1376
  const parallelism = request.flowControl.parallelism?.toString();
1369
- const rate = request.flowControl.ratePerSecond?.toString();
1377
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1378
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1370
1379
  const controlValue = [
1371
1380
  parallelism ? `parallelism=${parallelism}` : void 0,
1372
- rate ? `rate=${rate}` : void 0
1381
+ rate ? `rate=${rate}` : void 0,
1382
+ period ? `period=${period}` : void 0
1373
1383
  ].filter(Boolean);
1374
1384
  if (controlValue.length === 0) {
1375
1385
  throw new QstashError(
@@ -2894,7 +2904,7 @@ var Workflow = class {
2894
2904
  };
2895
2905
 
2896
2906
  // version.ts
2897
- var VERSION = "v2.8.0";
2907
+ var VERSION = "v2.8.2";
2898
2908
 
2899
2909
  // src/client/client.ts
2900
2910
  var Client = class {
package/h3.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  serve,
3
3
  verifySignatureH3
4
- } from "./chunk-PWDZVKVD.mjs";
5
- import "./chunk-UJ7YXITX.mjs";
6
- import "./chunk-X3J2ACLT.mjs";
4
+ } from "./chunk-RW3CBR2S.mjs";
5
+ import "./chunk-4XJ4NO33.mjs";
6
+ import "./chunk-H3E2J2K6.mjs";
7
7
  export {
8
8
  serve,
9
9
  verifySignatureH3
package/hono.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Context } from 'hono';
2
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BQXugsxm.mjs';
2
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.mjs';
3
3
  import 'neverthrow';
4
4
 
5
5
  type WorkflowBindings = {
package/hono.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Context } from 'hono';
2
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BQXugsxm.js';
2
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.js';
3
3
  import 'neverthrow';
4
4
 
5
5
  type WorkflowBindings = {
package/hono.js CHANGED
@@ -788,6 +788,9 @@ function processHeaders(request) {
788
788
  if (request.retries !== void 0) {
789
789
  headers.set("Upstash-Retries", request.retries.toFixed(0));
790
790
  }
791
+ if (request.retryDelay !== void 0) {
792
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
793
+ }
791
794
  if (request.callback !== void 0) {
792
795
  headers.set("Upstash-Callback", request.callback);
793
796
  }
@@ -803,10 +806,12 @@ function processHeaders(request) {
803
806
  }
804
807
  if (request.flowControl?.key) {
805
808
  const parallelism = request.flowControl.parallelism?.toString();
806
- const rate = request.flowControl.ratePerSecond?.toString();
809
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
810
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
807
811
  const controlValue = [
808
812
  parallelism ? `parallelism=${parallelism}` : void 0,
809
- rate ? `rate=${rate}` : void 0
813
+ rate ? `rate=${rate}` : void 0,
814
+ period ? `period=${period}` : void 0
810
815
  ].filter(Boolean);
811
816
  if (controlValue.length === 0) {
812
817
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1021,6 +1026,9 @@ var Schedules = class {
1021
1026
  if (request.retries !== void 0) {
1022
1027
  headers.set("Upstash-Retries", request.retries.toFixed(0));
1023
1028
  }
1029
+ if (request.retryDelay !== void 0) {
1030
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
1031
+ }
1024
1032
  if (request.callback !== void 0) {
1025
1033
  headers.set("Upstash-Callback", request.callback);
1026
1034
  }
@@ -1042,10 +1050,12 @@ var Schedules = class {
1042
1050
  }
1043
1051
  if (request.flowControl?.key) {
1044
1052
  const parallelism = request.flowControl.parallelism?.toString();
1045
- const rate = request.flowControl.ratePerSecond?.toString();
1053
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1054
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1046
1055
  const controlValue = [
1047
1056
  parallelism ? `parallelism=${parallelism}` : void 0,
1048
- rate ? `rate=${rate}` : void 0
1057
+ rate ? `rate=${rate}` : void 0,
1058
+ period ? `period=${period}` : void 0
1049
1059
  ].filter(Boolean);
1050
1060
  if (controlValue.length === 0) {
1051
1061
  throw new QstashError(
@@ -1184,7 +1194,7 @@ var UrlGroups = class {
1184
1194
  };
1185
1195
 
1186
1196
  // version.ts
1187
- var VERSION = "v2.8.0";
1197
+ var VERSION = "v2.8.2";
1188
1198
 
1189
1199
  // src/client/client.ts
1190
1200
  var Client = class {
package/hono.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  serve
3
- } from "./chunk-X3J2ACLT.mjs";
3
+ } from "./chunk-H3E2J2K6.mjs";
4
4
 
5
5
  // platforms/hono.ts
6
6
  var serve2 = (routeFunction, options) => {
package/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as RateLimit, C as ChatRateLimit, S as Step, F as FailureFunctionPayload, L as LLMOwner, B as BaseProvider, E as EmailOwner, P as ProviderInfo } from './client-BQXugsxm.mjs';
2
- export { A as AddEndpointsRequest, K as BodyInit, X as Chat, Z as ChatCompletion, _ as ChatCompletionChunk, Y as ChatCompletionMessage, a4 as ChatRequest, j as Client, r as CreateScheduleRequest, t as Endpoint, y as Event, D as EventPayload, h as EventsRequest, T as FlowControl, J as GetEventsPayload, i as GetEventsResponse, I as GetLogsPayload, G as GetLogsResponse, H as HTTPMethods, N as HeadersInit, x as Log, z as LogPayload, g as LogsRequest, M as Message, o as MessagePayload, p as Messages, a2 as OpenAIChatModel, a3 as PromptChatRequest, d as PublishBatchRequest, f as PublishJsonRequest, e as PublishRequest, n as PublishResponse, k as PublishToApiResponse, m as PublishToUrlGroupsResponse, l as PublishToUrlResponse, Q as QueueRequest, c as Receiver, a as ReceiverConfig, u as RemoveEndpointsRequest, O as RequestOptions, q as Schedule, s as Schedules, b as SignatureError, w as State, a0 as StreamDisabled, $ as StreamEnabled, a1 as StreamParameter, U as UrlGroup, v as UrlGroups, V as VerifyRequest, W as WithCursor, a7 as anthropic, a8 as custom, a6 as openai, a5 as upstash } from './client-BQXugsxm.mjs';
1
+ import { R as RateLimit, C as ChatRateLimit, S as Step, F as FailureFunctionPayload, L as LLMOwner, B as BaseProvider, E as EmailOwner, P as ProviderInfo } from './client-C3waRcAY.mjs';
2
+ export { A as AddEndpointsRequest, K as BodyInit, X as Chat, Z as ChatCompletion, _ as ChatCompletionChunk, Y as ChatCompletionMessage, a4 as ChatRequest, j as Client, r as CreateScheduleRequest, t as Endpoint, y as Event, D as EventPayload, h as EventsRequest, T as FlowControl, J as GetEventsPayload, i as GetEventsResponse, I as GetLogsPayload, G as GetLogsResponse, H as HTTPMethods, N as HeadersInit, x as Log, z as LogPayload, g as LogsRequest, M as Message, o as MessagePayload, p as Messages, a2 as OpenAIChatModel, a3 as PromptChatRequest, d as PublishBatchRequest, f as PublishJsonRequest, e as PublishRequest, n as PublishResponse, k as PublishToApiResponse, m as PublishToUrlGroupsResponse, l as PublishToUrlResponse, Q as QueueRequest, c as Receiver, a as ReceiverConfig, u as RemoveEndpointsRequest, O as RequestOptions, q as Schedule, s as Schedules, b as SignatureError, w as State, a0 as StreamDisabled, $ as StreamEnabled, a1 as StreamParameter, U as UrlGroup, v as UrlGroups, V as VerifyRequest, W as WithCursor, a7 as anthropic, a8 as custom, a6 as openai, a5 as upstash } from './client-C3waRcAY.mjs';
3
3
  import 'neverthrow';
4
4
 
5
5
  /**
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as RateLimit, C as ChatRateLimit, S as Step, F as FailureFunctionPayload, L as LLMOwner, B as BaseProvider, E as EmailOwner, P as ProviderInfo } from './client-BQXugsxm.js';
2
- export { A as AddEndpointsRequest, K as BodyInit, X as Chat, Z as ChatCompletion, _ as ChatCompletionChunk, Y as ChatCompletionMessage, a4 as ChatRequest, j as Client, r as CreateScheduleRequest, t as Endpoint, y as Event, D as EventPayload, h as EventsRequest, T as FlowControl, J as GetEventsPayload, i as GetEventsResponse, I as GetLogsPayload, G as GetLogsResponse, H as HTTPMethods, N as HeadersInit, x as Log, z as LogPayload, g as LogsRequest, M as Message, o as MessagePayload, p as Messages, a2 as OpenAIChatModel, a3 as PromptChatRequest, d as PublishBatchRequest, f as PublishJsonRequest, e as PublishRequest, n as PublishResponse, k as PublishToApiResponse, m as PublishToUrlGroupsResponse, l as PublishToUrlResponse, Q as QueueRequest, c as Receiver, a as ReceiverConfig, u as RemoveEndpointsRequest, O as RequestOptions, q as Schedule, s as Schedules, b as SignatureError, w as State, a0 as StreamDisabled, $ as StreamEnabled, a1 as StreamParameter, U as UrlGroup, v as UrlGroups, V as VerifyRequest, W as WithCursor, a7 as anthropic, a8 as custom, a6 as openai, a5 as upstash } from './client-BQXugsxm.js';
1
+ import { R as RateLimit, C as ChatRateLimit, S as Step, F as FailureFunctionPayload, L as LLMOwner, B as BaseProvider, E as EmailOwner, P as ProviderInfo } from './client-C3waRcAY.js';
2
+ export { A as AddEndpointsRequest, K as BodyInit, X as Chat, Z as ChatCompletion, _ as ChatCompletionChunk, Y as ChatCompletionMessage, a4 as ChatRequest, j as Client, r as CreateScheduleRequest, t as Endpoint, y as Event, D as EventPayload, h as EventsRequest, T as FlowControl, J as GetEventsPayload, i as GetEventsResponse, I as GetLogsPayload, G as GetLogsResponse, H as HTTPMethods, N as HeadersInit, x as Log, z as LogPayload, g as LogsRequest, M as Message, o as MessagePayload, p as Messages, a2 as OpenAIChatModel, a3 as PromptChatRequest, d as PublishBatchRequest, f as PublishJsonRequest, e as PublishRequest, n as PublishResponse, k as PublishToApiResponse, m as PublishToUrlGroupsResponse, l as PublishToUrlResponse, Q as QueueRequest, c as Receiver, a as ReceiverConfig, u as RemoveEndpointsRequest, O as RequestOptions, q as Schedule, s as Schedules, b as SignatureError, w as State, a0 as StreamDisabled, $ as StreamEnabled, a1 as StreamParameter, U as UrlGroup, v as UrlGroups, V as VerifyRequest, W as WithCursor, a7 as anthropic, a8 as custom, a6 as openai, a5 as upstash } from './client-C3waRcAY.js';
3
3
  import 'neverthrow';
4
4
 
5
5
  /**
package/index.js CHANGED
@@ -824,6 +824,9 @@ function processHeaders(request) {
824
824
  if (request.retries !== void 0) {
825
825
  headers.set("Upstash-Retries", request.retries.toFixed(0));
826
826
  }
827
+ if (request.retryDelay !== void 0) {
828
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
829
+ }
827
830
  if (request.callback !== void 0) {
828
831
  headers.set("Upstash-Callback", request.callback);
829
832
  }
@@ -839,10 +842,12 @@ function processHeaders(request) {
839
842
  }
840
843
  if (request.flowControl?.key) {
841
844
  const parallelism = request.flowControl.parallelism?.toString();
842
- const rate = request.flowControl.ratePerSecond?.toString();
845
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
846
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
843
847
  const controlValue = [
844
848
  parallelism ? `parallelism=${parallelism}` : void 0,
845
- rate ? `rate=${rate}` : void 0
849
+ rate ? `rate=${rate}` : void 0,
850
+ period ? `period=${period}` : void 0
846
851
  ].filter(Boolean);
847
852
  if (controlValue.length === 0) {
848
853
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1052,6 +1057,9 @@ var Schedules = class {
1052
1057
  if (request.retries !== void 0) {
1053
1058
  headers.set("Upstash-Retries", request.retries.toFixed(0));
1054
1059
  }
1060
+ if (request.retryDelay !== void 0) {
1061
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
1062
+ }
1055
1063
  if (request.callback !== void 0) {
1056
1064
  headers.set("Upstash-Callback", request.callback);
1057
1065
  }
@@ -1073,10 +1081,12 @@ var Schedules = class {
1073
1081
  }
1074
1082
  if (request.flowControl?.key) {
1075
1083
  const parallelism = request.flowControl.parallelism?.toString();
1076
- const rate = request.flowControl.ratePerSecond?.toString();
1084
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1085
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1077
1086
  const controlValue = [
1078
1087
  parallelism ? `parallelism=${parallelism}` : void 0,
1079
- rate ? `rate=${rate}` : void 0
1088
+ rate ? `rate=${rate}` : void 0,
1089
+ period ? `period=${period}` : void 0
1080
1090
  ].filter(Boolean);
1081
1091
  if (controlValue.length === 0) {
1082
1092
  throw new QstashError(
@@ -1246,7 +1256,7 @@ var Workflow = class {
1246
1256
  };
1247
1257
 
1248
1258
  // version.ts
1249
- var VERSION = "v2.8.0";
1259
+ var VERSION = "v2.8.2";
1250
1260
 
1251
1261
  // src/client/client.ts
1252
1262
  var Client = class {
package/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resend
3
- } from "./chunk-UJ7YXITX.mjs";
3
+ } from "./chunk-4XJ4NO33.mjs";
4
4
  import {
5
5
  Chat,
6
6
  Client,
@@ -22,7 +22,7 @@ import {
22
22
  openai,
23
23
  setupAnalytics,
24
24
  upstash
25
- } from "./chunk-X3J2ACLT.mjs";
25
+ } from "./chunk-H3E2J2K6.mjs";
26
26
  export {
27
27
  Chat,
28
28
  Client,
package/nextjs.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { NextApiHandler } from 'next';
2
2
  import { NextRequest, NextFetchEvent } from 'next/server';
3
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BQXugsxm.mjs';
3
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.mjs';
4
4
  import 'neverthrow';
5
5
 
6
6
  type VerifySignatureConfig = {
package/nextjs.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { NextApiHandler } from 'next';
2
2
  import { NextRequest, NextFetchEvent } from 'next/server';
3
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BQXugsxm.js';
3
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.js';
4
4
  import 'neverthrow';
5
5
 
6
6
  type VerifySignatureConfig = {
package/nextjs.js CHANGED
@@ -792,6 +792,9 @@ function processHeaders(request) {
792
792
  if (request.retries !== void 0) {
793
793
  headers.set("Upstash-Retries", request.retries.toFixed(0));
794
794
  }
795
+ if (request.retryDelay !== void 0) {
796
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
797
+ }
795
798
  if (request.callback !== void 0) {
796
799
  headers.set("Upstash-Callback", request.callback);
797
800
  }
@@ -807,10 +810,12 @@ function processHeaders(request) {
807
810
  }
808
811
  if (request.flowControl?.key) {
809
812
  const parallelism = request.flowControl.parallelism?.toString();
810
- const rate = request.flowControl.ratePerSecond?.toString();
813
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
814
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
811
815
  const controlValue = [
812
816
  parallelism ? `parallelism=${parallelism}` : void 0,
813
- rate ? `rate=${rate}` : void 0
817
+ rate ? `rate=${rate}` : void 0,
818
+ period ? `period=${period}` : void 0
814
819
  ].filter(Boolean);
815
820
  if (controlValue.length === 0) {
816
821
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1025,6 +1030,9 @@ var Schedules = class {
1025
1030
  if (request.retries !== void 0) {
1026
1031
  headers.set("Upstash-Retries", request.retries.toFixed(0));
1027
1032
  }
1033
+ if (request.retryDelay !== void 0) {
1034
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
1035
+ }
1028
1036
  if (request.callback !== void 0) {
1029
1037
  headers.set("Upstash-Callback", request.callback);
1030
1038
  }
@@ -1046,10 +1054,12 @@ var Schedules = class {
1046
1054
  }
1047
1055
  if (request.flowControl?.key) {
1048
1056
  const parallelism = request.flowControl.parallelism?.toString();
1049
- const rate = request.flowControl.ratePerSecond?.toString();
1057
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1058
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1050
1059
  const controlValue = [
1051
1060
  parallelism ? `parallelism=${parallelism}` : void 0,
1052
- rate ? `rate=${rate}` : void 0
1061
+ rate ? `rate=${rate}` : void 0,
1062
+ period ? `period=${period}` : void 0
1053
1063
  ].filter(Boolean);
1054
1064
  if (controlValue.length === 0) {
1055
1065
  throw new QstashError(
@@ -1188,7 +1198,7 @@ var UrlGroups = class {
1188
1198
  };
1189
1199
 
1190
1200
  // version.ts
1191
- var VERSION = "v2.8.0";
1201
+ var VERSION = "v2.8.2";
1192
1202
 
1193
1203
  // src/client/client.ts
1194
1204
  var Client = class {
package/nextjs.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Receiver,
3
3
  serve
4
- } from "./chunk-X3J2ACLT.mjs";
4
+ } from "./chunk-H3E2J2K6.mjs";
5
5
 
6
6
  // platforms/nextjs.ts
7
7
  var BAD_REQUEST = 400;
package/nuxt.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  verifySignatureH3
3
- } from "./chunk-PWDZVKVD.mjs";
4
- import "./chunk-UJ7YXITX.mjs";
5
- import "./chunk-X3J2ACLT.mjs";
3
+ } from "./chunk-RW3CBR2S.mjs";
4
+ import "./chunk-4XJ4NO33.mjs";
5
+ import "./chunk-H3E2J2K6.mjs";
6
6
 
7
7
  // platforms/nuxt.ts
8
8
  var verifySignatureNuxt = verifySignatureH3;
package/package.json CHANGED
@@ -1 +1 @@
1
- {"version":"v2.8.0","name":"@upstash/qstash","description":"Official Typescript client for QStash","author":"Andreas Thomas <dev@chronark.com>","license":"MIT","homepage":"https://github.com/upstash/sdk-qstash-ts#readme","repository":{"type":"git","url":"git+https://github.com/upstash/sdk-qstash-ts.git"},"bugs":{"url":"https://github.com/upstash/sdk-qstash-ts/issues"},"main":"./index.js","module":"./index.mjs","types":"./index.d.ts","files":["./*"],"exports":{".":{"import":"./index.mjs","require":"./index.js"},"./dist/nextjs":{"import":"./nextjs.mjs","require":"./nextjs.js"},"./nextjs":{"import":"./nextjs.mjs","require":"./nextjs.js"},"./h3":{"import":"./h3.mjs","require":"./h3.js"},"./nuxt":{"import":"./nuxt.mjs","require":"./nuxt.js"},"./svelte":{"import":"./svelte.mjs","require":"./svelte.js"},"./solidjs":{"import":"./solidjs.mjs","require":"./solidjs.js"},"./workflow":{"import":"./workflow.mjs","require":"./workflow.js"},"./hono":{"import":"./hono.mjs","require":"./hono.js"},"./cloudflare":{"import":"./cloudflare.mjs","require":"./cloudflare.js"}},"keywords":["qstash","queue","events","serverless","upstash"],"scripts":{"build":"tsup && cp README.md ./dist/ && cp package.json ./dist/ && cp LICENSE ./dist/","test":"bun test src","fmt":"prettier --write .","lint":"tsc && eslint \"{src,platforms}/**/*.{js,ts,tsx}\" --quiet --fix","check-exports":"bun run build && cd dist && attw -P"},"devDependencies":{"@commitlint/cli":"^19.2.2","@commitlint/config-conventional":"^19.2.2","@eslint/eslintrc":"^3.1.0","@eslint/js":"^9.10.0","@solidjs/start":"^1.0.6","@sveltejs/kit":"^2.5.18","@types/bun":"^1.1.1","@types/crypto-js":"^4.2.0","@typescript-eslint/eslint-plugin":"^8.4.0","@typescript-eslint/parser":"^8.4.0","ai":"^3.1.28","bun-types":"^1.1.7","eslint":"^9.10.0","eslint-plugin-unicorn":"^51.0.1","h3":"^1.12.0","hono":"^4.5.8","husky":"^9.0.10","next":"^14.0.2","prettier":"^3.2.5","tsup":"latest","typescript":"^5.4.5","undici-types":"^6.16.0","vitest":"latest"},"dependencies":{"crypto-js":">=4.2.0","jose":"^5.2.3","neverthrow":"^7.0.1"}}
1
+ {"version":"v2.8.2","name":"@upstash/qstash","description":"Official Typescript client for QStash","author":"Andreas Thomas <dev@chronark.com>","license":"MIT","homepage":"https://github.com/upstash/sdk-qstash-ts#readme","repository":{"type":"git","url":"git+https://github.com/upstash/sdk-qstash-ts.git"},"bugs":{"url":"https://github.com/upstash/sdk-qstash-ts/issues"},"main":"./index.js","module":"./index.mjs","types":"./index.d.ts","files":["./*"],"exports":{".":{"import":"./index.mjs","require":"./index.js"},"./dist/nextjs":{"import":"./nextjs.mjs","require":"./nextjs.js"},"./nextjs":{"import":"./nextjs.mjs","require":"./nextjs.js"},"./h3":{"import":"./h3.mjs","require":"./h3.js"},"./nuxt":{"import":"./nuxt.mjs","require":"./nuxt.js"},"./svelte":{"import":"./svelte.mjs","require":"./svelte.js"},"./solidjs":{"import":"./solidjs.mjs","require":"./solidjs.js"},"./workflow":{"import":"./workflow.mjs","require":"./workflow.js"},"./hono":{"import":"./hono.mjs","require":"./hono.js"},"./cloudflare":{"import":"./cloudflare.mjs","require":"./cloudflare.js"}},"keywords":["qstash","queue","events","serverless","upstash"],"scripts":{"build":"tsup && cp README.md ./dist/ && cp package.json ./dist/ && cp LICENSE ./dist/","test":"bun test src","fmt":"prettier --write .","lint":"tsc && eslint \"{src,platforms}/**/*.{js,ts,tsx}\" --quiet --fix","check-exports":"bun run build && cd dist && attw -P"},"devDependencies":{"@commitlint/cli":"^19.2.2","@commitlint/config-conventional":"^19.2.2","@eslint/eslintrc":"^3.1.0","@eslint/js":"^9.10.0","@solidjs/start":"^1.0.6","@sveltejs/kit":"^2.5.18","@types/bun":"^1.1.1","@types/crypto-js":"^4.2.0","@typescript-eslint/eslint-plugin":"^8.4.0","@typescript-eslint/parser":"^8.4.0","ai":"^3.1.28","bun-types":"^1.1.7","eslint":"^9.10.0","eslint-plugin-unicorn":"^51.0.1","h3":"^1.12.0","hono":"^4.5.8","husky":"^9.0.10","next":"^14.0.2","prettier":"^3.2.5","tsup":"latest","typescript":"^5.4.5","undici-types":"^6.16.0","vitest":"latest"},"dependencies":{"crypto-js":">=4.2.0","jose":"^5.2.3","neverthrow":"^7.0.1"}}
package/solidjs.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { APIHandler, APIEvent } from '@solidjs/start/server';
2
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BQXugsxm.mjs';
2
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.mjs';
3
3
  import 'neverthrow';
4
4
 
5
5
  type VerifySignatureConfig = {
package/solidjs.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { APIHandler, APIEvent } from '@solidjs/start/server';
2
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BQXugsxm.js';
2
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.js';
3
3
  import 'neverthrow';
4
4
 
5
5
  type VerifySignatureConfig = {
package/solidjs.js CHANGED
@@ -789,6 +789,9 @@ function processHeaders(request) {
789
789
  if (request.retries !== void 0) {
790
790
  headers.set("Upstash-Retries", request.retries.toFixed(0));
791
791
  }
792
+ if (request.retryDelay !== void 0) {
793
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
794
+ }
792
795
  if (request.callback !== void 0) {
793
796
  headers.set("Upstash-Callback", request.callback);
794
797
  }
@@ -804,10 +807,12 @@ function processHeaders(request) {
804
807
  }
805
808
  if (request.flowControl?.key) {
806
809
  const parallelism = request.flowControl.parallelism?.toString();
807
- const rate = request.flowControl.ratePerSecond?.toString();
810
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
811
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
808
812
  const controlValue = [
809
813
  parallelism ? `parallelism=${parallelism}` : void 0,
810
- rate ? `rate=${rate}` : void 0
814
+ rate ? `rate=${rate}` : void 0,
815
+ period ? `period=${period}` : void 0
811
816
  ].filter(Boolean);
812
817
  if (controlValue.length === 0) {
813
818
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1022,6 +1027,9 @@ var Schedules = class {
1022
1027
  if (request.retries !== void 0) {
1023
1028
  headers.set("Upstash-Retries", request.retries.toFixed(0));
1024
1029
  }
1030
+ if (request.retryDelay !== void 0) {
1031
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
1032
+ }
1025
1033
  if (request.callback !== void 0) {
1026
1034
  headers.set("Upstash-Callback", request.callback);
1027
1035
  }
@@ -1043,10 +1051,12 @@ var Schedules = class {
1043
1051
  }
1044
1052
  if (request.flowControl?.key) {
1045
1053
  const parallelism = request.flowControl.parallelism?.toString();
1046
- const rate = request.flowControl.ratePerSecond?.toString();
1054
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1055
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1047
1056
  const controlValue = [
1048
1057
  parallelism ? `parallelism=${parallelism}` : void 0,
1049
- rate ? `rate=${rate}` : void 0
1058
+ rate ? `rate=${rate}` : void 0,
1059
+ period ? `period=${period}` : void 0
1050
1060
  ].filter(Boolean);
1051
1061
  if (controlValue.length === 0) {
1052
1062
  throw new QstashError(
@@ -2571,7 +2581,7 @@ var Workflow = class {
2571
2581
  };
2572
2582
 
2573
2583
  // version.ts
2574
- var VERSION = "v2.8.0";
2584
+ var VERSION = "v2.8.2";
2575
2585
 
2576
2586
  // src/client/client.ts
2577
2587
  var Client = class {
package/solidjs.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import "./chunk-UJ7YXITX.mjs";
1
+ import "./chunk-4XJ4NO33.mjs";
2
2
  import {
3
3
  Receiver,
4
4
  serve
5
- } from "./chunk-X3J2ACLT.mjs";
5
+ } from "./chunk-H3E2J2K6.mjs";
6
6
 
7
7
  // platforms/solidjs.ts
8
8
  var verifySignatureSolidjs = (handler, config) => {
package/svelte.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RequestHandler } from '@sveltejs/kit';
2
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BQXugsxm.mjs';
2
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.mjs';
3
3
  import 'neverthrow';
4
4
 
5
5
  type VerifySignatureConfig = {
package/svelte.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RequestHandler } from '@sveltejs/kit';
2
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BQXugsxm.js';
2
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.js';
3
3
  import 'neverthrow';
4
4
 
5
5
  type VerifySignatureConfig = {
package/svelte.js CHANGED
@@ -789,6 +789,9 @@ function processHeaders(request) {
789
789
  if (request.retries !== void 0) {
790
790
  headers.set("Upstash-Retries", request.retries.toFixed(0));
791
791
  }
792
+ if (request.retryDelay !== void 0) {
793
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
794
+ }
792
795
  if (request.callback !== void 0) {
793
796
  headers.set("Upstash-Callback", request.callback);
794
797
  }
@@ -804,10 +807,12 @@ function processHeaders(request) {
804
807
  }
805
808
  if (request.flowControl?.key) {
806
809
  const parallelism = request.flowControl.parallelism?.toString();
807
- const rate = request.flowControl.ratePerSecond?.toString();
810
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
811
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
808
812
  const controlValue = [
809
813
  parallelism ? `parallelism=${parallelism}` : void 0,
810
- rate ? `rate=${rate}` : void 0
814
+ rate ? `rate=${rate}` : void 0,
815
+ period ? `period=${period}` : void 0
811
816
  ].filter(Boolean);
812
817
  if (controlValue.length === 0) {
813
818
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1022,6 +1027,9 @@ var Schedules = class {
1022
1027
  if (request.retries !== void 0) {
1023
1028
  headers.set("Upstash-Retries", request.retries.toFixed(0));
1024
1029
  }
1030
+ if (request.retryDelay !== void 0) {
1031
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
1032
+ }
1025
1033
  if (request.callback !== void 0) {
1026
1034
  headers.set("Upstash-Callback", request.callback);
1027
1035
  }
@@ -1043,10 +1051,12 @@ var Schedules = class {
1043
1051
  }
1044
1052
  if (request.flowControl?.key) {
1045
1053
  const parallelism = request.flowControl.parallelism?.toString();
1046
- const rate = request.flowControl.ratePerSecond?.toString();
1054
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1055
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1047
1056
  const controlValue = [
1048
1057
  parallelism ? `parallelism=${parallelism}` : void 0,
1049
- rate ? `rate=${rate}` : void 0
1058
+ rate ? `rate=${rate}` : void 0,
1059
+ period ? `period=${period}` : void 0
1050
1060
  ].filter(Boolean);
1051
1061
  if (controlValue.length === 0) {
1052
1062
  throw new QstashError(
@@ -2571,7 +2581,7 @@ var Workflow = class {
2571
2581
  };
2572
2582
 
2573
2583
  // version.ts
2574
- var VERSION = "v2.8.0";
2584
+ var VERSION = "v2.8.2";
2575
2585
 
2576
2586
  // src/client/client.ts
2577
2587
  var Client = class {
package/svelte.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import "./chunk-UJ7YXITX.mjs";
1
+ import "./chunk-4XJ4NO33.mjs";
2
2
  import {
3
3
  Receiver,
4
4
  serve
5
- } from "./chunk-X3J2ACLT.mjs";
5
+ } from "./chunk-H3E2J2K6.mjs";
6
6
 
7
7
  // platforms/svelte.ts
8
8
  var verifySignatureSvelte = (handler, config) => {
package/workflow.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export { am as AsyncStepFunction, af as DisabledWorkflowContext, F as FailureFunctionPayload, ap as FinishCondition, ar as LogLevel, ao as ParallelCallState, ak as RawStep, aq as RequiredExceptFields, a9 as RouteFunction, S as Step, an as StepFunction, aj as StepType, ai as StepTypes, al as SyncStepFunction, ab as Workflow, ag as WorkflowClient, ae as WorkflowContext, at as WorkflowLogger, as as WorkflowLoggerOptions, ah as WorkflowReceiver, aa as WorkflowServeOptions, ac as processOptions, ad as serve } from './client-BQXugsxm.mjs';
1
+ export { am as AsyncStepFunction, af as DisabledWorkflowContext, F as FailureFunctionPayload, ap as FinishCondition, ar as LogLevel, ao as ParallelCallState, ak as RawStep, aq as RequiredExceptFields, a9 as RouteFunction, S as Step, an as StepFunction, aj as StepType, ai as StepTypes, al as SyncStepFunction, ab as Workflow, ag as WorkflowClient, ae as WorkflowContext, at as WorkflowLogger, as as WorkflowLoggerOptions, ah as WorkflowReceiver, aa as WorkflowServeOptions, ac as processOptions, ad as serve } from './client-C3waRcAY.mjs';
2
2
  import 'neverthrow';
package/workflow.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { am as AsyncStepFunction, af as DisabledWorkflowContext, F as FailureFunctionPayload, ap as FinishCondition, ar as LogLevel, ao as ParallelCallState, ak as RawStep, aq as RequiredExceptFields, a9 as RouteFunction, S as Step, an as StepFunction, aj as StepType, ai as StepTypes, al as SyncStepFunction, ab as Workflow, ag as WorkflowClient, ae as WorkflowContext, at as WorkflowLogger, as as WorkflowLoggerOptions, ah as WorkflowReceiver, aa as WorkflowServeOptions, ac as processOptions, ad as serve } from './client-BQXugsxm.js';
1
+ export { am as AsyncStepFunction, af as DisabledWorkflowContext, F as FailureFunctionPayload, ap as FinishCondition, ar as LogLevel, ao as ParallelCallState, ak as RawStep, aq as RequiredExceptFields, a9 as RouteFunction, S as Step, an as StepFunction, aj as StepType, ai as StepTypes, al as SyncStepFunction, ab as Workflow, ag as WorkflowClient, ae as WorkflowContext, at as WorkflowLogger, as as WorkflowLoggerOptions, ah as WorkflowReceiver, aa as WorkflowServeOptions, ac as processOptions, ad as serve } from './client-C3waRcAY.js';
2
2
  import 'neverthrow';
package/workflow.js CHANGED
@@ -794,6 +794,9 @@ function processHeaders(request) {
794
794
  if (request.retries !== void 0) {
795
795
  headers.set("Upstash-Retries", request.retries.toFixed(0));
796
796
  }
797
+ if (request.retryDelay !== void 0) {
798
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
799
+ }
797
800
  if (request.callback !== void 0) {
798
801
  headers.set("Upstash-Callback", request.callback);
799
802
  }
@@ -809,10 +812,12 @@ function processHeaders(request) {
809
812
  }
810
813
  if (request.flowControl?.key) {
811
814
  const parallelism = request.flowControl.parallelism?.toString();
812
- const rate = request.flowControl.ratePerSecond?.toString();
815
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
816
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
813
817
  const controlValue = [
814
818
  parallelism ? `parallelism=${parallelism}` : void 0,
815
- rate ? `rate=${rate}` : void 0
819
+ rate ? `rate=${rate}` : void 0,
820
+ period ? `period=${period}` : void 0
816
821
  ].filter(Boolean);
817
822
  if (controlValue.length === 0) {
818
823
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1027,6 +1032,9 @@ var Schedules = class {
1027
1032
  if (request.retries !== void 0) {
1028
1033
  headers.set("Upstash-Retries", request.retries.toFixed(0));
1029
1034
  }
1035
+ if (request.retryDelay !== void 0) {
1036
+ headers.set("Upstash-Retry-Delay", request.retryDelay);
1037
+ }
1030
1038
  if (request.callback !== void 0) {
1031
1039
  headers.set("Upstash-Callback", request.callback);
1032
1040
  }
@@ -1048,10 +1056,12 @@ var Schedules = class {
1048
1056
  }
1049
1057
  if (request.flowControl?.key) {
1050
1058
  const parallelism = request.flowControl.parallelism?.toString();
1051
- const rate = request.flowControl.ratePerSecond?.toString();
1059
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1060
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1052
1061
  const controlValue = [
1053
1062
  parallelism ? `parallelism=${parallelism}` : void 0,
1054
- rate ? `rate=${rate}` : void 0
1063
+ rate ? `rate=${rate}` : void 0,
1064
+ period ? `period=${period}` : void 0
1055
1065
  ].filter(Boolean);
1056
1066
  if (controlValue.length === 0) {
1057
1067
  throw new QstashError(
@@ -1190,7 +1200,7 @@ var UrlGroups = class {
1190
1200
  };
1191
1201
 
1192
1202
  // version.ts
1193
- var VERSION = "v2.8.0";
1203
+ var VERSION = "v2.8.2";
1194
1204
 
1195
1205
  // src/client/client.ts
1196
1206
  var Client = class {
package/workflow.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  WorkflowLogger,
7
7
  processOptions,
8
8
  serve
9
- } from "./chunk-X3J2ACLT.mjs";
9
+ } from "./chunk-H3E2J2K6.mjs";
10
10
  export {
11
11
  DisabledWorkflowContext,
12
12
  StepTypes,