UNPKG

@altostra/core

Version:

Core library for shared types and logic

1 lines 2.18 kB
"use strict";var _DesignRecommendationsService_endpoint,__awaiter=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,t,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,i):r?r.value=i:t.set(e,i),i},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DesignRecommendationsService=void 0;const Url_1=require("../../../common/Utils/Url"),ServiceClientBase_1=require("../ServiceClientBase"),common_1=require("./common");class DesignRecommendationsService extends ServiceClientBase_1.ServiceClientBase{constructor({logger:e,getToken:t,endpoint:i}){super({serviceName:"DesignRecommendationsService",logger:e,getToken:t}),_DesignRecommendationsService_endpoint.set(this,void 0),__classPrivateFieldSet(this,_DesignRecommendationsService_endpoint,new URL(i),"f")}inspect(e){const t=new URL(Url_1.asUrl`/inspect`,__classPrivateFieldGet(this,_DesignRecommendationsService_endpoint,"f")),i={blueprint:e};return this._request({request:e=>__awaiter(this,void 0,void 0,(function*(){return yield e.post(t.toString(),i,{headers:yield this._getHeaders()})})),dataValidation:common_1.isDesignRecommendationsResponse})}}exports.DesignRecommendationsService=DesignRecommendationsService,_DesignRecommendationsService_endpoint=new WeakMap;