@upstash/qstash 0.0.12 → 0.0.13

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.
@@ -6,7 +6,7 @@ export class Consumer extends c.Consumer {
6
6
  super({
7
7
  ...config,
8
8
  // dnt-shim-ignore
9
- subtleCrypto: crypto.subtle
9
+ subtleCrypto: crypto.subtle,
10
10
  });
11
11
  }
12
12
  }
@@ -18,7 +18,7 @@ export function verifySignature(handler, config) {
18
18
  const consumer = new Consumer({
19
19
  currentSigningKey,
20
20
  nextSigningKey,
21
- subtleCrypto: dntShim.crypto.subtle
21
+ subtleCrypto: dntShim.crypto.subtle,
22
22
  });
23
23
  return async (req, res) => {
24
24
  const signature = req.headers["upstash-signature"];
@@ -0,0 +1,12 @@
1
+ // dnt-shim-ignore
2
+ import * as dntShim from "../_dnt.shims.js";
3
+ import * as c from "../pkg/consumer.js";
4
+ export * from "../pkg/client/client.js";
5
+ export class Consumer extends c.Consumer {
6
+ constructor(config) {
7
+ super({
8
+ ...config,
9
+ subtleCrypto: dntShim.crypto.subtle,
10
+ });
11
+ }
12
+ }
@@ -15,7 +15,7 @@ export class Client {
15
15
  baseUrl: config.baseUrl
16
16
  ? config.baseUrl.replace(/\/$/, "")
17
17
  : "https://qstash.upstash.io",
18
- authorization: config.token,
18
+ authorization: `Bearer ${config.token}`,
19
19
  });
20
20
  }
21
21
  /**
@@ -43,7 +43,7 @@ export class HttpClient {
43
43
  }
44
44
  async request(req) {
45
45
  const headers = new Headers(req.headers);
46
- headers.set("Upstash-Authorization", `Bearer ${this.authorization}`);
46
+ headers.set("Authorization", this.authorization);
47
47
  const requestOptions = {
48
48
  method: req.method,
49
49
  headers,
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
- "module": "./esm/entrypoints/nextjs.js",
3
- "main": "./script/entrypoints/nextjs.js",
4
- "types": "./types/entrypoints/nextjs.d.ts",
2
+ "module": "./esm/entrypoints/nodejs.js",
3
+ "main": "./script/entrypoints/nodejs.js",
4
+ "types": "./types/entrypoints/nodejs.d.ts",
5
5
  "name": "@upstash/qstash",
6
- "version": "v0.0.12",
6
+ "version": "v0.0.13",
7
7
  "description": "Official Deno/Typescript client for qStash",
8
8
  "repository": {
9
9
  "type": "git",
@@ -25,13 +25,17 @@
25
25
  "peerDependencies": {
26
26
  "micro": "latest"
27
27
  },
28
- "typesVersions": {
29
- "*": {
30
- "nextjs": "./types/entrypoints/nextjs.d.ts",
31
- "cloudflare": "./types/entrypoints/cloudflare.d.ts"
32
- }
33
- },
34
28
  "exports": {
29
+ ".": {
30
+ "import": "./esm/entrypoints/nodejs.js",
31
+ "require": "./script/entrypoints/nodejs.js",
32
+ "types": "./types/entrypoints/nodejs.d.ts"
33
+ },
34
+ "./nodejs": {
35
+ "import": "./esm/entrypoints/nodejs.js",
36
+ "require": "./script/entrypoints/nodejs.js",
37
+ "types": "./types/entrypoints/nodejs.d.ts"
38
+ },
35
39
  "./nextjs": {
36
40
  "import": "./esm/entrypoints/nextjs.js",
37
41
  "require": "./script/entrypoints/nextjs.js",
@@ -35,7 +35,7 @@ class Consumer extends c.Consumer {
35
35
  super({
36
36
  ...config,
37
37
  // dnt-shim-ignore
38
- subtleCrypto: crypto.subtle
38
+ subtleCrypto: crypto.subtle,
39
39
  });
40
40
  }
41
41
  }
@@ -44,7 +44,7 @@ function verifySignature(handler, config) {
44
44
  const consumer = new consumer_js_1.Consumer({
45
45
  currentSigningKey,
46
46
  nextSigningKey,
47
- subtleCrypto: dntShim.crypto.subtle
47
+ subtleCrypto: dntShim.crypto.subtle,
48
48
  });
49
49
  return async (req, res) => {
50
50
  const signature = req.headers["upstash-signature"];
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Consumer = void 0;
30
+ // dnt-shim-ignore
31
+ const dntShim = __importStar(require("../_dnt.shims.js"));
32
+ const c = __importStar(require("../pkg/consumer.js"));
33
+ __exportStar(require("../pkg/client/client.js"), exports);
34
+ class Consumer extends c.Consumer {
35
+ constructor(config) {
36
+ super({
37
+ ...config,
38
+ subtleCrypto: dntShim.crypto.subtle,
39
+ });
40
+ }
41
+ }
42
+ exports.Consumer = Consumer;
@@ -18,7 +18,7 @@ class Client {
18
18
  baseUrl: config.baseUrl
19
19
  ? config.baseUrl.replace(/\/$/, "")
20
20
  : "https://qstash.upstash.io",
21
- authorization: config.token,
21
+ authorization: `Bearer ${config.token}`,
22
22
  });
23
23
  }
24
24
  /**
@@ -46,7 +46,7 @@ class HttpClient {
46
46
  }
47
47
  async request(req) {
48
48
  const headers = new Headers(req.headers);
49
- headers.set("Upstash-Authorization", `Bearer ${this.authorization}`);
49
+ headers.set("Authorization", this.authorization);
50
50
  const requestOptions = {
51
51
  method: req.method,
52
52
  headers,
@@ -0,0 +1,5 @@
1
+ import * as c from "../pkg/consumer.js";
2
+ export * from "../pkg/client/client.js";
3
+ export declare class Consumer extends c.Consumer {
4
+ constructor(config: Omit<c.ConsumerConfig, "crypto">);
5
+ }
@@ -4,7 +4,7 @@ import { Messages } from "./messages.js";
4
4
  import { Schedules } from "./schedules.js";
5
5
  import { Endpoints } from "./endpoints.js";
6
6
  import type { Log } from "./types.js";
7
- import type { HeadersInit, BodyInit } from "../../deps/raw.githubusercontent.com/microsoft/TypeScript/main/lib/lib.dom";
7
+ import type { BodyInit, HeadersInit } from "../../deps/raw.githubusercontent.com/microsoft/TypeScript/main/lib/lib.dom";
8
8
  export declare type ClientConfig = {
9
9
  /**
10
10
  * Url of the qstash api server.
@@ -1,4 +1,4 @@
1
- import type { HeadersInit, BodyInit } from "../../deps/raw.githubusercontent.com/microsoft/TypeScript/main/lib/lib.dom";
1
+ import type { BodyInit, HeadersInit } from "../../deps/raw.githubusercontent.com/microsoft/TypeScript/main/lib/lib.dom";
2
2
  export declare type UpstashRequest = {
3
3
  /**
4
4
  * The path to the resource.