UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

23 lines 868 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApiKeyAuthentication = void 0; exports.ApiKeyAuthentication = function (credentials, self) { if (!(this instanceof exports.ApiKeyAuthentication)) { return new exports.ApiKeyAuthentication(credentials, self); } else { self.credentials = { apiKey: credentials.apiKey, type: credentials.type }; const ApiKeyAuthentication = function () { }; ApiKeyAuthentication.prototype.getAuthenticationHeaders = async () => { const headers = {}; headers["x-api-key"] = credentials.apiKey || ""; return headers; }; return new ApiKeyAuthentication(credentials, self); } }; exports.default = exports.ApiKeyAuthentication; //# sourceMappingURL=ApiKeyAuthentication.js.map