UNPKG

@sphereon/ssi-sdk-ext.kms-azure-rest-client

Version:

Sphereon SSI-SDK plugin for Azure KeyVault Key Management System.

32 lines 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IsomorphicFetchHttpLibrary = void 0; const http_1 = require("./http"); const rxjsStub_1 = require("../rxjsStub"); require("whatwg-fetch"); class IsomorphicFetchHttpLibrary { send(request) { let method = request.getHttpMethod().toString(); let body = request.getBody(); const resultPromise = fetch(request.getUrl(), { method: method, body: body, headers: request.getHeaders(), credentials: "same-origin" }).then((resp) => { const headers = {}; resp.headers.forEach((value, name) => { headers[name] = value; }); const body = { text: () => resp.text(), binary: () => resp.blob() }; return new http_1.ResponseContext(resp.status, headers, body); }); return (0, rxjsStub_1.from)(resultPromise); } } exports.IsomorphicFetchHttpLibrary = IsomorphicFetchHttpLibrary; //# sourceMappingURL=isomorphic-fetch.js.map //# sourceMappingURL=isomorphic-fetch.js.map