Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@temporalio/workflow

Package Overview
Dependencies
Maintainers
6
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@temporalio/workflow - npm Package Compare versions

Comparing version 1.0.0-rc.0 to 1.0.0-rc.1

src/alea.ts

14

lib/errors.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isCancellation = exports.DeterminismViolationError = exports.WorkflowError = exports.WorkflowExecutionAlreadyStartedError = void 0;
const common_1 = require("@temporalio/common");
var common_2 = require("@temporalio/common");
Object.defineProperty(exports, "WorkflowExecutionAlreadyStartedError", { enumerable: true, get: function () { return common_2.WorkflowExecutionAlreadyStartedError; } });
var common_1 = require("@temporalio/common");
Object.defineProperty(exports, "WorkflowExecutionAlreadyStartedError", { enumerable: true, get: function () { return common_1.WorkflowExecutionAlreadyStartedError; } });
/**

@@ -27,2 +26,5 @@ * Base class for all workflow errors

exports.DeterminismViolationError = DeterminismViolationError;
function looksLikeError(err) {
return typeof err === 'object' && err != null && Object.prototype.hasOwnProperty.call(err, 'name');
}
/**

@@ -32,6 +34,8 @@ * Returns whether provided `err` is caused by cancellation

function isCancellation(err) {
return (err instanceof common_1.CancelledFailure ||
((err instanceof common_1.ActivityFailure || err instanceof common_1.ChildWorkflowFailure) && isCancellation(err.cause)));
if (!looksLikeError(err))
return false;
return (err.name === 'CancelledFailure' ||
((err.name === 'ActivityFailure' || err.name === 'ChildWorkflowFailure') && isCancellation(err.cause)));
}
exports.isCancellation = isCancellation;
//# sourceMappingURL=errors.js.map

@@ -5,8 +5,9 @@ /**

* ## Usage
* See the [tutorial](https://docs.temporal.io/typescript/hello-world#workflows) for writing your first workflow.
* See the {@link https://docs.temporal.io/typescript/hello-world#workflows | tutorial} for writing your first workflow.
*
* ### Timers
*
* The recommended way of scheduling timers is by using the {@link sleep} function.
* We've replaced `setTimeout` and `clearTimeout` with deterministic versions so these are also usable but have a limitation that they don't play well with [cancellation scopes](https://docs.temporal.io/typescript/workflow-scopes-and-cancellation).
* The recommended way of scheduling timers is by using the {@link sleep} function. We've replaced `setTimeout` and
* `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}.
*

@@ -25,7 +26,8 @@ * <!--SNIPSTART typescript-sleep-workflow-->

*
* To add signal handlers to a Workflow, add a signals property to the exported `workflow` object.
* Signal handlers can return either `void` or `Promise<void>`, you may schedule activities and timers from a signal handler.
* To add signal handlers to a Workflow, add a signals property to the exported `workflow` object. Signal handlers can
* return either `void` or `Promise<void>`, you may schedule activities and timers from a signal handler.
*
* To add query handlers to a Workflow, add a queries property to the exported `workflow` object.
* Query handlers must **not** mutate any variables or generate any commands (like Activities or Timers), they run synchronously and thus **must** return a `Promise`.
* To add query handlers to a Workflow, add a queries property to the exported `workflow` object. Query handlers must
* **not** mutate any variables or generate any commands (like Activities or Timers), they run synchronously and thus
* **must** return a `Promise`.
*

@@ -38,3 +40,4 @@ * #### Implementation

* ### 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.
* 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.
*

@@ -51,4 +54,7 @@ * ### [Cancellation and scopes](https://docs.temporal.io/typescript/workflow-scopes-and-cancellation)

export { ActivityFailure, ApplicationFailure, CancelledFailure, ChildWorkflowFailure, defaultPayloadConverter, PayloadConverter, rootCause, ServerFailure, TemporalFailure, TerminatedFailure, TimeoutFailure, } from '@temporalio/common';
export { ActivityCancellationType, ActivityFunction, ActivityInterface, ActivityOptions, IllegalStateError, RetryPolicy, ValueError, } from '@temporalio/internal-workflow-common';
export { ActivityCancellationType, ActivityFunction, ActivityInterface, // eslint-disable-line deprecation/deprecation
ActivityOptions, RetryPolicy, UntypedActivities, } from '@temporalio/internal-workflow-common';
export * from '@temporalio/internal-workflow-common/lib/errors';
export * from '@temporalio/internal-workflow-common/lib/interfaces';
export * from '@temporalio/internal-workflow-common/lib/workflow-handle';
export * from '@temporalio/internal-workflow-common/lib/workflow-options';

@@ -55,0 +61,0 @@ export { AsyncLocalStorage, CancellationScope, CancellationScopeOptions, ROOT_SCOPE } from './cancellation-scope';

@@ -6,8 +6,9 @@ "use strict";

* ## Usage
* See the [tutorial](https://docs.temporal.io/typescript/hello-world#workflows) for writing your first workflow.
* See the {@link https://docs.temporal.io/typescript/hello-world#workflows | tutorial} for writing your first workflow.
*
* ### Timers
*
* The recommended way of scheduling timers is by using the {@link sleep} function.
* We've replaced `setTimeout` and `clearTimeout` with deterministic versions so these are also usable but have a limitation that they don't play well with [cancellation scopes](https://docs.temporal.io/typescript/workflow-scopes-and-cancellation).
* The recommended way of scheduling timers is by using the {@link sleep} function. We've replaced `setTimeout` and
* `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}.
*

@@ -26,7 +27,8 @@ * <!--SNIPSTART typescript-sleep-workflow-->

*
* To add signal handlers to a Workflow, add a signals property to the exported `workflow` object.
* Signal handlers can return either `void` or `Promise<void>`, you may schedule activities and timers from a signal handler.
* To add signal handlers to a Workflow, add a signals property to the exported `workflow` object. Signal handlers can
* return either `void` or `Promise<void>`, you may schedule activities and timers from a signal handler.
*
* To add query handlers to a Workflow, add a queries property to the exported `workflow` object.
* Query handlers must **not** mutate any variables or generate any commands (like Activities or Timers), they run synchronously and thus **must** return a `Promise`.
* To add query handlers to a Workflow, add a queries property to the exported `workflow` object. Query handlers must
* **not** mutate any variables or generate any commands (like Activities or Timers), they run synchronously and thus
* **must** return a `Promise`.
*

@@ -39,3 +41,4 @@ * #### Implementation

* ### 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.
* 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.
*

@@ -66,3 +69,3 @@ * ### [Cancellation and scopes](https://docs.temporal.io/typescript/workflow-scopes-and-cancellation)

Object.defineProperty(exports, "__esModule", { value: true });
exports.Trigger = exports.ParentClosePolicy = exports.ContinueAsNew = exports.ChildWorkflowCancellationType = exports.ROOT_SCOPE = exports.CancellationScope = exports.AsyncLocalStorage = exports.ValueError = exports.IllegalStateError = exports.ActivityCancellationType = exports.TimeoutFailure = exports.TerminatedFailure = exports.TemporalFailure = exports.ServerFailure = exports.rootCause = exports.defaultPayloadConverter = exports.ChildWorkflowFailure = exports.CancelledFailure = exports.ApplicationFailure = exports.ActivityFailure = void 0;
exports.Trigger = exports.ParentClosePolicy = exports.ContinueAsNew = exports.ChildWorkflowCancellationType = exports.ROOT_SCOPE = exports.CancellationScope = exports.AsyncLocalStorage = exports.ActivityCancellationType = exports.TimeoutFailure = exports.TerminatedFailure = exports.TemporalFailure = exports.ServerFailure = exports.rootCause = exports.defaultPayloadConverter = exports.ChildWorkflowFailure = exports.CancelledFailure = exports.ApplicationFailure = exports.ActivityFailure = void 0;
var common_1 = require("@temporalio/common");

@@ -81,5 +84,5 @@ Object.defineProperty(exports, "ActivityFailure", { enumerable: true, get: function () { return common_1.ActivityFailure; } });

Object.defineProperty(exports, "ActivityCancellationType", { enumerable: true, get: function () { return internal_workflow_common_1.ActivityCancellationType; } });
Object.defineProperty(exports, "IllegalStateError", { enumerable: true, get: function () { return internal_workflow_common_1.IllegalStateError; } });
Object.defineProperty(exports, "ValueError", { enumerable: true, get: function () { return internal_workflow_common_1.ValueError; } });
__exportStar(require("@temporalio/internal-workflow-common/lib/errors"), exports);
__exportStar(require("@temporalio/internal-workflow-common/lib/interfaces"), exports);
__exportStar(require("@temporalio/internal-workflow-common/lib/workflow-handle"), exports);
__exportStar(require("@temporalio/internal-workflow-common/lib/workflow-options"), exports);

@@ -86,0 +89,0 @@ var cancellation_scope_1 = require("./cancellation-scope");

@@ -24,3 +24,3 @@ import { RetryPolicy, TemporalFailure } from '@temporalio/common';

*/
searchAttributes?: SearchAttributes;
searchAttributes: SearchAttributes;
/**

@@ -140,12 +140,56 @@ * Non-indexed information attached to the Workflow Execution

}
/**
* Specifies:
* - whether cancellation requests are sent to the Child
* - whether and when a {@link CanceledFailure} is thrown from {@link executeChild} or
* {@link ChildWorkflowHandle.result}
*
* @default {@link ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED}
*/
export declare enum ChildWorkflowCancellationType {
/**
* Don't send a cancellation request to the Child.
*/
ABANDON = 0,
/**
* Send a cancellation request to the Child. Immediately throw the error.
*/
TRY_CANCEL = 1,
/**
* Send a cancellation request to the Child. The Child may respect cancellation, in which case an error will be thrown
* when cancellation has completed, and {@link isCancellation}(error) will be true. On the other hand, the Child may
* ignore the cancellation request, in which case an error might be thrown with a different cause, or the Child may
* complete successfully.
*
* @default
*/
WAIT_CANCELLATION_COMPLETED = 2,
/**
* Send a cancellation request to the Child. Throw the error once the Server receives the Child cancellation request.
*/
WAIT_CANCELLATION_REQUESTED = 3
}
/**
* How a Child Workflow reacts to the Parent Workflow reaching a Closed state.
*
* @see {@link https://docs.temporal.io/concepts/what-is-a-parent-close-policy/ | Parent Close Policy}
*/
export declare enum ParentClosePolicy {
/**
* If a `ParentClosePolicy` is set to this, or is not set at all, the server default value will be used.
*/
PARENT_CLOSE_POLICY_UNSPECIFIED = 0,
/**
* When the Parent is Closed, the Child is Terminated.
*
* @default
*/
PARENT_CLOSE_POLICY_TERMINATE = 1,
/**
* When the Parent is Closed, nothing is done to the Child.
*/
PARENT_CLOSE_POLICY_ABANDON = 2,
/**
* When the Parent is Closed, the Child is Cancelled.
*/
PARENT_CLOSE_POLICY_REQUEST_CANCEL = 3

@@ -166,9 +210,14 @@ }

