inngest 4.23.0 → 4.24.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 (68) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/components/Inngest.cjs.map +1 -1
  3. package/components/Inngest.d.cts +5 -1
  4. package/components/Inngest.d.cts.map +1 -1
  5. package/components/Inngest.d.ts +5 -1
  6. package/components/Inngest.d.ts.map +1 -1
  7. package/components/Inngest.js.map +1 -1
  8. package/components/realtime/types.d.cts +4 -4
  9. package/components/realtime/types.d.cts.map +1 -1
  10. package/components/realtime/types.d.ts +4 -4
  11. package/components/realtime/types.d.ts.map +1 -1
  12. package/components/sandbox/durable.cjs +27 -5
  13. package/components/sandbox/durable.cjs.map +1 -1
  14. package/components/sandbox/durable.js +27 -5
  15. package/components/sandbox/durable.js.map +1 -1
  16. package/components/sandbox/group.cjs +56 -0
  17. package/components/sandbox/group.cjs.map +1 -0
  18. package/components/sandbox/group.d.cts +16 -0
  19. package/components/sandbox/group.d.cts.map +1 -0
  20. package/components/sandbox/group.d.ts +16 -0
  21. package/components/sandbox/group.d.ts.map +1 -0
  22. package/components/sandbox/group.js +56 -0
  23. package/components/sandbox/group.js.map +1 -0
  24. package/components/sandbox/middleware.cjs +10 -2
  25. package/components/sandbox/middleware.cjs.map +1 -1
  26. package/components/sandbox/middleware.d.cts +5 -0
  27. package/components/sandbox/middleware.d.cts.map +1 -1
  28. package/components/sandbox/middleware.d.ts +5 -0
  29. package/components/sandbox/middleware.d.ts.map +1 -1
  30. package/components/sandbox/middleware.js +11 -3
  31. package/components/sandbox/middleware.js.map +1 -1
  32. package/components/sandbox/types.cjs.map +1 -1
  33. package/components/sandbox/types.d.cts +8 -1
  34. package/components/sandbox/types.d.cts.map +1 -1
  35. package/components/sandbox/types.d.ts +8 -1
  36. package/components/sandbox/types.d.ts.map +1 -1
  37. package/components/sandbox/types.js.map +1 -1
  38. package/components/sandbox/validation.cjs +5 -9
  39. package/components/sandbox/validation.cjs.map +1 -1
  40. package/components/sandbox/validation.js +5 -8
  41. package/components/sandbox/validation.js.map +1 -1
  42. package/experimental.d.cts +2 -1
  43. package/experimental.d.ts +2 -1
  44. package/helpers/duration.cjs +46 -0
  45. package/helpers/duration.cjs.map +1 -0
  46. package/helpers/duration.d.cts +25 -0
  47. package/helpers/duration.d.cts.map +1 -0
  48. package/helpers/duration.d.ts +25 -0
  49. package/helpers/duration.d.ts.map +1 -0
  50. package/helpers/duration.js +44 -0
  51. package/helpers/duration.js.map +1 -0
  52. package/index.cjs +2 -0
  53. package/index.d.cts +2 -1
  54. package/index.d.ts +2 -1
  55. package/index.js +2 -1
  56. package/package.json +1 -1
  57. package/types.cjs.map +1 -1
  58. package/types.d.cts +16 -13
  59. package/types.d.cts.map +1 -1
  60. package/types.d.ts +16 -13
  61. package/types.d.ts.map +1 -1
  62. package/types.js.map +1 -1
  63. package/version.cjs +1 -1
  64. package/version.cjs.map +1 -1
  65. package/version.d.cts +1 -1
  66. package/version.d.ts +1 -1
  67. package/version.js +1 -1
  68. package/version.js.map +1 -1
package/experimental.d.ts CHANGED
@@ -5,8 +5,9 @@ import { DeferredFunction, createDefer } from "./components/DeferredFunction.js"
5
5
  import { ExperimentRef } from "./types.js";
6
6
  import { DurableSandbox, DurableSandboxProcess, DurableSandboxSnapshot, DurableSandboxTools, Sandbox, SandboxAction, SandboxClient, SandboxCommand, SandboxCommandOptions, SandboxCommandOutputMetadata, SandboxCommandResult, SandboxCreateFreshOptions, SandboxCreateFromSnapshotOptions, SandboxCreateOptions, SandboxDestroyResult, SandboxDuration, SandboxError, SandboxErrorCode, SandboxErrorDetail, SandboxFileDownloadOptions, SandboxFileUploadOptions, SandboxFileUploadResult, SandboxLifecycleOptions, SandboxListOptions, SandboxListResult, SandboxLogStreamOptions, SandboxOutputChunk, SandboxPageInfo, SandboxProcess, SandboxProcessListOptions, SandboxProcessListResult, SandboxProcessOutput, SandboxProcessOutputOptions, SandboxProcessRef, SandboxProcessResource, SandboxProcessSignalOptions, SandboxProcessStartOptions, SandboxProcessState, SandboxProcessWaitOptions, SandboxRef, SandboxResource, SandboxResources, SandboxSnapshot, SandboxSnapshotCloneOptions, SandboxSnapshotCreateOptions, SandboxSnapshotListOptions, SandboxSnapshotListResult, SandboxSnapshotRef, SandboxSnapshotResource, SandboxSnapshotStatus, SandboxSnapshotWaitOptions, SandboxStatus, SandboxValidationError, SandboxWaitUntilRunningOptions } from "./components/sandbox/types.js";
7
7
  import { getSandboxError } from "./components/sandbox/protocol.js";
8
+ import { GroupSandbox, GroupSandboxOptions, GroupSandboxOptionsOrId } from "./components/sandbox/group.js";
8
9
  import { sandboxMiddleware } from "./components/sandbox/middleware.js";
9
10
  import { PublicInngestSpanProcessor } from "./components/execution/otel/processor.js";
10
11
  import { ExtendedTracesMiddlewareOptions, extendedTracesMiddleware } from "./components/execution/otel/middleware.js";
11
12
  import { createScorer } from "./components/ScoreFunction.js";
12
- export { type AsyncContext, DeferredFunction, type DurableSandbox, type DurableSandboxProcess, type DurableSandboxSnapshot, type DurableSandboxTools, type ExperimentRef, type ExtendedTracesMiddlewareOptions, PublicInngestSpanProcessor as InngestSpanProcessor, type Sandbox, type SandboxAction, type SandboxClient, type SandboxCommand, type SandboxCommandOptions, type SandboxCommandOutputMetadata, type SandboxCommandResult, type SandboxCreateFreshOptions, type SandboxCreateFromSnapshotOptions, type SandboxCreateOptions, type SandboxDestroyResult, type SandboxDuration, SandboxError, type SandboxErrorCode, type SandboxErrorDetail, type SandboxFileDownloadOptions, type SandboxFileUploadOptions, type SandboxFileUploadResult, type SandboxLifecycleOptions, type SandboxListOptions, type SandboxListResult, type SandboxLogStreamOptions, type SandboxOutputChunk, type SandboxPageInfo, type SandboxProcess, type SandboxProcessListOptions, type SandboxProcessListResult, type SandboxProcessOutput, type SandboxProcessOutputOptions, type SandboxProcessRef, type SandboxProcessResource, type SandboxProcessSignalOptions, type SandboxProcessStartOptions, type SandboxProcessState, type SandboxProcessWaitOptions, type SandboxRef, type SandboxResource, type SandboxResources, type SandboxSnapshot, type SandboxSnapshotCloneOptions, type SandboxSnapshotCreateOptions, type SandboxSnapshotListOptions, type SandboxSnapshotListResult, type SandboxSnapshotRef, type SandboxSnapshotResource, type SandboxSnapshotStatus, type SandboxSnapshotWaitOptions, type SandboxStatus, SandboxValidationError, type SandboxWaitUntilRunningOptions, createDefer, createScorer, extendedTracesMiddleware, getAsyncCtx, getSandboxError, metadataMiddleware, runWithAsyncCtx, sandboxMiddleware, scoreMiddleware };
13
+ export { type AsyncContext, DeferredFunction, type DurableSandbox, type DurableSandboxProcess, type DurableSandboxSnapshot, type DurableSandboxTools, type ExperimentRef, type ExtendedTracesMiddlewareOptions, type GroupSandbox, type GroupSandboxOptions, type GroupSandboxOptionsOrId, PublicInngestSpanProcessor as InngestSpanProcessor, type Sandbox, type SandboxAction, type SandboxClient, type SandboxCommand, type SandboxCommandOptions, type SandboxCommandOutputMetadata, type SandboxCommandResult, type SandboxCreateFreshOptions, type SandboxCreateFromSnapshotOptions, type SandboxCreateOptions, type SandboxDestroyResult, type SandboxDuration, SandboxError, type SandboxErrorCode, type SandboxErrorDetail, type SandboxFileDownloadOptions, type SandboxFileUploadOptions, type SandboxFileUploadResult, type SandboxLifecycleOptions, type SandboxListOptions, type SandboxListResult, type SandboxLogStreamOptions, type SandboxOutputChunk, type SandboxPageInfo, type SandboxProcess, type SandboxProcessListOptions, type SandboxProcessListResult, type SandboxProcessOutput, type SandboxProcessOutputOptions, type SandboxProcessRef, type SandboxProcessResource, type SandboxProcessSignalOptions, type SandboxProcessStartOptions, type SandboxProcessState, type SandboxProcessWaitOptions, type SandboxRef, type SandboxResource, type SandboxResources, type SandboxSnapshot, type SandboxSnapshotCloneOptions, type SandboxSnapshotCreateOptions, type SandboxSnapshotListOptions, type SandboxSnapshotListResult, type SandboxSnapshotRef, type SandboxSnapshotResource, type SandboxSnapshotStatus, type SandboxSnapshotWaitOptions, type SandboxStatus, SandboxValidationError, type SandboxWaitUntilRunningOptions, createDefer, createScorer, extendedTracesMiddleware, getAsyncCtx, getSandboxError, metadataMiddleware, runWithAsyncCtx, sandboxMiddleware, scoreMiddleware };
@@ -0,0 +1,46 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_temporal = require('./temporal.cjs');
3
+ let ms = require("ms");
4
+ ms = require_rolldown_runtime.__toESM(ms);
5
+
6
+ //#region src/helpers/duration.ts
7
+ /**
8
+ * Parse an `ms` string, or a compound string like `"1h30m"` or `"1h 30m"`
9
+ * (the sum of its parts), to milliseconds.
10
+ */
11
+ const parseString = (input) => {
12
+ const parts = input.trim().split(/(?<=[a-z])\s*(?=\d)/i);
13
+ if (parts.length > 1 && !/[a-z]$/i.test(parts[parts.length - 1] ?? "")) return;
14
+ let total = 0;
15
+ for (const part of parts) {
16
+ const value = part ? (0, ms.default)(part) : void 0;
17
+ if (typeof value !== "number") return;
18
+ total += value;
19
+ }
20
+ return total;
21
+ };
22
+ /**
23
+ * Convert a {@link DurationInput} to a positive, whole number of
24
+ * milliseconds. Throws an `Error` naming the value (`options.name`) if the
25
+ * input is malformed, not positive, or a `Temporal.Duration` with calendar
26
+ * years, months or weeks (their length depends on the calendar).
27
+ *
28
+ * Temporal values are detected by their brand, so no Temporal polyfill is
29
+ * needed or imported.
30
+ */
31
+ const durationToMs = (duration, options = {}) => {
32
+ const name = options.name ?? "duration";
33
+ let milliseconds;
34
+ if (typeof duration === "number") milliseconds = duration;
35
+ else if (typeof duration === "string") milliseconds = parseString(duration);
36
+ else if (require_temporal.isTemporalDuration(duration)) {
37
+ if (duration.years || duration.months || duration.weeks) throw new Error(`${name} cannot contain calendar years, months, or weeks`);
38
+ milliseconds = duration.total({ unit: "milliseconds" });
39
+ }
40
+ if (typeof milliseconds !== "number" || !Number.isSafeInteger(milliseconds) || milliseconds <= 0) throw new Error(`${name} must be a positive, whole number of milliseconds`);
41
+ return milliseconds;
42
+ };
43
+
44
+ //#endregion
45
+ exports.durationToMs = durationToMs;
46
+ //# sourceMappingURL=duration.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.cjs","names":["milliseconds: number | undefined","isTemporalDuration"],"sources":["../../src/helpers/duration.ts"],"sourcesContent":["import ms, { type StringValue } from \"ms\";\nimport { type DurationLike, isTemporalDuration } from \"./temporal.ts\";\n\n/**\n * Anything that describes a length of time: a number of milliseconds, a string\n * `ms` understands (`\"30s\"`, `\"2h\"`, `\"1d\"`), a compound string like `\"1h30m\"`,\n * or a `Temporal.Duration`.\n */\nexport type DurationInput = number | string | DurationLike;\n\n/**\n * Parse an `ms` string, or a compound string like `\"1h30m\"` or `\"1h 30m\"`\n * (the sum of its parts), to milliseconds.\n */\nconst parseString = (input: string): number | undefined => {\n // Split between a unit and the next number, so each part is an `ms` string.\n const parts = input.trim().split(/(?<=[a-z])\\s*(?=\\d)/i);\n\n // Every part of a compound string needs a unit, including the last.\n if (parts.length > 1 && !/[a-z]$/i.test(parts[parts.length - 1] ?? \"\")) {\n return undefined;\n }\n\n let total = 0;\n\n for (const part of parts) {\n // `ms` throws on an empty string.\n const value = part ? ms(part as StringValue) : undefined;\n\n if (typeof value !== \"number\") {\n return undefined;\n }\n\n total += value;\n }\n\n return total;\n};\n\n/**\n * Convert a {@link DurationInput} to a positive, whole number of\n * milliseconds. Throws an `Error` naming the value (`options.name`) if the\n * input is malformed, not positive, or a `Temporal.Duration` with calendar\n * years, months or weeks (their length depends on the calendar).\n *\n * Temporal values are detected by their brand, so no Temporal polyfill is\n * needed or imported.\n */\nexport const durationToMs = (\n duration: unknown,\n options: { name?: string } = {},\n): number => {\n const name = options.name ?? \"duration\";\n let milliseconds: number | undefined;\n\n if (typeof duration === \"number\") {\n milliseconds = duration;\n } else if (typeof duration === \"string\") {\n milliseconds = parseString(duration);\n } else if (isTemporalDuration(duration)) {\n if (duration.years || duration.months || duration.weeks) {\n throw new Error(\n `${name} cannot contain calendar years, months, or weeks`,\n );\n }\n\n milliseconds = duration.total({ unit: \"milliseconds\" });\n }\n\n if (\n typeof milliseconds !== \"number\" ||\n !Number.isSafeInteger(milliseconds) ||\n milliseconds <= 0\n ) {\n throw new Error(`${name} must be a positive, whole number of milliseconds`);\n }\n\n return milliseconds;\n};\n"],"mappings":";;;;;;;;;;AAcA,MAAM,eAAe,UAAsC;CAEzD,MAAM,QAAQ,MAAM,MAAM,CAAC,MAAM,uBAAuB;AAGxD,KAAI,MAAM,SAAS,KAAK,CAAC,UAAU,KAAK,MAAM,MAAM,SAAS,MAAM,GAAG,CACpE;CAGF,IAAI,QAAQ;AAEZ,MAAK,MAAM,QAAQ,OAAO;EAExB,MAAM,QAAQ,uBAAU,KAAoB,GAAG;AAE/C,MAAI,OAAO,UAAU,SACnB;AAGF,WAAS;;AAGX,QAAO;;;;;;;;;;;AAYT,MAAa,gBACX,UACA,UAA6B,EAAE,KACpB;CACX,MAAM,OAAO,QAAQ,QAAQ;CAC7B,IAAIA;AAEJ,KAAI,OAAO,aAAa,SACtB,gBAAe;UACN,OAAO,aAAa,SAC7B,gBAAe,YAAY,SAAS;UAC3BC,oCAAmB,SAAS,EAAE;AACvC,MAAI,SAAS,SAAS,SAAS,UAAU,SAAS,MAChD,OAAM,IAAI,MACR,GAAG,KAAK,kDACT;AAGH,iBAAe,SAAS,MAAM,EAAE,MAAM,gBAAgB,CAAC;;AAGzD,KACE,OAAO,iBAAiB,YACxB,CAAC,OAAO,cAAc,aAAa,IACnC,gBAAgB,EAEhB,OAAM,IAAI,MAAM,GAAG,KAAK,mDAAmD;AAG7E,QAAO"}
@@ -0,0 +1,25 @@
1
+ import { DurationLike } from "./temporal.cjs";
2
+
3
+ //#region src/helpers/duration.d.ts
4
+
5
+ /**
6
+ * Anything that describes a length of time: a number of milliseconds, a string
7
+ * `ms` understands (`"30s"`, `"2h"`, `"1d"`), a compound string like `"1h30m"`,
8
+ * or a `Temporal.Duration`.
9
+ */
10
+ type DurationInput = number | string | DurationLike;
11
+ /**
12
+ * Convert a {@link DurationInput} to a positive, whole number of
13
+ * milliseconds. Throws an `Error` naming the value (`options.name`) if the
14
+ * input is malformed, not positive, or a `Temporal.Duration` with calendar
15
+ * years, months or weeks (their length depends on the calendar).
16
+ *
17
+ * Temporal values are detected by their brand, so no Temporal polyfill is
18
+ * needed or imported.
19
+ */
20
+ declare const durationToMs: (duration: unknown, options?: {
21
+ name?: string;
22
+ }) => number;
23
+ //#endregion
24
+ export { DurationInput, durationToMs };
25
+ //# sourceMappingURL=duration.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.d.cts","names":[],"sources":["../../src/helpers/duration.ts"],"sourcesContent":[],"mappings":";;;;;;AAQA;AAwCA;;KAxCY,aAAA,qBAAkC;;;;;;;;;;cAwCjC"}
@@ -0,0 +1,25 @@
1
+ import { DurationLike } from "./temporal.js";
2
+
3
+ //#region src/helpers/duration.d.ts
4
+
5
+ /**
6
+ * Anything that describes a length of time: a number of milliseconds, a string
7
+ * `ms` understands (`"30s"`, `"2h"`, `"1d"`), a compound string like `"1h30m"`,
8
+ * or a `Temporal.Duration`.
9
+ */
10
+ type DurationInput = number | string | DurationLike;
11
+ /**
12
+ * Convert a {@link DurationInput} to a positive, whole number of
13
+ * milliseconds. Throws an `Error` naming the value (`options.name`) if the
14
+ * input is malformed, not positive, or a `Temporal.Duration` with calendar
15
+ * years, months or weeks (their length depends on the calendar).
16
+ *
17
+ * Temporal values are detected by their brand, so no Temporal polyfill is
18
+ * needed or imported.
19
+ */
20
+ declare const durationToMs: (duration: unknown, options?: {
21
+ name?: string;
22
+ }) => number;
23
+ //#endregion
24
+ export { DurationInput, durationToMs };
25
+ //# sourceMappingURL=duration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.d.ts","names":[],"sources":["../../src/helpers/duration.ts"],"sourcesContent":[],"mappings":";;;;;;AAQA;AAwCA;;KAxCY,aAAA,qBAAkC;;;;;;;;;;cAwCjC"}
@@ -0,0 +1,44 @@
1
+ import { isTemporalDuration } from "./temporal.js";
2
+ import ms from "ms";
3
+
4
+ //#region src/helpers/duration.ts
5
+ /**
6
+ * Parse an `ms` string, or a compound string like `"1h30m"` or `"1h 30m"`
7
+ * (the sum of its parts), to milliseconds.
8
+ */
9
+ const parseString = (input) => {
10
+ const parts = input.trim().split(/(?<=[a-z])\s*(?=\d)/i);
11
+ if (parts.length > 1 && !/[a-z]$/i.test(parts[parts.length - 1] ?? "")) return;
12
+ let total = 0;
13
+ for (const part of parts) {
14
+ const value = part ? ms(part) : void 0;
15
+ if (typeof value !== "number") return;
16
+ total += value;
17
+ }
18
+ return total;
19
+ };
20
+ /**
21
+ * Convert a {@link DurationInput} to a positive, whole number of
22
+ * milliseconds. Throws an `Error` naming the value (`options.name`) if the
23
+ * input is malformed, not positive, or a `Temporal.Duration` with calendar
24
+ * years, months or weeks (their length depends on the calendar).
25
+ *
26
+ * Temporal values are detected by their brand, so no Temporal polyfill is
27
+ * needed or imported.
28
+ */
29
+ const durationToMs = (duration, options = {}) => {
30
+ const name = options.name ?? "duration";
31
+ let milliseconds;
32
+ if (typeof duration === "number") milliseconds = duration;
33
+ else if (typeof duration === "string") milliseconds = parseString(duration);
34
+ else if (isTemporalDuration(duration)) {
35
+ if (duration.years || duration.months || duration.weeks) throw new Error(`${name} cannot contain calendar years, months, or weeks`);
36
+ milliseconds = duration.total({ unit: "milliseconds" });
37
+ }
38
+ if (typeof milliseconds !== "number" || !Number.isSafeInteger(milliseconds) || milliseconds <= 0) throw new Error(`${name} must be a positive, whole number of milliseconds`);
39
+ return milliseconds;
40
+ };
41
+
42
+ //#endregion
43
+ export { durationToMs };
44
+ //# sourceMappingURL=duration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.js","names":["milliseconds: number | undefined"],"sources":["../../src/helpers/duration.ts"],"sourcesContent":["import ms, { type StringValue } from \"ms\";\nimport { type DurationLike, isTemporalDuration } from \"./temporal.ts\";\n\n/**\n * Anything that describes a length of time: a number of milliseconds, a string\n * `ms` understands (`\"30s\"`, `\"2h\"`, `\"1d\"`), a compound string like `\"1h30m\"`,\n * or a `Temporal.Duration`.\n */\nexport type DurationInput = number | string | DurationLike;\n\n/**\n * Parse an `ms` string, or a compound string like `\"1h30m\"` or `\"1h 30m\"`\n * (the sum of its parts), to milliseconds.\n */\nconst parseString = (input: string): number | undefined => {\n // Split between a unit and the next number, so each part is an `ms` string.\n const parts = input.trim().split(/(?<=[a-z])\\s*(?=\\d)/i);\n\n // Every part of a compound string needs a unit, including the last.\n if (parts.length > 1 && !/[a-z]$/i.test(parts[parts.length - 1] ?? \"\")) {\n return undefined;\n }\n\n let total = 0;\n\n for (const part of parts) {\n // `ms` throws on an empty string.\n const value = part ? ms(part as StringValue) : undefined;\n\n if (typeof value !== \"number\") {\n return undefined;\n }\n\n total += value;\n }\n\n return total;\n};\n\n/**\n * Convert a {@link DurationInput} to a positive, whole number of\n * milliseconds. Throws an `Error` naming the value (`options.name`) if the\n * input is malformed, not positive, or a `Temporal.Duration` with calendar\n * years, months or weeks (their length depends on the calendar).\n *\n * Temporal values are detected by their brand, so no Temporal polyfill is\n * needed or imported.\n */\nexport const durationToMs = (\n duration: unknown,\n options: { name?: string } = {},\n): number => {\n const name = options.name ?? \"duration\";\n let milliseconds: number | undefined;\n\n if (typeof duration === \"number\") {\n milliseconds = duration;\n } else if (typeof duration === \"string\") {\n milliseconds = parseString(duration);\n } else if (isTemporalDuration(duration)) {\n if (duration.years || duration.months || duration.weeks) {\n throw new Error(\n `${name} cannot contain calendar years, months, or weeks`,\n );\n }\n\n milliseconds = duration.total({ unit: \"milliseconds\" });\n }\n\n if (\n typeof milliseconds !== \"number\" ||\n !Number.isSafeInteger(milliseconds) ||\n milliseconds <= 0\n ) {\n throw new Error(`${name} must be a positive, whole number of milliseconds`);\n }\n\n return milliseconds;\n};\n"],"mappings":";;;;;;;;AAcA,MAAM,eAAe,UAAsC;CAEzD,MAAM,QAAQ,MAAM,MAAM,CAAC,MAAM,uBAAuB;AAGxD,KAAI,MAAM,SAAS,KAAK,CAAC,UAAU,KAAK,MAAM,MAAM,SAAS,MAAM,GAAG,CACpE;CAGF,IAAI,QAAQ;AAEZ,MAAK,MAAM,QAAQ,OAAO;EAExB,MAAM,QAAQ,OAAO,GAAG,KAAoB,GAAG;AAE/C,MAAI,OAAO,UAAU,SACnB;AAGF,WAAS;;AAGX,QAAO;;;;;;;;;;;AAYT,MAAa,gBACX,UACA,UAA6B,EAAE,KACpB;CACX,MAAM,OAAO,QAAQ,QAAQ;CAC7B,IAAIA;AAEJ,KAAI,OAAO,aAAa,SACtB,gBAAe;UACN,OAAO,aAAa,SAC7B,gBAAe,YAAY,SAAS;UAC3B,mBAAmB,SAAS,EAAE;AACvC,MAAI,SAAS,SAAS,SAAS,UAAU,SAAS,MAChD,OAAM,IAAI,MACR,GAAG,KAAK,kDACT;AAGH,iBAAe,SAAS,MAAM,EAAE,MAAM,gBAAgB,CAAC;;AAGzD,KACE,OAAO,iBAAiB,YACxB,CAAC,OAAO,cAAc,aAAa,IACnC,gBAAgB,EAEhB,OAAM,IAAI,MAAM,GAAG,KAAK,mDAAmD;AAG7E,QAAO"}
package/index.cjs CHANGED
@@ -7,6 +7,7 @@ const require_strings = require('./helpers/strings.cjs');
7
7
  const require_logger = require('./middleware/logger.cjs');
8
8
  const require_triggers = require('./components/triggers/triggers.cjs');
9
9
  const require_middleware = require('./components/middleware/middleware.cjs');
10
+ const require_duration = require('./helpers/duration.cjs');
10
11
  const require_Fetch = require('./components/Fetch.cjs');
11
12
  const require_InngestFunctionReference = require('./components/InngestFunctionReference.cjs');
12
13
  const require_InngestStepTools = require('./components/InngestStepTools.cjs');
@@ -40,6 +41,7 @@ exports.RetryAfterError = require_RetryAfterError.RetryAfterError;
40
41
  exports.StepError = require_StepError.StepError;
41
42
  exports.cron = require_triggers.cron;
42
43
  exports.dependencyInjectionMiddleware = require_dependencyInjection.dependencyInjectionMiddleware;
44
+ exports.durationToMs = require_duration.durationToMs;
43
45
  exports.eventType = require_triggers.eventType;
44
46
  exports.experiment = require_ExperimentStrategies.experiment;
45
47
  exports.fetch = require_Fetch.fetch;
package/index.d.cts CHANGED
@@ -14,6 +14,7 @@ import { StepError } from "./components/StepError.cjs";
14
14
  import { EventType, cron, eventType, invoke, staticSchema } from "./components/triggers/triggers.cjs";
