@temporalio/client 1.3.0 → 1.4.1
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/async-completion-client.d.ts +1 -1
- package/lib/async-completion-client.js +11 -11
- package/lib/async-completion-client.js.map +1 -1
- package/lib/client.d.ts +1 -1
- package/lib/client.js +3 -3
- package/lib/client.js.map +1 -1
- package/lib/connection.d.ts +1 -1
- package/lib/connection.js +3 -3
- package/lib/connection.js.map +1 -1
- package/lib/grpc-retry.d.ts +51 -8
- package/lib/grpc-retry.js +73 -46
- package/lib/grpc-retry.js.map +1 -1
- package/lib/index.d.ts +5 -6
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/interceptors.d.ts +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/workflow-client.d.ts +2 -1
- package/lib/workflow-client.js +36 -39
- package/lib/workflow-client.js.map +1 -1
- package/lib/workflow-options.d.ts +2 -2
- package/lib/workflow-options.js +1 -1
- package/lib/workflow-options.js.map +1 -1
- package/package.json +4 -6
- package/src/async-completion-client.ts +2 -2
- package/src/client.ts +2 -2
- package/src/connection.ts +1 -1
- package/src/grpc-retry.ts +129 -56
- package/src/index.ts +5 -5
- package/src/interceptors.ts +1 -1
- package/src/types.ts +1 -1
- package/src/workflow-client.ts +16 -18
- package/src/workflow-options.ts +2 -6
package/src/index.ts
CHANGED
|
@@ -17,16 +17,16 @@ export {
|
|
|
17
17
|
DataConverter,
|
|
18
18
|
defaultPayloadConverter,
|
|
19
19
|
ProtoFailure,
|
|
20
|
+
RetryPolicy,
|
|
20
21
|
ServerFailure,
|
|
21
22
|
TemporalFailure,
|
|
22
23
|
TerminatedFailure,
|
|
23
24
|
TimeoutFailure,
|
|
24
25
|
} from '@temporalio/common';
|
|
25
|
-
export { TLSConfig } from '@temporalio/internal-non-workflow
|
|
26
|
-
export
|
|
27
|
-
export * from '@temporalio/
|
|
28
|
-
export * from '@temporalio/
|
|
29
|
-
export * from '@temporalio/internal-workflow-common/lib/workflow-handle';
|
|
26
|
+
export { TLSConfig } from '@temporalio/common/lib/internal-non-workflow';
|
|
27
|
+
export * from '@temporalio/common/lib/errors';
|
|
28
|
+
export * from '@temporalio/common/lib/interfaces';
|
|
29
|
+
export * from '@temporalio/common/lib/workflow-handle';
|
|
30
30
|
export * from './async-completion-client';
|
|
31
31
|
export * from './client';
|
|
32
32
|
export { Connection, ConnectionOptions, ConnectionOptionsWithDefaults, LOCAL_TARGET } from './connection';
|
package/src/interceptors.ts
CHANGED
package/src/types.ts
CHANGED
package/src/workflow-client.ts
CHANGED
|
@@ -21,22 +21,21 @@ import {
|
|
|
21
21
|
filterNullAndUndefined,
|
|
22
22
|
isLoadedDataConverter,
|
|
23
23
|
loadDataConverter,
|
|
24
|
-
} from '@temporalio/internal-non-workflow
|
|
24
|
+
} from '@temporalio/common/lib/internal-non-workflow';
|
|
25
25
|
import {
|
|
26
26
|
BaseWorkflowHandle,
|
|
27
27
|
compileRetryPolicy,
|
|
28
|
-
composeInterceptors,
|
|
29
|
-
optionalTsToDate,
|
|
30
28
|
QueryDefinition,
|
|
31
|
-
Replace,
|
|
32
29
|
SearchAttributes,
|
|
33
30
|
SignalDefinition,
|
|
34
|
-
tsToDate,
|
|
35
31
|
WithWorkflowArgs,
|
|
36
32
|
Workflow,
|
|
37
33
|
WorkflowNotFoundError,
|
|
38
34
|
WorkflowResultType,
|
|
39
|
-
} from '@temporalio/
|
|
35
|
+
} from '@temporalio/common';
|
|
36
|
+
import { optionalTsToDate, tsToDate } from '@temporalio/common/lib/time';
|
|
37
|
+
import { composeInterceptors } from '@temporalio/common/lib/interceptors';
|
|
38
|
+
import { Replace } from '@temporalio/common/lib/type-helpers';
|
|
40
39
|
import { temporal } from '@temporalio/proto';
|
|
41
40
|
import os from 'os';
|
|
42
41
|
import { v4 as uuid4 } from 'uuid';
|
|
@@ -503,14 +502,9 @@ export class WorkflowClient {
|
|
|
503
502
|
} catch (err) {
|
|
504
503
|
this.rethrowGrpcError(err, { workflowId, runId }, 'Failed to get Workflow execution history');
|
|
505
504
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
const { events } = res.history;
|
|
510
|
-
if (!events) {
|
|
511
|
-
throw new Error('No events in history returned by service');
|
|
512
|
-
}
|
|
513
|
-
if (events.length === 0) {
|
|
505
|
+
const events = res.history?.events;
|
|
506
|
+
|
|
507
|
+
if (events == null || events.length === 0) {
|
|
514
508
|
req.nextPageToken = res.nextPageToken;
|
|
515
509
|
continue;
|
|
516
510
|
}
|
|
@@ -877,10 +871,14 @@ export class WorkflowClient {
|
|
|
877
871
|
executionTime: optionalTsToDate(raw.workflowExecutionInfo!.executionTime),
|
|
878
872
|
closeTime: optionalTsToDate(raw.workflowExecutionInfo!.closeTime),
|
|
879
873
|
memo: await decodeMapFromPayloads(this.client.dataConverter, raw.workflowExecutionInfo!.memo?.fields),
|
|
880
|
-
searchAttributes:
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
874
|
+
searchAttributes: Object.fromEntries(
|
|
875
|
+
Object.entries(
|
|
876
|
+
mapFromPayloads(
|
|
877
|
+
searchAttributePayloadConverter,
|
|
878
|
+
raw.workflowExecutionInfo!.searchAttributes?.indexedFields ?? {}
|
|
879
|
+
) as SearchAttributes
|
|
880
|
+
).filter(([_, v]) => v && v.length > 0) // Filter out empty arrays returned by pre 1.18 servers
|
|
881
|
+
),
|
|
884
882
|
parentExecution: raw.workflowExecutionInfo?.parentExecution
|
|
885
883
|
? {
|
|
886
884
|
workflowId: raw.workflowExecutionInfo.parentExecution.workflowId!,
|
package/src/workflow-options.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CommonWorkflowOptions,
|
|
3
|
-
SignalDefinition,
|
|
4
|
-
WithCompiledWorkflowOptions,
|
|
5
|
-
} from '@temporalio/internal-workflow-common';
|
|
1
|
+
import { CommonWorkflowOptions, SignalDefinition, WithCompiledWorkflowOptions } from '@temporalio/common';
|
|
6
2
|
|
|
7
|
-
export * from '@temporalio/
|
|
3
|
+
export * from '@temporalio/common/lib/workflow-options';
|
|
8
4
|
|
|
9
5
|
export interface CompiledWorkflowOptions extends WithCompiledWorkflowOptions<WorkflowOptions> {
|
|
10
6
|
args: unknown[];
|