@upstash/qstash 2.10.1 → 2.11.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.
@@ -18,6 +18,15 @@ type ReceiverConfig = {
18
18
  * and UPSTASH_REGION header.
19
19
  */
20
20
  nextSigningKey?: string;
21
+ /**
22
+ * Controls the local dev server signing keys.
23
+ * - `true`: use dev server signing keys
24
+ * - `false`: never use dev server signing keys (ignores QSTASH_DEV env var)
25
+ * - `undefined`: check QSTASH_DEV env var
26
+ *
27
+ * @default undefined
28
+ */
29
+ devMode?: boolean;
21
30
  };
22
31
  type VerifyRequest = {
23
32
  /**
@@ -56,6 +65,7 @@ declare class SignatureError extends Error {
56
65
  declare class Receiver {
57
66
  private readonly currentSigningKey?;
58
67
  private readonly nextSigningKey?;
68
+ private readonly devMode?;
59
69
  constructor(config?: ReceiverConfig);
60
70
  /**
61
71
  * Verify the signature of a request.
@@ -91,7 +101,19 @@ type Log = {
91
101
  endpointName?: string;
92
102
  header?: Record<string, string>;
93
103
  body?: string;
104
+ /**
105
+ * Label of the message.
106
+ *
107
+ * @deprecated Use `labels` instead. When a message has multiple labels, this
108
+ * field only contains the first one.
109
+ */
94
110
  label?: string;
111
+ /**
112
+ * Labels attached to the message.
113
+ *
114
+ * A message can have multiple labels when published with `label: string[]`.
115
+ */
116
+ labels?: string[];
95
117
  };
96
118
  /**
97
119
  * Deprecated. Use the `Log` type instead.
@@ -518,7 +540,14 @@ type UniversalFilterFields = {
518
540
  fromDate?: Date | number;
519
541
  toDate?: Date | number;
520
542
  callerIp?: string;
521
- label?: string;
543
+ /**
544
+ * Filter by label.
545
+ *
546
+ * Pass an array to match runs that have any of the given labels (OR semantics).
547
+ * For example, with runs labelled `[label_1, label_2]` and `[label_2, label_3]`,
548
+ * filtering by `[label_1, label_2]` returns both.
549
+ */
550
+ label?: string | string[];
522
551
  flowControlKey?: string;
523
552
  };
524
553
  /** QStash-specific identity filters (DLQ + message endpoints). */
@@ -753,8 +782,17 @@ type Message = {
753
782
  period?: number;
754
783
  /**
755
784
  * The label assigned to the message for filtering purposes.
785
+ *
786
+ * @deprecated Use `labels` instead. When a message has multiple labels, this
787
+ * field only contains the first one.
756
788
  */
757
789
  label?: string;
790
+ /**
791
+ * The labels assigned to the message for filtering purposes.
792
+ *
793
+ * A message can have multiple labels when published with `label: string[]`.
794
+ */
795
+ labels?: string[];
758
796
  };
