@upstash/qstash
Advanced tools
Comparing version 0.0.0-ci.35a0750270048726c6bea0a6f697178dfa310685-20231114120302 to 0.0.0-ci.369b68ede38e9d1e5e9704dbefd4e4f4ff2ef95b-20241203080506
@@ -1,1 +0,1 @@ | ||
{ "name": "@upstash/qstash", "version": "v0.0.0-ci.35a0750270048726c6bea0a6f697178dfa310685-20231114120302", "description": "Official Typescript client for QStash", "repository": { "type": "git", "url": "git+https://github.com/upstash/sdk-qstash-ts.git" }, "module": "./dist/index.js", "main": "./dist/index.js", "types": "./dist/index.d.ts", "keywords": [ "qstash", "queue", "events", "serverless", "upstash" ], "author": "Andreas Thomas <dev@chronark.com>", "license": "MIT", "bugs": { "url": "https://github.com/upstash/sdk-qstash-ts/issues" }, "homepage": "https://github.com/upstash/sdk-qstash-ts#readme", "files": [ "dist" ], "scripts": { "build": "tsup", "fmt": "pnpm rome check . --apply-unsafe && pnpm rome format . --write" }, "devDependencies": { "@biomejs/biome": "^1.3.3", "@types/crypto-js": "^4.2.0", "@types/node": "^20.5.7", "next": "^14.0.2", "tsup": "^7.2.0", "typescript": "^5.2.2" }, "dependencies": { "crypto-js": "^4.2.0", "jose": "^4.14.4" }, "typesVersions": { "*": { ".": [ "./dist/index.d.ts" ], "nextjs": [ "./dist/nextjs.d.ts" ] } } } | ||
{ "version": "v0.0.0-ci.369b68ede38e9d1e5e9704dbefd4e4f4ff2ef95b-20241203080506", "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", "prepare": "husky" }, "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": { "neverthrow": "^7.0.1", "crypto-js": ">=4.2.0", "jose": "^5.2.3" } } |
@@ -5,2 +5,7 @@ # Upstash QStash SDK | ||
> [!NOTE] | ||
> **This project is in GA Stage.** | ||
> The Upstash Professional Support fully covers this project. It receives regular updates, and bug fixes. | ||
> The Upstash team is committed to maintaining and improving its functionality. | ||
**QStash** is an HTTP based messaging and scheduling solution for serverless and | ||
@@ -41,3 +46,3 @@ edge runtimes. | ||
Go to [upstash](https://console.upstash.com/qstash) and copy the token. | ||
Go to [Upstash Console](https://console.upstash.com/qstash) and copy the QSTASH_TOKEN. | ||
@@ -56,9 +61,9 @@ ## Basic Usage: | ||
const c = new Client({ | ||
const client = new Client({ | ||
token: "<QSTASH_TOKEN>", | ||
}); | ||
const res = await c.publishJSON({ | ||
const res = await client.publishJSON({ | ||
url: "https://my-api...", | ||
// or topic: "the name or id of a topic" | ||
// or urlGroup: "the name or id of a url group" | ||
body: { | ||
@@ -90,3 +95,3 @@ hello: "world", | ||
* Please note that on some platforms (e.g. Vercel or Netlify) you might | ||
* receive the header in lower case: `upstash-signature` | ||
* receive the header in lower case: `upstash-signature` | ||
* | ||
@@ -100,12 +105,31 @@ */ | ||
body: "string"; | ||
/** | ||
* Number of seconds to tolerate when checking `nbf` and `exp` claims, to deal with small clock differences among different servers | ||
* | ||
* @default 0 | ||
*/ | ||
clockTolerance?: number; | ||
}) | ||
``` | ||
### Publishing a message to an LLM provider | ||
No need for complicated setup your LLM request. We'll call LLM and schedule it for your serverless needs. | ||
```ts | ||
import { Client, openai } from "@upstash/qstash"; | ||
const client = new Client({ | ||
token: "<QSTASH_TOKEN>", | ||
}); | ||
const result = await client.publishJSON({ | ||
api: { name: "llm", provider: openai({ token: process.env.OPENAI_API_KEY! }) }, | ||
body: { | ||
model: "gpt-3.5-turbo", | ||
messages: [ | ||
{ | ||
role: "user", | ||
content: "Where is the capital of Turkey?", | ||
}, | ||
], | ||
}, | ||
callback: "https://oz.requestcatcher.com/", | ||
}); | ||
``` | ||
## Docs | ||
@@ -117,2 +141,33 @@ | ||
### [Install Deno](https://deno.land/#installation) | ||
### Setup | ||
This project requires [Bun](https://bun.sh/) to be installed. Please see the [Bun installation documentation](https://bun.sh/docs/installation) for further instructions. | ||
Once you have cloned the project, you will need to install the dependencies and then you can run the project. | ||
```sh | ||
bun install | ||
bun run build | ||
``` | ||
### Testing | ||
To begin testing, environment variables will need to be setup. First, create a `.env` file in the root of the project. [`.env.template`](/.env.template) can be used as a template. Your values can be found in the [Qstash Console](https://console.upstash.com/qstash). | ||
```sh | ||
bun run test | ||
``` | ||
### Committing | ||
This project uses [commitlint](https://commitlint.js.org/). When committing, please ensure your commit message is formatted to include an appropriate prefix with the message. | ||
#### Examples | ||
``` | ||
fix: typescript bug | ||
feat: use new logger | ||
perf: refactor cache | ||
``` | ||
For a full list of options, please see the [`commitlint.config.js`](/commitlint.config.js) file. |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
923732
44
27209
168
3
23
30
11
+ Addedneverthrow@^7.0.1
+ Addedjose@5.9.6(transitive)
+ Addedneverthrow@7.2.0(transitive)
- Removedjose@4.15.9(transitive)
Updatedcrypto-js@>=4.2.0
Updatedjose@^5.2.3