inngest 2.7.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/api/api.js +4 -4
  3. package/api/schema.d.ts +54 -6
  4. package/api/schema.d.ts.map +1 -1
  5. package/api/schema.js +17 -7
  6. package/api/schema.js.map +1 -1
  7. package/cloudflare.d.ts +6 -3
  8. package/cloudflare.d.ts.map +1 -1
  9. package/cloudflare.js +19 -41
  10. package/cloudflare.js.map +1 -1
  11. package/components/EventSchemas.d.ts +1 -12
  12. package/components/EventSchemas.d.ts.map +1 -1
  13. package/components/EventSchemas.js.map +1 -1
  14. package/components/Inngest.d.ts +44 -57
  15. package/components/Inngest.d.ts.map +1 -1
  16. package/components/Inngest.js +47 -26
  17. package/components/Inngest.js.map +1 -1
  18. package/components/InngestCommHandler.d.ts +156 -198
  19. package/components/InngestCommHandler.d.ts.map +1 -1
  20. package/components/InngestCommHandler.js +311 -305
  21. package/components/InngestCommHandler.js.map +1 -1
  22. package/components/InngestFunction.d.ts +9 -82
  23. package/components/InngestFunction.d.ts.map +1 -1
  24. package/components/InngestFunction.js +21 -413
  25. package/components/InngestFunction.js.map +1 -1
  26. package/components/InngestMiddleware.d.ts +37 -26
  27. package/components/InngestMiddleware.d.ts.map +1 -1
  28. package/components/InngestMiddleware.js +1 -3
  29. package/components/InngestMiddleware.js.map +1 -1
  30. package/components/InngestStepTools.d.ts +69 -37
  31. package/components/InngestStepTools.d.ts.map +1 -1
  32. package/components/InngestStepTools.js +34 -95
  33. package/components/InngestStepTools.js.map +1 -1
  34. package/components/NonRetriableError.d.ts.map +1 -1
  35. package/components/NonRetriableError.js +1 -0
  36. package/components/NonRetriableError.js.map +1 -1
  37. package/components/RetryAfterError.d.ts +38 -0
  38. package/components/RetryAfterError.d.ts.map +1 -0
  39. package/components/RetryAfterError.js +42 -0
  40. package/components/RetryAfterError.js.map +1 -0
  41. package/components/execution/InngestExecution.d.ts +72 -0
  42. package/components/execution/InngestExecution.d.ts.map +1 -0
  43. package/components/execution/InngestExecution.js +23 -0
  44. package/components/execution/InngestExecution.js.map +1 -0
  45. package/components/execution/v0.d.ts +114 -0
  46. package/components/execution/v0.d.ts.map +1 -0
  47. package/components/execution/v0.js +394 -0
  48. package/components/execution/v0.js.map +1 -0
  49. package/components/execution/v1.d.ts +88 -0
  50. package/components/execution/v1.d.ts.map +1 -0
  51. package/components/execution/v1.js +673 -0
  52. package/components/execution/v1.js.map +1 -0
  53. package/deno/fresh.d.ts +3 -3
  54. package/deno/fresh.d.ts.map +1 -1
  55. package/deno/fresh.js +17 -38
  56. package/deno/fresh.js.map +1 -1
  57. package/digitalocean.d.ts +5 -5
  58. package/digitalocean.d.ts.map +1 -1
  59. package/digitalocean.js +14 -46
  60. package/digitalocean.js.map +1 -1
  61. package/edge.d.ts +5 -5
  62. package/edge.d.ts.map +1 -1
  63. package/edge.js +16 -38
  64. package/edge.js.map +1 -1
  65. package/express.d.ts +7 -3
  66. package/express.d.ts.map +1 -1
  67. package/express.js +38 -45
  68. package/express.js.map +1 -1
  69. package/fastify.d.ts +8 -3
  70. package/fastify.d.ts.map +1 -1
  71. package/fastify.js +37 -47
  72. package/fastify.js.map +1 -1
  73. package/h3.d.ts +4 -3
  74. package/h3.d.ts.map +1 -1
  75. package/h3.js +18 -45
  76. package/h3.js.map +1 -1
  77. package/helpers/ServerTiming.d.ts.map +1 -1
  78. package/helpers/ServerTiming.js +2 -1
  79. package/helpers/ServerTiming.js.map +1 -1
  80. package/helpers/consts.d.ts +23 -9
  81. package/helpers/consts.d.ts.map +1 -1
  82. package/helpers/consts.js +31 -13
  83. package/helpers/consts.js.map +1 -1
  84. package/helpers/devserver.d.ts +0 -34
  85. package/helpers/devserver.d.ts.map +1 -1
  86. package/helpers/devserver.js.map +1 -1
  87. package/helpers/env.d.ts +14 -6
  88. package/helpers/env.d.ts.map +1 -1
  89. package/helpers/env.js +4 -4
  90. package/helpers/env.js.map +1 -1
  91. package/helpers/errors.d.ts +37 -2
  92. package/helpers/errors.d.ts.map +1 -1
  93. package/helpers/errors.js +66 -15
  94. package/helpers/errors.js.map +1 -1
  95. package/helpers/functions.d.ts +52 -5
  96. package/helpers/functions.d.ts.map +1 -1
  97. package/helpers/functions.js +121 -22
  98. package/helpers/functions.js.map +1 -1
  99. package/helpers/promises.d.ts +45 -0
  100. package/helpers/promises.d.ts.map +1 -1
  101. package/helpers/promises.js +69 -1
  102. package/helpers/promises.js.map +1 -1
  103. package/helpers/strings.d.ts +6 -1
  104. package/helpers/strings.d.ts.map +1 -1
  105. package/helpers/strings.js +7 -2
  106. package/helpers/strings.js.map +1 -1
  107. package/helpers/types.d.ts +5 -17
  108. package/helpers/types.d.ts.map +1 -1
  109. package/index.d.ts +4 -2
  110. package/index.d.ts.map +1 -1
  111. package/index.js +5 -1
  112. package/index.js.map +1 -1
  113. package/lambda.d.ts +10 -8
  114. package/lambda.d.ts.map +1 -1
  115. package/lambda.js +48 -72
  116. package/lambda.js.map +1 -1
  117. package/next.d.ts +11 -5
  118. package/next.d.ts.map +1 -1
  119. package/next.js +84 -103
  120. package/next.js.map +1 -1
  121. package/nuxt.d.ts +3 -3
  122. package/nuxt.d.ts.map +1 -1
  123. package/nuxt.js +5 -6
  124. package/nuxt.js.map +1 -1
  125. package/package.json +5 -4
  126. package/redwood.d.ts +4 -3
  127. package/redwood.d.ts.map +1 -1
  128. package/redwood.js +22 -48
  129. package/redwood.js.map +1 -1
  130. package/remix.d.ts +7 -5
  131. package/remix.d.ts.map +1 -1
  132. package/remix.js +15 -36
  133. package/remix.js.map +1 -1
  134. package/types.d.ts +126 -220
  135. package/types.d.ts.map +1 -1
  136. package/types.js +24 -45
  137. package/types.js.map +1 -1
  138. package/version.d.ts +1 -1
  139. package/version.js +1 -1
  140. package/helpers/scalar.d.ts +0 -8
  141. package/helpers/scalar.d.ts.map +0 -1
  142. package/helpers/scalar.js +0 -19
  143. package/helpers/scalar.js.map +0 -1
