New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ace-de/eua-silver-dat-client

Package Overview
Dependencies
Maintainers
7
Versions
194
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ace-de/eua-silver-dat-client - npm Package Compare versions

Comparing version 1.7.1-alpha.0 to 2.0.0-alpha.0

2

dist/index.esm.js

@@ -1,2 +0,2 @@

function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(s){return void r(s)}c.done?t(u):Promise.resolve(u).then(n,o)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function c(e){r(a,o,i,c,u,"next",e)}function u(e){r(a,o,i,c,u,"throw",e)}c(void 0)}))}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function l(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function f(e,t,r){return f=l()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&s(o,r.prototype),o},f.apply(null,arguments)}function h(e){var t="function"===typeof Map?new Map:void 0;return h=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return f(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),s(n,e)},h(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}var y=0;function d(e){return"__private_"+y+++"_"+e}function m(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var g={exports:{}};!function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(_){u=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var o=t&&t.prototype instanceof d?t:d,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(e,t,r){var n=f;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===v){if("throw"===o)throw i;return L()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=l(e,t,r);if("normal"===u.type){if(n=r.done?v:h,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=v,r.method="throw",r.arg=u.arg)}}}(e,r,a),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(_){return{type:"throw",arg:_}}}e.wrap=s;var f="suspendedStart",h="suspendedYield",p="executing",v="completed",y={};function d(){}function m(){}function g(){}var T={};u(T,i,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(P([])));w&&w!==r&&n.call(w,i)&&(T=w);var x=g.prototype=d.prototype=Object.create(T);function A(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,c){var u=l(e[o],e,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"===typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(f).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,c)}))}c(u.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function O(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=l(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function P(e){if(e){var r=e[i];if(r)return r.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:L}}function L(){return{value:t,done:!0}}return m.prototype=g,u(x,"constructor",g),u(g,"constructor",m),m.displayName=u(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,u(e,c,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},A(E.prototype),u(E.prototype,a,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new E(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},A(x),u(x,c,"Generator"),u(x,i,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=P,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),j(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(r){"object"===typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(g);var T=g.exports,b={},w=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,x=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,A=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,E=/\\([\u000b\u0020-\u00ff])/g,O=/([\\"])/g,k=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function j(e){var t=String(e);if(A.test(t))return t;if(t.length>0&&!x.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(O,"\\$1")+'"'}function S(e){this.parameters=Object.create(null),this.type=e}b.format=function(e){if(!e||"object"!==typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!k.test(r))throw new TypeError("invalid type");var n=r;if(t&&"object"===typeof t)for(var o,i=Object.keys(t).sort(),a=0;a<i.length;a++){if(o=i[a],!A.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+j(t[o])}return n},b.parse=function(e){if(!e)throw new TypeError("argument string is required");var t="object"===typeof e?function(e){var t;"function"===typeof e.getHeader?t=e.getHeader("content-type"):"object"===typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!==typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!==typeof t)throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=-1!==r?t.substr(0,r).trim():t.trim();if(!k.test(n))throw new TypeError("invalid media type");var o=new S(n.toLowerCase());if(-1!==r){var i,a,c;for(w.lastIndex=r;a=w.exec(t);){if(a.index!==r)throw new TypeError("invalid parameter format");r+=a[0].length,i=a[1].toLowerCase(),'"'===(c=a[2])[0]&&(c=c.substr(1,c.length-2).replace(E,"$1")),o.parameters[i]=c}if(r!==t.length)throw new TypeError("invalid parameter format")}return o};var P=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(r,h(Error));var t=function(e){var t=l();return function(){var r,n=u(e);if(t){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return v(this,r)}}(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1?arguments[1]:void 0;return o(this,r),e=t.call(this,n),Error.captureStackTrace&&Error.captureStackTrace(p(e),r),e.response=i,e}return a(r)}(),L=function(e){var t=function(e){var t=b.parse(e.headers.get("content-type")).type;return["application/json"].indexOf(t)>-1?e.json():["text/html","application/xml","text/xml"].indexOf(t)>-1?e.text():["application/octet-stream"].indexOf(t)>-1?Promise.resolve(""):["application/pdf"].indexOf(t)>-1?e.blob():Promise.reject(new Error("[service] Content-type not parsed: '".concat(t,"'.")))}(e);return e.ok?t:t.then((function(t){throw new P(t,e)}))},_="APPRAISAL",D=d("silverDATAuthToken"),R=d("silverDATAuthTokenRefreshTimeout"),V=a((function e(){var r=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),this.accessToken=null,this.setAccessToken=function(e){r.accessToken=e},Object.defineProperty(this,D,{writable:!0,value:null}),Object.defineProperty(this,R,{writable:!0,value:null}),this.acquireSilverDATAuthToken=n(T.mark((function e(){return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r.serviceParameters.AUTH_SERVICE_URL,{method:"GET",headers:{Authorization:"Bearer ".concat(r.accessToken)}}).then(L).then((function(e){return e.token}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),this.startSilverDATTokenRefreshTimeout=function(){clearTimeout(m(r,R)[R]);m(r,R)[R]=setTimeout(n(T.mark((function e(){return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.acquireSilverDATAuthToken();case 2:m(r,D)[D]=e.sent,m(r,D)[D]&&r.startSilverDATTokenRefreshTimeout();case 4:case"end":return e.stop()}}),e)}))),15e5)},this.getSilverDATAuthToken=n(T.mark((function e(){return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!m(r,D)[D]){e.next=2;break}return e.abrupt("return",m(r,D)[D]);case 2:return e.next=4,r.acquireSilverDATAuthToken();case 4:return m(r,D)[D]=e.sent,m(r,D)[D]&&r.startSilverDATTokenRefreshTimeout(),e.abrupt("return",m(r,D)[D]);case 7:case"end":return e.stop()}}),e)}))),this.getVehicleTypes=n(T.mark((function e(){var t,n,o;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.getSilverDATAuthToken();case 2:return t=e.sent,n=r.serviceParameters.SERVICE_URL,o='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(t,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getVehicleTypes>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n <restriction>ALL</restriction>\n </request>\n </veh:getVehicleTypes>\n </soapenv:Body>\n </soapenv:Envelope>\n '),e.abrupt("return",fetch(n,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":t},body:o}).then(L).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("vehicleType"),r={};return t.forEach((function(e){r[e.getAttribute("key")]=e.getAttribute("value")})),{vehicleTypes:r}})));case 6:case"end":return e.stop()}}),e)}))),this.getVehicleManufacturers=n(T.mark((function e(){var t,n,o,i,a,c,u,s,l,f=arguments;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=f.length>0&&void 0!==f[0]?f[0]:{},e.next=3,r.getSilverDATAuthToken();case 3:return n=e.sent,o=t.releaseRestriction,i=void 0===o?_:o,a=t.constructionTimeFrom,c=t.constructionTimeTo,u=t.vehicleType,s=r.serviceParameters.SERVICE_URL,l='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(n,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getManufacturers>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n ').concat(a?"<constructionTimeFrom>".concat(a,"</constructionTimeFrom>"):"","\n ").concat(c?"<constructionTimeTo>".concat(c,"</constructionTimeTo>"):"","\n ").concat(i?"<restriction>".concat(i,"</restriction>"):"","\n ").concat(u?"<vehicleType>".concat(u,"</vehicleType>"):"","\n </request>\n </veh:getManufacturers>\n </soapenv:Body>\n </soapenv:Envelope>\n "),e.abrupt("return",fetch(s,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":n},body:l}).then(L).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("manufacturer"),r={};return Array.from(t).forEach((function(e){var t=e.getAttribute("key"),n=e.getAttribute("value");r[t]={name:n}})),{vehicleManufacturers:r}})));case 8:case"end":return e.stop()}}),e)}))),this.getVehicleModels=n(T.mark((function e(){var t,n,o,i,a,c,u,s,l,f,h=arguments;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},e.next=3,r.getSilverDATAuthToken();case 3:return n=e.sent,o=t.releaseRestriction,i=void 0===o?_:o,a=t.constructionTimeFrom,c=t.constructionTimeTo,u=t.vehicleType,s=t.manufacturer,l=r.serviceParameters.SERVICE_URL,f='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(n,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getBaseModelsN>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n ').concat(a?"<constructionTimeFrom>".concat(a,"</constructionTimeFrom>"):"","\n ").concat(c?"<constructionTimeTo>".concat(c,"</constructionTimeTo>"):"","\n ").concat(i?"<restriction>".concat(i,"</restriction>"):"","\n ").concat(u?"<vehicleType>".concat(u,"</vehicleType>"):"","\n ").concat(s?"<manufacturer>".concat(s,"</manufacturer>"):"","\n </request>\n </veh:getBaseModelsN>\n </soapenv:Body>\n </soapenv:Envelope>\n "),e.abrupt("return",fetch(l,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":n},body:f}).then(L).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("baseModelN"),r={};return Array.from(t).forEach((function(e){var t=e.getAttribute("key"),n=e.getAttribute("value");r[t]={name:n}})),{vehicleModels:r}})));case 8:case"end":return e.stop()}}),e)}))),this.getVehicleVariants=n(T.mark((function e(){var t,n,o,i,a,c,u,s,l,f,h,p=arguments;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},e.next=3,r.getSilverDATAuthToken();case 3:return n=e.sent,o=t.releaseRestriction,i=void 0===o?_:o,a=t.constructionTimeFrom,c=t.constructionTimeTo,u=t.vehicleType,s=t.manufacturer,l=t.baseModel,f=r.serviceParameters.SERVICE_URL,h='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(n,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getSubModels>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n ').concat(a?"<constructionTimeFrom>".concat(a,"</constructionTimeFrom>"):"","\n ").concat(c?"<constructionTimeTo>".concat(c,"</constructionTimeTo>"):"","\n ").concat(i?"<restriction>".concat(i,"</restriction>"):"","\n ").concat(u?"<vehicleType>".concat(u,"</vehicleType>"):"","\n ").concat(s?"<manufacturer>".concat(s,"</manufacturer>"):"","\n ").concat(l?"<baseModel>".concat(l,"</baseModel>"):"","\n </request>\n </veh:getSubModels>\n </soapenv:Body>\n </soapenv:Envelope>\n "),e.abrupt("return",fetch(f,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":n},body:h}).then(L).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("subModel"),r={};return Array.from(t).forEach((function(e){var t=e.getAttribute("key"),n=e.getAttribute("value");r[t]={name:n}})),{vehicleVariants:r}})));case 8:case"end":return e.stop()}}),e)}))),this.serviceParameters=t({},i),{setAccessToken:this.setAccessToken,getVehicleTypes:this.getVehicleTypes,getVehicleManufacturers:this.getVehicleManufacturers,getVehicleModels:this.getVehicleModels,getVehicleVariants:this.getVehicleVariants}}));export{V as SilverDATClient};
function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(){t=function(){return r};var e,r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),c=new _(n||[]);return i(a,"_invoke",{value:j(e,r,c)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=f;var h="suspendedStart",v="suspendedYield",y="executing",d="completed",m={};function g(){}function T(){}function b(){}var w={};l(w,c,(function(){return this}));var x=Object.getPrototypeOf,A=x&&x(x(D([])));A&&A!==n&&o.call(A,c)&&(w=A);var E=b.prototype=g.prototype=Object.create(w);function O(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(n,i,a,c){var u=p(e[n],e,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&o.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(l).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,c)}))}c(u.arg)}var n;i(this,"_invoke",{value:function(e,o){function i(){return new t((function(t,n){r(e,o,t,n)}))}return n=n?n.then(i,i):i()}})}function j(t,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=S(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var s=p(t,r,n);if("normal"===s.type){if(o=n.done?d:v,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=d,n.method="throw",n.arg=s.arg)}}}function S(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function D(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function r(){for(;++n<t.length;)if(o.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return T.prototype=b,i(E,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:T,configurable:!0}),T.displayName=l(b,s,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===T||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},r.awrap=function(e){return{__await:e}},O(k.prototype),l(k.prototype,u,(function(){return this})),r.AsyncIterator=k,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var a=new k(f(e,t,n,o),i);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},O(E),l(E,s,"Generator"),l(E,c,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=D,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},r}function r(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function n(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(s){return void r(s)}c.done?t(u):Promise.resolve(u).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function c(e){n(a,o,i,c,u,"next",e)}function u(e){n(a,o,i,c,u,"throw",e)}c(void 0)}))}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}function c(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function f(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function p(e,t,r){return p=f()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&l(o,r.prototype),o},p.apply(null,arguments)}function h(e){var t="function"===typeof Map?new Map:void 0;return h=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"===typeof e}}(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return p(e,arguments,s(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,e)},h(e)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){var t=f();return function(){var r,n=s(e);if(t){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}(this,r)}}var d=0;function m(e){return"__private_"+d+++"_"+e}function g(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var T={},b=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,w=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,x=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,A=/\\([\u000b\u0020-\u00ff])/g,E=/([\\"])/g,O=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function k(e){var t=String(e);if(x.test(t))return t;if(t.length>0&&!w.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(E,"\\$1")+'"'}function j(e){this.parameters=Object.create(null),this.type=e}T.format=function(e){if(!e||"object"!==typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!O.test(r))throw new TypeError("invalid type");var n=r;if(t&&"object"===typeof t)for(var o,i=Object.keys(t).sort(),a=0;a<i.length;a++){if(o=i[a],!x.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+k(t[o])}return n},T.parse=function(e){if(!e)throw new TypeError("argument string is required");var t="object"===typeof e?function(e){var t;"function"===typeof e.getHeader?t=e.getHeader("content-type"):"object"===typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!==typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!==typeof t)throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=-1!==r?t.slice(0,r).trim():t.trim();if(!O.test(n))throw new TypeError("invalid media type");var o=new j(n.toLowerCase());if(-1!==r){var i,a,c;for(b.lastIndex=r;a=b.exec(t);){if(a.index!==r)throw new TypeError("invalid parameter format");r+=a[0].length,i=a[1].toLowerCase(),34===(c=a[2]).charCodeAt(0)&&-1!==(c=c.slice(1,-1)).indexOf("\\")&&(c=c.replace(A,"$1")),o.parameters[i]=c}if(r!==t.length)throw new TypeError("invalid parameter format")}return o};var S=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(r,h(Error));var t=y(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;return i(this,r),e=t.call(this,n),Error.captureStackTrace&&Error.captureStackTrace(v(e),r),e.response=o,e}return c(r)}(),P=function(e){var t=function(e){var t=T.parse(e.headers.get("content-type")).type;return["application/json"].indexOf(t)>-1?e.json():["text/html","application/xml","text/xml"].indexOf(t)>-1?e.text():["application/octet-stream"].indexOf(t)>-1?Promise.resolve(""):["application/pdf"].indexOf(t)>-1?e.blob():Promise.reject(new Error("[service] Content-type not parsed: '".concat(t,"'.")))}(e);return e.ok?t:t.then((function(t){throw new S(t,e)}))},L="APPRAISAL",_=m("silverDATAuthToken"),D=m("silverDATAuthTokenRefreshTimeout"),V=c((function r(){var n=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i(this,r),this.accessToken=null,this.setAccessToken=function(e){n.accessToken=e},Object.defineProperty(this,_,{writable:!0,value:null}),Object.defineProperty(this,D,{writable:!0,value:null}),this.acquireSilverDATAuthToken=o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(n.serviceParameters.AUTH_SERVICE_URL,{method:"GET",headers:{Authorization:"Bearer ".concat(n.accessToken)}}).then(P).then((function(e){return e.token}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),this.startSilverDATTokenRefreshTimeout=function(){clearTimeout(g(n,D)[D]);g(n,D)[D]=setTimeout(o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.acquireSilverDATAuthToken();case 2:g(n,_)[_]=e.sent,g(n,_)[_]&&n.startSilverDATTokenRefreshTimeout();case 4:case"end":return e.stop()}}),e)}))),15e5)},this.getSilverDATAuthToken=o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!g(n,_)[_]){e.next=2;break}return e.abrupt("return",g(n,_)[_]);case 2:return e.next=4,n.acquireSilverDATAuthToken();case 4:return g(n,_)[_]=e.sent,g(n,_)[_]&&n.startSilverDATTokenRefreshTimeout(),e.abrupt("return",g(n,_)[_]);case 7:case"end":return e.stop()}}),e)}))),this.getVehicleTypes=o(t().mark((function e(){var r,o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.getSilverDATAuthToken();case 2:return r=e.sent,o=n.serviceParameters.SERVICE_URL,i='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(r,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getVehicleTypes>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n <restriction>ALL</restriction>\n </request>\n </veh:getVehicleTypes>\n </soapenv:Body>\n </soapenv:Envelope>\n '),e.abrupt("return",fetch(o,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":r},body:i}).then(P).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("vehicleType"),r={};return t.forEach((function(e){r[e.getAttribute("key")]=e.getAttribute("value")})),{vehicleTypes:r}})));case 6:case"end":return e.stop()}}),e)}))),this.getVehicleManufacturers=o(t().mark((function e(){var r,o,i,a,c,u,s,l,f,p=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=p.length>0&&void 0!==p[0]?p[0]:{},e.next=3,n.getSilverDATAuthToken();case 3:return o=e.sent,i=r.releaseRestriction,a=void 0===i?L:i,c=r.constructionTimeFrom,u=r.constructionTimeTo,s=r.vehicleType,l=n.serviceParameters.SERVICE_URL,f='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(o,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getManufacturers>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n ').concat(c?"<constructionTimeFrom>".concat(c,"</constructionTimeFrom>"):"","\n ").concat(u?"<constructionTimeTo>".concat(u,"</constructionTimeTo>"):"","\n ").concat(a?"<restriction>".concat(a,"</restriction>"):"","\n ").concat(s?"<vehicleType>".concat(s,"</vehicleType>"):"","\n </request>\n </veh:getManufacturers>\n </soapenv:Body>\n </soapenv:Envelope>\n "),e.abrupt("return",fetch(l,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":o},body:f}).then(P).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("manufacturer"),r={};return Array.from(t).forEach((function(e){var t=e.getAttribute("key"),n=e.getAttribute("value");r[t]={name:n}})),{vehicleManufacturers:r}})));case 8:case"end":return e.stop()}}),e)}))),this.getVehicleModels=o(t().mark((function e(){var r,o,i,a,c,u,s,l,f,p,h=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=h.length>0&&void 0!==h[0]?h[0]:{},e.next=3,n.getSilverDATAuthToken();case 3:return o=e.sent,i=r.releaseRestriction,a=void 0===i?L:i,c=r.constructionTimeFrom,u=r.constructionTimeTo,s=r.vehicleType,l=r.manufacturer,f=n.serviceParameters.SERVICE_URL,p='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(o,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getBaseModelsN>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n ').concat(c?"<constructionTimeFrom>".concat(c,"</constructionTimeFrom>"):"","\n ").concat(u?"<constructionTimeTo>".concat(u,"</constructionTimeTo>"):"","\n ").concat(a?"<restriction>".concat(a,"</restriction>"):"","\n ").concat(s?"<vehicleType>".concat(s,"</vehicleType>"):"","\n ").concat(l?"<manufacturer>".concat(l,"</manufacturer>"):"","\n </request>\n </veh:getBaseModelsN>\n </soapenv:Body>\n </soapenv:Envelope>\n "),e.abrupt("return",fetch(f,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":o},body:p}).then(P).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("baseModelN"),r={};return Array.from(t).forEach((function(e){var t=e.getAttribute("key"),n=e.getAttribute("value");r[t]={name:n}})),{vehicleModels:r}})));case 8:case"end":return e.stop()}}),e)}))),this.getVehicleVariants=o(t().mark((function e(){var r,o,i,a,c,u,s,l,f,p,h,v=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=v.length>0&&void 0!==v[0]?v[0]:{},e.next=3,n.getSilverDATAuthToken();case 3:return o=e.sent,i=r.releaseRestriction,a=void 0===i?L:i,c=r.constructionTimeFrom,u=r.constructionTimeTo,s=r.vehicleType,l=r.manufacturer,f=r.baseModel,p=n.serviceParameters.SERVICE_URL,h='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(o,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getSubModels>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n ').concat(c?"<constructionTimeFrom>".concat(c,"</constructionTimeFrom>"):"","\n ").concat(u?"<constructionTimeTo>".concat(u,"</constructionTimeTo>"):"","\n ").concat(a?"<restriction>".concat(a,"</restriction>"):"","\n ").concat(s?"<vehicleType>".concat(s,"</vehicleType>"):"","\n ").concat(l?"<manufacturer>".concat(l,"</manufacturer>"):"","\n ").concat(f?"<baseModel>".concat(f,"</baseModel>"):"","\n </request>\n </veh:getSubModels>\n </soapenv:Body>\n </soapenv:Envelope>\n "),e.abrupt("return",fetch(p,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":o},body:h}).then(P).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("subModel"),r={};return Array.from(t).forEach((function(e){var t=e.getAttribute("key"),n=e.getAttribute("value");r[t]={name:n}})),{vehicleVariants:r}})));case 8:case"end":return e.stop()}}),e)}))),this.serviceParameters=function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},a),{setAccessToken:this.setAccessToken,getVehicleTypes:this.getVehicleTypes,getVehicleManufacturers:this.getVehicleManufacturers,getVehicleModels:this.getVehicleModels,getVehicleVariants:this.getVehicleVariants}}));export{V as SilverDATClient};
//# sourceMappingURL=index.esm.js.map

