@temporalio/workflow
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -11,3 +11,3 @@ /** | ||
* `clearTimeout` with deterministic versions so these are also usable but have a limitation that they don't play well | ||
* with {@link https://docs.temporal.io/typescript/workflow-scopes-and-cancellation | cancellation scopes}. | ||
* with {@link https://docs.temporal.io/typescript/cancellation-scopes | cancellation scopes}. | ||
* | ||
@@ -38,13 +38,11 @@ * <!--SNIPSTART typescript-sleep-workflow--> | ||
* | ||
* ### Deterministic built-ins | ||
* It is safe to call `Math.random()` and `Date()` in workflow code as they are replaced with deterministic versions. We | ||
* also provide a deterministic {@link uuid4} function for convenience. | ||
* ### More | ||
* | ||
* ### [Cancellation and scopes](https://docs.temporal.io/typescript/workflow-scopes-and-cancellation) | ||
* - {@link CancellationScope} | ||
* - {@link Trigger} | ||
* - [Deterministic built-ins](https://docs.temporal.io/typescript/determinism#sources-of-non-determinism) | ||
* - [Cancellation and scopes](https://docs.temporal.io/typescript/cancellation-scopes) | ||
* - {@link CancellationScope} | ||
* - {@link Trigger} | ||
* - [Sinks](https://docs.temporal.io/application-development/observability/?lang=ts#logging) | ||
* - {@link Sinks} | ||
* | ||
* ### [Sinks](https://docs.temporal.io/typescript/sinks) | ||
* - {@link Sinks} | ||
* | ||
* @module | ||
@@ -51,0 +49,0 @@ */ |
@@ -12,3 +12,3 @@ "use strict"; | ||
* `clearTimeout` with deterministic versions so these are also usable but have a limitation that they don't play well | ||
* with {@link https://docs.temporal.io/typescript/workflow-scopes-and-cancellation | cancellation scopes}. | ||
* with {@link https://docs.temporal.io/typescript/cancellation-scopes | cancellation scopes}. | ||
* | ||
@@ -39,13 +39,11 @@ * <!--SNIPSTART typescript-sleep-workflow--> | ||
* | ||
* ### Deterministic built-ins | ||
* It is safe to call `Math.random()` and `Date()` in workflow code as they are replaced with deterministic versions. We | ||
* also provide a deterministic {@link uuid4} function for convenience. | ||
* ### More | ||
* | ||
* ### [Cancellation and scopes](https://docs.temporal.io/typescript/workflow-scopes-and-cancellation) | ||
* - {@link CancellationScope} | ||
* - {@link Trigger} | ||
* - [Deterministic built-ins](https://docs.temporal.io/typescript/determinism#sources-of-non-determinism) | ||
* - [Cancellation and scopes](https://docs.temporal.io/typescript/cancellation-scopes) | ||
* - {@link CancellationScope} | ||
* - {@link Trigger} | ||
* - [Sinks](https://docs.temporal.io/application-development/observability/?lang=ts#logging) | ||
* - {@link Sinks} | ||
* | ||
* ### [Sinks](https://docs.temporal.io/typescript/sinks) | ||
* - {@link Sinks} | ||
* | ||
* @module | ||
@@ -52,0 +50,0 @@ */ |
@@ -141,3 +141,3 @@ import { RetryPolicy, TemporalFailure } from '@temporalio/common'; | ||
* Timeout for the entire Workflow run | ||
* @format {@link https://www.npmjs.com/package/ms | ms} formatted string | ||
* @format {@link https://www.npmjs.com/package/ms | ms-formatted string} | ||
*/ | ||
@@ -147,3 +147,3 @@ workflowRunTimeout?: string; | ||
* Timeout for a single Workflow task | ||
* @format {@link https://www.npmjs.com/package/ms | ms} formatted string | ||
* @format {@link https://www.npmjs.com/package/ms | ms-formatted string} | ||
*/ | ||
@@ -150,0 +150,0 @@ workflowTaskTimeout?: string; |
@@ -49,2 +49,3 @@ "use strict"; | ||
(0, internal_workflow_common_1.checkExtends)(); | ||
(0, internal_workflow_common_1.checkExtends)(); | ||
/** | ||
@@ -77,2 +78,3 @@ * How a Child Workflow reacts to the Parent Workflow reaching a Closed state. | ||
(0, internal_workflow_common_1.checkExtends)(); | ||
(0, internal_workflow_common_1.checkExtends)(); | ||
//# sourceMappingURL=interfaces.js.map |
@@ -33,2 +33,3 @@ "use strict"; | ||
(0, internal_workflow_common_1.checkExtends)(); | ||
(0, internal_workflow_common_1.checkExtends)(); | ||
/** | ||
@@ -35,0 +36,0 @@ * A class that acts as a marker for this special result type |
@@ -14,3 +14,3 @@ import { ActivityFunction, ActivityOptions, LocalActivityOptions, QueryDefinition, SearchAttributes, SignalDefinition, UntypedActivities, WithWorkflowArgs, Workflow, WorkflowResultType, WorkflowReturnType } from '@temporalio/internal-workflow-common'; | ||
* | ||
* @param ms sleep duration - {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds. | ||
* @param ms sleep duration - number of milliseconds or {@link https://www.npmjs.com/package/ms | ms-formatted string}. | ||
* If given a negative number or 0, value will be set to 1. | ||
@@ -342,3 +342,3 @@ */ | ||
* | ||
* @param timeout {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds | ||
* @param timeout number of milliseconds or {@link https://www.npmjs.com/package/ms | ms-formatted string} | ||
* | ||
@@ -345,0 +345,0 @@ * @returns a boolean indicating whether the condition was true before the timeout expires |
@@ -65,3 +65,3 @@ "use strict"; | ||
* | ||
* @param ms sleep duration - {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds. | ||
* @param ms sleep duration - number of milliseconds or {@link https://www.npmjs.com/package/ms | ms-formatted string}. | ||
* If given a negative number or 0, value will be set to 1. | ||
@@ -128,2 +128,3 @@ */ | ||
cancellationType: options.cancellationType, | ||
doNotEagerlyExecute: !(options.allowEagerDispatch ?? true), | ||
}, | ||
@@ -254,19 +255,7 @@ }); | ||
const complete = !internals_1.state.completions.childWorkflowComplete.has(seq); | ||
const started = !internals_1.state.completions.childWorkflowStart.has(seq); | ||
if (started && !complete) { | ||
const cancelSeq = internals_1.state.nextSeqs.cancelWorkflow++; | ||
if (!complete) { | ||
internals_1.state.pushCommand({ | ||
requestCancelExternalWorkflowExecution: { | ||
seq: cancelSeq, | ||
childWorkflowId: workflowId, | ||
}, | ||
cancelChildWorkflowExecution: { childWorkflowSeq: seq }, | ||
}); | ||
// Not interested in this completion | ||
internals_1.state.completions.cancelWorkflow.set(cancelSeq, { resolve: () => undefined, reject: () => undefined }); | ||
} | ||
else if (!started) { | ||
internals_1.state.pushCommand({ | ||
cancelUnstartedChildWorkflowExecution: { childWorkflowSeq: seq }, | ||
}); | ||
} | ||
// Nothing to cancel otherwise | ||
@@ -273,0 +262,0 @@ })); |
{ | ||
"name": "@temporalio/workflow", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Temporal.io SDK Workflow sub-package", | ||
@@ -20,5 +20,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@temporalio/common": "^1.1.0", | ||
"@temporalio/internal-workflow-common": "^1.1.0", | ||
"@temporalio/proto": "^1.1.0" | ||
"@temporalio/common": "^1.3.0", | ||
"@temporalio/internal-workflow-common": "^1.3.0", | ||
"@temporalio/proto": "^1.3.0" | ||
}, | ||
@@ -35,3 +35,3 @@ "devDependencies": { | ||
], | ||
"gitHead": "9790992f0a7da1638cd3db99518e414107651630" | ||
"gitHead": "966d51d3545a5e84102190f5b762160b9dfe99c2" | ||
} |
@@ -11,3 +11,3 @@ /** | ||
* `clearTimeout` with deterministic versions so these are also usable but have a limitation that they don't play well | ||
* with {@link https://docs.temporal.io/typescript/workflow-scopes-and-cancellation | cancellation scopes}. | ||
* with {@link https://docs.temporal.io/typescript/cancellation-scopes | cancellation scopes}. | ||
* | ||
@@ -38,13 +38,11 @@ * <!--SNIPSTART typescript-sleep-workflow--> | ||
* | ||
* ### Deterministic built-ins | ||
* It is safe to call `Math.random()` and `Date()` in workflow code as they are replaced with deterministic versions. We | ||
* also provide a deterministic {@link uuid4} function for convenience. | ||
* ### More | ||
* | ||
* ### [Cancellation and scopes](https://docs.temporal.io/typescript/workflow-scopes-and-cancellation) | ||
* - {@link CancellationScope} | ||
* - {@link Trigger} | ||
* - [Deterministic built-ins](https://docs.temporal.io/typescript/determinism#sources-of-non-determinism) | ||
* - [Cancellation and scopes](https://docs.temporal.io/typescript/cancellation-scopes) | ||
* - {@link CancellationScope} | ||
* - {@link Trigger} | ||
* - [Sinks](https://docs.temporal.io/application-development/observability/?lang=ts#logging) | ||
* - {@link Sinks} | ||
* | ||
* ### [Sinks](https://docs.temporal.io/typescript/sinks) | ||
* - {@link Sinks} | ||
* | ||
* @module | ||
@@ -51,0 +49,0 @@ */ |
@@ -172,3 +172,3 @@ import { RetryPolicy, TemporalFailure } from '@temporalio/common'; | ||
* Timeout for the entire Workflow run | ||
* @format {@link https://www.npmjs.com/package/ms | ms} formatted string | ||
* @format {@link https://www.npmjs.com/package/ms | ms-formatted string} | ||
*/ | ||
@@ -178,3 +178,3 @@ workflowRunTimeout?: string; | ||
* Timeout for a single Workflow task | ||
* @format {@link https://www.npmjs.com/package/ms | ms} formatted string | ||
* @format {@link https://www.npmjs.com/package/ms | ms-formatted string} | ||
*/ | ||
@@ -228,2 +228,3 @@ workflowTaskTimeout?: string; | ||
checkExtends<coresdk.child_workflow.ChildWorkflowCancellationType, ChildWorkflowCancellationType>(); | ||
checkExtends<ChildWorkflowCancellationType, coresdk.child_workflow.ChildWorkflowCancellationType>(); | ||
@@ -260,2 +261,3 @@ /** | ||
checkExtends<coresdk.child_workflow.ParentClosePolicy, ParentClosePolicy>(); | ||
checkExtends<ParentClosePolicy, coresdk.child_workflow.ParentClosePolicy>(); | ||
@@ -262,0 +264,0 @@ export interface ChildWorkflowOptions extends CommonWorkflowOptions { |
@@ -42,2 +42,3 @@ import { PayloadConverter } from '@temporalio/common'; | ||
checkExtends<coresdk.child_workflow.StartChildWorkflowExecutionFailedCause, StartChildWorkflowExecutionFailedCause>(); | ||
checkExtends<StartChildWorkflowExecutionFailedCause, coresdk.child_workflow.StartChildWorkflowExecutionFailedCause>(); | ||
@@ -44,0 +45,0 @@ export interface Stack { |
@@ -105,3 +105,3 @@ import { mapToPayloads, searchAttributePayloadConverter, toPayloads } from '@temporalio/common'; | ||
* | ||
* @param ms sleep duration - {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds. | ||
* @param ms sleep duration - number of milliseconds or {@link https://www.npmjs.com/package/ms | ms-formatted string}. | ||
* If given a negative number or 0, value will be set to 1. | ||
@@ -175,2 +175,3 @@ */ | ||
cancellationType: options.cancellationType, | ||
doNotEagerlyExecute: !(options.allowEagerDispatch ?? true), | ||
}, | ||
@@ -330,18 +331,7 @@ }); | ||
const complete = !state.completions.childWorkflowComplete.has(seq); | ||
const started = !state.completions.childWorkflowStart.has(seq); | ||
if (started && !complete) { | ||
const cancelSeq = state.nextSeqs.cancelWorkflow++; | ||
if (!complete) { | ||
state.pushCommand({ | ||
requestCancelExternalWorkflowExecution: { | ||
seq: cancelSeq, | ||
childWorkflowId: workflowId, | ||
}, | ||
cancelChildWorkflowExecution: { childWorkflowSeq: seq }, | ||
}); | ||
// Not interested in this completion | ||
state.completions.cancelWorkflow.set(cancelSeq, { resolve: () => undefined, reject: () => undefined }); | ||
} else if (!started) { | ||
state.pushCommand({ | ||
cancelUnstartedChildWorkflowExecution: { childWorkflowSeq: seq }, | ||
}); | ||
} | ||
@@ -1084,3 +1074,3 @@ // Nothing to cancel otherwise | ||
* | ||
* @param timeout {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds | ||
* @param timeout number of milliseconds or {@link https://www.npmjs.com/package/ms | ms-formatted string} | ||
* | ||
@@ -1087,0 +1077,0 @@ * @returns a boolean indicating whether the condition was true before the timeout expires |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
321014
6863