/**
* In case of a child workflow cancellation it fails with a CanceledFailure.
* The type defines at which point the exception is thrown.
* @default ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED
* Specifies:
* - whether cancellation requests are sent to the Child
* - whether and when an error is thrown from {@link executeChild} or
* {@link ChildWorkflowHandle.result}
*
* @default {@link ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED}
*/
cancellationType?: ChildWorkflowCancellationType;
/**
* Specifies how this workflow reacts to the death of the parent workflow.
* Specifies how the Child reacts to the Parent Workflow reaching a Closed state.
*
* @default {@link ParentClosePolicy.PARENT_CLOSE_POLICY_TERMINATE}
*/

@@ -175,0 +224,0 @@ parentClosePolicy?: ParentClosePolicy;

@@ -16,15 +16,59 @@ "use strict";

exports.ContinueAsNew = ContinueAsNew;
/**
* Specifies:
* - whether cancellation requests are sent to the Child
* - whether and when a {@link CanceledFailure} is thrown from {@link executeChild} or
* {@link ChildWorkflowHandle.result}
*
* @default {@link ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED}
*/
var ChildWorkflowCancellationType;
(function (ChildWorkflowCancellationType) {
/**
* Don't send a cancellation request to the Child.
*/
ChildWorkflowCancellationType[ChildWorkflowCancellationType["ABANDON"] = 0] = "ABANDON";
/**
* Send a cancellation request to the Child. Immediately throw the error.
*/
ChildWorkflowCancellationType[ChildWorkflowCancellationType["TRY_CANCEL"] = 1] = "TRY_CANCEL";
/**
* Send a cancellation request to the Child. The Child may respect cancellation, in which case an error will be thrown
* when cancellation has completed, and {@link isCancellation}(error) will be true. On the other hand, the Child may
* ignore the cancellation request, in which case an error might be thrown with a different cause, or the Child may
* complete successfully.
*
* @default
*/
ChildWorkflowCancellationType[ChildWorkflowCancellationType["WAIT_CANCELLATION_COMPLETED"] = 2] = "WAIT_CANCELLATION_COMPLETED";
/**
* Send a cancellation request to the Child. Throw the error once the Server receives the Child cancellation request.
*/
ChildWorkflowCancellationType[ChildWorkflowCancellationType["WAIT_CANCELLATION_REQUESTED"] = 3] = "WAIT_CANCELLATION_REQUESTED";
})(ChildWorkflowCancellationType = exports.ChildWorkflowCancellationType || (exports.ChildWorkflowCancellationType = {}));
(0, internal_workflow_common_1.checkExtends)();
/**
* How a Child Workflow reacts to the Parent Workflow reaching a Closed state.
*
* @see {@link https://docs.temporal.io/concepts/what-is-a-parent-close-policy/ | Parent Close Policy}
*/
var ParentClosePolicy;
(function (ParentClosePolicy) {
/**
* If a `ParentClosePolicy` is set to this, or is not set at all, the server default value will be used.
*/
ParentClosePolicy[ParentClosePolicy["PARENT_CLOSE_POLICY_UNSPECIFIED"] = 0] = "PARENT_CLOSE_POLICY_UNSPECIFIED";
/**
* When the Parent is Closed, the Child is Terminated.
*
* @default
*/
ParentClosePolicy[ParentClosePolicy["PARENT_CLOSE_POLICY_TERMINATE"] = 1] = "PARENT_CLOSE_POLICY_TERMINATE";
/**
* When the Parent is Closed, nothing is done to the Child.
*/
ParentClosePolicy[ParentClosePolicy["PARENT_CLOSE_POLICY_ABANDON"] = 2] = "PARENT_CLOSE_POLICY_ABANDON";
/**
* When the Parent is Closed, the Child is Cancelled.
*/
ParentClosePolicy[ParentClosePolicy["PARENT_CLOSE_POLICY_REQUEST_CANCEL"] = 3] = "PARENT_CLOSE_POLICY_REQUEST_CANCEL";

@@ -31,0 +75,0 @@ })(ParentClosePolicy = exports.ParentClosePolicy || (exports.ParentClosePolicy = {}));

