@upstash/qstash 2.7.20 → 2.7.21

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-WXLHIS4A.mjs";
3
+ } from "./chunk-QHCEWG63.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-WXLHIS4A.mjs";
4
+ } from "./chunk-QHCEWG63.mjs";
5
5
 
6
6
  // node_modules/defu/dist/defu.mjs
7
7
  function isPlainObject(value) {
@@ -1113,14 +1113,22 @@ var Client = class {
1113
1113
  http;
1114
1114
  token;
1115
1115
  constructor(config) {
1116
+ const environment = typeof process === "undefined" ? {} : process.env;
1117
+ const baseUrl = config?.baseUrl ? config.baseUrl.replace(/\/$/, "") : environment.QSTASH_URL ?? "https://qstash.upstash.io";
1118
+ const token = config?.token ?? environment.QSTASH_TOKEN;
1116
1119
  this.http = new HttpClient({
1117
- retry: config.retry,
1118
- baseUrl: config.baseUrl ? config.baseUrl.replace(/\/$/, "") : "https://qstash.upstash.io",
1119
- authorization: `Bearer ${config.token}`,
1120
+ retry: config?.retry,
1121
+ baseUrl,
1122
+ authorization: `Bearer ${token}`,
1120
1123
  //@ts-expect-error caused by undici and bunjs type overlap
1121
- headers: prefixHeaders(new Headers(config.headers))
1124
+ headers: prefixHeaders(new Headers(config?.headers ?? {}))
1122
1125
  });
1123
- this.token = config.token;
1126
+ if (!token) {
1127
+ console.warn(
1128
+ "[Upstash QStash] client token is not set. Either pass a token or set QSTASH_TOKEN env variable."
1129
+ );
1130
+ }
1131
+ this.token = token;
1124
1132
  }
1125
1133
  /**
1126
1134
  * Access the urlGroup API.
@@ -1564,13 +1564,20 @@ type ClientConfig = {
1564
1564
  *
1565
1565
  * This is only used for testing.
1566
1566
  *
1567
+ * If not provided, value of the QSTASH_URL environment
1568
+ * variable will be used if it exists. If the QSTASH_URL
1569
+ * environment variable isn't set either, default is used.
1570
+ *
1567
1571
  * @default "https://qstash.upstash.io"
1568
1572
  */
1569
1573
  baseUrl?: string;
1570
1574
  /**
1571
1575
  * The authorization token from the upstash console.
1576
+ *
1577
+ * If not provided, value of the QSTASH_TOKEN environment
1578
+ * variable will be used if it exists.
1572
1579
  */
1573
- token: string;
1580
+ token?: string;
1574
1581
  /**
1575
1582
  * Configure how the client should retry requests.
1576
1583
  */
@@ -1792,7 +1799,7 @@ type QueueRequest = {
1792
1799
  declare class Client {
1793
1800
  http: Requester;
1794
1801
  private token;
1795
- constructor(config: ClientConfig);
1802
+ constructor(config?: ClientConfig);
1796
1803
  /**
1797
1804
  * Access the urlGroup API.
1798
1805
  *
@@ -1564,13 +1564,20 @@ type ClientConfig = {
1564
1564
  *
1565
1565
  * This is only used for testing.
1566
1566
  *
1567
+ * If not provided, value of the QSTASH_URL environment
1568
+ * variable will be used if it exists. If the QSTASH_URL
1569
+ * environment variable isn't set either, default is used.
1570
+ *
1567
1571
  * @default "https://qstash.upstash.io"
1568
1572
  */
1569
1573
  baseUrl?: string;
1570
1574
  /**
1571
1575
  * The authorization token from the upstash console.
1576
+ *
1577
+ * If not provided, value of the QSTASH_TOKEN environment
1578
+ * variable will be used if it exists.
1572
1579
  */
1573
- token: string;
1580
+ token?: string;
1574
1581
  /**
1575
1582
  * Configure how the client should retry requests.
1576
1583
  */
@@ -1792,7 +1799,7 @@ type QueueRequest = {
1792
1799
  declare class Client {
1793
1800
  http: Requester;
1794
1801
  private token;
1795
- constructor(config: ClientConfig);
1802
+ constructor(config?: ClientConfig);
1796
1803
  /**
1797
1804
  * Access the urlGroup API.
1798
1805
  *
package/cloudflare.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-CdYtp0E1.mjs';
1
+ import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.mjs';
2
2
  import 'neverthrow';
3
3
 
4
4
  type WorkflowBindings = {
package/cloudflare.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-CdYtp0E1.js';
1
+ import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.js';
2
2
  import 'neverthrow';
3
3
 
4
4
  type WorkflowBindings = {
package/cloudflare.js CHANGED
@@ -1133,14 +1133,22 @@ var Client = class {
1133
1133
  http;
1134
1134
  token;
1135
1135
  constructor(config) {
1136
+ const environment = typeof process === "undefined" ? {} : process.env;
1137
+ const baseUrl = config?.baseUrl ? config.baseUrl.replace(/\/$/, "") : environment.QSTASH_URL ?? "https://qstash.upstash.io";
1138
+ const token = config?.token ?? environment.QSTASH_TOKEN;
1136
1139
  this.http = new HttpClient({
1137
- retry: config.retry,
1138
- baseUrl: config.baseUrl ? config.baseUrl.replace(/\/$/, "") : "https://qstash.upstash.io",
1139
- authorization: `Bearer ${config.token}`,
1140
+ retry: config?.retry,
1141
+ baseUrl,
1142
+ authorization: `Bearer ${token}`,
1140
1143
  //@ts-expect-error caused by undici and bunjs type overlap
1141
- headers: prefixHeaders(new Headers(config.headers))
1144
+ headers: prefixHeaders(new Headers(config?.headers ?? {}))
1142
1145
  });
1143
- this.token = config.token;
1146
+ if (!token) {
1147
+ console.warn(
1148
+ "[Upstash QStash] client token is not set. Either pass a token or set QSTASH_TOKEN env variable."
1149
+ );
1150
+ }
1151
+ this.token = token;
1144
1152
  }
1145
1153
  /**
1146
1154
  * Access the urlGroup API.
package/cloudflare.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  serve
3
- } from "./chunk-WXLHIS4A.mjs";
3
+ } from "./chunk-QHCEWG63.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 { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-CdYtp0E1.mjs';
3
+ import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.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 { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-CdYtp0E1.js';
3
+ import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.js';
4
4
  import 'neverthrow';
5
5
 
6
6
  type VerifySignatureConfig = {
package/h3.js CHANGED
@@ -2843,14 +2843,22 @@ var Client = class {
2843
2843
  http;
2844
2844
  token;
2845
2845
  constructor(config) {
2846
+ const environment = typeof process === "undefined" ? {} : process.env;
2847
+ const baseUrl = config?.baseUrl ? config.baseUrl.replace(/\/$/, "") : environment.QSTASH_URL ?? "https://qstash.upstash.io";
2848
+ const token = config?.token ?? environment.QSTASH_TOKEN;
2846
2849
  this.http = new HttpClient({
2847
- retry: config.retry,
2848
- baseUrl: config.baseUrl ? config.baseUrl.replace(/\/$/, "") : "https://qstash.upstash.io",
2849
- authorization: `Bearer ${config.token}`,
2850
+ retry: config?.retry,
2851
+ baseUrl,
2852
+ authorization: `Bearer ${token}`,
2850
2853
  //@ts-expect-error caused by undici and bunjs type overlap
2851
- headers: prefixHeaders(new Headers(config.headers))
2854
+ headers: prefixHeaders(new Headers(config?.headers ?? {}))
2852
2855
  });
2853
- this.token = config.token;
2856
+ if (!token) {
2857
+ console.warn(
2858
+ "[Upstash QStash] client token is not set. Either pass a token or set QSTASH_TOKEN env variable."
2859
+ );
2860
+ }
2861
+ this.token = token;
2854
2862
  }
2855
2863
  /**
2856
2864
  * Access the urlGroup API.
package/h3.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  serve,
3
3
  verifySignatureH3
4
- } from "./chunk-3XWIKEL6.mjs";
5
- import "./chunk-JSD5ZIXP.mjs";
6
- import "./chunk-WXLHIS4A.mjs";
4
+ } from "./chunk-FGKPOZOO.mjs";
5
+ import "./chunk-3D34OUXY.mjs";
6
+ import "./chunk-QHCEWG63.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 { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-CdYtp0E1.mjs';
2
+ import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.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 { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-CdYtp0E1.js';
2
+ import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.js';
3
3
  import 'neverthrow';
4
4
 
5
5
  type WorkflowBindings = {
package/hono.js CHANGED
@@ -1133,14 +1133,22 @@ var Client = class {
1133
1133
  http;
1134
1134
  token;
1135
1135
  constructor(config) {
1136
+ const environment = typeof process === "undefined" ? {} : process.env;
1137
+ const baseUrl = config?.baseUrl ? config.baseUrl.replace(/\/$/, "") : environment.QSTASH_URL ?? "https://qstash.upstash.io";
1138
+ const token = config?.token ?? environment.QSTASH_TOKEN;
1136
1139
  this.http = new HttpClient({
1137
- retry: config.retry,
1138
- baseUrl: config.baseUrl ? config.baseUrl.replace(/\/$/, "") : "https://qstash.upstash.io",
1139
- authorization: `Bearer ${config.token}`,
1140
+ retry: config?.retry,
1141
+ baseUrl,
1142
+ authorization: `Bearer ${token}`,
1140
1143
  //@ts-expect-error caused by undici and bunjs type overlap
1141
- headers: prefixHeaders(new Headers(config.headers))
1144
+ headers: prefixHeaders(new Headers(config?.headers ?? {}))
1142
1145
  });
1143
- this.token = config.token;
1146
+ if (!token) {
1147
+ console.warn(
1148
+ "[Upstash QStash] client token is not set. Either pass a token or set QSTASH_TOKEN env variable."
1149
+ );
1150
+ }
1151
+ this.token = token;
1144
1152
  }
1145
1153
  /**
1146
1154
  * Access the urlGroup API.
package/hono.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  serve
3
- } from "./chunk-WXLHIS4A.mjs";
3
+ } from "./chunk-QHCEWG63.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-CdYtp0E1.mjs';
2
- export { A as AddEndpointsRequest, y as BodyInit, I as Chat, K as ChatCompletion, N as ChatCompletionChunk, J as ChatCompletionMessage, _ as ChatRequest, h as Client, p as CreateScheduleRequest, r as Endpoint, v as Event, w as EventPayload, g as EventsRequest, x as GetEventsPayload, G as GetEventsResponse, H as HTTPMethods, z as HeadersInit, M as Message, m as MessagePayload, n as Messages, Y as OpenAIChatModel, Z as PromptChatRequest, d as PublishBatchRequest, f as PublishJsonRequest, e as PublishRequest, l as PublishResponse, i as PublishToApiResponse, k as PublishToUrlGroupsResponse, j as PublishToUrlResponse, Q as QueueRequest, c as Receiver, a as ReceiverConfig, s as RemoveEndpointsRequest, D as RequestOptions, o as Schedule, q as Schedules, b as SignatureError, u as State, T as StreamDisabled, O as StreamEnabled, X as StreamParameter, U as UrlGroup, t as UrlGroups, V as VerifyRequest, W as WithCursor, a1 as anthropic, a2 as custom, a0 as openai, $ as upstash } from './client-CdYtp0E1.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-DuOcoFUv.mjs';
2
+ export { A as AddEndpointsRequest, y as BodyInit, I as Chat, K as ChatCompletion, N as ChatCompletionChunk, J as ChatCompletionMessage, _ as ChatRequest, h as Client, p as CreateScheduleRequest, r as Endpoint, v as Event, w as EventPayload, g as EventsRequest, x as GetEventsPayload, G as GetEventsResponse, H as HTTPMethods, z as HeadersInit, M as Message, m as MessagePayload, n as Messages, Y as OpenAIChatModel, Z as PromptChatRequest, d as PublishBatchRequest, f as PublishJsonRequest, e as PublishRequest, l as PublishResponse, i as PublishToApiResponse, k as PublishToUrlGroupsResponse, j as PublishToUrlResponse, Q as QueueRequest, c as Receiver, a as ReceiverConfig, s as RemoveEndpointsRequest, D as RequestOptions, o as Schedule, q as Schedules, b as SignatureError, u as State, T as StreamDisabled, O as StreamEnabled, X as StreamParameter, U as UrlGroup, t as UrlGroups, V as VerifyRequest, W as WithCursor, a1 as anthropic, a2 as custom, a0 as openai, $ as upstash } from './client-DuOcoFUv.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-CdYtp0E1.js';
2
- export { A as AddEndpointsRequest, y as BodyInit, I as Chat, K as ChatCompletion, N as ChatCompletionChunk, J as ChatCompletionMessage, _ as ChatRequest, h as Client, p as CreateScheduleRequest, r as Endpoint, v as Event, w as EventPayload, g as EventsRequest, x as GetEventsPayload, G as GetEventsResponse, H as HTTPMethods, z as HeadersInit, M as Message, m as MessagePayload, n as Messages, Y as OpenAIChatModel, Z as PromptChatRequest, d as PublishBatchRequest, f as PublishJsonRequest, e as PublishRequest, l as PublishResponse, i as PublishToApiResponse, k as PublishToUrlGroupsResponse, j as PublishToUrlResponse, Q as QueueRequest, c as Receiver, a as ReceiverConfig, s as RemoveEndpointsRequest, D as RequestOptions, o as Schedule, q as Schedules, b as SignatureError, u as State, T as StreamDisabled, O as StreamEnabled, X as StreamParameter, U as UrlGroup, t as UrlGroups, V as VerifyRequest, W as WithCursor, a1 as anthropic, a2 as custom, a0 as openai, $ as upstash } from './client-CdYtp0E1.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-DuOcoFUv.js';
2
+ export { A as AddEndpointsRequest, y as BodyInit, I as Chat, K as ChatCompletion, N as ChatCompletionChunk, J as ChatCompletionMessage, _ as ChatRequest, h as Client, p as CreateScheduleRequest, r as Endpoint, v as Event, w as EventPayload, g as EventsRequest, x as GetEventsPayload, G as GetEventsResponse, H as HTTPMethods, z as HeadersInit, M as Message, m as MessagePayload, n as Messages, Y as OpenAIChatModel, Z as PromptChatRequest, d as PublishBatchRequest, f as PublishJsonRequest, e as PublishRequest, l as PublishResponse, i as PublishToApiResponse, k as PublishToUrlGroupsResponse, j as PublishToUrlResponse, Q as QueueRequest, c as Receiver, a as ReceiverConfig, s as RemoveEndpointsRequest, D as RequestOptions, o as Schedule, q as Schedules, b as SignatureError, u as State, T as StreamDisabled, O as StreamEnabled, X as StreamParameter, U as UrlGroup, t as UrlGroups, V as VerifyRequest, W as WithCursor, a1 as anthropic, a2 as custom, a0 as openai, $ as upstash } from './client-DuOcoFUv.js';
3
3
  import 'neverthrow';
4
4
 
5
5
  /**
package/index.js CHANGED
@@ -1195,14 +1195,22 @@ var Client = class {
1195
1195
  http;
1196
1196
  token;
1197
1197
  constructor(config) {
1198
+ const environment = typeof process === "undefined" ? {} : process.env;
1199
+ const baseUrl = config?.baseUrl ? config.baseUrl.replace(/\/$/, "") : environment.QSTASH_URL ?? "https://qstash.upstash.io";
1200
+ const token = config?.token ?? environment.QSTASH_TOKEN;
1198
1201
  this.http = new HttpClient({
1199
- retry: config.retry,
1200
- baseUrl: config.baseUrl ? config.baseUrl.replace(/\/$/, "") : "https://qstash.upstash.io",
1201
- authorization: `Bearer ${config.token}`,
1202
+ retry: config?.retry,
1203
+ baseUrl,
1204
+ authorization: `Bearer ${token}`,
1202
1205
  //@ts-expect-error caused by undici and bunjs type overlap
1203
- headers: prefixHeaders(new Headers(config.headers))
1206
+ headers: prefixHeaders(new Headers(config?.headers ?? {}))
1204
1207
  });
1205
- this.token = config.token;
1208
+ if (!token) {
1209
+ console.warn(
1210
+ "[Upstash QStash] client token is not set. Either pass a token or set QSTASH_TOKEN env variable."
1211
+ );
1212
+ }
1213
+ this.token = token;
1206
1214
  }
1207
1215
  /**
1208
1216
  * Access the urlGroup API.
package/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resend
3
- } from "./chunk-JSD5ZIXP.mjs";
3
+ } from "./chunk-3D34OUXY.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-WXLHIS4A.mjs";
25
+ } from "./chunk-QHCEWG63.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 { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-CdYtp0E1.mjs';
3
+ import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.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 { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-CdYtp0E1.js';
3
+ import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.js';
4
4
  import 'neverthrow';
5
5
 
6
6
  type VerifySignatureConfig = {
package/nextjs.js CHANGED
@@ -1137,14 +1137,22 @@ var Client = class {
1137
1137
  http;
1138
1138
  token;
1139
1139
  constructor(config) {
1140
+ const environment = typeof process === "undefined" ? {} : process.env;
1141
+ const baseUrl = config?.baseUrl ? config.baseUrl.replace(/\/$/, "") : environment.QSTASH_URL ?? "https://qstash.upstash.io";
1142
+ const token = config?.token ?? environment.QSTASH_TOKEN;
1140
1143
  this.http = new HttpClient({
1141
- retry: config.retry,
1142
- baseUrl: config.baseUrl ? config.baseUrl.replace(/\/$/, "") : "https://qstash.upstash.io",
1143
- authorization: `Bearer ${config.token}`,
1144
+ retry: config?.retry,
1145
+ baseUrl,
1146
+ authorization: `Bearer ${token}`,
1144
1147
  //@ts-expect-error caused by undici and bunjs type overlap
1145
- headers: prefixHeaders(new Headers(config.headers))
1148
+ headers: prefixHeaders(new Headers(config?.headers ?? {}))
1146
1149
  });
1147
- this.token = config.token;
1150
+ if (!token) {
1151
+ console.warn(
1152
+ "[Upstash QStash] client token is not set. Either pass a token or set QSTASH_TOKEN env variable."
1153
+ );
1154
+ }
1155
+ this.token = token;
1148
1156
  }
1149
1157
  /**
1150
1158
  * Access the urlGroup API.
package/nextjs.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Receiver,
3
3
  serve
4
- } from "./chunk-WXLHIS4A.mjs";
4
+ } from "./chunk-QHCEWG63.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-3XWIKEL6.mjs";
4
- import "./chunk-JSD5ZIXP.mjs";
5
- import "./chunk-WXLHIS4A.mjs";
3
+ } from "./chunk-FGKPOZOO.mjs";
4
+ import "./chunk-3D34OUXY.mjs";
5
+ import "./chunk-QHCEWG63.mjs";
6
6
 
7
7
  // platforms/nuxt.ts
8
8
  var verifySignatureNuxt = verifySignatureH3;
package/package.json CHANGED
@@ -1 +1 @@
1
- {"version":"v2.7.20","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.7.21","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 { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-CdYtp0E1.mjs';
2
+ import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.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 { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-CdYtp0E1.js';
2
+ import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.js';
3
3
  import 'neverthrow';
4
4
 
5
5
  type VerifySignatureConfig = {
package/solidjs.js CHANGED
@@ -2520,14 +2520,22 @@ var Client = class {
2520
2520
  http;
2521
2521
  token;
2522
2522
  constructor(config) {
2523
+ const environment = typeof process === "undefined" ? {} : process.env;
2524
+ const baseUrl = config?.baseUrl ? config.baseUrl.replace(/\/$/, "") : environment.QSTASH_URL ?? "https://qstash.upstash.io";
2525
+ const token = config?.token ?? environment.QSTASH_TOKEN;
2523
2526
  this.http = new HttpClient({
2524
- retry: config.retry,
2525
- baseUrl: config.baseUrl ? config.baseUrl.replace(/\/$/, "") : "https://qstash.upstash.io",
2526
- authorization: `Bearer ${config.token}`,
2527
+ retry: config?.retry,
2528
+ baseUrl,
2529
+ authorization: `Bearer ${token}`,
2527
2530
  //@ts-expect-error caused by undici and bunjs type overlap
2528
- headers: prefixHeaders(new Headers(config.headers))
2531
+ headers: prefixHeaders(new Headers(config?.headers ?? {}))
2529
2532
  });
2530
- this.token = config.token;
2533
+ if (!token) {
2534
+ console.warn(
2535
+ "[Upstash QStash] client token is not set. Either pass a token or set QSTASH_TOKEN env variable."
2536
+ );
2537
+ }
2538
+ this.token = token;
2531
2539
  }
2532
2540
  /**
2533
2541
  * Access the urlGroup API.
package/solidjs.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import "./chunk-JSD5ZIXP.mjs";
1
+ import "./chunk-3D34OUXY.mjs";
2
2
  import {
3
3
  Receiver,
4
4
  serve
5
- } from "./chunk-WXLHIS4A.mjs";
5
+ } from "./chunk-QHCEWG63.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 { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-CdYtp0E1.mjs';
2
+ import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.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 { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-CdYtp0E1.js';
2
+ import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.js';
3
3
  import 'neverthrow';
4
4
 
5
5
  type VerifySignatureConfig = {
package/svelte.js CHANGED
@@ -2520,14 +2520,22 @@ var Client = class {
2520
2520
  http;
2521
2521
  token;
2522
2522
  constructor(config) {
2523
+ const environment = typeof process === "undefined" ? {} : process.env;
2524
+ const baseUrl = config?.baseUrl ? config.baseUrl.replace(/\/$/, "") : environment.QSTASH_URL ?? "https://qstash.upstash.io";
2525
+ const token = config?.token ?? environment.QSTASH_TOKEN;
2523
2526
  this.http = new HttpClient({
2524
- retry: config.retry,
2525
- baseUrl: config.baseUrl ? config.baseUrl.replace(/\/$/, "") : "https://qstash.upstash.io",
2526
- authorization: `Bearer ${config.token}`,
2527
+ retry: config?.retry,
2528
+ baseUrl,
2529
+ authorization: `Bearer ${token}`,
2527
2530
  //@ts-expect-error caused by undici and bunjs type overlap
2528
- headers: prefixHeaders(new Headers(config.headers))
2531
+ headers: prefixHeaders(new Headers(config?.headers ?? {}))
2529
2532
  });
2530
- this.token = config.token;
2533
+ if (!token) {
2534
+ console.warn(
2535
+ "[Upstash QStash] client token is not set. Either pass a token or set QSTASH_TOKEN env variable."
2536
+ );
2537
+ }
2538
+ this.token = token;
2531
2539
  }
2532
2540
  /**
2533
2541
  * Access the urlGroup API.
package/svelte.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import "./chunk-JSD5ZIXP.mjs";
1
+ import "./chunk-3D34OUXY.mjs";
2
2
  import {
3
3
  Receiver,
4
4
  serve
5
- } from "./chunk-WXLHIS4A.mjs";
5
+ } from "./chunk-QHCEWG63.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 { ag as AsyncStepFunction, a9 as DisabledWorkflowContext, F as FailureFunctionPayload, aj as FinishCondition, al as LogLevel, ai as ParallelCallState, ae as RawStep, ak as RequiredExceptFields, a3 as RouteFunction, S as Step, ah as StepFunction, ad as StepType, ac as StepTypes, af as SyncStepFunction, a5 as Workflow, aa as WorkflowClient, a8 as WorkflowContext, an as WorkflowLogger, am as WorkflowLoggerOptions, ab as WorkflowReceiver, a4 as WorkflowServeOptions, a6 as processOptions, a7 as serve } from './client-CdYtp0E1.mjs';
1
+ export { ag as AsyncStepFunction, a9 as DisabledWorkflowContext, F as FailureFunctionPayload, aj as FinishCondition, al as LogLevel, ai as ParallelCallState, ae as RawStep, ak as RequiredExceptFields, a3 as RouteFunction, S as Step, ah as StepFunction, ad as StepType, ac as StepTypes, af as SyncStepFunction, a5 as Workflow, aa as WorkflowClient, a8 as WorkflowContext, an as WorkflowLogger, am as WorkflowLoggerOptions, ab as WorkflowReceiver, a4 as WorkflowServeOptions, a6 as processOptions, a7 as serve } from './client-DuOcoFUv.mjs';
2
2
  import 'neverthrow';
package/workflow.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { ag as AsyncStepFunction, a9 as DisabledWorkflowContext, F as FailureFunctionPayload, aj as FinishCondition, al as LogLevel, ai as ParallelCallState, ae as RawStep, ak as RequiredExceptFields, a3 as RouteFunction, S as Step, ah as StepFunction, ad as StepType, ac as StepTypes, af as SyncStepFunction, a5 as Workflow, aa as WorkflowClient, a8 as WorkflowContext, an as WorkflowLogger, am as WorkflowLoggerOptions, ab as WorkflowReceiver, a4 as WorkflowServeOptions, a6 as processOptions, a7 as serve } from './client-CdYtp0E1.js';
1
+ export { ag as AsyncStepFunction, a9 as DisabledWorkflowContext, F as FailureFunctionPayload, aj as FinishCondition, al as LogLevel, ai as ParallelCallState, ae as RawStep, ak as RequiredExceptFields, a3 as RouteFunction, S as Step, ah as StepFunction, ad as StepType, ac as StepTypes, af as SyncStepFunction, a5 as Workflow, aa as WorkflowClient, a8 as WorkflowContext, an as WorkflowLogger, am as WorkflowLoggerOptions, ab as WorkflowReceiver, a4 as WorkflowServeOptions, a6 as processOptions, a7 as serve } from './client-DuOcoFUv.js';
2
2
  import 'neverthrow';
package/workflow.js CHANGED
@@ -1139,14 +1139,22 @@ var Client = class {
1139
1139
  http;
1140
1140
  token;
1141
1141
  constructor(config) {
1142
+ const environment = typeof process === "undefined" ? {} : process.env;
1143
+ const baseUrl = config?.baseUrl ? config.baseUrl.replace(/\/$/, "") : environment.QSTASH_URL ?? "https://qstash.upstash.io";
1144
+ const token = config?.token ?? environment.QSTASH_TOKEN;
1142
1145
  this.http = new HttpClient({
1143
- retry: config.retry,
1144
- baseUrl: config.baseUrl ? config.baseUrl.replace(/\/$/, "") : "https://qstash.upstash.io",
1145
- authorization: `Bearer ${config.token}`,
1146
+ retry: config?.retry,
1147
+ baseUrl,
1148
+ authorization: `Bearer ${token}`,
1146
1149
  //@ts-expect-error caused by undici and bunjs type overlap
1147
- headers: prefixHeaders(new Headers(config.headers))
1150
+ headers: prefixHeaders(new Headers(config?.headers ?? {}))
1148
1151
  });
1149
- this.token = config.token;
1152
+ if (!token) {
1153
+ console.warn(
1154
+ "[Upstash QStash] client token is not set. Either pass a token or set QSTASH_TOKEN env variable."
1155
+ );
1156
+ }
1157
+ this.token = token;
1150
1158
  }
1151
1159
  /**
1152
1160
  * Access the urlGroup API.
package/workflow.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  WorkflowLogger,
7
7
  processOptions,
8
8
  serve
9
- } from "./chunk-WXLHIS4A.mjs";
9
+ } from "./chunk-QHCEWG63.mjs";
10
10
  export {
11
11
  DisabledWorkflowContext,
12
12
  StepTypes,