@temporalio/client
Advanced tools
Comparing version 0.13.0 to 0.14.0
@@ -1,41 +0,24 @@ | ||
import { temporal } from '@temporalio/proto'; | ||
import { RetryState, TemporalFailure } from '@temporalio/common'; | ||
/** | ||
* Thrown by client when waiting on Workflow execution result if Workflow is terminated | ||
* Thrown by the client while waiting on Workflow execution result if execution | ||
* completes with failure. | ||
* | ||
* The failure type will be set in the `cause` attribute. | ||
* | ||
* For example if the workflow is cancelled, `cause` will be set to | ||
* {@link CancelledFailure}. | ||
*/ | ||
export declare class WorkflowExecutionTerminatedError extends Error { | ||
readonly details: any[]; | ||
readonly identity?: string | undefined; | ||
export declare class WorkflowFailedError extends Error { | ||
readonly cause: TemporalFailure | undefined; | ||
readonly retryState: RetryState; | ||
readonly name: string; | ||
constructor(message: string, details: any[], identity?: string | undefined); | ||
constructor(message: string, cause: TemporalFailure | undefined, retryState: RetryState); | ||
} | ||
/** | ||
* Thrown by client when waiting on Workflow execution result if execution times out | ||
*/ | ||
export declare class WorkflowExecutionTimedOutError extends Error { | ||
readonly retryState: temporal.api.enums.v1.RetryState; | ||
readonly name: string; | ||
constructor(message: string, retryState: temporal.api.enums.v1.RetryState); | ||
} | ||
/** | ||
* Thrown by client when waiting on Workflow execution result if execution fails | ||
*/ | ||
export declare class WorkflowExecutionFailedError extends Error { | ||
readonly cause: Error | undefined; | ||
readonly name: string; | ||
constructor(message: string, cause: Error | undefined); | ||
} | ||
/** | ||
* Thrown by client when waiting on Workflow execution result if Workflow is cancelled | ||
*/ | ||
export declare class WorkflowExecutionCancelledError extends Error { | ||
readonly details: any[]; | ||
readonly name: string; | ||
constructor(message: string, details: any[]); | ||
} | ||
/** | ||
* Thrown by client when waiting on Workflow execution result if Workflow continues as new. | ||
* Thrown the by client while waiting on Workflow execution result if Workflow | ||
* continues as new. | ||
* | ||
* Only thrown if asked not to follow the chain of execution (see {@link WorkflowOptions.followRuns}). | ||
*/ | ||
export declare class WorkflowExecutionContinuedAsNewError extends Error { | ||
export declare class WorkflowContinuedAsNewError extends Error { | ||
readonly newExecutionRunId: string; | ||
@@ -42,0 +25,0 @@ readonly name: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WorkflowExecutionContinuedAsNewError = exports.WorkflowExecutionCancelledError = exports.WorkflowExecutionFailedError = exports.WorkflowExecutionTimedOutError = exports.WorkflowExecutionTerminatedError = void 0; | ||
exports.WorkflowContinuedAsNewError = exports.WorkflowFailedError = void 0; | ||
/** | ||
* Thrown by client when waiting on Workflow execution result if Workflow is terminated | ||
* Thrown by the client while waiting on Workflow execution result if execution | ||
* completes with failure. | ||
* | ||
* The failure type will be set in the `cause` attribute. | ||
* | ||
* For example if the workflow is cancelled, `cause` will be set to | ||
* {@link CancelledFailure}. | ||
*/ | ||
class WorkflowExecutionTerminatedError extends Error { | ||
constructor(message, details, identity) { | ||
class WorkflowFailedError extends Error { | ||
constructor(message, cause, retryState) { | ||
super(message); | ||
this.details = details; | ||
this.identity = identity; | ||
this.name = 'WorkflowExecutionTerminatedError'; | ||
} | ||
} | ||
exports.WorkflowExecutionTerminatedError = WorkflowExecutionTerminatedError; | ||
/** | ||
* Thrown by client when waiting on Workflow execution result if execution times out | ||
*/ | ||
class WorkflowExecutionTimedOutError extends Error { | ||
constructor(message, retryState) { | ||
super(message); | ||
this.cause = cause; | ||
this.retryState = retryState; | ||
this.name = 'WorkflowExecutionTimedOutError'; | ||
} | ||
} | ||
exports.WorkflowExecutionTimedOutError = WorkflowExecutionTimedOutError; | ||
/** | ||
* Thrown by client when waiting on Workflow execution result if execution fails | ||
*/ | ||
class WorkflowExecutionFailedError extends Error { | ||
constructor(message, cause) { | ||
super(message); | ||
this.cause = cause; | ||
this.name = 'WorkflowExecutionFailedError'; | ||
} | ||
} | ||
exports.WorkflowExecutionFailedError = WorkflowExecutionFailedError; | ||
exports.WorkflowFailedError = WorkflowFailedError; | ||
/** | ||
* Thrown by client when waiting on Workflow execution result if Workflow is cancelled | ||
*/ | ||
class WorkflowExecutionCancelledError extends Error { | ||
constructor(message, details) { | ||
super(message); | ||
this.details = details; | ||
this.name = 'WorkflowExecutionCancelledError'; | ||
} | ||
} | ||
exports.WorkflowExecutionCancelledError = WorkflowExecutionCancelledError; | ||
/** | ||
* Thrown by client when waiting on Workflow execution result if Workflow continues as new. | ||
* Thrown the by client while waiting on Workflow execution result if Workflow | ||
* continues as new. | ||
* | ||
* Only thrown if asked not to follow the chain of execution (see {@link WorkflowOptions.followRuns}). | ||
*/ | ||
class WorkflowExecutionContinuedAsNewError extends Error { | ||
class WorkflowContinuedAsNewError extends Error { | ||
constructor(message, newExecutionRunId) { | ||
@@ -61,3 +35,3 @@ super(message); | ||
} | ||
exports.WorkflowExecutionContinuedAsNewError = WorkflowExecutionContinuedAsNewError; | ||
exports.WorkflowContinuedAsNewError = WorkflowContinuedAsNewError; | ||
//# sourceMappingURL=errors.js.map |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -31,3 +12,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
const workflow_options_1 = require("./workflow-options"); | ||
const errors = __importStar(require("./errors")); | ||
const errors_1 = require("./errors"); | ||
const connection_1 = require("./connection"); | ||
@@ -185,9 +166,13 @@ function defaultWorkflowClientOptions() { | ||
const { failure } = ev.workflowExecutionFailedEventAttributes; | ||
throw new errors.WorkflowExecutionFailedError('Workflow execution failed', await (0, common_1.optionalFailureToOptionalError)(failure, this.options.dataConverter)); | ||
throw new errors_1.WorkflowFailedError('Workflow execution failed', await (0, common_1.optionalFailureToOptionalError)(failure, this.options.dataConverter), common_1.RetryState.RETRY_STATE_NON_RETRYABLE_FAILURE); | ||
} | ||
else if (ev.workflowExecutionCanceledEventAttributes) { | ||
throw new errors.WorkflowExecutionCancelledError('Workflow execution cancelled', await (0, common_1.arrayFromPayloads)(this.options.dataConverter, ev.workflowExecutionCanceledEventAttributes.details?.payloads)); | ||
const failure = new common_1.CancelledFailure('Workflow canceled', await (0, common_1.arrayFromPayloads)(this.options.dataConverter, ev.workflowExecutionCanceledEventAttributes.details?.payloads)); | ||
failure.stack = ''; | ||
throw new errors_1.WorkflowFailedError('Workflow execution cancelled', failure, common_1.RetryState.RETRY_STATE_NON_RETRYABLE_FAILURE); | ||
} | ||
else if (ev.workflowExecutionTerminatedEventAttributes) { | ||
throw new errors.WorkflowExecutionTerminatedError(ev.workflowExecutionTerminatedEventAttributes.reason || 'Workflow execution terminated', await (0, common_1.arrayFromPayloads)(this.options.dataConverter, ev.workflowExecutionTerminatedEventAttributes.details?.payloads), ev.workflowExecutionTerminatedEventAttributes.identity ?? undefined); | ||
const failure = new common_1.TerminatedFailure(ev.workflowExecutionTerminatedEventAttributes.reason || 'Workflow execution terminated'); | ||
failure.stack = ''; | ||
throw new errors_1.WorkflowFailedError(ev.workflowExecutionTerminatedEventAttributes.reason || 'Workflow execution terminated', failure, common_1.RetryState.RETRY_STATE_NON_RETRYABLE_FAILURE); | ||
} | ||
@@ -200,3 +185,5 @@ else if (ev.workflowExecutionTimedOutEventAttributes) { | ||
} | ||
throw new errors.WorkflowExecutionTimedOutError('Workflow execution timed out', ev.workflowExecutionTimedOutEventAttributes.retryState || 0); | ||
const failure = new common_1.TimeoutFailure('Workflow execution timed out', undefined, common_1.TimeoutType.TIMEOUT_TYPE_START_TO_CLOSE); | ||
failure.stack = ''; | ||
throw new errors_1.WorkflowFailedError('Workflow execution timed out', failure, ev.workflowExecutionTimedOutEventAttributes.retryState || 0); | ||
} | ||
@@ -209,3 +196,3 @@ else if (ev.workflowExecutionContinuedAsNewEventAttributes) { | ||
if (!followRuns) { | ||
throw new errors.WorkflowExecutionContinuedAsNewError('Workflow execution continued as new', newExecutionRunId); | ||
throw new errors_1.WorkflowContinuedAsNewError('Workflow execution continued as new', newExecutionRunId); | ||
} | ||
@@ -212,0 +199,0 @@ execution.runId = newExecutionRunId; |
{ | ||
"name": "@temporalio/client", | ||
"version": "0.13.0", | ||
"version": "0.14.0", | ||
"description": "Temporal.io SDK Client sub-package", | ||
@@ -17,4 +17,4 @@ "main": "lib/index.js", | ||
"@grpc/grpc-js": "^1.3.7", | ||
"@temporalio/common": "^0.13.0", | ||
"@temporalio/proto": "^0.13.0", | ||
"@temporalio/common": "^0.14.0", | ||
"@temporalio/proto": "^0.14.0", | ||
"ms": "^2.1.3", | ||
@@ -34,3 +34,3 @@ "protobufjs": "^6.11.2", | ||
}, | ||
"gitHead": "bbb8d36ad9d310eb44bd19f3f8bb9356e1dd9dfb" | ||
"gitHead": "fd09cf4d3c996c96bf604d2e318165cfbad18a4a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79549
1260
+ Added@temporalio/common@0.14.0(transitive)
+ Added@temporalio/proto@0.14.0(transitive)
- Removed@temporalio/common@0.13.0(transitive)
- Removed@temporalio/proto@0.13.0(transitive)
Updated@temporalio/common@^0.14.0
Updated@temporalio/proto@^0.14.0