@eventual/core
Advanced tools
Comparing version 0.7.8 to 0.7.9
@@ -46,8 +46,4 @@ "use strict"; | ||
} | ||
const workflow = (0, workflow_js_1.lookupWorkflow)(workflowName); | ||
if (workflow === undefined) { | ||
throw new Error(`no such workflow with name '${workflowName}'`); | ||
} | ||
// TODO: get workflow from execution id | ||
return orchestrateExecution(workflow, executionId, records, baseTime); | ||
return orchestrateExecution(workflowName, executionId, records, baseTime); | ||
}); | ||
@@ -66,5 +62,5 @@ logger.debug("Executions succeeded: " + | ||
}; | ||
async function orchestrateExecution(workflow, executionId, events, baseTime) { | ||
async function orchestrateExecution(workflowName, executionId, events, baseTime) { | ||
const executionLogger = logger.createChild({ | ||
persistentLogAttributes: { workflowName: workflow.name, executionId }, | ||
persistentLogAttributes: { workflowName, executionId }, | ||
}); | ||
@@ -104,2 +100,11 @@ const metrics = initializeMetrics(); | ||
}, start); | ||
const workflow = (0, workflow_js_1.lookupWorkflow)(workflowName); | ||
if (workflow === undefined) { | ||
yield (0, workflow_events_js_1.createEvent)({ | ||
type: workflow_events_js_1.WorkflowEventType.WorkflowFailed, | ||
error: "WorkflowNotFound", | ||
message: `Workflow name ${workflowName} does not exist.`, | ||
}, start); | ||
return; | ||
} | ||
const workflowContext = { | ||
@@ -143,3 +148,3 @@ name: workflow.workflowName, | ||
executionLogger.info(`Found ${newCommands.length} new commands.`); | ||
yield* await (0, utils_js_1.timed)(metrics, constants_js_1.OrchestratorMetrics.InvokeCommandsDuration, () => processCommands(newCommands)); | ||
yield* await (0, utils_js_1.timed)(metrics, constants_js_1.OrchestratorMetrics.InvokeCommandsDuration, () => processCommands(workflow, newCommands)); | ||
metrics.putMetric(constants_js_1.OrchestratorMetrics.CommandsInvoked, newCommands.length, unit_js_1.Unit.Count); | ||
@@ -269,3 +274,3 @@ // tracks the time it takes for a workflow task to be scheduled until new commands could be emitted. | ||
*/ | ||
async function processCommands(commands) { | ||
async function processCommands(workflow, commands) { | ||
console.debug("Commands to send", JSON.stringify(commands)); | ||
@@ -281,3 +286,3 @@ // register command events | ||
metrics.setDimensions({ | ||
[constants_js_1.MetricsCommon.WorkflowNameDimension]: workflow.workflowName, | ||
[constants_js_1.MetricsCommon.WorkflowNameDimension]: workflowName, | ||
}); | ||
@@ -314,2 +319,2 @@ // number of events that came from the workflow task | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JjaGVzdHJhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3J1bnRpbWUvaGFuZGxlcnMvb3JjaGVzdHJhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLCtCQUErQjtBQUcvQixpRUFnQmtDO0FBQ2xDLHFEQUs0QjtBQUM1QiwrQ0FBeUU7QUFDekUsbURBQStFO0FBQy9FLGtEQVE2QjtBQUM3QixnRUFBeUQ7QUFDekQsd0RBQXNFO0FBRXRFLDBEQUE2RTtBQUU3RSxnREFBMEM7QUFDMUMsa0RBQXVEO0FBQ3ZELDBDQUFvRTtBQUNwRSwyQ0FBNkM7QUEyQjdDOzs7OztHQUtHO0FBQ0gsU0FBZ0Isa0JBQWtCLENBQUMsRUFDakMsc0JBQXNCLEVBQ3RCLFdBQVcsRUFDWCxxQkFBcUIsRUFDckIsY0FBYyxFQUNkLGFBQWEsRUFDYixXQUFXLEVBQ1gsTUFBTSxHQUNtQjtJQUN6QixNQUFNLGVBQWUsR0FBRyxJQUFJLHFDQUFlLENBQUM7UUFDMUMsV0FBVztRQUNYLGNBQWM7UUFDZCxxQkFBcUI7UUFDckIsV0FBVztLQUNaLENBQUMsQ0FBQztJQUVILE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxRQUFRLEdBQUcsSUFBSSxJQUFJLEVBQUUsRUFBRSxFQUFFO1FBQ3BELE1BQU0sa0JBQWtCLEdBQUcsSUFBQSxrQkFBTyxFQUNoQyxhQUFhLEVBQ2I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BlOiBXb3JrZmxvd0V2ZW50VHlwZS5Xb3JrZmxvd1J1blN0YXJ0ZWQsXG4gICAgICAgICAgfSxcbiAgICAgICAgICBzdGFydFxuICAgICAgICApO1xuXG4gICAgICAgIGNvbnN0IHdvcmtmbG93Q29udGV4dDogV29ya2Zsb3dDb250ZXh0ID0ge1xuICAgICAgICAgIG5hbWU6IHdvcmtmbG93LndvcmtmbG93TmFtZSxcbiAgICAgICAgfTtcblxuICAgICAgICBjb25zdCBzdGFydEV2ZW50ID0gaGlzdG9yeS5maW5kKGlzV29ya2Zsb3dTdGFydGVkKTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQ2hlY2sgdG8gc2VlIGlmIHRoaXMgaXMgdGhlIGZpcnN0IHJ1biBvZiB0aGUgd29ya2Zsb3cgKG9yIGFsbCBvdGhlcnMgaGF2ZSBmYWlsZWQpLlxuICAgICAgICAgKiBJZiBzbywgY2hlY2sgdG8gc2VlIGlmIHRoZSB3b3JrZmxvdyBoYXMgdGltZW91dCB0byBzdGFydC5cbiAgICAgICAgICovXG4gICAgICAgIGlmICghc3RhcnRFdmVudCkge1xuICAgICAgICAgIGNvbnN0IG5ld1dvcmtmbG93U3RhcnQgPSBldmVudHMuZmluZChpc1dvcmtmbG93U3RhcnRlZCk7XG5cbiAgICAgICAgICBpZiAobmV3V29ya2Zsb3dTdGFydD8udGltZW91dFRpbWUpIHtcbiAgICAgICAgICAgIG1ldHJpY3Muc2V0UHJvcGVydHkoT3JjaGVzdHJhdG9yTWV0cmljcy5UaW1lb3V0U3RhcnRlZCwgMSk7XG4gICAgICAgICAgICBhd2FpdCB0aW1lZChcbiAgICAgICAgICAgICAgbWV0cmljcyxcbiAgICAgICAgICAgICAgT3JjaGVzdHJhdG9yTWV0cmljcy5UaW1lb3V0U3RhcnRlZER1cmF0aW9uLFxuICAgICAgICAgICAgICAoKSA9PlxuICAgICAgICAgICAgICAgIHRpbWVyQ2xpZW50LnNjaGVkdWxlRXZlbnQ8V29ya2Zsb3dUaW1lZE91dD4oe1xuICAgICAgICAgICAgICAgICAgc2NoZWR1bGU6IFNjaGVkdWxlLmFic29sdXRlKG5ld1dvcmtmbG93U3RhcnQudGltZW91dFRpbWUhKSxcbiAgICAgICAgICAgICAgICAgIGV2ZW50OiBjcmVhdGVFdmVudDxXb3JrZmxvd1RpbWVkT3V0PihcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLldvcmtmbG93VGltZWRPdXQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0XG4gICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1ldHJpY3Muc2V0UHJvcGVydHkoT3JjaGVzdHJhdG9yTWV0cmljcy5UaW1lb3V0U3RhcnRlZCwgMCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29uc3Qge1xuICAgICAgICAgIHJlc3VsdCxcbiAgICAgICAgICBjb21tYW5kczogbmV3Q29tbWFuZHMsXG4gICAgICAgICAgaGlzdG9yeTogdXBkYXRlZEhpc3RvcnlFdmVudHMsXG4gICAgICAgIH0gPSB0aW1lZFN5bmMoXG4gICAgICAgICAgbWV0cmljcyxcbiAgICAgICAgICBPcmNoZXN0cmF0b3JNZXRyaWNzLkFkdmFuY2VFeGVjdXRpb25EdXJhdGlvbixcbiAgICAgICAgICAoKSA9PiB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICByZXR1cm4gcHJvZ3Jlc3NXb3JrZmxvdyhcbiAgICAgICAgICAgICAgICB3b3JrZmxvdyxcbiAgICAgICAgICAgICAgICBoaXN0b3J5LFxuICAgICAgICAgICAgICAgIGV2ZW50cyxcbiAgICAgICAgICAgICAgICB3b3JrZmxvd0NvbnRleHQsXG4gICAgICAgICAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgICAgICAgICAgYmFzZVRpbWVcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIndvcmtmbG93IGVycm9yXCIpO1xuICAgICAgICAgICAgICBleGVjdXRpb25Mb2dnZXIuZXJyb3IoaW5zcGVjdChlcnIpKTtcbiAgICAgICAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgKTtcblxuICAgICAgICBtZXRyaWNzLnNldFByb3BlcnR5KFxuICAgICAgICAgIE9yY2hlc3RyYXRvck1ldHJpY3MuQWR2YW5jZUV4ZWN1dGlvbkV2ZW50cyxcbiAgICAgICAgICB1cGRhdGVkSGlzdG9yeUV2ZW50cy5sZW5ndGhcbiAgICAgICAgKTtcblxuICAgICAgICB5aWVsZCogdXBkYXRlZEhpc3RvcnlFdmVudHM7XG5cbiAgICAgICAgZXhlY3V0aW9uTG9nZ2VyLmRlYnVnKFxuICAgICAgICAgIFwiV29ya2Zsb3cgdGVybWluYXRlZCB3aXRoOiBcIiArIEpTT04uc3RyaW5naWZ5KHJlc3VsdClcbiAgICAgICAgKTtcblxuICAgICAgICBleGVjdXRpb25Mb2dnZXIuaW5mbyhgRm91bmQgJHtuZXdDb21tYW5kcy5sZW5ndGh9IG5ldyBjb21tYW5kcy5gKTtcblxuICAgICAgICB5aWVsZCogYXdhaXQgdGltZWQoXG4gICAgICAgICAgbWV0cmljcyxcbiAgICAgICAgICBPcmNoZXN0cmF0b3JNZXRyaWNzLkludm9rZUNvbW1hbmRzRHVyYXRpb24sXG4gICAgICAgICAgKCkgPT4gcHJvY2Vzc0NvbW1hbmRzKG5ld0NvbW1hbmRzKVxuICAgICAgICApO1xuXG4gICAgICAgIG1ldHJpY3MucHV0TWV0cmlj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gICB9LFxuICAgICAgICAgIHN0YXJ0XG4gICAgICAgICk7XG5cbiAgICAgICAgaWYgKGlzUmVzdWx0KHJlc3VsdCkpIHtcbiAgICAgICAgICBpZiAoaXNGYWlsZWQocmVzdWx0KSkge1xuICAgICAgICAgICAgY29uc3QgW2Vycm9yLCBtZXNzYWdlXSA9IGV4dGVuZHNFcnJvcihyZXN1bHQuZXJyb3IpXG4gICAgICAgICAgICAgID8gW3Jlc3VsdC5lcnJvci5uYW1lLCByZXN1bHQuZXJyb3IubWVzc2FnZV1cbiAgICAgICAgICAgICAgOiBbXCJFcnJvclwiLCBKU09OLnN0cmluZ2lmeShyZXN1bHQuZXJyb3IpXTtcbiAgICAgICAgICAgIHlpZWxkIGNyZWF0ZUV2ZW50PFdvcmtmbG93RmFpbGVkPihcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLldvcmtmbG93RmFpbGVkLFxuICAgICAgICAgICAgICAgIGVycm9yLFxuICAgICAgICAgICAgICAgIG1lc3NhZ2UsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIHN0YXJ0XG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0gZWxzZSBpZiAoaXNSZXNvbHZlZDxhbnk+KHJlc3VsdCkpIHtcbiAgICAgICAgICAgIHlpZWxkIGNyZWF0ZUV2ZW50PFdvcmtmbG93U3VjY2VlZGVkPihcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLldvcmtmbG93U3VjY2VlZGVkLFxuICAgICAgICAgICAgICAgIG91dHB1dDogcmVzdWx0LnZhbHVlLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBzdGFydFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgfVxuXG4gICAgICAvKipcbiAgICAgIC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Byb3BlcnR5KE9yY2hlc3RyYXRvck1ldHJpY3MuVGltZW91dFN0YXJ0ZWQsIDEpO1xuICAgICAgICAgICAgYXdhaXQgdGltZWQoXG4gICAgICAgICAgICAgIG1ldHJpY3MsXG4gICAgICAgICAgICAgIE9yY2hlc3RyYXRvck1ldHJpY3MuVGltZW91dFN0YXJ0ZWREdXJhdGlvbixcbiAgICAgICAgICAgICAgKCkgPT5cbiAgICAgICAgICAgICAgICB0aW1lckNsaWVudC5zY2hlZHVsZUV2ZW50PFdvcmtmbG93VGltZWRPdXQ+KHtcbiAgICAgICAgICAgICAgICAgIHNjaGVkdWxlOiBTY2hlZHVsZS5hYnNvbHV0ZShuZXdXb3JrZmxvd1N0YXJ0LnRpbWVvdXRUaW1lISksXG4gICAgICAgICAgICAgICAgICBldmVudDogY3JlYXRlRXZlbnQ8V29ya2Zsb3dUaW1lZE91dD4oXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5Xb3JrZmxvd1RpbWVkT3V0LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBzdGFydFxuICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgIGV4ZWN1dGlvbklkLFxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtZXRyaWNzLnNldFByb3BlcnR5KE9yY2hlc3RyYXRvck1ldHJpY3MuVGltZW91dFN0YXJ0ZWQsIDApO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IHtcbiAgICAgICAgICByZXN1bHQsXG4gICAgICAgICAgY29tbWFuZHM6IG5ld0NvbW1hbmRzLFxuICAgICAgICAgIGhpc3Rvcnk6IHVwZGF0ZWRIaXN0b3J5RXZlbnRzLFxuICAgICAgICB9ID0gdGltZWRTeW5jKFxuICAgICAgICAgIG1ldHJpY3MsXG4gICAgICAgICAgT3JjaGVzdHJhdG9yTWV0cmljcy5BZHZhbmNlRXhlY3V0aW9uRHVyYXRpb24sXG4gICAgICAgICAgKCkgPT4ge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgcmV0dXJuIHByb2dyZXNzV29ya2Zsb3coXG4gICAgICAgICAgICAgICAgd29ya2Zsb3csXG4gICAgICAgICAgICAgICAgaGlzdG9yeSxcbiAgICAgICAgICAgICAgICBldmVudHMsXG4gICAgICAgICAgICAgICAgd29ya2Zsb3dDb250ZXh0LFxuICAgICAgICAgICAgICAgIGV4ZWN1dGlvbklkLFxuICAgICAgICAgICAgICAgIGJhc2VUaW1lXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgICAgY29uc29sZS5sb2coXCJ3b3JrZmxvdyBlcnJvclwiKTtcbiAgICAgICAgICAgICAgZXhlY3V0aW9uTG9nZ2VyLmVycm9yKGluc3BlY3QoZXJyKSk7XG4gICAgICAgICAgICAgIHRocm93IGVycjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICk7XG5cbiAgICAgICAgbWV0cmljcy5zZXRQcm9wZXJ0eShcbiAgICAgICAgICBPcmNoZXN0cmF0b3JNZXRyaWNzLkFkdmFuY2VFeGVjdXRpb25FdmVudHMsXG4gICAgICAgICAgdXBkYXRlZEhpc3RvcnlFdmVudHMubGVuZ3RoXG4gICAgICAgICk7XG5cbiAgICAgICAgeWllbGQqIHVwZGF0ZWRIaXN0b3J5RXZlbnRzO1xuXG4gICAgICAgIGV4ZWN1dGlvbkxvZ2dlci5kZWJ1ZyhcbiAgICAgICAgICBcIldvcmtmbG93IHRlcm1pbmF0ZWQgd2l0aDogXCIgKyBKU09OLnN0cmluZ2lmeShyZXN1bHQpXG4gICAgICAgICk7XG5cbiAgICAgICAgZXhlY3V0aW9uTG9nZ2VyLmluZm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c3RyYXRvck1ldHJpY3MuVGltZVRvQ29tbWFuZHNJbnZva2VkLFxuICAgICAgICAgIG1heFRhc2tBZ2UgKyAobmV3IERhdGUoKS5nZXRUaW1lKCkgLSBzdGFydC5nZXRUaW1lKCkpXG4gICAgICAgICk7XG5cbiAgICAgICAgeWllbGQgY3JlYXRlRXZlbnQ8V29ya2Zsb3dSdW5Db21wbGV0ZWQ+KFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLldvcmtmbG93UnVuQ29tcGxldGVkLFxuICAgICAgICAgIH0sXG4gICAgICAgICAgc3RhcnRcbiAgICAgICAgKTtcblxuICAgICAgICBpZiAoaXNSZXN1bHQocmVzdWx0KSkge1xuICAgICAgICAgIGlmIChpc0ZhaWxlZChyZXN1bHQpKSB7XG4gICAgICAgICAgICBjb25zdCBbZXJyb3IsIG1lc3NhZ2VdID0gZXh0ZW5kc0Vycm9yKHJlc3VsdC5lcnJvcilcbiAgICAgICAgICAgICAgPyBbcmVzdWx0LmVycm9yLm5hbWUsIHJlc3VsdC5lcnJvci5tZXNzYWdlXVxuICAgICAgICAgICAgICA6IFtcIkVycm9yXCIsIEpTT04uc3RyaW5naWZ5KHJlc3VsdC5lcnJvcildO1xuICAgICAgICAgICAgeWllbGQgY3JlYXRlRXZlbnQ8V29ya2Zsb3dGYWlsZWQ+KFxuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuV29ya2Zsb3dGYWlsZWQsXG4gICAgICAgICAgICAgICAgZXJyb3IsXG4gICAgICAgICAgICAgICAgbWVzc2FnZSxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgc3RhcnRcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfSBlbHNlIGlmIChpc1Jlc29sdmVkPGFueT4ocmVzdWx0KSkge1xuICAgICAgICAgICAgeWllbGQgY3JlYXRlRXZlbnQ8V29ya2Zsb3dTdWNjZWVkZWQ+KFxuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuV29ya2Zsb3dTdWNjZWVkZWQsXG4gICAgICAgICAgICAgICAgb3V0cHV0OiByZXN1bHQudmFsdWUsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIHN0YXJ0XG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICB9XG5cbiAgICAgIC8qKlxuICAgICAgICogUGFydGl0aW9ucyB0aGUgZXZlbnRzIG91dHB1dCBieSB0aGUgd29ya2Zsb3cuXG4gICAgICAgKlxuICAgICAgICogV2UgbmVlZCB0d28gZGlmZmVyZW50IGNvbGxlY3Rpb24gb2YgZXZlbnRzLlxuICAgICAgICpcbiAgICAgICAqIEhpc3RvcnkgRXZlbnRzIC0gdGhlc2UgYXJlIHRoZSBldmVudHMgdGhhdCB3b3JrZmxvdyB1c2VzIHRvIG1haW50YWluIHN0YXRlLlxuICAgICAgICogICAgICAgICAgICAgICAgICBlYWNoIHJ1biBvZiB0aGUgd29ya2Zsb3cgd2UgbWF5IGZpbHRlciBvciBhZGQgZXZlbnRzIHRvIHRoaXMgY29sbGVjdGlvbi5cbiAgICAgICAqICAgICAgICAgICAgICAgICAgdGhlc2UgZXZlbnRzIHdpbGwgYmUgcGVyc2lzdGVkIGZvciB0aGUgbmV4dCBydW4uXG4gICAgICAgKiBXb3JrZmxvdyBFdmVudHMgLSB0aGVzZSBhcmUgZmluZWQgZ3JhaW5lZCBldmVudHMgZW1pdHRlZCBieSB0aGUgd29ya2Zsb3cuIFRoZXkgZHJpdmUgVUlzLFxuICAgICAgICogICAgICAgICAgICAgICAgICAgdmlzdWFsaXphdGlvbiBhbmQgZGVidWdnaW5nLiBUaGV5IG1heSBub3QgYmUgdXNlZCBpbiB0aGUgaW50ZXJwcmV0ZXIuXG4gIC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VxuICAgICAgc2xlZXBDb21wbGV0ZWRWYXJpYW5jZS5yZWR1Y2UoKHQsIG4pID0+IHQgKyBuLCAwKSAvXG4gICAgICBzbGVlcENvbXBsZXRlZFZhcmlhbmNlLmxlbmd0aDtcbiAgICBtZXRyaWNzLnNldFByb3BlcnR5KE9yY2hlc3RyYXRvck1ldHJpY3MuU2xlZXBWYXJpYW5jZU1pbGxpcywgYXZnKTtcbiAgfVxufVxuIl19 |
@@ -43,8 +43,4 @@ import { inspect } from "util"; | ||
} | ||
const workflow = lookupWorkflow(workflowName); | ||
if (workflow === undefined) { | ||
throw new Error(`no such workflow with name '${workflowName}'`); | ||
} | ||
// TODO: get workflow from execution id | ||
return orchestrateExecution(workflow, executionId, records, baseTime); | ||
return orchestrateExecution(workflowName, executionId, records, baseTime); | ||
}); | ||
@@ -63,5 +59,5 @@ logger.debug("Executions succeeded: " + | ||
}; | ||
async function orchestrateExecution(workflow, executionId, events, baseTime) { | ||
async function orchestrateExecution(workflowName, executionId, events, baseTime) { | ||
const executionLogger = logger.createChild({ | ||
persistentLogAttributes: { workflowName: workflow.name, executionId }, | ||
persistentLogAttributes: { workflowName, executionId }, | ||
}); | ||
@@ -101,2 +97,11 @@ const metrics = initializeMetrics(); | ||
}, start); | ||
const workflow = lookupWorkflow(workflowName); | ||
if (workflow === undefined) { | ||
yield createEvent({ | ||
type: WorkflowEventType.WorkflowFailed, | ||
error: "WorkflowNotFound", | ||
message: `Workflow name ${workflowName} does not exist.`, | ||
}, start); | ||
return; | ||
} | ||
const workflowContext = { | ||
@@ -140,3 +145,3 @@ name: workflow.workflowName, | ||
executionLogger.info(`Found ${newCommands.length} new commands.`); | ||
yield* await timed(metrics, OrchestratorMetrics.InvokeCommandsDuration, () => processCommands(newCommands)); | ||
yield* await timed(metrics, OrchestratorMetrics.InvokeCommandsDuration, () => processCommands(workflow, newCommands)); | ||
metrics.putMetric(OrchestratorMetrics.CommandsInvoked, newCommands.length, Unit.Count); | ||
@@ -266,3 +271,3 @@ // tracks the time it takes for a workflow task to be scheduled until new commands could be emitted. | ||
*/ | ||
async function processCommands(commands) { | ||
async function processCommands(workflow, commands) { | ||
console.debug("Commands to send", JSON.stringify(commands)); | ||
@@ -278,3 +283,3 @@ // register command events | ||
metrics.setDimensions({ | ||
[MetricsCommon.WorkflowNameDimension]: workflow.workflowName, | ||
[MetricsCommon.WorkflowNameDimension]: workflowName, | ||
}); | ||
@@ -310,2 +315,2 @@ // number of events that came from the workflow task | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JjaGVzdHJhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3J1bnRpbWUvaGFuZGxlcnMvb3JjaGVzdHJhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFHL0IsT0FBTyxFQUNMLFdBQVcsRUFDWCxVQUFVLEVBRVYsY0FBYyxFQUNkLGdCQUFnQixFQUNoQixtQkFBbUIsRUFDbkIsZ0JBQWdCLEVBQ2hCLGlCQUFpQixFQUdqQixpQkFBaUIsR0FLbEIsTUFBTSwwQkFBMEIsQ0FBQztBQUNsQyxPQUFPLEVBRUwsZUFBZSxFQUVmLG9CQUFvQixHQUNyQixNQUFNLG9CQUFvQixDQUFDO0FBQzVCLE9BQU8sRUFBRSxRQUFRLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBVSxNQUFNLGlCQUFpQixDQUFDO0FBQ3pFLE9BQU8sRUFBRSxjQUFjLEVBQUUsZ0JBQWdCLEVBQVksTUFBTSxtQkFBbUIsQ0FBQztBQUMvRSxPQUFPLEVBSUwsUUFBUSxHQUlULE1BQU0scUJBQXFCLENBQUM7QUFDN0IsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQ3pEL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ZlIGZhaWxlZCkuXG4gICAgICAgICAqIElmIHNvLCBjaGVjayB0byBzZWUgaWYgdGhlIHdvcmtmbG93IGhhcyB0aW1lb3V0IHRvIHN0YXJ0LlxuICAgICAgICAgKi9cbiAgICAgICAgaWYgKCFzdGFydEV2ZW50KSB7XG4gICAgICAgICAgY29uc3QgbmV3V29ya2Zsb3dTdGFydCA9IGV2ZW50cy5maW5kKGlzV29ya2Zsb3dTdGFydGVkKTtcblxuICAgICAgICAgIGlmIChuZXdXb3JrZmxvd1N0YXJ0Py50aW1lb3V0VGltZSkge1xuICAgICAgICAgICAgbWV0cmljcy5zZXRQcm9wZXJ0eShPcmNoZXN0cmF0b3JNZXRyaWNzLlRpbWVvdXRTdGFydGVkLCAxKTtcbiAgICAgICAgICAgIGF3YWl0IHRpbWVkKFxuICAgICAgICAgICAgICBtZXRyaWNzLFxuICAgICAgICAgICAgICBPcmNoZXN0cmF0b3JNZXRyaWNzLlRpbWVvdXRTdGFydGVkRHVyYXRpb24sXG4gICAgICAgICAgICAgICgpID0+XG4gICAgICAgICAgICAgICAgdGltZXJDbGllbnQuc2NoZWR1bGVFdmVudDxXb3JrZmxvd1RpbWVkT3V0Pih7XG4gICAgICAgICAgICAgICAgICBzY2hlZHVsZTogU2NoZWR1bGUuYWJzb2x1dGUobmV3V29ya2Zsb3dTdGFydC50aW1lb3V0VGltZSEpLFxuICAgICAgICAgICAgICAgICAgZXZlbnQ6IGNyZWF0ZUV2ZW50PFdvcmtmbG93VGltZWRPdXQ+KFxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuV29ya2Zsb3dUaW1lZE91dCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgc3RhcnRcbiAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICBleGVjdXRpb25JZCxcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbWV0cmljcy5zZXRQcm9wZXJ0eShPcmNoZXN0cmF0b3JNZXRyaWNzLlRpbWVvdXRTdGFydGVkLCAwKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCB7XG4gICAgICAgICAgcmVzdWx0LFxuICAgICAgICAgIGNvbW1hbmRzOiBuZXdDb21tYW5kcyxcbiAgICAgICAgICBoaXN0b3J5OiB1cGRhdGVkSGlzdG9yeUV2ZW50cyxcbiAgICAgICAgfSA9IHRpbWVkU3luYyhcbiAgICAgICAgICBtZXRyaWNzLFxuICAgICAgICAgIE9yY2hlc3RyYXRvck1ldHJpY3MuQWR2YW5jZUV4ZWN1dGlvbkR1cmF0aW9uLFxuICAgICAgICAgICgpID0+IHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIHJldHVybiBwcm9ncmVzc1dvcmtmbG93KFxuICAgICAgICAgICAgICAgIHdvcmtmbG93LFxuICAgICAgICAgICAgICAgIGhpc3RvcnksXG4gICAgICAgICAgICAgICAgZXZlbnRzLFxuICAgICAgICAgICAgICAgIHdvcmtmbG93Q29udGV4dCxcbiAgICAgICAgICAgICAgICBleGVjdXRpb25JZCxcbiAgICAgICAgICAgICAgICBiYXNlVGltZVxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwid29ya2Zsb3cgZXJyb3JcIik7XG4gICAgICAgICAgICAgIGV4ZWN1dGlvbkxvZ2dlci5lcnJvcihpbnNwZWN0KGVycikpO1xuICAgICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICApO1xuXG4gICAgICAgIG1ldHJpY3Muc2V0UHJvcGVydHkoXG4gICAgICAgICAgT3JjaGVzdHJhdG9yTWV0cmljcy5BZHZhbmNlRXhl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gICB7XG4gICAgICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuV29ya2Zsb3dGYWlsZWQsXG4gICAgICAgICAgICAgICAgZXJyb3IsXG4gICAgICAgICAgICAgICAgbWVzc2FnZSxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgc3RhcnRcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfSBlbHNlIGlmIChpc1Jlc29sdmVkPGFueT4ocmVzdWx0KSkge1xuICAgICAgICAgICAgeWllbGQgY3JlYXRlRXZlbnQ8V29ya2Zsb3dTdWNjZWVkZWQ+KFxuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuV29ya2Zsb3dTdWNjZWVkZWQsXG4gICAgICAgICAgICAgICAgb3V0cHV0OiByZXN1bHQudmFsdWUsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIHN0YXJ0XG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICB9XG5cbiAgICAgIC8qKlxuICAgICAgICogUGFydGl0aW9ucyB0aGUgZXZlbnRzIG91dHB1dCBieSB0aGUgd29ya2Zsb3cuXG4gICAgICAgKlxuICAgICAgICogV2UgbmVlZCB0d28gZGlmZmVyZW50IGNvbGxlY3Rpb24gb2YgZXZlbnRzLlxuICAgICAgICpcbiAgICAgICAqIEhpc3RvcnkgRXZlbnRzIC0gdGhlc2UgYXJlIHRoZSBldmVudHMgdGhhdCB3b3JrZmxvdyB1c2VzIHRvIG1haW50YWluIHN0YXRlLlxuICAgICAgICogICAgICAgICAgICAgICAgICBlYWNoIHJ1biBvZiB0aGUgd29ya2Zsb3cgd2UgbWF5IGZpbHRlciBvciBhZGQgZXZlbnRzIHRvIHRoaXMgY29sbGVjdGlvbi5cbiAgICAgICAqICAgICAgICAgICAgICAgICAgdGhlc2UgZXZlbnR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xuICAgICAgICAgICAgbWV0cmljcyxcbiAgICAgICAgICAgIE9yY2hlc3RyYXRvck1ldHJpY3MuRXhlY3V0aW9uU3RhdHVzVXBkYXRlRHVyYXRpb24sXG4gICAgICAgICAgICAoKSA9PlxuICAgICAgICAgICAgICB3b3JrZmxvd1J1bnRpbWVDbGllbnQuZmFpbEV4ZWN1dGlvbih7XG4gICAgICAgICAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgICAgICAgICAgZXJyb3I6IHJlc3VsdEV2ZW50LmVycm9yLFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6IHJlc3VsdEV2ZW50Lm1lc3NhZ2UsXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgKTtcblxuICAgICAgICAgIGxvZ0V4ZWN1dGlvbkNvbXBsZXRlTWV0cmljcyhleGVjdXRpb24pO1xuICAgICAgICB9IGVsc2UgaWYgKGlzV29ya2Zsb3dTdWNjZWVkZWQocmVzdWx0RXZlbnQpKSB7XG4gICAgICAgICAgY29uc3QgZXhlY3V0aW9uID0gYXdhaXQgdGltZWQoXG4gICAgICAgICAgICBtZXRyaWNzLFxuICAgICAgICAgICAgT3JjaGVzdHJhdG9yTWV0cmljcy5FeGVjdXRpb25TdGF0dXNVcGRhdGVEdXJhdGlvbixcbiAgICAgICAgICAgICgpID0+XG4gICAgICAgICAgICAgIHdvcmtmbG93UnVudGltZUNsaWVudC5zdWNjZWVkRXhlY3V0aW9uKHtcbiAgICAgICAgICAgICAgICBleGVjdXRpb25JZCxcbiAgICAgICAgICAgICAgICByZXN1bHQ6IHJlc3VsdEV2ZW50Lm91dHB1dCxcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICApO1xuICAgICAgICAgIGxvZ0V4ZWN1dGlvbkNvbXBsZXRlTWV0cmljcyhleGVjdXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogR2VuZXJhdGUgZXZlbnRzIGZyb20gY29tbWFuZ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lbnQ8V29ya2Zsb3dGYWlsZWQ+KFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5Xb3JrZmxvd0ZhaWxlZCxcbiAgICAgICAgICAgICAgZXJyb3I6IFwiV29ya2Zsb3dOb3RGb3VuZFwiLFxuICAgICAgICAgICAgICBtZXNzYWdlOiBgV29ya2Zsb3cgbmFtZSAke3dvcmtmbG93TmFtZX0gZG9lcyBub3QgZXhpc3QuYCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzdGFydFxuICAgICAgICAgICk7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3Qgd29ya2Zsb3dDb250ZXh0OiBXb3JrZmxvd0NvbnRleHQgPSB7XG4gICAgICAgICAgbmFtZTogd29ya2Zsb3chLndvcmtmbG93TmFtZSxcbiAgICAgICAgfTtcblxuICAgICAgICBjb25zdCBzdGFydEV2ZW50ID0gaGlzdG9yeS5maW5kKGlzV29ya2Zsb3dTdGFydGVkKTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQ2hlY2sgdG8gc2VlIGlmIHRoaXMgaXMgdGhlIGZpcnN0IHJ1biBvZiB0aGUgd29ya2Zsb3cgKG9yIGFsbCBvdGhlcnMgaGF2ZSBmYWlsZWQpLlxuICAgICAgICAgKiBJZiBzbywgY2hlY2sgdG8gc2VlIGlmIHRoZSB3b3JrZmxvdyBoYXMgdGltZW91dCB0byBzdGFydC5cbiAgICAgICAgICovXG4gICAgICAgIGlmICghc3RhcnRFdmVudCkge1xuICAgICAgICAgIGNvbnN0IG5ld1dvcmtmbG93U3RhcnQgPSBldmVudHMuZmluZChpc1dvcmtmbG93U3RhcnRlZCk7XG5cbiAgICAgICAgICBpZiAobmV3V29ya2Zsb3dTdGFydD8udGltZW91dFRpbWUpIHtcbiAgICAgICAgICAgIG1ldHJpY3Muc2V0UHJvcGVydHkoT3JjaGVzdHJhdG9yTWV0cmljcy5UaW1lb3V0U3RhcnRlZCwgMSk7XG4gICAgICAgICAgICBhd2FpdCB0aW1lZChcbiAgICAgICAgICAgICAgbWV0cmljcyxcbiAgICAgICAgICAgICAgT3JjaGVzdHJhdG9yTWV0cmljcy5UaW1lb3V0U3RhcnRlZER1cmF0aW9uLFxuICAgICAgICAgICAgICAoKSA9PlxuICAgICAgICAgICAgICAgIHRpbWVyQ2xpZW50LnNjaGVkdWxlRXZlbnQ8V29ya2Zsb3dUaW1lZE91dD4oe1xuICAgICAgICAgICAgICAgICAgc2NoZWR1bGU6IFNjaGVkdWxlLmFic29sdXRlKG5ld1dvcmtmbG93U3RhcnQudGltZW91dFRpbWUhKSxcbiAgICAgICAgICAgICAgICAgIGV2ZW50OiBjcmVhdGVFdmVudDxXb3JrZmxvd1RpbWVkT3V0PihcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLldvcmtmbG93VGltZWRPdXQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0XG4gICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1ldHJpY3Muc2V0UHJvcGVydHkoT3JjaGVzdHJhdG9yTWV0cmljcy5UaW1lb3V0U3RhcnRlZCwgMCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29uc3Qge1xuICAgICAgICAgIHJlc3VsdCxcbiAgICAgICAgICBjb21tYW5kczogbmV3Q29tbWFuZHMsXG4gICAgICAgICAgaGlzdG9yeTogdXBkYXRlZEhpc3RvcnlFdmVudHMsXG4gICAgICAgIH0gPSB0aW1lZFN5bmMoXG4gICAgICAgICAgbWV0cmljcyxcbiAgICAgICAgICBPcmNoZXN0cmF0b3JNZXRyaWNzLkFkdmFuY2VFeGVjdXRpb25EdXJhdGlvbixcbiAgICAgICAgICAoKSA9PiB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICByZXR1cm4gcHJvZ3Jlc3NXb3JrZmxvdyhcbiAgICAgICAgICAgICAgICB3b3JrZmxvdyxcbiAgICAgICAgICAgICAgICBoaXN0b3J5LFxuICAgICAgICAgICAgICAgIGV2ZW50cyxcbiAgICAgICAgICAgICAgICB3b3JrZmxvd0NvbnRleHQsXG4gICAgICAgICAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgICAgICAgICAgYmFzZVRpbWVcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIndvcmtmbG93IGVycm9yXCIpO1xuICAgICAgICAgICAgICBleGVjdXRpb25Mb2dnZXIuZXJyb3IoaW5zcGVjdChlcnIpKTtcbiAgICAgICAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgKTtcblxuICAgICAgICBtZXRyaWNzLnNldFByb3BlcnR5KFxuICAgICAgICAgIE9yY2hlc3RyYXRvck1ldHJpY3MuQWR2YW5jZUV4ZWN1dGlvbkV2ZW50cyxcbiAgICAgICAgICB1cGRhdGVkSGlzdG9yeUV2ZW50cy5sZW5ndGhcbiAgICAgICAgKTtcblxuICAgICAgICB5aWVsZCogdXBkYXRlZEhpc3RvcnlFdmVudHM7XG5cbiAgICAgICAgZXhlY3V0aW9uTG9nZ2VyLmRlYnVnKFxuICAgICAgICAgIFwiV29ya2Zsb3cgdGVybWluYXRlZCB3aXRoOiBcIiArIEpTT04uc3RyaW5naWZ5KHJlc3VsdClcbiAgICAgICAgKTtcblxuICAgICAgICBleGVjdXRpb25Mb2dnZXIuaW5mbyhgRm91bmQgJHtuZXdDb21tYW5kcy5sZW5ndGh9IG5ldyBj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sXG4gICAgICAgICAgbWF4VGFza0FnZSArIChuZXcgRGF0ZSgpLmdldFRpbWUoKSAtIHN0YXJ0LmdldFRpbWUoKSlcbiAgICAgICAgKTtcblxuICAgICAgICB5aWVsZCBjcmVhdGVFdmVudDxXb3JrZmxvd1J1bkNvbXBsZXRlZD4oXG4gICAgICAgICAge1xuICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuV29ya2Zsb3dSdW5Db21wbGV0ZWQsXG4gICAgICAgICAgfSxcbiAgICAgICAgICBzdGFydFxuICAgICAgICApO1xuXG4gICAgICAgIGlmIChpc1Jlc3VsdChyZXN1bHQpKSB7XG4gICAgICAgICAgaWYgKGlzRmFpbGVkKHJlc3VsdCkpIHtcbiAgICAgICAgICAgIGNvbnN0IFtlcnJvciwgbWVzc2FnZV0gPSBleHRlbmRzRXJyb3IocmVzdWx0LmVycm9yKVxuICAgICAgICAgICAgICA/IFtyZXN1bHQuZXJyb3IubmFtZSwgcmVzdWx0LmVycm9yLm1lc3NhZ2VdXG4gICAgICAgICAgICAgIDogW1wiRXJyb3JcIiwgSlNPTi5zdHJpbmdpZnkocmVzdWx0LmVycm9yKV07XG4gICAgICAgICAgICB5aWVsZCBjcmVhdGVFdmVudDxXb3JrZmxvd0ZhaWxlZD4oXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5Xb3JrZmxvd0ZhaWxlZCxcbiAgICAgICAgICAgICAgICBlcnJvcixcbiAgICAgICAgICAgICAgICBtZXNzYWdlLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBzdGFydFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9IGVsc2UgaWYgKGlzUmVzb2x2ZWQ8YW55PihyZXN1bHQpKSB7XG4gICAgICAgICAgICB5aWVsZCBjcmVhdGVFdmVudDxXb3JrZmxvd1N1Y2NlZWRlZD4oXG4gICAgICAgICAgICAgIHtcbiAgICAgIC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wgbikgPT4gdCArIG4sIDApIC9cbiAgICAgIHNsZWVwQ29tcGxldGVkVmFyaWFuY2UubGVuZ3RoO1xuICAgIG1ldHJpY3Muc2V0UHJvcGVydHkoT3JjaGVzdHJhdG9yTWV0cmljcy5TbGVlcFZhcmlhbmNlTWlsbGlzLCBhdmcpO1xuICB9XG59XG4iXX0= |
{ | ||
"name": "@eventual/core", | ||
"version": "0.7.8", | ||
"version": "0.7.9", | ||
"exports": { | ||
@@ -5,0 +5,0 @@ ".": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1481408
11725