@deltares/fews-web-oc-utils 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["fews-pi-requests"]=t():e["fews-pi-requests"]=t()}(self,(function(){return(()=>{"use strict";var e={}
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["fews-pi-requests"]=t():e["fews-pi-requests"]=t()}(self,(function(){return(()=>{"use strict";var e={d:(t,o)=>{for(var s in o)e.o(o,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:o[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{PiRestService:()=>o});class o{webserviceUrl;_oauth2Token=void 0;set oauth2Token(e){this._oauth2Token=e}constructor(e){this.webserviceUrl=e}async getData(e){const t={method:"GET"};void 0!==this._oauth2Token&&(t.headers={Authorization:"Bearer "+this._oauth2Token});const o=await fetch(e,t);return await this.processResponse({},o,e)}async processResponse(e,t,o){if(e.responseCode=t.status,200!=t.status)return e.errorMessage=t.statusText,e;try{e.data=await t.json()}catch(e){throw e.message+=`\n When loading ${o}.`,e}return e}async getDataWithRequestInit(e,t){if(void 0!==this._oauth2Token){const e={Authorization:"Bearer "+this._oauth2Token};t.headers={...e,...t.headers}}const o=await fetch(e,t);return await this.processResponse({},o,e)}}return t})()}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"piRestService.js","sourceRoot":"","sources":["../../../src/restservice/piRestService.ts"],"names":[],"mappings":"AAEA,M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