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

@temporalio/common

Package Overview
Dependencies
Maintainers
8
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@temporalio/common - npm Package Compare versions

Comparing version 1.6.0 to 1.7.0

3

lib/errors.d.ts

@@ -0,1 +1,2 @@

import { TemporalFailure } from './failure';
/**

@@ -29,3 +30,3 @@ * Thrown from code that receives a value that is unexpected or that it's unable to handle.

*/
export declare class WorkflowExecutionAlreadyStartedError extends Error {
export declare class WorkflowExecutionAlreadyStartedError extends TemporalFailure {
readonly workflowId: string;

@@ -32,0 +33,0 @@ readonly workflowType: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WorkflowNotFoundError = exports.WorkflowExecutionAlreadyStartedError = exports.IllegalStateError = exports.PayloadConverterError = exports.ValueError = void 0;
const failure_1 = require("./failure");
/**

@@ -43,3 +44,3 @@ * Thrown from code that receives a value that is unexpected or that it's unable to handle.

*/
class WorkflowExecutionAlreadyStartedError extends Error {
class WorkflowExecutionAlreadyStartedError extends failure_1.TemporalFailure {
constructor(message, workflowId, workflowType) {

@@ -46,0 +47,0 @@ super(message);

@@ -14,19 +14,38 @@ import type { temporal } from '@temporalio/proto';

export declare type Workflow = (...args: any[]) => WorkflowReturnType;
declare const argsBrand: unique symbol;
/**
* An interface representing a Workflow signal definition, as returned from {@link defineSignal}
*
* @remarks `_Args` can be used for parameter type inference in handler functions and *WorkflowHandle methods.
* @remarks `Args` can be used for parameter type inference in handler functions and *WorkflowHandle methods.
* `Name` can optionally be specified with a string literal type to preserve type-level knowledge of the signal name.
*/
export interface SignalDefinition<_Args extends any[] = []> {
export interface SignalDefinition<Args extends any[] = [], Name extends string = string> {
type: 'signal';
name: string;
name: Name;
/**
* Virtual type brand to maintain a distinction between {@link SignalDefinition} types with different args.
* This field is not present at run-time.
*/
[argsBrand]: Args;
}
declare const retBrand: unique symbol;
/**
* An interface representing a Workflow query definition as returned from {@link defineQuery}
*
* @remarks `_Args` and `_Ret` can be used for parameter type inference in handler functions and *WorkflowHandle methods.
* @remarks `Args` and `Ret` can be used for parameter type inference in handler functions and *WorkflowHandle methods.
* `Name` can optionally be specified with a string literal type to preserve type-level knowledge of the query name.
*/
export interface QueryDefinition<_Ret, _Args extends any[] = []> {
export interface QueryDefinition<Ret, Args extends any[] = [], Name extends string = string> {
type: 'query';
name: string;
name: Name;
/**
* Virtual type brand to maintain a distinction between {@link QueryDefinition} types with different args.
* This field is not present at run-time.
*/
[argsBrand]: Args;
/**
* Virtual type brand to maintain a distinction between {@link QueryDefinition} types with different return types.
* This field is not present at run-time.
*/
[retBrand]: Ret;
}

@@ -40,3 +59,3 @@ /** Get the "unwrapped" return type (without Promise) of the execute handler from Workflow type `W` */

*/
export declare type SearchAttributes = Record<string, SearchAttributeValue | undefined>;
export declare type SearchAttributes = Record<string, SearchAttributeValue | Readonly<SearchAttributeValue> | undefined>;
export declare type SearchAttributeValue = string[] | number[] | boolean[] | Date[];

@@ -62,1 +81,2 @@ export interface ActivityFunction<P extends any[] = any[], R = any> {

}
export {};

@@ -22,3 +22,3 @@ import { Workflow, WorkflowResultType, SignalDefinition } from './interfaces';

*/
signal<Args extends any[] = []>(def: SignalDefinition<Args> | string, ...args: Args): Promise<void>;
signal<Args extends any[] = [], Name extends string = string>(def: SignalDefinition<Args, Name> | string, ...args: Args): Promise<void>;
/**

@@ -25,0 +25,0 @@ * The workflowId of the current Workflow

@@ -80,3 +80,3 @@ import type { google } from '@temporalio/proto';

*/
args: Parameters<W>;
args: Parameters<W> | Readonly<Parameters<W>>;
} : {

@@ -86,3 +86,3 @@ /**

*/
args?: Parameters<W>;
args?: Parameters<W> | Readonly<Parameters<W>>;
});

@@ -89,0 +89,0 @@ export interface WorkflowDurationOptions {

{
"name": "@temporalio/common",
"version": "1.6.0",
"version": "1.7.0",
"description": "Common library for code that's used across the Client, Worker, and/or Workflow",

@@ -16,3 +16,3 @@ "main": "lib/index.js",

"@opentelemetry/api": "^1.3.0",
"@temporalio/proto": "1.6.0",
"@temporalio/proto": "1.7.0",
"long": "^5.2.0",

@@ -26,2 +26,7 @@ "ms": "^2.1.3",

},
"repository": {
"type": "git",
"url": "git+https://github.com/temporalio/sdk-typescript.git",
"directory": "packages/common"
},
"homepage": "https://github.com/temporalio/sdk-typescript/tree/main/packages/common",

@@ -35,3 +40,3 @@ "publishConfig": {

],
"gitHead": "49c6b1341daef2b94a0a989d515cbf97b8b02fa7"
"gitHead": "2b32bac62f879b35238b487d3aaed093a1e449a7"
}

@@ -0,1 +1,3 @@

import { TemporalFailure } from './failure';
/**

@@ -34,3 +36,3 @@ * Thrown from code that receives a value that is unexpected or that it's unable to handle.

*/
export class WorkflowExecutionAlreadyStartedError extends Error {
export class WorkflowExecutionAlreadyStartedError extends TemporalFailure {
public readonly name: string = 'WorkflowExecutionAlreadyStartedError';

@@ -37,0 +39,0 @@

@@ -18,22 +18,39 @@ import type { temporal } from '@temporalio/proto';

declare const argsBrand: unique symbol;
/**
* An interface representing a Workflow signal definition, as returned from {@link defineSignal}
*
* @remarks `_Args` can be used for parameter type inference in handler functions and *WorkflowHandle methods.
* @remarks `Args` can be used for parameter type inference in handler functions and *WorkflowHandle methods.
* `Name` can optionally be specified with a string literal type to preserve type-level knowledge of the signal name.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export interface SignalDefinition<_Args extends any[] = []> {
export interface SignalDefinition<Args extends any[] = [], Name extends string = string> {
type: 'signal';
name: string;
name: Name;
/**
* Virtual type brand to maintain a distinction between {@link SignalDefinition} types with different args.
* This field is not present at run-time.
*/
[argsBrand]: Args;
}
declare const retBrand: unique symbol;
/**
* An interface representing a Workflow query definition as returned from {@link defineQuery}
*
* @remarks `_Args` and `_Ret` can be used for parameter type inference in handler functions and *WorkflowHandle methods.
* @remarks `Args` and `Ret` can be used for parameter type inference in handler functions and *WorkflowHandle methods.
* `Name` can optionally be specified with a string literal type to preserve type-level knowledge of the query name.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export interface QueryDefinition<_Ret, _Args extends any[] = []> {
export interface QueryDefinition<Ret, Args extends any[] = [], Name extends string = string> {
type: 'query';
name: string;
name: Name;
/**
* Virtual type brand to maintain a distinction between {@link QueryDefinition} types with different args.
* This field is not present at run-time.
*/
[argsBrand]: Args;
/**
* Virtual type brand to maintain a distinction between {@link QueryDefinition} types with different return types.
* This field is not present at run-time.
*/
[retBrand]: Ret;
}

@@ -49,3 +66,3 @@

*/
export type SearchAttributes = Record<string, SearchAttributeValue | undefined>;
export type SearchAttributes = Record<string, SearchAttributeValue | Readonly<SearchAttributeValue> | undefined>;
export type SearchAttributeValue = string[] | number[] | boolean[] | Date[];

@@ -52,0 +69,0 @@

@@ -24,3 +24,6 @@ import { Workflow, WorkflowResultType, SignalDefinition } from './interfaces';

*/
signal<Args extends any[] = []>(def: SignalDefinition<Args> | string, ...args: Args): Promise<void>;
signal<Args extends any[] = [], Name extends string = string>(
def: SignalDefinition<Args, Name> | string,
...args: Args
): Promise<void>;

@@ -27,0 +30,0 @@ /**

@@ -99,3 +99,3 @@ import type { temporal, google } from '@temporalio/proto';

*/
args: Parameters<W>;
args: Parameters<W> | Readonly<Parameters<W>>;
}

@@ -106,3 +106,3 @@ : {

*/
args?: Parameters<W>;
args?: Parameters<W> | Readonly<Parameters<W>>;
});

@@ -109,0 +109,0 @@

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