Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@temporalio/core-bridge

Package Overview
Dependencies
Maintainers
8
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@temporalio/core-bridge - npm Package Compare versions

Comparing version 1.8.1 to 1.8.2

12

lib/errors.d.ts
import { IllegalStateError } from '@temporalio/common';
declare const isShutdownError: unique symbol;
/**

@@ -7,11 +6,2 @@ * The worker has been shut down

export declare class ShutdownError extends Error {
readonly name = "ShutdownError";
/**
* Marker to determine whether an error is an instance of TerminatedFailure.
*/
protected readonly [isShutdownError] = true;
/**
* Instanceof check that works when multiple versions of @temporalio/core-bridge are installed.
*/
static is(error: unknown): error is ShutdownError;
}

@@ -23,3 +13,2 @@ /**

export declare class TransportError extends Error {
readonly name = "TransportError";
}

@@ -30,5 +19,4 @@ /**

export declare class UnexpectedError extends Error {
readonly name = "UnexpectedError";
}
export { IllegalStateError };
export declare function convertFromNamedError(e: unknown, keepStackTrace: boolean): unknown;

62

lib/errors.js
"use strict";
var _a;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -7,24 +12,12 @@ exports.convertFromNamedError = exports.IllegalStateError = exports.UnexpectedError = exports.TransportError = exports.ShutdownError = void 0;

Object.defineProperty(exports, "IllegalStateError", { enumerable: true, get: function () { return common_1.IllegalStateError; } });
const isShutdownError = Symbol.for('__temporal_isShutdownError');
const type_helpers_1 = require("@temporalio/common/lib/type-helpers");
/**
* The worker has been shut down
*/
class ShutdownError extends Error {
constructor() {
super(...arguments);
this.name = 'ShutdownError';
/**
* Marker to determine whether an error is an instance of TerminatedFailure.
*/
this[_a] = true;
}
/**
* Instanceof check that works when multiple versions of @temporalio/core-bridge are installed.
*/
static is(error) {
return error instanceof ShutdownError || error?.[isShutdownError] === true;
}
}
let ShutdownError = class ShutdownError extends Error {
};
ShutdownError = __decorate([
(0, type_helpers_1.SymbolBasedInstanceOfError)('ShutdownError')
], ShutdownError);
exports.ShutdownError = ShutdownError;
_a = isShutdownError;
/**

@@ -34,8 +27,7 @@ * Thrown after shutdown was requested as a response to a poll function, JS should stop polling

*/
class TransportError extends Error {
constructor() {
super(...arguments);
this.name = 'TransportError';
}
}
let TransportError = class TransportError extends Error {
};
TransportError = __decorate([
(0, type_helpers_1.SymbolBasedInstanceOfError)('TransportError')
], TransportError);
exports.TransportError = TransportError;

@@ -45,14 +37,14 @@ /**

*/
class UnexpectedError extends Error {
constructor() {
super(...arguments);
this.name = 'UnexpectedError';
}
let UnexpectedError = class UnexpectedError extends Error {
};
UnexpectedError = __decorate([
(0, type_helpers_1.SymbolBasedInstanceOfError)('UnexpectedError')
], UnexpectedError);
exports.UnexpectedError = UnexpectedError;
// Check if the error's class is exactly Error (not a descendant of it), in a realm-safe way
function isBareError(e) {
return (0, type_helpers_1.isError)(e) && Object.getPrototypeOf(e)?.name === 'Error';
}
exports.UnexpectedError = UnexpectedError;
function convertFromNamedError(e, keepStackTrace) {
// Check if the error's class is exactly Error (not a descendant of it).
// The instanceof check both ensure that e is indeed an object AND avoid
// TypeScript from complaining on accessing Error properties.
if (e instanceof Error && Object.getPrototypeOf(e).name === 'Error') {
if (isBareError(e)) {
let newerr;

@@ -59,0 +51,0 @@ switch (e.name) {

{
"name": "@temporalio/core-bridge",
"version": "1.8.1",
"version": "1.8.2",
"description": "Temporal.io SDK Core<>Node bridge",

@@ -26,3 +26,3 @@ "main": "index.js",

"@opentelemetry/api": "^1.4.1",
"@temporalio/common": "1.8.1",
"@temporalio/common": "1.8.2",
"arg": "^5.0.2",

@@ -57,3 +57,3 @@ "cargo-cp-artifact": "^0.1.6",

},
"gitHead": "97808111bbec478260e915726bb9730a489f8fa4"
"gitHead": "d85bf54da757741b438f8d39a0e7265b80d4f0d6"
}
import { IllegalStateError } from '@temporalio/common';
import { isError, SymbolBasedInstanceOfError } from '@temporalio/common/lib/type-helpers';
const isShutdownError: unique symbol = Symbol.for('__temporal_isShutdownError');
/**
* The worker has been shut down
*/
export class ShutdownError extends Error {
public readonly name = 'ShutdownError';
@SymbolBasedInstanceOfError('ShutdownError')
export class ShutdownError extends Error {}
/**
* Marker to determine whether an error is an instance of TerminatedFailure.
*/
protected readonly [isShutdownError] = true;
/**
* Instanceof check that works when multiple versions of @temporalio/core-bridge are installed.
*/
static is(error: unknown): error is ShutdownError {
return error instanceof ShutdownError || (error as any)?.[isShutdownError] === true;
}
}
/**

@@ -28,5 +14,4 @@ * Thrown after shutdown was requested as a response to a poll function, JS should stop polling

*/
export class TransportError extends Error {
public readonly name = 'TransportError';
}
@SymbolBasedInstanceOfError('TransportError')
export class TransportError extends Error {}

@@ -36,13 +21,14 @@ /**

*/
export class UnexpectedError extends Error {
public readonly name = 'UnexpectedError';
}
@SymbolBasedInstanceOfError('UnexpectedError')
export class UnexpectedError extends Error {}
export { IllegalStateError };
// Check if the error's class is exactly Error (not a descendant of it), in a realm-safe way
function isBareError(e: unknown): e is Error {
return isError(e) && Object.getPrototypeOf(e)?.name === 'Error';
}
export function convertFromNamedError(e: unknown, keepStackTrace: boolean): unknown {
// Check if the error's class is exactly Error (not a descendant of it).
// The instanceof check both ensure that e is indeed an object AND avoid
// TypeScript from complaining on accessing Error properties.
if (e instanceof Error && Object.getPrototypeOf(e).name === 'Error') {
if (isBareError(e)) {
let newerr: Error;

@@ -49,0 +35,0 @@ switch (e.name) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc