UNPKG

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

Version:

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

1 lines 94.8 kB
{"version":3,"sources":["../src/index.ts","../src/AzureKeyVaultKeyManagementSystemRestClient.ts","../src/js-client/rxjsStub.js","../src/js-client/http/isomorphic-fetch.js","../src/js-client/http/http.js","../src/js-client/auth/auth.js","../src/js-client/models/BinaryData.js","../src/js-client/models/CreateEcKeyRequest.js","../src/js-client/models/JsonWebKey.js","../src/js-client/models/KeyProperties.js","../src/js-client/models/KeyReleasePolicy.js","../src/js-client/models/KeyVaultKey.js","../src/js-client/models/SignPayloadDTO.js","../src/js-client/models/SignPayloadResponse.js","../src/js-client/models/VerifyPayloadDTO.js","../src/js-client/middleware.js","../src/js-client/servers.js","../src/js-client/configuration.js","../src/js-client/apis/exception.js","../src/js-client/apis/baseapi.js","../src/js-client/models/ObjectSerializer.js","../src/js-client/util.js","../src/js-client/apis/KeyVaultControllerApi.js","../src/js-client/types/ObservableAPI.js","../src/js-client/types/PromiseAPI.js"],"sourcesContent":["export { AzureKeyVaultKeyManagementSystemRestClient } from './AzureKeyVaultKeyManagementSystemRestClient'\n\nexport interface KeyMetadata {\n algorithms?: string[]\n\n [x: string]: any\n}\n","import { IKey, ManagedKeyInfo, MinimalImportableKey, TKeyType } from '@veramo/core'\nimport { AbstractKeyManagementSystem } from '@veramo/key-manager'\nimport { KeyMetadata } from './index'\nimport * as AzureRestClient from './js-client'\n// @ts-ignore\nimport * as u8a from 'uint8arrays'\nconst { fromString, toString } = u8a\n\nimport { JsonWebKey } from '@sphereon/ssi-types'\n\ninterface AbstractKeyManagementSystemOptions {\n applicationId: string\n vaultUrl: string\n apiKey: string\n}\n\nexport class AzureKeyVaultKeyManagementSystemRestClient extends AbstractKeyManagementSystem {\n private client: AzureRestClient.KeyVaultControllerApi\n private readonly id: string\n\n constructor(options: AbstractKeyManagementSystemOptions) {\n super()\n\n const config = AzureRestClient.createConfiguration({\n baseServer: new AzureRestClient.ServerConfiguration(options.vaultUrl, {}),\n authMethods: {\n apiKeyScheme: options.apiKey,\n },\n })\n\n this.id = options.applicationId\n this.client = new AzureRestClient.KeyVaultControllerApi(config)\n }\n\n async createKey(args: { type: TKeyType; meta?: KeyMetadata }): Promise<ManagedKeyInfo> {\n const { type, meta } = args\n\n const curveName = this.mapKeyTypeCurveName(type)\n\n const options: AzureRestClient.CreateEcKeyRequest = {\n keyName: meta?.keyAlias.replace(/_/g, '-'),\n curveName,\n operations: meta && 'keyOperations' in meta ? meta.keyOperations : ['sign', 'verify'],\n }\n\n const createKeyResponse = await this.client.createEcKey(options)\n\n return {\n kid: createKeyResponse.name!,\n kms: this.id,\n type,\n meta: {\n alias: createKeyResponse.name!,\n algorithms: [createKeyResponse.key?.curveName ?? 'ES256'],\n kmsKeyRef: createKeyResponse.id!,\n },\n publicKeyHex: this.ecJwkToRawHexKey(createKeyResponse.key as JsonWebKey),\n }\n }\n\n private ecJwkToRawHexKey(jwk: JsonWebKey): string {\n if (!jwk.x || !jwk.y) {\n throw new Error(\"EC JWK must contain 'x' and 'y' properties.\")\n }\n\n // We are converting from base64 to base64url to be sure. The spec uses base64url, but in the wild we sometimes encounter a base64 string\n const x = fromString(jwk.x.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, ''), 'base64url')\n const y = fromString(jwk.y.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, ''), 'base64url')\n\n return '04' + toString(x, 'hex') + toString(y, 'hex')\n }\n\n private mapKeyTypeCurveName = (type: TKeyType) => {\n switch (type) {\n case 'Secp256r1':\n return 'P-256'\n default:\n throw new Error(`Key type ${type} is not supported by AzureKeyVaultKMS`)\n }\n }\n\n keyTypeToDigestAlgorithm = (type: TKeyType): 'sha256' | 'sha512' => {\n switch (type) {\n case 'Secp256r1':\n return 'sha256'\n default:\n throw new Error(`Key type ${type} is not supported by AzureKeyVaultKMS`)\n }\n }\n\n async sign(args: { keyRef: Pick<IKey, 'kid'>; data: Uint8Array; [x: string]: any }): Promise<string> {\n if (!args.keyRef) {\n throw new Error('key_not_found: No key ref provided')\n }\n const signResponse = await this.client.signPayload({\n keyName: args.keyRef.kid,\n payload: toString(args.data),\n })\n return signResponse.signature\n }\n\n async verify(args: { keyRef: Pick<IKey, 'kid'>; data: Uint8Array; signature: string; [x: string]: any }): Promise<Boolean> {\n if (!args.keyRef) {\n throw new Error('key_not_found: No key ref provided')\n }\n\n return await this.client.verifyPayload({\n keyName: args.keyRef.kid,\n signature: args.signature,\n payload: new TextDecoder().decode(args.data),\n })\n }\n\n sharedSecret(args: { myKeyRef: Pick<IKey, 'kid'>; theirKey: Pick<IKey, 'publicKeyHex' | 'type'> }): Promise<string> {\n throw new Error('sharedSecret is not implemented for AzureKeyVaultKMS.')\n }\n\n async importKey(args: Omit<MinimalImportableKey, 'kms'> & { privateKeyPEM?: string }): Promise<ManagedKeyInfo> {\n throw new Error('importKey is not implemented for AzureKeyVaultKMS.')\n }\n\n async deleteKey({ kid }: { kid: string }): Promise<boolean> {\n throw new Error('deleteKey is not implemented for AzureKeyVaultKMS.')\n }\n\n async listKeys(): Promise<ManagedKeyInfo[]> {\n throw new Error('listKeys is not implemented for AzureKeyVaultKMS.')\n }\n}\n","export class Observable {\n constructor(promise) {\n this.promise = promise\n }\n toPromise() {\n return this.promise\n }\n pipe(callback) {\n return new Observable(this.promise.then(callback))\n }\n}\nexport function from(promise) {\n return new Observable(promise)\n}\nexport function of(value) {\n return new Observable(Promise.resolve(value))\n}\nexport function mergeMap(callback) {\n return (value) => callback(value).toPromise()\n}\nexport function map(callback) {\n return callback\n}\n//# sourceMappingURL=rxjsStub.js.map\n","import { ResponseContext } from './http'\nimport { from } from '../rxjsStub'\nimport 'whatwg-fetch'\nexport class IsomorphicFetchHttpLibrary {\n send(request) {\n let method = request.getHttpMethod().toString()\n let body = request.getBody()\n const resultPromise = fetch(request.getUrl(), {\n method: method,\n body: body,\n headers: request.getHeaders(),\n credentials: 'same-origin',\n }).then((resp) => {\n const headers = {}\n resp.headers.forEach((value, name) => {\n headers[name] = value\n })\n const body = {\n text: () => resp.text(),\n binary: () => resp.blob(),\n }\n return new ResponseContext(resp.status, headers, body)\n })\n return from(resultPromise)\n }\n}\n//# sourceMappingURL=isomorphic-fetch.js.map\n","var __awaiter =\n (this && this.__awaiter) ||\n function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P\n ? value\n : new P(function (resolve) {\n resolve(value)\n })\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value))\n } catch (e) {\n reject(e)\n }\n }\n function rejected(value) {\n try {\n step(generator['throw'](value))\n } catch (e) {\n reject(e)\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected)\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next())\n })\n }\nimport { from } from '../rxjsStub'\nexport * from './isomorphic-fetch'\nexport var HttpMethod\n;(function (HttpMethod) {\n HttpMethod['GET'] = 'GET'\n HttpMethod['HEAD'] = 'HEAD'\n HttpMethod['POST'] = 'POST'\n HttpMethod['PUT'] = 'PUT'\n HttpMethod['DELETE'] = 'DELETE'\n HttpMethod['CONNECT'] = 'CONNECT'\n HttpMethod['OPTIONS'] = 'OPTIONS'\n HttpMethod['TRACE'] = 'TRACE'\n HttpMethod['PATCH'] = 'PATCH'\n})(HttpMethod || (HttpMethod = {}))\nexport class HttpException extends Error {\n constructor(msg) {\n super(msg)\n }\n}\nfunction ensureAbsoluteUrl(url) {\n if (url.startsWith('http://') || url.startsWith('https://')) {\n return url\n }\n return window.location.origin + url\n}\nexport class RequestContext {\n constructor(url, httpMethod) {\n this.httpMethod = httpMethod\n this.headers = {}\n this.body = undefined\n this.url = new URL(ensureAbsoluteUrl(url))\n }\n getUrl() {\n return this.url.toString().endsWith('/') ? this.url.toString().slice(0, -1) : this.url.toString()\n }\n setUrl(url) {\n this.url = new URL(ensureAbsoluteUrl(url))\n }\n setBody(body) {\n this.body = body\n }\n getHttpMethod() {\n return this.httpMethod\n }\n getHeaders() {\n return this.headers\n }\n getBody() {\n return this.body\n }\n setQueryParam(name, value) {\n this.url.searchParams.set(name, value)\n }\n appendQueryParam(name, value) {\n this.url.searchParams.append(name, value)\n }\n addCookie(name, value) {\n if (!this.headers['Cookie']) {\n this.headers['Cookie'] = ''\n }\n this.headers['Cookie'] += name + '=' + value + '; '\n }\n setHeaderParam(key, value) {\n this.headers[key] = value\n }\n}\nexport class SelfDecodingBody {\n constructor(dataSource) {\n this.dataSource = dataSource\n }\n binary() {\n return this.dataSource\n }\n text() {\n return __awaiter(this, void 0, void 0, function* () {\n const data = yield this.dataSource\n if (data.text) {\n return data.text()\n }\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.addEventListener('load', () => resolve(reader.result))\n reader.addEventListener('error', () => reject(reader.error))\n reader.readAsText(data)\n })\n })\n }\n}\nexport class ResponseContext {\n constructor(httpStatusCode, headers, body) {\n this.httpStatusCode = httpStatusCode\n this.headers = headers\n this.body = body\n }\n getParsedHeader(headerName) {\n const result = {}\n if (!this.headers[headerName]) {\n return result\n }\n const parameters = this.headers[headerName].split(';')\n for (const parameter of parameters) {\n let [key, value] = parameter.split('=', 2)\n if (!key) {\n continue\n }\n key = key.toLowerCase().trim()\n if (value === undefined) {\n result[''] = key\n } else {\n value = value.trim()\n if (value.startsWith('\"') && value.endsWith('\"')) {\n value = value.substring(1, value.length - 1)\n }\n result[key] = value\n }\n }\n return result\n }\n getBodyAsFile() {\n return __awaiter(this, void 0, void 0, function* () {\n const data = yield this.body.binary()\n const fileName = this.getParsedHeader('content-disposition')['filename'] || ''\n const contentType = this.headers['content-type'] || ''\n try {\n return new File([data], fileName, { type: contentType })\n } catch (error) {\n return Object.assign(data, {\n name: fileName,\n type: contentType,\n })\n }\n })\n }\n getBodyAsAny() {\n try {\n return this.body.text()\n } catch (_a) {}\n try {\n return this.body.binary()\n } catch (_b) {}\n return Promise.resolve(undefined)\n }\n}\nexport function wrapHttpLibrary(promiseHttpLibrary) {\n return {\n send(request) {\n return from(promiseHttpLibrary.send(request))\n },\n }\n}\nexport class HttpInfo extends ResponseContext {\n constructor(httpStatusCode, headers, body, data) {\n super(httpStatusCode, headers, body)\n this.data = data\n }\n}\n//# sourceMappingURL=http.js.map\n","export class ApiKeySchemeAuthentication {\n constructor(apiKey) {\n this.apiKey = apiKey\n }\n getName() {\n return 'apiKeyScheme'\n }\n applySecurityAuthentication(context) {\n context.setHeaderParam('X-API-KEY', this.apiKey)\n }\n}\nexport function configureAuthMethods(config) {\n let authMethods = {}\n if (!config) {\n return authMethods\n }\n authMethods['default'] = config['default']\n if (config['apiKeyScheme']) {\n authMethods['apiKeyScheme'] = new ApiKeySchemeAuthentication(config['apiKeyScheme'])\n }\n return authMethods\n}\n//# sourceMappingURL=auth.js.map\n","export class BinaryData {\n static getAttributeTypeMap() {\n return BinaryData.attributeTypeMap\n }\n constructor() {}\n}\nBinaryData.discriminator = undefined\nBinaryData.mapping = undefined\nBinaryData.attributeTypeMap = [\n {\n name: 'length',\n baseName: 'length',\n type: 'number',\n format: 'int64',\n },\n {\n name: 'replayable',\n baseName: 'replayable',\n type: 'boolean',\n format: '',\n },\n]\n//# sourceMappingURL=BinaryData.js.map\n","export class CreateEcKeyRequest {\n static getAttributeTypeMap() {\n return CreateEcKeyRequest.attributeTypeMap\n }\n constructor() {}\n}\nCreateEcKeyRequest.discriminator = undefined\nCreateEcKeyRequest.mapping = undefined\nCreateEcKeyRequest.attributeTypeMap = [\n {\n name: 'keyName',\n baseName: 'keyName',\n type: 'string',\n format: '',\n },\n {\n name: 'curveName',\n baseName: 'curveName',\n type: 'string',\n format: '',\n },\n {\n name: 'operations',\n baseName: 'operations',\n type: 'Array<string>',\n format: '',\n },\n]\n//# sourceMappingURL=CreateEcKeyRequest.js.map\n","export class JsonWebKey {\n static getAttributeTypeMap() {\n return JsonWebKey.attributeTypeMap\n }\n constructor() {}\n}\nJsonWebKey.discriminator = undefined\nJsonWebKey.mapping = undefined\nJsonWebKey.attributeTypeMap = [\n {\n name: 'keyType',\n baseName: 'keyType',\n type: 'string',\n format: '',\n },\n {\n name: 'keyOps',\n baseName: 'keyOps',\n type: 'Array<string>',\n format: '',\n },\n {\n name: 'n',\n baseName: 'n',\n type: 'string',\n format: 'byte',\n },\n {\n name: 'e',\n baseName: 'e',\n type: 'string',\n format: 'byte',\n },\n {\n name: 'd',\n baseName: 'd',\n type: 'string',\n format: 'byte',\n },\n {\n name: 'dp',\n baseName: 'dp',\n type: 'string',\n format: 'byte',\n },\n {\n name: 'dq',\n baseName: 'dq',\n type: 'string',\n format: 'byte',\n },\n {\n name: 'qi',\n baseName: 'qi',\n type: 'string',\n format: 'byte',\n },\n {\n name: 'p',\n baseName: 'p',\n type: 'string',\n format: 'byte',\n },\n {\n name: 'q',\n baseName: 'q',\n type: 'string',\n format: 'byte',\n },\n {\n name: 'k',\n baseName: 'k',\n type: 'string',\n format: 'byte',\n },\n {\n name: 't',\n baseName: 't',\n type: 'string',\n format: 'byte',\n },\n {\n name: 'x',\n baseName: 'x',\n type: 'string',\n format: 'byte',\n },\n {\n name: 'y',\n baseName: 'y',\n type: 'string',\n format: 'byte',\n },\n {\n name: 'id',\n baseName: 'id',\n type: 'string',\n format: '',\n },\n {\n name: 'valid',\n baseName: 'valid',\n type: 'boolean',\n format: '',\n },\n {\n name: 'curveName',\n baseName: 'curveName',\n type: 'string',\n format: '',\n },\n]\n//# sourceMappingURL=JsonWebKey.js.map\n","export class KeyProperties {\n static getAttributeTypeMap() {\n return KeyProperties.attributeTypeMap\n }\n constructor() {}\n}\nKeyProperties.discriminator = undefined\nKeyProperties.mapping = undefined\nKeyProperties.attributeTypeMap = [\n {\n name: 'enabled',\n baseName: 'enabled',\n type: 'boolean',\n format: '',\n },\n {\n name: 'exportable',\n baseName: 'exportable',\n type: 'boolean',\n format: '',\n },\n {\n name: 'notBefore',\n baseName: 'notBefore',\n type: 'Date',\n format: 'date-time',\n },\n {\n name: 'version',\n baseName: 'version',\n type: 'string',\n format: '',\n },\n {\n name: 'expiresOn',\n baseName: 'expiresOn',\n type: 'Date',\n format: 'date-time',\n },\n {\n name: 'createdOn',\n baseName: 'createdOn',\n type: 'Date',\n format: 'date-time',\n },\n {\n name: 'updatedOn',\n baseName: 'updatedOn',\n type: 'Date',\n format: 'date-time',\n },\n {\n name: 'recoveryLevel',\n baseName: 'recoveryLevel',\n type: 'string',\n format: '',\n },\n {\n name: 'name',\n baseName: 'name',\n type: 'string',\n format: '',\n },\n {\n name: 'id',\n baseName: 'id',\n type: 'string',\n format: '',\n },\n {\n name: 'tags',\n baseName: 'tags',\n type: '{ [key: string]: string; }',\n format: '',\n },\n {\n name: 'managed',\n baseName: 'managed',\n type: 'boolean',\n format: '',\n },\n {\n name: 'recoverableDays',\n baseName: 'recoverableDays',\n type: 'number',\n format: 'int32',\n },\n {\n name: 'releasePolicy',\n baseName: 'releasePolicy',\n type: 'KeyReleasePolicy',\n format: '',\n },\n {\n name: 'hsmPlatform',\n baseName: 'hsmPlatform',\n type: 'string',\n format: '',\n },\n]\n//# sourceMappingURL=KeyProperties.js.map\n","export class KeyReleasePolicy {\n static getAttributeTypeMap() {\n return KeyReleasePolicy.attributeTypeMap\n }\n constructor() {}\n}\nKeyReleasePolicy.discriminator = undefined\nKeyReleasePolicy.mapping = undefined\nKeyReleasePolicy.attributeTypeMap = [\n {\n name: 'encodedPolicy',\n baseName: 'encodedPolicy',\n type: 'BinaryData',\n format: '',\n },\n {\n name: 'contentType',\n baseName: 'contentType',\n type: 'string',\n format: '',\n },\n {\n name: 'immutable',\n baseName: 'immutable',\n type: 'boolean',\n format: '',\n },\n]\n//# sourceMappingURL=KeyReleasePolicy.js.map\n","export class KeyVaultKey {\n static getAttributeTypeMap() {\n return KeyVaultKey.attributeTypeMap\n }\n constructor() {}\n}\nKeyVaultKey.discriminator = undefined\nKeyVaultKey.mapping = undefined\nKeyVaultKey.attributeTypeMap = [\n {\n name: 'key',\n baseName: 'key',\n type: 'JsonWebKey',\n format: '',\n },\n {\n name: 'properties',\n baseName: 'properties',\n type: 'KeyProperties',\n format: '',\n },\n {\n name: 'name',\n baseName: 'name',\n type: 'string',\n format: '',\n },\n {\n name: 'id',\n baseName: 'id',\n type: 'string',\n format: '',\n },\n {\n name: 'keyType',\n baseName: 'keyType',\n type: 'string',\n format: '',\n },\n {\n name: 'keyOperations',\n baseName: 'keyOperations',\n type: 'Array<string>',\n format: '',\n },\n]\n//# sourceMappingURL=KeyVaultKey.js.map\n","export class SignPayloadDTO {\n static getAttributeTypeMap() {\n return SignPayloadDTO.attributeTypeMap\n }\n constructor() {}\n}\nSignPayloadDTO.discriminator = undefined\nSignPayloadDTO.mapping = undefined\nSignPayloadDTO.attributeTypeMap = [\n {\n name: 'keyName',\n baseName: 'keyName',\n type: 'string',\n format: '',\n },\n {\n name: 'payload',\n baseName: 'payload',\n type: 'string',\n format: '',\n },\n]\n//# sourceMappingURL=SignPayloadDTO.js.map\n","export class SignPayloadResponse {\n static getAttributeTypeMap() {\n return SignPayloadResponse.attributeTypeMap\n }\n constructor() {}\n}\nSignPayloadResponse.discriminator = undefined\nSignPayloadResponse.mapping = undefined\nSignPayloadResponse.attributeTypeMap = [\n {\n name: 'signature',\n baseName: 'signature',\n type: 'string',\n format: '',\n },\n]\n//# sourceMappingURL=SignPayloadResponse.js.map\n","export class VerifyPayloadDTO {\n static getAttributeTypeMap() {\n return VerifyPayloadDTO.attributeTypeMap\n }\n constructor() {}\n}\nVerifyPayloadDTO.discriminator = undefined\nVerifyPayloadDTO.mapping = undefined\nVerifyPayloadDTO.attributeTypeMap = [\n {\n name: 'keyName',\n baseName: 'keyName',\n type: 'string',\n format: '',\n },\n {\n name: 'payload',\n baseName: 'payload',\n type: 'string',\n format: '',\n },\n {\n name: 'signature',\n baseName: 'signature',\n type: 'string',\n format: '',\n },\n]\n//# sourceMappingURL=VerifyPayloadDTO.js.map\n","import { from } from './rxjsStub'\nexport class PromiseMiddlewareWrapper {\n constructor(middleware) {\n this.middleware = middleware\n }\n pre(context) {\n return from(this.middleware.pre(context))\n }\n post(context) {\n return from(this.middleware.post(context))\n }\n}\n//# sourceMappingURL=middleware.js.map\n","import { RequestContext } from './http/http'\nexport class ServerConfiguration {\n constructor(url, variableConfiguration) {\n this.url = url\n this.variableConfiguration = variableConfiguration\n }\n setVariables(variableConfiguration) {\n Object.assign(this.variableConfiguration, variableConfiguration)\n }\n getConfiguration() {\n return this.variableConfiguration\n }\n getUrl() {\n let replacedUrl = this.url\n for (const [key, value] of Object.entries(this.variableConfiguration)) {\n replacedUrl = replacedUrl.replaceAll(`{${key}}`, value)\n }\n return replacedUrl\n }\n makeRequestContext(endpoint, httpMethod) {\n return new RequestContext(this.getUrl() + endpoint, httpMethod)\n }\n}\nexport const server1 = new ServerConfiguration('http://localhost:8080', {})\nexport const servers = [server1]\n//# sourceMappingURL=servers.js.map\n","import { PromiseMiddlewareWrapper } from './middleware'\nimport { IsomorphicFetchHttpLibrary as DefaultHttpLibrary } from './http/isomorphic-fetch'\nimport { server1 } from './servers'\nimport { configureAuthMethods } from './auth/auth'\nexport function createConfiguration(conf = {}) {\n const configuration = {\n baseServer: conf.baseServer !== undefined ? conf.baseServer : server1,\n httpApi: conf.httpApi || new DefaultHttpLibrary(),\n middleware: conf.middleware || [],\n authMethods: configureAuthMethods(conf.authMethods),\n }\n if (conf.promiseMiddleware) {\n conf.promiseMiddleware.forEach((m) => configuration.middleware.push(new PromiseMiddlewareWrapper(m)))\n }\n return configuration\n}\n//# sourceMappingURL=configuration.js.map\n","export class ApiException extends Error {\n constructor(code, message, body, headers) {\n super('HTTP-Code: ' + code + '\\nMessage: ' + message + '\\nBody: ' + JSON.stringify(body) + '\\nHeaders: ' + JSON.stringify(headers))\n this.code = code\n this.body = body\n this.headers = headers\n }\n}\n//# sourceMappingURL=exception.js.map\n","export const COLLECTION_FORMATS = {\n csv: ',',\n ssv: ' ',\n tsv: '\\t',\n pipes: '|',\n}\nexport class BaseAPIRequestFactory {\n constructor(configuration) {\n this.configuration = configuration\n }\n}\nexport class RequiredError extends Error {\n constructor(api, method, field) {\n super('Required parameter ' + field + ' was null or undefined when calling ' + api + '.' + method + '.')\n this.api = api\n this.method = method\n this.field = field\n this.name = 'RequiredError'\n }\n}\n//# sourceMappingURL=baseapi.js.map\n","export * from '../models/BinaryData'\nexport * from '../models/CreateEcKeyRequest'\nexport * from '../models/JsonWebKey'\nexport * from '../models/KeyProperties'\nexport * from '../models/KeyReleasePolicy'\nexport * from '../models/KeyVaultKey'\nexport * from '../models/SignPayloadDTO'\nexport * from '../models/SignPayloadResponse'\nexport * from '../models/VerifyPayloadDTO'\nimport { BinaryData } from '../models/BinaryData'\nimport { CreateEcKeyRequest } from '../models/CreateEcKeyRequest'\nimport { JsonWebKey } from '../models/JsonWebKey'\nimport { KeyProperties } from '../models/KeyProperties'\nimport { KeyReleasePolicy } from '../models/KeyReleasePolicy'\nimport { KeyVaultKey } from '../models/KeyVaultKey'\nimport { SignPayloadDTO } from '../models/SignPayloadDTO'\nimport { SignPayloadResponse } from '../models/SignPayloadResponse'\nimport { VerifyPayloadDTO } from '../models/VerifyPayloadDTO'\nlet primitives = ['string', 'boolean', 'double', 'integer', 'long', 'float', 'number', 'any']\nlet enumsMap = new Set([])\nlet typeMap = {\n BinaryData: BinaryData,\n CreateEcKeyRequest: CreateEcKeyRequest,\n JsonWebKey: JsonWebKey,\n KeyProperties: KeyProperties,\n KeyReleasePolicy: KeyReleasePolicy,\n KeyVaultKey: KeyVaultKey,\n SignPayloadDTO: SignPayloadDTO,\n SignPayloadResponse: SignPayloadResponse,\n VerifyPayloadDTO: VerifyPayloadDTO,\n}\nconst parseMimeType = (mimeType) => {\n const [type = '', subtype = ''] = mimeType.split('/')\n return {\n type,\n subtype,\n subtypeTokens: subtype.split('+'),\n }\n}\nconst mimeTypePredicateFactory = (predicate) => (mimeType) => predicate(parseMimeType(mimeType))\nconst mimeTypeSimplePredicateFactory = (type, subtype) =>\n mimeTypePredicateFactory((descriptor) => {\n if (descriptor.type !== type) return false\n if (subtype != null && descriptor.subtype !== subtype) return false\n return true\n })\nconst isTextLikeMimeType = mimeTypeSimplePredicateFactory('text')\nconst isJsonMimeType = mimeTypeSimplePredicateFactory('application', 'json')\nconst isJsonLikeMimeType = mimeTypePredicateFactory(\n (descriptor) => descriptor.type === 'application' && descriptor.subtypeTokens.some((item) => item === 'json'),\n)\nconst isOctetStreamMimeType = mimeTypeSimplePredicateFactory('application', 'octet-stream')\nconst isFormUrlencodedMimeType = mimeTypeSimplePredicateFactory('application', 'x-www-form-urlencoded')\nconst supportedMimeTypePredicatesWithPriority = [\n isJsonMimeType,\n isJsonLikeMimeType,\n isTextLikeMimeType,\n isOctetStreamMimeType,\n isFormUrlencodedMimeType,\n]\nconst nullableSuffix = ' | null'\nconst optionalSuffix = ' | undefined'\nconst arrayPrefix = 'Array<'\nconst arraySuffix = '>'\nconst mapPrefix = '{ [key: string]: '\nconst mapSuffix = '; }'\nexport class ObjectSerializer {\n static findCorrectType(data, expectedType) {\n if (data == undefined) {\n return expectedType\n } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {\n return expectedType\n } else if (expectedType === 'Date') {\n return expectedType\n } else {\n if (enumsMap.has(expectedType)) {\n return expectedType\n }\n if (!typeMap[expectedType]) {\n return expectedType\n }\n let discriminatorProperty = typeMap[expectedType].discriminator\n if (discriminatorProperty == null) {\n return expectedType\n } else {\n if (data[discriminatorProperty]) {\n var discriminatorType = data[discriminatorProperty]\n let mapping = typeMap[expectedType].mapping\n if (mapping != undefined && mapping[discriminatorType]) {\n return mapping[discriminatorType]\n } else if (typeMap[discriminatorType]) {\n return discriminatorType\n } else {\n return expectedType\n }\n } else {\n return expectedType\n }\n }\n }\n }\n static serialize(data, type, format) {\n if (data == undefined) {\n return data\n } else if (primitives.indexOf(type.toLowerCase()) !== -1) {\n return data\n } else if (type.endsWith(nullableSuffix)) {\n let subType = type.slice(0, -nullableSuffix.length)\n return ObjectSerializer.serialize(data, subType, format)\n } else if (type.endsWith(optionalSuffix)) {\n let subType = type.slice(0, -optionalSuffix.length)\n return ObjectSerializer.serialize(data, subType, format)\n } else if (type.startsWith(arrayPrefix)) {\n let subType = type.slice(arrayPrefix.length, -arraySuffix.length)\n let transformedData = []\n for (let date of data) {\n transformedData.push(ObjectSerializer.serialize(date, subType, format))\n }\n return transformedData\n } else if (type.startsWith(mapPrefix)) {\n let subType = type.slice(mapPrefix.length, -mapSuffix.length)\n let transformedData = {}\n for (let key in data) {\n transformedData[key] = ObjectSerializer.serialize(data[key], subType, format)\n }\n return transformedData\n } else if (type === 'Date') {\n if (format == 'date') {\n let month = data.getMonth() + 1\n month = month < 10 ? '0' + month.toString() : month.toString()\n let day = data.getDate()\n day = day < 10 ? '0' + day.toString() : day.toString()\n return data.getFullYear() + '-' + month + '-' + day\n } else {\n return data.toISOString()\n }\n } else {\n if (enumsMap.has(type)) {\n return data\n }\n if (!typeMap[type]) {\n return data\n }\n type = this.findCorrectType(data, type)\n let attributeTypes = typeMap[type].getAttributeTypeMap()\n let instance = {}\n for (let attributeType of attributeTypes) {\n instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type, attributeType.format)\n }\n return instance\n }\n }\n static deserialize(data, type, format) {\n type = ObjectSerializer.findCorrectType(data, type)\n if (data == undefined) {\n return data\n } else if (primitives.indexOf(type.toLowerCase()) !== -1) {\n return data\n } else if (type.endsWith(nullableSuffix)) {\n let subType = type.slice(0, -nullableSuffix.length)\n return ObjectSerializer.deserialize(data, subType, format)\n } else if (type.endsWith(optionalSuffix)) {\n let subType = type.slice(0, -optionalSuffix.length)\n return ObjectSerializer.deserialize(data, subType, format)\n } else if (type.startsWith(arrayPrefix)) {\n let subType = type.slice(arrayPrefix.length, -arraySuffix.length)\n let transformedData = []\n for (let date of data) {\n transformedData.push(ObjectSerializer.deserialize(date, subType, format))\n }\n return transformedData\n } else if (type.startsWith(mapPrefix)) {\n let subType = type.slice(mapPrefix.length, -mapSuffix.length)\n let transformedData = {}\n for (let key in data) {\n transformedData[key] = ObjectSerializer.deserialize(data[key], subType, format)\n }\n return transformedData\n } else if (type === 'Date') {\n return new Date(data)\n } else {\n if (enumsMap.has(type)) {\n return data\n }\n if (!typeMap[type]) {\n return data\n }\n let instance = new typeMap[type]()\n let attributeTypes = typeMap[type].getAttributeTypeMap()\n for (let attributeType of attributeTypes) {\n let value = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type, attributeType.format)\n if (value !== undefined) {\n instance[attributeType.name] = value\n }\n }\n return instance\n }\n }\n static normalizeMediaType(mediaType) {\n var _a\n if (mediaType === undefined) {\n return undefined\n }\n return ((_a = mediaType.split(';')[0]) !== null && _a !== void 0 ? _a : '').trim().toLowerCase()\n }\n static getPreferredMediaType(mediaTypes) {\n if (mediaTypes.length === 0) {\n return 'application/json'\n }\n const normalMediaTypes = mediaTypes.map(this.normalizeMediaType)\n for (const predicate of supportedMimeTypePredicatesWithPriority) {\n for (const mediaType of normalMediaTypes) {\n if (mediaType != null && predicate(mediaType)) {\n return mediaType\n }\n }\n }\n throw new Error('None of the given media types are supported: ' + mediaTypes.join(', '))\n }\n static stringify(data, mediaType) {\n if (isTextLikeMimeType(mediaType)) {\n return String(data)\n }\n if (isJsonLikeMimeType(mediaType)) {\n return JSON.stringify(data)\n }\n throw new Error('The mediaType ' + mediaType + ' is not supported by ObjectSerializer.stringify.')\n }\n static parse(rawData, mediaType) {\n if (mediaType === undefined) {\n throw new Error('Cannot parse content. No Content-Type defined.')\n }\n if (isTextLikeMimeType(mediaType)) {\n return rawData\n }\n if (isJsonLikeMimeType(mediaType)) {\n return JSON.parse(rawData)\n }\n throw new Error('The mediaType ' + mediaType + ' is not supported by ObjectSerializer.parse.')\n }\n}\n//# sourceMappingURL=ObjectSerializer.js.map\n","export function isCodeInRange(codeRange, code) {\n if (codeRange === '0') {\n return true\n }\n if (codeRange == code.toString()) {\n return true\n } else {\n const codeString = code.toString()\n if (codeString.length != codeRange.length) {\n return false\n }\n for (let i = 0; i < codeString.length; i++) {\n if (codeRange.charAt(i) != 'X' && codeRange.charAt(i) != codeString.charAt(i)) {\n return false\n }\n }\n return true\n }\n}\nexport function canConsumeForm(contentTypes) {\n return contentTypes.indexOf('multipart/form-data') !== -1\n}\n//# sourceMappingURL=util.js.map\n","var __awaiter =\n (this && this.__awaiter) ||\n function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P\n ? value\n : new P(function (resolve) {\n resolve(value)\n })\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value))\n } catch (e) {\n reject(e)\n }\n }\n function rejected(value) {\n try {\n step(generator['throw'](value))\n } catch (e) {\n reject(e)\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected)\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next())\n })\n }\nimport { BaseAPIRequestFactory, RequiredError } from './baseapi'\nimport { HttpMethod, HttpInfo } from '../http/http'\nimport { ObjectSerializer } from '../models/ObjectSerializer'\nimport { ApiException } from './exception'\nimport { isCodeInRange } from '../util'\nexport class KeyVaultControllerApiRequestFactory extends BaseAPIRequestFactory {\n createEcKey(createEcKeyRequest, _options) {\n var _a, _b, _c\n return __awaiter(this, void 0, void 0, function* () {\n let _config = _options || this.configuration\n if (createEcKeyRequest === null || createEcKeyRequest === undefined) {\n throw new RequiredError('KeyVaultControllerApi', 'createEcKey', 'createEcKeyRequest')\n }\n const localVarPath = '/api/keys/create-ec-key'\n const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST)\n requestContext.setHeaderParam('Accept', 'application/json, */*;q=0.8')\n const contentType = ObjectSerializer.getPreferredMediaType(['application/json'])\n requestContext.setHeaderParam('Content-Type', contentType)\n const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(createEcKeyRequest, 'CreateEcKeyRequest', ''), contentType)\n requestContext.setBody(serializedBody)\n let authMethod\n authMethod = _config.authMethods['apiKeyScheme']\n if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {\n yield authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)\n }\n const defaultAuth =\n ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) ||\n ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default)\n if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {\n yield defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)\n }\n return requestContext\n })\n }\n getKey(keyName, _options) {\n var _a, _b, _c\n return __awaiter(this, void 0, void 0, function* () {\n let _config = _options || this.configuration\n if (keyName === null || keyName === undefined) {\n throw new RequiredError('KeyVaultControllerApi', 'getKey', 'keyName')\n }\n const localVarPath = '/api/keys/{keyName}'.replace('{' + 'keyName' + '}', encodeURIComponent(String(keyName)))\n const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET)\n requestContext.setHeaderParam('Accept', 'application/json, */*;q=0.8')\n let authMethod\n authMethod = _config.authMethods['apiKeyScheme']\n if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {\n yield authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)\n }\n const defaultAuth =\n ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) ||\n ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default)\n if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {\n yield defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)\n }\n return requestContext\n })\n }\n signPayload(signPayloadDTO, _options) {\n var _a, _b, _c\n return __awaiter(this, void 0, void 0, function* () {\n let _config = _options || this.configuration\n if (signPayloadDTO === null || signPayloadDTO === undefined) {\n throw new RequiredError('KeyVaultControllerApi', 'signPayload', 'signPayloadDTO')\n }\n const localVarPath = '/api/keys/sign'\n const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST)\n requestContext.setHeaderParam('Accept', 'application/json, */*;q=0.8')\n const contentType = ObjectSerializer.getPreferredMediaType(['application/json'])\n requestContext.setHeaderParam('Content-Type', contentType)\n const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(signPayloadDTO, 'SignPayloadDTO', ''), contentType)\n requestContext.setBody(serializedBody)\n let authMethod\n authMethod = _config.authMethods['apiKeyScheme']\n if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {\n yield authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)\n }\n const defaultAuth =\n ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) ||\n ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default)\n if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {\n yield defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)\n }\n return requestContext\n })\n }\n verifyPayload(verifyPayloadDTO, _options) {\n var _a, _b, _c\n return __awaiter(this, void 0, void 0, function* () {\n let _config = _options || this.configuration\n if (verifyPayloadDTO === null || verifyPayloadDTO === undefined) {\n throw new RequiredError('KeyVaultControllerApi', 'verifyPayload', 'verifyPayloadDTO')\n }\n const localVarPath = '/api/keys/verify'\n const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST)\n requestContext.setHeaderParam('Accept', 'application/json, */*;q=0.8')\n const contentType = ObjectSerializer.getPreferredMediaType(['application/json'])\n requestContext.setHeaderParam('Content-Type', contentType)\n const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(verifyPayloadDTO, 'VerifyPayloadDTO', ''), contentType)\n requestContext.setBody(serializedBody)\n let authMethod\n authMethod = _config.authMethods['apiKeyScheme']\n if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {\n yield authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)\n }\n const defaultAuth =\n ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) ||\n ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default)\n if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {\n yield defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)\n }\n return requestContext\n })\n }\n}\nexport class KeyVaultControllerApiResponseProcessor {\n createEcKeyWithHttpInfo(response) {\n return __awaiter(this, void 0, void 0, function* () {\n const contentType = ObjectSerializer.normalizeMediaType(response.headers['content-type'])\n if (isCodeInRange('201', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'KeyVaultKey', '')\n return new HttpInfo(response.httpStatusCode, response.headers, response.body, body)\n }\n if (isCodeInRange('400', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'KeyVaultKey', '')\n throw new ApiException(response.httpStatusCode, 'Invalid input parameters', body, response.headers)\n }\n if (isCodeInRange('500', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'KeyVaultKey', '')\n throw new ApiException(response.httpStatusCode, 'Unexpected error during key creation', body, response.headers)\n }\n if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'KeyVaultKey', '')\n return new HttpInfo(response.httpStatusCode, response.headers, response.body, body)\n }\n throw new ApiException(response.httpStatusCode, 'Unknown API Status Code!', yield response.getBodyAsAny(), response.headers)\n })\n }\n getKeyWithHttpInfo(response) {\n return __awaiter(this, void 0, void 0, function* () {\n const contentType = ObjectSerializer.normalizeMediaType(response.headers['content-type'])\n if (isCodeInRange('200', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'KeyVaultKey', '')\n return new HttpInfo(response.httpStatusCode, response.headers, response.body, body)\n }\n if (isCodeInRange('404', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'KeyVaultKey', '')\n throw new ApiException(response.httpStatusCode, 'Key not found', body, response.headers)\n }\n if (isCodeInRange('500', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'KeyVaultKey', '')\n throw new ApiException(response.httpStatusCode, 'Unexpected error during key retrieval', body, response.headers)\n }\n if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'KeyVaultKey', '')\n return new HttpInfo(response.httpStatusCode, response.headers, response.body, body)\n }\n throw new ApiException(response.httpStatusCode, 'Unknown API Status Code!', yield response.getBodyAsAny(), response.headers)\n })\n }\n signPayloadWithHttpInfo(response) {\n return __awaiter(this, void 0, void 0, function* () {\n const contentType = ObjectSerializer.normalizeMediaType(response.headers['content-type'])\n if (isCodeInRange('200', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'SignPayloadResponse', '')\n return new HttpInfo(response.httpStatusCode, response.headers, response.body, body)\n }\n if (isCodeInRange('400', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'SignPayloadResponse', '')\n throw new ApiException(response.httpStatusCode, 'Invalid input parameters', body, response.headers)\n }\n if (isCodeInRange('404', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'SignPayloadResponse', '')\n throw new ApiException(response.httpStatusCode, 'Key not found', body, response.headers)\n }\n if (isCodeInRange('500', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'SignPayloadResponse', '')\n throw new ApiException(response.httpStatusCode, 'Unexpected error during signing', body, response.headers)\n }\n if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'SignPayloadResponse', '')\n return new HttpInfo(response.httpStatusCode, response.headers, response.body, body)\n }\n throw new ApiException(response.httpStatusCode, 'Unknown API Status Code!', yield response.getBodyAsAny(), response.headers)\n })\n }\n verifyPayloadWithHttpInfo(response) {\n return __awaiter(this, void 0, void 0, function* () {\n const contentType = ObjectSerializer.normalizeMediaType(response.headers['content-type'])\n if (isCodeInRange('200', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'boolean', '')\n return new HttpInfo(response.httpStatusCode, response.headers, response.body, body)\n }\n if (isCodeInRange('400', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'boolean', '')\n throw new ApiException(response.httpStatusCode, 'Invalid input parameters', body, response.headers)\n }\n if (isCodeInRange('404', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'boolean', '')\n throw new ApiException(response.httpStatusCode, 'Key not found', body, response.headers)\n }\n if (isCodeInRange('500', response.httpStatusCode)) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'boolean', '')\n throw new ApiException(response.httpStatusCode, 'Unexpected error during verification', body, response.headers)\n }\n if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {\n const body = ObjectSerializer.deserialize(ObjectSerializer.parse(yield response.body.text(), contentType), 'boolean', '')\n return new HttpInfo(response.httpStatusCode, response.headers, response.body, body)\n }\n throw new ApiException(response.httpStatusCode, 'Unknown API Status Code!', yield response.getBodyAsAny(), response.headers)\n })\n }\n}\n//# sourceMappingURL=KeyVaultControllerApi.js.map\n","import { of, from } from '../rxjsStub'\nimport { mergeMap, map } from '../rxjsStub'\nimport { KeyVaultControllerApiRequestFactory, KeyVaultControllerApiResponseProcessor } from '../apis/KeyVaultControllerApi'\nexport class ObservableKeyVaultControllerApi {\n constructor(configuration, requestFactory, responseProcessor) {\n this.configuration = configuration\n this.requestFactory = requestFactory || new KeyVaultControllerApiRequestFactory(configuration)\n this.responseProcessor = responseProcessor || new KeyVaultControllerApiResponseProcessor()\n }\n createEcKeyWithHttpInfo(createEcKeyRequest, _options) {\n const requestContextPromise = this.requestFactory.createEcKey(createEcKeyRequest, _options)\n let middlewarePreObservable = from(requestContextPromise)\n for (const middleware of this.configuration.middleware) {\n middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)))\n }\n return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).pipe(\n mergeMap((response) => {\n let middlewarePostObservable = of(response)\n for (const middle