Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

inngest

Package Overview
Dependencies
Maintainers
2
Versions
563
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inngest - npm Package Compare versions

Comparing version 0.4.15 to 0.4.16-cfp.1

express.d.ts

6

cloudflare.d.ts

@@ -1,5 +0,5 @@

import { ServeHandler } from "./handlers/default";
import { ServeHandler } from "./express";
/**
* In Cloudflare Pages, serve and register any declared functions with Inngest,
* making them available to be triggered by events.
* In Cloudflare, serve and register any declared functions with Inngest, making
* them available to be triggered by events.
*

@@ -6,0 +6,0 @@ * @public

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.register = void 0;
// Import and set polyfills before other imports
const buffer_1 = require("buffer");
if (typeof window !== "undefined") {
window.Buffer = buffer_1.Buffer;
window.global = window;
}
// Regular imports
const zod_1 = require("zod");
const default_1 = require("./handlers/default");
const express_1 = require("./express");
const consts_1 = require("./helpers/consts");
class CloudflareCommHandler extends default_1.InngestCommHandler {
class CloudflareCommHandler extends express_1.InngestCommHandler {
constructor() {
super(...arguments);
this.frameworkName = "cloudflare-pages";
this.frameworkName = "remix";
}
createHandler() {
return async ({ request: req, env, }) => {
return async ({ request: req, }) => {
let reqUrl;

@@ -30,5 +23,2 @@ try {

}
if (!this.signingKey) {
this.signingKey = env.INNGEST_SIGNING_KEY;
}
switch (req.method) {

@@ -51,3 +41,3 @@ case "PUT": {

});
const stepRes = await this.runStep(fnId, stepId, req.body);
const stepRes = await this.runStep(fnId, stepId, await req.json());
if (stepRes.status === 500) {

@@ -69,4 +59,4 @@ return new Response(JSON.stringify(stepRes.error), {

/**
* In Cloudflare Pages, serve and register any declared functions with Inngest,
* making them available to be triggered by events.
* In Cloudflare, serve and register any declared functions with Inngest, making
* them available to be triggered by events.
*

@@ -76,5 +66,5 @@ * @public

const register = (nameOrInngest, signingKey, fns, opts) => {
return (0, default_1.serve)(new CloudflareCommHandler(nameOrInngest, signingKey, fns, opts));
return (0, express_1.serve)(new CloudflareCommHandler(nameOrInngest, signingKey, fns, opts));
};
exports.register = register;
//# sourceMappingURL=cloudflare.js.map

@@ -12,3 +12,3 @@ import { PartialK, SendEventPayload, SingleOrArray } from "../helpers/types";

* ```ts
* const inngest = new Inngest<Events>("My App", process.env.INNGEST_EVENT_KEY);
* const inngest = new Inngest<Events>({ name: "My App" });
*

@@ -18,10 +18,10 @@ * // or to provide custom events too

* Events & {
* "demo/event.blah": {
* name: "demo/event.blah";
* "app/user.created": {
* name: "app/user.created";
* data: {
* bar: boolean;
* foo: boolean;
* };
* };
* }
* >("My App", process.env.INNGEST_EVENT_KEY);
* >({ name: "My App" });
* ```

@@ -64,3 +64,3 @@ *

* ```ts
* const inngest = new Inngest<Events>("My App", process.env.INNGEST_EVENT_KEY);
* const inngest = new Inngest<Events>({ name: "My App" });
*

@@ -70,10 +70,10 @@ * // or to provide custom events too

* Events & {
* "demo/event.blah": {
* name: "demo/event.blah";
* "app/user.created": {
* name: "app/user.created";
* data: {
* bar: boolean;
* foo: boolean;
* };
* };
* }
* >("My App", process.env.INNGEST_EVENT_KEY);
* >({ name: "My App" });
* ```

@@ -80,0 +80,0 @@ */

@@ -25,3 +25,3 @@ "use strict";

* ```ts
* const inngest = new Inngest<Events>("My App", process.env.INNGEST_EVENT_KEY);
* const inngest = new Inngest<Events>({ name: "My App" });
*

@@ -31,10 +31,10 @@ * // or to provide custom events too

* Events & {
* "demo/event.blah": {
* name: "demo/event.blah";
* "app/user.created": {
* name: "app/user.created";
* data: {
* bar: boolean;
* foo: boolean;
* };
* };
* }
* >("My App", process.env.INNGEST_EVENT_KEY);
* >({ name: "My App" });
* ```

