New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

inngest

Package Overview
Dependencies
Maintainers
4
Versions
719
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 3.1.1 to 3.1.2-pr-329.0

11

components/execution/v1.js

@@ -262,2 +262,3 @@ "use strict";

return newSteps.map((step) => ({
displayName: step.displayName,
op: step.op,

@@ -268,3 +269,3 @@ id: step.hashedId,

}));
}, _V1InngestExecution_executeStep = async function _V1InngestExecution_executeStep({ id, name, opts, fn }) {
}, _V1InngestExecution_executeStep = async function _V1InngestExecution_executeStep({ id, name, opts, fn, displayName, }) {
var _a, _b, _c, _d, _e;

@@ -274,3 +275,9 @@ (_a = __classPrivateFieldGet(this, _V1InngestExecution_timeout, "f")) === null || _a === void 0 ? void 0 : _a.clear();

await ((_e = (_d = __classPrivateFieldGet(this, _V1InngestExecution_state, "f").hooks) === null || _d === void 0 ? void 0 : _d.beforeExecution) === null || _e === void 0 ? void 0 : _e.call(_d));
const outgoingOp = { id, op: types_1.StepOpCode.RunStep, name, opts };
const outgoingOp = {
id,
op: types_1.StepOpCode.RunStep,
name,
opts,
displayName,
};
__classPrivateFieldGet(this, _V1InngestExecution_state, "f").executingStep = outgoingOp;

@@ -277,0 +284,0 @@ this.debug(`executing step "${id}"`);

@@ -219,2 +219,68 @@ import { type ExclusiveKeys, type SendEventPayload } from "../helpers/types";

}>];
/**
* A helper type to extract the type of a set of event tooling from a given
* Inngest instance and optionally a trigger.
*
* @example Get generic step tools for an Inngest instance.
* ```ts
* type StepTools = GetStepTools<typeof inngest>;
* ```
*
* @example Get step tools with a trigger, ensuring tools like `waitForEvent` are typed.
* ```ts
* type StepTools = GetStepTools<typeof Inngest, "github/pull_request">;
* ```
*
* @public
*/
export type GetStepTools<TInngest extends Inngest<any>, TTrigger extends keyof GetEvents<TInngest> & string = keyof GetEvents<TInngest> & string> = GetFunctionInput<TInngest, TTrigger> extends {
step: infer TStep;
} ? TStep : never;
/**
* A helper type to extract the type of the input to a function from a given
* Inngest instance and optionally a trigger.
*
* @example Get generic function input for an Inngest instance.
* ```ts
* type Input = GetFunctionInput<typeof inngest>;
* ```
*
* @example Get function input with a trigger, ensuring tools like `waitForEvent` are typed.
* ```ts
* type Input = GetFunctionInput<typeof Inngest, "github/pull_request">;
* ```
*
* @public
*/
export type GetFunctionInput<TInngest extends Inngest<any>, TTrigger extends keyof GetEvents<TInngest> & string = keyof GetEvents<TInngest> & string> = Parameters<Handler<ClientOptionsFromInngest<TInngest>, GetEvents<TInngest>, TTrigger, ExtendWithMiddleware<[
typeof builtInMiddleware,
NonNullable<ClientOptionsFromInngest<TInngest>["middleware"]>
]>>>[0];
/**
* A helper type to extract the inferred event schemas from a given Inngest
* instance.
*
* It's recommended to use this type instead of directly passing
* schemas around, as it will ensure that extra properties such as `ts` and
* `user` are always added.
*
* @example
* ```ts
* type Events = GetEvents<typeof inngest>;
* ```
*
* @public
*/
export type GetEvents<TInngest extends Inngest<any>> = EventsFromOpts<ClientOptionsFromInngest<TInngest>>;
/**
* A helper type to extract the inferred options from a given Inngest instance.
*
* @example
* ```ts
* type Options = ClientOptionsFromInngest<typeof inngest>;
* ```
*
* @public
*/
export type ClientOptionsFromInngest<TInngest extends Inngest<any>> = TInngest extends Inngest<infer U> ? U : ClientOptions;
//# sourceMappingURL=Inngest.d.ts.map

31

components/Inngest.js

