@temporalio/common 1.4.0 → 1.4.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/index.d.ts +14 -0
- package/lib/index.js +22 -1
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +21 -0
package/lib/index.d.ts
CHANGED
|
@@ -33,3 +33,17 @@ export declare function u8(s: string): Uint8Array;
|
|
|
33
33
|
* @deprecated - meant for internal use only
|
|
34
34
|
*/
|
|
35
35
|
export declare function str(arr: Uint8Array): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get `error.message` (or `undefined` if not present)
|
|
38
|
+
*
|
|
39
|
+
* @hidden
|
|
40
|
+
* @deprecated - meant for internal use only
|
|
41
|
+
*/
|
|
42
|
+
export declare function errorMessage(error: unknown): string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Get `error.code` (or `undefined` if not present)
|
|
45
|
+
*
|
|
46
|
+
* @hidden
|
|
47
|
+
* @deprecated - meant for internal use only
|
|
48
|
+
*/
|
|
49
|
+
export declare function errorCode(error: unknown): string | undefined;
|
package/lib/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.str = exports.u8 = void 0;
|
|
29
|
+
exports.errorCode = exports.errorMessage = exports.str = exports.u8 = void 0;
|
|
30
30
|
__exportStar(require("./activity-options"), exports);
|
|
31
31
|
__exportStar(require("./converter/data-converter"), exports);
|
|
32
32
|
__exportStar(require("./converter/failure-converter"), exports);
|
|
@@ -42,6 +42,7 @@ __exportStar(require("./workflow-options"), exports);
|
|
|
42
42
|
__exportStar(require("./workflow-handle"), exports);
|
|
43
43
|
__exportStar(require("./deprecated-time"), exports);
|
|
44
44
|
const encoding = __importStar(require("./encoding"));
|
|
45
|
+
const helpers = __importStar(require("./type-helpers"));
|
|
45
46
|
/**
|
|
46
47
|
* Encode a UTF-8 string into a Uint8Array
|
|
47
48
|
*
|
|
@@ -62,4 +63,24 @@ function str(arr) {
|
|
|
62
63
|
return encoding.decode(arr);
|
|
63
64
|
}
|
|
64
65
|
exports.str = str;
|
|
66
|
+
/**
|
|
67
|
+
* Get `error.message` (or `undefined` if not present)
|
|
68
|
+
*
|
|
69
|
+
* @hidden
|
|
70
|
+
* @deprecated - meant for internal use only
|
|
71
|
+
*/
|
|
72
|
+
function errorMessage(error) {
|
|
73
|
+
return helpers.errorMessage(error);
|
|
74
|
+
}
|
|
75
|
+
exports.errorMessage = errorMessage;
|
|
76
|
+
/**
|
|
77
|
+
* Get `error.code` (or `undefined` if not present)
|
|
78
|
+
*
|
|
79
|
+
* @hidden
|
|
80
|
+
* @deprecated - meant for internal use only
|
|
81
|
+
*/
|
|
82
|
+
function errorCode(error) {
|
|
83
|
+
return helpers.errorCode(error);
|
|
84
|
+
}
|
|
85
|
+
exports.errorCode = errorCode;
|
|
65
86
|
//# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,qDAAmC;AACnC,6DAA2C;AAC3C,gEAA8C;AAC9C,4DAA0C;AAC1C,gEAA8C;AAC9C,oDAAkC;AAClC,2CAAyB;AACzB,4CAA0B;AAC1B,4CAA0B;AAC1B,+CAA6B;AAC7B,iDAA+B;AAE/B,qDAAmC;AACnC,oDAAkC;AAClC,oDAAkC;AAElC,qDAAuC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,qDAAmC;AACnC,6DAA2C;AAC3C,gEAA8C;AAC9C,4DAA0C;AAC1C,gEAA8C;AAC9C,oDAAkC;AAClC,2CAAyB;AACzB,4CAA0B;AAC1B,4CAA0B;AAC1B,+CAA6B;AAC7B,iDAA+B;AAE/B,qDAAmC;AACnC,oDAAkC;AAClC,oDAAkC;AAElC,qDAAuC;AACvC,wDAA0C;AAE1C;;;;;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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporalio/common",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
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.0.3",
|
|
16
|
-
"@temporalio/proto": "^1.4.
|
|
16
|
+
"@temporalio/proto": "^1.4.2",
|
|
17
17
|
"long": "^5.2.0",
|
|
18
18
|
"ms": "^2.1.3",
|
|
19
19
|
"proto3-json-serializer": "^1.0.3",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"src",
|
|
31
31
|
"lib"
|
|
32
32
|
],
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "d49c8530c67af77782b39a3f34c82922d8f8061e"
|
|
34
34
|
}
|
package/src/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from './workflow-handle';
|
|
|
22
22
|
export * from './deprecated-time';
|
|
23
23
|
|
|
24
24
|
import * as encoding from './encoding';
|
|
25
|
+
import * as helpers from './type-helpers';
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* Encode a UTF-8 string into a Uint8Array
|
|
@@ -42,3 +43,23 @@ export function u8(s: string): Uint8Array {
|
|
|
42
43
|
export function str(arr: Uint8Array): string {
|
|
43
44
|
return encoding.decode(arr);
|
|
44
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get `error.message` (or `undefined` if not present)
|
|
49
|
+
*
|
|
50
|
+
* @hidden
|
|
51
|
+
* @deprecated - meant for internal use only
|
|
52
|
+
*/
|
|
53
|
+
export function errorMessage(error: unknown): string | undefined {
|
|
54
|
+
return helpers.errorMessage(error);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Get `error.code` (or `undefined` if not present)
|
|
59
|
+
*
|
|
60
|
+
* @hidden
|
|
61
|
+
* @deprecated - meant for internal use only
|
|
62
|
+
*/
|
|
63
|
+
export function errorCode(error: unknown): string | undefined {
|
|
64
|
+
return helpers.errorCode(error);
|
|
65
|
+
}
|