@@ -6,7 +6,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
6
6
  };
7
7
  var _Inngest_instances, _Inngest_getResponseError;
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.Inngest = void 0;
9
+ exports.builtInMiddleware = exports.Inngest = void 0;
10
10
  const api_1 = require("../api/api");
11
11
  const consts_1 = require("../helpers/consts");
12
12
  const devserver_1 = require("../helpers/devserver");
@@ -60,7 +60,7 @@ class Inngest {
60
60
  * });
61
61
  * ```
62
62
  */
63
- constructor({ name, eventKey, inngestBaseUrl = "https://inn.gs/", fetch, env, logger = new logger_1.DefaultLogger(), middleware, }) {
63
+ constructor({ id, eventKey, baseUrl, fetch, env, logger = new logger_1.DefaultLogger(), middleware, }) {
64
64
  _Inngest_instances.add(this);
65
65
  /**
66
66
  * Inngest event key, used to send events to Inngest Cloud.
@@ -69,14 +69,14 @@ class Inngest {
69
69
  /**
70
70
  * The absolute URL of the Inngest Cloud API.
71
71
  */
72
- this.inngestApiUrl = new URL(`e/${this.eventKey}`, "https://inn.gs/");
73
- if (!name) {
72
+ this.sendEventUrl = new URL(`e/${this.eventKey}`, consts_1.defaultInngestEventBaseUrl);
73
+ if (!id) {
74
74
  // TODO PrettyError
75
- throw new Error("A name must be passed to create an Inngest instance.");
75
+ throw new Error("An `id` must be passed to create an Inngest instance.");
76
76
  }
77
- this.name = name;
78
- this.inngestBaseUrl = new URL(inngestBaseUrl);
79
- this.setEventKey(eventKey || (0, env_1.processEnv)(consts_1.envKeys.EventKey) || "");
77
+ this.id = id;
78
+ this.baseUrl = baseUrl || (0, env_1.processEnv)(consts_1.envKeys.InngestBaseUrl);
79
+ this.setEventKey(eventKey || (0, env_1.processEnv)(consts_1.envKeys.InngestEventKey) || "");
80
80
  if (!this.eventKey) {
81
81
  console.warn((0, errors_1.prettyError)({
82
82
  type: "warn",
@@ -91,15 +91,14 @@ class Inngest {
91
91
  inngestEnv: env,
92
92
  });
93
93
  this.fetch = (0, env_1.getFetch)(fetch);
94
- const signingKey = (0, env_1.processEnv)(consts_1.envKeys.SigningKey) || "";
95
94
  this.inngestApi = new api_1.InngestApi({
96
- baseUrl: (0, env_1.processEnv)(consts_1.envKeys.InngestApiBaseUrl) || "https://api.inngest.com",
97
- signingKey: signingKey,
95
+ baseUrl: this.baseUrl || consts_1.defaultInngestBaseUrl,
96
+ signingKey: (0, env_1.processEnv)(consts_1.envKeys.InngestSigningKey) || "",
98
97
  fetch: this.fetch,
99
98
  });
100
99
  this.logger = logger;
101
100
  this.middleware = this.initializeMiddleware([
102
- ...builtInMiddleware,
101
+ ...exports.builtInMiddleware,
103
102
  ...(middleware || []),
104
103
  ]);
105
104
  }
@@ -135,7 +134,7 @@ class Inngest {
135
134
  */
136
135
  eventKey) {
137
136
  this.eventKey = eventKey;
138
- this.inngestApiUrl = new URL(`e/${this.eventKey}`, this.inngestBaseUrl);
137
+ this.sendEventUrl = new URL(`e/${this.eventKey}`, this.baseUrl || consts_1.defaultInngestEventBaseUrl);
139
138
  }
140
139
  /**
141
140
  * Send one or many events to Inngest. Takes an entire payload (including
@@ -165,13 +164,15 @@ class Inngest {
165
164
  * ```