@@ -19,3 +19,4 @@ /**

*
* When calling a Sink function, arguments are copied from the Workflow isolate to the Node.js environment using [postMessage](https://nodejs.org/api/worker_threads.html#worker_threads_port_postmessage_value_transferlist).
* When calling a Sink function, arguments are copied from the Workflow isolate to the Node.js environment using
* {@link https://nodejs.org/api/worker_threads.html#worker_threads_port_postmessage_value_transferlist | postMessage}.

@@ -22,0 +23,0 @@ * This constrains the argument types to primitives (excluding Symbols).

@@ -1,2 +0,2 @@

import { ActivityFunction, ActivityInterface, ActivityOptions, LocalActivityOptions, QueryDefinition, SearchAttributes, SignalDefinition, WithWorkflowArgs, Workflow, WorkflowResultType, WorkflowReturnType } from '@temporalio/internal-workflow-common';
import { ActivityFunction, ActivityOptions, LocalActivityOptions, QueryDefinition, SearchAttributes, SignalDefinition, UntypedActivities, WithWorkflowArgs, Workflow, WorkflowResultType, WorkflowReturnType } from '@temporalio/internal-workflow-common';
import { ChildWorkflowOptions, ChildWorkflowOptionsWithDefaults, ContinueAsNewOptions, WorkflowInfo } from './interfaces';

@@ -18,7 +18,2 @@ import { Sinks } from './sinks';

export declare function sleep(ms: number | string): Promise<void>;
export interface ActivityInfo {
name: string;
type: string;
}
export declare type InternalActivityFunction<P extends any[], R> = ActivityFunction<P, R> & ActivityInfo;
/**

@@ -35,2 +30,37 @@ * Schedule an activity and run outbound interceptors

/**
* Symbol used in the return type of proxy methods to mark that an attribute on the source type is not a method.
*
* @see {@link ActivityInterfaceFor}
* @see {@link proxyActivities}
* @see {@link proxyLocalActivities}
*/
export declare const NotAnActivityMethod: unique symbol;
/**
* Type helper that takes a type `T` and transforms attributes that are not {@link ActivityFunction} to
* {@link NotAnActivityMethod}.
*
* @example
*
* Used by {@link proxyActivities} to get this compile-time error:
*
* ```ts
* interface MyActivities {
* valid(input: number): Promise<number>;
* invalid(input: number): number;
* }
*
* const act = proxyActivities<MyActivities>({ startToCloseTimeout: '5m' });
*
* await act.valid(true);
* await act.invalid();
* // ^ TS complains with:
* // (property) invalidDefinition: typeof NotAnActivityMethod
* // This expression is not callable.
* // Type 'Symbol' has no call signatures.(2349)
* ```
*/
export declare type ActivityInterfaceFor<T> = {
[K in keyof T]: T[K] extends ActivityFunction ? T[K] : typeof NotAnActivityMethod;
};
/**
* Configure Activity functions with given {@link ActivityOptions}.

@@ -40,10 +70,8 @@ *

*
* @return a [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)
* for which each attribute is a callable Activity function
* @return a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy | Proxy} for
* which each attribute is a callable Activity function
*
* @typeparam A An {@link ActivityInterface} - mapping of name to function
*
* @example
* ```ts
* import { proxyActivities, ActivityInterface } from '@temporalio/workflow';
* import { proxyActivities } from '@temporalio/workflow';
* import * as activities from '../activities';

@@ -57,3 +85,3 @@ *

* // Setup Activities from an explicit interface (e.g. when defined by another SDK)
* interface JavaActivities extends ActivityInterface {
* interface JavaActivities {
* httpGetFromJava(url: string): Promise<string>

@@ -77,3 +105,3 @@ * someOtherJavaActivity(arg1: number, arg2: string): Promise<string>;

*/
export declare function proxyActivities<A extends ActivityInterface>(options: ActivityOptions): A;
export declare function proxyActivities<A = UntypedActivities>(options: ActivityOptions): ActivityInterfaceFor<A>;
/**

@@ -84,12 +112,10 @@ * Configure Local Activity functions with given {@link LocalActivityOptions}.

*
* @return a [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)
* @return a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy | Proxy}
* for which each attribute is a callable Activity function
*
* @typeparam A An {@link ActivityInterface} - mapping of name to function
*
* @experimental
*
* See {@link proxyActivities} for examples
* @see {@link proxyActivities} for examples
*/
export declare function proxyLocalActivities<A extends ActivityInterface>(options: LocalActivityOptions): A;
export declare function proxyLocalActivities<A = UntypedActivities>(options: LocalActivityOptions): ActivityInterfaceFor<A>;
/**

@@ -187,3 +213,3 @@ * Returns a client-side handle that can be used to signal and cancel an existing Workflow execution.

*/
export declare function executeChild<T extends () => WorkflowReturnType>(workflowFunc: T): Promise<ChildWorkflowHandle<T>>;
export declare function executeChild<T extends () => WorkflowReturnType>(workflowFunc: T): Promise<WorkflowResultType<T>>;
/**

@@ -231,26 +257,23 @@ * Get information about the current Workflow

*
* `f` takes the same arguments as the Workflow execute function supplied to typeparam `F`.
* `f` takes the same arguments as the Workflow function supplied to typeparam `F`.
*
* Once `f` is called, Workflow execution immediately completes.
* Once `f` is called, Workflow Execution immediately completes.
*/
export declare function makeContinueAsNewFunc<F extends Workflow>(options?: ContinueAsNewOptions): (...args: Parameters<F>) => Promise<never>;
/**
* Continues current Workflow execution as new with default options.
* {@link https://docs.temporal.io/concepts/what-is-continue-as-new/ | Continues-As-New} the current Workflow Execution
* with default options.
*
* Shorthand for `makeContinueAsNewFunc<F>()(...args)`.
* Shorthand for `makeContinueAsNewFunc<F>()(...args)`. (See: {@link makeContinueAsNewFunc}.)
*
* @example
*
* ```ts
* import { continueAsNew } from '@temporalio/workflow';
*```ts
*import { continueAsNew } from '@temporalio/workflow';
*
* export function myWorkflow(n: number) {
* return {
* async execute() {
* // ... Workflow logic
* await continueAsNew<typeof myWorkflow>(n + 1);
* }
* };
* }
* ```
*export async function myWorkflow(n: number): Promise<void> {
* // ... Workflow logic
* await continueAsNew<typeof myWorkflow>(n + 1);
*}
*```
*/

