botframework-connector
Version:
Bot Connector is autorest generated connector client.
35 lines • 1.58 kB
JavaScript
;
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConnectorClientContext = void 0;
const core_http_1 = require("@azure/core-http");
const packageName = "botframework-connector";
const packageVersion = "4.0.0";
class ConnectorClientContext extends core_http_1.ServiceClient {
/**
* Initializes a new instance of the ConnectorClientContext class.
* @param credentials Subscription credentials which uniquely identify client subscription.
* @param [options] The parameter options
*/
constructor(credentials, options) {
if (credentials === null || credentials === undefined) {
throw new Error('\'credentials\' cannot be null.');
}
if (!options) {
// NOTE: autogen creates a {} which is invalid, it needs to be cast
options = {};
}
// TODO This is to workaround fact that AddUserAgent() was removed.
const defaultUserAgent = (0, core_http_1.getDefaultUserAgentValue)();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent} ${options.userAgent || ''}`;
super(credentials, options);
this.baseUri = options.baseUri || this.baseUri || "https://api.botframework.com";
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;
}
}
exports.ConnectorClientContext = ConnectorClientContext;
//# sourceMappingURL=connectorClientContext.js.map