166
165
  */
167
166
  async send(payload) {
168
- var _a, _b;
167
+ var _a;
169
168
  const hooks = await (0, InngestMiddleware_1.getHookStack)(this.middleware, "onSendEvent", undefined, {
170
169
  transformInput: (prev, output) => {
171
170
  return Object.assign(Object.assign({}, prev), output);
172
171
  },
173
- transformOutput: (prev, _output) => {
174
- return prev;
172
+ transformOutput(prev, output) {
173
+ return {
174
+ result: Object.assign(Object.assign({}, prev.result), output === null || output === void 0 ? void 0 : output.result),
175
+ };
175
176
  },
176
177
  });
177
178
  if (!this.eventKey) {
@@ -201,22 +202,28 @@ class Inngest {
201
202
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
202
203
  data: p.data || {} });
203
204
  });
205
+ const applyHookToOutput = async (arg) => {
206
+ var _a;
207
+ const hookOutput = await ((_a = hooks.transformOutput) === null || _a === void 0 ? void 0 : _a.call(hooks, arg));
208
+ return Object.assign(Object.assign({}, arg.result), hookOutput === null || hookOutput === void 0 ? void 0 : hookOutput.result);
209
+ };
204
210
  /**
205
211
  * It can be valid for a user to send an empty list of events; if this
206
212
  * happens, show a warning that this may not be intended, but don't throw.
207
213
  */
