@temporalio/common 1.8.0 → 1.8.2
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 +8 -0
- package/lib/activity-options.js.map +1 -1
- package/lib/converter/failure-converter.js +10 -10
- package/lib/converter/failure-converter.js.map +1 -1
- package/lib/converter/payload-converter.js +2 -2
- package/lib/converter/payload-converter.js.map +1 -1
- package/lib/converter/protobuf-payload-converters.js +58 -7
- package/lib/converter/protobuf-payload-converters.js.map +1 -1
- package/lib/errors.d.ts +0 -16
- package/lib/errors.js +37 -38
- package/lib/errors.js.map +1 -1
- package/lib/failure.d.ts +0 -81
- package/lib/failure.js +50 -131
- package/lib/failure.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/type-helpers.d.ts +33 -0
- package/lib/type-helpers.js +70 -9
- package/lib/type-helpers.js.map +1 -1
- package/lib/versioning-intent.d.ts +18 -0
- package/lib/versioning-intent.js +3 -0
- package/lib/versioning-intent.js.map +1 -0
- package/package.json +3 -3
- package/src/activity-options.ts +9 -0
- package/src/converter/failure-converter.ts +12 -12
- package/src/converter/payload-converter.ts +2 -2
- package/src/converter/protobuf-payload-converters.ts +62 -8
- package/src/errors.ts +9 -31
- package/src/failure.ts +13 -138
- package/src/index.ts +1 -0
- package/src/type-helpers.ts +78 -11
- package/src/versioning-intent.ts +18 -0
package/lib/failure.d.ts
CHANGED
|
@@ -19,7 +19,6 @@ export declare enum RetryState {
|
|
|
19
19
|
RETRY_STATE_CANCEL_REQUESTED = 7
|
|
20
20
|
}
|
|
21
21
|
export type WorkflowExecution = temporal.api.common.v1.IWorkflowExecution;
|
|
22
|
-
declare const isTemporalFailure: unique symbol;
|
|
23
22
|
/**
|
|
24
23
|
* Represents failures that can cross Workflow and Activity boundaries.
|
|
25
24
|
*
|
|
@@ -29,7 +28,6 @@ declare const isTemporalFailure: unique symbol;
|
|
|
29
28
|
*/
|
|
30
29
|
export declare class TemporalFailure extends Error {
|
|
31
30
|
readonly cause?: Error | undefined;
|
|
32
|
-
readonly name: string;
|
|
33
31
|
/**
|
|
34
32
|
* The original failure that constructed this error.
|
|
35
33
|
*
|
|
@@ -37,31 +35,12 @@ export declare class TemporalFailure extends Error {
|
|
|
37
35
|
*/
|
|
38
36
|
failure?: ProtoFailure;
|
|
39
37
|
constructor(message?: string | undefined | null, cause?: Error | undefined);
|
|
40
|
-
/**
|
|
41
|
-
* Marker to determine whether an error is an instance of TemporalFailure.
|
|
42
|
-
*/
|
|
43
|
-
protected readonly [isTemporalFailure] = true;
|
|
44
|
-
/**
|
|
45
|
-
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
46
|
-
*/
|
|
47
|
-
static is(error: unknown): error is TemporalFailure;
|
|
48
38
|
}
|
|
49
|
-
declare const isServerFailure: unique symbol;
|
|
50
39
|
/** Exceptions originated at the Temporal service. */
|
|
51
40
|
export declare class ServerFailure extends TemporalFailure {
|
|
52
41
|
readonly nonRetryable: boolean;
|
|
53
|
-
readonly name: string;
|
|
54
42
|
constructor(message: string | undefined, nonRetryable: boolean, cause?: Error);
|
|
55
|
-
/**
|
|
56
|
-
* Marker to determine whether an error is an instance of ServerFailure.
|
|
57
|
-
*/
|
|
58
|
-
protected readonly [isServerFailure] = true;
|
|
59
|
-
/**
|
|
60
|
-
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
61
|
-
*/
|
|
62
|
-
static is(error: unknown): error is ServerFailure;
|
|
63
43
|
}
|
|
64
|
-
declare const isApplicationFailure: unique symbol;
|
|
65
44
|
/**
|
|
66
45
|
* `ApplicationFailure`s are used to communicate application-specific failures in Workflows and Activities.
|
|
67
46
|
*
|
|
@@ -88,19 +67,10 @@ export declare class ApplicationFailure extends TemporalFailure {
|
|
|
88
67
|
readonly type?: string | null | undefined;
|
|
89
68
|
readonly nonRetryable?: boolean | null | undefined;
|
|
90
69
|
readonly details?: unknown[] | null | undefined;
|
|
91
|
-
readonly name: string;
|
|
92
70
|
/**
|
|
93
71
|
* Alternatively, use {@link fromError} or {@link create}.
|
|
94
72
|
*/
|
|
95
73
|
constructor(message?: string | undefined | null, type?: string | null | undefined, nonRetryable?: boolean | null | undefined, details?: unknown[] | null | undefined, cause?: Error);
|
|
96
|
-
/**
|
|
97
|
-
* Marker to determine whether an error is an instance of ApplicationFailure.
|
|
98
|
-
*/
|
|
99
|
-
protected readonly [isApplicationFailure] = true;
|
|
100
|
-
/**
|
|
101
|
-
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
102
|
-
*/
|
|
103
|
-
static is(error: unknown): error is ApplicationFailure;
|
|
104
74
|
/**
|
|
105
75
|
* Create a new `ApplicationFailure` from an Error object.
|
|
106
76
|
*
|
|
@@ -159,7 +129,6 @@ export interface ApplicationFailureOptions {
|
|
|
159
129
|
*/
|
|
160
130
|
cause?: Error;
|
|
161
131
|
}
|
|
162
|
-
declare const isCancelledFailure: unique symbol;
|
|
163
132
|
/**
|
|
164
133
|
* This error is thrown when Cancellation has been requested. To allow Cancellation to happen, let it propagate. To
|
|
165
134
|
* ignore Cancellation, catch it and continue executing. Note that Cancellation can only be requested a single time, so
|
|
@@ -169,52 +138,22 @@ declare const isCancelledFailure: unique symbol;
|
|
|
169
138
|
*/
|
|
170
139
|
export declare class CancelledFailure extends TemporalFailure {
|
|
171
140
|
readonly details: unknown[];
|
|
172
|
-
readonly name: string;
|
|
173
141
|
constructor(message: string | undefined, details?: unknown[], cause?: Error);
|
|
174
|
-
/**
|
|
175
|
-
* Marker to determine whether an error is an instance of CancelledFailure.
|
|
176
|
-
*/
|
|
177
|
-
protected readonly [isCancelledFailure] = true;
|
|
178
|
-
/**
|
|
179
|
-
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
180
|
-
*/
|
|
181
|
-
static is(error: unknown): error is CancelledFailure;
|
|
182
142
|
}
|
|
183
|
-
declare const isTerminatedFailure: unique symbol;
|
|
184
143
|
/**
|
|
185
144
|
* Used as the `cause` when a Workflow has been terminated
|
|
186
145
|
*/
|
|
187
146
|
export declare class TerminatedFailure extends TemporalFailure {
|
|
188
|
-
readonly name: string;
|
|
189
147
|
constructor(message: string | undefined, cause?: Error);
|
|
190
|
-
/**
|
|
191
|
-
* Marker to determine whether an error is an instance of TerminatedFailure.
|
|
192
|
-
*/
|
|
193
|
-
protected readonly [isTerminatedFailure] = true;
|
|
194
|
-
/**
|
|
195
|
-
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
196
|
-
*/
|
|
197
|
-
static is(error: unknown): error is TerminatedFailure;
|
|
198
148
|
}
|
|
199
|
-
declare const isTimeoutFailure: unique symbol;
|
|
200
149
|
/**
|
|
201
150
|
* Used to represent timeouts of Activities and Workflows
|
|
202
151
|
*/
|
|
203
152
|
export declare class TimeoutFailure extends TemporalFailure {
|
|
204
153
|
readonly lastHeartbeatDetails: unknown;
|
|
205
154
|
readonly timeoutType: TimeoutType;
|
|
206
|
-
readonly name: string;
|
|
207
155
|
constructor(message: string | undefined, lastHeartbeatDetails: unknown, timeoutType: TimeoutType);
|
|
208
|
-
/**
|
|
209
|
-
* Marker to determine whether an error is an instance of TimeoutFailure.
|
|
210
|
-
*/
|
|
211
|
-
protected readonly [isTimeoutFailure] = true;
|
|
212
|
-
/**
|
|
213
|
-
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
214
|
-
*/
|
|
215
|
-
static is(error: unknown): error is TimeoutFailure;
|
|
216
156
|
}
|
|
217
|
-
declare const isActivityFailure: unique symbol;
|
|
218
157
|
/**
|
|
219
158
|
* Contains information about an Activity failure. Always contains the original reason for the failure as its `cause`.
|
|
220
159
|
* For example, if an Activity timed out, the cause will be a {@link TimeoutFailure}.
|
|
@@ -226,18 +165,8 @@ export declare class ActivityFailure extends TemporalFailure {
|
|
|
226
165
|
readonly activityId: string | undefined;
|
|
227
166
|
readonly retryState: RetryState;
|
|
228
167
|
readonly identity: string | undefined;
|
|
229
|
-
readonly name: string;
|
|
230
168
|
constructor(message: string | undefined, activityType: string, activityId: string | undefined, retryState: RetryState, identity: string | undefined, cause?: Error);
|
|
231
|
-
/**
|
|
232
|
-
* Marker to determine whether an error is an instance of ActivityFailure.
|
|
233
|
-
*/
|
|
234
|
-
protected readonly [isActivityFailure] = true;
|
|
235
|
-
/**
|
|
236
|
-
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
237
|
-
*/
|
|
238
|
-
static is(error: unknown): error is ActivityFailure;
|
|
239
169
|
}
|
|
240
|
-
declare const isChildWorkflowFailure: unique symbol;
|
|
241
170
|
/**
|
|
242
171
|
* Contains information about a Child Workflow failure. Always contains the reason for the failure as its {@link cause}.
|
|
243
172
|
* For example, if the Child was Terminated, the `cause` is a {@link TerminatedFailure}.
|
|
@@ -249,16 +178,7 @@ export declare class ChildWorkflowFailure extends TemporalFailure {
|
|
|
249
178
|
readonly execution: WorkflowExecution;
|
|
250
179
|
readonly workflowType: string;
|
|
251
180
|
readonly retryState: RetryState;
|
|
252
|
-
readonly name: string;
|
|
253
181
|
constructor(namespace: string | undefined, execution: WorkflowExecution, workflowType: string, retryState: RetryState, cause?: Error);
|
|
254
|
-
/**
|
|
255
|
-
* Marker to determine whether an error is an instance of ChildWorkflowFailure.
|
|
256
|
-
*/
|
|
257
|
-
protected readonly [isChildWorkflowFailure] = true;
|
|
258
|
-
/**
|
|
259
|
-
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
260
|
-
*/
|
|
261
|
-
static is(error: unknown): error is ChildWorkflowFailure;
|
|
262
182
|
}
|
|
263
183
|
/**
|
|
264
184
|
* If `error` is already an `ApplicationFailure`, returns `error`.
|
|
@@ -285,4 +205,3 @@ export declare function ensureTemporalFailure(err: unknown): TemporalFailure;
|
|
|
285
205
|
* Otherwise, return `error.message`.
|
|
286
206
|
*/
|
|
287
207
|
export declare function rootCause(error: unknown): string | undefined;
|
|
288
|
-
export {};
|
package/lib/failure.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
3
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
9
|
exports.rootCause = exports.ensureTemporalFailure = exports.ensureApplicationFailure = 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;
|
|
5
10
|
const type_helpers_1 = require("./type-helpers");
|
|
@@ -31,7 +36,6 @@ var RetryState;
|
|
|
31
36
|
})(RetryState = exports.RetryState || (exports.RetryState = {}));
|
|
32
37
|
(0, type_helpers_1.checkExtends)();
|
|
33
38
|
(0, type_helpers_1.checkExtends)();
|
|
34
|
-
const isTemporalFailure = Symbol.for('__temporal_isTemporalFailure');
|
|
35
39
|
/**
|
|
36
40
|
* Represents failures that can cross Workflow and Activity boundaries.
|
|
37
41
|
*
|
|
@@ -39,47 +43,27 @@ const isTemporalFailure = Symbol.for('__temporal_isTemporalFailure');
|
|
|
39
43
|
*
|
|
40
44
|
* The only child class you should ever throw from your code is {@link ApplicationFailure}.
|
|
41
45
|
*/
|
|
42
|
-
class TemporalFailure extends Error {
|
|
46
|
+
let TemporalFailure = class TemporalFailure extends Error {
|
|
43
47
|
constructor(message, cause) {
|
|
44
48
|
super(message ?? undefined);
|
|
45
49
|
this.cause = cause;
|
|
46
|
-
this.name = 'TemporalFailure';
|
|
47
|
-
/**
|
|
48
|
-
* Marker to determine whether an error is an instance of TemporalFailure.
|
|
49
|
-
*/
|
|
50
|
-
this[_a] = true;
|
|
51
50
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return error instanceof TemporalFailure || (error instanceof Error && error[isTemporalFailure]);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
51
|
+
};
|
|
52
|
+
TemporalFailure = __decorate([
|
|
53
|
+
(0, type_helpers_1.SymbolBasedInstanceOfError)('TemporalFailure')
|
|
54
|
+
], TemporalFailure);
|
|
59
55
|
exports.TemporalFailure = TemporalFailure;
|
|
60
|
-
_a = isTemporalFailure;
|
|
61
|
-
const isServerFailure = Symbol.for('__temporal_isServerFailure');
|
|
62
56
|
/** Exceptions originated at the Temporal service. */
|
|
63
|
-
class ServerFailure extends TemporalFailure {
|
|
57
|
+
let ServerFailure = class ServerFailure extends TemporalFailure {
|
|
64
58
|
constructor(message, nonRetryable, cause) {
|
|
65
59
|
super(message, cause);
|
|
66
60
|
this.nonRetryable = nonRetryable;
|
|
67
|
-
this.name = 'ServerFailure';
|
|
68
|
-
/**
|
|
69
|
-
* Marker to determine whether an error is an instance of ServerFailure.
|
|
70
|
-
*/
|
|
71
|
-
this[_b] = true;
|
|
72
61
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return error instanceof ServerFailure || (error instanceof Error && error[isServerFailure]);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
62
|
+
};
|
|
63
|
+
ServerFailure = __decorate([
|
|
64
|
+
(0, type_helpers_1.SymbolBasedInstanceOfError)('ServerFailure')
|
|
65
|
+
], ServerFailure);
|
|
80
66
|
exports.ServerFailure = ServerFailure;
|
|
81
|
-
_b = isServerFailure;
|
|
82
|
-
const isApplicationFailure = Symbol.for('__temporal_isApplicationFailure');
|
|
83
67
|
/**
|
|
84
68
|
* `ApplicationFailure`s are used to communicate application-specific failures in Workflows and Activities.
|
|
85
69
|
*
|
|
@@ -102,7 +86,7 @@ const isApplicationFailure = Symbol.for('__temporal_isApplicationFailure');
|
|
|
102
86
|
* `ApplicationFailure` from the last Activity Task will be the `cause` of the {@link ActivityFailure} thrown in the
|
|
103
87
|
* Workflow.
|
|
104
88
|
*/
|
|
105
|
-
class ApplicationFailure extends TemporalFailure {
|
|
89
|
+
let ApplicationFailure = class ApplicationFailure extends TemporalFailure {
|
|
106
90
|
/**
|
|
107
91
|
* Alternatively, use {@link fromError} or {@link create}.
|
|
108
92
|
*/
|
|
@@ -111,17 +95,6 @@ class ApplicationFailure extends TemporalFailure {
|
|
|
111
95
|
this.type = type;
|
|
112
96
|
this.nonRetryable = nonRetryable;
|
|
113
97
|
this.details = details;
|
|
114
|
-
this.name = 'ApplicationFailure';
|
|
115
|
-
/**
|
|
116
|
-
* Marker to determine whether an error is an instance of ApplicationFailure.
|
|
117
|
-
*/
|
|
118
|
-
this[_c] = true;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
122
|
-
*/
|
|
123
|
-
static is(error) {
|
|
124
|
-
return error instanceof ApplicationFailure || (error instanceof Error && error[isApplicationFailure]);
|
|
125
98
|
}
|
|
126
99
|
/**
|
|
127
100
|
* Create a new `ApplicationFailure` from an Error object.
|
|
@@ -167,10 +140,11 @@ class ApplicationFailure extends TemporalFailure {
|
|
|
167
140
|
static nonRetryable(message, type, ...details) {
|
|
168
141
|
return new this(message, type ?? 'Error', true, details);
|
|
169
142
|
}
|
|
170
|
-
}
|
|
143
|
+
};
|
|
144
|
+
ApplicationFailure = __decorate([
|
|
145
|
+
(0, type_helpers_1.SymbolBasedInstanceOfError)('ApplicationFailure')
|
|
146
|
+
], ApplicationFailure);
|
|
171
147
|
exports.ApplicationFailure = ApplicationFailure;
|
|
172
|
-
_c = isApplicationFailure;
|
|
173
|
-
const isCancelledFailure = Symbol.for('__temporal_isCancelledFailure');
|
|
174
148
|
/**
|
|
175
149
|
* This error is thrown when Cancellation has been requested. To allow Cancellation to happen, let it propagate. To
|
|
176
150
|
* ignore Cancellation, catch it and continue executing. Note that Cancellation can only be requested a single time, so
|
|
@@ -178,129 +152,80 @@ const isCancelledFailure = Symbol.for('__temporal_isCancelledFailure');
|
|
|
178
152
|
*
|
|
179
153
|
* When a Workflow or Activity has been successfully cancelled, a `CancelledFailure` will be the `cause`.
|
|
180
154
|
*/
|
|
181
|
-
class CancelledFailure extends TemporalFailure {
|
|
155
|
+
let CancelledFailure = class CancelledFailure extends TemporalFailure {
|
|
182
156
|
constructor(message, details = [], cause) {
|
|
183
157
|
super(message, cause);
|
|
184
158
|
this.details = details;
|
|
185
|
-
this.name = 'CancelledFailure';
|
|
186
|
-
/**
|
|
187
|
-
* Marker to determine whether an error is an instance of CancelledFailure.
|
|
188
|
-
*/
|
|
189
|
-
this[_d] = true;
|
|
190
159
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return error instanceof CancelledFailure || (error instanceof Error && error[isCancelledFailure]);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
160
|
+
};
|
|
161
|
+
CancelledFailure = __decorate([
|
|
162
|
+
(0, type_helpers_1.SymbolBasedInstanceOfError)('CancelledFailure')
|
|
163
|
+
], CancelledFailure);
|
|
198
164
|
exports.CancelledFailure = CancelledFailure;
|
|
199
|
-
_d = isCancelledFailure;
|
|
200
|
-
const isTerminatedFailure = Symbol.for('__temporal_isTerminatedFailure');
|
|
201
165
|
/**
|
|
202
166
|
* Used as the `cause` when a Workflow has been terminated
|
|
203
167
|
*/
|
|
204
|
-
class TerminatedFailure extends TemporalFailure {
|
|
168
|
+
let TerminatedFailure = class TerminatedFailure extends TemporalFailure {
|
|
205
169
|
constructor(message, cause) {
|
|
206
170
|
super(message, cause);
|
|
207
|
-
this.name = 'TerminatedFailure';
|
|
208
|
-
/**
|
|
209
|
-
* Marker to determine whether an error is an instance of TerminatedFailure.
|
|
210
|
-
*/
|
|
211
|
-
this[_e] = true;
|
|
212
171
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return error instanceof TerminatedFailure || (error instanceof Error && error[isTerminatedFailure]);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
172
|
+
};
|
|
173
|
+
TerminatedFailure = __decorate([
|
|
174
|
+
(0, type_helpers_1.SymbolBasedInstanceOfError)('TerminatedFailure')
|
|
175
|
+
], TerminatedFailure);
|
|
220
176
|
exports.TerminatedFailure = TerminatedFailure;
|
|
221
|
-
_e = isTerminatedFailure;
|
|
222
|
-
const isTimeoutFailure = Symbol.for('__temporal_isTimeoutFailure');
|
|
223
177
|
/**
|
|
224
178
|
* Used to represent timeouts of Activities and Workflows
|
|
225
179
|
*/
|
|
226
|
-
class TimeoutFailure extends TemporalFailure {
|
|
180
|
+
let TimeoutFailure = class TimeoutFailure extends TemporalFailure {
|
|
227
181
|
constructor(message, lastHeartbeatDetails, timeoutType) {
|
|
228
182
|
super(message);
|
|
229
183
|
this.lastHeartbeatDetails = lastHeartbeatDetails;
|
|
230
184
|
this.timeoutType = timeoutType;
|
|
231
|
-
this.name = 'TimeoutFailure';
|
|
232
|
-
/**
|
|
233
|
-
* Marker to determine whether an error is an instance of TimeoutFailure.
|
|
234
|
-
*/
|
|
235
|
-
this[_f] = true;
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
239
|
-
*/
|
|
240
|
-
static is(error) {
|
|
241
|
-
return error instanceof TimeoutFailure || (error instanceof Error && error[isTimeoutFailure]);
|
|
242
185
|
}
|
|
243
|
-
}
|
|
186
|
+
};
|
|
187
|
+
TimeoutFailure = __decorate([
|
|
188
|
+
(0, type_helpers_1.SymbolBasedInstanceOfError)('TimeoutFailure')
|
|
189
|
+
], TimeoutFailure);
|
|
244
190
|
exports.TimeoutFailure = TimeoutFailure;
|
|
245
|
-
_f = isTimeoutFailure;
|
|
246
|
-
const isActivityFailure = Symbol.for('__temporal_isActivityFailure');
|
|
247
191
|
/**
|
|
248
192
|
* Contains information about an Activity failure. Always contains the original reason for the failure as its `cause`.
|
|
249
193
|
* For example, if an Activity timed out, the cause will be a {@link TimeoutFailure}.
|
|
250
194
|
*
|
|
251
195
|
* This exception is expected to be thrown only by the framework code.
|
|
252
196
|
*/
|
|
253
|
-
class ActivityFailure extends TemporalFailure {
|
|
197
|
+
let ActivityFailure = class ActivityFailure extends TemporalFailure {
|
|
254
198
|
constructor(message, activityType, activityId, retryState, identity, cause) {
|
|
255
199
|
super(message, cause);
|
|
256
200
|
this.activityType = activityType;
|
|
257
201
|
this.activityId = activityId;
|
|
258
202
|
this.retryState = retryState;
|
|
259
203
|
this.identity = identity;
|
|
260
|
-
this.name = 'ActivityFailure';
|
|
261
|
-
/**
|
|
262
|
-
* Marker to determine whether an error is an instance of ActivityFailure.
|
|
263
|
-
*/
|
|
264
|
-
this[_g] = true;
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
268
|
-
*/
|
|
269
|
-
static is(error) {
|
|
270
|
-
return error instanceof ActivityFailure || (error instanceof Error && error[isActivityFailure]);
|
|
271
204
|
}
|
|
272
|
-
}
|
|
205
|
+
};
|
|
206
|
+
ActivityFailure = __decorate([
|
|
207
|
+
(0, type_helpers_1.SymbolBasedInstanceOfError)('ActivityFailure')
|
|
208
|
+
], ActivityFailure);
|
|
273
209
|
exports.ActivityFailure = ActivityFailure;
|
|
274
|
-
_g = isActivityFailure;
|
|
275
|
-
const isChildWorkflowFailure = Symbol.for('__temporal_isChildWorkflowFailure');
|
|
276
210
|
/**
|
|
277
211
|
* Contains information about a Child Workflow failure. Always contains the reason for the failure as its {@link cause}.
|
|
278
212
|
* For example, if the Child was Terminated, the `cause` is a {@link TerminatedFailure}.
|
|
279
213
|
*
|
|
280
214
|
* This exception is expected to be thrown only by the framework code.
|
|
281
215
|
*/
|
|
282
|
-
class ChildWorkflowFailure extends TemporalFailure {
|
|
216
|
+
let ChildWorkflowFailure = class ChildWorkflowFailure extends TemporalFailure {
|
|
283
217
|
constructor(namespace, execution, workflowType, retryState, cause) {
|
|
284
218
|
super('Child Workflow execution failed', cause);
|
|
285
219
|
this.namespace = namespace;
|
|
286
220
|
this.execution = execution;
|
|
287
221
|
this.workflowType = workflowType;
|
|
288
222
|
this.retryState = retryState;
|
|
289
|
-
this.name = 'ChildWorkflowFailure';
|
|
290
|
-
/**
|
|
291
|
-
* Marker to determine whether an error is an instance of ChildWorkflowFailure.
|
|
292
|
-
*/
|
|
293
|
-
this[_h] = true;
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
297
|
-
*/
|
|
298
|
-
static is(error) {
|
|
299
|
-
return error instanceof ChildWorkflowFailure || (error instanceof Error && error[isChildWorkflowFailure]);
|
|
300
223
|
}
|
|
301
|
-
}
|
|
224
|
+
};
|
|
225
|
+
ChildWorkflowFailure = __decorate([
|
|
226
|
+
(0, type_helpers_1.SymbolBasedInstanceOfError)('ChildWorkflowFailure')
|
|
227
|
+
], ChildWorkflowFailure);
|
|
302
228
|
exports.ChildWorkflowFailure = ChildWorkflowFailure;
|
|
303
|
-
_h = isChildWorkflowFailure;
|
|
304
229
|
/**
|
|
305
230
|
* If `error` is already an `ApplicationFailure`, returns `error`.
|
|
306
231
|
*
|
|
@@ -311,7 +236,7 @@ _h = isChildWorkflowFailure;
|
|
|
311
236
|
* - `stack`: `error.stack` or `''`
|
|
312
237
|
*/
|
|
313
238
|
function ensureApplicationFailure(error) {
|
|
314
|
-
if (ApplicationFailure
|
|
239
|
+
if (error instanceof ApplicationFailure) {
|
|
315
240
|
return error;
|
|
316
241
|
}
|
|
317
242
|
const message = ((0, type_helpers_1.isRecord)(error) && String(error.message)) || String(error);
|
|
@@ -329,7 +254,7 @@ exports.ensureApplicationFailure = ensureApplicationFailure;
|
|
|
329
254
|
* Otherwise returns an `ApplicationFailure` with `String(err)` as the message.
|
|
330
255
|
*/
|
|
331
256
|
function ensureTemporalFailure(err) {
|
|
332
|
-
if (TemporalFailure
|
|
257
|
+
if (err instanceof TemporalFailure) {
|
|
333
258
|
return err;
|
|
334
259
|
}
|
|
335
260
|
return ensureApplicationFailure(err);
|
|
@@ -342,16 +267,10 @@ exports.ensureTemporalFailure = ensureTemporalFailure;
|
|
|
342
267
|
* Otherwise, return `error.message`.
|
|
343
268
|
*/
|
|
344
269
|
function rootCause(error) {
|
|
345
|
-
if (TemporalFailure
|
|
270
|
+
if (error instanceof TemporalFailure) {
|
|
346
271
|
return error.cause ? rootCause(error.cause) : error.message;
|
|
347
272
|
}
|
|
348
|
-
|
|
349
|
-
return error.message;
|
|
350
|
-
}
|
|
351
|
-
if (typeof error === 'string') {
|
|
352
|
-
return error;
|
|
353
|
-
}
|
|
354
|
-
return undefined;
|
|
273
|
+
return (0, type_helpers_1.errorMessage)(error);
|
|
355
274
|
}
|
|
356
275
|
exports.rootCause = rootCause;
|
|
357
276
|
//# sourceMappingURL=failure.js.map
|
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,iDAAkG;AAErF,QAAA,cAAc,GAAG,eAAe,CAAC;AAG9C,0EAA0E;AAC1E,gDAAgD;AAChD,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,qFAA4B,CAAA;IAC5B,2FAA+B,CAAA;IAC/B,iGAAkC,CAAA;IAClC,iGAAkC,CAAA;IAClC,iFAA0B,CAAA;AAC5B,CAAC,EANW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAMtB;AAED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Y,eAAe,EAAE;QAClC,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,wBAAwB,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC;AALD,sDAKC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,KAAc;IACtC,IAAI,KAAK,YAAY,eAAe,EAAE;QACpC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;KAC7D;IACD,OAAO,IAAA,2BAAY,EAAC,KAAK,CAAC,CAAC;AAC7B,CAAC;AALD,8BAKC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './retry-policy';
|
|
|
19
19
|
export { type Timestamp, Duration, StringValue } from './time';
|
|
20
20
|
export * from './workflow-handle';
|
|
21
21
|
export * from './workflow-options';
|
|
22
|
+
export * from './versioning-intent';
|
|
22
23
|
/**
|
|
23
24
|
* Encode a UTF-8 string into a Uint8Array
|
|
24
25
|
*
|
package/lib/index.js
CHANGED
|
@@ -48,6 +48,7 @@ __exportStar(require("./logger"), exports);
|
|
|
48
48
|
__exportStar(require("./retry-policy"), exports);
|
|
49
49
|
__exportStar(require("./workflow-handle"), exports);
|
|
50
50
|
__exportStar(require("./workflow-options"), exports);
|
|
51
|
+
__exportStar(require("./versioning-intent"), exports);
|
|
51
52
|
/**
|
|
52
53
|
* Encode a UTF-8 string into a Uint8Array
|
|
53
54
|
*
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qDAAuC;AACvC,wDAA0C;AAE1C,qDAAmC;AACnC,6DAA2C;AAC3C,gEAA8C;AAC9C,4DAA0C;AAC1C,gEAA8C;AAC9C,oDAAkC;AAClC,oDAAkC;AAClC,2CAAyB;AACzB,4CAA0B;AAE1B,+CAA6B;AAC7B,2CAAyB;AACzB,iDAA+B;AAE/B,oDAAkC;AAClC,qDAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qDAAuC;AACvC,wDAA0C;AAE1C,qDAAmC;AACnC,6DAA2C;AAC3C,gEAA8C;AAC9C,4DAA0C;AAC1C,gEAA8C;AAC9C,oDAAkC;AAClC,oDAAkC;AAClC,2CAAyB;AACzB,4CAA0B;AAE1B,+CAA6B;AAC7B,2CAAyB;AACzB,iDAA+B;AAE/B,oDAAkC;AAClC,qDAAmC;AACnC,sDAAoC;AAEpC;;;;;GAKG;AACH,SAAgB,EAAE,CAAC,CAAS;IAC1B,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC5B,CAAC;AAFD,gBAEC;AAED;;;;;GAKG;AACH,SAAgB,GAAG,CAAC,GAAe;IACjC,OAAO,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC;AAFD,kBAEC;AAED;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,KAAc;IACzC,OAAO,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC;AAFD,oCAEC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,KAAc;IACtC,OAAO,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC;AAFD,8BAEC"}
|
package/lib/type-helpers.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ export type Replace<Base, New> = Omit<Base, keyof New> & New;
|
|
|
14
14
|
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
15
15
|
export declare function hasOwnProperty<X extends Record<string, unknown>, Y extends PropertyKey>(record: X, prop: Y): record is X & Record<Y, unknown>;
|
|
16
16
|
export declare function hasOwnProperties<X extends Record<string, unknown>, Y extends PropertyKey>(record: X, props: Y[]): record is X & Record<Y, unknown>;
|
|
17
|
+
export declare function isError(error: unknown): error is Error;
|
|
18
|
+
export declare function isAbortError(error: unknown): error is Error & {
|
|
19
|
+
name: 'AbortError';
|
|
20
|
+
};
|
|
17
21
|
/**
|
|
18
22
|
* Get `error.message` (or `undefined` if not present)
|
|
19
23
|
*/
|
|
@@ -26,3 +30,32 @@ export declare function errorCode(error: unknown): string | undefined;
|
|
|
26
30
|
* Asserts that some type is the never type
|
|
27
31
|
*/
|
|
28
32
|
export declare function assertNever(msg: string, x: never): never;
|
|
33
|
+
export type Class<E extends Error> = {
|
|
34
|
+
new (...args: any[]): E;
|
|
35
|
+
prototype: E;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A decorator to be used on error classes. It adds the 'name' property AND provides a custom
|
|
39
|
+
* 'instanceof' handler that works correctly across execution contexts.
|
|
40
|
+
*
|
|
41
|
+
* ### Details ###
|
|
42
|
+
*
|
|
43
|
+
* According to the EcmaScript's spec, the default behavior of JavaScript's `x instanceof Y` operator is to walk up the
|
|
44
|
+
* prototype chain of object 'x', checking if any constructor in that hierarchy is _exactly the same object_ as the
|
|
45
|
+
* constructor function 'Y'.
|
|
46
|
+
*
|
|
47
|
+
* Unfortunately, it happens in various situations that different constructor function objects get created for what
|
|
48
|
+
* appears to be the very same class. This leads to surprising behavior where `instanceof` returns false though it is
|
|
49
|
+
* known that the object is indeed an instance of that class. One particular case where this happens is when constructor
|
|
50
|
+
* 'Y' belongs to a different realm than the constuctor with which 'x' was instantiated. Another case is when two copies
|
|
51
|
+
* of the same library gets loaded in the same realm.
|
|
52
|
+
*
|
|
53
|
+
* In practice, this tends to cause issues when crossing the workflow-sandboxing boundary (since Node's vm module
|
|
54
|
+
* really creates new execution realms), as well as when running tests using Jest (see https://github.com/jestjs/jest/issues/2549
|
|
55
|
+
* for some details on that one).
|
|
56
|
+
*
|
|
57
|
+
* This function injects a custom 'instanceof' handler into the prototype of 'clazz', which is both cross-realm safe and
|
|
58
|
+
* cross-copies-of-the-same-lib safe. It works by adding a special symbol property to the prototype of 'clazz', and then
|
|
59
|
+
* checking for the presence of that symbol.
|
|
60
|
+
*/
|
|
61
|
+
export declare function SymbolBasedInstanceOfError<E extends Error>(markerName: string): (clazz: Class<E>) => void;
|