@temporalio/client
Version:
Temporal.io SDK Client sub-package
65 lines • 2.56 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Client = void 0;
const internal_non_workflow_1 = require("@temporalio/common/lib/internal-non-workflow");
const async_completion_client_1 = require("./async-completion-client");
const base_client_1 = require("./base-client");
const schedule_client_1 = require("./schedule-client");
const workflow_client_1 = require("./workflow-client");
const task_queue_client_1 = require("./task-queue-client");
/**
* High level SDK client.
*/
class Client extends base_client_1.BaseClient {
constructor(options) {
super(options);
const { interceptors, workflow, ...commonOptions } = options ?? {};
this.workflow = new workflow_client_1.WorkflowClient({
...commonOptions,
...(workflow ?? {}),
connection: this.connection,
dataConverter: this.dataConverter,
interceptors: interceptors?.workflow,
queryRejectCondition: workflow?.queryRejectCondition,
});
this.activity = new async_completion_client_1.AsyncCompletionClient({
...commonOptions,
connection: this.connection,
dataConverter: this.dataConverter,
});
this.schedule = new schedule_client_1.ScheduleClient({
...commonOptions,
connection: this.connection,
dataConverter: this.dataConverter,
interceptors: interceptors?.schedule,
});
this.taskQueue = new task_queue_client_1.TaskQueueClient({
...commonOptions,
connection: this.connection,
dataConverter: this.dataConverter,
});
this.options = {
...(0, base_client_1.defaultBaseClientOptions)(),
...(0, internal_non_workflow_1.filterNullAndUndefined)(commonOptions),
loadedDataConverter: this.dataConverter,
interceptors: {
workflow: this.workflow.options.interceptors,
schedule: this.schedule.options.interceptors,
},
workflow: {
queryRejectCondition: this.workflow.options.queryRejectCondition,
},
};
}
/**
* Raw gRPC access to the Temporal service.
*
* **NOTE**: The namespace provided in {@link options} is **not** automatically set on requests made via this service
* object.
*/
get workflowService() {
return this.connection.workflowService;
}
}
exports.Client = Client;
//# sourceMappingURL=client.js.map