@temporalio/common 0.14.0 → 0.17.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/lib/activity-options.d.ts +9 -5
- package/lib/activity-options.js +10 -2
- package/lib/activity-options.js.map +1 -1
- package/lib/converter/types.d.ts +1 -1
- package/lib/failure.d.ts +20 -7
- package/lib/failure.js +32 -9
- package/lib/failure.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/interceptors.d.ts +1 -1
- package/lib/interfaces.d.ts +4 -38
- package/lib/retry-policy.d.ts +43 -0
- package/lib/retry-policy.js +36 -0
- package/lib/retry-policy.js.map +1 -0
- package/lib/time.d.ts +2 -1
- package/lib/time.js +7 -1
- package/lib/time.js.map +1 -1
- package/lib/type-helpers.d.ts +2 -0
- package/lib/type-helpers.js +6 -0
- package/lib/type-helpers.js.map +1 -1
- package/lib/utils.d.ts +4 -0
- package/lib/utils.js +11 -0
- package/lib/utils.js.map +1 -0
- package/lib/workflow-options.d.ts +16 -21
- package/lib/workflow-options.js +13 -3
- package/lib/workflow-options.js.map +1 -1
- package/package.json +3 -3
- package/src/activity-options.ts +14 -5
- package/src/converter/types.ts +1 -1
- package/src/failure.ts +34 -10
- package/src/index.ts +2 -0
- package/src/interceptors.ts +1 -1
- package/src/interfaces.ts +4 -40
- package/src/retry-policy.ts +73 -0
- package/src/time.ts +6 -1
- package/src/type-helpers.ts +5 -0
- package/src/utils.ts +6 -0
- package/src/workflow-options.ts +29 -34
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { coresdk } from '@temporalio/proto/lib/coresdk';
|
|
2
|
-
import {
|
|
3
|
-
export declare
|
|
1
|
+
import type { coresdk } from '@temporalio/proto/lib/coresdk';
|
|
2
|
+
import { RetryPolicy } from './retry-policy';
|
|
3
|
+
export declare enum ActivityCancellationType {
|
|
4
|
+
TRY_CANCEL = 0,
|
|
5
|
+
WAIT_CANCELLATION_COMPLETED = 1,
|
|
6
|
+
ABANDON = 2
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
9
|
* Options for remote activity invocation - will be processed from a task queue.
|
|
6
10
|
* @see https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/activity/ActivityOptions.Builder.html
|
|
@@ -31,9 +35,9 @@ export interface ActivityOptions {
|
|
|
31
35
|
*/
|
|
32
36
|
heartbeatTimeout?: string | number;
|
|
33
37
|
/**
|
|
34
|
-
*
|
|
38
|
+
* RetryPolicy that define how activity is retried in case of failure. If this is not set, then the server-defined default activity retry policy will be used. To ensure zero retries, set maximum attempts to 1.
|
|
35
39
|
*/
|
|
36
|
-
retry?:
|
|
40
|
+
retry?: RetryPolicy;
|
|
37
41
|
/**
|
|
38
42
|
* Maximum time of a single Activity execution attempt.
|
|
39
43
|
Note that the Temporal Server doesn't detect Worker process failures directly. It relies on this timeout to detect that an Activity that didn't complete on time. So this timeout should be as short as the longest possible execution of the Activity body. Potentially long running Activities must specify {@link heartbeatTimeout} and call {@link activity.Context.heartbeat} periodically for timely failure detection.
|
package/lib/activity-options.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActivityCancellationType = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const type_helpers_1 = require("./type-helpers");
|
|
5
|
+
// Avoid importing the proto implementation to reduce workflow bundle size
|
|
6
|
+
// Copied from coresdk.workflow_commands.ActivityCancellationType
|
|
7
|
+
var ActivityCancellationType;
|
|
8
|
+
(function (ActivityCancellationType) {
|
|
9
|
+
ActivityCancellationType[ActivityCancellationType["TRY_CANCEL"] = 0] = "TRY_CANCEL";
|
|
10
|
+
ActivityCancellationType[ActivityCancellationType["WAIT_CANCELLATION_COMPLETED"] = 1] = "WAIT_CANCELLATION_COMPLETED";
|
|
11
|
+
ActivityCancellationType[ActivityCancellationType["ABANDON"] = 2] = "ABANDON";
|
|
12
|
+
})(ActivityCancellationType = exports.ActivityCancellationType || (exports.ActivityCancellationType = {}));
|
|
13
|
+
(0, type_helpers_1.checkExtends)();
|
|
6
14
|
//# sourceMappingURL=activity-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-options.js","sourceRoot":"","sources":["../src/activity-options.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"activity-options.js","sourceRoot":"","sources":["../src/activity-options.ts"],"names":[],"mappings":";;;AAEA,iDAA8C;AAE9C,0EAA0E;AAC1E,iEAAiE;AACjE,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,mFAAc,CAAA;IACd,qHAA+B,CAAA;IAC/B,6EAAW,CAAA;AACb,CAAC,EAJW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAInC;AAED,IAAA,2BAAY,GAAgF,CAAC"}
|
package/lib/converter/types.d.ts
CHANGED
package/lib/failure.d.ts
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
import { temporal } from '@temporalio/proto/lib/coresdk';
|
|
1
|
+
import type { temporal } from '@temporalio/proto/lib/coresdk';
|
|
2
2
|
import { DataConverter } from './converter/data-converter';
|
|
3
3
|
export declare const FAILURE_SOURCE = "TypeScriptSDK";
|
|
4
4
|
export declare type ProtoFailure = temporal.api.failure.v1.IFailure;
|
|
5
|
-
export declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export declare enum TimeoutType {
|
|
6
|
+
TIMEOUT_TYPE_UNSPECIFIED = 0,
|
|
7
|
+
TIMEOUT_TYPE_START_TO_CLOSE = 1,
|
|
8
|
+
TIMEOUT_TYPE_SCHEDULE_TO_START = 2,
|
|
9
|
+
TIMEOUT_TYPE_SCHEDULE_TO_CLOSE = 3,
|
|
10
|
+
TIMEOUT_TYPE_HEARTBEAT = 4
|
|
11
|
+
}
|
|
12
|
+
export declare enum RetryState {
|
|
13
|
+
RETRY_STATE_UNSPECIFIED = 0,
|
|
14
|
+
RETRY_STATE_IN_PROGRESS = 1,
|
|
15
|
+
RETRY_STATE_NON_RETRYABLE_FAILURE = 2,
|
|
16
|
+
RETRY_STATE_TIMEOUT = 3,
|
|
17
|
+
RETRY_STATE_MAXIMUM_ATTEMPTS_REACHED = 4,
|
|
18
|
+
RETRY_STATE_RETRY_POLICY_NOT_SET = 5,
|
|
19
|
+
RETRY_STATE_INTERNAL_SERVER_ERROR = 6,
|
|
20
|
+
RETRY_STATE_CANCEL_REQUESTED = 7
|
|
21
|
+
}
|
|
9
22
|
export declare type WorkflowExecution = temporal.api.common.v1.IWorkflowExecution;
|
|
10
23
|
/**
|
|
11
24
|
* Represents failures that can cross Workflow and Activity boundaries.
|
|
@@ -75,7 +88,7 @@ export declare class ApplicationFailure extends TemporalFailure {
|
|
|
75
88
|
* @param details optional details about the failure. They are serialized using the same approach
|
|
76
89
|
* as arguments and results.
|
|
77
90
|
*/
|
|
78
|
-
static retryable(message: string | undefined, type
|
|
91
|
+
static retryable(message: string | undefined, type?: string, ...details: unknown[]): ApplicationFailure;
|
|
79
92
|
/**
|
|
80
93
|
* New ApplicationFailure with {@link nonRetryable} flag set to true.
|
|
81
94
|
*
|
|
@@ -87,7 +100,7 @@ export declare class ApplicationFailure extends TemporalFailure {
|
|
|
87
100
|
* @param details optional details about the failure. They are serialized using the same approach
|
|
88
101
|
* as arguments and results.
|
|
89
102
|
*/
|
|
90
|
-
static nonRetryable(message: string | undefined, type
|
|
103
|
+
static nonRetryable(message: string | undefined, type?: string, ...details: unknown[]): ApplicationFailure;
|
|
91
104
|
}
|
|
92
105
|
/**
|
|
93
106
|
* Used as the cause for when a Workflow or Activity has been cancelled
|
package/lib/failure.js
CHANGED
|
@@ -1,11 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rootCause = exports.failureToError = exports.failureToErrorInner = exports.optionalFailureToOptionalError = exports.ensureTemporalFailure = exports.errorToFailure = exports.cutoffStackTrace = exports.optionalErrorToOptionalFailure = exports.ChildWorkflowFailure = exports.ActivityFailure = exports.TimeoutFailure = exports.TerminatedFailure = exports.CancelledFailure = exports.ApplicationFailure = exports.ServerFailure = exports.TemporalFailure = exports.RetryState = exports.TimeoutType = exports.FAILURE_SOURCE = void 0;
|
|
4
|
-
const coresdk_1 = require("@temporalio/proto/lib/coresdk");
|
|
5
4
|
const data_converter_1 = require("./converter/data-converter");
|
|
5
|
+
const type_helpers_1 = require("./type-helpers");
|
|
6
6
|
exports.FAILURE_SOURCE = 'TypeScriptSDK';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
// Avoid importing the proto implementation to reduce workflow bundle size
|
|
8
|
+
// Copied from temporal.api.enums.v1.TimeoutType
|
|
9
|
+
var TimeoutType;
|
|
10
|
+
(function (TimeoutType) {
|
|
11
|
+
TimeoutType[TimeoutType["TIMEOUT_TYPE_UNSPECIFIED"] = 0] = "TIMEOUT_TYPE_UNSPECIFIED";
|
|
12
|
+
TimeoutType[TimeoutType["TIMEOUT_TYPE_START_TO_CLOSE"] = 1] = "TIMEOUT_TYPE_START_TO_CLOSE";
|
|
13
|
+
TimeoutType[TimeoutType["TIMEOUT_TYPE_SCHEDULE_TO_START"] = 2] = "TIMEOUT_TYPE_SCHEDULE_TO_START";
|
|
14
|
+
TimeoutType[TimeoutType["TIMEOUT_TYPE_SCHEDULE_TO_CLOSE"] = 3] = "TIMEOUT_TYPE_SCHEDULE_TO_CLOSE";
|
|
15
|
+
TimeoutType[TimeoutType["TIMEOUT_TYPE_HEARTBEAT"] = 4] = "TIMEOUT_TYPE_HEARTBEAT";
|
|
16
|
+
})(TimeoutType = exports.TimeoutType || (exports.TimeoutType = {}));
|
|
17
|
+
(0, type_helpers_1.checkExtends)();
|
|
18
|
+
// Avoid importing the proto implementation to reduce workflow bundle size
|
|
19
|
+
// Copied from temporal.api.enums.v1.RetryState
|
|
20
|
+
var RetryState;
|
|
21
|
+
(function (RetryState) {
|
|
22
|
+
RetryState[RetryState["RETRY_STATE_UNSPECIFIED"] = 0] = "RETRY_STATE_UNSPECIFIED";
|
|
23
|
+
RetryState[RetryState["RETRY_STATE_IN_PROGRESS"] = 1] = "RETRY_STATE_IN_PROGRESS";
|
|
24
|
+
RetryState[RetryState["RETRY_STATE_NON_RETRYABLE_FAILURE"] = 2] = "RETRY_STATE_NON_RETRYABLE_FAILURE";
|
|
25
|
+
RetryState[RetryState["RETRY_STATE_TIMEOUT"] = 3] = "RETRY_STATE_TIMEOUT";
|
|
26
|
+
RetryState[RetryState["RETRY_STATE_MAXIMUM_ATTEMPTS_REACHED"] = 4] = "RETRY_STATE_MAXIMUM_ATTEMPTS_REACHED";
|
|
27
|
+
RetryState[RetryState["RETRY_STATE_RETRY_POLICY_NOT_SET"] = 5] = "RETRY_STATE_RETRY_POLICY_NOT_SET";
|
|
28
|
+
RetryState[RetryState["RETRY_STATE_INTERNAL_SERVER_ERROR"] = 6] = "RETRY_STATE_INTERNAL_SERVER_ERROR";
|
|
29
|
+
RetryState[RetryState["RETRY_STATE_CANCEL_REQUESTED"] = 7] = "RETRY_STATE_CANCEL_REQUESTED";
|
|
30
|
+
})(RetryState = exports.RetryState || (exports.RetryState = {}));
|
|
31
|
+
(0, type_helpers_1.checkExtends)();
|
|
9
32
|
/**
|
|
10
33
|
* Represents failures that can cross Workflow and Activity boundaries.
|
|
11
34
|
*
|
|
@@ -77,7 +100,7 @@ class ApplicationFailure extends TemporalFailure {
|
|
|
77
100
|
* as arguments and results.
|
|
78
101
|
*/
|
|
79
102
|
static retryable(message, type, ...details) {
|
|
80
|
-
return new this(message, type, false, details);
|
|
103
|
+
return new this(message, type ?? 'Error', false, details);
|
|
81
104
|
}
|
|
82
105
|
/**
|
|
83
106
|
* New ApplicationFailure with {@link nonRetryable} flag set to true.
|
|
@@ -91,7 +114,7 @@ class ApplicationFailure extends TemporalFailure {
|
|
|
91
114
|
* as arguments and results.
|
|
92
115
|
*/
|
|
93
116
|
static nonRetryable(message, type, ...details) {
|
|
94
|
-
return new this(message, type, true, details);
|
|
117
|
+
return new this(message, type ?? 'Error', true, details);
|
|
95
118
|
}
|
|
96
119
|
}
|
|
97
120
|
exports.ApplicationFailure = ApplicationFailure;
|
|
@@ -172,7 +195,7 @@ exports.optionalErrorToOptionalFailure = optionalErrorToOptionalFailure;
|
|
|
172
195
|
*/
|
|
173
196
|
const CUTTOFF_STACK_PATTERNS = [
|
|
174
197
|
/** Activity execution */
|
|
175
|
-
/\s+at Activity\.execute \(
|
|
198
|
+
/\s+at Activity\.execute \(.*[\\/]worker[\\/](?:src|lib)[\\/]activity\.[jt]s:\d+:\d+\)/,
|
|
176
199
|
/** Workflow activation */
|
|
177
200
|
/\s+at Activator\.\S+NextHandler \(webpack-internal:\/\/\/.*\/internals\.[jt]s:\d+:\d+\)/,
|
|
178
201
|
];
|
|
@@ -327,7 +350,7 @@ async function failureToErrorInner(failure, dataConverter) {
|
|
|
327
350
|
return new ServerFailure(failure.message ?? undefined, Boolean(failure.serverFailureInfo.nonRetryable), await optionalFailureToOptionalError(failure.cause, dataConverter));
|
|
328
351
|
}
|
|
329
352
|
if (failure.timeoutFailureInfo) {
|
|
330
|
-
return new TimeoutFailure(failure.message ?? undefined, await dataConverter.fromPayloads(0, failure.timeoutFailureInfo.lastHeartbeatDetails?.payloads), failure.timeoutFailureInfo.timeoutType ??
|
|
353
|
+
return new TimeoutFailure(failure.message ?? undefined, await dataConverter.fromPayloads(0, failure.timeoutFailureInfo.lastHeartbeatDetails?.payloads), failure.timeoutFailureInfo.timeoutType ?? TimeoutType.TIMEOUT_TYPE_UNSPECIFIED);
|
|
331
354
|
}
|
|
332
355
|
if (failure.terminatedFailureInfo) {
|
|
333
356
|
return new TerminatedFailure(failure.message ?? undefined, await optionalFailureToOptionalError(failure.cause, dataConverter));
|
|
@@ -343,13 +366,13 @@ async function failureToErrorInner(failure, dataConverter) {
|
|
|
343
366
|
if (!(workflowType?.name && workflowExecution)) {
|
|
344
367
|
throw new TypeError('Missing attributes on childWorkflowExecutionFailureInfo');
|
|
345
368
|
}
|
|
346
|
-
return new ChildWorkflowFailure(namespace ?? undefined, workflowExecution, workflowType.name, retryState ??
|
|
369
|
+
return new ChildWorkflowFailure(namespace ?? undefined, workflowExecution, workflowType.name, retryState ?? RetryState.RETRY_STATE_UNSPECIFIED, await optionalFailureToOptionalError(failure.cause, dataConverter));
|
|
347
370
|
}
|
|
348
371
|
if (failure.activityFailureInfo) {
|
|
349
372
|
if (!failure.activityFailureInfo.activityType?.name) {
|
|
350
373
|
throw new TypeError('Missing activityType?.name on activityFailureInfo');
|
|
351
374
|
}
|
|
352
|
-
return new ActivityFailure(failure.activityFailureInfo.activityType.name, failure.activityFailureInfo.activityId ?? undefined, failure.activityFailureInfo.retryState ??
|
|
375
|
+
return new ActivityFailure(failure.activityFailureInfo.activityType.name, failure.activityFailureInfo.activityId ?? undefined, failure.activityFailureInfo.retryState ?? RetryState.RETRY_STATE_UNSPECIFIED, failure.activityFailureInfo.identity ?? undefined, await optionalFailureToOptionalError(failure.cause, dataConverter));
|
|
353
376
|
}
|
|
354
377
|
return new TemporalFailure(failure.message ?? undefined, await optionalFailureToOptionalError(failure.cause, dataConverter));
|
|
355
378
|
}
|
package/lib/failure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failure.js","sourceRoot":"","sources":["../src/failure.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"failure.js","sourceRoot":"","sources":["../src/failure.ts"],"names":[],"mappings":";;;AACA,+DAA8E;AAC9E,iDAA8C;AAEjC,QAAA,cAAc,GAAG,eAAe,CAAC;AAE9C,0EAA0E;AAC1E,gDAAgD;AAChD,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,qFAA4B,CAAA;IAC5B,2FAA+B,CAAA;IAC/B,iGAAkC,CAAA;IAClC,iGAAkC,CAAA;I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AAe,CACxB,OAAO,CAAC,OAAO,IAAI,SAAS,EAC5B,MAAM,8BAA8B,CAAC,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,CACnE,CAAC;AACJ,CAAC;AA9ED,kDA8EC;AAED;;GAEG;AACI,KAAK,UAAU,cAAc,CAAC,OAAqB,EAAE,aAA4B;IACtF,MAAM,GAAG,GAAG,MAAM,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAC9D,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;IACrC,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;IACtB,OAAO,GAAG,CAAC;AACb,CAAC;AALD,wCAKC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,GAAY;IACpC,IAAI,GAAG,YAAY,eAAe,EAAE;QAClC,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC;KACvD;IACD,IAAI,GAAG,YAAY,KAAK,EAAE;QACxB,OAAO,GAAG,CAAC,OAAO,CAAC;KACpB;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAXD,8BAWC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -9,7 +9,9 @@ export * from './errors';
|
|
|
9
9
|
export * from './failure';
|
|
10
10
|
export * from './interceptors';
|
|
11
11
|
export * from './interfaces';
|
|
12
|
+
export * from './retry-policy';
|
|
12
13
|
export * from './time';
|
|
13
14
|
export * from './tls-config';
|
|
14
15
|
export * from './workflow-handle';
|
|
15
16
|
export * from './workflow-options';
|
|
17
|
+
export * from './utils';
|
package/lib/index.js
CHANGED
|
@@ -21,8 +21,10 @@ __exportStar(require("./errors"), exports);
|
|
|
21
21
|
__exportStar(require("./failure"), exports);
|
|
22
22
|
__exportStar(require("./interceptors"), exports);
|
|
23
23
|
__exportStar(require("./interfaces"), exports);
|
|
24
|
+
__exportStar(require("./retry-policy"), exports);
|
|
24
25
|
__exportStar(require("./time"), exports);
|
|
25
26
|
__exportStar(require("./tls-config"), exports);
|
|
26
27
|
__exportStar(require("./workflow-handle"), exports);
|
|
27
28
|
__exportStar(require("./workflow-options"), exports);
|
|
29
|
+
__exportStar(require("./utils"), exports);
|
|
28
30
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;GAIG;AACH,qDAAmC;AACnC,6DAA2C;AAC3C,2CAAyB;AACzB,4CAA0B;AAC1B,iDAA+B;AAC/B,+CAA6B;AAC7B,yCAAuB;AACvB,+CAA6B;AAC7B,oDAAkC;AAClC,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;GAIG;AACH,qDAAmC;AACnC,6DAA2C;AAC3C,2CAAyB;AACzB,4CAA0B;AAC1B,iDAA+B;AAC/B,+CAA6B;AAC7B,iDAA+B;AAC/B,yCAAuB;AACvB,+CAA6B;AAC7B,oDAAkC;AAClC,qDAAmC;AACnC,0CAAwB"}
|
package/lib/interceptors.d.ts
CHANGED
package/lib/interfaces.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export declare type WorkflowQueryType = (...args: any[]) => any;
|
|
|
11
11
|
export declare type Workflow = (...args: any[]) => WorkflowReturnType;
|
|
12
12
|
/**
|
|
13
13
|
* An interface representing a Workflow signal definition, as returned from {@link defineSignal}
|
|
14
|
+
*
|
|
15
|
+
* @remarks `_Args` can be used for parameter type inference in handler functions and *WorkflowHandle methods.
|
|
14
16
|
*/
|
|
15
17
|
export interface SignalDefinition<_Args extends any[] = []> {
|
|
16
18
|
type: 'signal';
|
|
@@ -18,6 +20,8 @@ export interface SignalDefinition<_Args extends any[] = []> {
|
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* An interface representing a Workflow query definition as returned from {@link defineQuery}
|
|
23
|
+
*
|
|
24
|
+
* @remarks `_Args` and `_Ret` can be used for parameter type inference in handler functions and *WorkflowHandle methods.
|
|
21
25
|
*/
|
|
22
26
|
export interface QueryDefinition<_Ret, _Args extends any[] = []> {
|
|
23
27
|
type: 'query';
|
|
@@ -25,41 +29,3 @@ export interface QueryDefinition<_Ret, _Args extends any[] = []> {
|
|
|
25
29
|
}
|
|
26
30
|
/** Get the "unwrapped" return type (without Promise) of the execute handler from Workflow type `W` */
|
|
27
31
|
export declare type WorkflowResultType<W extends Workflow> = ReturnType<W> extends Promise<infer R> ? R : never;
|
|
28
|
-
/**
|
|
29
|
-
* Defines options for activity retries
|
|
30
|
-
* @see {@link https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/common/RetryOptions.Builder.html | Java SDK definition}
|
|
31
|
-
*/
|
|
32
|
-
export interface RetryOptions {
|
|
33
|
-
/**
|
|
34
|
-
* Coefficient used to calculate the next retry interval.
|
|
35
|
-
* The next retry interval is previous interval multiplied by this coefficient.
|
|
36
|
-
* @minimum 1
|
|
37
|
-
* @default 2
|
|
38
|
-
*/
|
|
39
|
-
backoffCoefficient?: number;
|
|
40
|
-
/**
|
|
41
|
-
* Interval of the first retry.
|
|
42
|
-
* If coefficient is 1 then it is used for all retries
|
|
43
|
-
* @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
|
|
44
|
-
*/
|
|
45
|
-
initialInterval: string | number;
|
|
46
|
-
/**
|
|
47
|
-
* Maximum number of attempts. When exceeded the retries stop even if not expired yet.
|
|
48
|
-
* @minimum 1
|
|
49
|
-
* @default Infinity
|
|
50
|
-
*/
|
|
51
|
-
maximumAttempts?: number;
|
|
52
|
-
/**
|
|
53
|
-
* Maximum interval between retries.
|
|
54
|
-
* Exponential backoff leads to interval increase.
|
|
55
|
-
* This value is the cap of the increase.
|
|
56
|
-
*
|
|
57
|
-
* @default 100x of {@link initialInterval}
|
|
58
|
-
* @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
|
|
59
|
-
*/
|
|
60
|
-
maximumInterval?: string | number;
|
|
61
|
-
/**
|
|
62
|
-
* List of application failures types to not retry.
|
|
63
|
-
*/
|
|
64
|
-
nonRetryableErrorTypes?: string[];
|
|
65
|
-
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { temporal } from '@temporalio/proto';
|
|
2
|
+
/**
|
|
3
|
+
* Options for retrying Workflows and Activities
|
|
4
|
+
*/
|
|
5
|
+
export interface RetryPolicy {
|
|
6
|
+
/**
|
|
7
|
+
* Coefficient used to calculate the next retry interval.
|
|
8
|
+
* The next retry interval is previous interval multiplied by this coefficient.
|
|
9
|
+
* @minimum 1
|
|
10
|
+
* @default 2
|
|
11
|
+
*/
|
|
12
|
+
backoffCoefficient?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Interval of the first retry.
|
|
15
|
+
* If coefficient is 1 then it is used for all retries
|
|
16
|
+
* @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
|
|
17
|
+
* @default 1 second
|
|
18
|
+
*/
|
|
19
|
+
initialInterval?: string | number;
|
|
20
|
+
/**
|
|
21
|
+
* Maximum number of attempts. When exceeded the retries stop even if not expired yet.
|
|
22
|
+
* @minimum 1
|
|
23
|
+
* @default Infinity
|
|
24
|
+
*/
|
|
25
|
+
maximumAttempts?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Maximum interval between retries.
|
|
28
|
+
* Exponential backoff leads to interval increase.
|
|
29
|
+
* This value is the cap of the increase.
|
|
30
|
+
*
|
|
31
|
+
* @default 100x of {@link initialInterval}
|
|
32
|
+
* @format {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
|
|
33
|
+
*/
|
|
34
|
+
maximumInterval?: string | number;
|
|
35
|
+
/**
|
|
36
|
+
* List of application failures types to not retry.
|
|
37
|
+
*/
|
|
38
|
+
nonRetryableErrorTypes?: string[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Turns a TS RetryPolicy into a proto compatible RetryPolicy
|
|
42
|
+
*/
|
|
43
|
+
export declare function compileRetryPolicy(retryPolicy: RetryPolicy): temporal.api.common.v1.IRetryPolicy;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compileRetryPolicy = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const time_1 = require("./time");
|
|
6
|
+
/**
|
|
7
|
+
* Turns a TS RetryPolicy into a proto compatible RetryPolicy
|
|
8
|
+
*/
|
|
9
|
+
function compileRetryPolicy(retryPolicy) {
|
|
10
|
+
if (retryPolicy.backoffCoefficient != null && retryPolicy.backoffCoefficient <= 0) {
|
|
11
|
+
throw new _1.ValueError('RetryPolicy.backoffCoefficient must be greater than 0');
|
|
12
|
+
}
|
|
13
|
+
if (retryPolicy.maximumAttempts != null && retryPolicy.maximumAttempts <= 0) {
|
|
14
|
+
throw new _1.ValueError('RetryPolicy.maximumAttempts must be greater than 0');
|
|
15
|
+
}
|
|
16
|
+
const maximumInterval = (0, time_1.msOptionalToNumber)(retryPolicy.maximumInterval);
|
|
17
|
+
const initialInterval = (0, time_1.msToNumber)(retryPolicy.initialInterval ?? 1000);
|
|
18
|
+
if (maximumInterval === 0) {
|
|
19
|
+
throw new _1.ValueError('RetryPolicy.maximumInterval cannot be 0');
|
|
20
|
+
}
|
|
21
|
+
if (initialInterval === 0) {
|
|
22
|
+
throw new _1.ValueError('RetryPolicy.initialInterval cannot be 0');
|
|
23
|
+
}
|
|
24
|
+
if (maximumInterval != null && maximumInterval < initialInterval) {
|
|
25
|
+
throw new _1.ValueError('RetryPolicy.maximumInterval cannot be less than its initialInterval');
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
maximumAttempts: retryPolicy.maximumAttempts,
|
|
29
|
+
initialInterval: (0, time_1.msToTs)(initialInterval),
|
|
30
|
+
maximumInterval: (0, time_1.msOptionalToTs)(maximumInterval),
|
|
31
|
+
backoffCoefficient: retryPolicy.backoffCoefficient,
|
|
32
|
+
nonRetryableErrorTypes: retryPolicy.nonRetryableErrorTypes,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.compileRetryPolicy = compileRetryPolicy;
|
|
36
|
+
//# sourceMappingURL=retry-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry-policy.js","sourceRoot":"","sources":["../src/retry-policy.ts"],"names":[],"mappings":";;;AACA,wBAA+B;AAC/B,iCAAgF;AA0ChF;;GAEG;AACH,SAAgB,kBAAkB,CAAC,WAAwB;IACzD,IAAI,WAAW,CAAC,kBAAkB,IAAI,IAAI,IAAI,WAAW,CAAC,kBAAkB,IAAI,CAAC,EAAE;QACjF,MAAM,IAAI,aAAU,CAAC,uDAAuD,CAAC,CAAC;KAC/E;IACD,IAAI,WAAW,CAAC,eAAe,IAAI,IAAI,IAAI,WAAW,CAAC,eAAe,IAAI,CAAC,EAAE;QAC3E,MAAM,IAAI,aAAU,CAAC,oDAAoD,CAAC,CAAC;KAC5E;IACD,MAAM,eAAe,GAAG,IAAA,yBAAkB,EAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACxE,MAAM,eAAe,GAAG,IAAA,iBAAU,EAAC,WAAW,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC;IACxE,IAAI,eAAe,KAAK,CAAC,EAAE;QACzB,MAAM,IAAI,aAAU,CAAC,yCAAyC,CAAC,CAAC;KACjE;IACD,IAAI,eAAe,KAAK,CAAC,EAAE;QACzB,MAAM,IAAI,aAAU,CAAC,yCAAyC,CAAC,CAAC;KACjE;IACD,IAAI,eAAe,IAAI,IAAI,IAAI,eAAe,GAAG,eAAe,EAAE;QAChE,MAAM,IAAI,aAAU,CAAC,qEAAqE,CAAC,CAAC;KAC7F;IACD,OAAO;QACL,eAAe,EAAE,WAAW,CAAC,eAAe;QAC5C,eAAe,EAAE,IAAA,aAAM,EAAC,eAAe,CAAC;QACxC,eAAe,EAAE,IAAA,qBAAc,EAAC,eAAe,CAAC;QAChD,kBAAkB,EAAE,WAAW,CAAC,kBAAkB;QAClD,sBAAsB,EAAE,WAAW,CAAC,sBAAsB;KAC3D,CAAC;AACJ,CAAC;AAzBD,gDAyBC"}
|
package/lib/time.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as iface from '@temporalio/proto/lib/coresdk';
|
|
1
|
+
import type * as iface from '@temporalio/proto/lib/coresdk';
|
|
2
2
|
export declare type Timestamp = iface.google.protobuf.ITimestamp;
|
|
3
3
|
/**
|
|
4
4
|
* Lossy conversion function from Timestamp to number due to possible overflow.
|
|
@@ -12,4 +12,5 @@ export declare function tsToMs(ts: Timestamp | null | undefined): number;
|
|
|
12
12
|
export declare function msNumberToTs(millis: number): Timestamp;
|
|
13
13
|
export declare function msToTs(str: string | number): Timestamp;
|
|
14
14
|
export declare function msOptionalToTs(str: string | number | undefined): Timestamp | undefined;
|
|
15
|
+
export declare function msOptionalToNumber(val: string | number | undefined): number | undefined;
|
|
15
16
|
export declare function msToNumber(val: string | number): number;
|
package/lib/time.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.msToNumber = exports.msOptionalToTs = exports.msToTs = exports.msNumberToTs = exports.tsToMs = exports.optionalTsToMs = void 0;
|
|
6
|
+
exports.msToNumber = exports.msOptionalToNumber = exports.msOptionalToTs = exports.msToTs = exports.msNumberToTs = exports.tsToMs = exports.optionalTsToMs = void 0;
|
|
7
7
|
const long_1 = __importDefault(require("long"));
|
|
8
8
|
const ms_1 = __importDefault(require("ms"));
|
|
9
9
|
const errors_1 = require("./errors");
|
|
@@ -57,6 +57,12 @@ function msOptionalToTs(str) {
|
|
|
57
57
|
return msNumberToTs((0, ms_1.default)(str));
|
|
58
58
|
}
|
|
59
59
|
exports.msOptionalToTs = msOptionalToTs;
|
|
60
|
+
function msOptionalToNumber(val) {
|
|
61
|
+
if (val === undefined)
|
|
62
|
+
return undefined;
|
|
63
|
+
return msToNumber(val);
|
|
64
|
+
}
|
|
65
|
+
exports.msOptionalToNumber = msOptionalToNumber;
|
|
60
66
|
function msToNumber(val) {
|
|
61
67
|
if (typeof val === 'number') {
|
|
62
68
|
return val;
|
package/lib/time.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.js","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,4CAAoB;AAEpB,qCAAsC;AAStC;;;GAGG;AACH,SAAgB,cAAc,CAAC,EAAgC;IAC7D,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,IAAI,EAAE;QACnC,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC;AACpB,CAAC;AALD,wCAKC;AAED;;GAEG;AACH,SAAgB,MAAM,CAAC,EAAgC;IACrD,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,IAAI,EAAE;QACnC,MAAM,IAAI,KAAK,CAAC,2BAA2B,EAAE,EAAE,CAAC,CAAC;KAClD;IACD,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IAC9B,OAAO,CAAC,OAAO,IAAI,cAAI,CAAC,KAAK,CAAC;SAC3B,GAAG,CAAC,IAAI,CAAC;SACT,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;SACvC,QAAQ,EAAE,CAAC;AAChB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;QAC3B,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;KAC1B;IACD,OAAO,YAAY,CAAC,IAAA,YAAE,EAAC,GAAG,CAAC,CAAC,CAAC;AAC/B,CAAC;AALD,wBAKC;AAED,SAAgB,cAAc,CAAC,GAAgC;IAC7D,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;KAC1B;IACD,OAAO,YAAY,CAAC,IAAA,YAAE,EAAC,GAAG,CAAC,CAAC,CAAC;AAC/B,CAAC;AAND,wCAMC;AAED,SAAgB,kBAAkB,CAAC,GAAgC;IACjE,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAHD,gDAGC;AAED,SAAgB,UAAU,CAAC,GAAoB;IAC7C,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,IAAA,YAAE,EAAC,GAAG,CAAC,CAAC;AACjB,CAAC;AALD,gCAKC"}
|
package/lib/type-helpers.d.ts
CHANGED
|
@@ -4,3 +4,5 @@ export declare type AnyFunc = (...args: any[]) => any;
|
|
|
4
4
|
export declare type OmitLast<T> = T extends [...infer REST, any] ? REST : never;
|
|
5
5
|
/** F with all arguments but the last */
|
|
6
6
|
export declare type OmitLastParam<F extends AnyFunc> = (...args: OmitLast<Parameters<F>>) => ReturnType<F>;
|
|
7
|
+
/** Verify that an type _Copy extends _Orig */
|
|
8
|
+
export declare function checkExtends<_Orig, _Copy extends _Orig>(): void;
|
package/lib/type-helpers.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkExtends = void 0;
|
|
4
|
+
/** Verify that an type _Copy extends _Orig */
|
|
5
|
+
function checkExtends() {
|
|
6
|
+
// noop, just type check
|
|
7
|
+
}
|
|
8
|
+
exports.checkExtends = checkExtends;
|
|
3
9
|
//# sourceMappingURL=type-helpers.js.map
|
package/lib/type-helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-helpers.js","sourceRoot":"","sources":["../src/type-helpers.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"type-helpers.js","sourceRoot":"","sources":["../src/type-helpers.ts"],"names":[],"mappings":";;;AAOA,8CAA8C;AAC9C,SAAgB,YAAY;IAC1B,wBAAwB;AAC1B,CAAC;AAFD,oCAEC"}
|
package/lib/utils.d.ts
ADDED
package/lib/utils.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterNullAndUndefined = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Helper to prevent undefined and null values overriding defaults when merging maps
|
|
6
|
+
*/
|
|
7
|
+
function filterNullAndUndefined(obj) {
|
|
8
|
+
return Object.fromEntries(Object.entries(obj).filter(([_k, v]) => v != null));
|
|
9
|
+
}
|
|
10
|
+
exports.filterNullAndUndefined = filterNullAndUndefined;
|
|
11
|
+
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,SAAgB,sBAAsB,CAAgC,GAAM;IAC1E,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAQ,CAAC;AACvF,CAAC;AAFD,wDAEC"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { google } from '@temporalio/proto/lib/coresdk';
|
|
2
2
|
import { Workflow } from './interfaces';
|
|
3
|
-
|
|
4
|
-
export declare
|
|
5
|
-
|
|
3
|
+
import { RetryPolicy } from './retry-policy';
|
|
4
|
+
export declare enum WorkflowIdReusePolicy {
|
|
5
|
+
WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED = 0,
|
|
6
|
+
WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE = 1,
|
|
7
|
+
WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY = 2,
|
|
8
|
+
WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE = 3
|
|
9
|
+
}
|
|
6
10
|
export interface BaseWorkflowOptions {
|
|
7
|
-
/**
|
|
8
|
-
* Workflow id to use when starting. If not specified a UUID is generated. Note that it is
|
|
9
|
-
* dangerous as in case of client side retries no deduplication will happen based on the
|
|
10
|
-
* generated id. So prefer assigning business meaningful ids if possible.
|
|
11
|
-
*/
|
|
12
|
-
workflowId?: string;
|
|
13
11
|
/**
|
|
14
12
|
* Specifies server behavior if a completed workflow with the same id exists. Note that under no
|
|
15
13
|
* conditions Temporal allows two workflows with the same namespace and workflow id run
|
|
@@ -21,11 +19,12 @@ export interface BaseWorkflowOptions {
|
|
|
21
19
|
*/
|
|
22
20
|
workflowIdReusePolicy?: WorkflowIdReusePolicy;
|
|
23
21
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* Controls how a Workflow is retried.
|
|
23
|
+
*
|
|
24
|
+
* Workflows should typically use the system default, do not set this unless
|
|
25
|
+
* you know what you're doing.
|
|
26
26
|
*/
|
|
27
|
-
|
|
28
|
-
retryPolicy?: coresdk.common.IRetryPolicy;
|
|
27
|
+
retry?: RetryPolicy;
|
|
29
28
|
/**
|
|
30
29
|
* Optional cron schedule for Workflow. If a cron schedule is specified, the Workflow will run
|
|
31
30
|
* as a cron based on the schedule. The scheduling will be based on UTC time. The schedule for the next run only happens
|
|
@@ -83,14 +82,10 @@ export interface WorkflowDurationOptions {
|
|
|
83
82
|
*/
|
|
84
83
|
workflowTaskTimeout?: string | number;
|
|
85
84
|
}
|
|
86
|
-
export declare type
|
|
87
|
-
export declare type
|
|
88
|
-
args: Parameters<T>[];
|
|
89
|
-
};
|
|
90
|
-
export declare type WorkflowOptionsWithDefaults<T extends Workflow = Workflow> = WorkflowOptions & RequiredWorkflowOptions<T>;
|
|
91
|
-
export declare type CompiledWorkflowOptions<T extends Workflow = Workflow> = BaseWorkflowOptions & RequiredWorkflowOptions<T> & {
|
|
85
|
+
export declare type CommonWorkflowOptions = BaseWorkflowOptions & WorkflowDurationOptions;
|
|
86
|
+
export declare type WithCompiledWorkflowDurationOptions<T extends WorkflowDurationOptions> = Omit<T, 'workflowExecutionTimeout' | 'workflowRunTimeout' | 'workflowTaskTimeout'> & {
|
|
92
87
|
workflowExecutionTimeout?: google.protobuf.IDuration;
|
|
93
88
|
workflowRunTimeout?: google.protobuf.IDuration;
|
|
94
89
|
workflowTaskTimeout?: google.protobuf.IDuration;
|
|
95
90
|
};
|
|
96
|
-
export declare function compileWorkflowOptions<T extends
|
|
91
|
+
export declare function compileWorkflowOptions<T extends WorkflowDurationOptions>(options: T): WithCompiledWorkflowDurationOptions<T>;
|
package/lib/workflow-options.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.compileWorkflowOptions = exports.WorkflowIdReusePolicy = void 0;
|
|
4
|
-
const coresdk_1 = require("@temporalio/proto/lib/coresdk");
|
|
5
4
|
const time_1 = require("./time");
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const type_helpers_1 = require("./type-helpers");
|
|
6
|
+
// Avoid importing the proto implementation to reduce workflow bundle size
|
|
7
|
+
// Copied from coresdk.common.WorkflowIdReusePolicy
|
|
8
|
+
var WorkflowIdReusePolicy;
|
|
9
|
+
(function (WorkflowIdReusePolicy) {
|
|
10
|
+
WorkflowIdReusePolicy[WorkflowIdReusePolicy["WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED"] = 0] = "WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED";
|
|
11
|
+
WorkflowIdReusePolicy[WorkflowIdReusePolicy["WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE"] = 1] = "WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE";
|
|
12
|
+
WorkflowIdReusePolicy[WorkflowIdReusePolicy["WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY"] = 2] = "WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY";
|
|
13
|
+
WorkflowIdReusePolicy[WorkflowIdReusePolicy["WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE"] = 3] = "WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE";
|
|
14
|
+
})(WorkflowIdReusePolicy = exports.WorkflowIdReusePolicy || (exports.WorkflowIdReusePolicy = {}));
|
|
15
|
+
(0, type_helpers_1.checkExtends)();
|
|
16
|
+
function compileWorkflowOptions(options) {
|
|
17
|
+
const { workflowExecutionTimeout, workflowRunTimeout, workflowTaskTimeout, ...rest } = options;
|
|
8
18
|
return {
|
|
9
19
|
...rest,
|
|
10
20
|
workflowExecutionTimeout: workflowExecutionTimeout ? (0, time_1.msToTs)(workflowExecutionTimeout) : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-options.js","sourceRoot":"","sources":["../src/workflow-options.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"workflow-options.js","sourceRoot":"","sources":["../src/workflow-options.ts"],"names":[],"mappings":";;;AAGA,iCAAgC;AAChC,iDAA8C;AAE9C,0EAA0E;AAC1E,mDAAmD;AACnD,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,iIAAwC,CAAA;IACxC,yIAA4C,CAAA;IAC5C,iKAAwD,CAAA;IACxD,2IAA6C,CAAA;AAC/C,CAAC,EALW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAKhC;AAED,IAAA,2BAAY,GAA+D,CAAC;AAoG5E,SAAgB,sBAAsB,CACpC,OAAU;IAEV,MAAM,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAE/F,OAAO;QACL,GAAG,IAAI;QACP,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC,IAAA,aAAM,EAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,SAAS;QACjG,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CAAC,IAAA,aAAM,EAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,SAAS;QAC/E,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CAAC,IAAA,aAAM,EAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,SAAS;KACnF,CAAC;AACJ,CAAC;AAXD,wDAWC"}
|