@corva/ui 0.78.0-3 → 0.78.0-4
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.
- package/cjs-bundle/clients/api/apiCore.js +1 -1
- package/cjs-bundle/clients/index.js +1 -1
- package/clients/api/apiCore.d.ts +1 -1
- package/clients/api/apiCore.d.ts.map +1 -1
- package/clients/api/apiCore.js +1 -1
- package/clients/index.d.ts +5 -5
- package/clients/index.d.ts.map +1 -1
- package/clients/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/helpers/classCallCheck"),a=require("@babel/runtime/helpers/createClass"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/helpers/classCallCheck"),a=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/regenerator"),o=require("query-string"),i=require("../utils.js"),u=require("./httpMessages.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function p(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var l=c(e),f=c(t),d=c(r),h=c(n),y=c(a),g=c(s),b=p(o);function v(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 m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){f.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var P={400:"Request Failed",403:"No Permission",404:"Not Found"},x=["POST","PUT","PATCH","DELETE"],w=function(){function e(t,r){h.default(this,e),this.status=t.status,this.statusText=t.statusText,this.message=r.message||"No Message"}return y.default(e,[{key:"isAuthenticationProblem",value:function(){return 401===this.status}},{key:"isTermsProblem",value:function(){return 401===this.status&&"Please accept the latest terms of service"===this.message}},{key:"isLoginProblem",value:function(){var e,t;return 401===this.status&&(null===(e=this.errorBody)||void 0===e||null===(t=e.errors)||void 0===t?void 0:t.login)}}]),e}(),O=b.parse(window.location.search).api_url||process.env.REACT_APP_API_URL||"https://api.qa.corva.ai",j={"Content-Type":"application/json",Accept:"application/json"};function T(e){e.isAuthenticationProblem&&e.isAuthenticationProblem()&&!e.isTermsProblem()&&!e.isLoginProblem()&&(console.error("Problem with user"),"/login"!==window.location.pathname&&(window.location.href="/login"))}var k=/^\/v1\/assets.*/;function A(){return A=d.default(g.default.mark((function e(t){var r,n,a,s,o,u=arguments;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]?u[2]:{},a=n.apiUrl,s=void 0===a?O:a,o=n.appKey,k.test(t)&&(r.cache="reload"),r.credentials="include",e.abrupt("return",fetch("".concat(s).concat(t),i.attachHTTPHeaders({config:r,appKey:o})));case 6:case"end":return e.stop()}}),e)}))),A.apply(this,arguments)}var S,K,E=(S=function(e){return A.apply(this,arguments)},K=d.default(g.default.mark((function e(t,r,n){var a,s,o,i,c,p,l;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(t,r,n);case 2:if(a=e.sent,s=a.status,!a.ok){e.next=6;break}return e.abrupt("return",204===s?null:a);case 6:return e.prev=6,e.next=9,a.json();case 9:o=e.sent,e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),o={};case 15:throw i=r.method,c=x.includes(i),p=u.DISPLAY_HTTP_MESSAGES[o.message]||P[s],c&&p&&console.error("ERROR"),T(l=new w(a,o)),l;case 22:case"end":return e.stop()}}),e,null,[[6,12]])}))),function(e,t,r){return K.apply(this,arguments)});function U(){return U=d.default(g.default.mark((function e(t,r){var n,a,s,o=arguments;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:{},a=n.apiUrl,e.next=4,E(t,{method:"POST",headers:j,body:JSON.stringify(r)},{apiUrl:a,appKey:i.getAppKeyFromStackTrace()});case 4:return s=e.sent,e.abrupt("return",s&&s.json());case 6:case"end":return e.stop()}}),e)}))),U.apply(this,arguments)}function q(e){return F.apply(this,arguments)}function F(){return F=d.default(g.default.mark((function e(t){var r,n,a,s,o,u,c,p=arguments;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=p.length>1&&void 0!==p[1]?p[1]:{},n=p.length>2&&void 0!==p[2]?p[2]:{},a=n.apiUrl,s=n.appKey,o=n.signal,u=b.stringify(r,{arrayFormat:"bracket"}),e.next=6,E("".concat(t).concat(u?"?":"").concat(u),{method:"GET",signal:o},{apiUrl:a,appKey:s||i.getAppKeyFromStackTrace()});case 6:if(c=e.sent,e.t0=c,!e.t0){e.next=12;break}return e.next=11,c.json();case 11:e.t0=e.sent;case 12:return e.t1=e.t0,e.t2=c&&c.headers,e.abrupt("return",{data:e.t1,headers:e.t2});case 15:case"end":return e.stop()}}),e)}))),F.apply(this,arguments)}function D(){return D=d.default(g.default.mark((function e(t){var r,n,a,s=arguments;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2&&void 0!==s[2]?s[2]:{},e.next=4,q(t,r,m(m({},n),{},{appKey:n.appKey||i.getAppKeyFromStackTrace()}));case 4:return a=e.sent,e.abrupt("return",a.data);case 6:case"end":return e.stop()}}),e)}))),D.apply(this,arguments)}function _(){return _=d.default(g.default.mark((function e(t,r){var n,a,s,o,u,c,p=arguments;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>2&&void 0!==p[2]?p[2]:{},a=p.length>3&&void 0!==p[3]?p[3]:{},s=a.apiUrl,o=a.signal,u=b.stringify(n),e.next=6,E("".concat(t).concat(u?"?":"").concat(u),{method:"PUT",headers:j,body:JSON.stringify(r)},{apiUrl:s,appKey:i.getAppKeyFromStackTrace(),signal:o});case 6:return c=e.sent,e.abrupt("return",c&&c.json());case 8:case"end":return e.stop()}}),e)}))),_.apply(this,arguments)}function C(){return C=d.default(g.default.mark((function e(t,r){var n,a,s,o,u,c,p=arguments;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>2&&void 0!==p[2]?p[2]:{},a=p.length>3&&void 0!==p[3]?p[3]:{},s=a.apiUrl,o=a.signal,u=b.stringify(n),e.next=6,E("".concat(t).concat(u?"?":"").concat(u),{method:"PATCH",headers:j,body:JSON.stringify(r)},{apiUrl:s,appKey:i.getAppKeyFromStackTrace(),signal:o});case 6:return c=e.sent,e.abrupt("return",c&&c.json());case 8:case"end":return e.stop()}}),e)}))),C.apply(this,arguments)}function H(){return H=d.default(g.default.mark((function e(t){var r,n,a,s,o,u,c=arguments;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=c.length>1&&void 0!==c[1]?c[1]:{},n=c.length>2&&void 0!==c[2]?c[2]:{},a=n.apiUrl,s=n.signal,o=b.stringify(r),e.next=6,E(o?"".concat(t,"?").concat(o):t,{method:"DELETE",headers:j},{apiUrl:a,appKey:i.getAppKeyFromStackTrace(),signal:s});case 6:return u=e.sent,e.abrupt("return",u&&u.json());case 8:case"end":return e.stop()}}),e)}))),H.apply(this,arguments)}function L(){return L=d.default(g.default.mark((function e(t,r){var n,a,s,o,u,c,p,f,d=arguments;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=d.length>2&&void 0!==d[2]?d[2]:{},a=d.length>3&&void 0!==d[3]?d[3]:{},s=b.stringify(n),o=a.method,u=void 0===o?"POST":o,c=a.signal,p=new FormData,Object.entries(r).forEach((function(e){var t=l.default(e,2),r=t[0],n=t[1];Array.isArray(n)?n.forEach((function(e){p.append(r,e)})):p.append(r,n)})),e.next=8,E(s?"".concat(t,"?").concat(s):t,{method:u,headers:{Accept:"application/json"},body:p},{appKey:i.getAppKeyFromStackTrace(),signal:c});case 8:return f=e.sent,e.abrupt("return",f&&f.json());case 10:case"end":return e.stop()}}),e)}))),L.apply(this,arguments)}exports.APIException=w,exports.baseUrl=O,exports.del=function(e){return H.apply(this,arguments)},exports.get=function(e){return D.apply(this,arguments)},exports.getWithHeaders=q,exports.handleAuthenticationProblem=T,exports.patch=function(e,t){return C.apply(this,arguments)},exports.post=function(e,t){return U.apply(this,arguments)},exports.put=function(e,t){return _.apply(this,arguments)},exports.sendFormData=function(e,t){return L.apply(this,arguments)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("uuid"),r=require("lodash"),n=require("./clientStorage/index.js"),o=require("./jsonApi/index.js"),i=require("./subscriptions.js"),u=require("./api/apiCore.js"),c=require("./constants.js"),s=require("./sso/index.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=a(e);function l(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
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("uuid"),r=require("lodash"),n=require("./clientStorage/index.js"),o=require("./jsonApi/index.js"),i=require("./subscriptions.js"),u=require("./api/apiCore.js"),c=require("./constants.js"),s=require("./sso/index.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=a(e);function l(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 v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){p.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d={get:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u.get(e,t,r)},put:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return u.put(e,t,r,n)},patch:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return u.patch(e,t,r,n)},post:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u.post(e,t,r)},del:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u.del(e,t,r)}},f={get:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u.get(e,t,v({apiUrl:c.CORVA_API_URLS.DATA_API},r))},put:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return u.put(e,t,r,v({apiUrl:c.CORVA_API_URLS.DATA_API},n))},patch:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return u.patch(e,t,r,v({apiUrl:c.CORVA_API_URLS.DATA_API},n))},post:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u.post(e,t,v({apiUrl:c.CORVA_API_URLS.DATA_API},r))},del:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u.del(e,t,v({apiUrl:c.CORVA_API_URLS.DATA_API},r))}},g={subscribe:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.onDataReceive,i=void 0===o?r.noop:o,u=window[Symbol.for("socket")]||{},c=u.subscribe,s=u.unsubscribe,a=u.socket;if(!a)return console.error("Socket is not initialized!"),r.noop;var p=t.v4(),l=v(v({},e),{},{collection:e.collection||e.dataset,appInstanceId:p});return c(l),a.on("data",(function(e){return e.appInstanceId===p&&i(e)})),function(){return s(l)}}};exports.clientStorage=n,exports.jsonApi=o,exports.subscriptions=i,exports.sso=s,exports.corvaAPI=d,exports.corvaDataAPI=f,exports.socketClient=g;
|
package/clients/api/apiCore.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export function getWithHeaders(path: any, queryParams?: {}, requestOptions?: {})
|
|
|
20
20
|
* @returns {Promise<*>}
|
|
21
21
|
*/
|
|
22
22
|
export function get(path: string, queryParams?: any | undefined, requestOptions?: any | undefined): Promise<any>;
|
|
23
|
-
export function getFile(path: any, queryParams?: {}): Promise<any>;
|
|
23
|
+
export function getFile(path: any, queryParams?: {}, requestOptions?: {}): Promise<any>;
|
|
24
24
|
export function put(path: any, content: any, queryParams?: {}, requestOptions?: {}): Promise<any>;
|
|
25
25
|
export function patch(path: any, content: any, queryParams?: {}, requestOptions?: {}): Promise<any>;
|
|
26
26
|
export function del(path: any, queryParams?: {}, requestOptions?: {}): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiCore.d.ts","sourceRoot":"","sources":["../../../src/clients/api/apiCore.js"],"names":[],"mappings":"AAqDA,0DAWC;
|
|
1
|
+
{"version":3,"file":"apiCore.d.ts","sourceRoot":"","sources":["../../../src/clients/api/apiCore.js"],"names":[],"mappings":"AAqDA,0DAWC;AAuDD;;;;;;GAMG;AACH,2BAJW,MAAM,kDAEJ,YAAU,CAetB;AAED;;;GAgBC;AAED;;;;;;;GAOG;AACH,0BALW,MAAM,oEAGJ,YAAU,CAQtB;AAED,wFAUC;AAED,kGAcC;AAED,oGAmBC;AAED,oFAiBC;AAED,wGA4BC;AAzPD;IACE,sCAIC;IAHC,YAA6B;IAC7B,gBAAqC;IACrC,aAA2C;IAG7C,mCAEC;IAED,0BAIC;IAED,sBAEC;CACF;AAGD,0BACmF"}
|
package/clients/api/apiCore.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/classCallCheck";import a from"@babel/runtime/helpers/createClass";import
|
|
1
|
+
import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/classCallCheck";import a from"@babel/runtime/helpers/createClass";import s from"@babel/runtime/regenerator";import*as o from"query-string";import{attachHTTPHeaders as i,getAppKeyFromStackTrace as c}from"../utils.js";import{DISPLAY_HTTP_MESSAGES as u}from"./httpMessages.js";function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?p(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var h={400:"Request Failed",403:"No Permission",404:"Not Found"},f=["POST","PUT","PATCH","DELETE"],d=function(){function t(e,r){n(this,t),this.status=e.status,this.statusText=e.statusText,this.message=r.message||"No Message"}return a(t,[{key:"isAuthenticationProblem",value:function(){return 401===this.status}},{key:"isTermsProblem",value:function(){return 401===this.status&&"Please accept the latest terms of service"===this.message}},{key:"isLoginProblem",value:function(){var t,e;return 401===this.status&&(null===(t=this.errorBody)||void 0===t||null===(e=t.errors)||void 0===e?void 0:e.login)}}]),t}(),m=o.parse(window.location.search).api_url||process.env.REACT_APP_API_URL||"https://api.qa.corva.ai",y={"Content-Type":"application/json",Accept:"application/json"};function v(t){t.isAuthenticationProblem&&t.isAuthenticationProblem()&&!t.isTermsProblem()&&!t.isLoginProblem()&&(console.error("Problem with user"),"/login"!==window.location.pathname&&(window.location.href="/login"))}var g=/^\/v1\/assets.*/;function b(){return b=r(s.mark((function t(e){var r,n,a,o,c,u=arguments;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]?u[2]:{},a=n.apiUrl,o=void 0===a?m:a,c=n.appKey,g.test(e)&&(r.cache="reload"),r.credentials="include",t.abrupt("return",fetch("".concat(o).concat(e),i({config:r,appKey:c})));case 6:case"end":return t.stop()}}),t)}))),b.apply(this,arguments)}var w,P,x=(w=function(t){return b.apply(this,arguments)},P=r(s.mark((function t(e,r,n){var a,o,i,c,p,l,m;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,w(e,r,n);case 2:if(a=t.sent,o=a.status,!a.ok){t.next=6;break}return t.abrupt("return",204===o?null:a);case 6:return t.prev=6,t.next=9,a.json();case 9:i=t.sent,t.next=15;break;case 12:t.prev=12,t.t0=t.catch(6),i={};case 15:throw c=r.method,p=f.includes(c),l=u[i.message]||h[o],p&&l&&console.error("ERROR"),v(m=new d(a,i)),m;case 22:case"end":return t.stop()}}),t,null,[[6,12]])}))),function(t,e,r){return P.apply(this,arguments)});function O(t,e){return j.apply(this,arguments)}function j(){return j=r(s.mark((function t(e,r){var n,a,o,i=arguments;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:{},a=n.apiUrl,t.next=4,x(e,{method:"POST",headers:y,body:JSON.stringify(r)},{apiUrl:a,appKey:c()});case 4:return o=t.sent,t.abrupt("return",o&&o.json());case 6:case"end":return t.stop()}}),t)}))),j.apply(this,arguments)}function k(t){return T.apply(this,arguments)}function T(){return T=r(s.mark((function t(e){var r,n,a,i,u,p,l,h=arguments;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.length>1&&void 0!==h[1]?h[1]:{},n=h.length>2&&void 0!==h[2]?h[2]:{},a=n.apiUrl,i=n.appKey,u=n.signal,p=o.stringify(r,{arrayFormat:"bracket"}),t.next=6,x("".concat(e).concat(p?"?":"").concat(p),{method:"GET",signal:u},{apiUrl:a,appKey:i||c()});case 6:if(l=t.sent,t.t0=l,!t.t0){t.next=12;break}return t.next=11,l.json();case 11:t.t0=t.sent;case 12:return t.t1=t.t0,t.t2=l&&l.headers,t.abrupt("return",{data:t.t1,headers:t.t2});case 15:case"end":return t.stop()}}),t)}))),T.apply(this,arguments)}function U(t){return A.apply(this,arguments)}function A(){return A=r(s.mark((function t(e){var r,n,a,o=arguments;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},n=o.length>2&&void 0!==o[2]?o[2]:{},t.next=4,k(e,r,l(l({},n),{},{appKey:n.appKey||c()}));case 4:return a=t.sent,t.abrupt("return",a.data);case 6:case"end":return t.stop()}}),t)}))),A.apply(this,arguments)}function E(t,e){return K.apply(this,arguments)}function K(){return K=r(s.mark((function t(e,r){var n,a,i,u,p,l,h=arguments;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=h.length>2&&void 0!==h[2]?h[2]:{},a=h.length>3&&void 0!==h[3]?h[3]:{},i=a.apiUrl,u=a.signal,p=o.stringify(n),t.next=6,x("".concat(e).concat(p?"?":"").concat(p),{method:"PUT",headers:y,body:JSON.stringify(r)},{apiUrl:i,appKey:c(),signal:u});case 6:return l=t.sent,t.abrupt("return",l&&l.json());case 8:case"end":return t.stop()}}),t)}))),K.apply(this,arguments)}function S(t,e){return C.apply(this,arguments)}function C(){return C=r(s.mark((function t(e,r){var n,a,i,u,p,l,h=arguments;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=h.length>2&&void 0!==h[2]?h[2]:{},a=h.length>3&&void 0!==h[3]?h[3]:{},i=a.apiUrl,u=a.signal,p=o.stringify(n),t.next=6,x("".concat(e).concat(p?"?":"").concat(p),{method:"PATCH",headers:y,body:JSON.stringify(r)},{apiUrl:i,appKey:c(),signal:u});case 6:return l=t.sent,t.abrupt("return",l&&l.json());case 8:case"end":return t.stop()}}),t)}))),C.apply(this,arguments)}function D(t){return N.apply(this,arguments)}function N(){return N=r(s.mark((function t(e){var r,n,a,i,u,p,l=arguments;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=l.length>1&&void 0!==l[1]?l[1]:{},n=l.length>2&&void 0!==l[2]?l[2]:{},a=n.apiUrl,i=n.signal,u=o.stringify(r),t.next=6,x(u?"".concat(e,"?").concat(u):e,{method:"DELETE",headers:y},{apiUrl:a,appKey:c(),signal:i});case 6:return p=t.sent,t.abrupt("return",p&&p.json());case 8:case"end":return t.stop()}}),t)}))),N.apply(this,arguments)}function R(t,e){return L.apply(this,arguments)}function L(){return L=r(s.mark((function e(r,n){var a,i,u,p,l,h,f,d,m=arguments;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=m.length>2&&void 0!==m[2]?m[2]:{},i=m.length>3&&void 0!==m[3]?m[3]:{},u=o.stringify(a),p=i.method,l=void 0===p?"POST":p,h=i.signal,f=new FormData,Object.entries(n).forEach((function(e){var r=t(e,2),n=r[0],a=r[1];Array.isArray(a)?a.forEach((function(t){f.append(n,t)})):f.append(n,a)})),e.next=8,x(u?"".concat(r,"?").concat(u):r,{method:l,headers:{Accept:"application/json"},body:f},{appKey:c(),signal:h});case 8:return d=e.sent,e.abrupt("return",d&&d.json());case 10:case"end":return e.stop()}}),e)}))),L.apply(this,arguments)}export{d as APIException,m as baseUrl,D as del,U as get,k as getWithHeaders,v as handleAuthenticationProblem,S as patch,O as post,E as put,R as sendFormData};
|
package/clients/index.d.ts
CHANGED
|
@@ -7,15 +7,15 @@ export namespace corvaAPI {
|
|
|
7
7
|
function del(path: any, queryParams?: {}, requestOptions?: {}): Promise<any>;
|
|
8
8
|
}
|
|
9
9
|
export namespace corvaDataAPI {
|
|
10
|
-
export function get_1(path: any, queryParams?: {}): Promise<any>;
|
|
10
|
+
export function get_1(path: any, queryParams?: {}, requestOptions?: {}): Promise<any>;
|
|
11
11
|
export { get_1 as get };
|
|
12
|
-
export function put_1(path: any, content: any, queryParams?: {}): Promise<any>;
|
|
12
|
+
export function put_1(path: any, content: any, queryParams?: {}, requestOptions?: {}): Promise<any>;
|
|
13
13
|
export { put_1 as put };
|
|
14
|
-
export function patch_1(path: any, content: any, queryParams?: {}): Promise<any>;
|
|
14
|
+
export function patch_1(path: any, content: any, queryParams?: {}, requestOptions?: {}): Promise<any>;
|
|
15
15
|
export { patch_1 as patch };
|
|
16
|
-
export function post_1(path: any, entity: any): Promise<any>;
|
|
16
|
+
export function post_1(path: any, entity: any, requestOptions?: {}): Promise<any>;
|
|
17
17
|
export { post_1 as post };
|
|
18
|
-
export function del_1(path: any, queryParams?: {}): Promise<any>;
|
|
18
|
+
export function del_1(path: any, queryParams?: {}, requestOptions?: {}): Promise<any>;
|
|
19
19
|
export { del_1 as del };
|
|
20
20
|
}
|
|
21
21
|
export namespace socketClient {
|
package/clients/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.js"],"names":[],"mappings":";;IAaO,6EAEJ;IACI,2FAEJ;IACM,6FAEN;IACK,yEAEL;IACI,6EAEJ;;;IAII,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.js"],"names":[],"mappings":";;IAaO,6EAEJ;IACI,2FAEJ;IACM,6FAEN;IACK,yEAEL;IACI,6EAEJ;;;IAII,sFAC2E;;IAC3E,oGACoF;;IAClF,sGACoF;;IACrF,kFACsE;;IACvE,sFAC2E;;;;IAMrE;;iCAwBV"}
|
package/clients/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import{v4 as r}from"uuid";import{noop as e}from"lodash";import*as n from"./clientStorage/index.js";export{n as clientStorage};import*as o from"./jsonApi/index.js";export{o as jsonApi};import*as i from"./subscriptions.js";export{i as subscriptions};import{get as c,put as a,patch as s,post as p,del as u}from"./api/apiCore.js";import{CORVA_API_URLS as l}from"./constants.js";import*as
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import{v4 as r}from"uuid";import{noop as e}from"lodash";import*as n from"./clientStorage/index.js";export{n as clientStorage};import*as o from"./jsonApi/index.js";export{o as jsonApi};import*as i from"./subscriptions.js";export{i as subscriptions};import{get as c,put as a,patch as s,post as p,del as u}from"./api/apiCore.js";import{CORVA_API_URLS as l}from"./constants.js";import*as v from"./sso/index.js";export{v as sso};function f(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function d(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){t(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}var g={get:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(t,r,e)},put:function(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return a(t,r,e,n)},patch:function(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return s(t,r,e,n)},post:function(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p(t,r,e)},del:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(t,r,e)}},h={get:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(t,r,d({apiUrl:l.DATA_API},e))},put:function(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return a(t,r,e,d({apiUrl:l.DATA_API},n))},patch:function(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return s(t,r,e,d({apiUrl:l.DATA_API},n))},post:function(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p(t,r,d({apiUrl:l.DATA_API},e))},del:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(t,r,d({apiUrl:l.DATA_API},e))}},b={subscribe:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.onDataReceive,i=void 0===o?e:o,c=window[Symbol.for("socket")]||{},a=c.subscribe,s=c.unsubscribe,p=c.socket;if(!p)return console.error("Socket is not initialized!"),e;var u=r(),l=d(d({},t),{},{collection:t.collection||t.dataset,appInstanceId:u});return a(l),p.on("data",(function(t){return t.appInstanceId===u&&i(t)})),function(){return s(l)}}};export{g as corvaAPI,h as corvaDataAPI,b as socketClient};
|