@temporalio/core-bridge 1.8.1 → 1.8.3

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/errors.d.ts CHANGED
@@ -1,31 +1,19 @@
1
1
  import { IllegalStateError } from '@temporalio/common';
2
- declare const isShutdownError: unique symbol;
3
2
  /**
4
3
  * The worker has been shut down
5
4
  */
6
5
  export declare class ShutdownError extends Error {
7
- readonly name = "ShutdownError";
8
- /**
9
- * Marker to determine whether an error is an instance of TerminatedFailure.
10
- */
11
- protected readonly [isShutdownError] = true;
12
- /**
13
- * Instanceof check that works when multiple versions of @temporalio/core-bridge are installed.
14
- */
15
- static is(error: unknown): error is ShutdownError;
16
6
  }
17
7
  /**
18
8
  * Thrown after shutdown was requested as a response to a poll function, JS should stop polling
19
9
  * once this error is encountered
20
10
  */
21
11
  export declare class TransportError extends Error {
22
- readonly name = "TransportError";
23
12
  }
24
13
  /**
25
14
  * Something unexpected happened, considered fatal
26
15
  */
27
16
  export declare class UnexpectedError extends Error {
28
- readonly name = "UnexpectedError";
29
17
  }
30
18
  export { IllegalStateError };
31
19
  export declare function convertFromNamedError(e: unknown, keepStackTrace: boolean): unknown;
package/lib/errors.js CHANGED
@@ -1,57 +1,49 @@
1
1
  "use strict";
2
- var _a;
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.convertFromNamedError = exports.IllegalStateError = exports.UnexpectedError = exports.TransportError = exports.ShutdownError = void 0;
5
10
  const common_1 = require("@temporalio/common");
6
11
  Object.defineProperty(exports, "IllegalStateError", { enumerable: true, get: function () { return common_1.IllegalStateError; } });
7
- const isShutdownError = Symbol.for('__temporal_isShutdownError');
12
+ const type_helpers_1 = require("@temporalio/common/lib/type-helpers");
8
13
  /**
9
14
  * The worker has been shut down
10
15
  */
11
- class ShutdownError extends Error {
12
- constructor() {
13
- super(...arguments);
14
- this.name = 'ShutdownError';
15
- /**
16
- * Marker to determine whether an error is an instance of TerminatedFailure.
17
- */
18
- this[_a] = true;
19
- }
20
- /**
21
- * Instanceof check that works when multiple versions of @temporalio/core-bridge are installed.
22
- */
23
- static is(error) {
24
- return error instanceof ShutdownError || error?.[isShutdownError] === true;
25
- }
26
- }
16
+ let ShutdownError = class ShutdownError extends Error {
17
+ };
18
+ ShutdownError = __decorate([
19
+ (0, type_helpers_1.SymbolBasedInstanceOfError)('ShutdownError')
20
+ ], ShutdownError);
27
21
  exports.ShutdownError = ShutdownError;
28
- _a = isShutdownError;
29
22
  /**
30
23
  * Thrown after shutdown was requested as a response to a poll function, JS should stop polling
31
24
  * once this error is encountered
32
25
  */
33
- class TransportError extends Error {
34
- constructor() {
35
- super(...arguments);
36
- this.name = 'TransportError';
37
- }
38
- }
26
+ let TransportError = class TransportError extends Error {
27
+ };
28
+ TransportError = __decorate([
29
+ (0, type_helpers_1.SymbolBasedInstanceOfError)('TransportError')
30
+ ], TransportError);
39
31
  exports.TransportError = TransportError;
40
32
  /**
41
33
  * Something unexpected happened, considered fatal
42
34
  */