@@ -178,10 +178,2 @@ "use strict";

});
if (!this.eventKey) {
throw new Error((0, errors_1.prettyError)({
whatHappened: "Failed to send event",
consequences: "Your event or events were not sent to Inngest.",
why: "We couldn't find an event key to use to send events to Inngest.",
toFixNow: errors_1.fixEventKeyMissingSteps,
}));
}
let payloads = Array.isArray(payload)

@@ -228,11 +220,22 @@ ? payload

let url = this.sendEventUrl.href;
/**
* INNGEST_BASE_URL is used to set both dev server and prod URLs, so if a
* user has set this it means they have already chosen a URL to hit.
*/
if (!(0, env_1.skipDevServer)()) {
const host = (0, env_1.devServerHost)();
// If the dev server host env var has been set we always want to use
// the dev server - even if it's down. Otherwise, optimistically use
// it for non-prod services.
if (host !== undefined || (await (0, devserver_1.devServerAvailable)(host, this.fetch))) {
url = (0, devserver_1.devServerUrl)(host, `e/${this.eventKey}`).href;
if (!this.baseUrl) {
const devAvailable = await (0, devserver_1.devServerAvailable)(consts_1.defaultDevServerHost, this.fetch);
if (devAvailable) {
url = (0, devserver_1.devServerUrl)(consts_1.defaultDevServerHost, `e/${this.eventKey}`).href;
}
}
}
else if (!this.eventKey) {
throw new Error((0, errors_1.prettyError)({
whatHappened: "Failed to send event",
consequences: "Your event or events were not sent to Inngest.",
why: "We couldn't find an event key to use to send events to Inngest.",
toFixNow: errors_1.fixEventKeyMissingSteps,
}));
}
const response = await this.fetch(url, {

@@ -239,0 +242,0 @@ method: "POST",

export { EventSchemas, type Combine, type LiteralZodEventSchema, type StandardEventSchemaToPayload, type StandardEventSchemas, type ZodEventSchemas, } from "./components/EventSchemas";
export { Inngest } from "./components/Inngest";
export type { EventsFromOpts } from "./components/Inngest";
export type { ClientOptionsFromInngest, EventsFromOpts, GetEvents, GetFunctionInput, GetStepTools, } from "./components/Inngest";
export { InngestCommHandler } from "./components/InngestCommHandler";

@@ -15,3 +15,3 @@ export type { ServeHandlerOptions } from "./components/InngestCommHandler";

export type { LogArg } from "./middleware/logger";
export type { ClientOptions, EventNameFromTrigger, EventPayload, FailureEventArgs, FailureEventPayload, FunctionOptions, GetEvents, LogLevel, RegisterOptions, StepOptions, StepOptionsOrId, TimeStr, TriggerOptions, } from "./types";
export type { ClientOptions, EventNameFromTrigger, EventPayload, FailureEventArgs, FailureEventPayload, FunctionOptions, LogLevel, RegisterOptions, StepOptions, StepOptionsOrId, TimeStr, TriggerOptions, } from "./types";
//# sourceMappingURL=index.d.ts.map
{
"name": "inngest",
"version": "3.1.1",
"version": "3.1.2-pr-329.0",
"description": "Official SDK for Inngest.com",

@@ -129,3 +129,3 @@ "main": "./index.js",

"type-fest": "^3.13.1",
"zod": "~3.21.4"
"zod": "~3.22.3"
},

@@ -132,0 +132,0 @@ "devDependencies": {

@@ -162,3 +162,3 @@ import { z } from "zod";

export type IncomingOp = z.output<typeof incomingOpSchema>;
export type OutgoingOp = Pick<HashedOp, "id" | "op" | "name" | "opts" | "data" | "error">;
export type OutgoingOp = Pick<HashedOp, "id" | "op" | "name" | "opts" | "data" | "error" | "displayName">;
/**

@@ -165,0 +165,0 @@ * The shape of a hashed operation in a step function. Used to communicate

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

export declare const version = "3.1.1";
export declare const version = "3.1.2-pr-329.0";
//# sourceMappingURL=version.d.ts.map

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

// Generated by genversion.
exports.version = "3.1.1";
exports.version = "3.1.2-pr-329.0";
//# 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

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