@@ -53,3 +53,3 @@ *

* ```ts
* const inngest = new Inngest<Events>("My App", process.env.INNGEST_EVENT_KEY);
* const inngest = new Inngest<Events>({ name: "My App" });
*

@@ -59,10 +59,10 @@ * // or to provide custom events too

* Events & {
* "demo/event.blah": {
* name: "demo/event.blah";
* "app/user.created": {
* name: "app/user.created";
* data: {
* bar: boolean;
* foo: boolean;
* };
* };
* }
* >("My App", process.env.INNGEST_EVENT_KEY);
* >({ name: "My App" });
* ```

@@ -69,0 +69,0 @@ */

@@ -28,3 +28,3 @@ import { EventPayload, FunctionOptions, FunctionTrigger, Steps } from "../types";

*/
get id(): string;
id(prefix?: string): string;
/**

@@ -31,0 +31,0 @@ * The name of this function as it will appear in the Inngest Cloud UI.

@@ -50,5 +50,5 @@ "use strict";

*/
get id() {
id(prefix) {
if (!__classPrivateFieldGet(this, _InngestFunction_opts, "f").id) {
__classPrivateFieldGet(this, _InngestFunction_opts, "f").id = __classPrivateFieldGet(this, _InngestFunction_instances, "m", _InngestFunction_generateId).call(this);
__classPrivateFieldGet(this, _InngestFunction_opts, "f").id = __classPrivateFieldGet(this, _InngestFunction_instances, "m", _InngestFunction_generateId).call(this, prefix);
}

@@ -72,5 +72,6 @@ return __classPrivateFieldGet(this, _InngestFunction_opts, "f").id;

*/
baseUrl) {
baseUrl, appPrefix) {
const id = this.id(appPrefix);
return {
id: this.id,
id,
name: this.name,

@@ -80,3 +81,3 @@ triggers: [__classPrivateFieldGet(this, _InngestFunction_trigger, "f")],

const url = new URL(baseUrl.href);
url.searchParams.set(consts_1.fnIdParam, this.id);
url.searchParams.set(consts_1.fnIdParam, id);
url.searchParams.set(consts_1.stepIdParam, stepId);

@@ -106,5 +107,6 @@ return Object.assign(Object.assign({}, acc), { [stepId]: {

exports.InngestFunction = InngestFunction;
_InngestFunction_opts = new WeakMap(), _InngestFunction_trigger = new WeakMap(), _InngestFunction_steps = new WeakMap(), _InngestFunction_instances = new WeakSet(), _InngestFunction_generateId = function _InngestFunction_generateId() {
_InngestFunction_opts = new WeakMap(), _InngestFunction_trigger = new WeakMap(), _InngestFunction_steps = new WeakMap(), _InngestFunction_instances = new WeakSet(), _InngestFunction_generateId = function _InngestFunction_generateId(prefix) {
const join = "-";
return __classPrivateFieldGet(this, _InngestFunction_opts, "f").name
return [prefix || "", __classPrivateFieldGet(this, _InngestFunction_opts, "f").name]
.join("-")
.toLowerCase()

@@ -111,0 +113,0 @@ .replaceAll(/[^a-z0-9-]+/g, join)

export { Inngest } from "./components/Inngest";
export { InngestCommHandler, serve, ServeHandler as RegisterHandler, } from "./handlers/default";
export { createFunction, createScheduledFunction } from "./helpers/func";
export { ClientOptions, EventPayload, FunctionOptions, RegisterOptions, StepFn, } from "./types";
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createScheduledFunction = exports.createFunction = exports.serve = exports.InngestCommHandler = exports.Inngest = void 0;
exports.createScheduledFunction = exports.createFunction = exports.Inngest = void 0;
var Inngest_1 = require("./components/Inngest");
Object.defineProperty(exports, "Inngest", { enumerable: true, get: function () { return Inngest_1.Inngest; } });
var default_1 = require("./handlers/default");
Object.defineProperty(exports, "InngestCommHandler", { enumerable: true, get: function () { return default_1.InngestCommHandler; } });
Object.defineProperty(exports, "serve", { enumerable: true, get: function () { return default_1.serve; } });
var func_1 = require("./helpers/func");

@@ -10,0 +7,0 @@ Object.defineProperty(exports, "createFunction", { enumerable: true, get: function () { return func_1.createFunction; } });

@@ -1,2 +0,2 @@

import { ServeHandler } from "./handlers/default";
import { ServeHandler } from "./express";
/**

@@ -3,0 +3,0 @@ * In Next.js, serve and register any declared functions with Inngest, making

@@ -5,5 +5,5 @@ "use strict";

const zod_1 = require("zod");
const default_1 = require("./handlers/default");
const express_1 = require("./express");
const consts_1 = require("./helpers/consts");
class NextCommHandler extends default_1.InngestCommHandler {
class NextCommHandler extends express_1.InngestCommHandler {
constructor() {

@@ -59,5 +59,5 @@ super(...arguments);

const serve = (nameOrInngest, signingKey, fns, opts) => {
return (0, default_1.serve)(new NextCommHandler(nameOrInngest, signingKey, fns, opts));
return (0, express_1.serve)(new NextCommHandler(nameOrInngest, signingKey, fns, opts));
};
exports.serve = serve;
//# sourceMappingURL=next.js.map
{
"name": "inngest",
"version": "0.4.15",
"version": "0.4.16-cfp.1",
"description": "Official SDK for Inngest.com",

@@ -19,5 +19,6 @@ "main": "./index.js",

"prebuild": "genversion --semi --double --es6 ./src/version.ts",
"build": "yarn run clean && tsc",
"build": "yarn run clean && tsc --project tsconfig.build.json",
"test": "jest --passWithNoTests",
"clean": "rm -rf ./dist",
"lint": "eslint .",
"postversion": "yarn run build && yarn run build:copy",

@@ -28,3 +29,3 @@ "release": "yarn run np",

"dev:build": "nodemon -w src -e ts -i version.ts --delay 300ms -x 'yarn run build && yarn run build:check --local'",
"dev:lint": "nodemon -w src -e ts -i version.ts --delay 300ms -x 'eslint .'",
"dev:lint": "nodemon -w src -e ts -i version.ts --delay 300ms -x 'yarn lint'",
"build:api": "api-extractor run --local --verbose",

@@ -53,5 +54,3 @@ "build:check": "api-extractor run --verbose",

"cross-fetch": "^3.1.5",
"events": "^3.3.0",
"isomorphic-crypto": "^3.0.0",
"stream": "^0.0.2",
"sha.js": "^2.4.11",
"zod": "^3.19.1"

@@ -63,2 +62,3 @@ },

"@types/jest": "^27.4.1",
"@types/sha.js": "^2.4.0",
"@typescript-eslint/eslint-plugin": "^5.38.0",

@@ -65,0 +65,0 @@ "@typescript-eslint/parser": "^5.38.0",

@@ -1,2 +0,2 @@

import { ServeHandler } from "./handlers/default";
import { ServeHandler } from "./express";
/**

@@ -3,0 +3,0 @@ * In Remix, serve and register any declared functions with Inngest, making them

@@ -6,3 +6,3 @@ "use strict";

const zod_1 = require("zod");
const default_1 = require("./handlers/default");
const express_1 = require("./express");
const consts_1 = require("./helpers/consts");

@@ -13,3 +13,3 @@ /**

*/
class RemixCommHandler extends default_1.InngestCommHandler {
class RemixCommHandler extends express_1.InngestCommHandler {
constructor() {

@@ -47,4 +47,11 @@ super(...arguments);

});
const stepRes = await this.runStep(fnId, stepId, req.body);
return new cross_fetch_1.Response(JSON.stringify(stepRes), { status: 200 });
const stepRes = await this.runStep(fnId, stepId, await req.json());
if (stepRes.status === 500) {
return new cross_fetch_1.Response(JSON.stringify(stepRes.error), {
status: stepRes.status,
});
}
return new cross_fetch_1.Response(JSON.stringify(stepRes.body), {
status: stepRes.status,
});
}

@@ -64,5 +71,5 @@ default:

const register = (nameOrInngest, signingKey, fns, opts) => {
return (0, default_1.serve)(new RemixCommHandler(nameOrInngest, signingKey, fns, opts));
return (0, express_1.serve)(new RemixCommHandler(nameOrInngest, signingKey, fns, opts));
};
exports.register = register;
//# sourceMappingURL=remix.js.map

@@ -1,2 +0,2 @@

export declare const version = "0.4.15";
export declare const version = "0.4.16-cfp.1";
//# sourceMappingURL=version.d.ts.map

@@ -5,3 +5,3 @@ "use strict";

// Generated by genversion.
exports.version = "0.4.15";
exports.version = "0.4.16-cfp.1";
//# 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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc