inngest 4.7.0 → 4.9.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.
- package/CHANGELOG.md +22 -0
- package/components/DeferredFunction.cjs +52 -0
- package/components/DeferredFunction.cjs.map +1 -1
- package/components/DeferredFunction.d.cts +35 -9
- package/components/DeferredFunction.d.cts.map +1 -1
- package/components/DeferredFunction.d.ts +35 -9
- package/components/DeferredFunction.d.ts.map +1 -1
- package/components/DeferredFunction.js +53 -1
- package/components/DeferredFunction.js.map +1 -1
- package/components/Inngest.cjs +24 -1
- package/components/Inngest.cjs.map +1 -1
- package/components/Inngest.d.cts +23 -3
- package/components/Inngest.d.cts.map +1 -1
- package/components/Inngest.d.ts +23 -3
- package/components/Inngest.d.ts.map +1 -1
- package/components/Inngest.js +24 -1
- package/components/Inngest.js.map +1 -1
- package/components/InngestCommHandler.d.cts +2 -2
- package/components/InngestCommHandler.d.ts +2 -2
- package/components/InngestFunction.d.cts +2 -2
- package/components/InngestFunction.d.ts +2 -2
- package/components/InngestGroupTools.cjs +7 -4
- package/components/InngestGroupTools.cjs.map +1 -1
- package/components/InngestGroupTools.d.cts +5 -24
- package/components/InngestGroupTools.d.cts.map +1 -1
- package/components/InngestGroupTools.d.ts +5 -24
- package/components/InngestGroupTools.d.ts.map +1 -1
- package/components/InngestGroupTools.js +7 -4
- package/components/InngestGroupTools.js.map +1 -1
- package/components/InngestMetadata.cjs +18 -4
- package/components/InngestMetadata.cjs.map +1 -1
- package/components/InngestMetadata.d.cts +2 -2
- package/components/InngestMetadata.d.cts.map +1 -1
- package/components/InngestMetadata.d.ts +2 -2
- package/components/InngestMetadata.d.ts.map +1 -1
- package/components/InngestMetadata.js +18 -5
- package/components/InngestMetadata.js.map +1 -1
- package/components/InngestScore.cjs +93 -0
- package/components/InngestScore.cjs.map +1 -0
- package/components/InngestScore.d.cts +89 -0
- package/components/InngestScore.d.cts.map +1 -0
- package/components/InngestScore.d.ts +89 -0
- package/components/InngestScore.d.ts.map +1 -0
- package/components/InngestScore.js +88 -0
- package/components/InngestScore.js.map +1 -0
- package/components/InngestStepTools.cjs +9 -0
- package/components/InngestStepTools.cjs.map +1 -1
- package/components/InngestStepTools.d.cts +5 -3
- package/components/InngestStepTools.d.cts.map +1 -1
- package/components/InngestStepTools.d.ts +5 -3
- package/components/InngestStepTools.d.ts.map +1 -1
- package/components/InngestStepTools.js +9 -0
- package/components/InngestStepTools.js.map +1 -1
- package/components/ScoreFunction.cjs +37 -0
- package/components/ScoreFunction.cjs.map +1 -0
- package/components/ScoreFunction.d.cts +24 -0
- package/components/ScoreFunction.d.cts.map +1 -0
- package/components/ScoreFunction.d.ts +24 -0
- package/components/ScoreFunction.d.ts.map +1 -0
- package/components/ScoreFunction.js +37 -0
- package/components/ScoreFunction.js.map +1 -0
- package/components/execution/InngestExecution.d.cts +2 -2
- package/components/execution/InngestExecution.d.ts +2 -2
- package/components/execution/als.cjs.map +1 -1
- package/components/execution/als.d.cts +1 -0
- package/components/execution/als.d.cts.map +1 -1
- package/components/execution/als.d.ts +1 -0
- package/components/execution/als.d.ts.map +1 -1
- package/components/execution/als.js.map +1 -1
- package/components/execution/engine.cjs +12 -10
- package/components/execution/engine.cjs.map +1 -1
- package/components/execution/engine.d.cts +1 -1
- package/components/execution/engine.d.cts.map +1 -1
- package/components/execution/engine.d.ts +1 -1
- package/components/execution/engine.d.ts.map +1 -1
- package/components/execution/engine.js +13 -11
- package/components/execution/engine.js.map +1 -1
- package/components/execution/otel/aiExtractor.cjs +90 -125
- package/components/execution/otel/aiExtractor.cjs.map +1 -1
- package/components/execution/otel/aiExtractor.d.cts +48 -5
- package/components/execution/otel/aiExtractor.d.cts.map +1 -1
- package/components/execution/otel/aiExtractor.d.ts +48 -5
- package/components/execution/otel/aiExtractor.d.ts.map +1 -1
- package/components/execution/otel/aiExtractor.js +90 -125
- package/components/execution/otel/aiExtractor.js.map +1 -1
- package/components/execution/otel/middleware.cjs +3 -1
- package/components/execution/otel/middleware.cjs.map +1 -1
- package/components/execution/otel/middleware.d.cts +19 -12
- package/components/execution/otel/middleware.d.cts.map +1 -1
- package/components/execution/otel/middleware.d.ts +19 -12
- package/components/execution/otel/middleware.d.ts.map +1 -1
- package/components/execution/otel/middleware.js +4 -2
- package/components/execution/otel/middleware.js.map +1 -1
- package/components/execution/otel/util.cjs +9 -1
- package/components/execution/otel/util.cjs.map +1 -1
- package/components/execution/otel/util.js +9 -2
- package/components/execution/otel/util.js.map +1 -1
- package/components/realtime/types.d.cts +3 -3
- package/components/realtime/types.d.cts.map +1 -1
- package/components/realtime/types.d.ts +3 -3
- package/components/realtime/types.d.ts.map +1 -1
- package/experimental.cjs +5 -1
- package/experimental.d.cts +4 -1
- package/experimental.d.ts +4 -1
- package/experimental.js +3 -1
- package/helpers/consts.cjs +7 -0
- package/helpers/consts.cjs.map +1 -1
- package/helpers/consts.d.cts.map +1 -1
- package/helpers/consts.d.ts.map +1 -1
- package/helpers/consts.js +7 -1
- package/helpers/consts.js.map +1 -1
- package/helpers/errors.cjs +16 -0
- package/helpers/errors.cjs.map +1 -1
- package/helpers/errors.d.cts +12 -1
- package/helpers/errors.d.cts.map +1 -1
- package/helpers/errors.d.ts +12 -1
- package/helpers/errors.d.ts.map +1 -1
- package/helpers/errors.js +16 -1
- package/helpers/errors.js.map +1 -1
- package/helpers/types.cjs +4 -0
- package/helpers/types.cjs.map +1 -1
- package/helpers/types.js +4 -1
- package/helpers/types.js.map +1 -1
- package/index.d.cts +2 -2
- package/index.d.ts +2 -2
- package/package.json +1 -1
- package/types.cjs.map +1 -1
- package/types.d.cts +30 -9
- package/types.d.cts.map +1 -1
- package/types.d.ts +30 -9
- package/types.d.ts.map +1 -1
- package/types.js.map +1 -1
- package/version.cjs +1 -1
- package/version.cjs.map +1 -1
- package/version.d.cts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
|
@@ -35,6 +35,13 @@ const createProvider = async (_behaviour, instrumentations = []) => {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
function warnDeprecatedCreateProviderBehaviour(behaviour) {
|
|
39
|
+
if (behaviour === "auto") {
|
|
40
|
+
console.warn("`extendedTracesMiddleware()` falling back to creating an OpenTelemetry provider is deprecated. Use @inngest/otel instead.");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
console.warn("`extendedTracesMiddleware({ behaviour: \"createProvider\" })` is deprecated. Use @inngest/otel instead.");
|
|
44
|
+
}
|
|
38
45
|
/**
|
|
39
46
|
* Attempts to extend the existing OTel provider with our processor. Returns true
|
|
40
47
|
* if the provider was extended, false if it was not.
|
|
@@ -42,7 +49,7 @@ const createProvider = async (_behaviour, instrumentations = []) => {
|
|
|
42
49
|
const extendProvider = (behaviour) => {
|
|
43
50
|
const globalProvider = __opentelemetry_api.trace.getTracerProvider();
|
|
44
51
|
if (!globalProvider) {
|
|
45
|
-
if (behaviour !== "auto") console.warn("No existing OTel provider found and behaviour is \"extendProvider\". Inngest's OTel middleware will not work.
|
|
52
|
+
if (behaviour !== "auto") console.warn("No existing OTel provider found and behaviour is \"extendProvider\". Inngest's OTel middleware will not work. Use @inngest/otel instead, or make sure that the provider is created and imported before the middleware is used.");
|
|
46
53
|
return { success: false };
|
|
47
54
|
}
|
|
48
55
|
const existingProvider = "getDelegate" in globalProvider && typeof globalProvider.getDelegate === "function" ? globalProvider.getDelegate() : globalProvider;
|
|
@@ -94,4 +101,5 @@ function getInternalSpanProcessors(provider) {
|
|
|
94
101
|
//#endregion
|
|
95
102
|
exports.createProvider = createProvider;
|
|
96
103
|
exports.extendProvider = extendProvider;
|
|
104
|
+
exports.warnDeprecatedCreateProviderBehaviour = warnDeprecatedCreateProviderBehaviour;
|
|
97
105
|
//# sourceMappingURL=util.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.cjs","names":["debug","debugPrefix","InngestSpanProcessor","BasicTracerProvider","trace"],"sources":["../../../../src/components/execution/otel/util.ts"],"sourcesContent":["import { context, trace } from \"@opentelemetry/api\";\nimport type { Instrumentation } from \"@opentelemetry/instrumentation\";\nimport { BasicTracerProvider } from \"@opentelemetry/sdk-trace-base\";\nimport Debug from \"debug\";\nimport { debugPrefix } from \"./consts.ts\";\nimport { InngestSpanProcessor } from \"./processor.ts\";\n\nconst debug = Debug(`${debugPrefix}:createProvider`);\n\nexport type Behaviour = \"createProvider\" | \"extendProvider\" | \"off\" | \"auto\";\nexport type Instrumentations = (Instrumentation | Instrumentation[])[];\n\nexport const createProvider = async (\n _behaviour: Behaviour,\n instrumentations: Instrumentations | undefined = [],\n): Promise<\n | { success: true; processor: InngestSpanProcessor }\n | { success: false; error?: unknown }\n> => {\n try {\n // TODO Check if there's an existing provider\n const processor = new InngestSpanProcessor();\n\n const p = new BasicTracerProvider({\n spanProcessors: [processor],\n });\n\n // Dynamic imports to avoid loading the full auto-instrumentation suite at\n // module evaluation time. These are only needed when creating a new provider,\n // not when extending an existing one. Static imports here caused version\n // conflicts with host app OTel setups (e.g. Sentry) and silently broke\n // inngest.send(). See #1324.\n const { getNodeAutoInstrumentations } = await import(\n \"@opentelemetry/auto-instrumentations-node\"\n );\n const { registerInstrumentations } = await import(\n \"@opentelemetry/instrumentation\"\n );\n const { AnthropicInstrumentation } = await import(\n \"@traceloop/instrumentation-anthropic\"\n );\n const { AsyncHooksContextManager } = await import(\n \"@opentelemetry/context-async-hooks\"\n );\n\n const instrList: Instrumentations = [\n ...instrumentations,\n ...getNodeAutoInstrumentations(),\n new AnthropicInstrumentation(),\n ];\n\n registerInstrumentations({\n instrumentations: instrList,\n });\n\n trace.setGlobalTracerProvider(p);\n context.setGlobalContextManager(new AsyncHooksContextManager().enable());\n\n return { success: true, processor };\n } catch (err) {\n debug(\"failed to create provider:\", err);\n return { success: false, error: err };\n }\n};\n\n/**\n * Attempts to extend the existing OTel provider with our processor. Returns true\n * if the provider was extended, false if it was not.\n */\nexport const extendProvider = (\n behaviour: Behaviour,\n): { success: true; processor: InngestSpanProcessor } | { success: false } => {\n // Attempt to add our processor and export to the existing provider\n const globalProvider = trace.getTracerProvider();\n if (!globalProvider) {\n if (behaviour !== \"auto\") {\n console.warn(\n 'No existing OTel provider found and behaviour is \"extendProvider\". Inngest\\'s OTel middleware will not work.
|
|
1
|
+
{"version":3,"file":"util.cjs","names":["debug","debugPrefix","InngestSpanProcessor","BasicTracerProvider","trace"],"sources":["../../../../src/components/execution/otel/util.ts"],"sourcesContent":["import { context, trace } from \"@opentelemetry/api\";\nimport type { Instrumentation } from \"@opentelemetry/instrumentation\";\nimport { BasicTracerProvider } from \"@opentelemetry/sdk-trace-base\";\nimport Debug from \"debug\";\nimport { debugPrefix } from \"./consts.ts\";\nimport { InngestSpanProcessor } from \"./processor.ts\";\n\nconst debug = Debug(`${debugPrefix}:createProvider`);\n\nexport type Behaviour = \"createProvider\" | \"extendProvider\" | \"off\" | \"auto\";\nexport type Instrumentations = (Instrumentation | Instrumentation[])[];\n\nexport const createProvider = async (\n _behaviour: Behaviour,\n instrumentations: Instrumentations | undefined = [],\n): Promise<\n | { success: true; processor: InngestSpanProcessor }\n | { success: false; error?: unknown }\n> => {\n try {\n // TODO Check if there's an existing provider\n const processor = new InngestSpanProcessor();\n\n const p = new BasicTracerProvider({\n spanProcessors: [processor],\n });\n\n // Dynamic imports to avoid loading the full auto-instrumentation suite at\n // module evaluation time. These are only needed when creating a new provider,\n // not when extending an existing one. Static imports here caused version\n // conflicts with host app OTel setups (e.g. Sentry) and silently broke\n // inngest.send(). See #1324.\n const { getNodeAutoInstrumentations } = await import(\n \"@opentelemetry/auto-instrumentations-node\"\n );\n const { registerInstrumentations } = await import(\n \"@opentelemetry/instrumentation\"\n );\n const { AnthropicInstrumentation } = await import(\n \"@traceloop/instrumentation-anthropic\"\n );\n const { AsyncHooksContextManager } = await import(\n \"@opentelemetry/context-async-hooks\"\n );\n\n const instrList: Instrumentations = [\n ...instrumentations,\n ...getNodeAutoInstrumentations(),\n new AnthropicInstrumentation(),\n ];\n\n registerInstrumentations({\n instrumentations: instrList,\n });\n\n trace.setGlobalTracerProvider(p);\n context.setGlobalContextManager(new AsyncHooksContextManager().enable());\n\n return { success: true, processor };\n } catch (err) {\n debug(\"failed to create provider:\", err);\n return { success: false, error: err };\n }\n};\n\nexport function warnDeprecatedCreateProviderBehaviour(\n behaviour: Extract<Behaviour, \"auto\" | \"createProvider\">,\n): void {\n if (behaviour === \"auto\") {\n console.warn(\n \"`extendedTracesMiddleware()` falling back to creating an OpenTelemetry provider is deprecated. Use @inngest/otel instead.\",\n );\n return;\n }\n\n console.warn(\n '`extendedTracesMiddleware({ behaviour: \"createProvider\" })` is deprecated. Use @inngest/otel instead.',\n );\n}\n\n/**\n * Attempts to extend the existing OTel provider with our processor. Returns true\n * if the provider was extended, false if it was not.\n */\nexport const extendProvider = (\n behaviour: Behaviour,\n): { success: true; processor: InngestSpanProcessor } | { success: false } => {\n // Attempt to add our processor and export to the existing provider\n const globalProvider = trace.getTracerProvider();\n if (!globalProvider) {\n if (behaviour !== \"auto\") {\n console.warn(\n 'No existing OTel provider found and behaviour is \"extendProvider\". Inngest\\'s OTel middleware will not work. Use @inngest/otel instead, or make sure that the provider is created and imported before the middleware is used.',\n );\n }\n\n return { success: false };\n }\n\n // trace.getTracerProvider() returns a ProxyTracerProvider wrapper\n // Unwrap it to get the actual provider.\n const existingProvider =\n \"getDelegate\" in globalProvider &&\n typeof globalProvider.getDelegate === \"function\"\n ? globalProvider.getDelegate()\n : globalProvider;\n\n if (!existingProvider) {\n if (behaviour !== \"auto\") {\n console.warn(\n \"Existing OTel provider is not a BasicTracerProvider. Inngest's OTel middleware will not work, as it can only extend an existing processor if it's a BasicTracerProvider.\",\n );\n }\n\n return { success: false };\n }\n\n const processor = new InngestSpanProcessor();\n\n // OTel SDK v1 exposes addSpanProcessor() on BasicTracerProvider.\n if (\n \"addSpanProcessor\" in existingProvider &&\n typeof existingProvider.addSpanProcessor === \"function\"\n ) {\n existingProvider.addSpanProcessor(processor);\n return { success: true, processor };\n }\n\n // OTel SDK v2 removed addSpanProcessor() — span processors are constructor-only.\n // No public API exists to add processors post-construction (OTel issue #5299),\n // so push into the internal _spanProcessors array.\n // These fields are TypeScript `private` (not #private), so accessible at runtime.\n // TODO: Replace this internal mutation with a SpanProcessor delegator that is\n // installed when creating the provider and can dynamically delegate to\n // processors added later.\n const spanProcessors = getInternalSpanProcessors(existingProvider);\n if (spanProcessors) {\n spanProcessors.push(processor);\n return { success: true, processor };\n }\n\n if (behaviour !== \"auto\") {\n console.warn(\n \"Unable to add InngestSpanProcessor to existing OTel provider. \" +\n \"The provider does not support addSpanProcessor() (OTel SDK v1) \" +\n \"or expose _activeSpanProcessor._spanProcessors (OTel SDK v2).\",\n );\n }\n\n return { success: false };\n};\n\n/**\n * Extract the internal span processors array from a BasicTracerProvider.\n * Returns the mutable array if accessible, undefined otherwise.\n *\n * BasicTracerProvider._activeSpanProcessor is a MultiSpanProcessor,\n * which holds a _spanProcessors: SpanProcessor[] array.\n * Both are TypeScript `private` (not ES #private), so accessible at runtime.\n *\n * Wrapped in try/catch because this accesses internal OTel fields that may\n * change — must never crash the host app.\n */\nfunction getInternalSpanProcessors(provider: unknown): unknown[] | undefined {\n try {\n const active = (provider as Record<string, unknown>)?._activeSpanProcessor;\n if (typeof active !== \"object\" || active === null) return undefined;\n\n const arr = (active as Record<string, unknown>)._spanProcessors;\n return Array.isArray(arr) ? arr : undefined;\n } catch {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;AAOA,MAAMA,6BAAc,GAAGC,2BAAY,iBAAiB;AAKpD,MAAa,iBAAiB,OAC5B,YACA,mBAAiD,EAAE,KAIhD;AACH,KAAI;EAEF,MAAM,YAAY,IAAIC,wCAAsB;EAE5C,MAAM,IAAI,IAAIC,mDAAoB,EAChC,gBAAgB,CAAC,UAAU,EAC5B,CAAC;EAOF,MAAM,EAAE,gCAAgC,MAAM,OAC5C;EAEF,MAAM,EAAE,6BAA6B,M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AA0B,UAA0C;AAC3E,KAAI;EACF,MAAM,SAAU,UAAsC;AACtD,MAAI,OAAO,WAAW,YAAY,WAAW,KAAM,QAAO;EAE1D,MAAM,MAAO,OAAmC;AAChD,SAAO,MAAM,QAAQ,IAAI,GAAG,MAAM;SAC5B;AACN"}
|
|
@@ -33,6 +33,13 @@ const createProvider = async (_behaviour, instrumentations = []) => {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
+
function warnDeprecatedCreateProviderBehaviour(behaviour) {
|
|
37
|
+
if (behaviour === "auto") {
|
|
38
|
+
console.warn("`extendedTracesMiddleware()` falling back to creating an OpenTelemetry provider is deprecated. Use @inngest/otel instead.");
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
console.warn("`extendedTracesMiddleware({ behaviour: \"createProvider\" })` is deprecated. Use @inngest/otel instead.");
|
|
42
|
+
}
|
|
36
43
|
/**
|
|
37
44
|
* Attempts to extend the existing OTel provider with our processor. Returns true
|
|
38
45
|
* if the provider was extended, false if it was not.
|
|
@@ -40,7 +47,7 @@ const createProvider = async (_behaviour, instrumentations = []) => {
|
|
|
40
47
|
const extendProvider = (behaviour) => {
|
|
41
48
|
const globalProvider = trace.getTracerProvider();
|
|
42
49
|
if (!globalProvider) {
|
|
43
|
-
if (behaviour !== "auto") console.warn("No existing OTel provider found and behaviour is \"extendProvider\". Inngest's OTel middleware will not work.
|
|
50
|
+
if (behaviour !== "auto") console.warn("No existing OTel provider found and behaviour is \"extendProvider\". Inngest's OTel middleware will not work. Use @inngest/otel instead, or make sure that the provider is created and imported before the middleware is used.");
|
|
44
51
|
return { success: false };
|
|
45
52
|
}
|
|
46
53
|
const existingProvider = "getDelegate" in globalProvider && typeof globalProvider.getDelegate === "function" ? globalProvider.getDelegate() : globalProvider;
|
|
@@ -90,5 +97,5 @@ function getInternalSpanProcessors(provider) {
|
|
|
90
97
|
}
|
|
91
98
|
|
|
92
99
|
//#endregion
|
|
93
|
-
export { createProvider, extendProvider };
|
|
100
|
+
export { createProvider, extendProvider, warnDeprecatedCreateProviderBehaviour };
|
|
94
101
|
//# sourceMappingURL=util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","names":[],"sources":["../../../../src/components/execution/otel/util.ts"],"sourcesContent":["import { context, trace } from \"@opentelemetry/api\";\nimport type { Instrumentation } from \"@opentelemetry/instrumentation\";\nimport { BasicTracerProvider } from \"@opentelemetry/sdk-trace-base\";\nimport Debug from \"debug\";\nimport { debugPrefix } from \"./consts.ts\";\nimport { InngestSpanProcessor } from \"./processor.ts\";\n\nconst debug = Debug(`${debugPrefix}:createProvider`);\n\nexport type Behaviour = \"createProvider\" | \"extendProvider\" | \"off\" | \"auto\";\nexport type Instrumentations = (Instrumentation | Instrumentation[])[];\n\nexport const createProvider = async (\n _behaviour: Behaviour,\n instrumentations: Instrumentations | undefined = [],\n): Promise<\n | { success: true; processor: InngestSpanProcessor }\n | { success: false; error?: unknown }\n> => {\n try {\n // TODO Check if there's an existing provider\n const processor = new InngestSpanProcessor();\n\n const p = new BasicTracerProvider({\n spanProcessors: [processor],\n });\n\n // Dynamic imports to avoid loading the full auto-instrumentation suite at\n // module evaluation time. These are only needed when creating a new provider,\n // not when extending an existing one. Static imports here caused version\n // conflicts with host app OTel setups (e.g. Sentry) and silently broke\n // inngest.send(). See #1324.\n const { getNodeAutoInstrumentations } = await import(\n \"@opentelemetry/auto-instrumentations-node\"\n );\n const { registerInstrumentations } = await import(\n \"@opentelemetry/instrumentation\"\n );\n const { AnthropicInstrumentation } = await import(\n \"@traceloop/instrumentation-anthropic\"\n );\n const { AsyncHooksContextManager } = await import(\n \"@opentelemetry/context-async-hooks\"\n );\n\n const instrList: Instrumentations = [\n ...instrumentations,\n ...getNodeAutoInstrumentations(),\n new AnthropicInstrumentation(),\n ];\n\n registerInstrumentations({\n instrumentations: instrList,\n });\n\n trace.setGlobalTracerProvider(p);\n context.setGlobalContextManager(new AsyncHooksContextManager().enable());\n\n return { success: true, processor };\n } catch (err) {\n debug(\"failed to create provider:\", err);\n return { success: false, error: err };\n }\n};\n\n/**\n * Attempts to extend the existing OTel provider with our processor. Returns true\n * if the provider was extended, false if it was not.\n */\nexport const extendProvider = (\n behaviour: Behaviour,\n): { success: true; processor: InngestSpanProcessor } | { success: false } => {\n // Attempt to add our processor and export to the existing provider\n const globalProvider = trace.getTracerProvider();\n if (!globalProvider) {\n if (behaviour !== \"auto\") {\n console.warn(\n 'No existing OTel provider found and behaviour is \"extendProvider\". Inngest\\'s OTel middleware will not work.
|
|
1
|
+
{"version":3,"file":"util.js","names":[],"sources":["../../../../src/components/execution/otel/util.ts"],"sourcesContent":["import { context, trace } from \"@opentelemetry/api\";\nimport type { Instrumentation } from \"@opentelemetry/instrumentation\";\nimport { BasicTracerProvider } from \"@opentelemetry/sdk-trace-base\";\nimport Debug from \"debug\";\nimport { debugPrefix } from \"./consts.ts\";\nimport { InngestSpanProcessor } from \"./processor.ts\";\n\nconst debug = Debug(`${debugPrefix}:createProvider`);\n\nexport type Behaviour = \"createProvider\" | \"extendProvider\" | \"off\" | \"auto\";\nexport type Instrumentations = (Instrumentation | Instrumentation[])[];\n\nexport const createProvider = async (\n _behaviour: Behaviour,\n instrumentations: Instrumentations | undefined = [],\n): Promise<\n | { success: true; processor: InngestSpanProcessor }\n | { success: false; error?: unknown }\n> => {\n try {\n // TODO Check if there's an existing provider\n const processor = new InngestSpanProcessor();\n\n const p = new BasicTracerProvider({\n spanProcessors: [processor],\n });\n\n // Dynamic imports to avoid loading the full auto-instrumentation suite at\n // module evaluation time. These are only needed when creating a new provider,\n // not when extending an existing one. Static imports here caused version\n // conflicts with host app OTel setups (e.g. Sentry) and silently broke\n // inngest.send(). See #1324.\n const { getNodeAutoInstrumentations } = await import(\n \"@opentelemetry/auto-instrumentations-node\"\n );\n const { registerInstrumentations } = await import(\n \"@opentelemetry/instrumentation\"\n );\n const { AnthropicInstrumentation } = await import(\n \"@traceloop/instrumentation-anthropic\"\n );\n const { AsyncHooksContextManager } = await import(\n \"@opentelemetry/context-async-hooks\"\n );\n\n const instrList: Instrumentations = [\n ...instrumentations,\n ...getNodeAutoInstrumentations(),\n new AnthropicInstrumentation(),\n ];\n\n registerInstrumentations({\n instrumentations: instrList,\n });\n\n trace.setGlobalTracerProvider(p);\n context.setGlobalContextManager(new AsyncHooksContextManager().enable());\n\n return { success: true, processor };\n } catch (err) {\n debug(\"failed to create provider:\", err);\n return { success: false, error: err };\n }\n};\n\nexport function warnDeprecatedCreateProviderBehaviour(\n behaviour: Extract<Behaviour, \"auto\" | \"createProvider\">,\n): void {\n if (behaviour === \"auto\") {\n console.warn(\n \"`extendedTracesMiddleware()` falling back to creating an OpenTelemetry provider is deprecated. Use @inngest/otel instead.\",\n );\n return;\n }\n\n console.warn(\n '`extendedTracesMiddleware({ behaviour: \"createProvider\" })` is deprecated. Use @inngest/otel instead.',\n );\n}\n\n/**\n * Attempts to extend the existing OTel provider with our processor. Returns true\n * if the provider was extended, false if it was not.\n */\nexport const extendProvider = (\n behaviour: Behaviour,\n): { success: true; processor: InngestSpanProcessor } | { success: false } => {\n // Attempt to add our processor and export to the existing provider\n const globalProvider = trace.getTracerProvider();\n if (!globalProvider) {\n if (behaviour !== \"auto\") {\n console.warn(\n 'No existing OTel provider found and behaviour is \"extendProvider\". Inngest\\'s OTel middleware will not work. Use @inngest/otel instead, or make sure that the provider is created and imported before the middleware is used.',\n );\n }\n\n return { success: false };\n }\n\n // trace.getTracerProvider() returns a ProxyTracerProvider wrapper\n // Unwrap it to get the actual provider.\n const existingProvider =\n \"getDelegate\" in globalProvider &&\n typeof globalProvider.getDelegate === \"function\"\n ? globalProvider.getDelegate()\n : globalProvider;\n\n if (!existingProvider) {\n if (behaviour !== \"auto\") {\n console.warn(\n \"Existing OTel provider is not a BasicTracerProvider. Inngest's OTel middleware will not work, as it can only extend an existing processor if it's a BasicTracerProvider.\",\n );\n }\n\n return { success: false };\n }\n\n const processor = new InngestSpanProcessor();\n\n // OTel SDK v1 exposes addSpanProcessor() on BasicTracerProvider.\n if (\n \"addSpanProcessor\" in existingProvider &&\n typeof existingProvider.addSpanProcessor === \"function\"\n ) {\n existingProvider.addSpanProcessor(processor);\n return { success: true, processor };\n }\n\n // OTel SDK v2 removed addSpanProcessor() — span processors are constructor-only.\n // No public API exists to add processors post-construction (OTel issue #5299),\n // so push into the internal _spanProcessors array.\n // These fields are TypeScript `private` (not #private), so accessible at runtime.\n // TODO: Replace this internal mutation with a SpanProcessor delegator that is\n // installed when creating the provider and can dynamically delegate to\n // processors added later.\n const spanProcessors = getInternalSpanProcessors(existingProvider);\n if (spanProcessors) {\n spanProcessors.push(processor);\n return { success: true, processor };\n }\n\n if (behaviour !== \"auto\") {\n console.warn(\n \"Unable to add InngestSpanProcessor to existing OTel provider. \" +\n \"The provider does not support addSpanProcessor() (OTel SDK v1) \" +\n \"or expose _activeSpanProcessor._spanProcessors (OTel SDK v2).\",\n );\n }\n\n return { success: false };\n};\n\n/**\n * Extract the internal span processors array from a BasicTracerProvider.\n * Returns the mutable array if accessible, undefined otherwise.\n *\n * BasicTracerProvider._activeSpanProcessor is a MultiSpanProcessor,\n * which holds a _spanProcessors: SpanProcessor[] array.\n * Both are TypeScript `private` (not ES #private), so accessible at runtime.\n *\n * Wrapped in try/catch because this accesses internal OTel fields that may\n * change — must never crash the host app.\n */\nfunction getInternalSpanProcessors(provider: unknown): unknown[] | undefined {\n try {\n const active = (provider as Record<string, unknown>)?._activeSpanProcessor;\n if (typeof active !== \"object\" || active === null) return undefined;\n\n const arr = (active as Record<string, unknown>)._spanProcessors;\n return Array.isArray(arr) ? arr : undefined;\n } catch {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;AAOA,MAAM,QAAQ,MAAM,GAAG,YAAY,iBAAiB;AAKpD,MAAa,iBAAiB,OAC5B,YACA,mBAAiD,EAAE,KAIhD;AACH,KAAI;EAEF,MAAM,YAAY,IAAI,sBAAsB;EAE5C,MAAM,IAAI,IAAI,oBA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;AAGrC,KAAI,cAAc,OAChB,SAAQ,KACN,6LAGD;AAGH,QAAO,EAAE,SAAS,OAAO;;;;;;;;;;;;;AAc3B,SAAS,0BAA0B,UAA0C;AAC3E,KAAI;EACF,MAAM,SAAU,UAAsC;AACtD,MAAI,OAAO,WAAW,YAAY,WAAW,KAAM,QAAO;EAE1D,MAAM,MAAO,OAAmC;AAChD,SAAO,MAAM,QAAQ,IAAI,GAAG,MAAM;SAC5B;AACN"}
|
|
@@ -65,8 +65,8 @@ declare namespace Realtime {
|
|
|
65
65
|
kind: z.ZodEnum<["step", "run", "data", "ping", "pong", "closing", "event", "sub", "unsub", "datastream-start", "datastream-end", "chunk"]>;
|
|
66
66
|
}, "strip", z.ZodTypeAny, {
|
|
67
67
|
kind: "data" | "event" | "run" | "step" | "ping" | "pong" | "closing" | "sub" | "unsub" | "datastream-start" | "datastream-end" | "chunk";
|
|
68
|
-
channel?: string | undefined;
|
|
69
68
|
data?: any;
|
|
69
|
+
channel?: string | undefined;
|
|
70
70
|
topic?: string | undefined;
|
|
71
71
|
run_id?: string | undefined;
|
|
72
72
|
fn_id?: string | undefined;
|
|
@@ -75,8 +75,8 @@ declare namespace Realtime {
|
|
|
75
75
|
stream_id?: string | undefined;
|
|
76
76
|
}, {
|
|
77
77
|
kind: "data" | "event" | "run" | "step" | "ping" | "pong" | "closing" | "sub" | "unsub" | "datastream-start" | "datastream-end" | "chunk";
|
|
78
|
-
channel?: string | undefined;
|
|
79
78
|
data?: any;
|
|
79
|
+
channel?: string | undefined;
|
|
80
80
|
topic?: string | undefined;
|
|
81
81
|
run_id?: string | undefined;
|
|
82
82
|
fn_id?: string | undefined;
|
|
@@ -95,8 +95,8 @@ declare namespace Realtime {
|
|
|
95
95
|
stream_id?: string | undefined;
|
|
96
96
|
}, {
|
|
97
97
|
kind: "data" | "event" | "run" | "step" | "ping" | "pong" | "closing" | "sub" | "unsub" | "datastream-start" | "datastream-end" | "chunk";
|
|
98
|
-
channel?: string | undefined;
|
|
99
98
|
data?: any;
|
|
99
|
+
channel?: string | undefined;
|
|
100
100
|
topic?: string | undefined;
|
|
101
101
|
run_id?: string | undefined;
|
|
102
102
|
fn_id?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/components/realtime/types.ts"],"sourcesContent":[],"mappings":";;;;kBAGiB,QAAA;+BACqB,QAAA,CAAS;EAD9B,UAAA,SAAQ,CAAA;IAAA,UAAA,KAAA,CAAA,iBAKF,QAAA,CAAS,YALP,GAKsB,QAAA,CAAS,YAL/B,EAAA,gBAAA,MAAA,EAAA,GAAA,MAAA,EAAA,CAAA,CAAA;MACa,GAAA,CAAS,EAAA,MAAA,GAAA,SAAA;MAIxB,OAAS,EAKjB,QALiB;MAAe,MAAS,EAM1C,OAN0C;MAKzC,UAAA,CAAA,EAAA,MAAA;IACD;IAUR,UAAA,WAAA,CAAA;MAAe,GAAA,EAAS,MAAA;MACI,UAAA,CAAA,EAAA,MAAA;IAAxB;IAKoB,KAAA,uBAAA,CAAA,MAAA,CAAA,GANxB,MAMwB,SANT,QAAA,CAAS,WAMA,GALpB,QAAA,CAAS,cAKW,CALI,MAKJ,CAAA,GAAA,GAAA;IAAQ,KAAA,kBAAA,CAAA,wBAAR,KAAQ,GAAA,KAAA,EAAA,cAClB,QADkB,CACT,KAAA,CAAM,YADG,CACU,eADV,CAAA,CAAA,GAC8B,QAD9B,CAE9B,KAAA,CAAM,YAFwB,CAEX,eAFW,CAAA,CAAA,CAAA,GAI9B,cAJ8B,CAIf,KAJe,CAAA,GAAA;MACU;;;;;;MAGzB,aAAA,EAAA,EAOA,cAPA,CAOe,KAPf,CAAA;MAAf;;;;;;;;MAgCU,gBAAM,EAAA,EAfE,cAeF,CAfiB,UAejB,CAAA;MAAkC;;;MAQY,KAAA,CAAA,MAAA,CAAA,EAAA,MAAA,CAAA,EAAA,IAAA;MAK5D;;;MAKqB,WAAA,CAAA,MAAA,CAAA,EAAA,MAA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AAA,EAAA,gBArDd,YAqDc,GArDC,YAqDD,CAAA,GAAA,CAAA,CAAA,GAAA,IAAA,EAnDrB,UAmDqB,CAnDV,OAmDU,CAAA,EAAA,GAlD3B,eAkD2B,CAlDX,UAkDW,CAlDA,OAkDA,CAAA,EAlDU,OAkDV,CAAA,CAAA,GAAA;IAAO,MAAA,EAjD7B,OAiD6B;IAE7B,OAAQ,EAlDP,UAkDO,CAlDI,OAkDJ,CAAA,CAAA,CAAA,CAAA;EAAA,CAAA;OAA0B,cAAA,GAAA,CAAA,KAAA,CAAA,CAAA,QAAA,EA5ChC,QA4CgC,CA5CvB,KA4CuB,CAAA,EAAA,IAAA,EA3CpC,KA2CoC,EAAA,GA1CvC,OA0CuC,CAAA,IAAA,CAAA;;;;;KAFlC,kBAAkB,IAAI,QAAQ;KAE9B,kCAAkC,IAAI,EAAE"}
|
|
@@ -65,8 +65,8 @@ declare namespace Realtime {
|
|
|
65
65
|
kind: z.ZodEnum<["step", "run", "data", "ping", "pong", "closing", "event", "sub", "unsub", "datastream-start", "datastream-end", "chunk"]>;
|
|
66
66
|
}, "strip", z.ZodTypeAny, {
|
|
67
67
|
kind: "data" | "event" | "run" | "step" | "ping" | "pong" | "closing" | "sub" | "unsub" | "datastream-start" | "datastream-end" | "chunk";
|
|
68
|
-
channel?: string | undefined;
|
|
69
68
|
data?: any;
|
|
69
|
+
channel?: string | undefined;
|
|
70
70
|
topic?: string | undefined;
|
|
71
71
|
run_id?: string | undefined;
|
|
72
72
|
fn_id?: string | undefined;
|
|
@@ -75,8 +75,8 @@ declare namespace Realtime {
|
|
|
75
75
|
stream_id?: string | undefined;
|
|
76
76
|
}, {
|
|
77
77
|
kind: "data" | "event" | "run" | "step" | "ping" | "pong" | "closing" | "sub" | "unsub" | "datastream-start" | "datastream-end" | "chunk";
|
|
78
|
-
channel?: string | undefined;
|
|
79
78
|
data?: any;
|
|
79
|
+
channel?: string | undefined;
|
|
80
80
|
topic?: string | undefined;
|
|
81
81
|
run_id?: string | undefined;
|
|
82
82
|
fn_id?: string | undefined;
|
|
@@ -95,8 +95,8 @@ declare namespace Realtime {
|
|
|
95
95
|
stream_id?: string | undefined;
|
|
96
96
|
}, {
|
|
97
97
|
kind: "data" | "event" | "run" | "step" | "ping" | "pong" | "closing" | "sub" | "unsub" | "datastream-start" | "datastream-end" | "chunk";
|
|
98
|
-
channel?: string | undefined;
|
|
99
98
|
data?: any;
|
|
99
|
+
channel?: string | undefined;
|
|
100
100
|
topic?: string | undefined;
|
|
101
101
|
run_id?: string | undefined;
|
|
102
102
|
fn_id?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/components/realtime/types.ts"],"sourcesContent":[],"mappings":";;;;kBAGiB,QAAA;+BACqB,QAAA,CAAS;EAD9B,UAAA,SAAQ,CAAA;IAAA,UAAA,KAAA,CAAA,iBAKF,QAAA,CAAS,YALP,GAKsB,QAAA,CAAS,YAL/B,EAAA,gBAAA,MAAA,EAAA,GAAA,MAAA,EAAA,CAAA,CAAA;MACa,GAAA,CAAS,EAAA,MAAA,GAAA,SAAA;MAIxB,OAAS,EAKjB,QALiB;MAAe,MAAS,EAM1C,OAN0C;MAKzC,UAAA,CAAA,EAAA,MAAA;IACD;IAUR,UAAA,WAAA,CAAA;MAAe,GAAA,EAAS,MAAA;MACI,UAAA,CAAA,EAAA,MAAA;IAAxB;IAKoB,KAAA,uBAAA,CAAA,MAAA,CAAA,GANxB,MAMwB,SANT,QAAA,CAAS,WAMA,GALpB,QAAA,CAAS,cAKW,CALI,MAKJ,CAAA,GAAA,GAAA;IAAQ,KAAA,kBAAA,CAAA,wBAAR,KAAQ,GAAA,KAAA,EAAA,cAClB,QADkB,CACT,KAAA,CAAM,YADG,CACU,eADV,CAAA,CAAA,GAC8B,QAD9B,CAE9B,KAAA,CAAM,YAFwB,CAEX,eAFW,CAAA,CAAA,CAAA,GAI9B,cAJ8B,CAIf,KAJe,CAAA,GAAA;M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A,IAAA,EA5Dd,KA4Dc;IAAM,MAAA,EA3DlB,OA2DkB;MA1DxB,cA0DoC,CA1DrB,KA0DqB,EA1Dd,OA0Dc,CAAA;OAAR,UAAA,CAAA,gBAAA,CAAA,GAAA,IAAA,EAAA,GAAA,EAAA,EAAA,GAAA,MAAA,GAAA,CAAA,GAAA,IAAA,EAAA,GAAA,EAAA,EAAA,GAAA,MAAA,EAAA,gBArDd,YAqDc,GArDC,YAqDD,CAAA,GAAA,CAAA,CAAA,GAAA,IAAA,EAnDrB,UAmDqB,CAnDV,OAmDU,CAAA,EAAA,GAlD3B,eAkD2B,CAlDX,UAkDW,CAlDA,OAkDA,CAAA,EAlDU,OAkDV,CAAA,CAAA,GAAA;IAAO,MAAA,EAjD7B,OAiD6B;IAE7B,OAAQ,EAlDP,UAkDO,CAlDI,OAkDJ,CAAA,CAAA,CAAA,CAAA;EAAA,CAAA;OAA0B,cAAA,GAAA,CAAA,KAAA,CAAA,CAAA,QAAA,EA5ChC,QA4CgC,CA5CvB,KA4CuB,CAAA,EAAA,IAAA,EA3CpC,KA2CoC,EAAA,GA1CvC,OA0CuC,CAAA,IAAA,CAAA;;;;;KAFlC,kBAAkB,IAAI,QAAQ;KAE9B,kCAAkC,IAAI,EAAE"}
|
package/experimental.cjs
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
const require_als = require('./components/execution/als.cjs');
|
|
2
2
|
const require_InngestMetadata = require('./components/InngestMetadata.cjs');
|
|
3
|
+
const require_InngestScore = require('./components/InngestScore.cjs');
|
|
3
4
|
const require_DeferredFunction = require('./components/DeferredFunction.cjs');
|
|
4
5
|
const require_processor = require('./components/execution/otel/processor.cjs');
|
|
5
6
|
const require_middleware = require('./components/execution/otel/middleware.cjs');
|
|
7
|
+
const require_ScoreFunction = require('./components/ScoreFunction.cjs');
|
|
6
8
|
|
|
7
9
|
exports.DeferredFunction = require_DeferredFunction.DeferredFunction;
|
|
8
10
|
exports.InngestSpanProcessor = require_processor.PublicInngestSpanProcessor;
|
|
9
11
|
exports.createDefer = require_DeferredFunction.createDefer;
|
|
12
|
+
exports.createScorer = require_ScoreFunction.createScorer;
|
|
10
13
|
exports.extendedTracesMiddleware = require_middleware.extendedTracesMiddleware;
|
|
11
14
|
exports.getAsyncCtx = require_als.getAsyncCtx;
|
|
12
|
-
exports.metadataMiddleware = require_InngestMetadata.metadataMiddleware;
|
|
15
|
+
exports.metadataMiddleware = require_InngestMetadata.metadataMiddleware;
|
|
16
|
+
exports.scoreMiddleware = require_InngestScore.scoreMiddleware;
|
package/experimental.d.cts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AsyncContext, getAsyncCtx } from "./components/execution/als.cjs";
|
|
2
2
|
import { metadataMiddleware } from "./components/InngestMetadata.cjs";
|
|
3
|
+
import { scoreMiddleware } from "./components/InngestScore.cjs";
|
|
3
4
|
import { DeferredFunction, createDefer } from "./components/DeferredFunction.cjs";
|
|
5
|
+
import { ExperimentRef } from "./types.cjs";
|
|
4
6
|
import { PublicInngestSpanProcessor } from "./components/execution/otel/processor.cjs";
|
|
5
7
|
import { ExtendedTracesMiddlewareOptions, extendedTracesMiddleware } from "./components/execution/otel/middleware.cjs";
|
|
6
|
-
|
|
8
|
+
import { createScorer } from "./components/ScoreFunction.cjs";
|
|
9
|
+
export { type AsyncContext, DeferredFunction, type ExperimentRef, type ExtendedTracesMiddlewareOptions, PublicInngestSpanProcessor as InngestSpanProcessor, createDefer, createScorer, extendedTracesMiddleware, getAsyncCtx, metadataMiddleware, scoreMiddleware };
|
package/experimental.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AsyncContext, getAsyncCtx } from "./components/execution/als.js";
|
|
2
2
|
import { metadataMiddleware } from "./components/InngestMetadata.js";
|
|
3
|
+
import { scoreMiddleware } from "./components/InngestScore.js";
|
|
3
4
|
import { DeferredFunction, createDefer } from "./components/DeferredFunction.js";
|
|
5
|
+
import { ExperimentRef } from "./types.js";
|
|
4
6
|
import { PublicInngestSpanProcessor } from "./components/execution/otel/processor.js";
|
|
5
7
|
import { ExtendedTracesMiddlewareOptions, extendedTracesMiddleware } from "./components/execution/otel/middleware.js";
|
|
6
|
-
|
|
8
|
+
import { createScorer } from "./components/ScoreFunction.js";
|
|
9
|
+
export { type AsyncContext, DeferredFunction, type ExperimentRef, type ExtendedTracesMiddlewareOptions, PublicInngestSpanProcessor as InngestSpanProcessor, createDefer, createScorer, extendedTracesMiddleware, getAsyncCtx, metadataMiddleware, scoreMiddleware };
|
package/experimental.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { getAsyncCtx } from "./components/execution/als.js";
|
|
2
2
|
import { metadataMiddleware } from "./components/InngestMetadata.js";
|
|
3
|
+
import { scoreMiddleware } from "./components/InngestScore.js";
|
|
3
4
|
import { DeferredFunction, createDefer } from "./components/DeferredFunction.js";
|
|
4
5
|
import { PublicInngestSpanProcessor } from "./components/execution/otel/processor.js";
|
|
5
6
|
import { extendedTracesMiddleware } from "./components/execution/otel/middleware.js";
|
|
7
|
+
import { createScorer } from "./components/ScoreFunction.js";
|
|
6
8
|
|
|
7
|
-
export { DeferredFunction, PublicInngestSpanProcessor as InngestSpanProcessor, createDefer, extendedTracesMiddleware, getAsyncCtx, metadataMiddleware };
|
|
9
|
+
export { DeferredFunction, PublicInngestSpanProcessor as InngestSpanProcessor, createDefer, createScorer, extendedTracesMiddleware, getAsyncCtx, metadataMiddleware, scoreMiddleware };
|
package/helpers/consts.cjs
CHANGED
|
@@ -211,6 +211,12 @@ let internalEvents = /* @__PURE__ */ function(internalEvents$1) {
|
|
|
211
211
|
internalEvents$1["DeferredSchedule"] = "inngest/deferred.schedule";
|
|
212
212
|
return internalEvents$1;
|
|
213
213
|
}({});
|
|
214
|
+
/**
|
|
215
|
+
* Reserved input key that carries the `defer(id, { experiment })` ref to the
|
|
216
|
+
* deferred run; the receiver strips it before the handler or schema validation
|
|
217
|
+
* see the data.
|
|
218
|
+
*/
|
|
219
|
+
const deferExperimentKey = "_inngestExperiment";
|
|
214
220
|
const logPrefix = "[Inngest]";
|
|
215
221
|
const debugPrefix = "inngest";
|
|
216
222
|
const dummyEventKey = "NO_EVENT_KEY_SET";
|
|
@@ -253,6 +259,7 @@ exports.defaultDevServerHost = defaultDevServerHost;
|
|
|
253
259
|
exports.defaultInngestApiBaseUrl = defaultInngestApiBaseUrl;
|
|
254
260
|
exports.defaultInngestEventBaseUrl = defaultInngestEventBaseUrl;
|
|
255
261
|
exports.defaultMaxRetries = defaultMaxRetries;
|
|
262
|
+
exports.deferExperimentKey = deferExperimentKey;
|
|
256
263
|
exports.dummyEventKey = dummyEventKey;
|
|
257
264
|
exports.envKeys = envKeys;
|
|
258
265
|
exports.forwardedHeaders = forwardedHeaders;
|
package/helpers/consts.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.cjs","names":["logPrefix: string"],"sources":["../../src/helpers/consts.ts"],"sourcesContent":["/**\n * Keys for accessing query parameters included in requests from Inngest to run\n * functions.\n *\n * Used internally to create handlers using `InngestCommHandler`, but can be\n * imported to be used if creating a custom handler outside of the package.\n *\n * @public\n */\nexport enum queryKeys {\n DeployId = \"deployId\",\n FnId = \"fnId\",\n Probe = \"probe\",\n StepId = \"stepId\",\n}\n\nexport enum probe {\n Trust = \"trust\",\n}\n\nexport enum envKeys {\n InngestSigningKey = \"INNGEST_SIGNING_KEY\",\n InngestSigningKeyFallback = \"INNGEST_SIGNING_KEY_FALLBACK\",\n InngestEventKey = \"INNGEST_EVENT_KEY\",\n\n /**\n * @deprecated Removed in v3. Use {@link InngestBaseUrl} instead.\n */\n InngestDevServerUrl = \"INNGEST_DEVSERVER_URL\",\n InngestEnvironment = \"INNGEST_ENV\",\n InngestBaseUrl = \"INNGEST_BASE_URL\",\n InngestEventApiBaseUrl = \"INNGEST_EVENT_API_BASE_URL\",\n InngestApiBaseUrl = \"INNGEST_API_BASE_URL\",\n InngestServeHost = \"INNGEST_SERVE_HOST\", // Deprecated, use INNGEST_SERVE_ORIGIN\n InngestServePath = \"INNGEST_SERVE_PATH\",\n InngestServeOrigin = \"INNGEST_SERVE_ORIGIN\",\n InngestStreaming = \"INNGEST_STREAMING\",\n InngestDevMode = \"INNGEST_DEV\",\n InngestAllowInBandSync = \"INNGEST_ALLOW_IN_BAND_SYNC\",\n InngestEnableUnauthedSync = \"INNGEST_ENABLE_UNAUTHED_SYNC\",\n InngestConnectMaxWorkerConcurrency = \"INNGEST_CONNECT_MAX_WORKER_CONCURRENCY\",\n InngestConnectIsolateExecution = \"INNGEST_CONNECT_ISOLATE_EXECUTION\",\n InngestConnectGatewayUrl = \"INNGEST_CONNECT_GATEWAY_URL\",\n\n /**\n * @deprecated It's unknown what this env var was used for, but we do not\n * provide explicit support for it. Prefer using `INNGEST_ENV` instead.\n */\n BranchName = \"BRANCH_NAME\",\n\n /**\n * The git branch of the commit the deployment was triggered by. Example:\n * `improve-about-page`.\n *\n * {@link https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables}\n */\n VercelBranch = \"VERCEL_GIT_COMMIT_REF\",\n\n /**\n * Expected to be `\"1\"` if defined.\n */\n IsVercel = \"VERCEL\",\n\n /**\n * The branch name of the current deployment. May only be accessible at build\n * time, but included here just in case.\n *\n * {@link https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables}\n */\n CloudflarePagesBranch = \"CF_PAGES_BRANCH\",\n\n /**\n * Expected to be `\"1\"` if defined.\n */\n IsCloudflarePages = \"CF_PAGES\",\n\n /**\n * The branch name of the deployment from Git to Netlify, if available.\n *\n * {@link https://docs.netlify.com/configure-builds/environment-variables/#git-metadata}\n */\n NetlifyBranch = \"BRANCH\",\n\n /**\n * Expected to be `\"true\"` if defined.\n */\n IsNetlify = \"NETLIFY\",\n\n /**\n * The Git branch for a service or deploy.\n *\n * {@link https://render.com/docs/environment-variables#all-services}\n */\n RenderBranch = \"RENDER_GIT_BRANCH\",\n\n /**\n * Expected to be `\"true\"` if defined.\n */\n IsRender = \"RENDER\",\n\n /**\n * The branch that triggered the deployment. Example: `main`\n *\n * {@link https://docs.railway.app/develop/variables#railway-provided-variables}\n */\n RailwayBranch = \"RAILWAY_GIT_BRANCH\",\n\n /**\n * The railway environment for the deployment. Example: `production`\n *\n * {@link https://docs.railway.app/develop/variables#railway-provided-variables}\n */\n RailwayEnvironment = \"RAILWAY_ENVIRONMENT\",\n\n VercelEnvKey = \"VERCEL_ENV\",\n\n /**\n * Standard Node.js environment indicator (e.g. `\"production\"`, `\"development\"`,\n * `\"test\"`). Read by some framework adapters to choose the request scheme,\n * and by prod-mode inference.\n */\n NodeEnv = \"NODE_ENV\",\n\n /**\n * Netlify's deploy context (e.g. `\"production\"`, `\"deploy-preview\"`). Used\n * for prod-mode inference.\n *\n * {@link https://docs.netlify.com/configure-builds/environment-variables/#build-metadata}\n */\n Context = \"CONTEXT\",\n\n /**\n * Generic environment name used by some platforms to indicate prod vs\n * non-prod (e.g. `\"production\"`).\n */\n Environment = \"ENVIRONMENT\",\n\n /**\n * Set by Deno Deploy. Its presence indicates a Deno Deploy environment,\n * which we treat as prod.\n *\n * {@link https://docs.deno.com/deploy/manual/environment-variables/}\n */\n DenoDeployment = \"DENO_DEPLOYMENT_ID\",\n\n OpenAiApiKey = \"OPENAI_API_KEY\",\n GeminiApiKey = \"GEMINI_API_KEY\",\n AnthropicApiKey = \"ANTHROPIC_API_KEY\",\n\n /**\n * Framework-prefixed variants of Inngest env vars. CRA's `REACT_APP_` and\n * Next's `NEXT_PUBLIC_` prefixes expose env vars to bundled client code, so\n * we accept the prefixed forms in addition to the canonical names.\n */\n ReactAppInngestBaseUrl = \"REACT_APP_INNGEST_BASE_URL\",\n ReactAppInngestDevMode = \"REACT_APP_INNGEST_DEV\",\n NextPublicInngestBaseUrl = \"NEXT_PUBLIC_INNGEST_BASE_URL\",\n NextPublicInngestDevMode = \"NEXT_PUBLIC_INNGEST_DEV\",\n}\n\n/**\n * Keys for accessing headers included in requests from Inngest to run\n * functions.\n *\n * Used internally to create handlers using `InngestCommHandler`, but can be\n * imported to be used if creating a custom handler outside of the package.\n *\n * @public\n */\nexport enum headerKeys {\n ContentType = \"content-type\",\n Host = \"host\",\n ForwardedFor = \"x-forwarded-for\",\n RealIp = \"x-real-ip\",\n Location = \"location\",\n ContentLength = \"content-length\",\n Signature = \"x-inngest-signature\",\n SdkVersion = \"x-inngest-sdk\",\n Environment = \"x-inngest-env\",\n Platform = \"x-inngest-platform\",\n Framework = \"x-inngest-framework\",\n NoRetry = \"x-inngest-no-retry\",\n RequestId = \"x-request-id\",\n GenerationId = \"x-inngest-generation-id\",\n InngestJobId = \"x-inngest-job-id\",\n RequestVersion = \"x-inngest-req-version\",\n RetryAfter = \"retry-after\",\n InngestServerKind = \"x-inngest-server-kind\",\n InngestExpectedServerKind = \"x-inngest-expected-server-kind\",\n InngestSyncKind = \"x-inngest-sync-kind\",\n EventIdSeed = \"x-inngest-event-id-seed\",\n TraceParent = \"traceparent\",\n TraceState = \"tracestate\",\n InngestRunId = \"x-run-id\",\n InngestStepId = \"x-inngest-step-id\",\n InngestForceStepPlan = \"x-inngest-force-step-plan\",\n SdkHandled = \"x-inngest-sdk-handled\",\n}\n\n/**\n * Headers that are forwarded from the original request when an Inngest function\n * is invoked.\n */\nexport const forwardedHeaders = [headerKeys.TraceParent, headerKeys.TraceState];\n\nexport const defaultInngestApiBaseUrl = \"https://api.inngest.com/\";\nexport const defaultInngestEventBaseUrl = \"https://inn.gs/\";\nexport const defaultDevServerHost = \"http://localhost:8288/\";\n\n/**\n * Events that Inngest may send internally that can be used to trigger\n * functions.\n *\n * @public\n */\nexport enum internalEvents {\n /**\n * A function has failed after exhausting all available retries. This event\n * will contain the original event and the error that caused the failure.\n */\n FunctionFailed = \"inngest/function.failed\",\n FunctionInvoked = \"inngest/function.invoked\",\n FunctionFinished = \"inngest/function.finished\",\n FunctionCancelled = \"inngest/function.cancelled\",\n ScheduledTimer = \"inngest/scheduled.timer\",\n HttpRequest = \"inngest/http.request\",\n\n /**\n * Triggers a deferred function. The backend emits this.\n */\n DeferredSchedule = \"inngest/deferred.schedule\",\n}\n\nexport const logPrefix: string = \"[Inngest]\";\n\nexport const debugPrefix = \"inngest\";\n\nexport const dummyEventKey = \"NO_EVENT_KEY_SET\";\n\nexport enum serverKind {\n Dev = \"dev\",\n Cloud = \"cloud\",\n}\n\nexport enum syncKind {\n InBand = \"in_band\",\n OutOfBand = \"out_of_band\",\n}\n\n/**\n * The execution models the SDK is aware of.\n *\n * This is used in a number of places to ensure all execution versions are\n * accounted for for a given operation.\n */\nexport enum ExecutionVersion {\n /**\n * Uses a more flexible approach to execution and is more lenient about\n * determinism, allowing non-step async actions and non-determinism.\n *\n * Nowhere near as stubborn about determinism and so can silently migrate\n * between versions after bug fixes.\n */\n V1 = 1,\n\n /**\n * Identical to V1, but allows the Executor to optimize parallel calls, hugely\n * reducing traffic going to/from the SDK.\n */\n V2 = 2,\n}\n\n/**\n * Default maximum number of retries for function/step executions.\n */\nexport const defaultMaxRetries = 3;\n"],"mappings":";;;;;;;;;;;AASA,IAAY,kDAAL;AACL;AACA;AACA;AACA;;;AAGF,IAAY,0CAAL;AACL;;;AAGF,IAAY,8CAAL;AACL;AACA;AACA;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AAMA;;;;;;;AAQA;;;;AAKA;;;;;;;AAQA;;;;AAKA;;;;;;AAOA;;;;AAKA;;;;;;AAOA;;;;AAKA;;;;;;AAOA;;;;;;AAOA;AAEA;;;;;;AAOA;;;;;;;AAQA;;;;;AAMA;;;;;;;AAQA;AAEA;AACA;AACA;;;;;;AAOA;AACA;AACA;AACA;;;;;;;;;;;;AAYF,IAAY,oDAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAOF,MAAa,mBAAmB,CAAC,WAAW,aAAa,WAAW,WAAW;AAE/E,MAAa,2BAA2B;AACxC,MAAa,6BAA6B;AAC1C,MAAa,uBAAuB;;;;;;;AAQpC,IAAY,4DAAL;;;;;AAKL;AACA;AACA;AACA;AACA;AACA;;;;AAKA
|
|
1
|
+
{"version":3,"file":"consts.cjs","names":["logPrefix: string"],"sources":["../../src/helpers/consts.ts"],"sourcesContent":["/**\n * Keys for accessing query parameters included in requests from Inngest to run\n * functions.\n *\n * Used internally to create handlers using `InngestCommHandler`, but can be\n * imported to be used if creating a custom handler outside of the package.\n *\n * @public\n */\nexport enum queryKeys {\n DeployId = \"deployId\",\n FnId = \"fnId\",\n Probe = \"probe\",\n StepId = \"stepId\",\n}\n\nexport enum probe {\n Trust = \"trust\",\n}\n\nexport enum envKeys {\n InngestSigningKey = \"INNGEST_SIGNING_KEY\",\n InngestSigningKeyFallback = \"INNGEST_SIGNING_KEY_FALLBACK\",\n InngestEventKey = \"INNGEST_EVENT_KEY\",\n\n /**\n * @deprecated Removed in v3. Use {@link InngestBaseUrl} instead.\n */\n InngestDevServerUrl = \"INNGEST_DEVSERVER_URL\",\n InngestEnvironment = \"INNGEST_ENV\",\n InngestBaseUrl = \"INNGEST_BASE_URL\",\n InngestEventApiBaseUrl = \"INNGEST_EVENT_API_BASE_URL\",\n InngestApiBaseUrl = \"INNGEST_API_BASE_URL\",\n InngestServeHost = \"INNGEST_SERVE_HOST\", // Deprecated, use INNGEST_SERVE_ORIGIN\n InngestServePath = \"INNGEST_SERVE_PATH\",\n InngestServeOrigin = \"INNGEST_SERVE_ORIGIN\",\n InngestStreaming = \"INNGEST_STREAMING\",\n InngestDevMode = \"INNGEST_DEV\",\n InngestAllowInBandSync = \"INNGEST_ALLOW_IN_BAND_SYNC\",\n InngestEnableUnauthedSync = \"INNGEST_ENABLE_UNAUTHED_SYNC\",\n InngestConnectMaxWorkerConcurrency = \"INNGEST_CONNECT_MAX_WORKER_CONCURRENCY\",\n InngestConnectIsolateExecution = \"INNGEST_CONNECT_ISOLATE_EXECUTION\",\n InngestConnectGatewayUrl = \"INNGEST_CONNECT_GATEWAY_URL\",\n\n /**\n * @deprecated It's unknown what this env var was used for, but we do not\n * provide explicit support for it. Prefer using `INNGEST_ENV` instead.\n */\n BranchName = \"BRANCH_NAME\",\n\n /**\n * The git branch of the commit the deployment was triggered by. Example:\n * `improve-about-page`.\n *\n * {@link https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables}\n */\n VercelBranch = \"VERCEL_GIT_COMMIT_REF\",\n\n /**\n * Expected to be `\"1\"` if defined.\n */\n IsVercel = \"VERCEL\",\n\n /**\n * The branch name of the current deployment. May only be accessible at build\n * time, but included here just in case.\n *\n * {@link https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables}\n */\n CloudflarePagesBranch = \"CF_PAGES_BRANCH\",\n\n /**\n * Expected to be `\"1\"` if defined.\n */\n IsCloudflarePages = \"CF_PAGES\",\n\n /**\n * The branch name of the deployment from Git to Netlify, if available.\n *\n * {@link https://docs.netlify.com/configure-builds/environment-variables/#git-metadata}\n */\n NetlifyBranch = \"BRANCH\",\n\n /**\n * Expected to be `\"true\"` if defined.\n */\n IsNetlify = \"NETLIFY\",\n\n /**\n * The Git branch for a service or deploy.\n *\n * {@link https://render.com/docs/environment-variables#all-services}\n */\n RenderBranch = \"RENDER_GIT_BRANCH\",\n\n /**\n * Expected to be `\"true\"` if defined.\n */\n IsRender = \"RENDER\",\n\n /**\n * The branch that triggered the deployment. Example: `main`\n *\n * {@link https://docs.railway.app/develop/variables#railway-provided-variables}\n */\n RailwayBranch = \"RAILWAY_GIT_BRANCH\",\n\n /**\n * The railway environment for the deployment. Example: `production`\n *\n * {@link https://docs.railway.app/develop/variables#railway-provided-variables}\n */\n RailwayEnvironment = \"RAILWAY_ENVIRONMENT\",\n\n VercelEnvKey = \"VERCEL_ENV\",\n\n /**\n * Standard Node.js environment indicator (e.g. `\"production\"`, `\"development\"`,\n * `\"test\"`). Read by some framework adapters to choose the request scheme,\n * and by prod-mode inference.\n */\n NodeEnv = \"NODE_ENV\",\n\n /**\n * Netlify's deploy context (e.g. `\"production\"`, `\"deploy-preview\"`). Used\n * for prod-mode inference.\n *\n * {@link https://docs.netlify.com/configure-builds/environment-variables/#build-metadata}\n */\n Context = \"CONTEXT\",\n\n /**\n * Generic environment name used by some platforms to indicate prod vs\n * non-prod (e.g. `\"production\"`).\n */\n Environment = \"ENVIRONMENT\",\n\n /**\n * Set by Deno Deploy. Its presence indicates a Deno Deploy environment,\n * which we treat as prod.\n *\n * {@link https://docs.deno.com/deploy/manual/environment-variables/}\n */\n DenoDeployment = \"DENO_DEPLOYMENT_ID\",\n\n OpenAiApiKey = \"OPENAI_API_KEY\",\n GeminiApiKey = \"GEMINI_API_KEY\",\n AnthropicApiKey = \"ANTHROPIC_API_KEY\",\n\n /**\n * Framework-prefixed variants of Inngest env vars. CRA's `REACT_APP_` and\n * Next's `NEXT_PUBLIC_` prefixes expose env vars to bundled client code, so\n * we accept the prefixed forms in addition to the canonical names.\n */\n ReactAppInngestBaseUrl = \"REACT_APP_INNGEST_BASE_URL\",\n ReactAppInngestDevMode = \"REACT_APP_INNGEST_DEV\",\n NextPublicInngestBaseUrl = \"NEXT_PUBLIC_INNGEST_BASE_URL\",\n NextPublicInngestDevMode = \"NEXT_PUBLIC_INNGEST_DEV\",\n}\n\n/**\n * Keys for accessing headers included in requests from Inngest to run\n * functions.\n *\n * Used internally to create handlers using `InngestCommHandler`, but can be\n * imported to be used if creating a custom handler outside of the package.\n *\n * @public\n */\nexport enum headerKeys {\n ContentType = \"content-type\",\n Host = \"host\",\n ForwardedFor = \"x-forwarded-for\",\n RealIp = \"x-real-ip\",\n Location = \"location\",\n ContentLength = \"content-length\",\n Signature = \"x-inngest-signature\",\n SdkVersion = \"x-inngest-sdk\",\n Environment = \"x-inngest-env\",\n Platform = \"x-inngest-platform\",\n Framework = \"x-inngest-framework\",\n NoRetry = \"x-inngest-no-retry\",\n RequestId = \"x-request-id\",\n GenerationId = \"x-inngest-generation-id\",\n InngestJobId = \"x-inngest-job-id\",\n RequestVersion = \"x-inngest-req-version\",\n RetryAfter = \"retry-after\",\n InngestServerKind = \"x-inngest-server-kind\",\n InngestExpectedServerKind = \"x-inngest-expected-server-kind\",\n InngestSyncKind = \"x-inngest-sync-kind\",\n EventIdSeed = \"x-inngest-event-id-seed\",\n TraceParent = \"traceparent\",\n TraceState = \"tracestate\",\n InngestRunId = \"x-run-id\",\n InngestStepId = \"x-inngest-step-id\",\n InngestForceStepPlan = \"x-inngest-force-step-plan\",\n SdkHandled = \"x-inngest-sdk-handled\",\n}\n\n/**\n * Headers that are forwarded from the original request when an Inngest function\n * is invoked.\n */\nexport const forwardedHeaders = [headerKeys.TraceParent, headerKeys.TraceState];\n\nexport const defaultInngestApiBaseUrl = \"https://api.inngest.com/\";\nexport const defaultInngestEventBaseUrl = \"https://inn.gs/\";\nexport const defaultDevServerHost = \"http://localhost:8288/\";\n\n/**\n * Events that Inngest may send internally that can be used to trigger\n * functions.\n *\n * @public\n */\nexport enum internalEvents {\n /**\n * A function has failed after exhausting all available retries. This event\n * will contain the original event and the error that caused the failure.\n */\n FunctionFailed = \"inngest/function.failed\",\n FunctionInvoked = \"inngest/function.invoked\",\n FunctionFinished = \"inngest/function.finished\",\n FunctionCancelled = \"inngest/function.cancelled\",\n ScheduledTimer = \"inngest/scheduled.timer\",\n HttpRequest = \"inngest/http.request\",\n\n /**\n * Triggers a deferred function. The backend emits this.\n */\n DeferredSchedule = \"inngest/deferred.schedule\",\n}\n\n/**\n * Reserved input key that carries the `defer(id, { experiment })` ref to the\n * deferred run; the receiver strips it before the handler or schema validation\n * see the data.\n */\nexport const deferExperimentKey = \"_inngestExperiment\";\n\nexport const logPrefix: string = \"[Inngest]\";\n\nexport const debugPrefix = \"inngest\";\n\nexport const dummyEventKey = \"NO_EVENT_KEY_SET\";\n\nexport enum serverKind {\n Dev = \"dev\",\n Cloud = \"cloud\",\n}\n\nexport enum syncKind {\n InBand = \"in_band\",\n OutOfBand = \"out_of_band\",\n}\n\n/**\n * The execution models the SDK is aware of.\n *\n * This is used in a number of places to ensure all execution versions are\n * accounted for for a given operation.\n */\nexport enum ExecutionVersion {\n /**\n * Uses a more flexible approach to execution and is more lenient about\n * determinism, allowing non-step async actions and non-determinism.\n *\n * Nowhere near as stubborn about determinism and so can silently migrate\n * between versions after bug fixes.\n */\n V1 = 1,\n\n /**\n * Identical to V1, but allows the Executor to optimize parallel calls, hugely\n * reducing traffic going to/from the SDK.\n */\n V2 = 2,\n}\n\n/**\n * Default maximum number of retries for function/step executions.\n */\nexport const defaultMaxRetries = 3;\n"],"mappings":";;;;;;;;;;;AASA,IAAY,kDAAL;AACL;AACA;AACA;AACA;;;AAGF,IAAY,0CAAL;AACL;;;AAGF,IAAY,8CAAL;AACL;AACA;AACA;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AAMA;;;;;;;AAQA;;;;AAKA;;;;;;;AAQA;;;;AAKA;;;;;;AAOA;;;;AAKA;;;;;;AAOA;;;;AAKA;;;;;;AAOA;;;;;;AAOA;AAEA;;;;;;AAOA;;;;;;;AAQA;;;;;AAMA;;;;;;;AAQA;AAEA;AACA;AACA;;;;;;AAOA;AACA;AACA;AACA;;;;;;;;;;;;AAYF,IAAY,oDAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAOF,MAAa,mBAAmB,CAAC,WAAW,aAAa,WAAW,WAAW;AAE/E,MAAa,2BAA2B;AACxC,MAAa,6BAA6B;AAC1C,MAAa,uBAAuB;;;;;;;AAQpC,IAAY,4DAAL;;;;;AAKL;AACA;AACA;AACA;AACA;AACA;;;;AAKA;;;;;;;;AAQF,MAAa,qBAAqB;AAElC,MAAaA,YAAoB;AAEjC,MAAa,cAAc;AAE3B,MAAa,gBAAgB;AAO7B,IAAY,gDAAL;AACL;AACA;;;;;;;;;AASF,IAAY,gEAAL;;;;;;;;AAQL;;;;;AAMA;;;;;;AAMF,MAAa,oBAAoB"}
|
package/helpers/consts.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.cts","names":[],"sources":["../../src/helpers/consts.ts"],"sourcesContent":[],"mappings":";;AASA;AAgKA;AA8CA;
|
|
1
|
+
{"version":3,"file":"consts.d.cts","names":[],"sources":["../../src/helpers/consts.ts"],"sourcesContent":[],"mappings":";;AASA;AAgKA;AA8CA;AA+CA;;;;;aA7PY,SAAA;;;;;;;;;;;;;;;aAgKA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA8CA,cAAA;;;;;;;;;;;;;;;;;;;;;;aA+CA,gBAAA"}
|
package/helpers/consts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","names":[],"sources":["../../src/helpers/consts.ts"],"sourcesContent":[],"mappings":";;AASA;AAgKA;AA8CA;
|
|
1
|
+
{"version":3,"file":"consts.d.ts","names":[],"sources":["../../src/helpers/consts.ts"],"sourcesContent":[],"mappings":";;AASA;AAgKA;AA8CA;AA+CA;;;;;aA7PY,SAAA;;;;;;;;;;;;;;;aAgKA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA8CA,cAAA;;;;;;;;;;;;;;;;;;;;;;aA+CA,gBAAA"}
|
package/helpers/consts.js
CHANGED
|
@@ -210,6 +210,12 @@ let internalEvents = /* @__PURE__ */ function(internalEvents$1) {
|
|
|
210
210
|
internalEvents$1["DeferredSchedule"] = "inngest/deferred.schedule";
|
|
211
211
|
return internalEvents$1;
|
|
212
212
|
}({});
|
|
213
|
+
/**
|
|
214
|
+
* Reserved input key that carries the `defer(id, { experiment })` ref to the
|
|
215
|
+
* deferred run; the receiver strips it before the handler or schema validation
|
|
216
|
+
* see the data.
|
|
217
|
+
*/
|
|
218
|
+
const deferExperimentKey = "_inngestExperiment";
|
|
213
219
|
const logPrefix = "[Inngest]";
|
|
214
220
|
const debugPrefix = "inngest";
|
|
215
221
|
const dummyEventKey = "NO_EVENT_KEY_SET";
|
|
@@ -246,5 +252,5 @@ let ExecutionVersion = /* @__PURE__ */ function(ExecutionVersion$1) {
|
|
|
246
252
|
const defaultMaxRetries = 3;
|
|
247
253
|
|
|
248
254
|
//#endregion
|
|
249
|
-
export { ExecutionVersion, debugPrefix, defaultDevServerHost, defaultInngestApiBaseUrl, defaultInngestEventBaseUrl, defaultMaxRetries, dummyEventKey, envKeys, forwardedHeaders, headerKeys, internalEvents, logPrefix, probe, queryKeys, syncKind };
|
|
255
|
+
export { ExecutionVersion, debugPrefix, defaultDevServerHost, defaultInngestApiBaseUrl, defaultInngestEventBaseUrl, defaultMaxRetries, deferExperimentKey, dummyEventKey, envKeys, forwardedHeaders, headerKeys, internalEvents, logPrefix, probe, queryKeys, syncKind };
|
|
250
256
|
//# sourceMappingURL=consts.js.map
|
package/helpers/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","names":["logPrefix: string"],"sources":["../../src/helpers/consts.ts"],"sourcesContent":["/**\n * Keys for accessing query parameters included in requests from Inngest to run\n * functions.\n *\n * Used internally to create handlers using `InngestCommHandler`, but can be\n * imported to be used if creating a custom handler outside of the package.\n *\n * @public\n */\nexport enum queryKeys {\n DeployId = \"deployId\",\n FnId = \"fnId\",\n Probe = \"probe\",\n StepId = \"stepId\",\n}\n\nexport enum probe {\n Trust = \"trust\",\n}\n\nexport enum envKeys {\n InngestSigningKey = \"INNGEST_SIGNING_KEY\",\n InngestSigningKeyFallback = \"INNGEST_SIGNING_KEY_FALLBACK\",\n InngestEventKey = \"INNGEST_EVENT_KEY\",\n\n /**\n * @deprecated Removed in v3. Use {@link InngestBaseUrl} instead.\n */\n InngestDevServerUrl = \"INNGEST_DEVSERVER_URL\",\n InngestEnvironment = \"INNGEST_ENV\",\n InngestBaseUrl = \"INNGEST_BASE_URL\",\n InngestEventApiBaseUrl = \"INNGEST_EVENT_API_BASE_URL\",\n InngestApiBaseUrl = \"INNGEST_API_BASE_URL\",\n InngestServeHost = \"INNGEST_SERVE_HOST\", // Deprecated, use INNGEST_SERVE_ORIGIN\n InngestServePath = \"INNGEST_SERVE_PATH\",\n InngestServeOrigin = \"INNGEST_SERVE_ORIGIN\",\n InngestStreaming = \"INNGEST_STREAMING\",\n InngestDevMode = \"INNGEST_DEV\",\n InngestAllowInBandSync = \"INNGEST_ALLOW_IN_BAND_SYNC\",\n InngestEnableUnauthedSync = \"INNGEST_ENABLE_UNAUTHED_SYNC\",\n InngestConnectMaxWorkerConcurrency = \"INNGEST_CONNECT_MAX_WORKER_CONCURRENCY\",\n InngestConnectIsolateExecution = \"INNGEST_CONNECT_ISOLATE_EXECUTION\",\n InngestConnectGatewayUrl = \"INNGEST_CONNECT_GATEWAY_URL\",\n\n /**\n * @deprecated It's unknown what this env var was used for, but we do not\n * provide explicit support for it. Prefer using `INNGEST_ENV` instead.\n */\n BranchName = \"BRANCH_NAME\",\n\n /**\n * The git branch of the commit the deployment was triggered by. Example:\n * `improve-about-page`.\n *\n * {@link https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables}\n */\n VercelBranch = \"VERCEL_GIT_COMMIT_REF\",\n\n /**\n * Expected to be `\"1\"` if defined.\n */\n IsVercel = \"VERCEL\",\n\n /**\n * The branch name of the current deployment. May only be accessible at build\n * time, but included here just in case.\n *\n * {@link https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables}\n */\n CloudflarePagesBranch = \"CF_PAGES_BRANCH\",\n\n /**\n * Expected to be `\"1\"` if defined.\n */\n IsCloudflarePages = \"CF_PAGES\",\n\n /**\n * The branch name of the deployment from Git to Netlify, if available.\n *\n * {@link https://docs.netlify.com/configure-builds/environment-variables/#git-metadata}\n */\n NetlifyBranch = \"BRANCH\",\n\n /**\n * Expected to be `\"true\"` if defined.\n */\n IsNetlify = \"NETLIFY\",\n\n /**\n * The Git branch for a service or deploy.\n *\n * {@link https://render.com/docs/environment-variables#all-services}\n */\n RenderBranch = \"RENDER_GIT_BRANCH\",\n\n /**\n * Expected to be `\"true\"` if defined.\n */\n IsRender = \"RENDER\",\n\n /**\n * The branch that triggered the deployment. Example: `main`\n *\n * {@link https://docs.railway.app/develop/variables#railway-provided-variables}\n */\n RailwayBranch = \"RAILWAY_GIT_BRANCH\",\n\n /**\n * The railway environment for the deployment. Example: `production`\n *\n * {@link https://docs.railway.app/develop/variables#railway-provided-variables}\n */\n RailwayEnvironment = \"RAILWAY_ENVIRONMENT\",\n\n VercelEnvKey = \"VERCEL_ENV\",\n\n /**\n * Standard Node.js environment indicator (e.g. `\"production\"`, `\"development\"`,\n * `\"test\"`). Read by some framework adapters to choose the request scheme,\n * and by prod-mode inference.\n */\n NodeEnv = \"NODE_ENV\",\n\n /**\n * Netlify's deploy context (e.g. `\"production\"`, `\"deploy-preview\"`). Used\n * for prod-mode inference.\n *\n * {@link https://docs.netlify.com/configure-builds/environment-variables/#build-metadata}\n */\n Context = \"CONTEXT\",\n\n /**\n * Generic environment name used by some platforms to indicate prod vs\n * non-prod (e.g. `\"production\"`).\n */\n Environment = \"ENVIRONMENT\",\n\n /**\n * Set by Deno Deploy. Its presence indicates a Deno Deploy environment,\n * which we treat as prod.\n *\n * {@link https://docs.deno.com/deploy/manual/environment-variables/}\n */\n DenoDeployment = \"DENO_DEPLOYMENT_ID\",\n\n OpenAiApiKey = \"OPENAI_API_KEY\",\n GeminiApiKey = \"GEMINI_API_KEY\",\n AnthropicApiKey = \"ANTHROPIC_API_KEY\",\n\n /**\n * Framework-prefixed variants of Inngest env vars. CRA's `REACT_APP_` and\n * Next's `NEXT_PUBLIC_` prefixes expose env vars to bundled client code, so\n * we accept the prefixed forms in addition to the canonical names.\n */\n ReactAppInngestBaseUrl = \"REACT_APP_INNGEST_BASE_URL\",\n ReactAppInngestDevMode = \"REACT_APP_INNGEST_DEV\",\n NextPublicInngestBaseUrl = \"NEXT_PUBLIC_INNGEST_BASE_URL\",\n NextPublicInngestDevMode = \"NEXT_PUBLIC_INNGEST_DEV\",\n}\n\n/**\n * Keys for accessing headers included in requests from Inngest to run\n * functions.\n *\n * Used internally to create handlers using `InngestCommHandler`, but can be\n * imported to be used if creating a custom handler outside of the package.\n *\n * @public\n */\nexport enum headerKeys {\n ContentType = \"content-type\",\n Host = \"host\",\n ForwardedFor = \"x-forwarded-for\",\n RealIp = \"x-real-ip\",\n Location = \"location\",\n ContentLength = \"content-length\",\n Signature = \"x-inngest-signature\",\n SdkVersion = \"x-inngest-sdk\",\n Environment = \"x-inngest-env\",\n Platform = \"x-inngest-platform\",\n Framework = \"x-inngest-framework\",\n NoRetry = \"x-inngest-no-retry\",\n RequestId = \"x-request-id\",\n GenerationId = \"x-inngest-generation-id\",\n InngestJobId = \"x-inngest-job-id\",\n RequestVersion = \"x-inngest-req-version\",\n RetryAfter = \"retry-after\",\n InngestServerKind = \"x-inngest-server-kind\",\n InngestExpectedServerKind = \"x-inngest-expected-server-kind\",\n InngestSyncKind = \"x-inngest-sync-kind\",\n EventIdSeed = \"x-inngest-event-id-seed\",\n TraceParent = \"traceparent\",\n TraceState = \"tracestate\",\n InngestRunId = \"x-run-id\",\n InngestStepId = \"x-inngest-step-id\",\n InngestForceStepPlan = \"x-inngest-force-step-plan\",\n SdkHandled = \"x-inngest-sdk-handled\",\n}\n\n/**\n * Headers that are forwarded from the original request when an Inngest function\n * is invoked.\n */\nexport const forwardedHeaders = [headerKeys.TraceParent, headerKeys.TraceState];\n\nexport const defaultInngestApiBaseUrl = \"https://api.inngest.com/\";\nexport const defaultInngestEventBaseUrl = \"https://inn.gs/\";\nexport const defaultDevServerHost = \"http://localhost:8288/\";\n\n/**\n * Events that Inngest may send internally that can be used to trigger\n * functions.\n *\n * @public\n */\nexport enum internalEvents {\n /**\n * A function has failed after exhausting all available retries. This event\n * will contain the original event and the error that caused the failure.\n */\n FunctionFailed = \"inngest/function.failed\",\n FunctionInvoked = \"inngest/function.invoked\",\n FunctionFinished = \"inngest/function.finished\",\n FunctionCancelled = \"inngest/function.cancelled\",\n ScheduledTimer = \"inngest/scheduled.timer\",\n HttpRequest = \"inngest/http.request\",\n\n /**\n * Triggers a deferred function. The backend emits this.\n */\n DeferredSchedule = \"inngest/deferred.schedule\",\n}\n\nexport const logPrefix: string = \"[Inngest]\";\n\nexport const debugPrefix = \"inngest\";\n\nexport const dummyEventKey = \"NO_EVENT_KEY_SET\";\n\nexport enum serverKind {\n Dev = \"dev\",\n Cloud = \"cloud\",\n}\n\nexport enum syncKind {\n InBand = \"in_band\",\n OutOfBand = \"out_of_band\",\n}\n\n/**\n * The execution models the SDK is aware of.\n *\n * This is used in a number of places to ensure all execution versions are\n * accounted for for a given operation.\n */\nexport enum ExecutionVersion {\n /**\n * Uses a more flexible approach to execution and is more lenient about\n * determinism, allowing non-step async actions and non-determinism.\n *\n * Nowhere near as stubborn about determinism and so can silently migrate\n * between versions after bug fixes.\n */\n V1 = 1,\n\n /**\n * Identical to V1, but allows the Executor to optimize parallel calls, hugely\n * reducing traffic going to/from the SDK.\n */\n V2 = 2,\n}\n\n/**\n * Default maximum number of retries for function/step executions.\n */\nexport const defaultMaxRetries = 3;\n"],"mappings":";;;;;;;;;;AASA,IAAY,kDAAL;AACL;AACA;AACA;AACA;;;AAGF,IAAY,0CAAL;AACL;;;AAGF,IAAY,8CAAL;AACL;AACA;AACA;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AAMA;;;;;;;AAQA;;;;AAKA;;;;;;;AAQA;;;;AAKA;;;;;;AAOA;;;;AAKA;;;;;;AAOA;;;;AAKA;;;;;;AAOA;;;;;;AAOA;AAEA;;;;;;AAOA;;;;;;;AAQA;;;;;AAMA;;;;;;;AAQA;AAEA;AACA;AACA;;;;;;AAOA;AACA;AACA;AACA;;;;;;;;;;;;AAYF,IAAY,oDAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAOF,MAAa,mBAAmB,CAAC,WAAW,aAAa,WAAW,WAAW;AAE/E,MAAa,2BAA2B;AACxC,MAAa,6BAA6B;AAC1C,MAAa,uBAAuB;;;;;;;AAQpC,IAAY,4DAAL;;;;;AAKL;AACA;AACA;AACA;AACA;AACA;;;;AAKA
|
|
1
|
+
{"version":3,"file":"consts.js","names":["logPrefix: string"],"sources":["../../src/helpers/consts.ts"],"sourcesContent":["/**\n * Keys for accessing query parameters included in requests from Inngest to run\n * functions.\n *\n * Used internally to create handlers using `InngestCommHandler`, but can be\n * imported to be used if creating a custom handler outside of the package.\n *\n * @public\n */\nexport enum queryKeys {\n DeployId = \"deployId\",\n FnId = \"fnId\",\n Probe = \"probe\",\n StepId = \"stepId\",\n}\n\nexport enum probe {\n Trust = \"trust\",\n}\n\nexport enum envKeys {\n InngestSigningKey = \"INNGEST_SIGNING_KEY\",\n InngestSigningKeyFallback = \"INNGEST_SIGNING_KEY_FALLBACK\",\n InngestEventKey = \"INNGEST_EVENT_KEY\",\n\n /**\n * @deprecated Removed in v3. Use {@link InngestBaseUrl} instead.\n */\n InngestDevServerUrl = \"INNGEST_DEVSERVER_URL\",\n InngestEnvironment = \"INNGEST_ENV\",\n InngestBaseUrl = \"INNGEST_BASE_URL\",\n InngestEventApiBaseUrl = \"INNGEST_EVENT_API_BASE_URL\",\n InngestApiBaseUrl = \"INNGEST_API_BASE_URL\",\n InngestServeHost = \"INNGEST_SERVE_HOST\", // Deprecated, use INNGEST_SERVE_ORIGIN\n InngestServePath = \"INNGEST_SERVE_PATH\",\n InngestServeOrigin = \"INNGEST_SERVE_ORIGIN\",\n InngestStreaming = \"INNGEST_STREAMING\",\n InngestDevMode = \"INNGEST_DEV\",\n InngestAllowInBandSync = \"INNGEST_ALLOW_IN_BAND_SYNC\",\n InngestEnableUnauthedSync = \"INNGEST_ENABLE_UNAUTHED_SYNC\",\n InngestConnectMaxWorkerConcurrency = \"INNGEST_CONNECT_MAX_WORKER_CONCURRENCY\",\n InngestConnectIsolateExecution = \"INNGEST_CONNECT_ISOLATE_EXECUTION\",\n InngestConnectGatewayUrl = \"INNGEST_CONNECT_GATEWAY_URL\",\n\n /**\n * @deprecated It's unknown what this env var was used for, but we do not\n * provide explicit support for it. Prefer using `INNGEST_ENV` instead.\n */\n BranchName = \"BRANCH_NAME\",\n\n /**\n * The git branch of the commit the deployment was triggered by. Example:\n * `improve-about-page`.\n *\n * {@link https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables}\n */\n VercelBranch = \"VERCEL_GIT_COMMIT_REF\",\n\n /**\n * Expected to be `\"1\"` if defined.\n */\n IsVercel = \"VERCEL\",\n\n /**\n * The branch name of the current deployment. May only be accessible at build\n * time, but included here just in case.\n *\n * {@link https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables}\n */\n CloudflarePagesBranch = \"CF_PAGES_BRANCH\",\n\n /**\n * Expected to be `\"1\"` if defined.\n */\n IsCloudflarePages = \"CF_PAGES\",\n\n /**\n * The branch name of the deployment from Git to Netlify, if available.\n *\n * {@link https://docs.netlify.com/configure-builds/environment-variables/#git-metadata}\n */\n NetlifyBranch = \"BRANCH\",\n\n /**\n * Expected to be `\"true\"` if defined.\n */\n IsNetlify = \"NETLIFY\",\n\n /**\n * The Git branch for a service or deploy.\n *\n * {@link https://render.com/docs/environment-variables#all-services}\n */\n RenderBranch = \"RENDER_GIT_BRANCH\",\n\n /**\n * Expected to be `\"true\"` if defined.\n */\n IsRender = \"RENDER\",\n\n /**\n * The branch that triggered the deployment. Example: `main`\n *\n * {@link https://docs.railway.app/develop/variables#railway-provided-variables}\n */\n RailwayBranch = \"RAILWAY_GIT_BRANCH\",\n\n /**\n * The railway environment for the deployment. Example: `production`\n *\n * {@link https://docs.railway.app/develop/variables#railway-provided-variables}\n */\n RailwayEnvironment = \"RAILWAY_ENVIRONMENT\",\n\n VercelEnvKey = \"VERCEL_ENV\",\n\n /**\n * Standard Node.js environment indicator (e.g. `\"production\"`, `\"development\"`,\n * `\"test\"`). Read by some framework adapters to choose the request scheme,\n * and by prod-mode inference.\n */\n NodeEnv = \"NODE_ENV\",\n\n /**\n * Netlify's deploy context (e.g. `\"production\"`, `\"deploy-preview\"`). Used\n * for prod-mode inference.\n *\n * {@link https://docs.netlify.com/configure-builds/environment-variables/#build-metadata}\n */\n Context = \"CONTEXT\",\n\n /**\n * Generic environment name used by some platforms to indicate prod vs\n * non-prod (e.g. `\"production\"`).\n */\n Environment = \"ENVIRONMENT\",\n\n /**\n * Set by Deno Deploy. Its presence indicates a Deno Deploy environment,\n * which we treat as prod.\n *\n * {@link https://docs.deno.com/deploy/manual/environment-variables/}\n */\n DenoDeployment = \"DENO_DEPLOYMENT_ID\",\n\n OpenAiApiKey = \"OPENAI_API_KEY\",\n GeminiApiKey = \"GEMINI_API_KEY\",\n AnthropicApiKey = \"ANTHROPIC_API_KEY\",\n\n /**\n * Framework-prefixed variants of Inngest env vars. CRA's `REACT_APP_` and\n * Next's `NEXT_PUBLIC_` prefixes expose env vars to bundled client code, so\n * we accept the prefixed forms in addition to the canonical names.\n */\n ReactAppInngestBaseUrl = \"REACT_APP_INNGEST_BASE_URL\",\n ReactAppInngestDevMode = \"REACT_APP_INNGEST_DEV\",\n NextPublicInngestBaseUrl = \"NEXT_PUBLIC_INNGEST_BASE_URL\",\n NextPublicInngestDevMode = \"NEXT_PUBLIC_INNGEST_DEV\",\n}\n\n/**\n * Keys for accessing headers included in requests from Inngest to run\n * functions.\n *\n * Used internally to create handlers using `InngestCommHandler`, but can be\n * imported to be used if creating a custom handler outside of the package.\n *\n * @public\n */\nexport enum headerKeys {\n ContentType = \"content-type\",\n Host = \"host\",\n ForwardedFor = \"x-forwarded-for\",\n RealIp = \"x-real-ip\",\n Location = \"location\",\n ContentLength = \"content-length\",\n Signature = \"x-inngest-signature\",\n SdkVersion = \"x-inngest-sdk\",\n Environment = \"x-inngest-env\",\n Platform = \"x-inngest-platform\",\n Framework = \"x-inngest-framework\",\n NoRetry = \"x-inngest-no-retry\",\n RequestId = \"x-request-id\",\n GenerationId = \"x-inngest-generation-id\",\n InngestJobId = \"x-inngest-job-id\",\n RequestVersion = \"x-inngest-req-version\",\n RetryAfter = \"retry-after\",\n InngestServerKind = \"x-inngest-server-kind\",\n InngestExpectedServerKind = \"x-inngest-expected-server-kind\",\n InngestSyncKind = \"x-inngest-sync-kind\",\n EventIdSeed = \"x-inngest-event-id-seed\",\n TraceParent = \"traceparent\",\n TraceState = \"tracestate\",\n InngestRunId = \"x-run-id\",\n InngestStepId = \"x-inngest-step-id\",\n InngestForceStepPlan = \"x-inngest-force-step-plan\",\n SdkHandled = \"x-inngest-sdk-handled\",\n}\n\n/**\n * Headers that are forwarded from the original request when an Inngest function\n * is invoked.\n */\nexport const forwardedHeaders = [headerKeys.TraceParent, headerKeys.TraceState];\n\nexport const defaultInngestApiBaseUrl = \"https://api.inngest.com/\";\nexport const defaultInngestEventBaseUrl = \"https://inn.gs/\";\nexport const defaultDevServerHost = \"http://localhost:8288/\";\n\n/**\n * Events that Inngest may send internally that can be used to trigger\n * functions.\n *\n * @public\n */\nexport enum internalEvents {\n /**\n * A function has failed after exhausting all available retries. This event\n * will contain the original event and the error that caused the failure.\n */\n FunctionFailed = \"inngest/function.failed\",\n FunctionInvoked = \"inngest/function.invoked\",\n FunctionFinished = \"inngest/function.finished\",\n FunctionCancelled = \"inngest/function.cancelled\",\n ScheduledTimer = \"inngest/scheduled.timer\",\n HttpRequest = \"inngest/http.request\",\n\n /**\n * Triggers a deferred function. The backend emits this.\n */\n DeferredSchedule = \"inngest/deferred.schedule\",\n}\n\n/**\n * Reserved input key that carries the `defer(id, { experiment })` ref to the\n * deferred run; the receiver strips it before the handler or schema validation\n * see the data.\n */\nexport const deferExperimentKey = \"_inngestExperiment\";\n\nexport const logPrefix: string = \"[Inngest]\";\n\nexport const debugPrefix = \"inngest\";\n\nexport const dummyEventKey = \"NO_EVENT_KEY_SET\";\n\nexport enum serverKind {\n Dev = \"dev\",\n Cloud = \"cloud\",\n}\n\nexport enum syncKind {\n InBand = \"in_band\",\n OutOfBand = \"out_of_band\",\n}\n\n/**\n * The execution models the SDK is aware of.\n *\n * This is used in a number of places to ensure all execution versions are\n * accounted for for a given operation.\n */\nexport enum ExecutionVersion {\n /**\n * Uses a more flexible approach to execution and is more lenient about\n * determinism, allowing non-step async actions and non-determinism.\n *\n * Nowhere near as stubborn about determinism and so can silently migrate\n * between versions after bug fixes.\n */\n V1 = 1,\n\n /**\n * Identical to V1, but allows the Executor to optimize parallel calls, hugely\n * reducing traffic going to/from the SDK.\n */\n V2 = 2,\n}\n\n/**\n * Default maximum number of retries for function/step executions.\n */\nexport const defaultMaxRetries = 3;\n"],"mappings":";;;;;;;;;;AASA,IAAY,kDAAL;AACL;AACA;AACA;AACA;;;AAGF,IAAY,0CAAL;AACL;;;AAGF,IAAY,8CAAL;AACL;AACA;AACA;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AAMA;;;;;;;AAQA;;;;AAKA;;;;;;;AAQA;;;;AAKA;;;;;;AAOA;;;;AAKA;;;;;;AAOA;;;;AAKA;;;;;;AAOA;;;;;;AAOA;AAEA;;;;;;AAOA;;;;;;;AAQA;;;;;AAMA;;;;;;;AAQA;AAEA;AACA;AACA;;;;;;AAOA;AACA;AACA;AACA;;;;;;;;;;;;AAYF,IAAY,oDAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAOF,MAAa,mBAAmB,CAAC,WAAW,aAAa,WAAW,WAAW;AAE/E,MAAa,2BAA2B;AACxC,MAAa,6BAA6B;AAC1C,MAAa,uBAAuB;;;;;;;AAQpC,IAAY,4DAAL;;;;;AAKL;AACA;AACA;AACA;AACA;AACA;;;;AAKA;;;;;;;;AAQF,MAAa,qBAAqB;AAElC,MAAaA,YAAoB;AAEjC,MAAa,cAAc;AAE3B,MAAa,gBAAgB;AAO7B,IAAY,gDAAL;AACL;AACA;;;;;;;;;AASF,IAAY,gEAAL;;;;;;;;AAQL;;;;;AAMA;;;;;;AAMF,MAAa,oBAAoB"}
|
package/helpers/errors.cjs
CHANGED
|
@@ -9,6 +9,7 @@ let serialize_error_cjs = require("serialize-error-cjs");
|
|
|
9
9
|
var errors_exports = /* @__PURE__ */ require_rolldown_runtime.__export({
|
|
10
10
|
ErrCode: () => ErrCode,
|
|
11
11
|
OutgoingResultError: () => OutgoingResultError,
|
|
12
|
+
UnreachableError: () => UnreachableError,
|
|
12
13
|
deserializeError: () => deserializeError,
|
|
13
14
|
fixEventKeyMissingSteps: () => fixEventKeyMissingSteps,
|
|
14
15
|
getErrorMessage: () => getErrorMessage,
|
|
@@ -208,9 +209,24 @@ const rethrowError = (prefix) => {
|
|
|
208
209
|
}
|
|
209
210
|
};
|
|
210
211
|
};
|
|
212
|
+
/**
|
|
213
|
+
* An error that indicates that a code path that was thought to be unreachable
|
|
214
|
+
* has been reached.
|
|
215
|
+
*
|
|
216
|
+
* This is useful for exhaustiveness checks in places where we think we've
|
|
217
|
+
* handled all possible cases, but want to be sure that if we haven't, we get a
|
|
218
|
+
* clear error.
|
|
219
|
+
*/
|
|
220
|
+
var UnreachableError = class extends Error {
|
|
221
|
+
constructor(message) {
|
|
222
|
+
super(message);
|
|
223
|
+
this.name = "UnreachableError";
|
|
224
|
+
}
|
|
225
|
+
};
|
|
211
226
|
|
|
212
227
|
//#endregion
|
|
213
228
|
exports.ErrCode = ErrCode;
|
|
229
|
+
exports.UnreachableError = UnreachableError;
|
|
214
230
|
exports.deserializeError = deserializeError;
|
|
215
231
|
Object.defineProperty(exports, 'errors_exports', {
|
|
216
232
|
enumerable: true,
|