@@ -1,2 +0,2 @@

"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(s){return void r(s)}c.done?t(u):Promise.resolve(u).then(n,o)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function c(e){r(a,o,i,c,u,"next",e)}function u(e){r(a,o,i,c,u,"throw",e)}c(void 0)}))}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function l(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function f(e,t,r){return f=l()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&s(o,r.prototype),o},f.apply(null,arguments)}function h(e){var t="function"===typeof Map?new Map:void 0;return h=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return f(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),s(n,e)},h(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}Object.defineProperty(exports,"__esModule",{value:!0});var y=0;function d(e){return"__private_"+y+++"_"+e}function m(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var g={exports:{}};!function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(L){u=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var o=t&&t.prototype instanceof d?t:d,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(e,t,r){var n=f;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===v){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=l(e,t,r);if("normal"===u.type){if(n=r.done?v:h,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=v,r.method="throw",r.arg=u.arg)}}}(e,r,a),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var f="suspendedStart",h="suspendedYield",p="executing",v="completed",y={};function d(){}function m(){}function g(){}var T={};u(T,i,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(P([])));w&&w!==r&&n.call(w,i)&&(T=w);var x=g.prototype=d.prototype=Object.create(T);function A(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,c){var u=l(e[o],e,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"===typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(f).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,c)}))}c(u.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function O(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=l(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function P(e){if(e){var r=e[i];if(r)return r.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:_}}function _(){return{value:t,done:!0}}return m.prototype=g,u(x,"constructor",g),u(g,"constructor",m),m.displayName=u(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,u(e,c,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},A(E.prototype),u(E.prototype,a,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new E(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},A(x),u(x,c,"Generator"),u(x,i,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=P,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),j(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(r){"object"===typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(g);var T=g.exports,b={},w=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,x=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,A=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,E=/\\([\u000b\u0020-\u00ff])/g,O=/([\\"])/g,k=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function j(e){var t=String(e);if(A.test(t))return t;if(t.length>0&&!x.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(O,"\\$1")+'"'}function S(e){this.parameters=Object.create(null),this.type=e}b.format=function(e){if(!e||"object"!==typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!k.test(r))throw new TypeError("invalid type");var n=r;if(t&&"object"===typeof t)for(var o,i=Object.keys(t).sort(),a=0;a<i.length;a++){if(o=i[a],!A.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+j(t[o])}return n},b.parse=function(e){if(!e)throw new TypeError("argument string is required");var t="object"===typeof e?function(e){var t;"function"===typeof e.getHeader?t=e.getHeader("content-type"):"object"===typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!==typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!==typeof t)throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=-1!==r?t.substr(0,r).trim():t.trim();if(!k.test(n))throw new TypeError("invalid media type");var o=new S(n.toLowerCase());if(-1!==r){var i,a,c;for(w.lastIndex=r;a=w.exec(t);){if(a.index!==r)throw new TypeError("invalid parameter format");r+=a[0].length,i=a[1].toLowerCase(),'"'===(c=a[2])[0]&&(c=c.substr(1,c.length-2).replace(E,"$1")),o.parameters[i]=c}if(r!==t.length)throw new TypeError("invalid parameter format")}return o};var P=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(r,h(Error));var t=function(e){var t=l();return function(){var r,n=u(e);if(t){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return v(this,r)}}(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1?arguments[1]:void 0;return o(this,r),e=t.call(this,n),Error.captureStackTrace&&Error.captureStackTrace(p(e),r),e.response=i,e}return a(r)}(),_=function(e){var t=function(e){var t=b.parse(e.headers.get("content-type")).type;return["application/json"].indexOf(t)>-1?e.json():["text/html","application/xml","text/xml"].indexOf(t)>-1?e.text():["application/octet-stream"].indexOf(t)>-1?Promise.resolve(""):["application/pdf"].indexOf(t)>-1?e.blob():Promise.reject(new Error("[service] Content-type not parsed: '".concat(t,"'.")))}(e);return e.ok?t:t.then((function(t){throw new P(t,e)}))},L="APPRAISAL",D=d("silverDATAuthToken"),R=d("silverDATAuthTokenRefreshTimeout"),V=a((function e(){var r=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),this.accessToken=null,this.setAccessToken=function(e){r.accessToken=e},Object.defineProperty(this,D,{writable:!0,value:null}),Object.defineProperty(this,R,{writable:!0,value:null}),this.acquireSilverDATAuthToken=n(T.mark((function e(){return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r.serviceParameters.AUTH_SERVICE_URL,{method:"GET",headers:{Authorization:"Bearer ".concat(r.accessToken)}}).then(_).then((function(e){return e.token}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),this.startSilverDATTokenRefreshTimeout=function(){clearTimeout(m(r,R)[R]);m(r,R)[R]=setTimeout(n(T.mark((function e(){return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.acquireSilverDATAuthToken();case 2:m(r,D)[D]=e.sent,m(r,D)[D]&&r.startSilverDATTokenRefreshTimeout();case 4:case"end":return e.stop()}}),e)}))),15e5)},this.getSilverDATAuthToken=n(T.mark((function e(){return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!m(r,D)[D]){e.next=2;break}return e.abrupt("return",m(r,D)[D]);case 2:return e.next=4,r.acquireSilverDATAuthToken();case 4:return m(r,D)[D]=e.sent,m(r,D)[D]&&r.startSilverDATTokenRefreshTimeout(),e.abrupt("return",m(r,D)[D]);case 7:case"end":return e.stop()}}),e)}))),this.getVehicleTypes=n(T.mark((function e(){var t,n,o;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.getSilverDATAuthToken();case 2:return t=e.sent,n=r.serviceParameters.SERVICE_URL,o='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(t,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getVehicleTypes>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n <restriction>ALL</restriction>\n </request>\n </veh:getVehicleTypes>\n </soapenv:Body>\n </soapenv:Envelope>\n '),e.abrupt("return",fetch(n,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":t},body:o}).then(_).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("vehicleType"),r={};return t.forEach((function(e){r[e.getAttribute("key")]=e.getAttribute("value")})),{vehicleTypes:r}})));case 6:case"end":return e.stop()}}),e)}))),this.getVehicleManufacturers=n(T.mark((function e(){var t,n,o,i,a,c,u,s,l,f=arguments;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=f.length>0&&void 0!==f[0]?f[0]:{},e.next=3,r.getSilverDATAuthToken();case 3:return n=e.sent,o=t.releaseRestriction,i=void 0===o?L:o,a=t.constructionTimeFrom,c=t.constructionTimeTo,u=t.vehicleType,s=r.serviceParameters.SERVICE_URL,l='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(n,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getManufacturers>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n ').concat(a?"<constructionTimeFrom>".concat(a,"</constructionTimeFrom>"):"","\n ").concat(c?"<constructionTimeTo>".concat(c,"</constructionTimeTo>"):"","\n ").concat(i?"<restriction>".concat(i,"</restriction>"):"","\n ").concat(u?"<vehicleType>".concat(u,"</vehicleType>"):"","\n </request>\n </veh:getManufacturers>\n </soapenv:Body>\n </soapenv:Envelope>\n "),e.abrupt("return",fetch(s,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":n},body:l}).then(_).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("manufacturer"),r={};return Array.from(t).forEach((function(e){var t=e.getAttribute("key"),n=e.getAttribute("value");r[t]={name:n}})),{vehicleManufacturers:r}})));case 8:case"end":return e.stop()}}),e)}))),this.getVehicleModels=n(T.mark((function e(){var t,n,o,i,a,c,u,s,l,f,h=arguments;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},e.next=3,r.getSilverDATAuthToken();case 3:return n=e.sent,o=t.releaseRestriction,i=void 0===o?L:o,a=t.constructionTimeFrom,c=t.constructionTimeTo,u=t.vehicleType,s=t.manufacturer,l=r.serviceParameters.SERVICE_URL,f='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(n,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getBaseModelsN>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n ').concat(a?"<constructionTimeFrom>".concat(a,"</constructionTimeFrom>"):"","\n ").concat(c?"<constructionTimeTo>".concat(c,"</constructionTimeTo>"):"","\n ").concat(i?"<restriction>".concat(i,"</restriction>"):"","\n ").concat(u?"<vehicleType>".concat(u,"</vehicleType>"):"","\n ").concat(s?"<manufacturer>".concat(s,"</manufacturer>"):"","\n </request>\n </veh:getBaseModelsN>\n </soapenv:Body>\n </soapenv:Envelope>\n "),e.abrupt("return",fetch(l,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":n},body:f}).then(_).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("baseModelN"),r={};return Array.from(t).forEach((function(e){var t=e.getAttribute("key"),n=e.getAttribute("value");r[t]={name:n}})),{vehicleModels:r}})));case 8:case"end":return e.stop()}}),e)}))),this.getVehicleVariants=n(T.mark((function e(){var t,n,o,i,a,c,u,s,l,f,h,p=arguments;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},e.next=3,r.getSilverDATAuthToken();case 3:return n=e.sent,o=t.releaseRestriction,i=void 0===o?L:o,a=t.constructionTimeFrom,c=t.constructionTimeTo,u=t.vehicleType,s=t.manufacturer,l=t.baseModel,f=r.serviceParameters.SERVICE_URL,h='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(n,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getSubModels>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n ').concat(a?"<constructionTimeFrom>".concat(a,"</constructionTimeFrom>"):"","\n ").concat(c?"<constructionTimeTo>".concat(c,"</constructionTimeTo>"):"","\n ").concat(i?"<restriction>".concat(i,"</restriction>"):"","\n ").concat(u?"<vehicleType>".concat(u,"</vehicleType>"):"","\n ").concat(s?"<manufacturer>".concat(s,"</manufacturer>"):"","\n ").concat(l?"<baseModel>".concat(l,"</baseModel>"):"","\n </request>\n </veh:getSubModels>\n </soapenv:Body>\n </soapenv:Envelope>\n "),e.abrupt("return",fetch(f,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":n},body:h}).then(_).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("subModel"),r={};return Array.from(t).forEach((function(e){var t=e.getAttribute("key"),n=e.getAttribute("value");r[t]={name:n}})),{vehicleVariants:r}})));case 8:case"end":return e.stop()}}),e)}))),this.serviceParameters=t({},i),{setAccessToken:this.setAccessToken,getVehicleTypes:this.getVehicleTypes,getVehicleManufacturers:this.getVehicleManufacturers,getVehicleModels:this.getVehicleModels,getVehicleVariants:this.getVehicleVariants}}));exports.SilverDATClient=V;
"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(){t=function(){return r};var e,r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),c=new _(n||[]);return i(a,"_invoke",{value:j(e,r,c)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=f;var h="suspendedStart",v="suspendedYield",y="executing",d="completed",m={};function g(){}function T(){}function b(){}var w={};l(w,c,(function(){return this}));var x=Object.getPrototypeOf,A=x&&x(x(D([])));A&&A!==n&&o.call(A,c)&&(w=A);var E=b.prototype=g.prototype=Object.create(w);function O(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(n,i,a,c){var u=p(e[n],e,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&o.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(l).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,c)}))}c(u.arg)}var n;i(this,"_invoke",{value:function(e,o){function i(){return new t((function(t,n){r(e,o,t,n)}))}return n=n?n.then(i,i):i()}})}function j(t,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=S(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var s=p(t,r,n);if("normal"===s.type){if(o=n.done?d:v,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=d,n.method="throw",n.arg=s.arg)}}}function S(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function D(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function r(){for(;++n<t.length;)if(o.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return T.prototype=b,i(E,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:T,configurable:!0}),T.displayName=l(b,s,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===T||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},r.awrap=function(e){return{__await:e}},O(k.prototype),l(k.prototype,u,(function(){return this})),r.AsyncIterator=k,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var a=new k(f(e,t,n,o),i);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},O(E),l(E,s,"Generator"),l(E,c,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=D,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},r}function r(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function n(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(s){return void r(s)}c.done?t(u):Promise.resolve(u).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function c(e){n(a,o,i,c,u,"next",e)}function u(e){n(a,o,i,c,u,"throw",e)}c(void 0)}))}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}function c(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function f(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function p(e,t,r){return p=f()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&l(o,r.prototype),o},p.apply(null,arguments)}function h(e){var t="function"===typeof Map?new Map:void 0;return h=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"===typeof e}}(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return p(e,arguments,s(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,e)},h(e)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){var t=f();return function(){var r,n=s(e);if(t){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}(this,r)}}var d=0;function m(e){return"__private_"+d+++"_"+e}function g(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var T={},b=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,w=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,x=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,A=/\\([\u000b\u0020-\u00ff])/g,E=/([\\"])/g,O=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function k(e){var t=String(e);if(x.test(t))return t;if(t.length>0&&!w.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(E,"\\$1")+'"'}function j(e){this.parameters=Object.create(null),this.type=e}T.format=function(e){if(!e||"object"!==typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!O.test(r))throw new TypeError("invalid type");var n=r;if(t&&"object"===typeof t)for(var o,i=Object.keys(t).sort(),a=0;a<i.length;a++){if(o=i[a],!x.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+k(t[o])}return n},T.parse=function(e){if(!e)throw new TypeError("argument string is required");var t="object"===typeof e?function(e){var t;"function"===typeof e.getHeader?t=e.getHeader("content-type"):"object"===typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!==typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!==typeof t)throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=-1!==r?t.slice(0,r).trim():t.trim();if(!O.test(n))throw new TypeError("invalid media type");var o=new j(n.toLowerCase());if(-1!==r){var i,a,c;for(b.lastIndex=r;a=b.exec(t);){if(a.index!==r)throw new TypeError("invalid parameter format");r+=a[0].length,i=a[1].toLowerCase(),34===(c=a[2]).charCodeAt(0)&&-1!==(c=c.slice(1,-1)).indexOf("\\")&&(c=c.replace(A,"$1")),o.parameters[i]=c}if(r!==t.length)throw new TypeError("invalid parameter format")}return o};var S=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(r,h(Error));var t=y(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;return i(this,r),e=t.call(this,n),Error.captureStackTrace&&Error.captureStackTrace(v(e),r),e.response=o,e}return c(r)}(),P=function(e){var t=function(e){var t=T.parse(e.headers.get("content-type")).type;return["application/json"].indexOf(t)>-1?e.json():["text/html","application/xml","text/xml"].indexOf(t)>-1?e.text():["application/octet-stream"].indexOf(t)>-1?Promise.resolve(""):["application/pdf"].indexOf(t)>-1?e.blob():Promise.reject(new Error("[service] Content-type not parsed: '".concat(t,"'.")))}(e);return e.ok?t:t.then((function(t){throw new S(t,e)}))},L="APPRAISAL",_=m("silverDATAuthToken"),D=m("silverDATAuthTokenRefreshTimeout"),V=c((function r(){var n=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i(this,r),this.accessToken=null,this.setAccessToken=function(e){n.accessToken=e},Object.defineProperty(this,_,{writable:!0,value:null}),Object.defineProperty(this,D,{writable:!0,value:null}),this.acquireSilverDATAuthToken=o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(n.serviceParameters.AUTH_SERVICE_URL,{method:"GET",headers:{Authorization:"Bearer ".concat(n.accessToken)}}).then(P).then((function(e){return e.token}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),this.startSilverDATTokenRefreshTimeout=function(){clearTimeout(g(n,D)[D]);g(n,D)[D]=setTimeout(o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.acquireSilverDATAuthToken();case 2:g(n,_)[_]=e.sent,g(n,_)[_]&&n.startSilverDATTokenRefreshTimeout();case 4:case"end":return e.stop()}}),e)}))),15e5)},this.getSilverDATAuthToken=o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!g(n,_)[_]){e.next=2;break}return e.abrupt("return",g(n,_)[_]);case 2:return e.next=4,n.acquireSilverDATAuthToken();case 4:return g(n,_)[_]=e.sent,g(n,_)[_]&&n.startSilverDATTokenRefreshTimeout(),e.abrupt("return",g(n,_)[_]);case 7:case"end":return e.stop()}}),e)}))),this.getVehicleTypes=o(t().mark((function e(){var r,o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.getSilverDATAuthToken();case 2:return r=e.sent,o=n.serviceParameters.SERVICE_URL,i='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(r,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getVehicleTypes>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n <restriction>ALL</restriction>\n </request>\n </veh:getVehicleTypes>\n </soapenv:Body>\n </soapenv:Envelope>\n '),e.abrupt("return",fetch(o,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":r},body:i}).then(P).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("vehicleType"),r={};return t.forEach((function(e){r[e.getAttribute("key")]=e.getAttribute("value")})),{vehicleTypes:r}})));case 6:case"end":return e.stop()}}),e)}))),this.getVehicleManufacturers=o(t().mark((function e(){var r,o,i,a,c,u,s,l,f,p=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=p.length>0&&void 0!==p[0]?p[0]:{},e.next=3,n.getSilverDATAuthToken();case 3:return o=e.sent,i=r.releaseRestriction,a=void 0===i?L:i,c=r.constructionTimeFrom,u=r.constructionTimeTo,s=r.vehicleType,l=n.serviceParameters.SERVICE_URL,f='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(o,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getManufacturers>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n ').concat(c?"<constructionTimeFrom>".concat(c,"</constructionTimeFrom>"):"","\n ").concat(u?"<constructionTimeTo>".concat(u,"</constructionTimeTo>"):"","\n ").concat(a?"<restriction>".concat(a,"</restriction>"):"","\n ").concat(s?"<vehicleType>".concat(s,"</vehicleType>"):"","\n </request>\n </veh:getManufacturers>\n </soapenv:Body>\n </soapenv:Envelope>\n "),e.abrupt("return",fetch(l,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":o},body:f}).then(P).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("manufacturer"),r={};return Array.from(t).forEach((function(e){var t=e.getAttribute("key"),n=e.getAttribute("value");r[t]={name:n}})),{vehicleManufacturers:r}})));case 8:case"end":return e.stop()}}),e)}))),this.getVehicleModels=o(t().mark((function e(){var r,o,i,a,c,u,s,l,f,p,h=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=h.length>0&&void 0!==h[0]?h[0]:{},e.next=3,n.getSilverDATAuthToken();case 3:return o=e.sent,i=r.releaseRestriction,a=void 0===i?L:i,c=r.constructionTimeFrom,u=r.constructionTimeTo,s=r.vehicleType,l=r.manufacturer,f=n.serviceParameters.SERVICE_URL,p='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(o,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getBaseModelsN>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n ').concat(c?"<constructionTimeFrom>".concat(c,"</constructionTimeFrom>"):"","\n ").concat(u?"<constructionTimeTo>".concat(u,"</constructionTimeTo>"):"","\n ").concat(a?"<restriction>".concat(a,"</restriction>"):"","\n ").concat(s?"<vehicleType>".concat(s,"</vehicleType>"):"","\n ").concat(l?"<manufacturer>".concat(l,"</manufacturer>"):"","\n </request>\n </veh:getBaseModelsN>\n </soapenv:Body>\n </soapenv:Envelope>\n "),e.abrupt("return",fetch(f,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":o},body:p}).then(P).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("baseModelN"),r={};return Array.from(t).forEach((function(e){var t=e.getAttribute("key"),n=e.getAttribute("value");r[t]={name:n}})),{vehicleModels:r}})));case 8:case"end":return e.stop()}}),e)}))),this.getVehicleVariants=o(t().mark((function e(){var r,o,i,a,c,u,s,l,f,p,h,v=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=v.length>0&&void 0!==v[0]?v[0]:{},e.next=3,n.getSilverDATAuthToken();case 3:return o=e.sent,i=r.releaseRestriction,a=void 0===i?L:i,c=r.constructionTimeFrom,u=r.constructionTimeTo,s=r.vehicleType,l=r.manufacturer,f=r.baseModel,p=n.serviceParameters.SERVICE_URL,h='\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n xmlns:veh="http://sphinx.dat.de/services/VehicleSelectionService">\n <soapenv:Header>\n <DAT-AuthorizationToken>'.concat(o,'</DAT-AuthorizationToken>\n </soapenv:Header>\n <soapenv:Body>\n <veh:getSubModels>\n <request>\n <locale country="de" datCountryIndicator="de" language="de"/>\n ').concat(c?"<constructionTimeFrom>".concat(c,"</constructionTimeFrom>"):"","\n ").concat(u?"<constructionTimeTo>".concat(u,"</constructionTimeTo>"):"","\n ").concat(a?"<restriction>".concat(a,"</restriction>"):"","\n ").concat(s?"<vehicleType>".concat(s,"</vehicleType>"):"","\n ").concat(l?"<manufacturer>".concat(l,"</manufacturer>"):"","\n ").concat(f?"<baseModel>".concat(f,"</baseModel>"):"","\n </request>\n </veh:getSubModels>\n </soapenv:Body>\n </soapenv:Envelope>\n "),e.abrupt("return",fetch(p,{method:"POST",headers:{"Content-Type":"text/xml",Accept:"*/*","DAT-AuthorizationToken":o},body:h}).then(P).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("subModel"),r={};return Array.from(t).forEach((function(e){var t=e.getAttribute("key"),n=e.getAttribute("value");r[t]={name:n}})),{vehicleVariants:r}})));case 8:case"end":return e.stop()}}),e)}))),this.serviceParameters=function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},a),{setAccessToken:this.setAccessToken,getVehicleTypes:this.getVehicleTypes,getVehicleManufacturers:this.getVehicleManufacturers,getVehicleModels:this.getVehicleModels,getVehicleVariants:this.getVehicleVariants}}));exports.SilverDATClient=V;
//# sourceMappingURL=index.js.map
{
"name": "@ace-de/eua-silver-dat-client",
"version": "1.7.1-alpha.0",
"version": "2.0.0-alpha.0",
"description": "EUA Silver DAT Client",

@@ -9,3 +9,3 @@ "author": "Computer Rock",

"type": "git",
"url": "https://gitlab.computerrock.com/js/eua-wa"
"url": "https://gitlab.computerrock.com/js/eua-wa-lib"
},

@@ -21,6 +21,6 @@ "publishConfig": {

"devDependencies": {
"@computerrock/rollup-monorepo-bundler": "^1.3.1"
"@computerrock/rollup-monorepo-bundler": "^2.0.0-alpha.0"
},
"dependencies": {
"content-type": "^1.0.4"
"content-type": "^1.0.5"
},

@@ -32,3 +32,3 @@ "scripts": {

},
"gitHead": "77beb88851f25398c030d0786f00d7b0e8d1b2ad"
"gitHead": "cb0ec03c00915d912fb11133ab4d8df3f35564af"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc