@upstash/qstash
Advanced tools
Comparing version
import * as dntShim from "../_dnt.shims.js"; | ||
// @ts-ignore Deno can't compile | ||
import { buffer } from "micro"; | ||
import { Consumer } from "../pkg/consumer.js"; | ||
@@ -31,4 +29,9 @@ export function verifySignature(handler, config) { | ||
} | ||
const body = (await buffer(req)).toString(); | ||
console.log(req.headers); | ||
const chunks = []; | ||
for await (const chunk of req) { | ||
chunks.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk); | ||
} | ||
const body = Buffer.concat(chunks).toString("utf-8"); | ||
// const body = (await buffer(req)).toString(); | ||
console.log(req.headers, body); | ||
const url = config?.url ?? new URL(req.url, `https://${process.env.VERCEL_URL}`).href; | ||
@@ -35,0 +38,0 @@ const isValid = await consumer.verify({ signature, body, url }); |
@@ -6,3 +6,3 @@ { | ||
"name": "@upstash/qstash", | ||
"version": "v0.0.13", | ||
"version": "v0.0.14", | ||
"description": "Official Deno/Typescript client for qStash", | ||
@@ -26,4 +26,14 @@ "repository": { | ||
"homepage": "https://github.com/upstash/sdk-qstash-ts#readme", | ||
"peerDependencies": { | ||
"micro": "latest" | ||
"typesVersions": { | ||
"*": { | ||
"nodejs": [ | ||
"./types/entrypoints/nodejs.d.ts" | ||
], | ||
"cloudflare": [ | ||
"./types/entrypoints/cloudflare.d.ts" | ||
], | ||
"nextjs": [ | ||
"./types/entrypoints/nextjs.d.ts" | ||
] | ||
} | ||
}, | ||
@@ -41,2 +51,7 @@ "exports": { | ||
}, | ||
"./cloudflare": { | ||
"import": "./esm/entrypoints/cloudflare.js", | ||
"require": "./script/entrypoints/cloudflare.js", | ||
"types": "./types/entrypoints/cloudflare.d.ts" | ||
}, | ||
"./nextjs": { | ||
@@ -46,12 +61,7 @@ "import": "./esm/entrypoints/nextjs.js", | ||
"types": "./types/entrypoints/nextjs.d.ts" | ||
}, | ||
"./cloudflare": { | ||
"import": "./esm/entrypoints/cloudflare.js", | ||
"require": "./script/entrypoints/cloudflare.js", | ||
"types": "./types/entrypoints/cloudflare.d.ts" | ||
} | ||
}, | ||
"dependencies": { | ||
"@deno/shim-crypto": "~0.3.1" | ||
"@deno/shim-crypto": "~0.3.0" | ||
} | ||
} |
@@ -28,4 +28,2 @@ "use strict"; | ||
const dntShim = __importStar(require("../_dnt.shims.js")); | ||
// @ts-ignore Deno can't compile | ||
const micro_1 = require("micro"); | ||
const consumer_js_1 = require("../pkg/consumer.js"); | ||
@@ -58,4 +56,9 @@ function verifySignature(handler, config) { | ||
} | ||
const body = (await (0, micro_1.buffer)(req)).toString(); | ||
console.log(req.headers); | ||
const chunks = []; | ||
for await (const chunk of req) { | ||
chunks.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk); | ||
} | ||
const body = Buffer.concat(chunks).toString("utf-8"); | ||
// const body = (await buffer(req)).toString(); | ||
console.log(req.headers, body); | ||
const url = config?.url ?? new URL(req.url, `https://${process.env.VERCEL_URL}`).href; | ||
@@ -62,0 +65,0 @@ const isValid = await consumer.verify({ signature, body, url }); |
@@ -26,3 +26,3 @@ import * as dntShim from "../../../../_dnt.shims.js"; | ||
(format: "jwk", key: dntShim.CryptoKey): Promise<dntShim.JsonWebKey>; | ||
(format: "pkcs8" | "raw" | "spki", key: dntShim.CryptoKey): Promise<ArrayBuffer>; | ||
(format: "raw" | "pkcs8" | "spki", key: dntShim.CryptoKey): Promise<ArrayBuffer>; | ||
}; | ||
@@ -36,3 +36,3 @@ generateKey: { | ||
(format: "jwk", keyData: dntShim.JsonWebKey, algorithm: dntShim.AlgorithmIdentifier | dntShim.HmacImportParams | dntShim.RsaHashedImportParams | dntShim.EcKeyImportParams | dntShim.AesKeyAlgorithm, extractable: boolean, keyUsages: readonly dntShim.KeyUsage[]): Promise<dntShim.CryptoKey>; | ||
(format: "pkcs8" | "raw" | "spki", keyData: dntShim.BufferSource, algorithm: dntShim.AlgorithmIdentifier | dntShim.HmacImportParams | dntShim.RsaHashedImportParams | dntShim.EcKeyImportParams | dntShim.AesKeyAlgorithm, extractable: boolean, keyUsages: dntShim.KeyUsage[]): Promise<dntShim.CryptoKey>; | ||
(format: "raw" | "pkcs8" | "spki", keyData: dntShim.BufferSource, algorithm: dntShim.AlgorithmIdentifier | dntShim.HmacImportParams | dntShim.RsaHashedImportParams | dntShim.EcKeyImportParams | dntShim.AesKeyAlgorithm, extractable: boolean, keyUsages: dntShim.KeyUsage[]): Promise<dntShim.CryptoKey>; | ||
}; | ||
@@ -39,0 +39,0 @@ sign: (algorithm: dntShim.AlgorithmIdentifier | dntShim.RsaPssParams | dntShim.EcdsaParams, key: dntShim.CryptoKey, data: dntShim.BufferSource) => Promise<ArrayBuffer>; |
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
587295
0.09%1
-50%9610
0.06%- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated