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.0.1 to 3.0.2

3

api/api.d.ts
import { type fetch } from "cross-fetch";
import { type ExecutionVersion } from "../components/execution/InngestExecution";
import { type Result } from "../types";

@@ -17,3 +18,3 @@ import { type BatchResponse, type ErrorResponse, type StepsResponse } from "./schema";

setSigningKey(key: string | undefined): void;
getRunSteps(runId: string): Promise<Result<StepsResponse, ErrorResponse>>;
getRunSteps(runId: string, version: ExecutionVersion): Promise<Result<StepsResponse, ErrorResponse>>;
getRunBatch(runId: string): Promise<Result<BatchResponse, ErrorResponse>>;

@@ -20,0 +21,0 @@ }

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

}
async getRunSteps(runId) {
async getRunSteps(runId, version) {
const url = new URL(`/v0/runs/${runId}/actions`, this.baseUrl);

@@ -32,3 +32,3 @@ return this.fetch(url, {

if (resp.ok) {
return (0, types_1.ok)(schema_1.stepsSchema.parse(data));
return (0, types_1.ok)(schema_1.stepsSchemas[version].parse(data));
}

@@ -35,0 +35,0 @@ else {

import { z } from "zod";
import { ExecutionVersion } from "../components/execution/InngestExecution";
import { type EventPayload } from "../types";

@@ -14,57 +15,62 @@ export declare const errorSchema: z.ZodObject<{

export type ErrorResponse = z.infer<typeof errorSchema>;
export declare const stepsSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"data">>>;
data: z.ZodEffects<z.ZodAny, any, any>;
}, "strip", z.ZodTypeAny, {
type: "data";
data?: any;
}, {
type?: "data" | undefined;
data?: any;
}>, z.ZodObject<{
type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"error">>>;
error: z.ZodObject<{
name: z.ZodString;
message: z.ZodString;
stack: z.ZodOptional<z.ZodString>;
cause: z.ZodOptional<z.ZodString>;
status: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
name: string;
message: string;
stack?: string | undefined;
cause?: string | undefined;
status?: number | undefined;
export declare const stepsSchemas: {
0: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodAny, any, any>>>>;
1: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"data">>>;
data: z.ZodEffects<z.ZodAny, any, any>;
}, "strict", z.ZodTypeAny, {
type: "data";
data?: any;
}, {
name: string;
message: string;
stack?: string | undefined;
cause?: string | undefined;
status?: number | undefined;
}>;
}, "strip", z.ZodTypeAny, {
type: "error";
error: {
name: string;
message: string;
stack?: string | undefined;
cause?: string | undefined;
status?: number | undefined;
};
}, {
error: {
name: string;
message: string;
stack?: string | undefined;
cause?: string | undefined;
status?: number | undefined;
};
type?: "error" | undefined;
}>]>, z.ZodEffects<z.ZodNull, {
type: "data";
data: null;
}, null>]>>>;
export type StepsResponse = z.infer<typeof stepsSchema>;
type?: "data" | undefined;
data?: any;
}>, z.ZodObject<{
type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"error">>>;
error: z.ZodObject<{
name: z.ZodString;
message: z.ZodString;
stack: z.ZodOptional<z.ZodString>;
cause: z.ZodOptional<z.ZodString>;
status: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
name: string;
message: string;
stack?: string | undefined;
cause?: string | undefined;
status?: number | undefined;
}, {
name: string;
message: string;
stack?: string | undefined;
cause?: string | undefined;
status?: number | undefined;
}>;
}, "strict", z.ZodTypeAny, {
type: "error";
error: {
name: string;
message: string;
stack?: string | undefined;
cause?: string | undefined;
status?: number | undefined;
};
}, {
error: {
name: string;
message: string;
stack?: string | undefined;
cause?: string | undefined;
status?: number | undefined;
};
type?: "error" | undefined;
}>]>, z.ZodEffects<z.ZodAny, {
type: "data";
data: any;
}, any>]>>>;
};
export type StepsResponse = {
[V in ExecutionVersion]: z.infer<(typeof stepsSchemas)[V]>;
}[ExecutionVersion];
export declare const batchSchema: z.ZodArray<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodAny>, EventPayload, Record<string, any>>, "many">;
export type BatchResponse = z.infer<typeof batchSchema>;
//# sourceMappingURL=schema.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.batchSchema = exports.stepsSchema = exports.errorSchema = void 0;
exports.batchSchema = exports.stepsSchemas = exports.errorSchema = void 0;
const zod_1 = require("zod");
const InngestExecution_1 = require("../components/execution/InngestExecution");
const types_1 = require("../types");

