Comparing version 2.4.1-fetch.1 to 2.4.1
# inngest | ||
## 2.4.1 | ||
### Patch Changes | ||
- f2ffc8b: Fix `cross-fetch` import issue in testing environemtnst. API package also uses custom `fetch` passed via arguments. | ||
- acfa07c: Throw error when using `inngest/express` and not using a body parser | ||
- b535e1e: Ensure users are not allowed to configure batching with cancellation or rate limiting, as these features do not yet function together | ||
- c271eb1: Add `x-inngest-no-retry: true` header when non-retriable for internal executor changes | ||
- 2a93f0b: Fix `onFailure` functions missing types applied by middleware | ||
## 2.4.0 | ||
@@ -4,0 +14,0 @@ |
@@ -6,3 +6,3 @@ import { type ExclusiveKeys, type SendEventPayload } from "../helpers/types"; | ||
import { InngestFunction } from "./InngestFunction"; | ||
import { InngestMiddleware, type MiddlewareStackRunInputMutation } from "./InngestMiddleware"; | ||
import { InngestMiddleware, type ExtendWithMiddleware } from "./InngestMiddleware"; | ||
/** | ||
@@ -173,3 +173,7 @@ * Given a set of client options for Inngest, return the event types that can | ||
*/ | ||
onFailure?: Handler<TOpts, EventsFromOpts<TOpts>, TTriggerName, TShimmedFns, FailureEventArgs<EventsFromOpts<TOpts>[TTriggerName]>>; | ||
onFailure?: Handler<TOpts, EventsFromOpts<TOpts>, TTriggerName, TShimmedFns, ExtendWithMiddleware<[ | ||
typeof builtInMiddleware, | ||
NonNullable<TOpts["middleware"]>, | ||
TMiddleware | ||
], FailureEventArgs<EventsFromOpts<TOpts>[TTriggerName]>>>; | ||
/** | ||
@@ -179,3 +183,7 @@ * TODO | ||
middleware?: TMiddleware; | ||
}, "batchEvents", "cancelOn" | "rateLimit">, trigger: TTrigger, handler: Handler<TOpts, EventsFromOpts<TOpts>, TTriggerName, TShimmedFns, MiddlewareStackRunInputMutation<{}, typeof builtInMiddleware> & MiddlewareStackRunInputMutation<{}, NonNullable<TOpts["middleware"]>> & MiddlewareStackRunInputMutation<{}, TMiddleware>>): InngestFunction<TOpts, EventsFromOpts<TOpts>, FunctionTrigger<keyof EventsFromOpts<TOpts> & string>, FunctionOptions<EventsFromOpts<TOpts>, keyof EventsFromOpts<TOpts> & string>>; | ||
}, "batchEvents", "cancelOn" | "rateLimit">, trigger: TTrigger, handler: Handler<TOpts, EventsFromOpts<TOpts>, TTriggerName, TShimmedFns, ExtendWithMiddleware<[ | ||
typeof builtInMiddleware, | ||
NonNullable<TOpts["middleware"]>, | ||
TMiddleware | ||
]>>): InngestFunction<TOpts, EventsFromOpts<TOpts>, FunctionTrigger<keyof EventsFromOpts<TOpts> & string>, FunctionOptions<EventsFromOpts<TOpts>, keyof EventsFromOpts<TOpts> & string>>; | ||
} | ||
@@ -182,0 +190,0 @@ /** |
@@ -302,2 +302,8 @@ import { type Simplify } from "type-fest"; | ||
*/ | ||
export type ExtendWithMiddleware<TMiddlewareStacks extends MiddlewareStack[], TContext = {}> = ObjectAssign<{ | ||
[K in keyof TMiddlewareStacks]: MiddlewareStackRunInputMutation<{}, TMiddlewareStacks[K]>; | ||
}, TContext>; | ||
/** | ||
* @internal | ||
*/ | ||
export type MiddlewareStackRunInputMutation<TContext, TMiddleware extends MiddlewareStack> = ObjectAssign<{ | ||
@@ -304,0 +310,0 @@ [K in keyof TMiddleware]: GetMiddlewareRunInputMutation<TMiddleware[K]>; |
@@ -0,4 +1,4 @@ | ||
import { type InngestApi } from "../api/api"; | ||
import { type FnData, type Result } from "../types"; | ||
import { type Await } from "./types"; | ||
import { type FnData, type Result } from "../types"; | ||
import { type InngestApi } from "../api/api"; | ||
/** | ||
@@ -5,0 +5,0 @@ * Wraps a function with a cache. When the returned function is run, it will |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseFnData = exports.waterfall = exports.cacheFn = void 0; | ||
const zod_1 = require("zod"); | ||
const types_1 = require("../types"); | ||
const errors_1 = require("./errors"); | ||
const types_1 = require("../types"); | ||
/** | ||
@@ -102,6 +103,12 @@ * Wraps a function with a cache. When the returned function is run, it will | ||
console.error(error); | ||
let why; | ||
if (error instanceof zod_1.ZodError) { | ||
why = error.toString(); | ||
} | ||
return (0, types_1.err)((0, errors_1.prettyError)({ | ||
whatHappened: "failed to parse data from executor", | ||
consequences: "function execution can't continue", | ||
whatHappened: "Failed to parse data from executor.", | ||
consequences: "Function execution can't continue.", | ||
toFixNow: "Make sure that your API is set up to parse incoming request bodies as JSON, like body-parser for Express (https://expressjs.com/en/resources/middleware/body-parser.html).", | ||
stack: true, | ||
why, | ||
})); | ||
@@ -108,0 +115,0 @@ } |
{ | ||
"name": "inngest", | ||
"version": "2.4.1-fetch.1", | ||
"version": "2.4.1", | ||
"description": "Official SDK for Inngest.com", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -17,3 +17,3 @@ <div align="center"> | ||
<br/> | ||
<a href="https://discord.gg/EuesV2ZSnX"><img src="https://img.shields.io/discord/842170679536517141?label=discord" /></a> | ||
<a href="https://www.inngest.com/discord"><img src="https://img.shields.io/discord/842170679536517141?label=discord" /></a> | ||
<a href="https://twitter.com/inngest"><img src="https://img.shields.io/twitter/follow/inngest?style=social" /></a> | ||
@@ -203,3 +203,4 @@ | ||
```sh | ||
yarn version --new-version 1.2.0-foo.1 | ||
yarn version v1.2.0-foo.1 | ||
yarn build | ||
yarn prelink | ||
@@ -206,0 +207,0 @@ cd dist/ |
@@ -1,2 +0,2 @@ | ||
export declare const version = "2.4.1-fetch.1"; | ||
export declare const version = "2.4.1"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -5,3 +5,3 @@ "use strict"; | ||
// Generated by genversion. | ||
exports.version = "2.4.1-fetch.1"; | ||
exports.version = "2.4.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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
813413
8832
0
210