@temporalio/client
Advanced tools
Comparing version 1.7.2 to 1.7.3
@@ -27,4 +27,4 @@ import { BaseClient, BaseClientOptions, LoadedWithDefaults } from './base-client'; | ||
*/ | ||
export declare type AsyncCompletionClientOptions = BaseClientOptions; | ||
export declare type LoadedAsyncCompletionClientOptions = LoadedWithDefaults<AsyncCompletionClientOptions>; | ||
export type AsyncCompletionClientOptions = BaseClientOptions; | ||
export type LoadedAsyncCompletionClientOptions = LoadedWithDefaults<AsyncCompletionClientOptions>; | ||
/** | ||
@@ -31,0 +31,0 @@ * A mostly unique Activity identifier including its scheduling workflow's ID |
@@ -29,5 +29,5 @@ import { DataConverter, LoadedDataConverter } from '@temporalio/common'; | ||
} | ||
export declare type WithDefaults<Options extends BaseClientOptions> = // | ||
export type WithDefaults<Options extends BaseClientOptions> = // | ||
Required<Omit<Options, 'connection'>> & Pick<Options, 'connection'>; | ||
export declare type LoadedWithDefaults<Options extends BaseClientOptions> = // | ||
export type LoadedWithDefaults<Options extends BaseClientOptions> = // | ||
WithDefaults<Options> & { | ||
@@ -34,0 +34,0 @@ loadedDataConverter: LoadedDataConverter; |
@@ -24,3 +24,3 @@ import { temporal } from '@temporalio/proto'; | ||
} | ||
export declare type LoadedClientOptions = LoadedWithDefaults<ClientOptions>; | ||
export type LoadedClientOptions = LoadedWithDefaults<ClientOptions>; | ||
/** | ||
@@ -27,0 +27,0 @@ * High level SDK client. |
@@ -76,3 +76,3 @@ /// <reference types="node" /> | ||
} | ||
export declare type ConnectionOptionsWithDefaults = Required<Omit<ConnectionOptions, 'tls' | 'connectTimeout'>> & { | ||
export type ConnectionOptionsWithDefaults = Required<Omit<ConnectionOptions, 'tls' | 'connectTimeout'>> & { | ||
connectTimeoutMs: number; | ||
@@ -79,0 +79,0 @@ }; |
@@ -99,10 +99,2 @@ "use strict"; | ||
class Connection { | ||
constructor({ options, client, workflowService, operatorService, healthService, callContextStorage, }) { | ||
this.options = options; | ||
this.client = client; | ||
this.workflowService = workflowService; | ||
this.operatorService = operatorService; | ||
this.healthService = healthService; | ||
this.callContextStorage = callContextStorage; | ||
} | ||
static createCtorOptions(options) { | ||
@@ -200,2 +192,10 @@ var _a, _b; | ||
} | ||
constructor({ options, client, workflowService, operatorService, healthService, callContextStorage, }) { | ||
this.options = options; | ||
this.client = client; | ||
this.workflowService = workflowService; | ||
this.operatorService = operatorService; | ||
this.healthService = healthService; | ||
this.callContextStorage = callContextStorage; | ||
} | ||
static generateRPCImplementation({ serviceName, client, callContextStorage, interceptors, staticMetadata, }) { | ||
@@ -202,0 +202,0 @@ return (method, requestData, callback) => { |
import { LoadedDataConverter } from '@temporalio/common'; | ||
import { Replace } from '@temporalio/common/lib/type-helpers'; | ||
import { RawWorkflowExecutionInfo, WorkflowExecutionInfo } from './types'; | ||
export declare function executionInfoFromRaw(raw: RawWorkflowExecutionInfo, dataConverter: LoadedDataConverter): Promise<WorkflowExecutionInfo>; | ||
export declare function executionInfoFromRaw<T>(raw: RawWorkflowExecutionInfo, dataConverter: LoadedDataConverter, rawDataToEmbed: T): Promise<Replace<WorkflowExecutionInfo, { | ||
raw: T; | ||
}>>; |
@@ -34,3 +34,3 @@ "use strict"; | ||
} | ||
async function executionInfoFromRaw(raw, dataConverter) { | ||
async function executionInfoFromRaw(raw, dataConverter, rawDataToEmbed) { | ||
return { | ||
@@ -60,3 +60,3 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ | ||
: undefined, | ||
raw, | ||
raw: rawDataToEmbed, | ||
}; | ||
@@ -63,0 +63,0 @@ } |
@@ -98,3 +98,3 @@ /** | ||
/** @deprecated: Use WorkflowClientInterceptor instead */ | ||
export declare type WorkflowClientCallsInterceptor = WorkflowClientInterceptor; | ||
export type WorkflowClientCallsInterceptor = WorkflowClientInterceptor; | ||
/** @deprecated */ | ||
@@ -142,3 +142,3 @@ export interface WorkflowClientCallsInterceptorFactoryInput { | ||
} | ||
export declare type CreateScheduleOutput = { | ||
export type CreateScheduleOutput = { | ||
readonly conflictToken: Uint8Array; | ||
@@ -145,0 +145,0 @@ }; |
@@ -74,3 +74,3 @@ import { Workflow } from '@temporalio/common'; | ||
/** @experimental */ | ||
export declare type LoadedScheduleClientOptions = LoadedWithDefaults<ScheduleClientOptions>; | ||
export type LoadedScheduleClientOptions = LoadedWithDefaults<ScheduleClientOptions>; | ||
/** @experimental */ | ||
@@ -77,0 +77,0 @@ export interface ListScheduleOptions { |
@@ -109,3 +109,3 @@ import { Replace } from '@temporalio/common/lib/type-helpers'; | ||
/** @experimental */ | ||
export declare type CompiledScheduleOptions = Replace<ScheduleOptions, { | ||
export type CompiledScheduleOptions = Replace<ScheduleOptions, { | ||
action: CompiledScheduleAction; | ||
@@ -118,3 +118,3 @@ }>; | ||
*/ | ||
export declare type ScheduleUpdateOptions<A extends ScheduleOptionsAction = ScheduleOptionsAction> = Replace<Omit<ScheduleOptions, 'scheduleId' | 'memo' | 'searchAttributes'>, { | ||
export type ScheduleUpdateOptions<A extends ScheduleOptionsAction = ScheduleOptionsAction> = Replace<Omit<ScheduleOptions, 'scheduleId' | 'memo' | 'searchAttributes'>, { | ||
action: Replace<A, { | ||
@@ -126,3 +126,3 @@ workflowId: string; | ||
/** @experimental */ | ||
export declare type CompiledScheduleUpdateOptions = Replace<ScheduleUpdateOptions, { | ||
export type CompiledScheduleUpdateOptions = Replace<ScheduleUpdateOptions, { | ||
action: CompiledScheduleAction; | ||
@@ -195,3 +195,3 @@ }>; | ||
/** @experimental */ | ||
export declare type ScheduleExecutionActionResult = ScheduleExecutionStartWorkflowActionResult; | ||
export type ScheduleExecutionActionResult = ScheduleExecutionStartWorkflowActionResult; | ||
/** @experimental */ | ||
@@ -214,3 +214,3 @@ export interface ScheduleExecutionStartWorkflowActionResult { | ||
*/ | ||
export declare type ScheduleDescription = { | ||
export type ScheduleDescription = { | ||
/** | ||
@@ -417,3 +417,3 @@ * The Schedule Id. We recommend using a meaningful business identifier. | ||
*/ | ||
export declare type ScheduleSpecDescription = Omit<ScheduleSpec, 'calendars' | 'intervals' | 'cronExpressions' | 'skip' | 'jitter'> & { | ||
export type ScheduleSpecDescription = Omit<ScheduleSpec, 'calendars' | 'intervals' | 'cronExpressions' | 'skip' | 'jitter'> & { | ||
/** Calendar-based specifications of times. */ | ||
@@ -635,3 +635,3 @@ calendars?: CalendarSpecDescription[]; | ||
*/ | ||
export declare type LooseRange<Unit> = Range<Unit> | { | ||
export type LooseRange<Unit> = Range<Unit> | { | ||
start: Range<Unit>['start']; | ||
@@ -644,11 +644,11 @@ end?: Range<Unit>['end']; | ||
/** @experimental */ | ||
export declare type Month = typeof MONTHS[number]; | ||
export type Month = (typeof MONTHS)[number]; | ||
/** @experimental */ | ||
export declare const DAYS_OF_WEEK: readonly ["SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"]; | ||
/** @experimental */ | ||
export declare type DayOfWeek = typeof DAYS_OF_WEEK[number]; | ||
export type DayOfWeek = (typeof DAYS_OF_WEEK)[number]; | ||
/** @experimental */ | ||
export declare type ScheduleOptionsAction = ScheduleOptionsStartWorkflowAction<Workflow>; | ||
export type ScheduleOptionsAction = ScheduleOptionsStartWorkflowAction<Workflow>; | ||
/** @experimental */ | ||
export declare type ScheduleOptionsStartWorkflowAction<W extends Workflow> = { | ||
export type ScheduleOptionsStartWorkflowAction<W extends Workflow> = { | ||
type: 'startWorkflow'; | ||
@@ -666,3 +666,3 @@ workflowType: string | W; | ||
/** @experimental */ | ||
export declare type ScheduleSummaryAction = ScheduleSummaryStartWorkflowAction; | ||
export type ScheduleSummaryAction = ScheduleSummaryStartWorkflowAction; | ||
/** @experimental */ | ||
@@ -674,7 +674,7 @@ export interface ScheduleSummaryStartWorkflowAction { | ||
/** @experimental */ | ||
export declare type ScheduleDescriptionAction = ScheduleDescriptionStartWorkflowAction; | ||
export type ScheduleDescriptionAction = ScheduleDescriptionStartWorkflowAction; | ||
/** @experimental */ | ||
export declare type ScheduleDescriptionStartWorkflowAction = ScheduleSummaryStartWorkflowAction & Pick<WorkflowStartOptions<Workflow>, 'taskQueue' | 'workflowId' | 'args' | 'memo' | 'searchAttributes' | 'retry' | 'workflowExecutionTimeout' | 'workflowRunTimeout' | 'workflowTaskTimeout'>; | ||
export type ScheduleDescriptionStartWorkflowAction = ScheduleSummaryStartWorkflowAction & Pick<WorkflowStartOptions<Workflow>, 'taskQueue' | 'workflowId' | 'args' | 'memo' | 'searchAttributes' | 'retry' | 'workflowExecutionTimeout' | 'workflowRunTimeout' | 'workflowTaskTimeout'>; | ||
/** @experimental */ | ||
export declare type CompiledScheduleAction = Replace<ScheduleDescriptionAction, { | ||
export type CompiledScheduleAction = Replace<ScheduleDescriptionAction, { | ||
workflowType: string; | ||
@@ -681,0 +681,0 @@ args: unknown[]; |
@@ -9,9 +9,9 @@ import type * as grpc from '@grpc/grpc-js'; | ||
} | ||
export declare type StartWorkflowExecutionRequest = proto.temporal.api.workflowservice.v1.IStartWorkflowExecutionRequest; | ||
export declare type GetWorkflowExecutionHistoryRequest = proto.temporal.api.workflowservice.v1.IGetWorkflowExecutionHistoryRequest; | ||
export declare type DescribeWorkflowExecutionResponse = proto.temporal.api.workflowservice.v1.IDescribeWorkflowExecutionResponse; | ||
export declare type RawWorkflowExecutionInfo = proto.temporal.api.workflow.v1.IWorkflowExecutionInfo; | ||
export declare type TerminateWorkflowExecutionResponse = proto.temporal.api.workflowservice.v1.ITerminateWorkflowExecutionResponse; | ||
export declare type RequestCancelWorkflowExecutionResponse = proto.temporal.api.workflowservice.v1.IRequestCancelWorkflowExecutionResponse; | ||
export declare type WorkflowExecutionStatusName = 'UNSPECIFIED' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'TERMINATED' | 'CONTINUED_AS_NEW' | 'TIMED_OUT' | 'UNKNOWN'; | ||
export type StartWorkflowExecutionRequest = proto.temporal.api.workflowservice.v1.IStartWorkflowExecutionRequest; | ||
export type GetWorkflowExecutionHistoryRequest = proto.temporal.api.workflowservice.v1.IGetWorkflowExecutionHistoryRequest; | ||
export type DescribeWorkflowExecutionResponse = proto.temporal.api.workflowservice.v1.IDescribeWorkflowExecutionResponse; | ||
export type RawWorkflowExecutionInfo = proto.temporal.api.workflow.v1.IWorkflowExecutionInfo; | ||
export type TerminateWorkflowExecutionResponse = proto.temporal.api.workflowservice.v1.ITerminateWorkflowExecutionResponse; | ||
export type RequestCancelWorkflowExecutionResponse = proto.temporal.api.workflowservice.v1.IRequestCancelWorkflowExecutionResponse; | ||
export type WorkflowExecutionStatusName = 'UNSPECIFIED' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'TERMINATED' | 'CONTINUED_AS_NEW' | 'TIMED_OUT' | 'UNKNOWN'; | ||
export interface WorkflowExecutionInfo { | ||
@@ -35,10 +35,10 @@ type: string; | ||
} | ||
export declare type WorkflowExecutionDescription = Replace<WorkflowExecutionInfo, { | ||
export type WorkflowExecutionDescription = Replace<WorkflowExecutionInfo, { | ||
raw: DescribeWorkflowExecutionResponse; | ||
}>; | ||
export declare type WorkflowService = proto.temporal.api.workflowservice.v1.WorkflowService; | ||
export type WorkflowService = proto.temporal.api.workflowservice.v1.WorkflowService; | ||
export declare const WorkflowService: typeof proto.temporal.api.workflowservice.v1.WorkflowService; | ||
export declare type OperatorService = proto.temporal.api.operatorservice.v1.OperatorService; | ||
export type OperatorService = proto.temporal.api.operatorservice.v1.OperatorService; | ||
export declare const OperatorService: typeof proto.temporal.api.operatorservice.v1.OperatorService; | ||
export declare type HealthService = proto.grpc.health.v1.Health; | ||
export type HealthService = proto.grpc.health.v1.Health; | ||
export declare const HealthService: typeof proto.grpc.health.v1.Health; | ||
@@ -48,3 +48,3 @@ /** | ||
*/ | ||
export declare type Metadata = Record<string, grpc.MetadataValue>; | ||
export type Metadata = Record<string, grpc.MetadataValue>; | ||
/** | ||
@@ -51,0 +51,0 @@ * User defined context for gRPC client calls |
@@ -116,3 +116,3 @@ import { status as grpcStatus } from '@grpc/grpc-js'; | ||
} | ||
export declare type LoadedWorkflowClientOptions = LoadedWithDefaults<WorkflowClientOptions>; | ||
export type LoadedWorkflowClientOptions = LoadedWithDefaults<WorkflowClientOptions>; | ||
/** | ||
@@ -119,0 +119,0 @@ * Options for getting a result of a Workflow execution. |
@@ -483,5 +483,7 @@ "use strict"; | ||
}); | ||
const info = await (0, helpers_1.executionInfoFromRaw)(raw.workflowExecutionInfo ?? {}, this.client.dataConverter); | ||
info.raw = raw; | ||
return info; | ||
const info = await (0, helpers_1.executionInfoFromRaw)(raw.workflowExecutionInfo ?? {}, this.client.dataConverter, raw); | ||
return { | ||
...info, | ||
raw, | ||
}; | ||
}, | ||
@@ -569,3 +571,3 @@ async fetchHistory() { | ||
for (const raw of response.executions) { | ||
yield await (0, helpers_1.executionInfoFromRaw)(raw, this.dataConverter); | ||
yield await (0, helpers_1.executionInfoFromRaw)(raw, this.dataConverter, raw); | ||
} | ||
@@ -572,0 +574,0 @@ nextPageToken = response.nextPageToken; |
@@ -30,3 +30,3 @@ import { CommonWorkflowOptions, SignalDefinition, WithCompiledWorkflowOptions, WithWorkflowArgs, Workflow } from '@temporalio/common'; | ||
} | ||
export declare type WorkflowSignalWithStartOptions<SignalArgs extends any[] = []> = SignalArgs extends [any, ...any[]] ? WorkflowSignalWithStartOptionsWithArgs<SignalArgs> : WorkflowSignalWithStartOptionsWithoutArgs<SignalArgs>; | ||
export type WorkflowSignalWithStartOptions<SignalArgs extends any[] = []> = SignalArgs extends [any, ...any[]] ? WorkflowSignalWithStartOptionsWithArgs<SignalArgs> : WorkflowSignalWithStartOptionsWithoutArgs<SignalArgs>; | ||
export interface WorkflowSignalWithStartOptionsWithoutArgs<SignalArgs extends any[]> extends WorkflowOptions { | ||
@@ -55,2 +55,2 @@ /** | ||
*/ | ||
export declare type WorkflowStartOptions<T extends Workflow = Workflow> = WithWorkflowArgs<T, WorkflowOptions>; | ||
export type WorkflowStartOptions<T extends Workflow = Workflow> = WithWorkflowArgs<T, WorkflowOptions>; |
{ | ||
"name": "@temporalio/client", | ||
"version": "1.7.2", | ||
"version": "1.7.3", | ||
"description": "Temporal.io SDK Client sub-package", | ||
@@ -17,4 +17,4 @@ "main": "lib/index.js", | ||
"@grpc/grpc-js": "~1.7.3", | ||
"@temporalio/common": "1.7.2", | ||
"@temporalio/proto": "1.7.2", | ||
"@temporalio/common": "1.7.3", | ||
"@temporalio/proto": "1.7.3", | ||
"abort-controller": "^3.0.0", | ||
@@ -43,3 +43,3 @@ "long": "^5.2.0", | ||
], | ||
"gitHead": "779561124eecdec8396e658c0a1305d343dfaff7" | ||
"gitHead": "c78237bad40342b97a0aaec97ef01763b39a04f8" | ||
} |
@@ -7,2 +7,3 @@ import { | ||
} from '@temporalio/common'; | ||
import { Replace } from '@temporalio/common/lib/type-helpers'; | ||
import { optionalTsToDate, tsToDate } from '@temporalio/common/lib/time'; | ||
@@ -43,6 +44,7 @@ import { decodeMapFromPayloads } from '@temporalio/common/lib/internal-non-workflow/codec-helpers'; | ||
export async function executionInfoFromRaw( | ||
export async function executionInfoFromRaw<T>( | ||
raw: RawWorkflowExecutionInfo, | ||
dataConverter: LoadedDataConverter | ||
): Promise<WorkflowExecutionInfo> { | ||
dataConverter: LoadedDataConverter, | ||
rawDataToEmbed: T | ||
): Promise<Replace<WorkflowExecutionInfo, { raw: T }>> { | ||
return { | ||
@@ -75,4 +77,4 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ | ||
: undefined, | ||
raw, | ||
raw: rawDataToEmbed, | ||
}; | ||
} |
@@ -767,3 +767,3 @@ import { checkExtends, Replace } from '@temporalio/common/lib/type-helpers'; | ||
/** @experimental */ | ||
export type Month = typeof MONTHS[number]; | ||
export type Month = (typeof MONTHS)[number]; | ||
@@ -774,3 +774,3 @@ /** @experimental */ | ||
/** @experimental */ | ||
export type DayOfWeek = typeof DAYS_OF_WEEK[number]; | ||
export type DayOfWeek = (typeof DAYS_OF_WEEK)[number]; | ||
@@ -777,0 +777,0 @@ /** @experimental */ |
@@ -844,5 +844,7 @@ import { status as grpcStatus } from '@grpc/grpc-js'; | ||
}); | ||
const info = await executionInfoFromRaw(raw.workflowExecutionInfo ?? {}, this.client.dataConverter); | ||
(info as unknown as WorkflowExecutionDescription).raw = raw; | ||
return info; | ||
const info = await executionInfoFromRaw(raw.workflowExecutionInfo ?? {}, this.client.dataConverter, raw); | ||
return { | ||
...info, | ||
raw, | ||
}; | ||
}, | ||
@@ -937,3 +939,3 @@ async fetchHistory() { | ||
for (const raw of response.executions) { | ||
yield await executionInfoFromRaw(raw, this.dataConverter); | ||
yield await executionInfoFromRaw(raw, this.dataConverter, raw); | ||
} | ||
@@ -940,0 +942,0 @@ nextPageToken = response.nextPageToken; |
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
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
410429
8678
+ Added@temporalio/common@1.7.3(transitive)
+ Added@temporalio/proto@1.7.3(transitive)
- Removed@temporalio/common@1.7.2(transitive)
- Removed@temporalio/proto@1.7.2(transitive)
Updated@temporalio/common@1.7.3
Updated@temporalio/proto@1.7.3