Skip to content

Commit 33d672c

Browse files
committed
revert movement of interceptor adapters to wf client creation
1 parent c38d662 commit 33d672c

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

packages/client/src/workflow-client.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,6 @@ export class WorkflowClient extends BaseClient {
511511
...filterNullAndUndefined(options ?? {}),
512512
loadedDataConverter: this.dataConverter,
513513
};
514-
this.options.interceptors = this.adaptInterceptors();
515514
}
516515

517516
/**
@@ -532,9 +531,10 @@ export class WorkflowClient extends BaseClient {
532531
const workflowType = extractWorkflowType(workflowTypeOrFunc);
533532
assertRequiredWorkflowOptions(options);
534533
const compiledOptions = compileWorkflowOptions(ensureArgs(options));
534+
const adaptedInterceptors = interceptors.map((i) => adaptWorkflowClientInterceptor(i));
535535

536536
const startWithDetails = composeInterceptors(
537-
interceptors,
537+
adaptedInterceptors,
538538
'startWithDetails',
539539
this._startWorkflowHandler.bind(this)
540540
);
@@ -1646,24 +1646,6 @@ export class WorkflowClient extends BaseClient {
16461646
return decodeCountWorkflowExecutionsResponse(response);
16471647
}
16481648

1649-
// eslint-disable-next-line deprecation/deprecation
1650-
protected adaptInterceptors(): WorkflowClientInterceptors | WorkflowClientInterceptor[] {
1651-
if (typeof this.options.interceptors === 'object' && 'calls' in this.options.interceptors) {
1652-
// eslint-disable-next-line deprecation/deprecation
1653-
const factories = (this.options.interceptors as WorkflowClientInterceptors).calls ?? [];
1654-
// Compose factory functions with adapters.
1655-
return {
1656-
calls: factories.map((ctor) => {
1657-
return (input) => adaptWorkflowClientInterceptor(ctor(input));
1658-
}),
1659-
};
1660-
}
1661-
const interceptors = Array.isArray(this.options.interceptors)
1662-
? (this.options.interceptors as WorkflowClientInterceptor[])
1663-
: [];
1664-
return interceptors.map((i) => adaptWorkflowClientInterceptor(i));
1665-
}
1666-
16671649
protected getOrMakeInterceptors(workflowId: string, runId?: string): WorkflowClientInterceptor[] {
16681650
if (typeof this.options.interceptors === 'object' && 'calls' in this.options.interceptors) {
16691651
// eslint-disable-next-line deprecation/deprecation

0 commit comments

Comments
 (0)