UNPKG

@temporalio/testing

Version:
39 lines 1.54 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Connection = exports.TestService = void 0; const client_1 = require("@temporalio/client"); const proto_1 = require("@temporalio/proto"); exports.TestService = proto_1.temporal.api.testservice.v1.TestService; /** * A Connection class that can be used to interact with both the test server's TestService and WorkflowService */ class Connection extends client_1.Connection { static createCtorOptions(options) { const ctorOptions = client_1.Connection.createCtorOptions(options); const rpcImpl = this.generateRPCImplementation({ serviceName: 'temporal.api.testservice.v1.TestService', client: ctorOptions.client, callContextStorage: ctorOptions.callContextStorage, interceptors: ctorOptions.options.interceptors, staticMetadata: ctorOptions.options.metadata, apiKeyFnRef: {}, }); const testService = exports.TestService.create(rpcImpl, false, false); return { ...ctorOptions, testService }; } static lazy(options) { const ctorOptions = this.createCtorOptions(options); return new this(ctorOptions); } static async connect(options) { const ret = this.lazy(options); await ret.ensureConnected(); return ret; } constructor(options) { super(options); this.testService = options.testService; } } exports.Connection = Connection; //# sourceMappingURL=connection.js.map