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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Simplify } from "../../helpers/types.cjs";
|
|
2
|
-
import { FoundStep } from "../InngestStepTools.cjs";
|
|
3
2
|
import { MetadataUpdate } from "../InngestMetadata.cjs";
|
|
3
|
+
import { FoundStep } from "../InngestStepTools.cjs";
|
|
4
4
|
import { BasicFoundStep, InngestExecutionFactory, MemoizedOp } from "./InngestExecution.cjs";
|
|
5
5
|
import { OutgoingOp } from "../../types.cjs";
|
|
6
6
|
import { StepError } from "../StepError.cjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.cts","names":[],"sources":["../../../src/components/execution/engine.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"engine.d.cts","names":[],"sources":["../../../src/components/execution/engine.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;cAqIa,uBAAuB;;;;UAuzFnB,WAAA;;YACU,cAAc;;;IAxzF5B,KAAA,EAAA,OAAA;EAuzFI,CAAA;EAAW,mBAAA,EAAA;IACD,IAAA,EAAA,OAAA;;kBAIjB,EAAA;IACM,IAAA,EADN,UACM;IAAc,UAAA,EAAd,cAAc,EAAA;IAOzB,eAAU,EAAA,MAAA;EAAA,CAAA;iCACD,EAAA,CAAA,CAAA;yCAA+B,EAAA,CAAA,CAAA;;KADxC,UAAA,GAC0D,QAAnC,MAAd,WAAc,GAAA,QAAA,CAAA;EACpB,IAAA,EADqC,CACrC;AAAW,CAAA,GADgC,WAChC,CAD4C,CAC5C,CAAA,CAAA,EA+BnB,CAAA,MA/BQ,WA+BS,CAAA;AAAc,UAAd,cAAA,CAAc;;;;;;eAoBlB,CAAA,EAdK,QAcL,CAdc,IAcd,CAdmB,UAcnB,EAAA,IAAA,CAAA,CAAA;;;;;;;yBAwDa,CAAA,EA9DE,UA8DF;;;;;WAoDD,EA5GZ,MA4GY,CAAA,MAAA,EA5GG,UA4GH,CAAA;;;AACxB;AAgBkC;;;aA6BjC,EAlJa,MAkJb,CAAA,MAAA,EAAA,OAAA,CAAA;;;;;gBAME,EAAA,MAAA;EAAyB;AAsC7B;;;OAnFiC,EA/FxB,GA+FwB,CAAA,MAAA,EA/FZ,SA+FY,CAAA;;;;;;;;;;;QAlFzB,eAAe;;;;wBAKC;;;;;;;;;;;;;;;0BAkBE;;;;;;;;;;;;;;;8BAgBI;;;;;;;;;;;;;;;;;;;;;2BAwBH;;;;;;WAOhB;;;;aAKE,YAAY,MAAM;;;;;UAiBrB,yBAAA;;;;;;;;;;;;;;;iBA2BD,sBAAA;;;;;;mBAMU;YACP,YAAY;IACpB;;;;cAsCS;eAnFO,eAAa"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Simplify } from "../../helpers/types.js";
|
|
2
|
-
import { FoundStep } from "../InngestStepTools.js";
|
|
3
2
|
import { MetadataUpdate } from "../InngestMetadata.js";
|
|
3
|
+
import { FoundStep } from "../InngestStepTools.js";
|
|
4
4
|
import { BasicFoundStep, InngestExecutionFactory, MemoizedOp } from "./InngestExecution.js";
|
|
5
5
|
import { OutgoingOp } from "../../types.js";
|
|
6
6
|
import { StepError } from "../StepError.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","names":[],"sources":["../../../src/components/execution/engine.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"engine.d.ts","names":[],"sources":["../../../src/components/execution/engine.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;cAqIa,uBAAuB;;;;UAuzFnB,WAAA;;YACU,cAAc;;;IAxzF5B,KAAA,EAAA,OAAA;EAuzFI,CAAA;EAAW,mBAAA,EAAA;IACD,IAAA,EAAA,OAAA;;kBAIjB,EAAA;IACM,IAAA,EADN,UACM;IAAc,UAAA,EAAd,cAAc,EAAA;IAOzB,eAAU,EAAA,MAAA;EAAA,CAAA;iCACD,EAAA,CAAA,CAAA;yCAA+B,EAAA,CAAA,CAAA;;KADxC,UAAA,GAC0D,QAAnC,MAAd,WAAc,GAAA,QAAA,CAAA;EACpB,IAAA,EADqC,CACrC;AAAW,CAAA,GADgC,WAChC,CAD4C,CAC5C,CAAA,CAAA,EA+BnB,CAAA,MA/BQ,WA+BS,CAAA;AAAc,UAAd,cAAA,CAAc;;;;;;eAoBlB,CAAA,EAdK,QAcL,CAdc,IAcd,CAdmB,UAcnB,EAAA,IAAA,CAAA,CAAA;;;;;;;yBAwDa,CAAA,EA9DE,UA8DF;;;;;WAoDD,EA5GZ,MA4GY,CAAA,MAAA,EA5GG,UA4GH,CAAA;;;AACxB;AAgBkC;;;aA6BjC,EAlJa,MAkJb,CAAA,MAAA,EAAA,OAAA,CAAA;;;;;gBAME,EAAA,MAAA;EAAyB;AAsC7B;;;OAnFiC,EA/FxB,GA+FwB,CAAA,MAAA,EA/FZ,SA+FY,CAAA;;;;;;;;;;;QAlFzB,eAAe;;;;wBAKC;;;;;;;;;;;;;;;0BAkBE;;;;;;;;;;;;;;;8BAgBI;;;;;;;;;;;;;;;;;;;;;2BAwBH;;;;;;WAOhB;;;;aAKE,YAAY,MAAM;;;;;UAiBrB,yBAAA;;;;;;;;;;;;;;;iBA2BD,sBAAA;;;;;;mBAMU;YACP,YAAY;IACpB;;;;cAsCS;eAnFO,eAAa"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __export } from "../../_virtual/rolldown_runtime.js";
|
|
2
|
-
import { ExecutionVersion, defaultMaxRetries, headerKeys } from "../../helpers/consts.js";
|
|
2
|
+
import { ExecutionVersion, defaultMaxRetries, deferExperimentKey, headerKeys } from "../../helpers/consts.js";
|
|
3
3
|
import { version } from "../../version.js";
|
|
4
4
|
import { NonRetriableError } from "../NonRetriableError.js";
|
|
5
5
|
import { ErrCode, deserializeError, serializeError } from "../../helpers/errors.js";
|
|
@@ -192,7 +192,7 @@ var InngestExecutionEngine = class extends InngestExecution {
|
|
|
192
192
|
traceparent: this.options.headers[headerKeys.TraceParent],
|
|
193
193
|
tracestate: this.options.headers[headerKeys.TraceState]
|
|
194
194
|
});
|
|
195
|
-
metadataSpanProcessor.declareStartingSpan({
|
|
195
|
+
if (this.options.client.aiMetadataEnabled) metadataSpanProcessor.declareStartingSpan({
|
|
196
196
|
span,
|
|
197
197
|
traceparent: this.options.headers[headerKeys.TraceParent],
|
|
198
198
|
onAIMetadata: (aiMetadata) => {
|
|
@@ -910,7 +910,8 @@ var InngestExecutionEngine = class extends InngestExecution {
|
|
|
910
910
|
if (store?.execution) store.execution.executingStep = {
|
|
911
911
|
id,
|
|
912
912
|
name: displayName,
|
|
913
|
-
hashedId
|
|
913
|
+
hashedId,
|
|
914
|
+
userlandId: userland.id
|
|
914
915
|
};
|
|
915
916
|
this.devDebug(`executing step "${id}"`);
|
|
916
917
|
if (this.rootSpanId && this.options.checkpointingConfig) clientProcessorMap.get(this.options.client)?.declareStepExecution(this.rootSpanId, userland.id ?? "", userland.index ?? 0, hashedId, this.options.data?.attempt ?? 0);
|
|
@@ -1043,8 +1044,10 @@ var InngestExecutionEngine = class extends InngestExecution {
|
|
|
1043
1044
|
})), triggers);
|
|
1044
1045
|
}
|
|
1045
1046
|
/**
|
|
1046
|
-
* Validate the deferred event's data against the defer function's own
|
|
1047
|
-
*
|
|
1047
|
+
* Validate the deferred event's data against the defer function's own schema
|
|
1048
|
+
* (set via `createDefer`'s `opts.schema`). Our internal metadata
|
|
1049
|
+
* (`event.data._inngest`) was already stripped, so that won't affect
|
|
1050
|
+
* validation.
|
|
1048
1051
|
*/
|
|
1049
1052
|
async validateDeferEventSchema() {
|
|
1050
1053
|
const fn = this.options.fn;
|
|
@@ -1187,10 +1190,6 @@ var InngestExecutionEngine = class extends InngestExecution {
|
|
|
1187
1190
|
group: createGroupTools({ experimentStepRun }),
|
|
1188
1191
|
defer
|
|
1189
1192
|
};
|
|
1190
|
-
if (this.options.handlerKind === "defer") {
|
|
1191
|
-
delete fnArg.event.data._inngest;
|
|
1192
|
-
for (const event of fnArg.events) delete event.data._inngest;
|
|
1193
|
-
}
|
|
1194
1193
|
/**
|
|
1195
1194
|
* Handle use of the `onFailure` option by deserializing the error.
|
|
1196
1195
|
*/
|
|
@@ -1484,7 +1483,7 @@ var InngestExecutionEngine = class extends InngestExecution {
|
|
|
1484
1483
|
* schema mismatch) are logged and the call is silently skipped.
|
|
1485
1484
|
*/
|
|
1486
1485
|
buildDefer(stepHandler) {
|
|
1487
|
-
return (idOrOptions, { function: deferFn, data }) => {
|
|
1486
|
+
return (idOrOptions, { function: deferFn, data, experiment }) => {
|
|
1488
1487
|
const log = this.options.client[internalLoggerSymbol];
|
|
1489
1488
|
const runId = this.fnArg.runId;
|
|
1490
1489
|
try {
|
|
@@ -1511,7 +1510,10 @@ var InngestExecutionEngine = class extends InngestExecution {
|
|
|
1511
1510
|
input = result.value ?? data;
|
|
1512
1511
|
}
|
|
1513
1512
|
stepHandler({
|
|
1514
|
-
args: [idOrOptions, input
|
|
1513
|
+
args: [idOrOptions, experiment && isRecord(input) ? {
|
|
1514
|
+
...input,
|
|
1515
|
+
[deferExperimentKey]: experiment
|
|
1516
|
+
} : input],
|
|
1515
1517
|
matchOp: (stepOptions, inputArg) => ({
|
|
1516
1518
|
id: stepOptions.id,
|
|
1517
1519
|
mode: StepMode.Sync,
|