@upstash/qstash
Advanced tools
Comparing version 2.7.21 to 2.7.22
@@ -1,2 +0,2 @@ | ||
import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.js'; | ||
import { a4 as RouteFunction, a5 as WorkflowServeOptions } from './client-vTeVVeh7.js'; | ||
import 'neverthrow'; | ||
@@ -3,0 +3,0 @@ |
import * as h3 from 'h3'; | ||
import { H3Event } from 'h3'; | ||
import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.js'; | ||
import { a4 as RouteFunction, a5 as WorkflowServeOptions } from './client-vTeVVeh7.js'; | ||
import 'neverthrow'; | ||
@@ -5,0 +5,0 @@ |
import { Context } from 'hono'; | ||
import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.js'; | ||
import { a4 as RouteFunction, a5 as WorkflowServeOptions } from './client-vTeVVeh7.js'; | ||
import 'neverthrow'; | ||
@@ -4,0 +4,0 @@ |
@@ -1,3 +0,3 @@ | ||
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'; | ||
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'; | ||
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-vTeVVeh7.js'; | ||
export { A as AddEndpointsRequest, y as BodyInit, J as Chat, N as ChatCompletion, O as ChatCompletionChunk, K as ChatCompletionMessage, $ as ChatRequest, h as Client, p as CreateScheduleRequest, r as Endpoint, v as Event, w as EventPayload, g as EventsRequest, I as FlowControl, x as GetEventsPayload, G as GetEventsResponse, H as HTTPMethods, z as HeadersInit, M as Message, m as MessagePayload, n as Messages, Z as OpenAIChatModel, _ 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, X as StreamDisabled, T as StreamEnabled, Y as StreamParameter, U as UrlGroup, t as UrlGroups, V as VerifyRequest, W as WithCursor, a2 as anthropic, a3 as custom, a1 as openai, a0 as upstash } from './client-vTeVVeh7.js'; | ||
import 'neverthrow'; | ||
@@ -4,0 +4,0 @@ |
46
index.js
@@ -144,3 +144,4 @@ "use strict"; | ||
...message, | ||
urlGroup: message.topicName | ||
urlGroup: message.topicName, | ||
ratePerSecond: "rate" in message ? message.rate : void 0 | ||
}; | ||
@@ -575,3 +576,4 @@ }), | ||
...messagePayload, | ||
urlGroup: messagePayload.topicName | ||
urlGroup: messagePayload.topicName, | ||
ratePerSecond: "rate" in messagePayload ? messagePayload.rate : void 0 | ||
}; | ||
@@ -833,2 +835,15 @@ return message; | ||
} | ||
if (request.flowControl?.key) { | ||
const parallelism = request.flowControl.parallelism?.toString(); | ||
const rate = request.flowControl.ratePerSecond?.toString(); | ||
const controlValue = [ | ||
parallelism ? `parallelism=${parallelism}` : void 0, | ||
rate ? `rate=${rate}` : void 0 | ||
].filter(Boolean); | ||
if (controlValue.length === 0) { | ||
throw new QstashError("Provide at least one of parallelism or ratePerSecond for flowControl"); | ||
} | ||
headers.set("Upstash-Flow-Control-Key", request.flowControl.key); | ||
headers.set("Upstash-Flow-Control-Value", controlValue.join(", ")); | ||
} | ||
return headers; | ||
@@ -1045,2 +1060,17 @@ } | ||
} | ||
if (request.flowControl?.key) { | ||
const parallelism = request.flowControl.parallelism?.toString(); | ||
const rate = request.flowControl.ratePerSecond?.toString(); | ||
const controlValue = [ | ||
parallelism ? `parallelism=${parallelism}` : void 0, | ||
rate ? `rate=${rate}` : void 0 | ||
].filter(Boolean); | ||
if (controlValue.length === 0) { | ||
throw new QstashError( | ||
"Provide at least one of parallelism or ratePerSecond for flowControl" | ||
); | ||
} | ||
headers.set("Upstash-Flow-Control-Key", request.flowControl.key); | ||
headers.set("Upstash-Flow-Control-Value", controlValue.join(", ")); | ||
} | ||
return await this.http.request({ | ||
@@ -1057,6 +1087,9 @@ method: "POST", | ||
async get(scheduleId) { | ||
return await this.http.request({ | ||
const schedule = await this.http.request({ | ||
method: "GET", | ||
path: ["v2", "schedules", scheduleId] | ||
}); | ||
if ("rate" in schedule) | ||
schedule.ratePerSecond = schedule.rate; | ||
return schedule; | ||
} | ||
@@ -1067,6 +1100,11 @@ /** | ||
async list() { | ||
return await this.http.request({ | ||
const schedules = await this.http.request({ | ||
method: "GET", | ||
path: ["v2", "schedules"] | ||
}); | ||
for (const schedule of schedules) { | ||
if ("rate" in schedule) | ||
schedule.ratePerSecond = schedule.rate; | ||
} | ||
return schedules; | ||
} | ||
@@ -1073,0 +1111,0 @@ /** |
import { NextApiHandler } from 'next'; | ||
import { NextRequest, NextFetchEvent } from 'next/server'; | ||
import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.js'; | ||
import { a4 as RouteFunction, a5 as WorkflowServeOptions } from './client-vTeVVeh7.js'; | ||
import 'neverthrow'; | ||
@@ -5,0 +5,0 @@ |
@@ -1,1 +0,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"}} | ||
{"version":"v2.7.22","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"}} |
import { APIHandler, APIEvent } from '@solidjs/start/server'; | ||
import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.js'; | ||
import { a4 as RouteFunction, a5 as WorkflowServeOptions } from './client-vTeVVeh7.js'; | ||
import 'neverthrow'; | ||
@@ -4,0 +4,0 @@ |
import { RequestHandler } from '@sveltejs/kit'; | ||
import { a3 as RouteFunction, a4 as WorkflowServeOptions } from './client-DuOcoFUv.js'; | ||
import { a4 as RouteFunction, a5 as WorkflowServeOptions } from './client-vTeVVeh7.js'; | ||
import 'neverthrow'; | ||
@@ -4,0 +4,0 @@ |
@@ -1,2 +0,2 @@ | ||
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'; | ||
export { ah as AsyncStepFunction, aa as DisabledWorkflowContext, F as FailureFunctionPayload, ak as FinishCondition, am as LogLevel, aj as ParallelCallState, af as RawStep, al as RequiredExceptFields, a4 as RouteFunction, S as Step, ai as StepFunction, ae as StepType, ad as StepTypes, ag as SyncStepFunction, a6 as Workflow, ab as WorkflowClient, a9 as WorkflowContext, ao as WorkflowLogger, an as WorkflowLoggerOptions, ac as WorkflowReceiver, a5 as WorkflowServeOptions, a7 as processOptions, a8 as serve } from './client-vTeVVeh7.js'; | ||
import 'neverthrow'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
944339
27691