@temporalio/client 1.3.0 → 1.4.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/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-common';
26
- export { RetryPolicy } from '@temporalio/internal-workflow-common';
27
- export * from '@temporalio/internal-workflow-common/lib/errors';
28
- export * from '@temporalio/internal-workflow-common/lib/interfaces';
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';
@@ -4,7 +4,7 @@
4
4
  * @module
5
5
  */
6
6
 
7
- import { Headers, Next } from '@temporalio/internal-workflow-common';
7
+ import { Headers, Next } from '@temporalio/common';
8
8
  import { temporal } from '@temporalio/proto';
9
9
  import {
10
10
  DescribeWorkflowExecutionResponse,
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { SearchAttributes } from '@temporalio/internal-workflow-common';
1
+ import type { SearchAttributes } from '@temporalio/common';
2
2
  import * as proto from '@temporalio/proto';
3
3
  import type * as grpc from '@grpc/grpc-js';
4
4
 
@@ -21,22 +21,21 @@ import {
21
21
  filterNullAndUndefined,
22
22
  isLoadedDataConverter,
23
23
  loadDataConverter,
24
- } from '@temporalio/internal-non-workflow-common';
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/internal-workflow-common';
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';
@@ -877,10 +876,14 @@ export class WorkflowClient {
877
876
  executionTime: optionalTsToDate(raw.workflowExecutionInfo!.executionTime),
878
877
  closeTime: optionalTsToDate(raw.workflowExecutionInfo!.closeTime),
879
878
  memo: await decodeMapFromPayloads(this.client.dataConverter, raw.workflowExecutionInfo!.memo?.fields),
880
- searchAttributes: mapFromPayloads(
881
- searchAttributePayloadConverter,
882
- raw.workflowExecutionInfo!.searchAttributes?.indexedFields ?? {}
883
- ) as SearchAttributes,
879
+ searchAttributes: Object.fromEntries(
880
+ Object.entries(
881
+ mapFromPayloads(
882
+ searchAttributePayloadConverter,
883
+ raw.workflowExecutionInfo!.searchAttributes?.indexedFields ?? {}
884
+ ) as SearchAttributes
885
+ ).filter(([_, v]) => v && v.length > 0) // Filter out empty arrays returned by pre 1.18 servers
886
+ ),
884
887
  parentExecution: raw.workflowExecutionInfo?.parentExecution
885
888
  ? {
886
889
  workflowId: raw.workflowExecutionInfo.parentExecution.workflowId!,
@@ -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/internal-workflow-common/lib/workflow-options';
3
+ export * from '@temporalio/common/lib/workflow-options';
8
4
 
9
5
  export interface CompiledWorkflowOptions extends WithCompiledWorkflowOptions<WorkflowOptions> {
10
6
  args: unknown[];