@temporalio/common 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/activity-options.d.ts +67 -16
- package/lib/activity-options.js +47 -1
- package/lib/activity-options.js.map +1 -1
- package/lib/converter/failure-converter.js +6 -6
- package/lib/converter/failure-converter.js.map +1 -1
- package/lib/converter/payload-search-attributes.d.ts +1 -1
- package/lib/converter/payload-search-attributes.js +3 -3
- package/lib/converter/payload-search-attributes.js.map +1 -1
- package/lib/failure.js +13 -13
- package/lib/failure.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/internal-workflow/enums-helpers.d.ts +1 -1
- package/lib/internal-workflow/enums-helpers.js +1 -1
- package/lib/metrics.d.ts +34 -15
- package/lib/metrics.js +11 -3
- package/lib/metrics.js.map +1 -1
- package/lib/search-attributes.js +10 -1
- package/lib/search-attributes.js.map +1 -1
- package/lib/time.js +1 -1
- package/lib/time.js.map +1 -1
- package/lib/versioning-intent-enum.d.ts +4 -2
- package/lib/versioning-intent-enum.js +5 -3
- package/lib/versioning-intent-enum.js.map +1 -1
- package/lib/versioning-intent.d.ts +1 -2
- package/lib/worker-deployments.d.ts +0 -4
- package/lib/worker-deployments.js +0 -2
- package/lib/worker-deployments.js.map +1 -1
- package/lib/workflow-options.d.ts +3 -3
- package/lib/workflow-options.js +15 -7
- package/lib/workflow-options.js.map +1 -1
- package/package.json +3 -3
- package/src/activity-options.ts +78 -16
- package/src/converter/failure-converter.ts +6 -7
- package/src/converter/payload-search-attributes.ts +3 -3
- package/src/failure.ts +13 -14
- package/src/index.ts +2 -2
- package/src/internal-workflow/enums-helpers.ts +1 -1
- package/src/metrics.ts +64 -22
- package/src/search-attributes.ts +13 -5
- package/src/time.ts +1 -1
- package/src/versioning-intent-enum.ts +5 -3
- package/src/versioning-intent.ts +1 -2
- package/src/worker-deployments.ts +0 -4
- package/src/workflow-options.ts +11 -11
|
@@ -10,12 +10,12 @@ import { Exact, RemovePrefix, UnionToIntersection } from '../type-helpers';
|
|
|
10
10
|
* Newly introduced enums should follow the following pattern:
|
|
11
11
|
*
|
|
12
12
|
* ```ts
|
|
13
|
-
* type ParentClosePolicy = (typeof ParentClosePolicy)[keyof typeof ParentClosePolicy];
|
|
14
13
|
* const ParentClosePolicy = {
|
|
15
14
|
* TERMINATE: 'TERMINATE',
|
|
16
15
|
* ABANDON: 'ABANDON',
|
|
17
16
|
* REQUEST_CANCEL: 'REQUEST_CANCEL',
|
|
18
17
|
* } as const;
|
|
18
|
+
* type ParentClosePolicy = (typeof ParentClosePolicy)[keyof typeof ParentClosePolicy];
|
|
19
19
|
*
|
|
20
20
|
* const [encodeParentClosePolicy, decodeParentClosePolicy] = //
|
|
21
21
|
* makeProtoEnumConverters<
|
package/src/metrics.ts
CHANGED
|
@@ -69,8 +69,43 @@ export interface Metric {
|
|
|
69
69
|
* The description of the metric, if any.
|
|
70
70
|
*/
|
|
71
71
|
description?: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The kind of the metric (e.g. `counter`, `histogram`, `gauge`).
|
|
75
|
+
*/
|
|
76
|
+
kind: MetricKind;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The type of value recorded by the metric. Either `int` or `float`.
|
|
80
|
+
*/
|
|
81
|
+
valueType: NumericMetricValueType;
|
|
72
82
|
}
|
|
73
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Tags to be attached to some metrics.
|
|
86
|
+
*
|
|
87
|
+
* @experimental The Metric API is an experimental feature and may be subject to change.
|
|
88
|
+
*/
|
|
89
|
+
export type MetricTags = Record<string, string | number | boolean>;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Type of numerical values recorded by a metric.
|
|
93
|
+
*
|
|
94
|
+
* Note that this represents the _configuration_ of the metric; however, since JavaScript doesn't
|
|
95
|
+
* have different runtime representation for integers and floats, the actual value type is always
|
|
96
|
+
* a JS 'number'.
|
|
97
|
+
*
|
|
98
|
+
* @experimental The Metric API is an experimental feature and may be subject to change.
|
|
99
|
+
*/
|
|
100
|
+
export type NumericMetricValueType = 'int' | 'float';
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The kind of a metric.
|
|
104
|
+
*
|
|
105
|
+
* @experimental The Metric API is an experimental feature and may be subject to change.
|
|
106
|
+
*/
|
|
107
|
+
export type MetricKind = 'counter' | 'histogram' | 'gauge';
|
|
108
|
+
|
|
74
109
|
/**
|
|
75
110
|
* A metric that supports adding values as a counter.
|
|
76
111
|
*
|
|
@@ -91,6 +126,9 @@ export interface MetricCounter extends Metric {
|
|
|
91
126
|
* @param tags Tags to append to existing tags.
|
|
92
127
|
*/
|
|
93
128
|
withTags(tags: MetricTags): MetricCounter;
|
|
129
|
+
|
|
130
|
+
kind: 'counter';
|
|
131
|
+
valueType: 'int';
|
|
94
132
|
}
|
|
95
133
|
|
|
96
134
|
/**
|
|
@@ -99,11 +137,6 @@ export interface MetricCounter extends Metric {
|
|
|
99
137
|
* @experimental The Metric API is an experimental feature and may be subject to change.
|
|
100
138
|
*/
|
|
101
139
|
export interface MetricHistogram extends Metric {
|
|
102
|
-
/**
|
|
103
|
-
* The type of value to record. Either `int` or `float`.
|
|
104
|
-
*/
|
|
105
|
-
valueType: NumericMetricValueType;
|
|
106
|
-
|
|
107
140
|
/**
|
|
108
141
|
* Record the given value on the histogram.
|
|
109
142
|
*
|
|
@@ -120,6 +153,8 @@ export interface MetricHistogram extends Metric {
|
|
|
120
153
|
* @param tags Tags to append to existing tags.
|
|
121
154
|
*/
|
|
122
155
|
withTags(tags: MetricTags): MetricHistogram;
|
|
156
|
+
|
|
157
|
+
kind: 'histogram';
|
|
123
158
|
}
|
|
124
159
|
|
|
125
160
|
/**
|
|
@@ -128,11 +163,6 @@ export interface MetricHistogram extends Metric {
|
|
|
128
163
|
* @experimental The Metric API is an experimental feature and may be subject to change.
|
|
129
164
|
*/
|
|
130
165
|
export interface MetricGauge extends Metric {
|
|
131
|
-
/**
|
|
132
|
-
* The type of value to set. Either `int` or `float`.
|
|
133
|
-
*/
|
|
134
|
-
valueType: NumericMetricValueType;
|
|
135
|
-
|
|
136
166
|
/**
|
|
137
167
|
* Set the given value on the gauge.
|
|
138
168
|
*
|
|
@@ -147,16 +177,9 @@ export interface MetricGauge extends Metric {
|
|
|
147
177
|
* @param tags Tags to append to existing tags.
|
|
148
178
|
*/
|
|
149
179
|
withTags(tags: MetricTags): MetricGauge;
|
|
150
|
-
}
|
|
151
180
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
*
|
|
155
|
-
* @experimental The Metric API is an experimental feature and may be subject to change.
|
|
156
|
-
*/
|
|
157
|
-
export type MetricTags = Record<string, string | number | boolean>;
|
|
158
|
-
|
|
159
|
-
export type NumericMetricValueType = 'int' | 'float';
|
|
181
|
+
kind: 'gauge';
|
|
182
|
+
}
|
|
160
183
|
|
|
161
184
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
162
185
|
|
|
@@ -170,6 +193,9 @@ class NoopMetricMeter implements MetricMeter {
|
|
|
170
193
|
unit,
|
|
171
194
|
description,
|
|
172
195
|
|
|
196
|
+
kind: 'counter',
|
|
197
|
+
valueType: 'int',
|
|
198
|
+
|
|
173
199
|
add(_value, _extraTags) {},
|
|
174
200
|
|
|
175
201
|
withTags(_extraTags) {
|
|
@@ -186,10 +212,12 @@ class NoopMetricMeter implements MetricMeter {
|
|
|
186
212
|
): MetricHistogram {
|
|
187
213
|
return {
|
|
188
214
|
name,
|
|
189
|
-
valueType,
|
|
190
215
|
unit,
|
|
191
216
|
description,
|
|
192
217
|
|
|
218
|
+
kind: 'histogram',
|
|
219
|
+
valueType,
|
|
220
|
+
|
|
193
221
|
record(_value, _extraTags) {},
|
|
194
222
|
|
|
195
223
|
withTags(_extraTags) {
|
|
@@ -198,13 +226,20 @@ class NoopMetricMeter implements MetricMeter {
|
|
|
198
226
|
};
|
|
199
227
|
}
|
|
200
228
|
|
|
201
|
-
createGauge(
|
|
229
|
+
createGauge(
|
|
230
|
+
name: string,
|
|
231
|
+
valueType: NumericMetricValueType = 'int',
|
|
232
|
+
unit?: string,
|
|
233
|
+
description?: string
|
|
234
|
+
): MetricGauge {
|
|
202
235
|
return {
|
|
203
236
|
name,
|
|
204
|
-
valueType: valueType ?? 'int',
|
|
205
237
|
unit,
|
|
206
238
|
description,
|
|
207
239
|
|
|
240
|
+
kind: 'gauge',
|
|
241
|
+
valueType,
|
|
242
|
+
|
|
208
243
|
set(_value, _extraTags) {},
|
|
209
244
|
|
|
210
245
|
withTags(_extraTags) {
|
|
@@ -300,6 +335,9 @@ export class MetricMeterWithComposedTags implements MetricMeter {
|
|
|
300
335
|
* @experimental The Metric API is an experimental feature and may be subject to change.
|
|
301
336
|
*/
|
|
302
337
|
class MetricCounterWithComposedTags implements MetricCounter {
|
|
338
|
+
public readonly kind = 'counter';
|
|
339
|
+
public readonly valueType = 'int';
|
|
340
|
+
|
|
303
341
|
constructor(
|
|
304
342
|
private parentCounter: MetricCounter,
|
|
305
343
|
private contributors: MetricTagsOrFunc[]
|
|
@@ -332,6 +370,8 @@ class MetricCounterWithComposedTags implements MetricCounter {
|
|
|
332
370
|
* @experimental The Metric API is an experimental feature and may be subject to change.
|
|
333
371
|
*/
|
|
334
372
|
class MetricHistogramWithComposedTags implements MetricHistogram {
|
|
373
|
+
public readonly kind = 'histogram';
|
|
374
|
+
|
|
335
375
|
constructor(
|
|
336
376
|
private parentHistogram: MetricHistogram,
|
|
337
377
|
private contributors: MetricTagsOrFunc[]
|
|
@@ -369,6 +409,8 @@ class MetricHistogramWithComposedTags implements MetricHistogram {
|
|
|
369
409
|
* @hidden
|
|
370
410
|
*/
|
|
371
411
|
class MetricGaugeWithComposedTags implements MetricGauge {
|
|
412
|
+
public readonly kind = 'gauge';
|
|
413
|
+
|
|
372
414
|
constructor(
|
|
373
415
|
private parentGauge: MetricGauge,
|
|
374
416
|
private contributors: MetricTagsOrFunc[]
|
package/src/search-attributes.ts
CHANGED
|
@@ -2,11 +2,11 @@ import type { temporal } from '@temporalio/proto';
|
|
|
2
2
|
import { makeProtoEnumConverters } from './internal-workflow';
|
|
3
3
|
|
|
4
4
|
/** @deprecated: Use {@link TypedSearchAttributes} instead */
|
|
5
|
-
export type SearchAttributeValueOrReadonly = SearchAttributeValue | Readonly<SearchAttributeValue> | undefined; // eslint-disable-line
|
|
5
|
+
export type SearchAttributeValueOrReadonly = SearchAttributeValue | Readonly<SearchAttributeValue> | undefined; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
6
6
|
/** @deprecated: Use {@link TypedSearchAttributes} instead */
|
|
7
|
-
export type SearchAttributes = Record<string, SearchAttributeValueOrReadonly>; // eslint-disable-line
|
|
7
|
+
export type SearchAttributes = Record<string, SearchAttributeValueOrReadonly>; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
8
8
|
/** @deprecated: Use {@link TypedSearchAttributes} instead */
|
|
9
|
-
export type SearchAttributeValue = string[] | number[] | boolean[] | Date[];
|
|
9
|
+
export type SearchAttributeValue = string[] | number[] | boolean[] | Date[];
|
|
10
10
|
|
|
11
11
|
export const SearchAttributeType = {
|
|
12
12
|
TEXT: 'TEXT',
|
|
@@ -17,7 +17,6 @@ export const SearchAttributeType = {
|
|
|
17
17
|
DATETIME: 'DATETIME',
|
|
18
18
|
KEYWORD_LIST: 'KEYWORD_LIST',
|
|
19
19
|
} as const;
|
|
20
|
-
|
|
21
20
|
export type SearchAttributeType = (typeof SearchAttributeType)[keyof typeof SearchAttributeType];
|
|
22
21
|
|
|
23
22
|
// Note: encodeSearchAttributeIndexedValueType exported for use in tests to register search attributes
|
|
@@ -213,7 +212,7 @@ export class TypedSearchAttributes {
|
|
|
213
212
|
|
|
214
213
|
static getKeyFromUntyped(
|
|
215
214
|
key: string,
|
|
216
|
-
value: SearchAttributeValueOrReadonly // eslint-disable-line
|
|
215
|
+
value: SearchAttributeValueOrReadonly // eslint-disable-line @typescript-eslint/no-deprecated
|
|
217
216
|
): SearchAttributeKey<SearchAttributeType> | undefined {
|
|
218
217
|
if (value == null) {
|
|
219
218
|
return;
|
|
@@ -270,20 +269,29 @@ export class TypedSearchAttributes {
|
|
|
270
269
|
}
|
|
271
270
|
|
|
272
271
|
static toSearchAttributeType(type: string): SearchAttributeType | undefined {
|
|
272
|
+
// The type metadata is usually in PascalCase (e.g. "KeywordList") but in
|
|
273
|
+
// rare cases may be in SCREAMING_SNAKE_CASE (e.g. "INDEXED_VALUE_TYPE_KEYWORD_LIST").
|
|
273
274
|
switch (type) {
|
|
274
275
|
case 'Text':
|
|
276
|
+
case 'INDEXED_VALUE_TYPE_TEXT':
|
|
275
277
|
return SearchAttributeType.TEXT;
|
|
276
278
|
case 'Keyword':
|
|
279
|
+
case 'INDEXED_VALUE_TYPE_KEYWORD':
|
|
277
280
|
return SearchAttributeType.KEYWORD;
|
|
278
281
|
case 'Int':
|
|
282
|
+
case 'INDEXED_VALUE_TYPE_INT':
|
|
279
283
|
return SearchAttributeType.INT;
|
|
280
284
|
case 'Double':
|
|
285
|
+
case 'INDEXED_VALUE_TYPE_DOUBLE':
|
|
281
286
|
return SearchAttributeType.DOUBLE;
|
|
282
287
|
case 'Bool':
|
|
288
|
+
case 'INDEXED_VALUE_TYPE_BOOL':
|
|
283
289
|
return SearchAttributeType.BOOL;
|
|
284
290
|
case 'Datetime':
|
|
291
|
+
case 'INDEXED_VALUE_TYPE_DATETIME':
|
|
285
292
|
return SearchAttributeType.DATETIME;
|
|
286
293
|
case 'KeywordList':
|
|
294
|
+
case 'INDEXED_VALUE_TYPE_KEYWORD_LIST':
|
|
287
295
|
return SearchAttributeType.KEYWORD_LIST;
|
|
288
296
|
default:
|
|
289
297
|
return;
|
package/src/time.ts
CHANGED
|
@@ -2,15 +2,14 @@ import type { coresdk } from '@temporalio/proto';
|
|
|
2
2
|
import type { VersioningIntent as VersioningIntentString } from './versioning-intent';
|
|
3
3
|
import { assertNever, checkExtends } from './type-helpers';
|
|
4
4
|
|
|
5
|
-
/* eslint-disable
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
6
6
|
|
|
7
7
|
// Avoid importing the proto implementation to reduce workflow bundle size
|
|
8
8
|
// Copied from coresdk.common.VersioningIntent
|
|
9
9
|
/**
|
|
10
10
|
* Protobuf enum representation of {@link VersioningIntentString}.
|
|
11
11
|
*
|
|
12
|
-
* @deprecated
|
|
13
|
-
* @experimental The Worker Versioning API is still being designed. Major changes are expected.
|
|
12
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
14
13
|
*/
|
|
15
14
|
export enum VersioningIntent {
|
|
16
15
|
UNSPECIFIED = 0,
|
|
@@ -21,6 +20,9 @@ export enum VersioningIntent {
|
|
|
21
20
|
checkExtends<coresdk.common.VersioningIntent, VersioningIntent>();
|
|
22
21
|
checkExtends<VersioningIntent, coresdk.common.VersioningIntent>();
|
|
23
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
25
|
+
*/
|
|
24
26
|
export function versioningIntentToProto(intent: VersioningIntentString | undefined): VersioningIntent {
|
|
25
27
|
switch (intent) {
|
|
26
28
|
case 'DEFAULT':
|
package/src/versioning-intent.ts
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
* current worker. The default behavior for starting Workflows is `DEFAULT`. The default behavior for Workflows starting
|
|
12
12
|
* Activities, starting Child Workflows, or Continuing As New is `COMPATIBLE`.
|
|
13
13
|
*
|
|
14
|
-
* @deprecated
|
|
15
|
-
* @experimental The Worker Versioning API is still being designed. Major changes are expected.
|
|
14
|
+
* @deprecated Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments
|
|
16
15
|
*/
|
|
17
16
|
export type VersioningIntent = 'COMPATIBLE' | 'DEFAULT';
|
|
@@ -3,8 +3,6 @@ import { makeProtoEnumConverters } from './internal-workflow';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Represents the version of a specific worker deployment.
|
|
6
|
-
*
|
|
7
|
-
* @experimental Deployment based versioning is experimental and may change in the future.
|
|
8
6
|
*/
|
|
9
7
|
export interface WorkerDeploymentVersion {
|
|
10
8
|
readonly buildId: string;
|
|
@@ -25,8 +23,6 @@ export function toCanonicalString(version: WorkerDeploymentVersion): string {
|
|
|
25
23
|
* * 'PINNED' - The workflow will be pinned to the current Build ID unless manually moved.
|
|
26
24
|
* * 'AUTO_UPGRADE' - The workflow will automatically move to the latest version (default Build ID
|
|
27
25
|
* of the task queue) when the next task is dispatched.
|
|
28
|
-
*
|
|
29
|
-
* @experimental Deployment based versioning is experimental and may change in the future.
|
|
30
26
|
*/
|
|
31
27
|
export const VersioningBehavior = {
|
|
32
28
|
PINNED: 'PINNED',
|
package/src/workflow-options.ts
CHANGED
|
@@ -43,7 +43,7 @@ export const WorkflowIdReusePolicy = {
|
|
|
43
43
|
* {@link WorkflowIdConflictPolicy.WORKFLOW_ID_CONFLICT_POLICY_TERMINATE_EXISTING}.
|
|
44
44
|
* When using this option, `WorkflowOptions.workflowIdConflictPolicy` must be left unspecified.
|
|
45
45
|
*/
|
|
46
|
-
TERMINATE_IF_RUNNING: 'TERMINATE_IF_RUNNING',
|
|
46
|
+
TERMINATE_IF_RUNNING: 'TERMINATE_IF_RUNNING',
|
|
47
47
|
|
|
48
48
|
/// Anything below this line has been deprecated
|
|
49
49
|
|
|
@@ -52,19 +52,19 @@ export const WorkflowIdReusePolicy = {
|
|
|
52
52
|
*
|
|
53
53
|
* @deprecated Either leave property `undefined`, or use {@link ALLOW_DUPLICATE} instead.
|
|
54
54
|
*/
|
|
55
|
-
WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED: undefined,
|
|
55
|
+
WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED: undefined,
|
|
56
56
|
|
|
57
57
|
/** @deprecated Use {@link ALLOW_DUPLICATE} instead. */
|
|
58
|
-
WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE: 'ALLOW_DUPLICATE',
|
|
58
|
+
WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE: 'ALLOW_DUPLICATE',
|
|
59
59
|
|
|
60
60
|
/** @deprecated Use {@link ALLOW_DUPLICATE_FAILED_ONLY} instead. */
|
|
61
|
-
WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY: 'ALLOW_DUPLICATE_FAILED_ONLY',
|
|
61
|
+
WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY: 'ALLOW_DUPLICATE_FAILED_ONLY',
|
|
62
62
|
|
|
63
63
|
/** @deprecated Use {@link REJECT_DUPLICATE} instead. */
|
|
64
|
-
WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE: 'REJECT_DUPLICATE',
|
|
64
|
+
WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE: 'REJECT_DUPLICATE',
|
|
65
65
|
|
|
66
66
|
/** @deprecated Use {@link TERMINATE_IF_RUNNING} instead. */
|
|
67
|
-
WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING: 'TERMINATE_IF_RUNNING',
|
|
67
|
+
WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING: 'TERMINATE_IF_RUNNING',
|
|
68
68
|
} as const;
|
|
69
69
|
export type WorkflowIdReusePolicy = (typeof WorkflowIdReusePolicy)[keyof typeof WorkflowIdReusePolicy];
|
|
70
70
|
|
|
@@ -79,7 +79,7 @@ export const [encodeWorkflowIdReusePolicy, decodeWorkflowIdReusePolicy] = makePr
|
|
|
79
79
|
[WorkflowIdReusePolicy.ALLOW_DUPLICATE]: 1,
|
|
80
80
|
[WorkflowIdReusePolicy.ALLOW_DUPLICATE_FAILED_ONLY]: 2,
|
|
81
81
|
[WorkflowIdReusePolicy.REJECT_DUPLICATE]: 3,
|
|
82
|
-
[WorkflowIdReusePolicy.TERMINATE_IF_RUNNING]: 4, // eslint-disable-line
|
|
82
|
+
[WorkflowIdReusePolicy.TERMINATE_IF_RUNNING]: 4, // eslint-disable-line @typescript-eslint/no-deprecated
|
|
83
83
|
UNSPECIFIED: 0,
|
|
84
84
|
} as const,
|
|
85
85
|
'WORKFLOW_ID_REUSE_POLICY_'
|
|
@@ -93,7 +93,6 @@ export const [encodeWorkflowIdReusePolicy, decodeWorkflowIdReusePolicy] = makePr
|
|
|
93
93
|
*
|
|
94
94
|
* *Note: It is never possible to have two _actively running_ Workflows with the same ID.*
|
|
95
95
|
*/
|
|
96
|
-
export type WorkflowIdConflictPolicy = (typeof WorkflowIdConflictPolicy)[keyof typeof WorkflowIdConflictPolicy];
|
|
97
96
|
export const WorkflowIdConflictPolicy = {
|
|
98
97
|
/**
|
|
99
98
|
* Do not start a new Workflow. Instead raise a `WorkflowExecutionAlreadyStartedError`.
|
|
@@ -110,6 +109,7 @@ export const WorkflowIdConflictPolicy = {
|
|
|
110
109
|
*/
|
|
111
110
|
TERMINATE_EXISTING: 'TERMINATE_EXISTING',
|
|
112
111
|
} as const;
|
|
112
|
+
export type WorkflowIdConflictPolicy = (typeof WorkflowIdConflictPolicy)[keyof typeof WorkflowIdConflictPolicy];
|
|
113
113
|
|
|
114
114
|
export const [encodeWorkflowIdConflictPolicy, decodeWorkflowIdConflictPolicy] = makeProtoEnumConverters<
|
|
115
115
|
temporal.api.enums.v1.WorkflowIdConflictPolicy,
|
|
@@ -133,7 +133,7 @@ export interface BaseWorkflowOptions {
|
|
|
133
133
|
*
|
|
134
134
|
* *Note: It is not possible to have two actively running Workflows with the same ID.*
|
|
135
135
|
*
|
|
136
|
-
* @default
|
|
136
|
+
* @default WorkflowIdReusePolicy.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE
|
|
137
137
|
*/
|
|
138
138
|
workflowIdReusePolicy?: WorkflowIdReusePolicy;
|
|
139
139
|
|
|
@@ -142,7 +142,7 @@ export interface BaseWorkflowOptions {
|
|
|
142
142
|
*
|
|
143
143
|
* *Note: It is not possible to have two actively running Workflows with the same ID.*
|
|
144
144
|
*
|
|
145
|
-
* @default
|
|
145
|
+
* @default WorkflowIdConflictPolicy.WORKFLOW_ID_CONFLICT_POLICY_UNSPECIFIED
|
|
146
146
|
*/
|
|
147
147
|
workflowIdConflictPolicy?: WorkflowIdConflictPolicy;
|
|
148
148
|
|
|
@@ -179,7 +179,7 @@ export interface BaseWorkflowOptions {
|
|
|
179
179
|
*
|
|
180
180
|
* @deprecated Use {@link typedSearchAttributes} instead.
|
|
181
181
|
*/
|
|
182
|
-
searchAttributes?: SearchAttributes; // eslint-disable-line
|
|
182
|
+
searchAttributes?: SearchAttributes; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
185
|
* Specifies additional indexed information to attach to the Workflow Execution. More info:
|