759
797
  type MessagePayload = Omit<Message, "urlGroup"> & {
760
798
  topicName: string;
@@ -2125,6 +2163,15 @@ type ClientConfig = {
2125
2163
  * @default true
2126
2164
  */
2127
2165
  enableTelemetry?: boolean;
2166
+ /**
2167
+ * Controls the local dev server.
2168
+ * - `true`: force dev mode on (downloads, starts, and manages the dev server automatically)
2169
+ * - `false`: force dev mode off (ignores QSTASH_DEV env var)
2170
+ * - `undefined`: check QSTASH_DEV env var
2171
+ *
2172
+ * @default undefined
2173
+ */
2174
+ devMode?: boolean;
2128
2175
  };
2129
2176
  type PublishBatchRequest<TBody = BodyInit> = PublishRequest<TBody> & {
2130
2177
  queueName?: string;
@@ -2266,9 +2313,12 @@ type PublishRequest<TBody = BodyInit> = {
2266
2313
  /**
2267
2314
  * Assign a label to the request to filter logs later.
2268
2315
  *
2316
+ * Pass an array to attach multiple labels to a single message; they are
2317
+ * sent as a comma-separated value in the `Upstash-Label` header.
2318
+ *
2269
2319
  * @default undefined
2270
2320
  */
2271
- label?: string;
2321
+ label?: string | string[];
2272
2322
  /**
2273
2323
  * Configure which fields should be redacted in logs.
2274
2324
  *
@@ -18,6 +18,15 @@ type ReceiverConfig = {
18
18
  * and UPSTASH_REGION header.
19
19
  */
20
20
  nextSigningKey?: string;
21
+ /**
22
+ * Controls the local dev server signing keys.
23
+ * - `true`: use dev server signing keys
24
+ * - `false`: never use dev server signing keys (ignores QSTASH_DEV env var)
25
+ * - `undefined`: check QSTASH_DEV env var
26
+ *
27
+ * @default undefined
28
+ */
29
+ devMode?: boolean;
21
30
  };
22
31
  type VerifyRequest = {
23
32
  /**
@@ -56,6 +65,7 @@ declare class SignatureError extends Error {
56
65
  declare class Receiver {
57
66
  private readonly currentSigningKey?;
58
67
  private readonly nextSigningKey?;
68
+ private readonly devMode?;
59
69
  constructor(config?: ReceiverConfig);
60
70
  /**
61
71
  * Verify the signature of a request.
@@ -91,7 +101,19 @@ type Log = {
91
101
  endpointName?: string;
92
102
  header?: Record<string, string>;
93
103
  body?: string;
104
+ /**
105
+ * Label of the message.
106
+ *
107
+ * @deprecated Use `labels` instead. When a message has multiple labels, this
108
+ * field only contains the first one.
109
+ */
94
110
  label?: string;
111
+ /**
112
+ * Labels attached to the message.
113
+ *
114
+ * A message can have multiple labels when published with `label: string[]`.
115
+ */
116
+ labels?: string[];
95
117
  };
96
118
  /**
97
119
  * Deprecated. Use the `Log` type instead.
@@ -518,7 +540,14 @@ type UniversalFilterFields = {
518
540
  fromDate?: Date | number;
519
541
  toDate?: Date | number;
520
542
  callerIp?: string;
521
- label?: string;
543
+ /**
544
+ * Filter by label.
545
+ *
546
+ * Pass an array to match runs that have any of the given labels (OR semantics).
547
+ * For example, with runs labelled `[label_1, label_2]` and `[label_2, label_3]`,
548
+ * filtering by `[label_1, label_2]` returns both.
549
+ */
550
+ label?: string | string[];
522
551
  flowControlKey?: string;
523
552
  };
524
553
  /** QStash-specific identity filters (DLQ + message endpoints). */
@@ -753,8 +782,17 @@ type Message = {
753
782
  period?: number;
754
783
  /**
755
784
  * The label assigned to the message for filtering purposes.
785
+ *
786
+ * @deprecated Use `labels` instead. When a message has multiple labels, this
787
+ * field only contains the first one.
756
788
  */
757
789
  label?: string;
790
+ /**
791
+ * The labels assigned to the message for filtering purposes.
792
+ *
793
+ * A message can have multiple labels when published with `label: string[]`.
794
+ */
795
+ labels?: string[];
758
796
  };
759
797
  type MessagePayload = Omit<Message, "urlGroup"> & {
760
798
  topicName: string;
@@ -2125,6 +2163,15 @@ type ClientConfig = {
2125
2163
  * @default true
2126
2164
  */
2127
2165
  enableTelemetry?: boolean;
2166
+ /**
2167
+ * Controls the local dev server.
2168
+ * - `true`: force dev mode on (downloads, starts, and manages the dev server automatically)
2169
+ * - `false`: force dev mode off (ignores QSTASH_DEV env var)
2170
+ * - `undefined`: check QSTASH_DEV env var
2171
+ *
2172
+ * @default undefined
2173
+ */
2174
+ devMode?: boolean;
2128
2175
  };
2129
2176
  type PublishBatchRequest<TBody = BodyInit> = PublishRequest<TBody> & {
2130
2177
  queueName?: string;
@@ -2266,9 +2313,12 @@ type PublishRequest<TBody = BodyInit> = {
2266
2313
  /**
2267
2314
  * Assign a label to the request to filter logs later.
2268
2315
  *
2316
+ * Pass an array to attach multiple labels to a single message; they are
2317
+ * sent as a comma-separated value in the `Upstash-Label` header.
2318
+ *
2269
2319
  * @default undefined
2270
2320
  */
2271
- label?: string;
2321
+ label?: string | string[];
2272
2322
  /**
2273
2323
  * Configure which fields should be redacted in logs.
2274
2324
  *
package/cloudflare.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { ae as RouteFunction, af as WorkflowServeOptions } from './client-CsM1dTnz.mjs';
1
+ import { ae as RouteFunction, af as WorkflowServeOptions } from './client-BHOXiX0H.mjs';
2
2
  import 'neverthrow';
3
3
 
4
4
  type WorkflowBindings = {
package/cloudflare.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ae as RouteFunction, af as WorkflowServeOptions } from './client-CsM1dTnz.js';
1
+ import { ae as RouteFunction, af as WorkflowServeOptions } from './client-BHOXiX0H.js';
2
2
  import 'neverthrow';
3
3
 
4
4
  type WorkflowBindings = {