@@ -10,17 +11,36 @@ exports.errorSchema = zod_1.z.object({

});
exports.stepsSchema = zod_1.z
.record(zod_1.z
.object({
type: zod_1.z.literal("data").optional().default("data"),
data: zod_1.z.any().refine((v) => typeof v !== "undefined", {
message: "Data in steps must be defined",
}),
})
.or(zod_1.z.object({
type: zod_1.z.literal("error").optional().default("error"),
error: types_1.failureEventErrorSchema,
}))
.or(zod_1.z.null().transform(() => ({ type: "data", data: null }))))
.default({});
exports.stepsSchemas = {
[InngestExecution_1.ExecutionVersion.V0]: zod_1.z
.record(zod_1.z.any().refine((v) => typeof v !== "undefined", {
message: "Values in steps must be defined",
}))
.optional()
.nullable(),
[InngestExecution_1.ExecutionVersion.V1]: zod_1.z
.record(zod_1.z
.object({
type: zod_1.z.literal("data").optional().default("data"),
data: zod_1.z.any().refine((v) => typeof v !== "undefined", {
message: "Data in steps must be defined",
}),
})
.strict()
.or(zod_1.z
.object({
type: zod_1.z.literal("error").optional().default("error"),
error: types_1.failureEventErrorSchema,
})
.strict())
/**
* If the result isn't a distcint `data` or `error` object, then it's
* likely that the executor has set this directly to a value, for example
* in the case of `sleep` or `waitForEvent`.
*
* In this case, pull the entire value through as data.
*/
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
.or(zod_1.z.any().transform((v) => ({ type: "data", data: v }))))
.default({}),
};
exports.batchSchema = zod_1.z.array(zod_1.z.record(zod_1.z.any()).transform((v) => v));
//# sourceMappingURL=schema.js.map
# inngest
## 3.0.2
### Patch Changes
- [#348](https://github.com/inngest/inngest-js/pull/348) [`ebb245f`](https://github.com/inngest/inngest-js/commit/ebb245f9a6ae40a07173e2645f7614b54cd69c53) Thanks [@jpwilliams](https://github.com/jpwilliams)! - Fix `"inngest/next"` types not inferring from `defineProperties`
- [#346](https://github.com/inngest/inngest-js/pull/346) [`c14bbb3`](https://github.com/inngest/inngest-js/commit/c14bbb3b0c078ec372b93dfcd39bfd5382d46e93) Thanks [@jpwilliams](https://github.com/jpwilliams)! - Fix `waitForEvent` potentially dropping some fields when being parsed
## 3.0.1

@@ -4,0 +12,0 @@

@@ -459,3 +459,7 @@ "use strict";

const result = (0, promises_1.runAsPromise)(async () => {
const anyFnData = await (0, functions_1.fetchAllFnData)(immediateFnData, this.client["inngestApi"]);
const anyFnData = await (0, functions_1.fetchAllFnData)({
data: immediateFnData,
api: this.client["inngestApi"],
version,
});
if (!anyFnData.ok) {

@@ -462,0 +466,0 @@ throw new Error(anyFnData.error);

@@ -33,4 +33,4 @@ import { z } from "zod";

readonly ctx?: {
run_id: string;
attempt: number;
run_id: string;
stack?: z.objectOutputType<{

@@ -43,2 +43,4 @@ stack: z.ZodEffects<z.ZodNullable<z.ZodArray<z.ZodString, "many">>, string[], string[] | null>;

} | {
readonly event: Record<string, any>;
readonly events: Record<string, any>[];
readonly steps: Record<string, {

@@ -58,9 +60,7 @@ type: "data";

type: "data";
data: null;
data: any;
}>;
readonly event: Record<string, any>;
readonly events: Record<string, any>[];
readonly ctx?: {
run_id: string;
attempt: number;
run_id: string;
use_api: boolean;

@@ -77,4 +77,8 @@ disable_immediate_execution: boolean;

type ParseErr = string;
export declare const fetchAllFnData: (data: FnData, api: InngestApi) => Promise<Result<FnData, ParseErr>>;
export declare const fetchAllFnData: ({ data, api, version, }: {
data: FnData;
api: InngestApi;
version: ExecutionVersion;
}) => Promise<Result<FnData, ParseErr>>;
export {};
//# sourceMappingURL=functions.d.ts.map

@@ -90,8 +90,3 @@ "use strict";

events: zod_1.z.array(zod_1.z.record(zod_1.z.any())).default([]),
steps: zod_1.z
.record(zod_1.z.any().refine((v) => typeof v !== "undefined", {
message: "Values in steps must be defined",
}))
.optional()
.nullable(),
steps: schema_1.stepsSchemas[InngestExecution_1.ExecutionVersion.V0],
ctx: zod_1.z

@@ -122,3 +117,3 @@ .object({

events: zod_1.z.array(zod_1.z.record(zod_1.z.any())).default([]),
steps: schema_1.stepsSchema,
steps: schema_1.stepsSchemas[InngestExecution_1.ExecutionVersion.V1],
ctx: zod_1.z

@@ -154,3 +149,3 @@ .object({

exports.parseFnData = parseFnData;
const fetchAllFnData = async (data, api) => {
const fetchAllFnData = async ({ data, api, version, }) => {
var _a, _b, _c, _d;

@@ -171,3 +166,3 @@ const result = Object.assign({}, data);

api.getRunBatch(result.ctx.run_id),
api.getRunSteps(result.ctx.run_id),
api.getRunSteps(result.ctx.run_id, version),
]);

@@ -174,0 +169,0 @@ if (evtResp.ok) {

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

import { type NextApiRequest, type NextApiResponse } from "next";
import { type NextApiResponse } from "next";
import { type NextRequest } from "next/server";
import { type ServeHandlerOptions } from "./components/InngestCommHandler";
import { type Either } from "./helpers/types";
import { type SupportedFrameworkName } from "./types";

@@ -11,3 +10,3 @@ export declare const frameworkName: SupportedFrameworkName;

*
* @example Next.js <=12 can export the handler directly
* @example Next.js <=12 or the pages router can export the handler directly
* ```ts

@@ -27,3 +26,7 @@ * export default serve({ client: inngest, functions: [fn1, fn2] });

*/
export declare const serve: (options: ServeHandlerOptions) => (req: Either<NextApiRequest, NextRequest>, res: NextApiResponse) => Promise<Response | undefined>;
export declare const serve: (options: ServeHandlerOptions) => ((expectedReq: NextRequest, res: NextApiResponse) => Promise<Response | undefined>) & {
GET: (expectedReq: NextRequest, res: NextApiResponse) => Promise<Response | undefined>;
POST: (expectedReq: NextRequest, res: NextApiResponse) => Promise<Response | undefined>;
PUT: (expectedReq: NextRequest, res: NextApiResponse) => Promise<Response | undefined>;
};
//# sourceMappingURL=next.d.ts.map

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

*
* @example Next.js <=12 can export the handler directly
* @example Next.js <=12 or the pages router can export the handler directly
* ```ts

@@ -31,3 +31,4 @@ * export default serve({ client: inngest, functions: [fn1, fn2] });

const serve = (options) => {
const handler = new InngestCommHandler_1.InngestCommHandler(Object.assign(Object.assign({ frameworkName: exports.frameworkName }, options), { handler: (reqMethod, req, res) => {
const handler = new InngestCommHandler_1.InngestCommHandler(Object.assign(Object.assign({ frameworkName: exports.frameworkName }, options), { handler: (reqMethod, expectedReq, res) => {
const req = expectedReq;
const isEdge = isNextEdgeRequest(req);

@@ -129,10 +130,12 @@ return {

*/
const fn = handler.createHandler();
return Object.defineProperties(fn.bind(null, undefined), {
GET: { value: fn.bind(null, "GET") },
POST: { value: fn.bind(null, "POST") },
PUT: { value: fn.bind(null, "PUT") },
const baseFn = handler.createHandler();
const fn = baseFn.bind(null, undefined);
const handlerFn = Object.defineProperties(fn, {
GET: { value: baseFn.bind(null, "GET") },
POST: { value: baseFn.bind(null, "POST") },
PUT: { value: baseFn.bind(null, "PUT") },
});
return handlerFn;
};
exports.serve = serve;
//# sourceMappingURL=next.js.map
{
"name": "inngest",
"version": "3.0.1",
"version": "3.0.2",
"description": "Official SDK for Inngest.com",

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

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

export declare const version = "3.0.1";
export declare const version = "3.0.2";
//# sourceMappingURL=version.d.ts.map

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

// Generated by genversion.
exports.version = "3.0.1";
exports.version = "3.0.2";
//# 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

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