@@ -268,3 +291,3 @@ export declare function continueAsNew<F extends Workflow>(...args: Parameters<F>): Promise<never>;

*
* See [docs page](https://docs.temporal.io/typescript/versioning) for info.
* See {@link https://docs.temporal.io/typescript/versioning | docs page} for info.
*

@@ -287,3 +310,3 @@ * If the workflow is replaying an existing history, then this function returns true if that

*
* See [docs page](https://docs.temporal.io/typescript/versioning) for info.
* See {@link https://docs.temporal.io/typescript/versioning | docs page} for info.
*

@@ -290,0 +313,0 @@ * Workflows with this call may be deployed alongside workflows with a {@link patched} call, but

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stackTraceQuery = exports.taskInfo = exports.upsertSearchAttributes = exports.setHandler = exports.defineQuery = exports.defineSignal = exports.condition = exports.deprecatePatch = exports.patched = exports.uuid4 = exports.continueAsNew = exports.makeContinueAsNewFunc = exports.proxySinks = exports.inWorkflowContext = exports.workflowInfo = exports.executeChild = exports.startChild = exports.getExternalWorkflowHandle = exports.proxyLocalActivities = exports.proxyActivities = exports.scheduleLocalActivity = exports.scheduleActivity = exports.sleep = exports.addDefaultWorkflowOptions = void 0;
exports.stackTraceQuery = exports.taskInfo = exports.upsertSearchAttributes = exports.setHandler = exports.defineQuery = exports.defineSignal = exports.condition = exports.deprecatePatch = exports.patched = exports.uuid4 = exports.continueAsNew = exports.makeContinueAsNewFunc = exports.proxySinks = exports.inWorkflowContext = exports.workflowInfo = exports.executeChild = exports.startChild = exports.getExternalWorkflowHandle = exports.proxyLocalActivities = exports.proxyActivities = exports.NotAnActivityMethod = exports.scheduleLocalActivity = exports.scheduleActivity = exports.sleep = exports.addDefaultWorkflowOptions = void 0;
const common_1 = require("@temporalio/common");

@@ -358,2 +358,10 @@ const internal_workflow_common_1 = require("@temporalio/internal-workflow-common");

/**
* Symbol used in the return type of proxy methods to mark that an attribute on the source type is not a method.
*
* @see {@link ActivityInterfaceFor}
* @see {@link proxyActivities}
* @see {@link proxyLocalActivities}
*/
exports.NotAnActivityMethod = Symbol.for('__TEMPORAL_NOT_AN_ACTIVITY_METHOD');
/**
* Configure Activity functions with given {@link ActivityOptions}.

@@ -363,10 +371,8 @@ *

*
* @return a [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)
* for which each attribute is a callable Activity function
* @return a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy | Proxy} for
* which each attribute is a callable Activity function
*
* @typeparam A An {@link ActivityInterface} - mapping of name to function
*
* @example
* ```ts
* import { proxyActivities, ActivityInterface } from '@temporalio/workflow';
* import { proxyActivities } from '@temporalio/workflow';
* import * as activities from '../activities';

@@ -380,3 +386,3 @@ *

* // Setup Activities from an explicit interface (e.g. when defined by another SDK)
* interface JavaActivities extends ActivityInterface {
* interface JavaActivities {
* httpGetFromJava(url: string): Promise<string>

@@ -423,10 +429,8 @@ * someOtherJavaActivity(arg1: number, arg2: string): Promise<string>;

*
* @return a [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)
* @return a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy | Proxy}
* for which each attribute is a callable Activity function
*
* @typeparam A An {@link ActivityInterface} - mapping of name to function
*
* @experimental
*
* See {@link proxyActivities} for examples
* @see {@link proxyActivities} for examples
*/

@@ -644,5 +648,5 @@ function proxyLocalActivities(options) {

*
* `f` takes the same arguments as the Workflow execute function supplied to typeparam `F`.
* `f` takes the same arguments as the Workflow function supplied to typeparam `F`.
*
* Once `f` is called, Workflow execution immediately completes.
* Once `f` is called, Workflow Execution immediately completes.
*/

@@ -682,20 +686,17 @@ function makeContinueAsNewFunc(options) {

/**
* Continues current Workflow execution as new with default options.
* {@link https://docs.temporal.io/concepts/what-is-continue-as-new/ | Continues-As-New} the current Workflow Execution
* with default options.
*
* Shorthand for `makeContinueAsNewFunc<F>()(...args)`.
* Shorthand for `makeContinueAsNewFunc<F>()(...args)`. (See: {@link makeContinueAsNewFunc}.)
*
* @example
*
* ```ts
* import { continueAsNew } from '@temporalio/workflow';
*```ts
*import { continueAsNew } from '@temporalio/workflow';
*
* export function myWorkflow(n: number) {
* return {
* async execute() {
* // ... Workflow logic
* await continueAsNew<typeof myWorkflow>(n + 1);
* }
* };
* }
* ```
*export async function myWorkflow(n: number): Promise<void> {
* // ... Workflow logic
* await continueAsNew<typeof myWorkflow>(n + 1);
*}
*```
*/

@@ -733,3 +734,3 @@ function continueAsNew(...args) {

*
* See [docs page](https://docs.temporal.io/typescript/versioning) for info.
* See {@link https://docs.temporal.io/typescript/versioning | docs page} for info.
*

@@ -755,3 +756,3 @@ * If the workflow is replaying an existing history, then this function returns true if that

*
* See [docs page](https://docs.temporal.io/typescript/versioning) for info.
* See {@link https://docs.temporal.io/typescript/versioning | docs page} for info.
*

@@ -758,0 +759,0 @@ * Workflows with this call may be deployed alongside workflows with a {@link patched} call, but

{
"name": "@temporalio/workflow",
"version": "1.0.0-rc.0",
"version": "1.0.0-rc.1",
"description": "Temporal.io SDK Workflow sub-package",

@@ -18,10 +18,7 @@ "keywords": [

"types": "lib/index.d.ts",
"files": [
"lib"
],
"scripts": {},
"dependencies": {
"@temporalio/common": "^1.0.0-rc.0",
"@temporalio/internal-workflow-common": "^1.0.0-rc.0",
"@temporalio/proto": "^1.0.0-rc.0"
"@temporalio/common": "^1.0.0-rc.1",
"@temporalio/internal-workflow-common": "^1.0.0-rc.1",
"@temporalio/proto": "^1.0.0-rc.1"
},

@@ -31,3 +28,7 @@ "publishConfig": {

},
"gitHead": "c25e91309b980f2118df4048d760306982019871"
"files": [
"src",
"lib"
],
"gitHead": "723de0fbc7a04e68084ec99453578e7027eb3803"
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc