Comparing version 0.4.16-cfp.9 to 0.4.16-cfp.10
@@ -85,6 +85,6 @@ "use strict"; | ||
*/ | ||
const serve = (nameOrInngest, signingKey, fns, opts) => { | ||
return (0, express_1.serve)(new CloudflareCommHandler(nameOrInngest, signingKey, fns, Object.assign({ fetch: fetch.bind(globalThis) }, opts))); | ||
const serve = (nameOrInngest, fns, opts) => { | ||
return (0, express_1.serve)(new CloudflareCommHandler(nameOrInngest, fns, Object.assign({ fetch: fetch.bind(globalThis) }, opts))); | ||
}; | ||
exports.serve = serve; | ||
//# sourceMappingURL=cloudflare.js.map |
import { Inngest } from "./components/Inngest"; | ||
import { InngestFunction } from "./components/InngestFunction"; | ||
import { EventPayload, FunctionConfig, RegisterOptions, RegisterRequest, StepRunResponse } from "./types"; | ||
import type { FunctionConfig, RegisterOptions, RegisterRequest, StepRunResponse } from "./types"; | ||
/** | ||
@@ -18,9 +18,11 @@ * A handler for serving Inngest functions. This type should be used | ||
/** | ||
* A key used to sign requests to and from Inngest in order to prove that the | ||
* source is legitimate. | ||
* | ||
* @link TODO | ||
* An array of the functions to serve and register with Inngest. | ||
*/ | ||
signingKey: string, functions: InngestFunction<any>[], opts?: RegisterOptions) => any; | ||
functions: InngestFunction<any>[], | ||
/** | ||
* A set of options to further configure the registration of Inngest | ||
* functions. | ||
*/ | ||
opts?: RegisterOptions) => any; | ||
/** | ||
* Serve and register any declared functions with Inngest, making them available | ||
@@ -34,3 +36,3 @@ * to be triggered by events. | ||
*/ | ||
export declare const serve: <Events extends Record<string, EventPayload>>(...args: [nameOrInngest: string | Inngest<Events>, signingKey: string, functions: InngestFunction<Events>[], opts?: RegisterOptions | undefined] | [commHandler: InngestCommHandler]) => any; | ||
export declare const serve: (...args: Parameters<ServeHandler> | [commHandler: InngestCommHandler]) => any; | ||
/** | ||
@@ -77,3 +79,3 @@ * TODO Instead of `createHandler`, expose `createRequest` and `handleResponse` | ||
private readonly fns; | ||
constructor(nameOrInngest: string | Inngest<any>, signingKey: string, functions: InngestFunction<any>[], { inngestRegisterUrl, fetch, landingPage }?: RegisterOptions); | ||
constructor(nameOrInngest: string | Inngest<any>, functions: InngestFunction<any>[], { inngestRegisterUrl, fetch, landingPage, signingKey }?: RegisterOptions); | ||
private get hashedSigningKey(); | ||
@@ -80,0 +82,0 @@ createHandler(): any; |
@@ -13,2 +13,5 @@ "use strict"; | ||
const version_1 = require("./version"); | ||
/** | ||
* A schema for the response from Inngest when registering. | ||
*/ | ||
const registerResSchema = zod_1.z.object({ | ||
@@ -32,4 +35,4 @@ status: zod_1.z.number().default(200), | ||
} | ||
const [nameOrInngest, signingKey, fns, opts] = args; | ||
const handler = new InngestCommHandler(nameOrInngest, signingKey, fns, opts); | ||
const [nameOrInngest, fns, opts] = args; | ||
const handler = new InngestCommHandler(nameOrInngest, fns, opts); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return | ||
@@ -59,3 +62,3 @@ return handler.createHandler(); | ||
class InngestCommHandler { | ||
constructor(nameOrInngest, signingKey, functions, { inngestRegisterUrl, fetch, landingPage } = {}) { | ||
constructor(nameOrInngest, functions, { inngestRegisterUrl, fetch, landingPage, signingKey } = {}) { | ||
this.frameworkName = "default"; | ||
@@ -62,0 +65,0 @@ /** |
@@ -68,6 +68,6 @@ "use strict"; | ||
*/ | ||
const serve = (nameOrInngest, signingKey, fns, opts) => { | ||
return (0, express_1.serve)(new NextCommHandler(nameOrInngest, signingKey, fns, opts)); | ||
const serve = (nameOrInngest, fns, opts) => { | ||
return (0, express_1.serve)(new NextCommHandler(nameOrInngest, fns, opts)); | ||
}; | ||
exports.serve = serve; | ||
//# sourceMappingURL=next.js.map |
{ | ||
"name": "inngest", | ||
"version": "0.4.16-cfp.9", | ||
"version": "0.4.16-cfp.10", | ||
"description": "Official SDK for Inngest.com", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -67,6 +67,6 @@ "use strict"; | ||
*/ | ||
const register = (nameOrInngest, signingKey, fns, opts) => { | ||
return (0, express_1.serve)(new RemixCommHandler(nameOrInngest, signingKey, fns, opts)); | ||
const register = (nameOrInngest, fns, opts) => { | ||
return (0, express_1.serve)(new RemixCommHandler(nameOrInngest, fns, opts)); | ||
}; | ||
exports.register = register; | ||
//# sourceMappingURL=remix.js.map |
@@ -155,2 +155,9 @@ import type { InngestStep } from "./components/InngestStep"; | ||
/** | ||
* A key used to sign requests to and from Inngest in order to prove that the | ||
* source is legitimate. | ||
* | ||
* @link TODO | ||
*/ | ||
signingKey?: string; | ||
/** | ||
* The URL used to register functions with Inngest. | ||
@@ -160,2 +167,10 @@ * Defaults to https://api.inngest.com/fn/register | ||
inngestRegisterUrl?: string; | ||
/** | ||
* If provided, will override the used `fetch` implementation. Useful for | ||
* giving the library a particular implementation if accessing it is not done | ||
* via globals. | ||
* | ||
* By default the library will try to use the native Web API fetch, falling | ||
* back to a Node implementation if no global fetch can be found. | ||
*/ | ||
fetch?: typeof fetch; | ||
@@ -162,0 +177,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
export declare const version = "0.4.16-cfp.9"; | ||
export declare const version = "0.4.16-cfp.10"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -5,3 +5,3 @@ "use strict"; | ||
// Generated by genversion. | ||
exports.version = "0.4.16-cfp.9"; | ||
exports.version = "0.4.16-cfp.10"; | ||
//# sourceMappingURL=version.js.map |
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 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 not supported yet
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
210485
1982