15
15
  import { HandlerWithTriggers } from "./components/triggers/typeHelpers.cjs";
16
16
  import { isInngest, isInngestFunction, isInngestRequest } from "./helpers/assertions.cjs";
17
+ import { DurationInput, durationToMs } from "./helpers/duration.cjs";
17
18
  import { serializeError } from "./helpers/errors.cjs";
18
19
  import { wrapStringFirstLogger } from "./helpers/log.cjs";
19
20
  import { slugify } from "./helpers/strings.cjs";
@@ -27,4 +28,4 @@ import { ClientOptionsFromInngest, GetFunctionInput, GetFunctionOutput, GetFunct
27
28
  import { InngestCommHandler, ServeHandlerOptions } from "./components/InngestCommHandler.cjs";
28
29
  import { StandardSchemaV1 } from "@standard-schema/spec";
29
30
  export * from "@inngest/ai";
30
- export { type BaseContext, type ClientOptions, type ClientOptionsFromInngest, ConsoleLogger, type Context, type DurationLike, type EventMeta, type EventNameFromTrigger, type EventPayload, type EventSessionValue, type EventSessions, EventType, type ExclusiveKeys, type FailureEventArgs, type FailureEventPayload, type FinishedEventPayload, type GetFunctionInput, type GetFunctionOutput, type GetFunctionOutputRaw, type GetStepTools, type GroupExperiment, type GroupTools, type GroupToolsDeps, type Handler, type HandlerWithTriggers, Inngest, InngestCommHandler, type InngestFunction, type InngestFunctionReference, type InstantLike, type IsStringLiteral, type JsonError, type LogArg, type LogLevel, type Logger, type MaybePromise, Middleware, NonRetriableError, type OutgoingOp, type ParallelOptions, type PropagatedEventSessionValue, type PropagatedEventSessions, ProxyLogger, type Realtime, type ReceivedEventMeta, type RegisterOptions, RetryAfterError, type ScheduledTimerEventPayload, type SendEventBaseOutput, type SendEventPayload, type SendSignalResponse, type ServeHandlerOptions, type StandardSchemaV1, StepError, type StepFetch, type StepOptions, type StepOptionsOrId, type StrictUnion, type StrictUnionHelper, type TimeStr, type UnionKeys, type ZonedDateTimeLike, cron, dependencyInjectionMiddleware, eventType, experiment, fetch, group, headerKeys, internalEvents, invoke, isInngest, isInngestFunction, isInngestRequest, queryKeys, realtime, referenceFunction, serializeError, slugify, staticSchema, step, version, wrapStringFirstLogger };
31
+ export { type BaseContext, type ClientOptions, type ClientOptionsFromInngest, ConsoleLogger, type Context, type DurationInput, type DurationLike, type EventMeta, type EventNameFromTrigger, type EventPayload, type EventSessionValue, type EventSessions, EventType, type ExclusiveKeys, type FailureEventArgs, type FailureEventPayload, type FinishedEventPayload, type GetFunctionInput, type GetFunctionOutput, type GetFunctionOutputRaw, type GetStepTools, type GroupExperiment, type GroupTools, type GroupToolsDeps, type Handler, type HandlerWithTriggers, Inngest, InngestCommHandler, type InngestFunction, type InngestFunctionReference, type InstantLike, type IsStringLiteral, type JsonError, type LogArg, type LogLevel, type Logger, type MaybePromise, Middleware, NonRetriableError, type OutgoingOp, type ParallelOptions, type PropagatedEventSessionValue, type PropagatedEventSessions, ProxyLogger, type Realtime, type ReceivedEventMeta, type RegisterOptions, RetryAfterError, type ScheduledTimerEventPayload, type SendEventBaseOutput, type SendEventPayload, type SendSignalResponse, type ServeHandlerOptions, type StandardSchemaV1, StepError, type StepFetch, type StepOptions, type StepOptionsOrId, type StrictUnion, type StrictUnionHelper, type TimeStr, type UnionKeys, type ZonedDateTimeLike, cron, dependencyInjectionMiddleware, durationToMs, eventType, experiment, fetch, group, headerKeys, internalEvents, invoke, isInngest, isInngestFunction, isInngestRequest, queryKeys, realtime, referenceFunction, serializeError, slugify, staticSchema, step, version, wrapStringFirstLogger };
package/index.d.ts CHANGED
@@ -14,6 +14,7 @@ import { StepError } from "./components/StepError.js";
14
14
  import { EventType, cron, eventType, invoke, staticSchema } from "./components/triggers/triggers.js";
15
15
  import { HandlerWithTriggers } from "./components/triggers/typeHelpers.js";
16
16
  import { isInngest, isInngestFunction, isInngestRequest } from "./helpers/assertions.js";
17
+ import { DurationInput, durationToMs } from "./helpers/duration.js";
17
18
  import { serializeError } from "./helpers/errors.js";
18
19
  import { wrapStringFirstLogger } from "./helpers/log.js";
19
20
  import { slugify } from "./helpers/strings.js";
@@ -27,4 +28,4 @@ import { ClientOptionsFromInngest, GetFunctionInput, GetFunctionOutput, GetFunct
27
28
  import { InngestCommHandler, ServeHandlerOptions } from "./components/InngestCommHandler.js";
28
29
  import { StandardSchemaV1 } from "@standard-schema/spec";
29
30
  export * from "@inngest/ai";
30
- export { type BaseContext, type ClientOptions, type ClientOptionsFromInngest, ConsoleLogger, type Context, type DurationLike, type EventMeta, type EventNameFromTrigger, type EventPayload, type EventSessionValue, type EventSessions, EventType, type ExclusiveKeys, type FailureEventArgs, type FailureEventPayload, type FinishedEventPayload, type GetFunctionInput, type GetFunctionOutput, type GetFunctionOutputRaw, type GetStepTools, type GroupExperiment, type GroupTools, type GroupToolsDeps, type Handler, type HandlerWithTriggers, Inngest, InngestCommHandler, type InngestFunction, type InngestFunctionReference, type InstantLike, type IsStringLiteral, type JsonError, type LogArg, type LogLevel, type Logger, type MaybePromise, Middleware, NonRetriableError, type OutgoingOp, type ParallelOptions, type PropagatedEventSessionValue, type PropagatedEventSessions, ProxyLogger, type Realtime, type ReceivedEventMeta, type RegisterOptions, RetryAfterError, type ScheduledTimerEventPayload, type SendEventBaseOutput, type SendEventPayload, type SendSignalResponse, type ServeHandlerOptions, type StandardSchemaV1, StepError, type StepFetch, type StepOptions, type StepOptionsOrId, type StrictUnion, type StrictUnionHelper, type TimeStr, type UnionKeys, type ZonedDateTimeLike, cron, dependencyInjectionMiddleware, eventType, experiment, fetch, group, headerKeys, internalEvents, invoke, isInngest, isInngestFunction, isInngestRequest, queryKeys, realtime, referenceFunction, serializeError, slugify, staticSchema, step, version, wrapStringFirstLogger };
31
+ export { type BaseContext, type ClientOptions, type ClientOptionsFromInngest, ConsoleLogger, type Context, type DurationInput, type DurationLike, type EventMeta, type EventNameFromTrigger, type EventPayload, type EventSessionValue, type EventSessions, EventType, type ExclusiveKeys, type FailureEventArgs, type FailureEventPayload, type FinishedEventPayload, type GetFunctionInput, type GetFunctionOutput, type GetFunctionOutputRaw, type GetStepTools, type GroupExperiment, type GroupTools, type GroupToolsDeps, type Handler, type HandlerWithTriggers, Inngest, InngestCommHandler, type InngestFunction, type InngestFunctionReference, type InstantLike, type IsStringLiteral, type JsonError, type LogArg, type LogLevel, type Logger, type MaybePromise, Middleware, NonRetriableError, type OutgoingOp, type ParallelOptions, type PropagatedEventSessionValue, type PropagatedEventSessions, ProxyLogger, type Realtime, type ReceivedEventMeta, type RegisterOptions, RetryAfterError, type ScheduledTimerEventPayload, type SendEventBaseOutput, type SendEventPayload, type SendSignalResponse, type ServeHandlerOptions, type StandardSchemaV1, StepError, type StepFetch, type StepOptions, type StepOptionsOrId, type StrictUnion, type StrictUnionHelper, type TimeStr, type UnionKeys, type ZonedDateTimeLike, cron, dependencyInjectionMiddleware, durationToMs, eventType, experiment, fetch, group, headerKeys, internalEvents, invoke, isInngest, isInngestFunction, isInngestRequest, queryKeys, realtime, referenceFunction, serializeError, slugify, staticSchema, step, version, wrapStringFirstLogger };
package/index.js CHANGED
@@ -7,6 +7,7 @@ import { slugify } from "./helpers/strings.js";
7
7
  import { ConsoleLogger, ProxyLogger } from "./middleware/logger.js";
8
8
  import { EventType, cron, eventType, invoke, staticSchema } from "./components/triggers/triggers.js";
9
9
  import { Middleware } from "./components/middleware/middleware.js";
10
+ import { durationToMs } from "./helpers/duration.js";
10
11
  import { fetch } from "./components/Fetch.js";
11
12
  import { referenceFunction } from "./components/InngestFunctionReference.js";
12
13
  import { group, step } from "./components/InngestStepTools.js";
@@ -21,4 +22,4 @@ import { dependencyInjectionMiddleware } from "./middleware/dependencyInjection.
21
22
 
22
23
  export * from "@inngest/ai"
23
24
 
24
- export { ConsoleLogger, EventType, Inngest, InngestCommHandler, Middleware, NonRetriableError, ProxyLogger, RetryAfterError, StepError, cron, dependencyInjectionMiddleware, eventType, experiment, fetch, group, headerKeys, internalEvents, invoke, isInngest, isInngestFunction, isInngestRequest, queryKeys, realtime, referenceFunction, serializeError, slugify, staticSchema, step, version, wrapStringFirstLogger };
25
+ export { ConsoleLogger, EventType, Inngest, InngestCommHandler, Middleware, NonRetriableError, ProxyLogger, RetryAfterError, StepError, cron, dependencyInjectionMiddleware, durationToMs, eventType, experiment, fetch, group, headerKeys, internalEvents, invoke, isInngest, isInngestFunction, isInngestRequest, queryKeys, realtime, referenceFunction, serializeError, slugify, staticSchema, step, version, wrapStringFirstLogger };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inngest",
3
- "version": "4.23.0",
3
+ "version": "4.24.0",
4
4
  "description": "Official SDK for Inngest.com. Inngest is the reliability layer for modern applications. Inngest combines durable execution, events, and queues into a zero-infra platform with built-in observability.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",