43
- class UnexpectedError extends Error {
44
- constructor() {
45
- super(...arguments);
46
- this.name = 'UnexpectedError';
47
- }
48
- }
35
+ let UnexpectedError = class UnexpectedError extends Error {
36
+ };
37
+ UnexpectedError = __decorate([
38
+ (0, type_helpers_1.SymbolBasedInstanceOfError)('UnexpectedError')
39
+ ], UnexpectedError);
49
40
  exports.UnexpectedError = UnexpectedError;
41
+ // Check if the error's class is exactly Error (not a descendant of it), in a realm-safe way
42
+ function isBareError(e) {
43
+ return (0, type_helpers_1.isError)(e) && Object.getPrototypeOf(e)?.name === 'Error';
44
+ }
50
45
  function convertFromNamedError(e, keepStackTrace) {
51
- // Check if the error's class is exactly Error (not a descendant of it).
52
- // The instanceof check both ensure that e is indeed an object AND avoid
53
- // TypeScript from complaining on accessing Error properties.
54
- if (e instanceof Error && Object.getPrototypeOf(e).name === 'Error') {
46
+ if (isBareError(e)) {
55
47
  let newerr;
56
48
  switch (e.name) {
57
49
  case 'TransportError':
package/lib/errors.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../ts/errors.ts"],"names":[],"mappings":";;;;AAAA,+CAAuD;AAsC9C,kGAtCA,0BAAiB,OAsCA;AApC1B,MAAM,eAAe,GAAkB,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAEhF;;GAEG;AACH,MAAa,aAAc,SAAQ,KAAK;IAAxC;;QACkB,SAAI,GAAG,eAAe,CAAC;QAEvC;;WAEG;QACgB,QAAiB,GAAG,IAAI,CAAC;IAQ9C,CAAC;IANC;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAc;QACtB,OAAO,KAAK,YAAY,aAAa,IAAK,KAAa,EAAE,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IACtF,CAAC;CACF;AAdD,sCAcC;KARqB,eAAe;AAUrC;;;GAGG;AACH,MAAa,cAAe,SAAQ,KAAK;IAAzC;;QACkB,SAAI,GAAG,gBAAgB,CAAC;IAC1C,CAAC;CAAA;AAFD,wCAEC;AAED;;GAEG;AACH,MAAa,eAAgB,SAAQ,KAAK;IAA1C;;QACkB,SAAI,GAAG,iBAAiB,CAAC;IAC3C,CAAC;CAAA;AAFD,0CAEC;AAID,SAAgB,qBAAqB,CAAC,CAAU,EAAE,cAAuB;IACvE,wEAAwE;IACxE,wEAAwE;IACxE,6DAA6D;IAC7D,IAAI,CAAC,YAAY,KAAK,IAAI,MAAM,CAAC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BAClB,MAAM,GAAG,IAAI,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBACtC,MAAM,CAAC,KAAK,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;gBACpD,OAAO,MAAM,CAAC;YAEhB,KAAK,iBAAiB;gBACpB,MAAM,GAAG,IAAI,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBACxC,MAAM,CAAC,KAAK,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;gBACpD,OAAO,MAAM,CAAC;SACjB;KACF;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AA1BD,sDA0BC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temporalio/core-bridge",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "description": "Temporal.io SDK Core<>Node bridge",
5
5
  "main": "index.js",
6
6
  "types": "lib/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
25
  "@opentelemetry/api": "^1.4.1",
26
- "@temporalio/common": "1.8.1",
26
+ "@temporalio/common": "1.8.3",
27
27
  "arg": "^5.0.2",
28
28
  "cargo-cp-artifact": "^0.1.6",
29
29
  "which": "^2.0.2"
@@ -53,5 +53,5 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "97808111bbec478260e915726bb9730a489f8fa4"
56
+ "gitHead": "7d1c0ec969b897b4f32bd5a8eda9819a03bd2f83"
57
57
  }
@@ -1,4 +1,4 @@
1
- FROM rust:1.68
1
+ FROM rust:1.71
2
2
 
3
3
  RUN rustup component add rustfmt && \
4
4
  rustup component add clippy