208
214
  if (!payloads.length) {
209
- return console.warn((0, errors_1.prettyError)({
215
+ console.warn((0, errors_1.prettyError)({
210
216
  type: "warn",
211
217
  whatHappened: "`inngest.send()` called with no events",
212
218
  reassurance: "This is not an error, but you may not have intended to do this.",
213
219
  consequences: "The returned promise will resolve, but no events have been sent to Inngest.",
214
220
  stack: true,
215
221
  }));
222
+ return await applyHookToOutput({ result: { ids: [] } });
216
223
  }
217
224
  // When sending events, check if the dev server is available. If so, use the
218
225
  // dev server.
219
- let url = this.inngestApiUrl.href;
226
+ let url = this.sendEventUrl.href;
220
227
  if (!(0, env_1.skipDevServer)()) {
221
228
  const host = (0, env_1.devServerHost)();
222
229
  // If the dev server host env var has been set we always want to use
@@ -242,13 +249,25 @@ class Inngest {
242
249
  if (body.status / 100 !== 2 || body.error) {
243
250
  throw await __classPrivateFieldGet(this, _Inngest_instances, "m", _Inngest_getResponseError).call(this, response, body.error);
244
251
  }
245
- return void (await ((_b = hooks.transformOutput) === null || _b === void 0 ? void 0 : _b.call(hooks, { payloads: [...payloads] })));
252
+ return await applyHookToOutput({ result: { ids: body.ids } });
246
253
  }
247
- createFunction(nameOrOpts, trigger, handler) {
248
- const sanitizedOpts = (typeof nameOrOpts === "string" ? { name: nameOrOpts } : nameOrOpts);
254
+ createFunction(options, trigger, handler) {
255
+ let sanitizedOpts;
256
+ if (typeof options === "string") {
257
+ // v2 -> v3 runtime migraton warning
258
+ console.warn(`${consts_1.logPrefix} InngestFunction: Creating a function with a string as the first argument has been deprecated in v3; pass an object instead. See https://www.inngest.com/docs/sdk/migration`);
259
+ sanitizedOpts = { id: options };
260
+ }
261
+ else {
262
+ sanitizedOpts = options;
263
+ }
249
264
  let sanitizedTrigger;
250
265
  if (typeof trigger === "string") {
251
- sanitizedTrigger = { event: trigger };
266
+ // v2 -> v3 migration warning
267
+ console.warn(`${consts_1.logPrefix} InngestFunction: Creating a function with a string as the second argument has been deprecated in v3; pass an object instead. See https://www.inngest.com/docs/sdk/migration`);
268
+ sanitizedTrigger = {
269
+ event: trigger,
270
+ };
252
271
  }
253
272
  else if (trigger.event) {
254
273
  sanitizedTrigger = {
@@ -259,9 +278,11 @@ class Inngest {
259
278
  else {
260
279
  sanitizedTrigger = trigger;
261
280
  }
262
- return new InngestFunction_1.InngestFunction(this, sanitizedOpts, sanitizedTrigger,
263
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any
264
- handler);
281
+ if (Object.prototype.hasOwnProperty.call(sanitizedOpts, "fns")) {
282
+ // v2 -> v3 migration warning
283
+ console.warn(`${consts_1.logPrefix} InngestFunction: \`fns\` option has been deprecated in v3; use \`middleware\` instead. See https://www.inngest.com/docs/sdk/migration`);
284
+ }
285
+ return new InngestFunction_1.InngestFunction(this, sanitizedOpts, sanitizedTrigger, handler);
265
286
  }
266
287
  }
267
288
  exports.Inngest = Inngest;
@@ -316,7 +337,7 @@ async function _Inngest_getResponseError(response, foundErr = "Unknown error") {
316
337
  * If this is moved, please ensure that using this package in another project
317
338
  * can correctly access comments on mutated input and output.
318
339
  */
319
- const builtInMiddleware = ((m) => m)([
340
+ exports.builtInMiddleware = ((m) => m)([
320
341
  new InngestMiddleware_1.InngestMiddleware({
321
342
  name: "Inngest: Logger",
322
343
  init({ client }) {
@@ -1 +1 @@
1
- {"version":3,"file":"Inngest.js","sourceRoot":"","sources":["../../src/components/Inngest.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oCAAwC;AACxC,8CAA4C;AAC5C,oDAAwE;AACxE,wCAMwB;AACxB,8CAAyE;AACzE,gDAA+C;AAE/C,iDAA+E;AAC/E,oCAakB;AAElB,uDAAoD;AACpD,2DAO6B;A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AAG,IAAI,oBAAW,CAAC,cAAc,CAAC,CAAC;oBAE/C,OAAO;wBACL,cAAc;4BACZ,OAAO;gCACL,GAAG,EAAE;oCACH;;;uCAGG;oCACH,MAAM,EAAE,MAAgB;iCACzB;6BACF,CAAC;wBACJ,CAAC;wBACD,eAAe;4BACb,MAAM,CAAC,MAAM,EAAE,CAAC;wBAClB,CAAC;wBACD,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE;4BACnC,IAAI,KAAK,EAAE;gCACT,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;6BACrB;wBACH,CAAC;wBACD,KAAK,CAAC,cAAc;4BAClB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;wBACvB,CAAC;qBACF,CAAC;gBACJ,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;CACH,CAAC,CAAC"}
@@ -1,61 +1,90 @@
1
1
  import { ServerTiming } from "../helpers/ServerTiming";
2
+ import { type Env } from "../helpers/env";
2
3
  import { type MaybePromise } from "../helpers/types";
3
- import { type FunctionConfig, type LogLevel, type RegisterOptions, type RegisterRequest, type StepRunResponse } from "../types";
4
- import { type Inngest } from "./Inngest";
5
- import { type InngestFunction } from "./InngestFunction";
4
+ import { type FunctionConfig, type LogLevel, type RegisterOptions, type RegisterRequest } from "../types";
5
+ import { type AnyInngest } from "./Inngest";
6
+ import { type AnyInngestFunction } from "./InngestFunction";
7
+ import { ExecutionVersion, type ExecutionResult } from "./execution/InngestExecution";
6
8
  /**
7
- * A handler for serving Inngest functions. This type should be used
8
- * whenever a handler for a new framework is being added to enforce that the
9
- * registration process is always the same for the user.
10
- *
11
- * @example
12
- * ```
13
- * // my-custom-handler.ts
14
- * import { InngestCommHandler, ServeHandler } from "inngest";
15
- *
16
- * export const serve: ServeHandler = (nameOrInngest, fns, opts) => {
17
- * const handler = new InngestCommHandler(
18
- * "my-custom-handler",
19
- * nameOrInngest,
20
- * fns,
21
- * opts,
22
- * () => { ... },
23
- * () => { ... }
24
- * );
25
- *
26
- * return handler.createHandler();
27
- * };
28
- * ```
9
+ * A set of options that can be passed to a serve handler, intended to be used
10
+ * by internal and custom serve handlers to provide a consistent interface.
29
11
  *
30
12
  * @public
31
13
  */
32
- export type ServeHandler = (
33
- /**
34
- * The name of this app, used to scope and group Inngest functions, or
35
- * the `Inngest` instance used to declare all functions.
36
- */
37
- client: Inngest<any>,
38
- /**
39
- * An array of the functions to serve and register with Inngest.
40
- */
41
- functions: InngestFunction<any, any, any, any>[],
42
- /**
43
- * A set of options to further configure the registration of Inngest
44
- * functions.
45
- */
46
- opts?: RegisterOptions
47
- /**
48
- * This `any` return is appropriate.
49
- *
50
- * While we can infer the signature of the returned value, we cannot guarantee
51
- * that we have used the same types as the framework we are integrating with,
52
- * which sometimes can cause frustrating collisions for a user that result in
53
- * `as unknown as X` casts.
54
- *
55
- * Instead, we will use `any` here and have the user be able to place it
56
- * anywhere they need.
57
- */
58
- ) => any;
14
+ export interface ServeHandlerOptions extends RegisterOptions {
15
+ /**
16
+ * The `Inngest` instance used to declare all functions.
17
+ */
18
+ client: AnyInngest;
19
+ /**
20
+ * An array of the functions to serve and register with Inngest.
21
+ */
22
+ functions: readonly AnyInngestFunction[];
23
+ }
24
+ export interface InternalServeHandlerOptions extends ServeHandlerOptions {
25
+ /**
26
+ * Can be used to override the framework name given to a particular serve
27
+ * handler.
28
+ */
29
+ frameworkName?: string;
30
+ }
31
+ interface InngestCommHandlerOptions<Input extends any[] = any[], Output = any, StreamOutput = any> extends RegisterOptions {
32
+ /**
33
+ * The name of the framework this handler is designed for. Should be
34
+ * lowercase, alphanumeric characters inclusive of `-` and `/`.
35
+ *
36
+ * This should never be defined by the user; a {@link ServeHandler} should
37
+ * abstract this.
38
+ */
39
+ frameworkName: string;
40
+ /**
41
+ * The name of this serve handler, e.g. `"My App"`. It's recommended that this
42
+ * value represents the overarching app/service that this set of functions is
43
+ * being served from.
44
+ *
45
+ * This can also be an `Inngest` client, in which case the name given when
46
+ * instantiating the client is used. This is useful if you're sending and
47
+ * receiving events from the same service, as you can reuse a single
48
+ * definition of Inngest.
49
+ */
50
+ client: AnyInngest;
51
+ /**
52
+ * An array of the functions to serve and register with Inngest.
53
+ */
54
+ functions: readonly AnyInngestFunction[];
55
+ /**
56
+ * The `handler` is the function your framework requires to handle a
57
+ * request. For example, this is most commonly a function that is given a
58
+ * `Request` and must return a `Response`.
59
+ *
60
+ * The handler must map out any incoming parameters, then return a
61
+ * strictly-typed object to assess what kind of request is being made,
62
+ * collecting any relevant data as we go.
63
+ *
64
+ * @example
65
+ * ```
66
+ * return {
67
+ * register: () => { ... },
68
+ * run: () => { ... },
69
+ * view: () => { ... }
70
+ * };
71
+ * ```
72
+ *
73
+ * Every key must be specified and must be a function that either returns
74
+ * a strictly-typed payload or `undefined` if the request is not for that
75
+ * purpose.
76
+ *
77
+ * This gives handlers freedom to choose how their platform of choice will
78
+ * trigger differing actions, whilst also ensuring all required information
79
+ * is given for each request type.
80
+ *
81
+ * See any existing handler for a full example.
82
+ *
83
+ * This should never be defined by the user; a {@link ServeHandler} should
84
+ * abstract this.
85
+ */
86
+ handler: Handler<Input, Output, StreamOutput>;
87
+ }
59
88
  /**
60
89
  * `InngestCommHandler` is a class for handling incoming requests from Inngest (or
61
90
  * Inngest's tooling such as the dev server or CLI) and taking appropriate
@@ -91,30 +120,24 @@ opts?: RegisterOptions
91
120
  *
92
121
  * @public
93
122
  */
94
- export declare class InngestCommHandler<H extends Handler, TResTransform extends (res: ActionResponse<string>, ...args: Parameters<H>) => any, TStreamTransform extends (res: ActionResponse<ReadableStream>, ...args: Parameters<H>) => any> {
123
+ export declare class InngestCommHandler<Input extends any[] = any[], Output = any, StreamOutput = any> {
95
124
  /**
96
- * The name of this serve handler, e.g. `"My App"`. It's recommended that this
125
+ * The ID of this serve handler, e.g. `"my-app"`. It's recommended that this
97
126
  * value represents the overarching app/service that this set of functions is
98
127
  * being served from.
99
128
  */
100
- readonly name: string;
129
+ readonly id: string;
101
130
  /**
102
131
  * The handler specified during instantiation of the class.
103
132
  */
104
- readonly handler: H;
105
- /**
106
- * The response transformer specified during instantiation of the class.
107
- */
108
- readonly transformRes: TResTransform;
109
- readonly streamTransformRes: TStreamTransform | undefined;
133
+ readonly handler: Handler;
110
134
  /**
111
135
  * The URL of the Inngest function registration endpoint.
112
136
  */
113
137
  private readonly inngestRegisterUrl;
114
138
  /**
115
139
  * The name of the framework this handler is designed for. Should be
116
- * lowercase, alphanumeric characters inclusive of `-` and `/`. This should
117
- * never be defined by the user; a {@link ServeHandler} should abstract this.
140
+ * lowercase, alphanumeric characters inclusive of `-` and `/`.
118
141
  */
119
142
  protected readonly frameworkName: string;
120
143
  /**
@@ -188,106 +211,9 @@ export declare class InngestCommHandler<H extends Handler, TResTransform extends
188
211
  * to find and register functions when interacting with Inngest Cloud.
189
212
  */
190
213
  private readonly fns;
214
+ private env;
191
215
  private allowExpiredSignatures;
192
- constructor(
193
- /**
194
- * The name of the framework this handler is designed for. Should be
195
- * lowercase, alphanumeric characters inclusive of `-` and `/`.
196
- *
197
- * This should never be defined by the user; a {@link ServeHandler} should
198
- * abstract this.
199
- */
200
- frameworkName: string,
201
- /**
202
- * The name of this serve handler, e.g. `"My App"`. It's recommended that this
203
- * value represents the overarching app/service that this set of functions is
204
- * being served from.
205
- *
206
- * This can also be an `Inngest` client, in which case the name given when
207
- * instantiating the client is used. This is useful if you're sending and
208
- * receiving events from the same service, as you can reuse a single
209
- * definition of Inngest.
210
- */
211
- client: Inngest<any>,
212
- /**
213
- * An array of the functions to serve and register with Inngest.
214
- */
215
- functions: InngestFunction<any, any, any, any>[], options: RegisterOptions | undefined,
216
- /**
217
- * The `handler` is the function your framework requires to handle a
218
- * request. For example, this is most commonly a function that is given a
219
- * `Request` and must return a `Response`.
220
- *
221
- * The handler must map out any incoming parameters, then return a
222
- * strictly-typed object to assess what kind of request is being made,
223
- * collecting any relevant data as we go.
224
- *
225
- * @example
226
- * ```
227
- * return {
228
- * register: () => { ... },
229
- * run: () => { ... },
230
- * view: () => { ... }
231
- * };
232
- * ```
233
- *
234
- * Every key must be specified and must be a function that either returns
235
- * a strictly-typed payload or `undefined` if the request is not for that
236
- * purpose.
237
- *
238
- * This gives handlers freedom to choose how their platform of choice will
239
- * trigger differing actions, whilst also ensuring all required information
240
- * is given for each request type.
241
- *
242
- * See any existing handler for a full example.
243
- *
244
- * This should never be defined by the user; a {@link ServeHandler} should
245
- * abstract this.
246
- */
247
- handler: H,
248
- /**
249
- * The `transformRes` function receives the output of the Inngest SDK and
250
- * can decide how to package up that information to appropriately return the
251
- * information to Inngest.
252
- *
253
- * Mostly, this is taking the given parameters and returning a new
254
- * `Response`.
255
- *
256
- * The function is passed an {@link ActionResponse} (an object containing a
257
- * `status` code, a `headers` object, and a stringified `body`), as well as
258
- * every parameter passed to the given `handler` function. This ensures you
259
- * can appropriately handle the response, including use of any required
260
- * parameters such as `res` in Express-/Connect-like frameworks.
261
- *
262
- * This should never be defined by the user; a {@link ServeHandler} should
263
- * abstract this.
264
- */
265
- transformRes: TResTransform,
266
- /**
267
- * The `streamTransformRes` function, if defined, declares that this handler
268
- * supports streaming responses back to Inngest. This is useful for
269
- * functions that are expected to take a long time, as edge streaming can
270
- * often circumvent restrictive request timeouts and other limitations.
271
- *
272
- * If your handler does not support streaming, do not define this function.
273
- *
274
- * It receives the output of the Inngest SDK and can decide how to package
275
- * up that information to appropriately return the information in a stream
276
- * to Inngest.
277
- *
278
- * Mostly, this is taking the given parameters and returning a new
279
- * `Response`.
280
- *
281
- * The function is passed an {@link ActionResponse} (an object containing a
282
- * `status` code, a `headers` object, and `body`, a `ReadableStream`), as
283
- * well as every parameter passed to the given `handler` function. This
284
- * ensures you can appropriately handle the response, including use of any
285
- * required parameters such as `res` in Express-/Connect-like frameworks.
286
- *
287
- * This should never be defined by the user; a {@link ServeHandler} should
288
- * abstract this.
289
- */
290
- streamTransformRes?: TStreamTransform);
216
+ constructor(options: InngestCommHandlerOptions<Input, Output, StreamOutput>);
291
217
  private get hashedSigningKey();
292
218
  /**
293
219
  * `createHandler` should be used to return a type-equivalent version of the
@@ -312,7 +238,7 @@ export declare class InngestCommHandler<H extends Handler, TResTransform extends
312
238
  * };
313
239
  * ```
314
240
  */
315
- createHandler(): (...args: Parameters<H>) => Promise<Awaited<ReturnType<TResTransform>>>;
241
+ createHandler(): (...args: Input) => Promise<Awaited<Output>>;
316
242
  /**
317
243
  * Given a set of functions to check if an action is available from the
318
244
  * instance's handler, enact any action that is found.
@@ -325,7 +251,10 @@ export declare class InngestCommHandler<H extends Handler, TResTransform extends
325
251
  * found (e.g. env vars, options, etc).
326
252
  */
327
253
  private handleAction;
328
- protected runStep(functionId: string, stepId: string | null, data: unknown, timer: ServerTiming): Promise<StepRunResponse>;
254
+ protected runStep(functionId: string, stepId: string | null, data: unknown, timer: ServerTiming): {
255
+ version: ExecutionVersion;
256
+ result: Promise<ExecutionResult>;
257
+ };
329
258
  protected configs(url: URL): FunctionConfig[];
330
259
  /**
331
260
  * Return an Inngest serve endpoint URL given a potential `path` and `host`.
@@ -335,7 +264,7 @@ export declare class InngestCommHandler<H extends Handler, TResTransform extends
335
264
  */
336
265
  protected reqUrl(url: URL): URL;
337
266
  protected registerBody(url: URL): RegisterRequest;
338
- protected register(url: URL, devServerHost: string | undefined, deployId: string | undefined | null, getHeaders: () => Record<string, string>): Promise<{
267
+ protected register(url: URL, deployId: string | undefined | null, getHeaders: () => Record<string, string>): Promise<{
339
268
  status: number;
340
269
  message: string;
341
270
  modified: boolean;
@@ -347,7 +276,7 @@ export declare class InngestCommHandler<H extends Handler, TResTransform extends
347
276
  * are otherwise difficult to access during initialization.
348
277
  */
349
278
  private upsertKeysFromEnv;
350
- protected validateSignature(sig: string | undefined, body: Record<string, unknown>): void;
279
+ protected validateSignature(sig: string | undefined, body: unknown): void;
351
280
  protected signResponse(): string;
352
281
  /**
353
282
  * Log to stdout/stderr if the log level is set to include the given level.
@@ -363,16 +292,57 @@ export declare class InngestCommHandler<H extends Handler, TResTransform extends
363
292
  * The broad definition of a handler passed when instantiating an
364
293
  * {@link InngestCommHandler} instance.
365
294
  */
366
- type Handler = (...args: any[]) => {
367
- env?: Record<string, unknown>;
368
- isProduction?: boolean;
369
- url: URL;
370
- } & {
371
- [K in Extract<HandlerAction, {
372
- action: "run" | "register" | "view";
373
- }>["action"]]: () => MaybePromise<Omit<Extract<HandlerAction, {
374
- action: K;
375
- }>, "action"> | undefined>;
295
+ export type Handler<Input extends any[] = any[], Output = any, StreamOutput = any> = (...args: Input) => HandlerResponse<Output, StreamOutput>;
296
+ export type HandlerResponse<Output = any, StreamOutput = any> = {
297
+ body: () => MaybePromise<any>;
298
+ env?: () => MaybePromise<Env>;
299
+ headers: (key: string) => MaybePromise<string | null | undefined>;
300
+ /**
301
+ * Whether the current environment is production. This is used to determine
302
+ * some functionality like whether to connect to the dev server or whether to
303
+ * show debug logging.
304
+ *
305
+ * If this is not provided--or is provided and returns `undefined`--we'll try
306
+ * to automatically detect whether we're in production by checking various
307
+ * environment variables.
308
+ */
309
+ isProduction?: () => MaybePromise<boolean | undefined>;
310
+ method: () => MaybePromise<string>;
311
+ queryString?: (key: string, url: URL) => MaybePromise<string | null | undefined>;
312
+ url: () => MaybePromise<URL>;
313
+ /**
314
+ * The `transformResponse` function receives the output of the Inngest SDK and
315
+ * can decide how to package up that information to appropriately return the
316
+ * information to Inngest.
317
+ *
318
+ * Mostly, this is taking the given parameters and returning a new `Response`.
319
+ *
320
+ * The function is passed an {@link ActionResponse}, an object containing a
321
+ * `status` code, a `headers` object, and a stringified `body`. This ensures
322
+ * you can appropriately handle the response, including use of any required
323
+ * parameters such as `res` in Express-/Connect-like frameworks.
324
+ */
325
+ transformResponse: (res: ActionResponse<string>) => Output;
326
+ /**
327
+ * The `transformStreamingResponse` function, if defined, declares that this
328
+ * handler supports streaming responses back to Inngest. This is useful for
329
+ * functions that are expected to take a long time, as edge streaming can
330
+ * often circumvent restrictive request timeouts and other limitations.
331
+ *
332
+ * If your handler does not support streaming, do not define this function.
333
+ *
334
+ * It receives the output of the Inngest SDK and can decide how to package
335
+ * up that information to appropriately return the information in a stream
336
+ * to Inngest.
337
+ *
338
+ * Mostly, this is taking the given parameters and returning a new `Response`.
339
+ *
340
+ * The function is passed an {@link ActionResponse}, an object containing a
341
+ * `status` code, a `headers` object, and `body`, a `ReadableStream`. This
342
+ * ensures you can appropriately handle the response, including use of any
343
+ * required parameters such as `res` in Express-/Connect-like frameworks.
344
+ */
345
+ transformStreamingResponse?: (res: ActionResponse<ReadableStream>) => StreamOutput;
376
346
  };
377
347
  /**
378
348
  * The response from the Inngest SDK before it is transformed in to a
@@ -391,28 +361,16 @@ export interface ActionResponse<TBody extends string | ReadableStream = string>
391
361
  * A stringified body to return.
392
362
  */
393
363
  body: TBody;
364
+ /**
365
+ * The version of the execution engine that was used to run this action.
366
+ *
367
+ * If the action didn't use the execution engine (for example, a GET request
368
+ * as a health check), this will be `undefined`.
369
+ *
370
+ * If the version should be entirely omitted from the response (for example,
371
+ * when sending preliminary headers when streaming), this will be `null`.
372
+ */
373
+ version: ExecutionVersion | null | undefined;
394
374
  }
395
- /**
396
- * A set of actions the SDK is aware of, including any payloads they require
397
- * when requesting them.
398
- */
399
- type HandlerAction = {
400
- action: "error";
401
- data: Record<string, string>;
402
- } | {
403
- action: "view";
404
- isIntrospection: boolean;
405
- } | {
406
- action: "register";
407
- deployId?: null | string;
408
- } | {
409
- action: "run";
410
- fnId: string;
411
- stepId: string | null;
412
- data: Record<string, unknown>;
413
- signature: string | undefined;
414
- } | {
415
- action: "bad-method";
416
- };
417
375
  export {};
418
376
  //# sourceMappingURL=InngestCommHandler.d.ts.map