@upstash/qstash 2.8.0 → 2.8.1

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-SSGARCU5.mjs";
4
4
 
5
5
  // src/client/api/email.ts
6
6
  var EmailProvider = class extends BaseProvider {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Receiver,
3
3
  serve
4
- } from "./chunk-X3J2ACLT.mjs";
4
+ } from "./chunk-SSGARCU5.mjs";
5
5
 
6
6
  // node_modules/defu/dist/defu.mjs
7
7
  function isPlainObject(value) {
@@ -783,10 +783,12 @@ function processHeaders(request) {
783
783
  }
784
784
  if (request.flowControl?.key) {
785
785
  const parallelism = request.flowControl.parallelism?.toString();
786
- const rate = request.flowControl.ratePerSecond?.toString();
786
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
787
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
787
788
  const controlValue = [
788
789
  parallelism ? `parallelism=${parallelism}` : void 0,
789
- rate ? `rate=${rate}` : void 0
790
+ rate ? `rate=${rate}` : void 0,
791
+ period ? `period=${period}` : void 0
790
792
  ].filter(Boolean);
791
793
  if (controlValue.length === 0) {
792
794
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1022,10 +1024,12 @@ var Schedules = class {
1022
1024
  }
1023
1025
  if (request.flowControl?.key) {
1024
1026
  const parallelism = request.flowControl.parallelism?.toString();
1025
- const rate = request.flowControl.ratePerSecond?.toString();
1027
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1028
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1026
1029
  const controlValue = [
1027
1030
  parallelism ? `parallelism=${parallelism}` : void 0,
1028
- rate ? `rate=${rate}` : void 0
1031
+ rate ? `rate=${rate}` : void 0,
1032
+ period ? `period=${period}` : void 0
1029
1033
  ].filter(Boolean);
1030
1034
  if (controlValue.length === 0) {
1031
1035
  throw new QstashError(
@@ -1164,7 +1168,7 @@ var UrlGroups = class {
1164
1168
  };
1165
1169
 
1166
1170
  // version.ts
1167
- var VERSION = "v2.8.0";
1171
+ var VERSION = "v2.8.1";
1168
1172
 
1169
1173
  // src/client/client.ts
1170
1174
  var Client = class {
@@ -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 = {
@@ -510,8 +577,22 @@ type Message = {
510
577
  parallelism?: number;
511
578
  /**
512
579
  * number of requests to activate per second with the same flow control key
580
+ *
581
+ * @deprecated use rate instead
513
582
  */
514
583
  ratePerSecond?: number;
584
+ /**
585
+ * number of requests to activate within the period with the same flow control key.
586
+ * Default period is a second.
587
+ */
588
+ rate?: number;
589
+ /**
590
+ * The time interval during which the specified `rate` of requests can be activated
591
+ * using the same flow control key.
592
+ *
593
+ * In seconds.
594
+ */
595
+ period?: number;
515
596
  };
516
597
  type MessagePayload = Omit<Message, "urlGroup"> & {
517
598
  topicName: string;
@@ -625,9 +706,6 @@ declare class DLQ {
625
706
  }>;
626
707
  }
627
708
 
628
- type Unit = "s" | "m" | "h" | "d";
629
- type Duration = `${bigint}${Unit}`;
630
-
631
709
  declare class Chat {
632
710
  private http;
633
711
  private token;
@@ -750,7 +828,18 @@ type Schedule = {
750
828
  queueName?: string;
751
829
  flowControlKey?: string;
752
830
  parallelism?: number;
831
+ rate?: number;
832
+ /**
833
+ * @deprecated use rate instead
834
+ */
753
835
  ratePerSecond?: number;
836
+ /**
837
+ * The time interval during which the specified `rate` of requests can be activated
838
+ * using the same flow control key.
839
+ *
840
+ * In seconds.
841
+ */
842
+ period?: number;
754
843
  };
755
844
  type CreateScheduleRequest = {
756
845
  /**
@@ -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 = {
@@ -510,8 +577,22 @@ type Message = {
510
577
  parallelism?: number;
511
578
  /**
512
579
  * number of requests to activate per second with the same flow control key
580
+ *
581
+ * @deprecated use rate instead
513
582
  */
514
583
  ratePerSecond?: number;
584
+ /**
585
+ * number of requests to activate within the period with the same flow control key.
586
+ * Default period is a second.
587
+ */
588
+ rate?: number;
589
+ /**
590
+ * The time interval during which the specified `rate` of requests can be activated
591
+ * using the same flow control key.
592
+ *
593
+ * In seconds.
594
+ */
595
+ period?: number;
515
596
  };
516
597
  type MessagePayload = Omit<Message, "urlGroup"> & {
517
598
  topicName: string;
@@ -625,9 +706,6 @@ declare class DLQ {
625
706
  }>;
626
707
  }
627
708
 
628
- type Unit = "s" | "m" | "h" | "d";
629
- type Duration = `${bigint}${Unit}`;
630
-
631
709
  declare class Chat {
632
710
  private http;
633
711
  private token;
@@ -750,7 +828,18 @@ type Schedule = {
750
828
  queueName?: string;
751
829
  flowControlKey?: string;
752
830
  parallelism?: number;
831
+ rate?: number;
832
+ /**
833
+ * @deprecated use rate instead
834
+ */
753
835
  ratePerSecond?: number;
836
+ /**
837
+ * The time interval during which the specified `rate` of requests can be activated
838
+ * using the same flow control key.
839
+ *
840
+ * In seconds.
841
+ */
842
+ period?: number;
754
843
  };
755
844
  type CreateScheduleRequest = {
756
845
  /**
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-CpYCcLg9.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-CpYCcLg9.js';
2
2
  import 'neverthrow';
3
3
 
4
4
  type WorkflowBindings = {
package/cloudflare.js CHANGED
@@ -803,10 +803,12 @@ function processHeaders(request) {
803
803
  }
804
804
  if (request.flowControl?.key) {
805
805
  const parallelism = request.flowControl.parallelism?.toString();
806
- const rate = request.flowControl.ratePerSecond?.toString();
806
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
807
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
807
808
  const controlValue = [
808
809
  parallelism ? `parallelism=${parallelism}` : void 0,
809
- rate ? `rate=${rate}` : void 0
810
+ rate ? `rate=${rate}` : void 0,
811
+ period ? `period=${period}` : void 0
810
812
  ].filter(Boolean);
811
813
  if (controlValue.length === 0) {
812
814
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1042,10 +1044,12 @@ var Schedules = class {
1042
1044
  }
1043
1045
  if (request.flowControl?.key) {
1044
1046
  const parallelism = request.flowControl.parallelism?.toString();
1045
- const rate = request.flowControl.ratePerSecond?.toString();
1047
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1048
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1046
1049
  const controlValue = [
1047
1050
  parallelism ? `parallelism=${parallelism}` : void 0,
1048
- rate ? `rate=${rate}` : void 0
1051
+ rate ? `rate=${rate}` : void 0,
1052
+ period ? `period=${period}` : void 0
1049
1053
  ].filter(Boolean);
1050
1054
  if (controlValue.length === 0) {
1051
1055
  throw new QstashError(
@@ -1184,7 +1188,7 @@ var UrlGroups = class {
1184
1188
  };
1185
1189
 
1186
1190
  // version.ts
1187
- var VERSION = "v2.8.0";
1191
+ var VERSION = "v2.8.1";
1188
1192
 
1189
1193
  // src/client/client.ts
1190
1194
  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-SSGARCU5.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-CpYCcLg9.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-CpYCcLg9.js';
4
4
  import 'neverthrow';
5
5
 
6
6
  type VerifySignatureConfig = {
package/h3.js CHANGED
@@ -1127,10 +1127,12 @@ function processHeaders(request) {
1127
1127
  }
1128
1128
  if (request.flowControl?.key) {
1129
1129
  const parallelism = request.flowControl.parallelism?.toString();
1130
- const rate = request.flowControl.ratePerSecond?.toString();
1130
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1131
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1131
1132
  const controlValue = [
1132
1133
  parallelism ? `parallelism=${parallelism}` : void 0,
1133
- rate ? `rate=${rate}` : void 0
1134
+ rate ? `rate=${rate}` : void 0,
1135
+ period ? `period=${period}` : void 0
1134
1136
  ].filter(Boolean);
1135
1137
  if (controlValue.length === 0) {
1136
1138
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1366,10 +1368,12 @@ var Schedules = class {
1366
1368
  }
1367
1369
  if (request.flowControl?.key) {
1368
1370
  const parallelism = request.flowControl.parallelism?.toString();
1369
- const rate = request.flowControl.ratePerSecond?.toString();
1371
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1372
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1370
1373
  const controlValue = [
1371
1374
  parallelism ? `parallelism=${parallelism}` : void 0,
1372
- rate ? `rate=${rate}` : void 0
1375
+ rate ? `rate=${rate}` : void 0,
1376
+ period ? `period=${period}` : void 0
1373
1377
  ].filter(Boolean);
1374
1378
  if (controlValue.length === 0) {
1375
1379
  throw new QstashError(
@@ -2894,7 +2898,7 @@ var Workflow = class {
2894
2898
  };
2895
2899
 
2896
2900
  // version.ts
2897
- var VERSION = "v2.8.0";
2901
+ var VERSION = "v2.8.1";
2898
2902
 
2899
2903
  // src/client/client.ts
2900
2904
  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-IZPRR2F5.mjs";
5
+ import "./chunk-CGY7C7LV.mjs";
6
+ import "./chunk-SSGARCU5.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-CpYCcLg9.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-CpYCcLg9.js';
3
3
  import 'neverthrow';
4
4
 
5
5
  type WorkflowBindings = {
package/hono.js CHANGED
@@ -803,10 +803,12 @@ function processHeaders(request) {
803
803
  }
804
804
  if (request.flowControl?.key) {
805
805
  const parallelism = request.flowControl.parallelism?.toString();
806
- const rate = request.flowControl.ratePerSecond?.toString();
806
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
807
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
807
808
  const controlValue = [
808
809
  parallelism ? `parallelism=${parallelism}` : void 0,
809
- rate ? `rate=${rate}` : void 0
810
+ rate ? `rate=${rate}` : void 0,
811
+ period ? `period=${period}` : void 0
810
812
  ].filter(Boolean);
811
813
  if (controlValue.length === 0) {
812
814
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1042,10 +1044,12 @@ var Schedules = class {
1042
1044
  }
1043
1045
  if (request.flowControl?.key) {
1044
1046
  const parallelism = request.flowControl.parallelism?.toString();
1045
- const rate = request.flowControl.ratePerSecond?.toString();
1047
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1048
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1046
1049
  const controlValue = [
1047
1050
  parallelism ? `parallelism=${parallelism}` : void 0,
1048
- rate ? `rate=${rate}` : void 0
1051
+ rate ? `rate=${rate}` : void 0,
1052
+ period ? `period=${period}` : void 0
1049
1053
  ].filter(Boolean);
1050
1054
  if (controlValue.length === 0) {
1051
1055
  throw new QstashError(
@@ -1184,7 +1188,7 @@ var UrlGroups = class {
1184
1188
  };
1185
1189
 
1186
1190
  // version.ts
1187
- var VERSION = "v2.8.0";
1191
+ var VERSION = "v2.8.1";
1188
1192
 
1189
1193
  // src/client/client.ts
1190
1194
  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-SSGARCU5.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-CpYCcLg9.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-CpYCcLg9.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-CpYCcLg9.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-CpYCcLg9.js';
3
3
  import 'neverthrow';
4
4
 
5
5
  /**
package/index.js CHANGED
@@ -839,10 +839,12 @@ function processHeaders(request) {
839
839
  }
840
840
  if (request.flowControl?.key) {
841
841
  const parallelism = request.flowControl.parallelism?.toString();
842
- const rate = request.flowControl.ratePerSecond?.toString();
842
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
843
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
843
844
  const controlValue = [
844
845
  parallelism ? `parallelism=${parallelism}` : void 0,
845
- rate ? `rate=${rate}` : void 0
846
+ rate ? `rate=${rate}` : void 0,
847
+ period ? `period=${period}` : void 0
846
848
  ].filter(Boolean);
847
849
  if (controlValue.length === 0) {
848
850
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1073,10 +1075,12 @@ var Schedules = class {
1073
1075
  }
1074
1076
  if (request.flowControl?.key) {
1075
1077
  const parallelism = request.flowControl.parallelism?.toString();
1076
- const rate = request.flowControl.ratePerSecond?.toString();
1078
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1079
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1077
1080
  const controlValue = [
1078
1081
  parallelism ? `parallelism=${parallelism}` : void 0,
1079
- rate ? `rate=${rate}` : void 0
1082
+ rate ? `rate=${rate}` : void 0,
1083
+ period ? `period=${period}` : void 0
1080
1084
  ].filter(Boolean);
1081
1085
  if (controlValue.length === 0) {
1082
1086
  throw new QstashError(
@@ -1246,7 +1250,7 @@ var Workflow = class {
1246
1250
  };
1247
1251
 
1248
1252
  // version.ts
1249
- var VERSION = "v2.8.0";
1253
+ var VERSION = "v2.8.1";
1250
1254
 
1251
1255
  // src/client/client.ts
1252
1256
  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-CGY7C7LV.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-SSGARCU5.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-CpYCcLg9.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-CpYCcLg9.js';
4
4
  import 'neverthrow';
5
5
 
6
6
  type VerifySignatureConfig = {
package/nextjs.js CHANGED
@@ -807,10 +807,12 @@ function processHeaders(request) {
807
807
  }
808
808
  if (request.flowControl?.key) {
809
809
  const parallelism = request.flowControl.parallelism?.toString();
810
- 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;
811
812
  const controlValue = [
812
813
  parallelism ? `parallelism=${parallelism}` : void 0,
813
- rate ? `rate=${rate}` : void 0
814
+ rate ? `rate=${rate}` : void 0,
815
+ period ? `period=${period}` : void 0
814
816
  ].filter(Boolean);
815
817
  if (controlValue.length === 0) {
816
818
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1046,10 +1048,12 @@ var Schedules = class {
1046
1048
  }
1047
1049
  if (request.flowControl?.key) {
1048
1050
  const parallelism = request.flowControl.parallelism?.toString();
1049
- const rate = request.flowControl.ratePerSecond?.toString();
1051
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1052
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1050
1053
  const controlValue = [
1051
1054
  parallelism ? `parallelism=${parallelism}` : void 0,
1052
- rate ? `rate=${rate}` : void 0
1055
+ rate ? `rate=${rate}` : void 0,
1056
+ period ? `period=${period}` : void 0
1053
1057
  ].filter(Boolean);
1054
1058
  if (controlValue.length === 0) {
1055
1059
  throw new QstashError(
@@ -1188,7 +1192,7 @@ var UrlGroups = class {
1188
1192
  };
1189
1193
 
1190
1194
  // version.ts
1191
- var VERSION = "v2.8.0";
1195
+ var VERSION = "v2.8.1";
1192
1196
 
1193
1197
  // src/client/client.ts
1194
1198
  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-SSGARCU5.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-IZPRR2F5.mjs";
4
+ import "./chunk-CGY7C7LV.mjs";
5
+ import "./chunk-SSGARCU5.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.1","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-CpYCcLg9.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-CpYCcLg9.js';
3
3
  import 'neverthrow';
4
4
 
5
5
  type VerifySignatureConfig = {
package/solidjs.js CHANGED
@@ -804,10 +804,12 @@ function processHeaders(request) {
804
804
  }
805
805
  if (request.flowControl?.key) {
806
806
  const parallelism = request.flowControl.parallelism?.toString();
807
- const rate = request.flowControl.ratePerSecond?.toString();
807
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
808
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
808
809
  const controlValue = [
809
810
  parallelism ? `parallelism=${parallelism}` : void 0,
810
- rate ? `rate=${rate}` : void 0
811
+ rate ? `rate=${rate}` : void 0,
812
+ period ? `period=${period}` : void 0
811
813
  ].filter(Boolean);
812
814
  if (controlValue.length === 0) {
813
815
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1043,10 +1045,12 @@ var Schedules = class {
1043
1045
  }
1044
1046
  if (request.flowControl?.key) {
1045
1047
  const parallelism = request.flowControl.parallelism?.toString();
1046
- const rate = request.flowControl.ratePerSecond?.toString();
1048
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1049
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1047
1050
  const controlValue = [
1048
1051
  parallelism ? `parallelism=${parallelism}` : void 0,
1049
- rate ? `rate=${rate}` : void 0
1052
+ rate ? `rate=${rate}` : void 0,
1053
+ period ? `period=${period}` : void 0
1050
1054
  ].filter(Boolean);
1051
1055
  if (controlValue.length === 0) {
1052
1056
  throw new QstashError(
@@ -2571,7 +2575,7 @@ var Workflow = class {
2571
2575
  };
2572
2576
 
2573
2577
  // version.ts
2574
- var VERSION = "v2.8.0";
2578
+ var VERSION = "v2.8.1";
2575
2579
 
2576
2580
  // src/client/client.ts
2577
2581
  var Client = class {
package/solidjs.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import "./chunk-UJ7YXITX.mjs";
1
+ import "./chunk-CGY7C7LV.mjs";
2
2
  import {
3
3
  Receiver,
4
4
  serve
5
- } from "./chunk-X3J2ACLT.mjs";
5
+ } from "./chunk-SSGARCU5.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-CpYCcLg9.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-CpYCcLg9.js';
3
3
  import 'neverthrow';
4
4
 
5
5
  type VerifySignatureConfig = {
package/svelte.js CHANGED
@@ -804,10 +804,12 @@ function processHeaders(request) {
804
804
  }
805
805
  if (request.flowControl?.key) {
806
806
  const parallelism = request.flowControl.parallelism?.toString();
807
- const rate = request.flowControl.ratePerSecond?.toString();
807
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
808
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
808
809
  const controlValue = [
809
810
  parallelism ? `parallelism=${parallelism}` : void 0,
810
- rate ? `rate=${rate}` : void 0
811
+ rate ? `rate=${rate}` : void 0,
812
+ period ? `period=${period}` : void 0
811
813
  ].filter(Boolean);
812
814
  if (controlValue.length === 0) {
813
815
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1043,10 +1045,12 @@ var Schedules = class {
1043
1045
  }
1044
1046
  if (request.flowControl?.key) {
1045
1047
  const parallelism = request.flowControl.parallelism?.toString();
1046
- const rate = request.flowControl.ratePerSecond?.toString();
1048
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
1049
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
1047
1050
  const controlValue = [
1048
1051
  parallelism ? `parallelism=${parallelism}` : void 0,
1049
- rate ? `rate=${rate}` : void 0
1052
+ rate ? `rate=${rate}` : void 0,
1053
+ period ? `period=${period}` : void 0
1050
1054
  ].filter(Boolean);
1051
1055
  if (controlValue.length === 0) {
1052
1056
  throw new QstashError(
@@ -2571,7 +2575,7 @@ var Workflow = class {
2571
2575
  };
2572
2576
 
2573
2577
  // version.ts
2574
- var VERSION = "v2.8.0";
2578
+ var VERSION = "v2.8.1";
2575
2579
 
2576
2580
  // src/client/client.ts
2577
2581
  var Client = class {
package/svelte.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import "./chunk-UJ7YXITX.mjs";
1
+ import "./chunk-CGY7C7LV.mjs";
2
2
  import {
3
3
  Receiver,
4
4
  serve
5
- } from "./chunk-X3J2ACLT.mjs";
5
+ } from "./chunk-SSGARCU5.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-CpYCcLg9.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-CpYCcLg9.js';
2
2
  import 'neverthrow';
package/workflow.js CHANGED
@@ -809,10 +809,12 @@ function processHeaders(request) {
809
809
  }
810
810
  if (request.flowControl?.key) {
811
811
  const parallelism = request.flowControl.parallelism?.toString();
812
- const rate = request.flowControl.ratePerSecond?.toString();
812
+ const rate = (request.flowControl.rate ?? request.flowControl.ratePerSecond)?.toString();
813
+ const period = typeof request.flowControl.period === "number" ? `${request.flowControl.period}s` : request.flowControl.period;
813
814
  const controlValue = [
814
815
  parallelism ? `parallelism=${parallelism}` : void 0,
815
- rate ? `rate=${rate}` : void 0
816
+ rate ? `rate=${rate}` : void 0,
817
+ period ? `period=${period}` : void 0
816
818
  ].filter(Boolean);
817
819
  if (controlValue.length === 0) {
818
820
  throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl");
@@ -1048,10 +1050,12 @@ var Schedules = class {
1048
1050
  }
1049
1051
  if (request.flowControl?.key) {
1050
1052
  const parallelism = request.flowControl.parallelism?.toString();
1051
- 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;
1052
1055
  const controlValue = [
1053
1056
  parallelism ? `parallelism=${parallelism}` : void 0,
1054
- rate ? `rate=${rate}` : void 0
1057
+ rate ? `rate=${rate}` : void 0,
1058
+ period ? `period=${period}` : void 0
1055
1059
  ].filter(Boolean);
1056
1060
  if (controlValue.length === 0) {
1057
1061
  throw new QstashError(
@@ -1190,7 +1194,7 @@ var UrlGroups = class {
1190
1194
  };
1191
1195
 
1192
1196
  // version.ts
1193
- var VERSION = "v2.8.0";
1197
+ var VERSION = "v2.8.1";
1194
1198
 
1195
1199
  // src/client/client.ts
1196
1200
  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-SSGARCU5.mjs";
10
10
  export {
11
11
  DisabledWorkflowContext,
12
12
  StepTypes,