Comparing version 0.4.16-cfp.3 to 0.4.16-cfp.4
@@ -11,2 +11,6 @@ "use strict"; | ||
const version_1 = require("./version"); | ||
const registerResSchema = zod_1.z.object({ | ||
status: zod_1.z.number().default(200), | ||
error: zod_1.z.string().default("Successfully registered"), | ||
}); | ||
/** | ||
@@ -85,5 +89,5 @@ * Serve and register any declared functions with Inngest, making them available | ||
const prefix = ((_a = this.signingKey.match(/^signkey-(test|prod)-/)) === null || _a === void 0 ? void 0 : _a.shift()) || ""; | ||
const key = Buffer.from(this.signingKey.replace(/^signkey-(test|prod)-/, ""), "hex"); | ||
const key = this.signingKey.replace(/^signkey-(test|prod)-/, ""); | ||
// Decode the key from its hex representation into a bytestream | ||
return `${prefix}${(0, sha_js_1.default)("sha256").update(key).digest("hex")}`; | ||
return `${prefix}${(0, sha_js_1.default)("sha256").update(key, "hex").digest("hex")}`; | ||
} | ||
@@ -185,9 +189,13 @@ createHandler() { | ||
} | ||
const { status, error } = zod_1.z | ||
.object({ | ||
status: zod_1.z.number().default(200), | ||
error: zod_1.z.string().default("Successfully registered"), | ||
}) | ||
.parse((await res.json()) || { status: 200, error: "Successfully registered" }); | ||
console.log("Registered:", res.status, res.statusText, res.json()); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
let data = {}; | ||
try { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
data = await res.json(); | ||
} | ||
catch (err) { | ||
console.warn("Couldn't unpack register response:", err); | ||
} | ||
const { status, error } = registerResSchema.parse(data); | ||
console.log("Registered:", res.status, res.statusText, data); | ||
return { status, message: error }; | ||
@@ -194,0 +202,0 @@ } |
{ | ||
"name": "inngest", | ||
"version": "0.4.16-cfp.3", | ||
"version": "0.4.16-cfp.4", | ||
"description": "Official SDK for Inngest.com", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -1,2 +0,2 @@ | ||
export declare const version = "0.4.16-cfp.3"; | ||
export declare const version = "0.4.16-cfp.4"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -5,3 +5,3 @@ "use strict"; | ||
// Generated by genversion. | ||
exports.version = "0.4.16-cfp.3"; | ||
exports.version = "0.4.16-cfp.4"; | ||
//# sourceMappingURL=version.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
128150
1576