@temporalio/client 1.14.2-canary-release-testing.0 → 1.15.0
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/build-id-types.d.ts +8 -8
- package/lib/helpers.js +2 -1
- package/lib/helpers.js.map +1 -1
- package/lib/interceptor-adapters.js +2 -2
- package/lib/interceptor-adapters.js.map +1 -1
- package/lib/schedule-client.js +4 -4
- package/lib/schedule-client.js.map +1 -1
- package/lib/schedule-helpers.js +3 -10
- package/lib/schedule-helpers.js.map +1 -1
- package/lib/schedule-types.d.ts +1 -1
- package/lib/schedule-types.js +1 -1
- package/lib/schedule-types.js.map +1 -1
- package/lib/task-queue-client.d.ts +34 -12
- package/lib/task-queue-client.js +19 -3
- package/lib/task-queue-client.js.map +1 -1
- package/lib/types.d.ts +2 -1
- package/lib/types.js +4 -4
- package/lib/types.js.map +1 -1
- package/lib/workflow-client.js +5 -6
- package/lib/workflow-client.js.map +1 -1
- package/lib/workflow-options.d.ts +0 -2
- package/lib/workflow-options.js.map +1 -1
- package/lib/workflow-update-stage.js +1 -1
- package/lib/workflow-update-stage.js.map +1 -1
- package/package.json +4 -4
- package/src/build-id-types.ts +8 -8
- package/src/helpers.ts +2 -1
- package/src/interceptor-adapters.ts +2 -2
- package/src/interceptors.ts +3 -3
- package/src/schedule-client.ts +4 -4
- package/src/schedule-helpers.ts +8 -10
- package/src/schedule-types.ts +5 -5
- package/src/task-queue-client.ts +34 -13
- package/src/types.ts +8 -6
- package/src/workflow-client.ts +7 -7
- package/src/workflow-options.ts +0 -2
- package/src/workflow-update-stage.ts +1 -1
package/src/task-queue-client.ts
CHANGED
|
@@ -13,18 +13,19 @@ type IUpdateWorkerBuildIdCompatibilityRequest =
|
|
|
13
13
|
type GetWorkerTaskReachabilityResponse = temporal.api.workflowservice.v1.GetWorkerTaskReachabilityResponse;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @
|
|
16
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
17
17
|
*/
|
|
18
18
|
export type TaskQueueClientOptions = BaseClientOptions;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* @
|
|
21
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
22
22
|
*/
|
|
23
23
|
export type LoadedTaskQueueClientOptions = LoadedWithDefaults<TaskQueueClientOptions>;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* A stand-in for a Build Id for unversioned Workers
|
|
27
|
-
*
|
|
27
|
+
*
|
|
28
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
28
29
|
*/
|
|
29
30
|
export const UnversionedBuildId = Symbol.for('__temporal_unversionedBuildId');
|
|
30
31
|
export type UnversionedBuildIdType = typeof UnversionedBuildId;
|
|
@@ -32,7 +33,7 @@ export type UnversionedBuildIdType = typeof UnversionedBuildId;
|
|
|
32
33
|
/**
|
|
33
34
|
* Client for starting Workflow executions and creating Workflow handles
|
|
34
35
|
*
|
|
35
|
-
* @
|
|
36
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
36
37
|
*/
|
|
37
38
|
export class TaskQueueClient extends BaseClient {
|
|
38
39
|
public readonly options: LoadedTaskQueueClientOptions;
|
|
@@ -63,6 +64,8 @@ export class TaskQueueClient extends BaseClient {
|
|
|
63
64
|
*
|
|
64
65
|
* @param taskQueue The task queue to make changes to.
|
|
65
66
|
* @param operation The operation to be performed.
|
|
67
|
+
*
|
|
68
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
66
69
|
*/
|
|
67
70
|
public async updateBuildIdCompatibility(taskQueue: string, operation: BuildIdOperation): Promise<void> {
|
|
68
71
|
const request: IUpdateWorkerBuildIdCompatibilityRequest = {
|
|
@@ -107,6 +110,8 @@ export class TaskQueueClient extends BaseClient {
|
|
|
107
110
|
* @param taskQueue The task queue to fetch the compatibility information for.
|
|
108
111
|
* @returns The sets of compatible Build Ids for the given task queue, or undefined if the queue
|
|
109
112
|
* has no Build Ids defined on it.
|
|
113
|
+
*
|
|
114
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
110
115
|
*/
|
|
111
116
|
public async getBuildIdCompatability(taskQueue: string): Promise<WorkerBuildIdVersionSets | undefined> {
|
|
112
117
|
let resp;
|
|
@@ -134,6 +139,8 @@ export class TaskQueueClient extends BaseClient {
|
|
|
134
139
|
* task queues that reachability information could not be retrieved for will be marked with a
|
|
135
140
|
* `NotFetched` entry in {@link BuildIdReachability.taskQueueReachability}. The caller may issue
|
|
136
141
|
* another call to get the reachability for those task queues.
|
|
142
|
+
*
|
|
143
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
137
144
|
*/
|
|
138
145
|
public async getReachability(options: ReachabilityOptions): Promise<ReachabilityResponse> {
|
|
139
146
|
let resp;
|
|
@@ -170,9 +177,20 @@ export class TaskQueueClient extends BaseClient {
|
|
|
170
177
|
|
|
171
178
|
/**
|
|
172
179
|
* Options for {@link TaskQueueClient.getReachability}
|
|
180
|
+
*
|
|
181
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
173
182
|
*/
|
|
174
183
|
export type ReachabilityOptions = RequireAtLeastOne<BaseReachabilityOptions, 'buildIds' | 'taskQueues'>;
|
|
175
184
|
|
|
185
|
+
/**
|
|
186
|
+
* There are different types of reachability:
|
|
187
|
+
* - `NEW_WORKFLOWS`: The Build Id might be used by new workflows
|
|
188
|
+
* - `EXISTING_WORKFLOWS` The Build Id might be used by open workflows and/or closed workflows.
|
|
189
|
+
* - `OPEN_WORKFLOWS` The Build Id might be used by open workflows
|
|
190
|
+
* - `CLOSED_WORKFLOWS` The Build Id might be used by closed workflows
|
|
191
|
+
*
|
|
192
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
193
|
+
*/
|
|
176
194
|
export const ReachabilityType = {
|
|
177
195
|
/** The Build Id might be used by new workflows. */
|
|
178
196
|
NEW_WORKFLOWS: 'NEW_WORKFLOWS',
|
|
@@ -186,14 +204,6 @@ export const ReachabilityType = {
|
|
|
186
204
|
/** The Build Id might be used by closed workflows. */
|
|
187
205
|
CLOSED_WORKFLOWS: 'CLOSED_WORKFLOWS',
|
|
188
206
|
} as const;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* There are different types of reachability:
|
|
192
|
-
* - `NEW_WORKFLOWS`: The Build Id might be used by new workflows
|
|
193
|
-
* - `EXISTING_WORKFLOWS` The Build Id might be used by open workflows and/or closed workflows.
|
|
194
|
-
* - `OPEN_WORKFLOWS` The Build Id might be used by open workflows
|
|
195
|
-
* - `CLOSED_WORKFLOWS` The Build Id might be used by closed workflows
|
|
196
|
-
*/
|
|
197
207
|
export type ReachabilityType = (typeof ReachabilityType)[keyof typeof ReachabilityType];
|
|
198
208
|
|
|
199
209
|
export const [encodeTaskReachability, decodeTaskReachability] = makeProtoEnumConverters<
|
|
@@ -215,6 +225,8 @@ export const [encodeTaskReachability, decodeTaskReachability] = makeProtoEnumCon
|
|
|
215
225
|
|
|
216
226
|
/**
|
|
217
227
|
* See {@link ReachabilityOptions}
|
|
228
|
+
*
|
|
229
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
218
230
|
*/
|
|
219
231
|
export interface BaseReachabilityOptions {
|
|
220
232
|
/**
|
|
@@ -231,13 +243,22 @@ export interface BaseReachabilityOptions {
|
|
|
231
243
|
reachability?: ReachabilityType;
|
|
232
244
|
}
|
|
233
245
|
|
|
246
|
+
/**
|
|
247
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
248
|
+
*/
|
|
234
249
|
export interface ReachabilityResponse {
|
|
235
250
|
/** Maps Build Ids to their reachability information. */
|
|
236
251
|
buildIdReachability: Record<string | UnversionedBuildIdType, BuildIdReachability>;
|
|
237
252
|
}
|
|
238
253
|
|
|
254
|
+
/**
|
|
255
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
256
|
+
*/
|
|
239
257
|
export type ReachabilityTypeResponse = ReachabilityType | 'NOT_FETCHED';
|
|
240
258
|
|
|
259
|
+
/**
|
|
260
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
261
|
+
*/
|
|
241
262
|
export interface BuildIdReachability {
|
|
242
263
|
/**
|
|
243
264
|
* Maps Task Queue names to how the Build Id may be reachable from them. If they are not
|
|
@@ -284,7 +305,7 @@ export function reachabilityResponseFromProto(resp: GetWorkerTaskReachabilityRes
|
|
|
284
305
|
* - Id passed is incorrect
|
|
285
306
|
* - Build Id has been scavenged by the server.
|
|
286
307
|
*
|
|
287
|
-
* @
|
|
308
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
288
309
|
*/
|
|
289
310
|
@SymbolBasedInstanceOfError('BuildIdNotFoundError')
|
|
290
311
|
export class BuildIdNotFoundError extends Error {}
|
package/src/types.ts
CHANGED
|
@@ -29,6 +29,7 @@ export type WorkflowExecutionStatusName =
|
|
|
29
29
|
| 'TERMINATED'
|
|
30
30
|
| 'CONTINUED_AS_NEW'
|
|
31
31
|
| 'TIMED_OUT'
|
|
32
|
+
| 'PAUSED'
|
|
32
33
|
| 'UNKNOWN'; // UNKNOWN is reserved for future enum values
|
|
33
34
|
|
|
34
35
|
export interface WorkflowExecutionInfo {
|
|
@@ -49,7 +50,7 @@ export interface WorkflowExecutionInfo {
|
|
|
49
50
|
closeTime?: Date;
|
|
50
51
|
memo?: Record<string, unknown>;
|
|
51
52
|
/** @deprecated Use {@link typedSearchAttributes} instead. */
|
|
52
|
-
searchAttributes: SearchAttributes; // eslint-disable-line
|
|
53
|
+
searchAttributes: SearchAttributes; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
53
54
|
typedSearchAttributes: TypedSearchAttributes;
|
|
54
55
|
parentExecution?: Required<proto.temporal.api.common.v1.IWorkflowExecution>;
|
|
55
56
|
rootExecution?: Required<proto.temporal.api.common.v1.IWorkflowExecution>;
|
|
@@ -61,7 +62,7 @@ export interface CountWorkflowExecution {
|
|
|
61
62
|
count: number;
|
|
62
63
|
groups: {
|
|
63
64
|
count: number;
|
|
64
|
-
groupValues: SearchAttributeValue[]; // eslint-disable-line
|
|
65
|
+
groupValues: SearchAttributeValue[]; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
65
66
|
}[];
|
|
66
67
|
}
|
|
67
68
|
|
|
@@ -123,6 +124,7 @@ export interface CallContext {
|
|
|
123
124
|
*/
|
|
124
125
|
export interface ConnectionLike {
|
|
125
126
|
workflowService: WorkflowService;
|
|
127
|
+
operatorService: OperatorService;
|
|
126
128
|
plugins: ConnectionPlugin[];
|
|
127
129
|
close(): Promise<void>;
|
|
128
130
|
ensureConnected(): Promise<void>;
|
|
@@ -183,16 +185,16 @@ export const QueryRejectCondition = {
|
|
|
183
185
|
NOT_COMPLETED_CLEANLY: 'NOT_COMPLETED_CLEANLY',
|
|
184
186
|
|
|
185
187
|
/** @deprecated Use {@link NONE} instead. */
|
|
186
|
-
QUERY_REJECT_CONDITION_NONE: 'NONE',
|
|
188
|
+
QUERY_REJECT_CONDITION_NONE: 'NONE',
|
|
187
189
|
|
|
188
190
|
/** @deprecated Use {@link NOT_OPEN} instead. */
|
|
189
|
-
QUERY_REJECT_CONDITION_NOT_OPEN: 'NOT_OPEN',
|
|
191
|
+
QUERY_REJECT_CONDITION_NOT_OPEN: 'NOT_OPEN',
|
|
190
192
|
|
|
191
193
|
/** @deprecated Use {@link NOT_COMPLETED_CLEANLY} instead. */
|
|
192
|
-
QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY: 'NOT_COMPLETED_CLEANLY',
|
|
194
|
+
QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY: 'NOT_COMPLETED_CLEANLY',
|
|
193
195
|
|
|
194
196
|
/** @deprecated Use `undefined` instead. */
|
|
195
|
-
QUERY_REJECT_CONDITION_UNSPECIFIED: undefined,
|
|
197
|
+
QUERY_REJECT_CONDITION_UNSPECIFIED: undefined,
|
|
196
198
|
} as const;
|
|
197
199
|
export type QueryRejectCondition = (typeof QueryRejectCondition)[keyof typeof QueryRejectCondition];
|
|
198
200
|
|
package/src/workflow-client.ts
CHANGED
|
@@ -296,7 +296,7 @@ export interface WorkflowClientOptions extends BaseClientOptions {
|
|
|
296
296
|
*
|
|
297
297
|
* Useful for injecting auth headers and tracing Workflow executions
|
|
298
298
|
*/
|
|
299
|
-
// eslint-disable-next-line
|
|
299
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
300
300
|
interceptors?: WorkflowClientInterceptors | WorkflowClientInterceptor[];
|
|
301
301
|
|
|
302
302
|
/**
|
|
@@ -1033,7 +1033,7 @@ export class WorkflowClient extends BaseClient {
|
|
|
1033
1033
|
}
|
|
1034
1034
|
return {
|
|
1035
1035
|
updateId: request.request!.meta!.updateId!,
|
|
1036
|
-
|
|
1036
|
+
|
|
1037
1037
|
workflowRunId: response.updateRef!.workflowExecution!.runId!,
|
|
1038
1038
|
outcome: response.outcome ?? undefined,
|
|
1039
1039
|
};
|
|
@@ -1237,9 +1237,9 @@ export class WorkflowClient extends BaseClient {
|
|
|
1237
1237
|
retryPolicy: options.retry ? compileRetryPolicy(options.retry) : undefined,
|
|
1238
1238
|
memo: options.memo ? { fields: await encodeMapToPayloads(this.dataConverter, options.memo) } : undefined,
|
|
1239
1239
|
searchAttributes:
|
|
1240
|
-
options.searchAttributes || options.typedSearchAttributes // eslint-disable-line
|
|
1240
|
+
options.searchAttributes || options.typedSearchAttributes // eslint-disable-line @typescript-eslint/no-deprecated
|
|
1241
1241
|
? {
|
|
1242
|
-
indexedFields: encodeUnifiedSearchAttributes(options.searchAttributes, options.typedSearchAttributes), // eslint-disable-line
|
|
1242
|
+
indexedFields: encodeUnifiedSearchAttributes(options.searchAttributes, options.typedSearchAttributes), // eslint-disable-line @typescript-eslint/no-deprecated
|
|
1243
1243
|
}
|
|
1244
1244
|
: undefined,
|
|
1245
1245
|
cronSchedule: options.cronSchedule,
|
|
@@ -1326,9 +1326,9 @@ export class WorkflowClient extends BaseClient {
|
|
|
1326
1326
|
retryPolicy: opts.retry ? compileRetryPolicy(opts.retry) : undefined,
|
|
1327
1327
|
memo: opts.memo ? { fields: await encodeMapToPayloads(this.dataConverter, opts.memo) } : undefined,
|
|
1328
1328
|
searchAttributes:
|
|
1329
|
-
opts.searchAttributes || opts.typedSearchAttributes // eslint-disable-line
|
|
1329
|
+
opts.searchAttributes || opts.typedSearchAttributes // eslint-disable-line @typescript-eslint/no-deprecated
|
|
1330
1330
|
? {
|
|
1331
|
-
indexedFields: encodeUnifiedSearchAttributes(opts.searchAttributes, opts.typedSearchAttributes), // eslint-disable-line
|
|
1331
|
+
indexedFields: encodeUnifiedSearchAttributes(opts.searchAttributes, opts.typedSearchAttributes), // eslint-disable-line @typescript-eslint/no-deprecated
|
|
1332
1332
|
}
|
|
1333
1333
|
: undefined,
|
|
1334
1334
|
cronSchedule: opts.cronSchedule,
|
|
@@ -1649,7 +1649,7 @@ export class WorkflowClient extends BaseClient {
|
|
|
1649
1649
|
|
|
1650
1650
|
protected getOrMakeInterceptors(workflowId: string, runId?: string): WorkflowClientInterceptor[] {
|
|
1651
1651
|
if (typeof this.options.interceptors === 'object' && 'calls' in this.options.interceptors) {
|
|
1652
|
-
// eslint-disable-next-line
|
|
1652
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1653
1653
|
const factories = (this.options.interceptors as WorkflowClientInterceptors).calls ?? [];
|
|
1654
1654
|
return factories.map((ctor) => ctor({ workflowId, runId }));
|
|
1655
1655
|
}
|
package/src/workflow-options.ts
CHANGED
|
@@ -50,8 +50,6 @@ export interface WorkflowOptions extends CommonWorkflowOptions {
|
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Override the versioning behavior of the Workflow that is about to be started.
|
|
53
|
-
*
|
|
54
|
-
* @experimental Deployment based versioning is experimental and may change in the future.
|
|
55
53
|
*/
|
|
56
54
|
versioningOverride?: VersioningOverride;
|
|
57
55
|
|
|
@@ -20,7 +20,7 @@ export const WorkflowUpdateStage = {
|
|
|
20
20
|
* This is not an allowed value.
|
|
21
21
|
* @deprecated
|
|
22
22
|
*/
|
|
23
|
-
UNSPECIFIED: undefined,
|
|
23
|
+
UNSPECIFIED: undefined,
|
|
24
24
|
} as const;
|
|
25
25
|
export type WorkflowUpdateStage = (typeof WorkflowUpdateStage)[keyof typeof WorkflowUpdateStage];
|
|
26
26
|
|