@gudhub/core 1.1.120 → 1.1.121
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.
|
@@ -12,12 +12,12 @@ export class GroupInvitation {
|
|
|
12
12
|
token: await this.gudhub.auth.getToken(),
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const groupInvitation = await this.req.post({
|
|
16
16
|
url: "/api/invitation/create",
|
|
17
17
|
form,
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
return
|
|
20
|
+
return groupInvitation;
|
|
21
21
|
} catch (err) {
|
|
22
22
|
console.log(err);
|
|
23
23
|
return null;
|
|
@@ -30,12 +30,12 @@ export class GroupInvitation {
|
|
|
30
30
|
invitation_id: invitationId
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const
|
|
33
|
+
const groupInvitation = await this.req.post({
|
|
34
34
|
url: "/api/invitation/get",
|
|
35
35
|
form,
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
return
|
|
38
|
+
return groupInvitation;
|
|
39
39
|
} catch (err) {
|
|
40
40
|
console.log(err);
|
|
41
41
|
return null;
|
|
@@ -48,12 +48,12 @@ export class GroupInvitation {
|
|
|
48
48
|
invitation_id: invitationId
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const groupInvitation = await this.req.post({
|
|
52
52
|
url: "/api/invitation/accept",
|
|
53
53
|
form,
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
return
|
|
56
|
+
return groupInvitation;
|
|
57
57
|
} catch (err) {
|
|
58
58
|
console.log(err);
|
|
59
59
|
return null;
|
package/GUDHUB/gudhub.js
CHANGED
|
@@ -47,7 +47,7 @@ export class GudHub {
|
|
|
47
47
|
this.auth = new Auth(this.req, this.storage);
|
|
48
48
|
this.sharing = new Sharing(this, this.req);
|
|
49
49
|
this.groupSharing = new GroupSharing(this, this.req, this.pipeService);
|
|
50
|
-
this.
|
|
50
|
+
this.groupInvitation = new GroupInvitation(this, this.req);
|
|
51
51
|
|
|
52
52
|
// Login with access token - pass to setUser access token and after it user can make requests with access token
|
|
53
53
|
// This method created for optimize GudHub initialization without auth key
|
package/package.json
CHANGED
package/umd/library.min.js
CHANGED
|
@@ -345,7 +345,7 @@ var t=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),export
|
|
|
345
345
|
},{}],"quyV":[function(require,module,exports) {
|
|
346
346
|
"use strict";function t(){var e,n,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",u=o.toStringTag||"@@toStringTag";function a(t,o,i,u){var a=o&&o.prototype instanceof f?o:f,s=Object.create(a.prototype);return r(s,"_invoke",function(t,r,o){var i,u,a,f=0,s=o||[],p=!1,l={p:0,n:0,v:e,a:y,f:y.bind(e,4),d:function(t,r){return i=t,u=0,a=e,l.n=r,c}};function y(t,r){for(u=t,a=r,n=0;!p&&f&&!o&&n<s.length;n++){var o,i=s[n],y=l.p,b=i[2];t>3?(o=b===r)&&(a=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=y&&((o=t<2&&y<i[1])?(u=0,l.v=r,l.n=i[1]):y<b&&(o=t<3||i[0]>r||r>b)&&(i[4]=t,i[5]=r,l.n=b,u=0))}if(o||t>1)return c;throw p=!0,r}return function(o,s,b){if(f>1)throw TypeError("Generator is already running");for(p&&1===s&&y(s,b),u=s,a=b;(n=u<2?e:a)||!p;){i||(u?u<3?(u>1&&(l.n=-1),y(u,a)):l.n=a:l.v=a);try{if(f=2,i){if(u||(o="next"),n=i[o]){if(!(n=n.call(i,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,u<2&&(u=0)}else 1===u&&(n=i.return)&&n.call(i),u<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((n=(p=l.n<0)?a:t.call(r,l))!==c)break}catch(n){i=e,u=1,a=n}finally{f=1}}return{value:n,done:p}}}(t,i,u),!0),s}var c={};function f(){}function s(){}function p(){}n=Object.getPrototypeOf;var l=[][i]?n(n([][i]())):(r(n={},i,function(){return this}),n),y=p.prototype=f.prototype=Object.create(l);function b(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,r(t,u,"GeneratorFunction")),t.prototype=Object.create(y),t}return s.prototype=p,r(y,"constructor",p),r(p,"constructor",s),s.displayName="GeneratorFunction",r(p,u,"GeneratorFunction"),r(y),r(y,u,"Generator"),r(y,i,function(){return this}),r(y,"toString",function(){return"[object Generator]"}),(t=function(){return{w:a,m:b}})()}function r(t,e,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}(r=function(t,e,n,o){function u(e,n){r(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[e]=n:(u("next",0),u("throw",1),u("return",2))})(t,e,n,o)}function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,r,e,n,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void e(t)}a.done?r(c):Promise.resolve(c).then(n,o)}function o(t){return function(){var r=this,e=arguments;return new Promise(function(o,i){var u=t.apply(r,e);function a(t){n(u,o,i,a,c,"next",t)}function c(t){n(u,o,i,a,c,"throw",t)}a(void 0)})}}function i(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function u(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function a(t,r,e){return r&&u(t.prototype,r),e&&u(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var r=f(t,"string");return"symbol"==e(r)?r:r+""}function f(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebSocketEmitter=void 0;var s=exports.WebSocketEmitter=function(){return a(function t(r){i(this,t),this.gudhub=r},[{key:"emitToUser",value:function(){var r=o(t().m(function r(n,o){var i,u;return t().w(function(t){for(;;)switch(t.n){case 0:return i={user_id:n,data:"object"===e(o)?JSON.stringify(o):o},t.n=1,this.gudhub.req.post({url:"/ws/emit-to-user",form:i});case 1:return u=t.v,t.a(2,u)}},r,this)}));return function(t,e){return r.apply(this,arguments)}}()},{key:"broadcastToAppSubscribers",value:function(){var r=o(t().m(function r(e,n,o){var i,u;return t().w(function(t){for(;;)switch(t.n){case 0:return i={app_id:e,data:JSON.stringify({data_type:n,data:o})},t.n=1,this.gudhub.req.post({url:"/ws/broadcast-to-app-subscribers",form:i});case 1:return u=t.v,t.a(2,u)}},r,this)}));return function(t,e,n){return r.apply(this,arguments)}}()}])}();
|
|
347
347
|
},{}],"U9gy":[function(require,module,exports) {
|
|
348
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GudHub=void 0;var e=require("./gudhub-https-service.js"),t=require("./PipeService/PipeService.js"),r=require("./Storage/Storage.js"),i=require("./WebSocket/WebSocket.js"),n=require("./config.js"),o=require("./Utils/Utils.js"),u=require("./Auth/Auth.js"),s=require("./GHConstructor/ghconstructor.js"),a=require("./AppProcessor/AppProcessor.js"),c=require("./ItemProcessor/ItemProcessor.js"),l=require("./FieldProcessor/FieldProcessor.js"),p=require("./FileManager/FileManager.js"),h=require("./ChunksManager/ChunksManager.js"),f=require("./DocumentManager/DocumentManager.js"),d=require("./GHConstructor/interpritate.js"),v=require("./consts.js"),g=require("./WebSocket/WebsocketHandler.js"),y=require("./Utils/sharing/GroupSharing.js"),k=require("./Utils/sharing/GroupInvitation.js"),m=require("./Utils/sharing/Sharing.js"),b=require("./WebSocket/WebSocketEmitter.js");function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(){var e,t,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",n=r.toStringTag||"@@toStringTag";function o(r,i,n,o){var a=i&&i.prototype instanceof s?i:s,c=Object.create(a.prototype);return P(c,"_invoke",function(r,i,n){var o,s,a,c=0,l=n||[],p=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return o=t,s=0,a=e,h.n=r,u}};function f(r,i){for(s=r,a=i,t=0;!p&&c&&!n&&t<l.length;t++){var n,o=l[t],f=h.p,d=o[2];r>3?(n=d===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((n=r<2&&f<o[1])?(s=0,h.v=i,h.n=o[1]):f<d&&(n=r<3||o[0]>i||i>d)&&(o[4]=r,o[5]=i,h.n=d,s=0))}if(n||r>1)return u;throw p=!0,i}return function(n,l,d){if(c>1)throw TypeError("Generator is already running");for(p&&1===l&&f(l,d),s=l,a=d;(t=s<2?e:a)||!p;){o||(s?s<3?(s>1&&(h.n=-1),f(s,a)):h.n=a:h.v=a);try{if(c=2,o){if(s||(n="next"),t=o[n]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+n+"' method"),s=1);o=e}else if((t=(p=h.n<0)?a:r.call(i,h))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:p}}}(r,n,o),!0),c}var u={};function s(){}function a(){}function c(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(P(t={},i,function(){return this}),t),p=c.prototype=s.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,P(e,n,"GeneratorFunction")),e.prototype=Object.create(p),e}return a.prototype=c,P(p,"constructor",c),P(c,"constructor",a),a.displayName="GeneratorFunction",P(c,n,"GeneratorFunction"),P(p),P(p,n,"Generator"),P(p,i,function(){return this}),P(p,"toString",function(){return"[object Generator]"}),(w=function(){return{w:o,m:h}})()}function P(e,t,r,i){var n=Object.defineProperty;try{n({},"",{})}catch(e){n=0}(P=function(e,t,r,i){function o(t,r){P(e,t,function(e){return this._invoke(t,r,e)})}t?n?n(e,t,{value:r,enumerable:!i,configurable:!i,writable:!i}):e[t]=r:(o("next",0),o("throw",1),o("return",2))})(e,t,r,i)}function F(e,t,r,i,n,o,u){try{var s=e[o](u),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(i,n)}function I(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var o=e.apply(t,r);function u(e){F(o,i,n,u,s,"next",e)}function s(e){F(o,i,n,u,s,"throw",e)}u(void 0)})}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,W(i.key),i)}}function q(e,t,r){return t&&j(e.prototype,t),r&&j(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function W(e){var t=A(e,"string");return"symbol"==S(t)?t:t+""}function A(e,t){if("object"!=S(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=S(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var M=exports.GudHub=function(){return q(function v(S){var w=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{server_url:n.server_url,wss_url:n.wss_url,node_server_url:n.node_server_url,initWebsocket:!1,activateSW:!1,swLink:"",async_modules_path:n.async_modules_path,file_server_url:n.file_server_url,automation_modules_path:n.automation_modules_path,accesstoken:this.accesstoken,expirydate:this.expirydate};_(this,v),this.config=w,this.ghconstructor=new s.GHConstructor(this),this.interpritate=new d.Interpritate(this),this.pipeService=new t.PipeService,this.storage=new r.Storage(w.async_modules_path,w.file_server_url,w.automation_modules_path),this.util=new o.Utils(this),this.req=new e.GudHubHttpsService(w.server_url),this.auth=new u.Auth(this.req,this.storage),this.sharing=new m.Sharing(this,this.req),this.groupSharing=new y.GroupSharing(this,this.req,this.pipeService),this.groupInventation=new k.GroupInvitation(this,this.req),S?this.storage.setUser({auth_key:S}):w.accesstoken&&w.expirydate&&this.storage.setUser({accesstoken:w.accesstoken,expirydate:w.expirydate}),this.req.init(this.auth.getToken.bind(this.auth)),this.ws=new i.WebSocketApi(w.wss_url,this.auth),this.chunksManager=new h.ChunksManager(this.storage,this.pipeService,this.req,this.util),this.appProcessor=new a.AppProcessor(this.storage,this.pipeService,this.req,this.ws,this.chunksManager,this.util,w.activateSW),this.itemProcessor=new c.ItemProcessor(this.storage,this.pipeService,this.req,this.appProcessor,this.util),this.fieldProcessor=new l.FieldProcessor(this.storage,this.req,this.appProcessor,this.itemProcessor,this.pipeService),this.fileManager=new p.FileManager(this.storage,this.pipeService,this.req,this.appProcessor),this.documentManager=new f.DocumentManager(this.req,this.pipeService),this.websocketsemitter=new b.WebSocketEmitter(this),w.initWebsocket&&this.ws.initWebSocket(g.WebsocketHandler.bind(this,this),this.appProcessor.refreshApps.bind(this.appProcessor));w.activateSW&&this.activateSW(w.swLink)},[{key:"activateSW",value:function(){var e=I(w().m(function e(t){var r,i;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!(v.IS_WEB&&"serviceWorker"in window.navigator)){e.n=5;break}return e.p=1,e.n=2,window.navigator.serviceWorker.register(t);case 2:(r=e.v).update().then(function(){return console.log("%cSW ->>> Service worker successful updated","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;")}).catch(function(){return console.warn("SW ->>> Service worker is not updated")}),console.log("%cSW ->>> Service worker is registered","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",r),e.n=4;break;case 3:e.p=3,i=e.v,console.warn("%cSW ->>> Service worker is not registered","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",i);case 4:e.n=6;break;case 5:console.log("%cSW ->>> ServiceWorkers not supported","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;");case 6:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}()},{key:"on",value:function(e,t,r){return this.pipeService.on(e,t,r),this}},{key:"emit",value:function(e,t,r,i){return this.pipeService.emit(e,t,r,i),this}},{key:"destroy",value:function(e,t,r){return this.pipeService.destroy(e,t,r),this}},{key:"prefilter",value:function(e,t){return this.util.prefilter(e,t)}},{key:"debounce",value:function(e,t){return this.util.debounce(e,t)}},{key:"emitToUser",value:function(e,t){return this.websocketsemitter.emitToUser(e,t)}},{key:"broadcastToAppSubscribers",value:function(e,t,r){return this.websocketsemitter.broadcastToAppSubscribers(e,t,r)}},{key:"getInterpretation",value:function(e,t,r,i,n,o,u){return this.interpritate.getInterpretation(e,t,r,i,n,o,u)}},{key:"getInterpretationById",value:function(e,t,r,i,n,o){return this.interpritate.getInterpretationById(e,t,r,i,n,o)}},{key:"filter",value:function(e,t){return this.util.filter(e,t)}},{key:"mergeFilters",value:function(e,t){return this.util.mergeFilters(e,t)}},{key:"group",value:function(e,t){return this.util.group(e,t)}},{key:"getFilteredItems",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.util.getFilteredItems(e,t,r.element_app_id,r.app_id,r.item_id,r.field_group,r.search,r.search_params)}},{key:"sortItems",value:function(e,t){return this.util.sortItems(e,t)}},{key:"jsonToItems",value:function(e,t){return this.util.jsonToItems(e,t)}},{key:"getDate",value:function(e){return this.util.getDate(e)}},{key:"populateWithDate",value:function(e,t){return this.util.populateWithDate(e,t)}},{key:"checkRecurringDate",value:function(e,t){return this.util.checkRecurringDate(e,t)}},{key:"populateItems",value:function(e,t,r){return this.util.populateItems(e,t,r)}},{key:"populateWithItemRef",value:function(e,t,r,i,n,o){return this.util.populateWithItemRef(e,t,r,i,n,o)}},{key:"compareItems",value:function(e,t,r){return this.util.compareItems(e,t,r)}},{key:"mergeItems",value:function(e,t,r){return this.util.mergeItems(e,t,r)}},{key:"mergeObjects",value:function(e,t){return this.util.mergeObjects(e,t)}},{key:"makeNestedList",value:function(e,t,r,i,n){return this.util.makeNestedList(e,t,r,i,n)}},{key:"jsonConstructor",value:function(e,t,r,i){return this.util.jsonConstructor(e,t,r,i)}},{key:"getAppsList",value:function(){return this.appProcessor.getAppsList()}},{key:"getAppInfo",value:function(e){return this.appProcessor.getAppInfo(e)}},{key:"deleteApp",value:function(e){return this.appProcessor.deleteApp(e)}},{key:"getApp",value:function(e){return this.appProcessor.getApp(e)}},{key:"updateApp",value:function(e){return this.appProcessor.updateApp(e)}},{key:"updateAppInfo",value:function(e){return this.appProcessor.updateAppInfo(e)}},{key:"createNewApp",value:function(e){return this.appProcessor.createNewApp(e)}},{key:"getItems",value:function(e){return this.itemProcessor.getItems(e)}},{key:"getItem",value:function(){var e=I(w().m(function e(t,r){var i;return w().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getItems(t);case 1:if(!(i=e.v)){e.n=2;break}return e.a(2,i.find(function(e){return e.item_id==r}));case 2:return e.a(2)}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"addNewItems",value:function(e,t){return this.itemProcessor.addNewItems(e,t)}},{key:"updateItems",value:function(e,t){return this.itemProcessor.updateItems(e,t)}},{key:"deleteItems",value:function(e,t){return this.itemProcessor.deleteItems(e,t)}},{key:"restoreItems",value:function(e,t){return this.itemProcessor.restoreItems(e,t)}},{key:"getField",value:function(e,t){return this.fieldProcessor.getField(e,t)}},{key:"getFieldIdByNameSpace",value:function(e,t){return this.fieldProcessor.getFieldIdByNameSpace(e,t)}},{key:"getFieldModels",value:function(e){return this.fieldProcessor.getFieldModels(e)}},{key:"updateField",value:function(e,t){return this.fieldProcessor.updateField(e,t)}},{key:"deleteField",value:function(e,t){return this.fieldProcessor.deleteField(e,t)}},{key:"getFieldValue",value:function(e,t,r){return this.fieldProcessor.getFieldValue(e,t,r)}},{key:"setFieldValue",value:function(e,t,r,i){return this.fieldProcessor.setFieldValue(e,t,r,i)}},{key:"getFile",value:function(e,t){return this.fileManager.getFile(e,t)}},{key:"getFiles",value:function(e,t){return this.fileManager.getFiles(e,t)}},{key:"uploadFile",value:function(e,t,r){return this.fileManager.uploadFile(e,t,r)}},{key:"uploadFileFromString",value:function(e,t,r,i,n,o,u){return this.fileManager.uploadFileFromString(e,t,r,i,n,o,u)}},{key:"updateFileFromString",value:function(e,t,r,i,n,o,u){return this.fileManager.updateFileFromString(e,t,r,i,n,o,u)}},{key:"deleteFile",value:function(e,t){return this.fileManager.deleteFile(e,t)}},{key:"duplicateFile",value:function(e){return this.fileManager.duplicateFile(e)}},{key:"downloadFileFromString",value:function(e,t){return this.fileManager.downloadFileFromString(e,t)}},{key:"createDocument",value:function(e){return this.documentManager.createDocument(e)}},{key:"getDocument",value:function(e){return this.documentManager.getDocument(e)}},{key:"getDocuments",value:function(e){return this.documentManager.getDocuments(e)}},{key:"deleteDocument",value:function(e){return this.documentManager.deleteDocument(e)}},{key:"login",value:function(e){return this.auth.login(e)}},{key:"loginWithToken",value:function(e){return this.auth.loginWithToken(e)}},{key:"logout",value:function(e){return this.appProcessor.clearAppProcessor(),this.auth.logout(e)}},{key:"signup",value:function(e){return this.auth.signup(e)}},{key:"getUsersList",value:function(e){return this.auth.getUsersList(e)}},{key:"updateToken",value:function(e){return this.auth.updateToken(e)}},{key:"avatarUploadApi",value:function(e){return this.auth.avatarUploadApi(e)}},{key:"getVersion",value:function(){return this.auth.getVersion()}},{key:"getUserById",value:function(e){return this.auth.getUserById(e)}},{key:"getToken",value:function(){return this.auth.getToken()}},{key:"updateUser",value:function(e){return this.auth.updateUser(e)}},{key:"updateAvatar",value:function(e){return this.auth.updateAvatar(e)}}])}();
|
|
348
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GudHub=void 0;var e=require("./gudhub-https-service.js"),t=require("./PipeService/PipeService.js"),r=require("./Storage/Storage.js"),i=require("./WebSocket/WebSocket.js"),n=require("./config.js"),o=require("./Utils/Utils.js"),u=require("./Auth/Auth.js"),s=require("./GHConstructor/ghconstructor.js"),a=require("./AppProcessor/AppProcessor.js"),c=require("./ItemProcessor/ItemProcessor.js"),l=require("./FieldProcessor/FieldProcessor.js"),p=require("./FileManager/FileManager.js"),h=require("./ChunksManager/ChunksManager.js"),f=require("./DocumentManager/DocumentManager.js"),d=require("./GHConstructor/interpritate.js"),v=require("./consts.js"),g=require("./WebSocket/WebsocketHandler.js"),y=require("./Utils/sharing/GroupSharing.js"),k=require("./Utils/sharing/GroupInvitation.js"),m=require("./Utils/sharing/Sharing.js"),b=require("./WebSocket/WebSocketEmitter.js");function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(){var e,t,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",n=r.toStringTag||"@@toStringTag";function o(r,i,n,o){var a=i&&i.prototype instanceof s?i:s,c=Object.create(a.prototype);return P(c,"_invoke",function(r,i,n){var o,s,a,c=0,l=n||[],p=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return o=t,s=0,a=e,h.n=r,u}};function f(r,i){for(s=r,a=i,t=0;!p&&c&&!n&&t<l.length;t++){var n,o=l[t],f=h.p,d=o[2];r>3?(n=d===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((n=r<2&&f<o[1])?(s=0,h.v=i,h.n=o[1]):f<d&&(n=r<3||o[0]>i||i>d)&&(o[4]=r,o[5]=i,h.n=d,s=0))}if(n||r>1)return u;throw p=!0,i}return function(n,l,d){if(c>1)throw TypeError("Generator is already running");for(p&&1===l&&f(l,d),s=l,a=d;(t=s<2?e:a)||!p;){o||(s?s<3?(s>1&&(h.n=-1),f(s,a)):h.n=a:h.v=a);try{if(c=2,o){if(s||(n="next"),t=o[n]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+n+"' method"),s=1);o=e}else if((t=(p=h.n<0)?a:r.call(i,h))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:p}}}(r,n,o),!0),c}var u={};function s(){}function a(){}function c(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(P(t={},i,function(){return this}),t),p=c.prototype=s.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,P(e,n,"GeneratorFunction")),e.prototype=Object.create(p),e}return a.prototype=c,P(p,"constructor",c),P(c,"constructor",a),a.displayName="GeneratorFunction",P(c,n,"GeneratorFunction"),P(p),P(p,n,"Generator"),P(p,i,function(){return this}),P(p,"toString",function(){return"[object Generator]"}),(w=function(){return{w:o,m:h}})()}function P(e,t,r,i){var n=Object.defineProperty;try{n({},"",{})}catch(e){n=0}(P=function(e,t,r,i){function o(t,r){P(e,t,function(e){return this._invoke(t,r,e)})}t?n?n(e,t,{value:r,enumerable:!i,configurable:!i,writable:!i}):e[t]=r:(o("next",0),o("throw",1),o("return",2))})(e,t,r,i)}function F(e,t,r,i,n,o,u){try{var s=e[o](u),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(i,n)}function I(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var o=e.apply(t,r);function u(e){F(o,i,n,u,s,"next",e)}function s(e){F(o,i,n,u,s,"throw",e)}u(void 0)})}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,W(i.key),i)}}function q(e,t,r){return t&&j(e.prototype,t),r&&j(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function W(e){var t=A(e,"string");return"symbol"==S(t)?t:t+""}function A(e,t){if("object"!=S(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=S(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var M=exports.GudHub=function(){return q(function v(S){var w=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{server_url:n.server_url,wss_url:n.wss_url,node_server_url:n.node_server_url,initWebsocket:!1,activateSW:!1,swLink:"",async_modules_path:n.async_modules_path,file_server_url:n.file_server_url,automation_modules_path:n.automation_modules_path,accesstoken:this.accesstoken,expirydate:this.expirydate};_(this,v),this.config=w,this.ghconstructor=new s.GHConstructor(this),this.interpritate=new d.Interpritate(this),this.pipeService=new t.PipeService,this.storage=new r.Storage(w.async_modules_path,w.file_server_url,w.automation_modules_path),this.util=new o.Utils(this),this.req=new e.GudHubHttpsService(w.server_url),this.auth=new u.Auth(this.req,this.storage),this.sharing=new m.Sharing(this,this.req),this.groupSharing=new y.GroupSharing(this,this.req,this.pipeService),this.groupInvitation=new k.GroupInvitation(this,this.req),S?this.storage.setUser({auth_key:S}):w.accesstoken&&w.expirydate&&this.storage.setUser({accesstoken:w.accesstoken,expirydate:w.expirydate}),this.req.init(this.auth.getToken.bind(this.auth)),this.ws=new i.WebSocketApi(w.wss_url,this.auth),this.chunksManager=new h.ChunksManager(this.storage,this.pipeService,this.req,this.util),this.appProcessor=new a.AppProcessor(this.storage,this.pipeService,this.req,this.ws,this.chunksManager,this.util,w.activateSW),this.itemProcessor=new c.ItemProcessor(this.storage,this.pipeService,this.req,this.appProcessor,this.util),this.fieldProcessor=new l.FieldProcessor(this.storage,this.req,this.appProcessor,this.itemProcessor,this.pipeService),this.fileManager=new p.FileManager(this.storage,this.pipeService,this.req,this.appProcessor),this.documentManager=new f.DocumentManager(this.req,this.pipeService),this.websocketsemitter=new b.WebSocketEmitter(this),w.initWebsocket&&this.ws.initWebSocket(g.WebsocketHandler.bind(this,this),this.appProcessor.refreshApps.bind(this.appProcessor));w.activateSW&&this.activateSW(w.swLink)},[{key:"activateSW",value:function(){var e=I(w().m(function e(t){var r,i;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!(v.IS_WEB&&"serviceWorker"in window.navigator)){e.n=5;break}return e.p=1,e.n=2,window.navigator.serviceWorker.register(t);case 2:(r=e.v).update().then(function(){return console.log("%cSW ->>> Service worker successful updated","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;")}).catch(function(){return console.warn("SW ->>> Service worker is not updated")}),console.log("%cSW ->>> Service worker is registered","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",r),e.n=4;break;case 3:e.p=3,i=e.v,console.warn("%cSW ->>> Service worker is not registered","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",i);case 4:e.n=6;break;case 5:console.log("%cSW ->>> ServiceWorkers not supported","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;");case 6:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}()},{key:"on",value:function(e,t,r){return this.pipeService.on(e,t,r),this}},{key:"emit",value:function(e,t,r,i){return this.pipeService.emit(e,t,r,i),this}},{key:"destroy",value:function(e,t,r){return this.pipeService.destroy(e,t,r),this}},{key:"prefilter",value:function(e,t){return this.util.prefilter(e,t)}},{key:"debounce",value:function(e,t){return this.util.debounce(e,t)}},{key:"emitToUser",value:function(e,t){return this.websocketsemitter.emitToUser(e,t)}},{key:"broadcastToAppSubscribers",value:function(e,t,r){return this.websocketsemitter.broadcastToAppSubscribers(e,t,r)}},{key:"getInterpretation",value:function(e,t,r,i,n,o,u){return this.interpritate.getInterpretation(e,t,r,i,n,o,u)}},{key:"getInterpretationById",value:function(e,t,r,i,n,o){return this.interpritate.getInterpretationById(e,t,r,i,n,o)}},{key:"filter",value:function(e,t){return this.util.filter(e,t)}},{key:"mergeFilters",value:function(e,t){return this.util.mergeFilters(e,t)}},{key:"group",value:function(e,t){return this.util.group(e,t)}},{key:"getFilteredItems",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.util.getFilteredItems(e,t,r.element_app_id,r.app_id,r.item_id,r.field_group,r.search,r.search_params)}},{key:"sortItems",value:function(e,t){return this.util.sortItems(e,t)}},{key:"jsonToItems",value:function(e,t){return this.util.jsonToItems(e,t)}},{key:"getDate",value:function(e){return this.util.getDate(e)}},{key:"populateWithDate",value:function(e,t){return this.util.populateWithDate(e,t)}},{key:"checkRecurringDate",value:function(e,t){return this.util.checkRecurringDate(e,t)}},{key:"populateItems",value:function(e,t,r){return this.util.populateItems(e,t,r)}},{key:"populateWithItemRef",value:function(e,t,r,i,n,o){return this.util.populateWithItemRef(e,t,r,i,n,o)}},{key:"compareItems",value:function(e,t,r){return this.util.compareItems(e,t,r)}},{key:"mergeItems",value:function(e,t,r){return this.util.mergeItems(e,t,r)}},{key:"mergeObjects",value:function(e,t){return this.util.mergeObjects(e,t)}},{key:"makeNestedList",value:function(e,t,r,i,n){return this.util.makeNestedList(e,t,r,i,n)}},{key:"jsonConstructor",value:function(e,t,r,i){return this.util.jsonConstructor(e,t,r,i)}},{key:"getAppsList",value:function(){return this.appProcessor.getAppsList()}},{key:"getAppInfo",value:function(e){return this.appProcessor.getAppInfo(e)}},{key:"deleteApp",value:function(e){return this.appProcessor.deleteApp(e)}},{key:"getApp",value:function(e){return this.appProcessor.getApp(e)}},{key:"updateApp",value:function(e){return this.appProcessor.updateApp(e)}},{key:"updateAppInfo",value:function(e){return this.appProcessor.updateAppInfo(e)}},{key:"createNewApp",value:function(e){return this.appProcessor.createNewApp(e)}},{key:"getItems",value:function(e){return this.itemProcessor.getItems(e)}},{key:"getItem",value:function(){var e=I(w().m(function e(t,r){var i;return w().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getItems(t);case 1:if(!(i=e.v)){e.n=2;break}return e.a(2,i.find(function(e){return e.item_id==r}));case 2:return e.a(2)}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"addNewItems",value:function(e,t){return this.itemProcessor.addNewItems(e,t)}},{key:"updateItems",value:function(e,t){return this.itemProcessor.updateItems(e,t)}},{key:"deleteItems",value:function(e,t){return this.itemProcessor.deleteItems(e,t)}},{key:"restoreItems",value:function(e,t){return this.itemProcessor.restoreItems(e,t)}},{key:"getField",value:function(e,t){return this.fieldProcessor.getField(e,t)}},{key:"getFieldIdByNameSpace",value:function(e,t){return this.fieldProcessor.getFieldIdByNameSpace(e,t)}},{key:"getFieldModels",value:function(e){return this.fieldProcessor.getFieldModels(e)}},{key:"updateField",value:function(e,t){return this.fieldProcessor.updateField(e,t)}},{key:"deleteField",value:function(e,t){return this.fieldProcessor.deleteField(e,t)}},{key:"getFieldValue",value:function(e,t,r){return this.fieldProcessor.getFieldValue(e,t,r)}},{key:"setFieldValue",value:function(e,t,r,i){return this.fieldProcessor.setFieldValue(e,t,r,i)}},{key:"getFile",value:function(e,t){return this.fileManager.getFile(e,t)}},{key:"getFiles",value:function(e,t){return this.fileManager.getFiles(e,t)}},{key:"uploadFile",value:function(e,t,r){return this.fileManager.uploadFile(e,t,r)}},{key:"uploadFileFromString",value:function(e,t,r,i,n,o,u){return this.fileManager.uploadFileFromString(e,t,r,i,n,o,u)}},{key:"updateFileFromString",value:function(e,t,r,i,n,o,u){return this.fileManager.updateFileFromString(e,t,r,i,n,o,u)}},{key:"deleteFile",value:function(e,t){return this.fileManager.deleteFile(e,t)}},{key:"duplicateFile",value:function(e){return this.fileManager.duplicateFile(e)}},{key:"downloadFileFromString",value:function(e,t){return this.fileManager.downloadFileFromString(e,t)}},{key:"createDocument",value:function(e){return this.documentManager.createDocument(e)}},{key:"getDocument",value:function(e){return this.documentManager.getDocument(e)}},{key:"getDocuments",value:function(e){return this.documentManager.getDocuments(e)}},{key:"deleteDocument",value:function(e){return this.documentManager.deleteDocument(e)}},{key:"login",value:function(e){return this.auth.login(e)}},{key:"loginWithToken",value:function(e){return this.auth.loginWithToken(e)}},{key:"logout",value:function(e){return this.appProcessor.clearAppProcessor(),this.auth.logout(e)}},{key:"signup",value:function(e){return this.auth.signup(e)}},{key:"getUsersList",value:function(e){return this.auth.getUsersList(e)}},{key:"updateToken",value:function(e){return this.auth.updateToken(e)}},{key:"avatarUploadApi",value:function(e){return this.auth.avatarUploadApi(e)}},{key:"getVersion",value:function(){return this.auth.getVersion()}},{key:"getUserById",value:function(e){return this.auth.getUserById(e)}},{key:"getToken",value:function(){return this.auth.getToken()}},{key:"updateUser",value:function(e){return this.auth.updateUser(e)}},{key:"updateAvatar",value:function(e){return this.auth.updateAvatar(e)}}])}();
|
|
349
349
|
},{"./gudhub-https-service.js":"hDvy","./PipeService/PipeService.js":"E3xI","./Storage/Storage.js":"CSHe","./WebSocket/WebSocket.js":"pHMV","./config.js":"TPH7","./Utils/Utils.js":"mWlG","./Auth/Auth.js":"rK64","./GHConstructor/ghconstructor.js":"Htuh","./AppProcessor/AppProcessor.js":"q0my","./ItemProcessor/ItemProcessor.js":"UUd3","./FieldProcessor/FieldProcessor.js":"PoPF","./FileManager/FileManager.js":"XUT2","./ChunksManager/ChunksManager.js":"KHGc","./DocumentManager/DocumentManager.js":"K1Gs","./GHConstructor/interpritate.js":"X4Dt","./consts.js":"UV2u","./WebSocket/WebsocketHandler.js":"sPce","./Utils/sharing/GroupSharing.js":"LS0j","./Utils/sharing/GroupInvitation.js":"kPfD","./Utils/sharing/Sharing.js":"XaHW","./WebSocket/WebSocketEmitter.js":"quyV"}],"iRRN":[function(require,module,exports) {
|
|
350
350
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"GudHub",{enumerable:!0,get:function(){return e.GudHub}}),exports.default=void 0,require("regenerator-runtime/runtime.js");var e=require("./GUDHUB/gudhub.js"),r=exports.default=e.GudHub;
|
|
351
351
|
},{"regenerator-runtime/runtime.js":"KA2S","./GUDHUB/gudhub.js":"U9gy"}]},{},["iRRN"], "GudHubLibrary")
|