@temporalio/common 1.8.0 → 1.8.1
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/failure.js +8 -8
- 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/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/failure.ts +8 -8
- package/src/index.ts +1 -0
- package/src/versioning-intent.ts +18 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { coresdk } from '@temporalio/proto';
|
|
2
2
|
import { RetryPolicy } from './retry-policy';
|
|
3
3
|
import { Duration } from './time';
|
|
4
|
+
import { VersioningIntent } from './versioning-intent';
|
|
4
5
|
export declare enum ActivityCancellationType {
|
|
5
6
|
TRY_CANCEL = 0,
|
|
6
7
|
WAIT_CANCELLATION_COMPLETED = 1,
|
|
@@ -84,6 +85,13 @@ export interface ActivityOptions {
|
|
|
84
85
|
* @default true
|
|
85
86
|
*/
|
|
86
87
|
allowEagerDispatch?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* When using the Worker Versioning feature, specifies whether this Activity should run on a
|
|
90
|
+
* worker with a compatible Build Id or not. See {@link VersioningIntent}.
|
|
91
|
+
*
|
|
92
|
+
* @experimental
|
|
93
|
+
*/
|
|
94
|
+
versioningIntent?: VersioningIntent;
|
|
87
95
|
}
|
|
88
96
|
/**
|
|
89
97
|
* Options for local activity invocation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-options.js","sourceRoot":"","sources":["../src/activity-options.ts"],"names":[],"mappings":";;;AAEA,iDAA8C;
|
|
1
|
+
{"version":3,"file":"activity-options.js","sourceRoot":"","sources":["../src/activity-options.ts"],"names":[],"mappings":";;;AAEA,iDAA8C;AAI9C,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;AAC7F,IAAA,2BAAY,GAAgF,CAAC"}
|
package/lib/failure.js
CHANGED
|
@@ -53,7 +53,7 @@ class TemporalFailure extends Error {
|
|
|
53
53
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
54
54
|
*/
|
|
55
55
|
static is(error) {
|
|
56
|
-
return error instanceof TemporalFailure ||
|
|
56
|
+
return error instanceof TemporalFailure || error?.[isTemporalFailure] === true;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
exports.TemporalFailure = TemporalFailure;
|
|
@@ -74,7 +74,7 @@ class ServerFailure extends TemporalFailure {
|
|
|
74
74
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
75
75
|
*/
|
|
76
76
|
static is(error) {
|
|
77
|
-
return error instanceof ServerFailure ||
|
|
77
|
+
return error instanceof ServerFailure || error?.[isServerFailure] === true;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
exports.ServerFailure = ServerFailure;
|
|
@@ -121,7 +121,7 @@ class ApplicationFailure extends TemporalFailure {
|
|
|
121
121
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
122
122
|
*/
|
|
123
123
|
static is(error) {
|
|
124
|
-
return error instanceof ApplicationFailure ||
|
|
124
|
+
return error instanceof ApplicationFailure || error?.[isApplicationFailure] === true;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
127
|
* Create a new `ApplicationFailure` from an Error object.
|
|
@@ -192,7 +192,7 @@ class CancelledFailure extends TemporalFailure {
|
|
|
192
192
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
193
193
|
*/
|
|
194
194
|
static is(error) {
|
|
195
|
-
return error instanceof CancelledFailure ||
|
|
195
|
+
return error instanceof CancelledFailure || error?.[isCancelledFailure] === true;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
exports.CancelledFailure = CancelledFailure;
|
|
@@ -214,7 +214,7 @@ class TerminatedFailure extends TemporalFailure {
|
|
|
214
214
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
215
215
|
*/
|
|
216
216
|
static is(error) {
|
|
217
|
-
return error instanceof TerminatedFailure ||
|
|
217
|
+
return error instanceof TerminatedFailure || error?.[isTerminatedFailure] === true;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
exports.TerminatedFailure = TerminatedFailure;
|
|
@@ -238,7 +238,7 @@ class TimeoutFailure extends TemporalFailure {
|
|
|
238
238
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
239
239
|
*/
|
|
240
240
|
static is(error) {
|
|
241
|
-
return error instanceof TimeoutFailure ||
|
|
241
|
+
return error instanceof TimeoutFailure || error?.[isTimeoutFailure] === true;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
exports.TimeoutFailure = TimeoutFailure;
|
|
@@ -267,7 +267,7 @@ class ActivityFailure extends TemporalFailure {
|
|
|
267
267
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
268
268
|
*/
|
|
269
269
|
static is(error) {
|
|
270
|
-
return error instanceof ActivityFailure ||
|
|
270
|
+
return error instanceof ActivityFailure || error?.[isActivityFailure] === true;
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
exports.ActivityFailure = ActivityFailure;
|
|
@@ -296,7 +296,7 @@ class ChildWorkflowFailure extends TemporalFailure {
|
|
|
296
296
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
297
297
|
*/
|
|
298
298
|
static is(error) {
|
|
299
|
-
return error instanceof ChildWorkflowFailure ||
|
|
299
|
+
return error instanceof ChildWorkflowFailure || error?.[isChildWorkflowFailure] === true;
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
exports.ChildWorkflowFailure = ChildWorkflowFailure;
|
package/lib/failure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failure.js","sourceRoot":"","sources":["../src/failure.ts"],"names":[],"mappings":";;;;AACA,iDAAwD;AAE3C,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,IAAA,2BAAY,GAAkD,CAAC;AAC/D,IAAA,2BAAY,GAAkD,CAAC;AAE/D,0EAA0E;AAC1E,+CAA+C;AAC/C,IAAY,UASX;AATD,WAAY,UAAU;IACpB,iFAA2B,CAAA;IAC3B,iFAA2B,CAAA;IAC3B,qGAAqC,CAAA;IACrC,yEAAuB,CAAA;IACvB,2GAAwC,CAAA;IACxC,mGAAoC,CAAA;IACpC,qGAAqC,CAAA;IACrC,2FAAgC,CAAA;AAClC,CAAC,EATW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QASrB;AAED,IAAA,2BAAY,GAAgD,CAAC;AAC7D,IAAA,2BAAY,GAAgD,CAAC;AAI7D,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;AAErE;;;;;;GAMG;AACH,MAAa,eAAgB,SAAQ,KAAK;IASxC,YAAY,OAAmC,EAAkB,KAAa;QAC5E,KAAK,CAAC,OAAO,IAAI,SAAS,CAAC,CAAC;QADmC,UAAK,GAAL,KAAK,CAAQ;QAR9D,SAAI,GAAW,iBAAiB,CAAC;QAYjD;;WAEG;QACgB,QAAmB,GAAG,IAAI,CAAC;IAL9C,CAAC;IAOD;;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AC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;KAC7D;IACD,IAAI,KAAK,YAAY,KAAK,EAAE;QAC1B,OAAO,KAAK,CAAC,OAAO,CAAC;KACtB;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,OAAO,KAAK,CAAC;KACd;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAXD,8BAWC"}
|
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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Indicates whether the user intends certain commands to be run on a compatible worker Build Id
|
|
3
|
+
* version or not.
|
|
4
|
+
*
|
|
5
|
+
* `COMPATIBLE` indicates that the command should run on a worker with compatible version if
|
|
6
|
+
* possible. It may not be possible if the target task queue does not also have knowledge of the
|
|
7
|
+
* current worker's Build Id.
|
|
8
|
+
*
|
|
9
|
+
* `DEFAULT` indicates that the command should run on the target task queue's current
|
|
10
|
+
* overall-default Build Id.
|
|
11
|
+
*
|
|
12
|
+
* Where this type is accepted optionally, an unset value indicates that the SDK should choose the
|
|
13
|
+
* most sensible default behavior for the type of command, accounting for whether the command will
|
|
14
|
+
* be run on the same task queue as the current worker.
|
|
15
|
+
*
|
|
16
|
+
* @experimental
|
|
17
|
+
*/
|
|
18
|
+
export type VersioningIntent = 'COMPATIBLE' | 'DEFAULT';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versioning-intent.js","sourceRoot":"","sources":["../src/versioning-intent.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporalio/common",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "Common library for code that's used across the Client, Worker, and/or Workflow",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@opentelemetry/api": "^1.4.1",
|
|
16
|
-
"@temporalio/proto": "1.8.
|
|
16
|
+
"@temporalio/proto": "1.8.1",
|
|
17
17
|
"long": "^5.2.0",
|
|
18
18
|
"ms": "^3.0.0-canary.1",
|
|
19
19
|
"proto3-json-serializer": "^1.0.3",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"src",
|
|
36
36
|
"lib"
|
|
37
37
|
],
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "97808111bbec478260e915726bb9730a489f8fa4"
|
|
39
39
|
}
|
package/src/activity-options.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { coresdk } from '@temporalio/proto';
|
|
|
2
2
|
import { RetryPolicy } from './retry-policy';
|
|
3
3
|
import { checkExtends } from './type-helpers';
|
|
4
4
|
import { Duration } from './time';
|
|
5
|
+
import { VersioningIntent } from './versioning-intent';
|
|
5
6
|
|
|
6
7
|
// Avoid importing the proto implementation to reduce workflow bundle size
|
|
7
8
|
// Copied from coresdk.workflow_commands.ActivityCancellationType
|
|
@@ -100,6 +101,14 @@ export interface ActivityOptions {
|
|
|
100
101
|
* @default true
|
|
101
102
|
*/
|
|
102
103
|
allowEagerDispatch?: boolean;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* When using the Worker Versioning feature, specifies whether this Activity should run on a
|
|
107
|
+
* worker with a compatible Build Id or not. See {@link VersioningIntent}.
|
|
108
|
+
*
|
|
109
|
+
* @experimental
|
|
110
|
+
*/
|
|
111
|
+
versioningIntent?: VersioningIntent;
|
|
103
112
|
}
|
|
104
113
|
|
|
105
114
|
/**
|
package/src/failure.ts
CHANGED
|
@@ -66,7 +66,7 @@ export class TemporalFailure extends Error {
|
|
|
66
66
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
67
67
|
*/
|
|
68
68
|
static is(error: unknown): error is TemporalFailure {
|
|
69
|
-
return error instanceof TemporalFailure || (error
|
|
69
|
+
return error instanceof TemporalFailure || (error as any)?.[isTemporalFailure] === true;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -89,7 +89,7 @@ export class ServerFailure extends TemporalFailure {
|
|
|
89
89
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
90
90
|
*/
|
|
91
91
|
static is(error: unknown): error is ServerFailure {
|
|
92
|
-
return error instanceof ServerFailure || (error
|
|
92
|
+
return error instanceof ServerFailure || (error as any)?.[isServerFailure] === true;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -142,7 +142,7 @@ export class ApplicationFailure extends TemporalFailure {
|
|
|
142
142
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
143
143
|
*/
|
|
144
144
|
static is(error: unknown): error is ApplicationFailure {
|
|
145
|
-
return error instanceof ApplicationFailure || (error
|
|
145
|
+
return error instanceof ApplicationFailure || (error as any)?.[isApplicationFailure] === true;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
/**
|
|
@@ -248,7 +248,7 @@ export class CancelledFailure extends TemporalFailure {
|
|
|
248
248
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
249
249
|
*/
|
|
250
250
|
static is(error: unknown): error is CancelledFailure {
|
|
251
|
-
return error instanceof CancelledFailure || (error
|
|
251
|
+
return error instanceof CancelledFailure || (error as any)?.[isCancelledFailure] === true;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
|
|
@@ -273,7 +273,7 @@ export class TerminatedFailure extends TemporalFailure {
|
|
|
273
273
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
274
274
|
*/
|
|
275
275
|
static is(error: unknown): error is TerminatedFailure {
|
|
276
|
-
return error instanceof TerminatedFailure || (error
|
|
276
|
+
return error instanceof TerminatedFailure || (error as any)?.[isTerminatedFailure] === true;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
|
|
@@ -302,7 +302,7 @@ export class TimeoutFailure extends TemporalFailure {
|
|
|
302
302
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
303
303
|
*/
|
|
304
304
|
static is(error: unknown): error is TimeoutFailure {
|
|
305
|
-
return error instanceof TimeoutFailure || (error
|
|
305
|
+
return error instanceof TimeoutFailure || (error as any)?.[isTimeoutFailure] === true;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
|
|
@@ -337,7 +337,7 @@ export class ActivityFailure extends TemporalFailure {
|
|
|
337
337
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
338
338
|
*/
|
|
339
339
|
static is(error: unknown): error is ActivityFailure {
|
|
340
|
-
return error instanceof ActivityFailure || (error
|
|
340
|
+
return error instanceof ActivityFailure || (error as any)?.[isActivityFailure] === true;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
|
|
@@ -371,7 +371,7 @@ export class ChildWorkflowFailure extends TemporalFailure {
|
|
|
371
371
|
* Instanceof check that works when multiple versions of @temporalio/common are installed.
|
|
372
372
|
*/
|
|
373
373
|
static is(error: unknown): error is ChildWorkflowFailure {
|
|
374
|
-
return error instanceof ChildWorkflowFailure || (error
|
|
374
|
+
return error instanceof ChildWorkflowFailure || (error as any)?.[isChildWorkflowFailure] === true;
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
|
package/src/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from './retry-policy';
|
|
|
23
23
|
export { type Timestamp, Duration, StringValue } from './time';
|
|
24
24
|
export * from './workflow-handle';
|
|
25
25
|
export * from './workflow-options';
|
|
26
|
+
export * from './versioning-intent';
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* Encode a UTF-8 string into a Uint8Array
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Indicates whether the user intends certain commands to be run on a compatible worker Build Id
|
|
3
|
+
* version or not.
|
|
4
|
+
*
|
|
5
|
+
* `COMPATIBLE` indicates that the command should run on a worker with compatible version if
|
|
6
|
+
* possible. It may not be possible if the target task queue does not also have knowledge of the
|
|
7
|
+
* current worker's Build Id.
|
|
8
|
+
*
|
|
9
|
+
* `DEFAULT` indicates that the command should run on the target task queue's current
|
|
10
|
+
* overall-default Build Id.
|
|
11
|
+
*
|
|
12
|
+
* Where this type is accepted optionally, an unset value indicates that the SDK should choose the
|
|
13
|
+
* most sensible default behavior for the type of command, accounting for whether the command will
|
|
14
|
+
* be run on the same task queue as the current worker.
|
|
15
|
+
*
|
|
16
|
+
* @experimental
|
|
17
|
+
*/
|
|
18
|
+
export type VersioningIntent = 'COMPATIBLE' | 'DEFAULT';
|