@gudhub/core 1.1.152 → 1.1.154
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/GUDHUB/Auth/Auth.js +12 -0
- package/GUDHUB/Auth/Auth.test.js +11 -0
- package/GUDHUB/ItemProcessor/ItemProcessor.js +1 -1
- package/GUDHUB/Utils/groupManager/GroupManager.js +2 -1
- package/GUDHUB/Utils/sharing/GroupSharing.js +2 -2
- package/GUDHUB/gudhub.js +4 -0
- package/Readme.md +11 -0
- package/fake_server/fake_java_server.js +8 -1
- package/package.json +1 -1
- package/umd/library.min.js +5 -5
- package/umd/library.min.js.map +1 -1
- package/.claude/scheduled_tasks.lock +0 -1
package/GUDHUB/Auth/Auth.js
CHANGED
|
@@ -54,6 +54,14 @@ export class Auth {
|
|
|
54
54
|
return usersList;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
async getUserWorkspace() {
|
|
58
|
+
const usersList = await this.getUserWorkspaceApi();
|
|
59
|
+
|
|
60
|
+
usersList.forEach((user) => this.saveUserToStorage(user));
|
|
61
|
+
|
|
62
|
+
return usersList;
|
|
63
|
+
}
|
|
64
|
+
|
|
57
65
|
async loginApi(username, password) {
|
|
58
66
|
try {
|
|
59
67
|
const user = await this.req.axiosRequest({
|
|
@@ -128,6 +136,10 @@ export class Auth {
|
|
|
128
136
|
});
|
|
129
137
|
}
|
|
130
138
|
|
|
139
|
+
getUserWorkspaceApi() {
|
|
140
|
+
return this.req.get({ url: "/auth/get-user-workspace" });
|
|
141
|
+
}
|
|
142
|
+
|
|
131
143
|
updateUserApi(userData) {
|
|
132
144
|
return this.req.post({
|
|
133
145
|
url: "/auth/updateuser",
|
package/GUDHUB/Auth/Auth.test.js
CHANGED
|
@@ -57,6 +57,17 @@ describe("AUTHORIZATION", async function() {
|
|
|
57
57
|
user.fullname.should.equal('Vasya Pupkin');
|
|
58
58
|
})
|
|
59
59
|
|
|
60
|
+
it("Get user workspace / It should return workspace users and cache them in storage", async function () {
|
|
61
|
+
const gudhub = new GudHub(auth_key);
|
|
62
|
+
const usersList = await gudhub.getUserWorkspace();
|
|
63
|
+
|
|
64
|
+
usersList.length.should.be.above(0);
|
|
65
|
+
|
|
66
|
+
usersList.forEach((user) => {
|
|
67
|
+
gudhub.storage.getUsersList().find((u) => u.user_id == user.user_id).should.be.ok;
|
|
68
|
+
});
|
|
69
|
+
})
|
|
70
|
+
|
|
60
71
|
it("Update user avatar", async function() {
|
|
61
72
|
const gudhub = new GudHub(auth_key);
|
|
62
73
|
|
|
@@ -6,11 +6,12 @@ export class GroupManager {
|
|
|
6
6
|
|
|
7
7
|
//********************* CREATE GROUP *********************//
|
|
8
8
|
|
|
9
|
-
async createGroupApi(groupName) {
|
|
9
|
+
async createGroupApi(groupName, isPrivate = false) {
|
|
10
10
|
try {
|
|
11
11
|
const form = {
|
|
12
12
|
token: await this.gudhub.auth.getToken(),
|
|
13
13
|
group_name: groupName,
|
|
14
|
+
private: isPrivate,
|
|
14
15
|
};
|
|
15
16
|
const group = await this.req.post({
|
|
16
17
|
url: "/api/sharing-group/create-group",
|
|
@@ -9,8 +9,8 @@ export class GroupSharing {
|
|
|
9
9
|
this.appGroupSharing = new AppGroupSharing(gudhub, req);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
createGroup(groupName) {
|
|
13
|
-
return this.groupManager.createGroupApi(groupName);
|
|
12
|
+
createGroup(groupName, isPrivate = false) {
|
|
13
|
+
return this.groupManager.createGroupApi(groupName, isPrivate);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
updateGroup(groupId, groupName) {
|
package/GUDHUB/gudhub.js
CHANGED
package/Readme.md
CHANGED
|
@@ -43,6 +43,7 @@ I't a Library to simplify work with GudHub API. Also this Library contains utili
|
|
|
43
43
|
- [signup()](#signup)
|
|
44
44
|
- [getUserById()](#getuserbyid)
|
|
45
45
|
- [getUsersList()](#getuserslist)
|
|
46
|
+
- [getUserWorkspace()](#getuserworkspace)
|
|
46
47
|
- [updateUser()](#updateuser)
|
|
47
48
|
- [getToken()](#gettoken)
|
|
48
49
|
- [updateToken()](#updatetoken)
|
|
@@ -294,6 +295,16 @@ gudhub.getUsersList(keyword);
|
|
|
294
295
|
|
|
295
296
|
Read more information about [getUsersList on GudHub](https://app.gudhub.com/docs/core-api/auth-core-api/#getuserslist).
|
|
296
297
|
|
|
298
|
+
### getUserWorkspace()
|
|
299
|
+
|
|
300
|
+
This method is used to get the list of users belonging to the current user's workspace. Returned users are cached in storage.
|
|
301
|
+
|
|
302
|
+
```js
|
|
303
|
+
gudhub.getUserWorkspace();
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
Read more information about [getUserWorkspace on GudHub](https://app.gudhub.com/docs/core-api/auth-core-api/#getuserworkspace).
|
|
307
|
+
|
|
297
308
|
### updateUser()
|
|
298
309
|
|
|
299
310
|
This is the method used to update user account data.
|
|
@@ -80,6 +80,13 @@ export default function (app) {
|
|
|
80
80
|
res.status(200).send(data.token);
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
+
app.get('/auth/get-user-workspace', (req, res) => {
|
|
84
|
+
res.status(200).send([
|
|
85
|
+
{ user_id: "58", fullname: "Vasya Pupkin", avatar_128: "https://app.gudhub.com/avatars/58_5556_128.jpg", avatar_512: "https://app.gudhub.com/avatars/58_5556_512.jpg" },
|
|
86
|
+
{ user_id: "59", fullname: "Petya Ronaldinho", avatar_128: "https://app.gudhub.com/avatars/59_5556_128.jpg", avatar_512: "https://app.gudhub.com/avatars/59_5556_512.jpg" },
|
|
87
|
+
]);
|
|
88
|
+
});
|
|
89
|
+
|
|
83
90
|
|
|
84
91
|
app.post('/api/items/update', (req, res) => {
|
|
85
92
|
let result = null;
|
|
@@ -293,7 +300,7 @@ export default function (app) {
|
|
|
293
300
|
});
|
|
294
301
|
|
|
295
302
|
app.post('/api/sharing-group/create-group', (req, res) => {
|
|
296
|
-
res.status(200).send({ group_id: 1, group_name: req.body.group_name });
|
|
303
|
+
res.status(200).send({ group_id: 1, group_name: req.body.group_name, private: req.body.private === true || req.body.private === 'true' });
|
|
297
304
|
})
|
|
298
305
|
|
|
299
306
|
app.post('/api/sharing-group/update-group', (req, res) => {
|
package/package.json
CHANGED
package/umd/library.min.js
CHANGED
|
@@ -305,7 +305,7 @@ function o(e){return module.exports=o="function"==typeof Symbol&&"symbol"==typeo
|
|
|
305
305
|
},{}],"mWlG":[function(require,module,exports) {
|
|
306
306
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Utils=void 0;var e=require("./filter/filterPreparation.js"),t=b(require("./filter/filter.js")),r=require("./filter/mergeFilters.js"),n=require("./json_to_items/json_to_items.js"),i=require("./merge_compare_items/merge_compare_items.js"),o=require("./filter/group.js"),u=require("./filter/utils.js"),s=b(require("./populate_items/populate_items.js")),l=require("./get_date/get_date.js"),a=require("./merge_objects/merge_objects.js"),c=require("./merge_chunks/merge_chunks.js"),f=require("./nested_list/nested_list.js"),p=b(require("./MergeFields/MergeFields.js")),m=b(require("./ItemsSelection/ItemsSelection.js")),v=require("./compare_items_lists_worker/compare_items_lists.worker.js"),y=require("./json_constructor/json_constructor.js"),h=b(require("./AppsTemplateService/AppsTemplateService.js")),d=require("./FIleHelper/FileHelper.js"),g=require("./compareObjects/compareObjects.js"),j=require("./dynamicPromiseAll/dynamicPromiseAll.js"),k=require("./filter/sortItems.js");function b(e){return e&&e.__esModule?e:{default:e}}function _(e){return(_="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 I(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var l=n&&n.prototype instanceof s?n:s,a=Object.create(l.prototype);return w(a,"_invoke",function(r,n,i){var o,s,l,a=0,c=i||[],f=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return o=t,s=0,l=e,p.n=r,u}};function m(r,n){for(s=r,l=n,t=0;!f&&a&&!i&&t<c.length;t++){var i,o=c[t],m=p.p,v=o[2];r>3?(i=v===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((i=r<2&&m<o[1])?(s=0,p.v=n,p.n=o[1]):m<v&&(i=r<3||o[0]>n||n>v)&&(o[4]=r,o[5]=n,p.n=v,s=0))}if(i||r>1)return u;throw f=!0,n}return function(i,c,v){if(a>1)throw TypeError("Generator is already running");for(f&&1===c&&m(c,v),s=c,l=v;(t=s<2?e:l)||!f;){o||(s?s<3?(s>1&&(p.n=-1),m(s,l)):p.n=l:p.v=l);try{if(a=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=p.n<0)?l:r.call(n,p))!==u)break}catch(t){o=e,s=1,l=t}finally{a=1}}return{value:t,done:f}}}(r,i,o),!0),a}var u={};function s(){}function l(){}function a(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(w(t={},n,function(){return this}),t),f=a.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,w(e,i,"GeneratorFunction")),e.prototype=Object.create(f),e}return l.prototype=a,w(f,"constructor",a),w(a,"constructor",l),l.displayName="GeneratorFunction",w(a,i,"GeneratorFunction"),w(f),w(f,i,"Generator"),w(f,n,function(){return this}),w(f,"toString",function(){return"[object Generator]"}),(I=function(){return{w:o,m:p}})()}function w(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(w=function(e,t,r,n){function o(t,r){w(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(o("next",0),o("throw",1),o("return",2))})(e,t,r,n)}function S(e,t,r,n,i,o,u){try{var s=e[o](u),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function F(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function u(e){S(o,n,i,u,s,"next",e)}function s(e){S(o,n,i,u,s,"throw",e)}u(void 0)})}}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q(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,P(n.key),n)}}function O(e,t,r){return t&&q(e.prototype,t),r&&q(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function P(e){var t=A(e,"string");return"symbol"==_(t)?t:t+""}function A(e,t){if("object"!=_(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var L=exports.Utils=function(){return O(function e(t){T(this,e),this.gudhub=t,this.MergeFields=new p.default(t),this.ItemsSelection=new m.default(t),this.AppsTemplateService=new h.default(t),this.FileHelper=new d.FileHelper(t)},[{key:"prefilter",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,e.filterPreparation)(t,this.gudhub.storage,this.gudhub.pipeService,r)}},{key:"filter",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,t.default)(e,r,n)}},{key:"mergeFilters",value:function(e,t){return(0,r.mergeFilters)(e,t)}},{key:"group",value:function(e,t){return(0,o.group)(e,t)}},{key:"getFilteredItems",value:function(){var e=F(I().m(function e(){var t,r,n,i,o,s,l,a,c,f,p,m,v=arguments;return I().w(function(e){for(;;)switch(e.n){case 0:return t=v.length>0&&void 0!==v[0]?v[0]:[],r=v.length>1&&void 0!==v[1]?v[1]:[],n=v.length>2?v[2]:void 0,i=v.length>3?v[3]:void 0,o=v.length>4?v[4]:void 0,s=v.length>5&&void 0!==v[5]?v[5]:"",l=v.length>6?v[6]:void 0,a=v.length>7?v[7]:void 0,c=v.length>8&&void 0!==v[8]&&v[8],e.n=1,this.prefilter(r,{element_app_id:n,app_id:i,item_id:o});case 1:return f=e.v,p=this.filter(t,f,c),m=this.group(s,p),e.a(2,m.filter(function(e){return!l||1===(0,u.searchValue)([e],l).length}).filter(function(e){return!a||1===(0,u.searchValue)([e],a).length}))}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"jsonToItems",value:function(e,t){return(0,n.jsonToItems)(e,t)}},{key:"getDate",value:function(e){return(0,l.getDate)(e)}},{key:"checkRecurringDate",value:function(e,t){return(0,l.checkRecurringDate)(e,t)}},{key:"populateItems",value:function(e,t,r){return(0,s.default)(e,t,r)}},{key:"populateWithDate",value:function(e,t){return(0,l.populateWithDate)(e,t)}},{key:"populateWithItemRef",value:function(e,t,r,n,o,u){return(0,i.populateWithItemRef)(e,t,r,n,o,u)}},{key:"compareItems",value:function(e,t,r){return(0,i.compareItems)(e,t,r)}},{key:"mergeItems",value:function(e,t,r){return(0,i.mergeItems)(e,t,r)}},{key:"mergeObjects",value:function(e,t,r){return(0,a.mergeObjects)(e,t,r)}},{key:"makeNestedList",value:function(e,t,r,n,i){return(0,f.makeNestedList)(e,t,r,n,i)}},{key:"mergeChunks",value:function(e){return(0,c.mergeChunks)(e)}},{key:"mergeFieldLists",value:function(e,t){return this.MergeFields.mergeFieldLists(e,t)}},{key:"createFieldsListToView",value:function(e,t){return this.MergeFields.createFieldsListToView(e,t)}},{key:"createFieldsListToViewWithDataType",value:function(e,t){return this.MergeFields.createFieldsListToViewWithDataType(e,t)}},{key:"selectItems",value:function(e,t){return this.ItemsSelection.selectItems(e,t)}},{key:"getSelectedItems",value:function(e){return this.ItemsSelection.getSelectedItems(e)}},{key:"clearSelectedItems",value:function(e){return this.ItemsSelection.clearSelectedItems(e)}},{key:"isItemSelected",value:function(e,t){return this.ItemsSelection.isItemSelected(e,t)}},{key:"jsonConstructor",value:function(e,t,r,n){return(0,y.compiler)(e,t,this,r,n)}},{key:"fileInstallerHelper",value:function(e,t,r,n,i,o){return this.FileHelper.fileInstallerHelper(e,t,r,n,i,o)}},{key:"createAppsFromTemplate",value:function(e,t,r,n,i,o){return this.AppsTemplateService.createAppsFromTemplate(e,t,r,n,i,o)}},{key:"createApps",value:function(e){return this.AppsTemplateService.createApps(e)}},{key:"createItems",value:function(e,t){return this.AppsTemplateService.createItems(e,t)}},{key:"compareObjects",value:function(e,t){return(0,g.compareObjects)(e,t)}},{key:"compareAppsItemsLists",value:function(e,t,r){var n=new Blob([(0,v.compare_items_lists_Worker)()],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(n)),this.worker.postMessage({items_list1:e,items_list2:t}),this.worker.addEventListener("message",function(e){var t=e.data.diff;r(t)})}},{key:"dynamicPromiseAll",value:function(e){return(0,j.dynamicPromiseAll)(e)}},{key:"sortItems",value:function(e,t){return(0,k.sortItems)(e,t)}},{key:"debounce",value:function(e,t){var r;return function(){for(var n=this,i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];clearTimeout(r),r=setTimeout(function(){e.apply(n,o)},t)}}}])}();
|
|
307
307
|
},{"./filter/filterPreparation.js":"DvAj","./filter/filter.js":"mbGN","./filter/mergeFilters.js":"LXWr","./json_to_items/json_to_items.js":"UCDv","./merge_compare_items/merge_compare_items.js":"xDLX","./filter/group.js":"VgUi","./filter/utils.js":"zsiC","./populate_items/populate_items.js":"EzAv","./get_date/get_date.js":"VzfS","./merge_objects/merge_objects.js":"EE1j","./merge_chunks/merge_chunks.js":"AMYJ","./nested_list/nested_list.js":"S7Iy","./MergeFields/MergeFields.js":"vno1","./ItemsSelection/ItemsSelection.js":"DfIi","./compare_items_lists_worker/compare_items_lists.worker.js":"xR4c","./json_constructor/json_constructor.js":"nKaW","./AppsTemplateService/AppsTemplateService.js":"zqOZ","./FIleHelper/FileHelper.js":"E7yc","./compareObjects/compareObjects.js":"AefJ","./dynamicPromiseAll/dynamicPromiseAll.js":"ndUf","./filter/sortItems.js":"Owq4"}],"rK64":[function(require,module,exports) {
|
|
308
|
-
"use strict";function t(r){return(t="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})(r)}function r(){var t,n,o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",i=o.toStringTag||"@@toStringTag";function a(r,o,u,i){var a=o&&o.prototype instanceof c?o:c,f=Object.create(a.prototype);return e(f,"_invoke",function(r,e,o){var u,i,a,c=0,f=o||[],p=!1,l={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(r,e){return u=r,i=0,a=t,l.n=e,s}};function h(r,e){for(i=r,a=e,n=0;!p&&c&&!o&&n<f.length;n++){var o,u=f[n],h=l.p,v=u[2];r>3?(o=v===e)&&(a=u[(i=u[4])?5:(i=3,3)],u[4]=u[5]=t):u[0]<=h&&((o=r<2&&h<u[1])?(i=0,l.v=e,l.n=u[1]):h<v&&(o=r<3||u[0]>e||e>v)&&(u[4]=r,u[5]=e,l.n=v,i=0))}if(o||r>1)return s;throw p=!0,e}return function(o,f,v){if(c>1)throw TypeError("Generator is already running");for(p&&1===f&&h(f,v),i=f,a=v;(n=i<2?t:a)||!p;){u||(i?i<3?(i>1&&(l.n=-1),h(i,a)):l.n=a:l.v=a);try{if(c=2,u){if(i||(o="next"),n=u[o]){if(!(n=n.call(u,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,i<2&&(i=0)}else 1===i&&(n=u.return)&&n.call(u),i<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),i=1);u=t}else if((n=(p=l.n<0)?a:r.call(e,l))!==s)break}catch(n){u=t,i=1,a=n}finally{c=1}}return{value:n,done:p}}}(r,u,i),!0),f}var s={};function c(){}function f(){}function p(){}n=Object.getPrototypeOf;var l=[][u]?n(n([][u]())):(e(n={},u,function(){return this}),n),h=p.prototype=c.prototype=Object.create(l);function v(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,e(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return f.prototype=p,e(h,"constructor",p),e(p,"constructor",f),f.displayName="GeneratorFunction",e(p,i,"GeneratorFunction"),e(h),e(h,i,"Generator"),e(h,u,function(){return this}),e(h,"toString",function(){return"[object Generator]"}),(r=function(){return{w:a,m:v}})()}function e(t,r,n,o){var u=Object.defineProperty;try{u({},"",{})}catch(t){u=0}(e=function(t,r,n,o){function i(r,n){e(t,r,function(t){return this._invoke(r,n,t)})}r?u?u(t,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[r]=n:(i("next",0),i("throw",1),i("return",2))})(t,r,n,o)}function n(t,r,e,n,o,u,i){try{var a=t[u](i),s=a.value}catch(t){return void e(t)}a.done?r(s):Promise.resolve(s).then(n,o)}function o(t){return function(){var r=this,e=arguments;return new Promise(function(o,u){var i=t.apply(r,e);function a(t){n(i,o,u,a,s,"next",t)}function s(t){n(i,o,u,a,s,"throw",t)}a(void 0)})}}function u(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function i(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,s(n.key),n)}}function a(t,r,e){return r&&i(t.prototype,r),e&&i(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(r){var e=c(r,"string");return"symbol"==t(e)?e:e+""}function c(r,e){if("object"!=t(r)||!r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var o=n.call(r,e||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(r)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Auth=void 0;var f=exports.Auth=function(){return a(function t(r,e){u(this,t),this.req=r,this.storage=e},[{key:"login",value:function(){var t=o(r().m(function t(){var e,n,o,u,i,a,s=arguments;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return e=s.length>0&&void 0!==s[0]?s[0]:{},n=e.username,o=e.password,t.p=1,t.n=2,this.loginApi(n,o);case 2:return u=t.v,this.storage.updateUser(u),t.a(2,u);case 3:return t.p=3,a=t.v,t.a(2,{error:(null===(i=a.response)||void 0===i?void 0:i.data)||a.message})}},t,this,[[1,3]])}));return function(){return t.apply(this,arguments)}}()},{key:"loginWithToken",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.loginWithTokenApi(e);case 1:return n=t.v,this.storage.updateUser(n),t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"logout",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.logoutApi(e);case 1:return n=t.v,t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"signup",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.signupApi(e);case 1:return n=t.v,t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateToken",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.updateTokenApi(e);case 1:return n=t.v,t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateUser",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.updateUserApi(e);case 1:return n=t.v,this.storage.updateUser(n),t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateAvatar",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.avatarUploadApi(e);case 1:return n=t.v,this.storage.updateUser(n),t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"getUsersList",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.getUsersListApi(e);case 1:return n=t.v,t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"loginApi",value:function(){var t=o(r().m(function t(e,n){var o,u,i,a;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login"),form:{username:e,password:n}});case 1:return o=t.v,t.a(2,o);case 2:return t.p=2,a=t.v,console.log(a),t.a(2,{status:null===(u=a.response)||void 0===u?void 0:u.status,message:null===(i=a.response)||void 0===i?void 0:i.data})}},t,this,[[0,2]])}));return function(r,e){return t.apply(this,arguments)}}()},{key:"loginWithTokenApi",value:function(){var t=o(r().m(function t(e){var n,o;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login?accesstoken=").concat(e)});case 1:return n=t.v,t.a(2,n);case 2:t.p=2,o=t.v,console.log(o);case 3:return t.a(2)}},t,this,[[0,2]])}));return function(r){return t.apply(this,arguments)}}()},{key:"updateTokenApi",value:function(){var t=o(r().m(function t(e){var n,o;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login"),form:{auth_key:e}});case 1:return n=t.v,t.a(2,n);case 2:t.p=2,o=t.v,console.log(o);case 3:return t.a(2)}},t,this,[[0,2]])}));return function(r){return t.apply(this,arguments)}}()},{key:"logoutApi",value:function(t){return this.req.post({url:"/auth/logout",form:{token:t}})}},{key:"signupApi",value:function(t){return this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/singup"),form:{user:JSON.stringify(t)}})}},{key:"getUsersListApi",value:function(t){return this.req.get({url:"/auth/userlist",params:{keyword:t}})}},{key:"updateUserApi",value:function(t){return this.req.post({url:"/auth/updateuser",form:{user:JSON.stringify(t)}})}},{key:"avatarUploadApi",value:function(t){return this.req.post({url:"/auth/avatar-upload",form:{image:t}})}},{key:"getUserByIdApi",value:function(t){return this.req.get({url:"/auth/getuserbyid",params:{id:t}})}},{key:"getVersion",value:function(){return this.req.get({url:"/version"})}},{key:"getUserFromStorage",value:function(t){return this.storage.getUsersList().find(function(r){return r.user_id==t})}},{key:"saveUserToStorage",value:function(t){var r=this.storage.getUsersList(),e=r.find(function(r){return r.user_id==t.user_id});return e||(r.push(t),t)}},{key:"getUserById",value:function(){var t=o(r().m(function t(e){var n,o;return r().w(function(t){for(;;)switch(t.n){case 0:if(n=this.getUserFromStorage(e)){t.n=3;break}return t.n=1,this.getUserByIdApi(e);case 1:if(o=t.v){t.n=2;break}return t.a(2,null);case 2:(n=this.getUserFromStorage(e))||(this.saveUserToStorage(o),n=o);case 3:return t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"getToken",value:function(){var t=o(r().m(function t(){var e,n,o,u;return r().w(function(t){for(;;)switch(t.n){case 0:if(e=new Date(this.storage.getUser().expirydate),n=new Date,o=this.storage.getUser().accesstoken,!(e<n)&&o){t.n=2;break}return t.n=1,this.updateToken(this.storage.getUser().auth_key);case 1:u=t.v,this.storage.updateUser(u),o=u.accesstoken;case 2:return t.a(2,o)}},t,this)}));return function(){return t.apply(this,arguments)}}()}])}();
|
|
308
|
+
"use strict";function t(r){return(t="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})(r)}function r(){var t,n,o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",i=o.toStringTag||"@@toStringTag";function a(r,o,u,i){var a=o&&o.prototype instanceof c?o:c,f=Object.create(a.prototype);return e(f,"_invoke",function(r,e,o){var u,i,a,c=0,f=o||[],p=!1,l={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(r,e){return u=r,i=0,a=t,l.n=e,s}};function h(r,e){for(i=r,a=e,n=0;!p&&c&&!o&&n<f.length;n++){var o,u=f[n],h=l.p,v=u[2];r>3?(o=v===e)&&(a=u[(i=u[4])?5:(i=3,3)],u[4]=u[5]=t):u[0]<=h&&((o=r<2&&h<u[1])?(i=0,l.v=e,l.n=u[1]):h<v&&(o=r<3||u[0]>e||e>v)&&(u[4]=r,u[5]=e,l.n=v,i=0))}if(o||r>1)return s;throw p=!0,e}return function(o,f,v){if(c>1)throw TypeError("Generator is already running");for(p&&1===f&&h(f,v),i=f,a=v;(n=i<2?t:a)||!p;){u||(i?i<3?(i>1&&(l.n=-1),h(i,a)):l.n=a:l.v=a);try{if(c=2,u){if(i||(o="next"),n=u[o]){if(!(n=n.call(u,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,i<2&&(i=0)}else 1===i&&(n=u.return)&&n.call(u),i<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),i=1);u=t}else if((n=(p=l.n<0)?a:r.call(e,l))!==s)break}catch(n){u=t,i=1,a=n}finally{c=1}}return{value:n,done:p}}}(r,u,i),!0),f}var s={};function c(){}function f(){}function p(){}n=Object.getPrototypeOf;var l=[][u]?n(n([][u]())):(e(n={},u,function(){return this}),n),h=p.prototype=c.prototype=Object.create(l);function v(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,e(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return f.prototype=p,e(h,"constructor",p),e(p,"constructor",f),f.displayName="GeneratorFunction",e(p,i,"GeneratorFunction"),e(h),e(h,i,"Generator"),e(h,u,function(){return this}),e(h,"toString",function(){return"[object Generator]"}),(r=function(){return{w:a,m:v}})()}function e(t,r,n,o){var u=Object.defineProperty;try{u({},"",{})}catch(t){u=0}(e=function(t,r,n,o){function i(r,n){e(t,r,function(t){return this._invoke(r,n,t)})}r?u?u(t,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[r]=n:(i("next",0),i("throw",1),i("return",2))})(t,r,n,o)}function n(t,r,e,n,o,u,i){try{var a=t[u](i),s=a.value}catch(t){return void e(t)}a.done?r(s):Promise.resolve(s).then(n,o)}function o(t){return function(){var r=this,e=arguments;return new Promise(function(o,u){var i=t.apply(r,e);function a(t){n(i,o,u,a,s,"next",t)}function s(t){n(i,o,u,a,s,"throw",t)}a(void 0)})}}function u(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function i(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,s(n.key),n)}}function a(t,r,e){return r&&i(t.prototype,r),e&&i(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(r){var e=c(r,"string");return"symbol"==t(e)?e:e+""}function c(r,e){if("object"!=t(r)||!r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var o=n.call(r,e||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(r)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Auth=void 0;var f=exports.Auth=function(){return a(function t(r,e){u(this,t),this.req=r,this.storage=e},[{key:"login",value:function(){var t=o(r().m(function t(){var e,n,o,u,i,a,s=arguments;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return e=s.length>0&&void 0!==s[0]?s[0]:{},n=e.username,o=e.password,t.p=1,t.n=2,this.loginApi(n,o);case 2:return u=t.v,this.storage.updateUser(u),t.a(2,u);case 3:return t.p=3,a=t.v,t.a(2,{error:(null===(i=a.response)||void 0===i?void 0:i.data)||a.message})}},t,this,[[1,3]])}));return function(){return t.apply(this,arguments)}}()},{key:"loginWithToken",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.loginWithTokenApi(e);case 1:return n=t.v,this.storage.updateUser(n),t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"logout",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.logoutApi(e);case 1:return n=t.v,t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"signup",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.signupApi(e);case 1:return n=t.v,t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateToken",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.updateTokenApi(e);case 1:return n=t.v,t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateUser",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.updateUserApi(e);case 1:return n=t.v,this.storage.updateUser(n),t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateAvatar",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.avatarUploadApi(e);case 1:return n=t.v,this.storage.updateUser(n),t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"getUsersList",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.getUsersListApi(e);case 1:return n=t.v,t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"getUserWorkspace",value:function(){var t=o(r().m(function t(){var e,n=this;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.getUserWorkspaceApi();case 1:return(e=t.v).forEach(function(t){return n.saveUserToStorage(t)}),t.a(2,e)}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"loginApi",value:function(){var t=o(r().m(function t(e,n){var o,u,i,a;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login"),form:{username:e,password:n}});case 1:return o=t.v,t.a(2,o);case 2:return t.p=2,a=t.v,console.log(a),t.a(2,{status:null===(u=a.response)||void 0===u?void 0:u.status,message:null===(i=a.response)||void 0===i?void 0:i.data})}},t,this,[[0,2]])}));return function(r,e){return t.apply(this,arguments)}}()},{key:"loginWithTokenApi",value:function(){var t=o(r().m(function t(e){var n,o;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login?accesstoken=").concat(e)});case 1:return n=t.v,t.a(2,n);case 2:t.p=2,o=t.v,console.log(o);case 3:return t.a(2)}},t,this,[[0,2]])}));return function(r){return t.apply(this,arguments)}}()},{key:"updateTokenApi",value:function(){var t=o(r().m(function t(e){var n,o;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login"),form:{auth_key:e}});case 1:return n=t.v,t.a(2,n);case 2:t.p=2,o=t.v,console.log(o);case 3:return t.a(2)}},t,this,[[0,2]])}));return function(r){return t.apply(this,arguments)}}()},{key:"logoutApi",value:function(t){return this.req.post({url:"/auth/logout",form:{token:t}})}},{key:"signupApi",value:function(t){return this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/singup"),form:{user:JSON.stringify(t)}})}},{key:"getUsersListApi",value:function(t){return this.req.get({url:"/auth/userlist",params:{keyword:t}})}},{key:"getUserWorkspaceApi",value:function(){return this.req.get({url:"/auth/get-user-workspace"})}},{key:"updateUserApi",value:function(t){return this.req.post({url:"/auth/updateuser",form:{user:JSON.stringify(t)}})}},{key:"avatarUploadApi",value:function(t){return this.req.post({url:"/auth/avatar-upload",form:{image:t}})}},{key:"getUserByIdApi",value:function(t){return this.req.get({url:"/auth/getuserbyid",params:{id:t}})}},{key:"getVersion",value:function(){return this.req.get({url:"/version"})}},{key:"getUserFromStorage",value:function(t){return this.storage.getUsersList().find(function(r){return r.user_id==t})}},{key:"saveUserToStorage",value:function(t){var r=this.storage.getUsersList(),e=r.find(function(r){return r.user_id==t.user_id});return e||(r.push(t),t)}},{key:"getUserById",value:function(){var t=o(r().m(function t(e){var n,o;return r().w(function(t){for(;;)switch(t.n){case 0:if(n=this.getUserFromStorage(e)){t.n=3;break}return t.n=1,this.getUserByIdApi(e);case 1:if(o=t.v){t.n=2;break}return t.a(2,null);case 2:(n=this.getUserFromStorage(e))||(this.saveUserToStorage(o),n=o);case 3:return t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"getToken",value:function(){var t=o(r().m(function t(){var e,n,o,u;return r().w(function(t){for(;;)switch(t.n){case 0:if(e=new Date(this.storage.getUser().expirydate),n=new Date,o=this.storage.getUser().accesstoken,!(e<n)&&o){t.n=2;break}return t.n=1,this.updateToken(this.storage.getUser().auth_key);case 1:u=t.v,this.storage.updateUser(u),o=u.accesstoken;case 2:return t.a(2,o)}},t,this)}));return function(){return t.apply(this,arguments)}}()}])}();
|
|
309
309
|
},{}],"UV2u":[function(require,module,exports) {
|
|
310
310
|
"use strict";function e(o){return(e="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})(o)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.IS_WEB=void 0;var o=exports.IS_WEB=!["undefined"==typeof window?"undefined":e(window),"undefined"==typeof document?"undefined":e(document)].includes("undefined");
|
|
311
311
|
},{}],"osSN":[function(require,module,exports) {
|
|
@@ -319,7 +319,7 @@ var t=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),export
|
|
|
319
319
|
},{"./createAngularModuleInstance.js":"osSN","./createClassInstance.js":"DsUm"}],"q0my":[function(require,module,exports) {
|
|
320
320
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppProcessor=void 0;var t=require("../consts.js"),e=require("../utils.js");function r(t){return(r="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){return p(t)||a(t)||f(t)||i()}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function p(t){if(Array.isArray(t))return l(t)}function o(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 s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){u(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function u(t,e,r){return(e=w(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,p=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return p=t.done,t},e:function(t){o=!0,a=t},f:function(){try{p||null==r.return||r.return()}finally{if(o)throw a}}}}function f(t,e){if(t){if("string"==typeof t)return l(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function h(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var s=n&&n.prototype instanceof o?n:o,u=Object.create(s.prototype);return v(u,"_invoke",function(r,n,i){var a,o,s,u=0,c=i||[],f=!1,l={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return a=e,o=0,s=t,l.n=r,p}};function h(r,n){for(o=r,s=n,e=0;!f&&u&&!i&&e<c.length;e++){var i,a=c[e],h=l.p,v=a[2];r>3?(i=v===n)&&(s=a[(o=a[4])?5:(o=3,3)],a[4]=a[5]=t):a[0]<=h&&((i=r<2&&h<a[1])?(o=0,l.v=n,l.n=a[1]):h<v&&(i=r<3||a[0]>n||n>v)&&(a[4]=r,a[5]=n,l.n=v,o=0))}if(i||r>1)return p;throw f=!0,n}return function(i,c,v){if(u>1)throw TypeError("Generator is already running");for(f&&1===c&&h(c,v),o=c,s=v;(e=o<2?t:s)||!f;){a||(o?o<3?(o>1&&(l.n=-1),h(o,s)):l.n=s:l.v=s);try{if(u=2,a){if(o||(i="next"),e=a[i]){if(!(e=e.call(a,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,o<2&&(o=0)}else 1===o&&(e=a.return)&&e.call(a),o<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),o=1);a=t}else if((e=(f=l.n<0)?s:r.call(n,l))!==p)break}catch(e){a=t,o=1,s=e}finally{u=1}}return{value:e,done:f}}}(r,i,a),!0),u}var p={};function o(){}function s(){}function u(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(v(e={},n,function(){return this}),e),f=u.prototype=o.prototype=Object.create(c);function l(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,v(t,i,"GeneratorFunction")),t.prototype=Object.create(f),t}return s.prototype=u,v(f,"constructor",u),v(u,"constructor",s),s.displayName="GeneratorFunction",v(u,i,"GeneratorFunction"),v(f),v(f,i,"Generator"),v(f,n,function(){return this}),v(f,"toString",function(){return"[object Generator]"}),(h=function(){return{w:a,m:l}})()}function v(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}(v=function(t,e,r,n){function a(e,r){v(t,e,function(t){return this._invoke(e,r,t)})}e?i?i(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))})(t,e,r,n)}function d(t,e,r,n,i,a,p){try{var o=t[a](p),s=o.value}catch(t){return void r(t)}o.done?e(s):Promise.resolve(s).then(n,i)}function _(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var a=t.apply(e,r);function p(t){d(a,n,i,p,o,"next",t)}function o(t){d(a,n,i,p,o,"throw",t)}p(void 0)})}}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,w(n.key),n)}}function y(t,e,r){return e&&m(t.prototype,e),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function w(t){var e=A(t,"string");return"symbol"==r(e)?e:e+""}function A(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var b=exports.AppProcessor=function(){return y(function t(e,r,n,i,a,p,o){g(this,t),this.storage=e,this.pipeService=r,this.req=n,this.ws=i,this.applistReceived=!1,this.activateSW=o,this.chunksManager=a,this.util=p,this.appListeners(),this.appRequestCache=new Map},[{key:"createNewAppApi",value:function(){var t=_(h().m(function t(e){var r,n;return h().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.post({url:"/api/app/create",form:{app:JSON.stringify(e)}});case 1:return(r=t.v).from_apps_list=!0,t.a(2,r);case 2:return t.p=2,n=t.v,console.log(n),t.a(2,null)}},t,this,[[0,2]])}));return function(e){return t.apply(this,arguments)}}()},{key:"updateAppApi",value:function(){var t=_(h().m(function t(e){var r,n;return h().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}});case 1:return r=t.v,t.a(2,r);case 2:return t.p=2,n=t.v,console.log(n),t.a(2,null)}},t,this,[[0,2]])}));return function(e){return t.apply(this,arguments)}}()},{key:"deleteAppApi",value:function(){var t=_(h().m(function t(e){var r,n;return h().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.post({url:"/api/app/delete",form:{app_id:e}});case 1:return r=t.v,t.a(2,r);case 2:return t.p=2,n=t.v,console.log(n),t.a(2,null)}},t,this,[[0,2]])}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppListApi",value:function(){var t=_(h().m(function t(){var e,r;return h().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.get({url:"/api/applist/get"});case 1:return e=t.v,t.a(2,e.apps_list.map(function(t){return t.from_apps_list=!0,t}));case 2:return t.p=2,r=t.v,console.log(r),t.a(2,null)}},t,this,[[0,2]])}));return function(){return t.apply(this,arguments)}}()},{key:"getAppApi",value:function(){var t=_(h().m(function t(e){var r,n;return h().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.get({url:"/api/app/get",params:{app_id:e}});case 1:return r=t.v,t.a(2,r);case 2:return t.p=2,n=t.v,console.log(n),t.a(2,null)}},t,this,[[0,2]])}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppListFromStorage",value:function(){return this.storage.getAppsList()}},{key:"getAppFromStorage",value:function(t){var e=this.storage.getApp(t);return e&&e.field_list.length?e:null}},{key:"addNewAppToStorage",value:function(t){return this.storage.getAppsList().push(t)}},{key:"saveAppInStorage",value:function(t){t.items_object={};for(var e=0;e<t.items_list.length;e++){t.items_object[t.items_list[e].item_id]={};for(var r=0;r<t.items_list[e].fields.length;r++)t.items_object[t.items_list[e].item_id][t.items_list[e].fields[r].field_id]=t.items_list[e].fields[r]}var n=this.storage.getApp(t.app_id);return n?(t.from_apps_list=n.from_apps_list,t.permission=n.permission,this.storage.updateApp(t)):(t.from_apps_list=!1,this.addNewAppToStorage(t)),this.getAppFromStorage(t.app_id)}},{key:"updateAppFieldsAndViews",value:function(t){var e=this,r=this.getAppFromStorage(t.app_id);t.items_list=r.items_list,t.file_list=r.file_list,t.from_apps_list=r.from_apps_list,t.items_object=r.items_object,this.storage.updateApp(t),this.pipeService.emit("gh_app_views_update",{app_id:t.app_id},t.views_list),t.field_list.forEach(function(r){e.pipeService.emit("gh_model_update",{app_id:t.app_id,field_id:r.field_id},r)})}},{key:"updateAppInStorage",value:function(t){this.storage.getApp(t.app_id)?(this.storage.updateApp(t),this.pipeService.emit("gh_app_update",{app_id:t.app_id},t),this.pipeService.emit("gh_items_update",{app_id:t.app_id},t.items_list)):this.addNewAppToStorage(t)}},{key:"deletingAppFromStorage",value:function(t){var e=this.storage.getAppsList();return e.forEach(function(r,n){r.app_id==t&&e.splice(n)}),e}},{key:"updateAppsListInStorage",value:function(){var t,e=c(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);try{for(e.s();!(t=e.n()).done;){var r=t.value,n=this.storage.getApp(r.app_id);n?(n.from_apps_list=r.from_apps_list,n.permission=r.permission):this.addNewAppToStorage(r)}}catch(i){e.e(i)}finally{e.f()}}},{key:"refreshApps",value:function(){var t=_(h().m(function t(){var e,r,n,i,a,p,o,s,u,f=arguments;return h().w(function(t){for(;;)switch(t.p=t.n){case 0:e=f.length>0&&void 0!==f[0]?f[0]:[],r=c(e),t.p=1,r.s();case 2:if((n=r.n()).done){t.n=7;break}if(null==(i=n.value)){t.n=6;break}return t.p=3,t.n=4,this.getAppApi(i);case 4:if(a=t.v){for(a.items_object={},p=0;p<a.items_list.length;p++)for(a.items_object[a.items_list[p].item_id]={},o=0;o<a.items_list[p].fields.length;o++)a.items_object[a.items_list[p].item_id][a.items_list[p].fields[o].field_id]=a.items_list[p].fields[o];this.updateAppInStorage(a),this.pipeService.emit("gh_app_views_update",{app_id:a.app_id},a.views_list)}t.n=6;break;case 5:t.p=5,s=t.v,console.log(s);case 6:t.n=2;break;case 7:t.n=9;break;case 8:t.p=8,u=t.v,r.e(u);case 9:return t.p=9,r.f(),t.f(9);case 10:console.log("Apps refreshed: ",JSON.stringify(e));case 11:return t.a(2)}},t,this,[[3,5],[1,8,9,10]])}));return function(){return t.apply(this,arguments)}}()},{key:"refreshAppsList",value:function(){var t=_(h().m(function t(){var e,r,n;return h().w(function(t){for(;;)switch(t.n){case 0:return e=this.getAppListFromStorage(),t.n=1,this.getAppListApi();case 1:r=t.v,n=r.map(function(t){return s(s({},t),e.find(function(e){return e.app_id===t.app_id}))}),this.updateAppsListInStorage(n),this.pipeService.emit("gh_apps_list_refreshed",{});case 2:return t.a(2)}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getAppsList",value:function(){var t=_(h().m(function t(){var e,r;return h().w(function(t){for(;;)switch(t.n){case 0:if(e=this.getAppListFromStorage(),this.applistReceived){t.n=3;break}return t.n=1,this.getAppListApi();case 1:if(r=t.v){t.n=2;break}return t.a(2,null);case 2:this.updateAppsListInStorage(r),this.applistReceived=!0,e=r,this.getApp(this.storage.getUser().app_init);case 3:return t.a(2,e)}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getAppInfo",value:function(){var t=_(h().m(function t(e){var r;return h().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.getAppsList();case 1:return r=t.v,t.a(2,r?r.find(function(t){return t.app_id==e}):null)}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"deleteApp",value:function(){var t=_(h().m(function t(e){return h().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.deleteAppApi(e);case 1:return t.a(2,this.deletingAppFromStorage(e))}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getApp",value:function(){var t=_(h().m(function t(r){var i,a,p,o=this;return h().w(function(t){for(;;)switch(t.n){case 0:if(r){t.n=1;break}return t.a(2,null);case 1:if(!(i=this.getAppFromStorage(r))){t.n=2;break}return t.a(2,i);case 2:if(!this.appRequestCache.has(r)){t.n=3;break}return t.a(2,this.appRequestCache.get(r));case 3:return a=this,p=new Promise(function(){var t=_(h().m(function t(i,p){var s,u,c;return h().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,o.getAppApi(r);case 1:if((s=t.v)||p(),!s.chunks||!s.chunks.length){t.n=3;break}return t.n=2,a.chunksManager.getChunks(r,s.chunks);case 2:u=t.v,s.items_list=a.util.mergeChunks([].concat(n(u),[s]));case 3:c=(0,e.trashFilter)(s),a.saveAppInStorage(c),a.ws.addSubscription(r),i(c),t.n=5;break;case 4:t.p=4,t.v,p();case 5:return t.a(2)}},t,null,[[0,4]])}));return function(e,r){return t.apply(this,arguments)}}()),a.appRequestCache.set(r,p),t.a(2,p)}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateApp",value:function(){var t=_(h().m(function t(r){var n,i;return h().w(function(t){for(;;)switch(t.n){case 0:if(r.views_list&&r.views_list.length&&r.show){t.n=2;break}return t.n=1,this.getApp(r.app_id);case 1:n=t.v,r.views_list&&r.views_list.length||(r.views_list=n.views_list),void 0===r.show&&(r.show=n.show);case 2:return t.n=3,this.updateAppApi(r);case 3:return(i=t.v).field_list=(0,e.trashFilter)(i).field_list,this.updateAppFieldsAndViews(i),t.a(2,i)}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateAppInfo",value:function(){var t=_(h().m(function t(){var e,r=arguments;return h().w(function(t){for(;;)switch(t.n){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),t.a(2,this.updateApp(e))}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"createNewApp",value:function(){var t=_(h().m(function t(e){var r;return h().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.createNewAppApi(e);case 1:return(r=t.v).items_object={},this.addNewAppToStorage(r),t.a(2,r)}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppViews",value:function(){var t=_(h().m(function t(e){var r;return h().w(function(t){for(;;)switch(t.n){case 0:if(!e){t.n=2;break}return t.n=1,this.getApp(e);case 1:return r=t.v,t.a(2,r.views_list);case 2:return t.a(2)}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"clearAppProcessor",value:function(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}},{key:"appListeners",value:function(){var e=this;this.pipeService.onRoot("gh_app_get",{},function(){var t=_(h().m(function t(r,n){var i;return h().w(function(t){for(;;)switch(t.n){case 0:if(!n||!n.app_id){t.n=2;break}return t.n=1,e.getApp(n.app_id);case 1:i=t.v,e.pipeService.emit("gh_app_get",n,i);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_apps_list_get",{},function(){var t=_(h().m(function t(r,n){var i;return h().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e.getAppsList();case 1:i=t.v,e.pipeService.emit("gh_apps_list_get",n,i);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_delete_app",{},function(){var t=_(h().m(function t(r,n){var i;return h().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e.deleteApp(n.app_id);case 1:i=t.v,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},i);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_update",{},function(){var t=_(h().m(function t(r,n){var i,a;return h().w(function(t){for(;;)switch(t.n){case 0:return n.app.items_list=[],n.app.file_list=[],t.n=1,e.updateApp(n.app);case 1:return i=t.v,e.pipeService.emit("gh_app_views_update",{app_id:i.app_id},i.views_list),t.n=2,e.getAppsList();case 2:a=t.v,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},a),i.field_list.forEach(function(t){e.pipeService.emit("gh_model_update",{app_id:i.app_id,field_id:t.field_id},t)});case 3:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_view_get",{},function(){var t=_(h().m(function t(r,n){var i;return h().w(function(t){for(;;)switch(t.n){case 0:if(!n||!n.app_id){t.n=2;break}return t.n=1,e.getApp(n.app_id);case 1:(i=t.v).views_list.forEach(function(t,r){t.view_id==n.view_id&&e.pipeService.emit("gh_app_view_get",n,i.views_list[r])});case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_info_get",{},function(){var t=_(h().m(function t(r,n){var i;return h().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e.getAppInfo(n.app_id);case 1:(i=t.v)&&e.pipeService.emit("gh_app_info_get",n,i);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_info_update",{},function(){var t=_(h().m(function t(r,n){var i;return h().w(function(t){for(;;)switch(t.n){case 0:if(!n||!n.app){t.n=2;break}return t.n=1,e.updateAppInfo(n.app);case 1:i=t.v,e.pipeService.emit("gh_app_info_update",{app_id:n.app.app_id},i);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_create",{},function(){var t=_(h().m(function t(r,n){var i;return h().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e.createNewApp(n.app);case 1:return t.n=2,e.getAppsList();case 2:i=t.v,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},i);case 3:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),t.IS_WEB&&this.activateSW&&navigator.serviceWorker.addEventListener("message",function(){var t=_(h().m(function t(r){var n;return h().w(function(t){for(;;)switch(t.n){case 0:if("refresh app"!==r.data.type){t.n=2;break}return t.n=1,e.getApp(r.data.payload.app_id);case 1:(n=t.v)&&e.util.compareAppsItemsLists(n.items_list,r.data.payload.items_list.filter(function(t){return!t.trash}),function(t){var n=t.diff_fields_items,i=t.diff_fields_items_Ids,a=t.diff_items,p=t.newItems,o=t.deletedItems;(a.length||p.length||o.length)&&(e.pipeService.emit("gh_items_update",{app_id:r.data.payload.app_id},r.data.payload.items_list.filter(function(t){return!t.trash})),a.forEach(function(t){return e.pipeService.emit("gh_item_update",{app_id:r.data.payload.app_id,item_id:t.item_id},t)})),i.forEach(function(t){var i=n[t];i&&i.forEach(function(n){e.pipeService.emit("gh_value_update",{app_id:r.data.payload.app_id,item_id:t,field_id:n.field_id},n.field_value)})})}),r.data.payload.items_list=e.util.mergeChunks([n,r.data.payload]),e.saveAppInStorage(r.data.payload);case 2:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}())}}])}();
|
|
321
321
|
},{"../consts.js":"UV2u","../utils.js":"EgeI"}],"UUd3":[function(require,module,exports) {
|
|
322
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ItemProcessor=void 0;var e=require("../utils.js");function t(e){return(t="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 r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function i(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function n(e,t,r){return(t=l(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(){var e,t,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",n=r.toStringTag||"@@toStringTag";function s(r,i,n,o){var s=i&&i.prototype instanceof c?i:c,p=Object.create(s.prototype);return u(p,"_invoke",function(r,i,n){var o,u,s,c=0,p=n||[],f=!1,l={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return o=t,u=0,s=e,l.n=r,a}};function m(r,i){for(u=r,s=i,t=0;!f&&c&&!n&&t<p.length;t++){var n,o=p[t],m=l.p,d=o[2];r>3?(n=d===i)&&(s=o[(u=o[4])?5:(u=3,3)],o[4]=o[5]=e):o[0]<=m&&((n=r<2&&m<o[1])?(u=0,l.v=i,l.n=o[1]):m<d&&(n=r<3||o[0]>i||i>d)&&(o[4]=r,o[5]=i,l.n=d,u=0))}if(n||r>1)return a;throw f=!0,i}return function(n,p,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===p&&m(p,d),u=p,s=d;(t=u<2?e:s)||!f;){o||(u?u<3?(u>1&&(l.n=-1),m(u,s)):l.n=s:l.v=s);try{if(c=2,o){if(u||(n="next"),t=o[n]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,u<2&&(u=0)}else 1===u&&(t=o.return)&&t.call(o),u<2&&(s=TypeError("The iterator does not provide a '"+n+"' method"),u=1);o=e}else if((t=(f=l.n<0)?s:r.call(i,l))!==a)break}catch(t){o=e,u=1,s=t}finally{c=1}}return{value:t,done:f}}}(r,n,o),!0),p}var a={};function c(){}function p(){}function f(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(u(t={},i,function(){return this}),t),m=f.prototype=c.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,n,"GeneratorFunction")),e.prototype=Object.create(m),e}return p.prototype=f,u(m,"constructor",f),u(f,"constructor",p),p.displayName="GeneratorFunction",u(f,n,"GeneratorFunction"),u(m),u(m,n,"Generator"),u(m,i,function(){return this}),u(m,"toString",function(){return"[object Generator]"}),(o=function(){return{w:s,m:d}})()}function u(e,t,r,i){var n=Object.defineProperty;try{n({},"",{})}catch(e){n=0}(u=function(e,t,r,i){function o(t,r){u(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 s(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 a(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var o=e.apply(t,r);function u(e){s(o,i,n,u,a,"next",e)}function a(e){s(o,i,n,u,a,"throw",e)}u(void 0)})}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(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,l(i.key),i)}}function f(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var r=m(e,"string");return"symbol"==t(r)?r:r+""}function m(e,r){if("object"!=t(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,r||"default");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}var d=exports.ItemProcessor=function(){return f(function e(t,r,i,n,o){c(this,e),this.storage=t,this.pipeService=r,this.req=i,this.appProcessor=n,this.util=o,this.itemListeners()},[{key:"addItemsApi",value:function(){var e=a(o().m(function e(t,r){var i,n;return o().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.req.post({url:"/api/items/add",form:{items:JSON.stringify(r),app_id:t}});case 1:return i=e.v,e.a(2,i);case 2:return e.p=2,n=e.v,console.log(n),e.a(2,null)}},e,this,[[0,2]])}));return function(t,r){return e.apply(this,arguments)}}()},{key:"updateItemsApi",value:function(){var e=a(o().m(function e(t,r){var i,n;return o().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.req.post({url:"/api/items/update",form:{items:JSON.stringify(r),app_id:t}});case 1:return i=e.v,e.a(2,i);case 2:return e.p=2,n=e.v,console.log(n),e.a(2,null)}},e,this,[[0,2]])}));return function(t,r){return e.apply(this,arguments)}}()},{key:"deleteItemsApi",value:function(e){try{var t=this.req.post({url:"/api/items/delete",form:{items_ids:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(r){return console.log(r),null}}},{key:"getFilteredItemsAPI",value:function(){var e=a(o().m(function e(t){var r,i,n,u,s,a,c,p=arguments;return o().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=p.length>1&&void 0!==p[1]?p[1]:[],i=p.length>2&&void 0!==p[2]?p[2]:{},e.p=1,n=i.items,u=i.offset,s=i.limit_to,e.n=2,this.req.post({url:"/api/items/get",form:{app_id:t,items:n?JSON.stringify(n):void 0,offset:u,limit_to:s,filters:JSON.stringify(r)}});case 2:return a=e.v,e.a(2,a);case 3:return e.p=3,c=e.v,console.log(c),e.a(2,null)}},e,this,[[1,3]])}));return function(t){return e.apply(this,arguments)}}()},{key:"addItemsToStorage",value:function(){var e=a(o().m(function e(t,r){var i,n=this;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.appProcessor.getApp(t);case 1:return(i=e.v)&&(r.forEach(function(e){i.items_list.push(e),i.items_object[e.item_id]={};for(var r=0;r<e.fields.length;r++)i.items_object[e.item_id][e.fields[r].field_id]=e.fields[r];n.pipeService.emit("gh_item_add",{app_id:t},[e])}),this.pipeService.emit("gh_items_update",{app_id:t},i.items_list),this.storage.updateApp(i)),e.a(2,i)}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"updateItemsInStorage",value:function(){var e=a(o().m(function e(t,r,i){var n,u=this;return o().w(function(e){for(;;)switch(e.n){case 0:return this.pipeService.emit("gh_items_update",{app_id:t},r),e.n=1,this.appProcessor.getApp(t);case 1:return(n=e.v)&&r&&r.forEach(function(e){var r={app_id:t};u.pipeService.emit("gh_item_update",r,[e],i),r.item_id=e.item_id,u.pipeService.emit("gh_item_update",r,e,i);var o=n.items_list.find(function(t){return t.item_id==e.item_id})||n.trash_items.find(function(t){return t.item_id==e.item_id});o&&(e.fields.forEach(function(e){var t=o.fields.find(function(t){return t.field_id==e.field_id});r.field_id=e.field_id,t?t.field_value!=e.field_value&&(t.field_value=e.field_value,n.items_object[o.item_id][t.field_id]=t,u.pipeService.emit("gh_value_update",r,e.field_value,i)):(o.fields.push(e),n.items_object[o.item_id][e.field_id]=e,u.pipeService.emit("gh_value_update",r,e.field_value,i))}),n.items_list.some(function(e){return e.item_id===o.item_id})||(n.trash_items=n.trash_items.filter(function(e){return e.item_id!==o.item_id}),n.items_list.push(o)))}),e.a(2,r)}},e,this)}));return function(t,r,i){return e.apply(this,arguments)}}()},{key:"deleteItemsFromStorage",value:function(){var e=a(o().m(function e(t){var r,n,u=arguments;return o().w(function(e){for(;;)switch(e.n){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:[],e.n=1,this.appProcessor.getApp(t);case 1:(n=e.v)&&(n.items_list=n.items_list.filter(function(e){return!r.find(function(t){return e.item_id==t.item_id})||(null!=n&&n.trash_items||(n.trash_items=[]),null==n||n.trash_items.push(i(i({},e),{},{trash:!0,last_update:Date.now()})),delete n.items_object[e.item_id],!1)}),this.pipeService.emit("gh_items_update",{app_id:t},n.items_list),this.storage.updateApp(n));case 2:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"getItems",value:function(){var e=a(o().m(function e(t){var r,i=arguments;return o().w(function(e){for(;;)switch(e.n){case 0:return i.length>1&&void 0!==i[1]&&i[1],e.n=1,this.appProcessor.getApp(t);case 1:if(r=e.v){e.n=2;break}return e.a(2,null);case 2:return e.a(2,r.items_list)}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"addNewItems",value:function(){var t=a(o().m(function t(r,n){var u,s;return o().w(function(t){for(;;)switch(t.n){case 0:return u=n.map(function(t){return i(i({},t),{},{fields:(0,e.filterFields)(t.fields)})}),t.n=1,this.addItemsApi(r,u);case 1:return s=t.v,t.n=2,this.addItemsToStorage(r,s);case 2:return this.pipeService.emit("gh_items_add",{app_id:r},s),t.a(2,s)}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"updateItems",value:function(){var t=a(o().m(function t(r,n){var u,s;return o().w(function(t){for(;;)switch(t.n){case 0:return u=n.map(function(t){return i(i({},t),{},{fields:(0,e.filterFields)(t.fields)})}),t.n=1,this.updateItemsApi(r,u);case 1:return s=t.v,t.n=2,this.updateItemsInStorage(r,s);case 2:return t.a(2,t.v)}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"deleteItems",value:function(){var e=a(o().m(function e(t,r){var i=this;return o().w(function(e){for(;;)switch(e.n){case 0:return e.a(2,this.deleteItemsApi(r).then(function(){var e=a(o().m(function e(r){return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,i.deleteItemsFromStorage(t,r);case 1:return e.a(2,e.v)}},e)}));return function(t){return e.apply(this,arguments)}}()))}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"restoreItems",value:function(){var e=a(o().m(function e(t,r){var i;return o().w(function(e){for(;;)switch(e.n){case 0:return i=r.map(function(e){return{item_id:e,trash:!1}}),e.n=1,this.updateItems(t,i);case 1:return e.a(2,e.v)}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"itemListeners",value:function(){var e=this;this.pipeService.onRoot("gh_items_get",{},function(){var t=a(o().m(function t(r,i){var n;return o().w(function(t){for(;;)switch(t.n){case 0:if(!i||!i.app_id){t.n=2;break}return t.n=1,e.getItems(i.app_id);case 1:(n=t.v)?e.pipeService.emit("gh_items_get",i,n):e.pipeService.emit("gh_items_get",i,[]);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_items_add",{},function(){var t=a(o().m(function t(r,i){var n;return o().w(function(t){for(;;)switch(t.n){case 0:if(!(i&&i.app_id&&i.items)){t.n=2;break}return t.n=1,e.addNewItems(i.app_id,i.items);case 1:(n=t.v)?e.pipeService.emit("gh_items_add",i,n):e.pipeService.emit("gh_items_add",i,[]);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_items_update",{},function(){var t=a(o().m(function t(r,i){var n;return o().w(function(t){for(;;)switch(t.n){case 0:if(!(i&&i.app_id&&i.items)){t.n=2;break}return t.n=1,e.updateItems(i.app_id,i.items);case 1:(n=t.v)?e.pipeService.emit("gh_items_update",i,n):e.pipeService.emit("gh_items_update",i,[]);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_item_get",{},function(){var t=a(o().m(function t(r,i){var n,u;return o().w(function(t){for(;;)switch(t.n){case 0:if(!i||!i.app_id){t.n=2;break}return t.n=1,e.getItems(i.app_id);case 1:n=t.v,u=n.find(function(e){return e.item_id==i.item_id}),e.pipeService.emit("gh_item_get",i,u);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_filtered_items_get",{},function(){var t=a(o().m(function t(r,i){var n,u;return o().w(function(t){for(;;)switch(t.n){case 0:if(!i||!i.element_app_id){t.n=3;break}return t.n=1,e.getItems(i.element_app_id);case 1:return n=t.v,t.n=2,e.util.getFilteredItems(n,i.filters_list,i.element_app_id,i.app_id,i.item_id,i.field_groupe,i.search,i.search_params);case 2:u=t.v,e.pipeService.emit("gh_filtered_items_get",i,u);case 3:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_filter_items",{},function(){var t=a(o().m(function t(r,i){var n;return o().w(function(t){for(;;)switch(t.n){case 0:if(!i||!i.items){t.n=2;break}return t.n=1,e.util.getFilteredItems(i.items,i.filters_list,i.element_app_id,i.app_id,i.item_id,i.field_groupe,i.search,i.search_params);case 1:n=t.v,e.pipeService.emit("gh_filter_items",i,n);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}())}}])}();
|
|
322
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ItemProcessor=void 0;var e=require("../utils.js");function t(e){return(t="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 r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function i(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function n(e,t,r){return(t=l(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(){var e,t,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",n=r.toStringTag||"@@toStringTag";function s(r,i,n,o){var s=i&&i.prototype instanceof c?i:c,p=Object.create(s.prototype);return u(p,"_invoke",function(r,i,n){var o,u,s,c=0,p=n||[],f=!1,l={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return o=t,u=0,s=e,l.n=r,a}};function m(r,i){for(u=r,s=i,t=0;!f&&c&&!n&&t<p.length;t++){var n,o=p[t],m=l.p,d=o[2];r>3?(n=d===i)&&(s=o[(u=o[4])?5:(u=3,3)],o[4]=o[5]=e):o[0]<=m&&((n=r<2&&m<o[1])?(u=0,l.v=i,l.n=o[1]):m<d&&(n=r<3||o[0]>i||i>d)&&(o[4]=r,o[5]=i,l.n=d,u=0))}if(n||r>1)return a;throw f=!0,i}return function(n,p,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===p&&m(p,d),u=p,s=d;(t=u<2?e:s)||!f;){o||(u?u<3?(u>1&&(l.n=-1),m(u,s)):l.n=s:l.v=s);try{if(c=2,o){if(u||(n="next"),t=o[n]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,u<2&&(u=0)}else 1===u&&(t=o.return)&&t.call(o),u<2&&(s=TypeError("The iterator does not provide a '"+n+"' method"),u=1);o=e}else if((t=(f=l.n<0)?s:r.call(i,l))!==a)break}catch(t){o=e,u=1,s=t}finally{c=1}}return{value:t,done:f}}}(r,n,o),!0),p}var a={};function c(){}function p(){}function f(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(u(t={},i,function(){return this}),t),m=f.prototype=c.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,n,"GeneratorFunction")),e.prototype=Object.create(m),e}return p.prototype=f,u(m,"constructor",f),u(f,"constructor",p),p.displayName="GeneratorFunction",u(f,n,"GeneratorFunction"),u(m),u(m,n,"Generator"),u(m,i,function(){return this}),u(m,"toString",function(){return"[object Generator]"}),(o=function(){return{w:s,m:d}})()}function u(e,t,r,i){var n=Object.defineProperty;try{n({},"",{})}catch(e){n=0}(u=function(e,t,r,i){function o(t,r){u(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 s(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 a(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var o=e.apply(t,r);function u(e){s(o,i,n,u,a,"next",e)}function a(e){s(o,i,n,u,a,"throw",e)}u(void 0)})}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(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,l(i.key),i)}}function f(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var r=m(e,"string");return"symbol"==t(r)?r:r+""}function m(e,r){if("object"!=t(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,r||"default");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}var d=exports.ItemProcessor=function(){return f(function e(t,r,i,n,o){c(this,e),this.storage=t,this.pipeService=r,this.req=i,this.appProcessor=n,this.util=o,this.itemListeners()},[{key:"addItemsApi",value:function(){var e=a(o().m(function e(t,r){var i,n;return o().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.req.post({url:"/api/items/add",form:{items:JSON.stringify(r),app_id:t}});case 1:return i=e.v,e.a(2,i);case 2:return e.p=2,n=e.v,console.log(n),e.a(2,null)}},e,this,[[0,2]])}));return function(t,r){return e.apply(this,arguments)}}()},{key:"updateItemsApi",value:function(){var e=a(o().m(function e(t,r){var i,n;return o().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.req.post({url:"/api/items/update",form:{items:JSON.stringify(r),app_id:t}});case 1:return i=e.v,e.a(2,i);case 2:return e.p=2,n=e.v,console.log(n),e.a(2,null)}},e,this,[[0,2]])}));return function(t,r){return e.apply(this,arguments)}}()},{key:"deleteItemsApi",value:function(e){try{var t=this.req.post({url:"/api/items/delete",form:{items_ids:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(r){return console.log(r),null}}},{key:"getFilteredItemsAPI",value:function(){var e=a(o().m(function e(t){var r,i,n,u,s,a,c,p=arguments;return o().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=p.length>1&&void 0!==p[1]?p[1]:[],i=p.length>2&&void 0!==p[2]?p[2]:{},e.p=1,n=i.items,u=i.offset,s=i.limit_to,e.n=2,this.req.post({url:"/api/items/get",form:{app_id:t,items:n?JSON.stringify(n):void 0,offset:u,limit_to:s,filter_list:JSON.stringify(r)}});case 2:return a=e.v,e.a(2,a);case 3:return e.p=3,c=e.v,console.log(c),e.a(2,null)}},e,this,[[1,3]])}));return function(t){return e.apply(this,arguments)}}()},{key:"addItemsToStorage",value:function(){var e=a(o().m(function e(t,r){var i,n=this;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.appProcessor.getApp(t);case 1:return(i=e.v)&&(r.forEach(function(e){i.items_list.push(e),i.items_object[e.item_id]={};for(var r=0;r<e.fields.length;r++)i.items_object[e.item_id][e.fields[r].field_id]=e.fields[r];n.pipeService.emit("gh_item_add",{app_id:t},[e])}),this.pipeService.emit("gh_items_update",{app_id:t},i.items_list),this.storage.updateApp(i)),e.a(2,i)}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"updateItemsInStorage",value:function(){var e=a(o().m(function e(t,r,i){var n,u=this;return o().w(function(e){for(;;)switch(e.n){case 0:return this.pipeService.emit("gh_items_update",{app_id:t},r),e.n=1,this.appProcessor.getApp(t);case 1:return(n=e.v)&&r&&r.forEach(function(e){var r={app_id:t};u.pipeService.emit("gh_item_update",r,[e],i),r.item_id=e.item_id,u.pipeService.emit("gh_item_update",r,e,i);var o=n.items_list.find(function(t){return t.item_id==e.item_id})||n.trash_items.find(function(t){return t.item_id==e.item_id});o&&(e.fields.forEach(function(e){var t=o.fields.find(function(t){return t.field_id==e.field_id});r.field_id=e.field_id,t?t.field_value!=e.field_value&&(t.field_value=e.field_value,n.items_object[o.item_id][t.field_id]=t,u.pipeService.emit("gh_value_update",r,e.field_value,i)):(o.fields.push(e),n.items_object[o.item_id][e.field_id]=e,u.pipeService.emit("gh_value_update",r,e.field_value,i))}),n.items_list.some(function(e){return e.item_id===o.item_id})||(n.trash_items=n.trash_items.filter(function(e){return e.item_id!==o.item_id}),n.items_list.push(o)))}),e.a(2,r)}},e,this)}));return function(t,r,i){return e.apply(this,arguments)}}()},{key:"deleteItemsFromStorage",value:function(){var e=a(o().m(function e(t){var r,n,u=arguments;return o().w(function(e){for(;;)switch(e.n){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:[],e.n=1,this.appProcessor.getApp(t);case 1:(n=e.v)&&(n.items_list=n.items_list.filter(function(e){return!r.find(function(t){return e.item_id==t.item_id})||(null!=n&&n.trash_items||(n.trash_items=[]),null==n||n.trash_items.push(i(i({},e),{},{trash:!0,last_update:Date.now()})),delete n.items_object[e.item_id],!1)}),this.pipeService.emit("gh_items_update",{app_id:t},n.items_list),this.storage.updateApp(n));case 2:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"getItems",value:function(){var e=a(o().m(function e(t){var r,i=arguments;return o().w(function(e){for(;;)switch(e.n){case 0:return i.length>1&&void 0!==i[1]&&i[1],e.n=1,this.appProcessor.getApp(t);case 1:if(r=e.v){e.n=2;break}return e.a(2,null);case 2:return e.a(2,r.items_list)}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"addNewItems",value:function(){var t=a(o().m(function t(r,n){var u,s;return o().w(function(t){for(;;)switch(t.n){case 0:return u=n.map(function(t){return i(i({},t),{},{fields:(0,e.filterFields)(t.fields)})}),t.n=1,this.addItemsApi(r,u);case 1:return s=t.v,t.n=2,this.addItemsToStorage(r,s);case 2:return this.pipeService.emit("gh_items_add",{app_id:r},s),t.a(2,s)}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"updateItems",value:function(){var t=a(o().m(function t(r,n){var u,s;return o().w(function(t){for(;;)switch(t.n){case 0:return u=n.map(function(t){return i(i({},t),{},{fields:(0,e.filterFields)(t.fields)})}),t.n=1,this.updateItemsApi(r,u);case 1:return s=t.v,t.n=2,this.updateItemsInStorage(r,s);case 2:return t.a(2,t.v)}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"deleteItems",value:function(){var e=a(o().m(function e(t,r){var i=this;return o().w(function(e){for(;;)switch(e.n){case 0:return e.a(2,this.deleteItemsApi(r).then(function(){var e=a(o().m(function e(r){return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,i.deleteItemsFromStorage(t,r);case 1:return e.a(2,e.v)}},e)}));return function(t){return e.apply(this,arguments)}}()))}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"restoreItems",value:function(){var e=a(o().m(function e(t,r){var i;return o().w(function(e){for(;;)switch(e.n){case 0:return i=r.map(function(e){return{item_id:e,trash:!1}}),e.n=1,this.updateItems(t,i);case 1:return e.a(2,e.v)}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"itemListeners",value:function(){var e=this;this.pipeService.onRoot("gh_items_get",{},function(){var t=a(o().m(function t(r,i){var n;return o().w(function(t){for(;;)switch(t.n){case 0:if(!i||!i.app_id){t.n=2;break}return t.n=1,e.getItems(i.app_id);case 1:(n=t.v)?e.pipeService.emit("gh_items_get",i,n):e.pipeService.emit("gh_items_get",i,[]);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_items_add",{},function(){var t=a(o().m(function t(r,i){var n;return o().w(function(t){for(;;)switch(t.n){case 0:if(!(i&&i.app_id&&i.items)){t.n=2;break}return t.n=1,e.addNewItems(i.app_id,i.items);case 1:(n=t.v)?e.pipeService.emit("gh_items_add",i,n):e.pipeService.emit("gh_items_add",i,[]);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_items_update",{},function(){var t=a(o().m(function t(r,i){var n;return o().w(function(t){for(;;)switch(t.n){case 0:if(!(i&&i.app_id&&i.items)){t.n=2;break}return t.n=1,e.updateItems(i.app_id,i.items);case 1:(n=t.v)?e.pipeService.emit("gh_items_update",i,n):e.pipeService.emit("gh_items_update",i,[]);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_item_get",{},function(){var t=a(o().m(function t(r,i){var n,u;return o().w(function(t){for(;;)switch(t.n){case 0:if(!i||!i.app_id){t.n=2;break}return t.n=1,e.getItems(i.app_id);case 1:n=t.v,u=n.find(function(e){return e.item_id==i.item_id}),e.pipeService.emit("gh_item_get",i,u);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_filtered_items_get",{},function(){var t=a(o().m(function t(r,i){var n,u;return o().w(function(t){for(;;)switch(t.n){case 0:if(!i||!i.element_app_id){t.n=3;break}return t.n=1,e.getItems(i.element_app_id);case 1:return n=t.v,t.n=2,e.util.getFilteredItems(n,i.filters_list,i.element_app_id,i.app_id,i.item_id,i.field_groupe,i.search,i.search_params);case 2:u=t.v,e.pipeService.emit("gh_filtered_items_get",i,u);case 3:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_filter_items",{},function(){var t=a(o().m(function t(r,i){var n;return o().w(function(t){for(;;)switch(t.n){case 0:if(!i||!i.items){t.n=2;break}return t.n=1,e.util.getFilteredItems(i.items,i.filters_list,i.element_app_id,i.app_id,i.item_id,i.field_groupe,i.search,i.search_params);case 1:n=t.v,e.pipeService.emit("gh_filter_items",i,n);case 2:return t.a(2)}},t)}));return function(e,r){return t.apply(this,arguments)}}())}}])}();
|
|
323
323
|
},{"../utils.js":"EgeI"}],"PoPF":[function(require,module,exports) {
|
|
324
324
|
"use strict";function e(t){return(e="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})(t)}function t(){var e,n,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.toStringTag||"@@toStringTag";function a(t,i,o,u){var a=i&&i.prototype instanceof l?i:l,s=Object.create(a.prototype);return r(s,"_invoke",function(t,r,i){var o,u,a,l=0,s=i||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return o=t,u=0,a=e,p.n=r,c}};function d(t,r){for(u=t,a=r,n=0;!f&&l&&!i&&n<s.length;n++){var i,o=s[n],d=p.p,v=o[2];t>3?(i=v===r)&&(a=o[(u=o[4])?5:(u=3,3)],o[4]=o[5]=e):o[0]<=d&&((i=t<2&&d<o[1])?(u=0,p.v=r,p.n=o[1]):d<v&&(i=t<3||o[0]>r||r>v)&&(o[4]=t,o[5]=r,p.n=v,u=0))}if(i||t>1)return c;throw f=!0,r}return function(i,s,v){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,v),u=s,a=v;(n=u<2?e:a)||!f;){o||(u?u<3?(u>1&&(p.n=-1),d(u,a)):p.n=a:p.v=a);try{if(l=2,o){if(u||(i="next"),n=o[i]){if(!(n=n.call(o,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=o.return)&&n.call(o),u<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),u=1);o=e}else if((n=(f=p.n<0)?a:t.call(r,p))!==c)break}catch(n){o=e,u=1,a=n}finally{l=1}}return{value:n,done:f}}}(t,o,u),!0),s}var c={};function l(){}function s(){}function f(){}n=Object.getPrototypeOf;var p=[][o]?n(n([][o]())):(r(n={},o,function(){return this}),n),d=f.prototype=l.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,u,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=f,r(d,"constructor",f),r(f,"constructor",s),s.displayName="GeneratorFunction",r(f,u,"GeneratorFunction"),r(d),r(d,u,"Generator"),r(d,o,function(){return this}),r(d,"toString",function(){return"[object Generator]"}),(t=function(){return{w:a,m:v}})()}function r(e,t,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(r=function(e,t,n,i){function u(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(u("next",0),u("throw",1),u("return",2))})(e,t,n,i)}function n(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 i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t,r,n,i,o,u){try{var a=e[o](u),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){u(o,n,i,a,c,"next",e)}function c(e){u(o,n,i,a,c,"throw",e)}a(void 0)})}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(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,f(n.key),n)}}function s(e,t,r){return t&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(t){var r=p(t,"string");return"symbol"==e(r)?r:r+""}function p(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,r||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FieldProcessor=void 0;var d=exports.FieldProcessor=function(){return s(function e(t,r,n,i,o){c(this,e),this.storage=t,this.req=r,this.appProcessor=n,this.itemProcessor=i,this.pipeService=o,this.fieldListeners()},[{key:"deleteFieldApi",value:function(e){return this.req.post({url:"/api/app/delete-field",form:{field_id:e}})}},{key:"updatedFieldApi",value:function(){var e=a(t().m(function e(r){var n,o,u,a=arguments;return t().w(function(e){for(;;)switch(e.n){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.n=1,this.appProcessor.getApp(r);case 1:return o=e.v,u={app_id:r,app_name:o.app_name,group_id:o.group_id,icon:o.icon,field_list:o.field_list.map(function(e){return e.field_id==n.field_id?i(i({},e),n):e}),views_list:o.views_list},e.a(2,this.appProcessor.updateApp(u))}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setFieldValueApi",value:function(e,t,r,n){var i=[{item_id:t,fields:[{field_id:r,field_value:n}]}];return this.itemProcessor.updateItems(e,i)}},{key:"deleteFieldInStorage",value:function(e,t){var r=this.storage.getApp(e);return r.field_list=r.field_list.filter(function(e){return e.field_id!=t}),r.items_list=r.items_list.map(function(e){return e.fields=e.fields.filter(function(e){return e.field_id!=t}),e}),this.storage.updateApp(r),!0}},{key:"updateFieldInStorage",value:function(e,t){var r=this.storage.getApp(e);return r.field_list=r.field_list.map(function(e){return e.field_id==t.field_id?i(i({},e),t):e}),this.storage.updateApp(r),t}},{key:"updateFieldValue",value:function(e,t,r,n){var i=this.storage.getApp(e);return i.items_list.forEach(function(e){e.item_id==t&&e.fields.forEach(function(t){t.field_id==r&&(t.field_value=n,i.items_object[e.item_id][t.field_id]=t)})}),this.storage.updateApp(i),n}},{key:"getField",value:function(){var e=a(t().m(function e(r,n){var i,o;return t().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.appProcessor.getApp(r);case 1:if(i=e.v){e.n=2;break}return e.a(2,null);case 2:o=0;case 3:if(!(o<i.field_list.length)){e.n=5;break}if(i.field_list[o].field_id!=n){e.n=4;break}return e.a(2,i.field_list[o]);case 4:o++,e.n=3;break;case 5:return e.a(2,null)}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"getFieldIdByNameSpace",value:function(){var e=a(t().m(function e(r,n){var i,o;return t().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.appProcessor.getApp(r);case 1:if(i=e.v){e.n=2;break}return e.a(2,null);case 2:o=0;case 3:if(!(o<i.field_list.length)){e.n=5;break}if(i.field_list[o].name_space!=n){e.n=4;break}return e.a(2,i.field_list[o].field_id);case 4:o++,e.n=3;break;case 5:return e.a(2,null)}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"getFieldModels",value:function(){var e=a(t().m(function e(r){var n;return t().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.appProcessor.getApp(r);case 1:if(n=e.v){e.n=2;break}return e.a(2,null);case 2:return e.a(2,n.field_list)}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"updateField",value:function(){var e=a(t().m(function e(r,n){var i;return t().w(function(e){for(;;)switch(e.n){case 0:if(r&&n){e.n=1;break}return e.a(2);case 1:return e.n=2,this.updatedFieldApi(r,n);case 2:return i=e.v,e.a(2,this.updateFieldInStorage(r,i))}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"deleteField",value:function(){var e=a(t().m(function e(r,n){return t().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.deleteFieldApi(n);case 1:return e.a(2,this.deleteFieldInStorage(r,n))}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"getFieldValue",value:function(){var e=a(t().m(function e(r,n,i){var o,u;return t().w(function(e){for(;;)switch(e.n){case 0:return o=null,e.n=1,this.appProcessor.getApp(r);case 1:u=e.v;try{o=u.items_object[n][i].field_value}catch(t){}return e.a(2,o)}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"setFieldValue",value:function(){var e=a(t().m(function e(r,n,i,o){return t().w(function(e){for(;;)switch(e.n){case 0:if(r&&n&&i){e.n=1;break}return e.a(2);case 1:return e.n=2,this.setFieldValueApi(r,n,i,o);case 2:return e.a(2,this.updateFieldValue(r,n,i,o))}},e,this)}));return function(t,r,n,i){return e.apply(this,arguments)}}()},{key:"fieldListeners",value:function(){var e=this;this.pipeService.onRoot("gh_value_get",{},function(){var r=a(t().m(function r(n,i){var o;return t().w(function(t){for(;;)switch(t.n){case 0:if(!(i.app_id&&i.item_id&&i.field_id)){t.n=2;break}return t.n=1,e.getFieldValue(i.app_id,i.item_id,i.field_id);case 1:o=t.v,e.pipeService.emit("gh_value_get",i,o);case 2:return t.a(2)}},r)}));return function(e,t){return r.apply(this,arguments)}}()),this.pipeService.onRoot("gh_value_set",{},function(){var r=a(t().m(function r(n,i){return t().w(function(t){for(;;)switch(t.n){case 0:i.item_id&&(e.setFieldValue(i.app_id,i.item_id,i.field_id,i.new_value),delete i.new_value);case 1:return t.a(2)}},r)}));return function(e,t){return r.apply(this,arguments)}}()),this.pipeService.onRoot("gh_model_get",{},function(){var r=a(t().m(function r(n,i){var o,u;return t().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,e.getField(i.app_id,i.field_id);case 1:o=t.v,e.pipeService.emit("gh_model_get",i,o),t.n=3;break;case 2:t.p=2,u=t.v,console.log("Field model: ",u);case 3:return t.a(2)}},r,null,[[0,2]])}));return function(e,t){return r.apply(this,arguments)}}()),this.pipeService.onRoot("gh_model_update",{},function(){var r=a(t().m(function r(n,i){var o;return t().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e.updateField(i.app_id,i.field_model);case 1:o=t.v,e.pipeService.emit("gh_model_update",{app_id:i.app_id,field_id:i.field_id},o);case 2:return t.a(2)}},r)}));return function(e,t){return r.apply(this,arguments)}}()),this.pipeService.onRoot("gh_models_get",{},function(){var r=a(t().m(function r(n,i){var o;return t().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e.getFieldModels(i.app_id);case 1:o=t.v,e.pipeService.emit("gh_models_get",i,o);case 2:return t.a(2)}},r)}));return function(e,t){return r.apply(this,arguments)}}()),this.pipeService.onRoot("gh_model_delete",{},function(){var r=a(t().m(function r(n,i){var o;return t().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e.deleteField(i.app_id,i.field_id);case 1:o=t.v,e.pipeService.emit("gh_model_delete",i,o);case 2:return t.a(2)}},r)}));return function(e,t){return r.apply(this,arguments)}}())}}])}();
|
|
325
325
|
},{}],"XUT2":[function(require,module,exports) {
|
|
@@ -333,11 +333,11 @@ var t=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),export
|
|
|
333
333
|
},{}],"sPce":[function(require,module,exports) {
|
|
334
334
|
"use strict";function e(e,s){switch(s.api){case"/items/update":console.log("/items/update - ",s),e.itemProcessor.updateItemsInStorage(s.app_id,s.response,s);break;case"/items/add":console.log("/items/add - ",s),e.itemProcessor.addItemsToStorage(s.app_id,s.response);break;case"/items/delete":console.log("/items/delete - ",s),e.itemProcessor.deleteItemsFromStorage(s.app_id,s.response);break;case"/app/update":console.log("/app/update - ",s),e.appProcessor.updateAppFieldsAndViews(s.response);break;case"/file/delete":console.log("file/delete - ",s),e.fileManager.deleteFileFromStorage(s.response.file_id,s.app_id);break;case"/file/upload":console.log("file/upload - ",s),e.fileManager.addFileToStorage(s.app_id,s.response);break;case"/file/formupload":console.log("file/formupload - ",s);break;case"/file/update":e.fileManager.updateFileInStorage(s.response.file_id,s.response.app_id,s.response),console.log("file/update - ",s);break;case"/new/file/duplicate":e.fileManager.addFilesToStorage(s.app_id,s.response),console.log("new/file/duplicate - ",s);break;case"/api/new/document/insert-one":e.documentManager.emitDocumentInsert(s.response),console.log("/api/new/document/insert-one - ",s);break;case"/ws/emit-to-user":console.log("/ws/emit-to-user - ",s);var o=JSON.parse(s.response);e.pipeService.emit(o.service_id,{user_id:s.user_id},o);break;case"/ws/broadcast-to-app-subscribers":console.log("/ws/broadcast-to-app-subscribers - ",s);var a=JSON.parse(s.response);if(!a.data_type)return;e.ghconstructor.getInstance(a.data_type).then(function(e){e.onMessage(s.app_id,s.user_id,a)});break;default:console.warn("WEBSOCKETS is not process this API:",s.api)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebsocketHandler=e;
|
|
335
335
|
},{}],"qJXG":[function(require,module,exports) {
|
|
336
|
-
"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(t)}function t(){var r,e,o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",i=o.toStringTag||"@@toStringTag";function a(t,o,u,i){var a=o&&o.prototype instanceof s?o:s,p=Object.create(a.prototype);return n(p,"_invoke",function(t,n,o){var u,i,a,s=0,p=o||[],f=!1,l={p:0,n:0,v:r,a:h,f:h.bind(r,4),d:function(t,n){return u=t,i=0,a=r,l.n=n,c}};function h(t,n){for(i=t,a=n,e=0;!f&&s&&!o&&e<p.length;e++){var o,u=p[e],h=l.p,v=u[2];t>3?(o=v===n)&&(a=u[(i=u[4])?5:(i=3,3)],u[4]=u[5]=r):u[0]<=h&&((o=t<2&&h<u[1])?(i=0,l.v=n,l.n=u[1]):h<v&&(o=t<3||u[0]>n||n>v)&&(u[4]=t,u[5]=n,l.n=v,i=0))}if(o||t>1)return c;throw f=!0,n}return function(o,p,v){if(s>1)throw TypeError("Generator is already running");for(f&&1===p&&h(p,v),i=p,a=v;(e=i<2?r:a)||!f;){u||(i?i<3?(i>1&&(l.n=-1),h(i,a)):l.n=a:l.v=a);try{if(s=2,u){if(i||(o="next"),e=u[o]){if(!(e=e.call(u,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,i<2&&(i=0)}else 1===i&&(e=u.return)&&e.call(u),i<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),i=1);u=r}else if((e=(f=l.n<0)?a:t.call(n,l))!==c)break}catch(e){u=r,i=1,a=e}finally{s=1}}return{value:e,done:f}}}(t,u,i),!0),p}var c={};function s(){}function p(){}function f(){}e=Object.getPrototypeOf;var l=[][u]?e(e([][u]())):(n(e={},u,function(){return this}),e),h=f.prototype=s.prototype=Object.create(l);function v(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,f):(r.__proto__=f,n(r,i,"GeneratorFunction")),r.prototype=Object.create(h),r}return p.prototype=f,n(h,"constructor",f),n(f,"constructor",p),p.displayName="GeneratorFunction",n(f,i,"GeneratorFunction"),n(h),n(h,i,"Generator"),n(h,u,function(){return this}),n(h,"toString",function(){return"[object Generator]"}),(t=function(){return{w:a,m:v}})()}function n(r,t,e,o){var u=Object.defineProperty;try{u({},"",{})}catch(r){u=0}(n=function(r,t,e,o){function i(t,e){n(r,t,function(r){return this._invoke(t,e,r)})}t?u?u(r,t,{value:e,enumerable:!o,configurable:!o,writable:!o}):r[t]=e:(i("next",0),i("throw",1),i("return",2))})(r,t,e,o)}function e(r,t,n,e,o,u,i){try{var a=r[u](i),c=a.value}catch(r){return void n(r)}a.done?t(c):Promise.resolve(c).then(e,o)}function o(r){return function(){var t=this,n=arguments;return new Promise(function(o,u){var i=r.apply(t,n);function a(r){e(i,o,u,a,c,"next",r)}function c(r){e(i,o,u,a,c,"throw",r)}a(void 0)})}}function u(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function i(r,t){for(var n=0;n<t.length;n++){var e=t[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,c(e.key),e)}}function a(r,t,n){return t&&i(r.prototype,t),n&&i(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function c(t){var n=s(t,"string");return"symbol"==r(n)?n:n+""}function s(t,n){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,n||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.GroupManager=void 0;var p=exports.GroupManager=function(){return a(function r(t,n){u(this,r),this.req=n,this.gudhub=t},[{key:"createGroupApi",value:function(){var r=o(t().m(function r(n){var e,o,u,i;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=
|
|
336
|
+
"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(t)}function t(){var r,e,o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",i=o.toStringTag||"@@toStringTag";function a(t,o,u,i){var a=o&&o.prototype instanceof s?o:s,p=Object.create(a.prototype);return n(p,"_invoke",function(t,n,o){var u,i,a,s=0,p=o||[],f=!1,l={p:0,n:0,v:r,a:h,f:h.bind(r,4),d:function(t,n){return u=t,i=0,a=r,l.n=n,c}};function h(t,n){for(i=t,a=n,e=0;!f&&s&&!o&&e<p.length;e++){var o,u=p[e],h=l.p,v=u[2];t>3?(o=v===n)&&(a=u[(i=u[4])?5:(i=3,3)],u[4]=u[5]=r):u[0]<=h&&((o=t<2&&h<u[1])?(i=0,l.v=n,l.n=u[1]):h<v&&(o=t<3||u[0]>n||n>v)&&(u[4]=t,u[5]=n,l.n=v,i=0))}if(o||t>1)return c;throw f=!0,n}return function(o,p,v){if(s>1)throw TypeError("Generator is already running");for(f&&1===p&&h(p,v),i=p,a=v;(e=i<2?r:a)||!f;){u||(i?i<3?(i>1&&(l.n=-1),h(i,a)):l.n=a:l.v=a);try{if(s=2,u){if(i||(o="next"),e=u[o]){if(!(e=e.call(u,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,i<2&&(i=0)}else 1===i&&(e=u.return)&&e.call(u),i<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),i=1);u=r}else if((e=(f=l.n<0)?a:t.call(n,l))!==c)break}catch(e){u=r,i=1,a=e}finally{s=1}}return{value:e,done:f}}}(t,u,i),!0),p}var c={};function s(){}function p(){}function f(){}e=Object.getPrototypeOf;var l=[][u]?e(e([][u]())):(n(e={},u,function(){return this}),e),h=f.prototype=s.prototype=Object.create(l);function v(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,f):(r.__proto__=f,n(r,i,"GeneratorFunction")),r.prototype=Object.create(h),r}return p.prototype=f,n(h,"constructor",f),n(f,"constructor",p),p.displayName="GeneratorFunction",n(f,i,"GeneratorFunction"),n(h),n(h,i,"Generator"),n(h,u,function(){return this}),n(h,"toString",function(){return"[object Generator]"}),(t=function(){return{w:a,m:v}})()}function n(r,t,e,o){var u=Object.defineProperty;try{u({},"",{})}catch(r){u=0}(n=function(r,t,e,o){function i(t,e){n(r,t,function(r){return this._invoke(t,e,r)})}t?u?u(r,t,{value:e,enumerable:!o,configurable:!o,writable:!o}):r[t]=e:(i("next",0),i("throw",1),i("return",2))})(r,t,e,o)}function e(r,t,n,e,o,u,i){try{var a=r[u](i),c=a.value}catch(r){return void n(r)}a.done?t(c):Promise.resolve(c).then(e,o)}function o(r){return function(){var t=this,n=arguments;return new Promise(function(o,u){var i=r.apply(t,n);function a(r){e(i,o,u,a,c,"next",r)}function c(r){e(i,o,u,a,c,"throw",r)}a(void 0)})}}function u(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function i(r,t){for(var n=0;n<t.length;n++){var e=t[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,c(e.key),e)}}function a(r,t,n){return t&&i(r.prototype,t),n&&i(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function c(t){var n=s(t,"string");return"symbol"==r(n)?n:n+""}function s(t,n){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,n||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.GroupManager=void 0;var p=exports.GroupManager=function(){return a(function r(t,n){u(this,r),this.req=n,this.gudhub=t},[{key:"createGroupApi",value:function(){var r=o(t().m(function r(n){var e,o,u,i,a,c=arguments;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return e=c.length>1&&void 0!==c[1]&&c[1],r.p=1,r.n=2,this.gudhub.auth.getToken();case 2:return i=r.v,o={token:i,group_name:n,private:e},r.n=3,this.req.post({url:"/api/sharing-group/create-group",form:o});case 3:return u=r.v,r.a(2,u);case 4:return r.p=4,a=r.v,console.log(a),r.a(2,null)}},r,this,[[1,4]])}));return function(t){return r.apply(this,arguments)}}()},{key:"updateGroupApi",value:function(){var r=o(t().m(function r(n,e){var o,u,i,a;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,this.gudhub.auth.getToken();case 1:return i=r.v,o={token:i,group_name:e,group_id:n},r.n=2,this.req.post({url:"/api/sharing-group/update-group",form:o});case 2:return u=r.v,r.a(2,u);case 3:return r.p=3,a=r.v,console.log(a),r.a(2,null)}},r,this,[[0,3]])}));return function(t,n){return r.apply(this,arguments)}}()},{key:"deleteGroupApi",value:function(){var r=o(t().m(function r(n){var e,o,u,i;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,this.gudhub.auth.getToken();case 1:return u=r.v,e={token:u,group_id:n},r.n=2,this.req.post({url:"/api/sharing-group/delete-group",form:e});case 2:return o=r.v,r.a(2,o);case 3:return r.p=3,i=r.v,console.log(i),r.a(2,null)}},r,this,[[0,3]])}));return function(t){return r.apply(this,arguments)}}()},{key:"addUserToGroupApi",value:function(){var r=o(t().m(function r(n,e,o){var u,i,a,c;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,this.gudhub.auth.getToken();case 1:return a=r.v,u={token:a,group_id:n,user_id:e,group_permission:o},r.n=2,this.req.post({url:"/api/sharing-group/add-user-to-group",form:u});case 2:return i=r.v,r.a(2,i);case 3:return r.p=3,c=r.v,console.log(c),r.a(2,null)}},r,this,[[0,3]])}));return function(t,n,e){return r.apply(this,arguments)}}()},{key:"getUsersByGroupApi",value:function(){var r=o(t().m(function r(n){var e,o,u,i;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,this.gudhub.auth.getToken();case 1:return u=r.v,e={token:u,group_id:n},r.n=2,this.req.post({url:"/api/sharing-group/get-users-by-group",form:e});case 2:return o=r.v,r.a(2,o);case 3:return r.p=3,i=r.v,console.log(i),r.a(2,null)}},r,this,[[0,3]])}));return function(t){return r.apply(this,arguments)}}()},{key:"updateUserInGroupApi",value:function(){var r=o(t().m(function r(n,e,o){var u,i,a,c;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,this.gudhub.auth.getToken();case 1:return a=r.v,u={token:a,user_id:n,group_id:e,group_permission:o},r.n=2,this.req.post({url:"/api/sharing-group/update-user-in-group",form:u});case 2:return i=r.v,r.a(2,i);case 3:return r.p=3,c=r.v,console.log(c),r.a(2,null)}},r,this,[[0,3]])}));return function(t,n,e){return r.apply(this,arguments)}}()},{key:"deleteUserFromGroupApi",value:function(){var r=o(t().m(function r(n,e){var o,u,i,a;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,this.gudhub.auth.getToken();case 1:return i=r.v,o={token:i,user_id:n,group_id:e},r.n=2,this.req.post({url:"/api/sharing-group/delete-user-from-group",form:o});case 2:return u=r.v,r.a(2,u);case 3:return r.p=3,a=r.v,console.log(a),r.a(2,null)}},r,this,[[0,3]])}));return function(t,n){return r.apply(this,arguments)}}()},{key:"getGroupsByUserApi",value:function(){var r=o(t().m(function r(n){var e,o,u,i;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,this.gudhub.auth.getToken();case 1:return u=r.v,e={token:u,user_id:n},r.n=2,this.req.post({url:"/api/sharing-group/get-groups-by-user",form:e});case 2:return o=r.v,r.a(2,o);case 3:return r.p=3,i=r.v,console.log(i),r.a(2,null)}},r,this,[[0,3]])}));return function(t){return r.apply(this,arguments)}}()}])}();
|
|
337
337
|
},{}],"Z7AV":[function(require,module,exports) {
|
|
338
338
|
"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(t)}function t(){var r,e,o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",i=o.toStringTag||"@@toStringTag";function a(t,o,u,i){var a=o&&o.prototype instanceof c?o:c,s=Object.create(a.prototype);return n(s,"_invoke",function(t,n,o){var u,i,a,c=0,s=o||[],f=!1,l={p:0,n:0,v:r,a:v,f:v.bind(r,4),d:function(t,n){return u=t,i=0,a=r,l.n=n,p}};function v(t,n){for(i=t,a=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,u=s[e],v=l.p,h=u[2];t>3?(o=h===n)&&(a=u[(i=u[4])?5:(i=3,3)],u[4]=u[5]=r):u[0]<=v&&((o=t<2&&v<u[1])?(i=0,l.v=n,l.n=u[1]):v<h&&(o=t<3||u[0]>n||n>h)&&(u[4]=t,u[5]=n,l.n=h,i=0))}if(o||t>1)return p;throw f=!0,n}return function(o,s,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&v(s,h),i=s,a=h;(e=i<2?r:a)||!f;){u||(i?i<3?(i>1&&(l.n=-1),v(i,a)):l.n=a:l.v=a);try{if(c=2,u){if(i||(o="next"),e=u[o]){if(!(e=e.call(u,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,i<2&&(i=0)}else 1===i&&(e=u.return)&&e.call(u),i<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),i=1);u=r}else if((e=(f=l.n<0)?a:t.call(n,l))!==p)break}catch(e){u=r,i=1,a=e}finally{c=1}}return{value:e,done:f}}}(t,u,i),!0),s}var p={};function c(){}function s(){}function f(){}e=Object.getPrototypeOf;var l=[][u]?e(e([][u]())):(n(e={},u,function(){return this}),e),v=f.prototype=c.prototype=Object.create(l);function h(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,f):(r.__proto__=f,n(r,i,"GeneratorFunction")),r.prototype=Object.create(v),r}return s.prototype=f,n(v,"constructor",f),n(f,"constructor",s),s.displayName="GeneratorFunction",n(f,i,"GeneratorFunction"),n(v),n(v,i,"Generator"),n(v,u,function(){return this}),n(v,"toString",function(){return"[object Generator]"}),(t=function(){return{w:a,m:h}})()}function n(r,t,e,o){var u=Object.defineProperty;try{u({},"",{})}catch(r){u=0}(n=function(r,t,e,o){function i(t,e){n(r,t,function(r){return this._invoke(t,e,r)})}t?u?u(r,t,{value:e,enumerable:!o,configurable:!o,writable:!o}):r[t]=e:(i("next",0),i("throw",1),i("return",2))})(r,t,e,o)}function e(r,t,n,e,o,u,i){try{var a=r[u](i),p=a.value}catch(r){return void n(r)}a.done?t(p):Promise.resolve(p).then(e,o)}function o(r){return function(){var t=this,n=arguments;return new Promise(function(o,u){var i=r.apply(t,n);function a(r){e(i,o,u,a,p,"next",r)}function p(r){e(i,o,u,a,p,"throw",r)}a(void 0)})}}function u(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function i(r,t){for(var n=0;n<t.length;n++){var e=t[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,p(e.key),e)}}function a(r,t,n){return t&&i(r.prototype,t),n&&i(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function p(t){var n=c(t,"string");return"symbol"==r(n)?n:n+""}function c(t,n){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,n||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppGroupSharing=void 0;var s=exports.AppGroupSharing=function(){return a(function r(t,n){u(this,r),this.req=n,this.gudhub=t},[{key:"addAppToGroupApi",value:function(){var r=o(t().m(function r(n,e,o){var u,i,a,p;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,this.gudhub.auth.getToken();case 1:return a=r.v,u={token:a,app_id:n,group_id:e,app_permission:o},r.n=2,this.req.post({url:"/api/sharing-group/add-app-to-group",form:u});case 2:return i=r.v,r.a(2,i);case 3:return r.p=3,p=r.v,console.log(p),r.a(2,null)}},r,this,[[0,3]])}));return function(t,n,e){return r.apply(this,arguments)}}()},{key:"getAppsByGroupApi",value:function(){var r=o(t().m(function r(n){var e,o,u,i;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,this.gudhub.auth.getToken();case 1:return u=r.v,e={token:u,group_id:n},r.n=2,this.req.post({url:"/api/sharing-group/get-apps-by-group",form:e});case 2:return o=r.v,r.a(2,o);case 3:return r.p=3,i=r.v,console.log(i),r.a(2,null)}},r,this,[[0,3]])}));return function(t){return r.apply(this,arguments)}}()},{key:"updateAppInGroupApi",value:function(){var r=o(t().m(function r(n,e,o){var u,i,a,p;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,this.gudhub.auth.getToken();case 1:return a=r.v,u={token:a,group_id:e,app_id:n,app_permission:o},r.n=2,this.req.post({url:"/api/sharing-group/update-app-in-group",form:u});case 2:return i=r.v,r.a(2,i);case 3:return r.p=3,p=r.v,console.log(p),r.a(2,null)}},r,this,[[0,3]])}));return function(t,n,e){return r.apply(this,arguments)}}()},{key:"deleteAppFromGroupApi",value:function(){var r=o(t().m(function r(n,e,o){var u,i,a,p;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,this.gudhub.auth.getToken();case 1:return a=r.v,u={token:a,group_id:e,app_id:n,app_permission:o},r.n=2,this.req.post({url:"/api/sharing-group/delete-app-from-group",form:u});case 2:return i=r.v,r.a(2,i);case 3:return r.p=3,p=r.v,console.log(p),r.a(2,null)}},r,this,[[0,3]])}));return function(t,n,e){return r.apply(this,arguments)}}()},{key:"getGroupsByAppApi",value:function(){var r=o(t().m(function r(n){var e,o,u,i;return t().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,this.gudhub.auth.getToken();case 1:return u=r.v,e={token:u,app_id:n},r.n=2,this.req.post({url:"/api/sharing-group/get-groups-by-app",form:e});case 2:return o=r.v,r.a(2,o);case 3:return r.p=3,i=r.v,console.log(i),r.a(2,null)}},r,this,[[0,3]])}));return function(t){return r.apply(this,arguments)}}()}])}();
|
|
339
339
|
},{}],"LS0j":[function(require,module,exports) {
|
|
340
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GroupSharing=void 0;var r=require("../groupManager/GroupManager.js"),e=require("./AppGroupSharing.js");function t(r){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function n(){var r,e,t="function"==typeof Symbol?Symbol:{},u=t.iterator||"@@iterator",i=t.toStringTag||"@@toStringTag";function p(t,n,u,i){var p=n&&n.prototype instanceof c?n:c,s=Object.create(p.prototype);return o(s,"_invoke",function(t,n,o){var u,i,p,c=0,s=o||[],f=!1,l={p:0,n:0,v:r,a:y,f:y.bind(r,4),d:function(e,t){return u=e,i=0,p=r,l.n=t,a}};function y(t,n){for(i=t,p=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,u=s[e],y=l.p,
|
|
340
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GroupSharing=void 0;var r=require("../groupManager/GroupManager.js"),e=require("./AppGroupSharing.js");function t(r){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function n(){var r,e,t="function"==typeof Symbol?Symbol:{},u=t.iterator||"@@iterator",i=t.toStringTag||"@@toStringTag";function p(t,n,u,i){var p=n&&n.prototype instanceof c?n:c,s=Object.create(p.prototype);return o(s,"_invoke",function(t,n,o){var u,i,p,c=0,s=o||[],f=!1,l={p:0,n:0,v:r,a:y,f:y.bind(r,4),d:function(e,t){return u=e,i=0,p=r,l.n=t,a}};function y(t,n){for(i=t,p=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,u=s[e],y=l.p,v=u[2];t>3?(o=v===n)&&(p=u[(i=u[4])?5:(i=3,3)],u[4]=u[5]=r):u[0]<=y&&((o=t<2&&y<u[1])?(i=0,l.v=n,l.n=u[1]):y<v&&(o=t<3||u[0]>n||n>v)&&(u[4]=t,u[5]=n,l.n=v,i=0))}if(o||t>1)return a;throw f=!0,n}return function(o,s,v){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&y(s,v),i=s,p=v;(e=i<2?r:p)||!f;){u||(i?i<3?(i>1&&(l.n=-1),y(i,p)):l.n=p:l.v=p);try{if(c=2,u){if(i||(o="next"),e=u[o]){if(!(e=e.call(u,p)))throw TypeError("iterator result is not an object");if(!e.done)return e;p=e.value,i<2&&(i=0)}else 1===i&&(e=u.return)&&e.call(u),i<2&&(p=TypeError("The iterator does not provide a '"+o+"' method"),i=1);u=r}else if((e=(f=l.n<0)?p:t.call(n,l))!==a)break}catch(e){u=r,i=1,p=e}finally{c=1}}return{value:e,done:f}}}(t,u,i),!0),s}var a={};function c(){}function s(){}function f(){}e=Object.getPrototypeOf;var l=[][u]?e(e([][u]())):(o(e={},u,function(){return this}),e),y=f.prototype=c.prototype=Object.create(l);function v(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,f):(r.__proto__=f,o(r,i,"GeneratorFunction")),r.prototype=Object.create(y),r}return s.prototype=f,o(y,"constructor",f),o(f,"constructor",s),s.displayName="GeneratorFunction",o(f,i,"GeneratorFunction"),o(y),o(y,i,"Generator"),o(y,u,function(){return this}),o(y,"toString",function(){return"[object Generator]"}),(n=function(){return{w:p,m:v}})()}function o(r,e,t,n){var u=Object.defineProperty;try{u({},"",{})}catch(r){u=0}(o=function(r,e,t,n){function i(e,t){o(r,e,function(r){return this._invoke(e,t,r)})}e?u?u(r,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):r[e]=t:(i("next",0),i("throw",1),i("return",2))})(r,e,t,n)}function u(r,e,t,n,o,u,i){try{var p=r[u](i),a=p.value}catch(r){return void t(r)}p.done?e(a):Promise.resolve(a).then(n,o)}function i(r){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function p(r){u(i,n,o,p,a,"next",r)}function a(r){u(i,n,o,p,a,"throw",r)}p(void 0)})}}function p(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function a(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,s(n.key),n)}}function c(r,e,t){return e&&a(r.prototype,e),t&&a(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function s(r){var e=f(r,"string");return"symbol"==t(e)?e:e+""}function f(r,e){if("object"!=t(r)||!r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var o=n.call(r,e||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(r)}var l=exports.GroupSharing=function(){return c(function t(n,o,u){p(this,t),this.req=o,this.gudhub=n,this.pipeService=u,this.groupManager=new r.GroupManager(n,o),this.appGroupSharing=new e.AppGroupSharing(n,o)},[{key:"createGroup",value:function(r){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.groupManager.createGroupApi(r,e)}},{key:"updateGroup",value:function(r,e){return this.groupManager.updateGroupApi(r,e)}},{key:"deleteGroup",value:function(r){return this.groupManager.deleteGroupApi(r)}},{key:"addUserToGroup",value:function(){var r=i(n().m(function r(e,t,o){var u;return n().w(function(r){for(;;)switch(r.n){case 0:return r.n=1,this.groupManager.addUserToGroupApi(e,t,o);case 1:return u=r.v,this.pipeService.emit("group_members_add",{app_id:"group_sharing"},u),r.a(2,u)}},r,this)}));return function(e,t,n){return r.apply(this,arguments)}}()},{key:"getUsersByGroup",value:function(r){return this.groupManager.getUsersByGroupApi(r)}},{key:"updateUserInGroup",value:function(){var r=i(n().m(function r(e,t,o){var u;return n().w(function(r){for(;;)switch(r.n){case 0:return r.n=1,this.groupManager.updateUserInGroupApi(e,t,o);case 1:return u=r.v,this.pipeService.emit("group_members_update",{app_id:"group_sharing"},u),r.a(2,u)}},r,this)}));return function(e,t,n){return r.apply(this,arguments)}}()},{key:"deleteUserFromGroup",value:function(){var r=i(n().m(function r(e,t){var o;return n().w(function(r){for(;;)switch(r.n){case 0:return r.n=1,this.groupManager.deleteUserFromGroupApi(e,t);case 1:return o=r.v,this.pipeService.emit("group_members_delete",{app_id:"group_sharing"},o),r.a(2,o)}},r,this)}));return function(e,t){return r.apply(this,arguments)}}()},{key:"getGroupsByUser",value:function(r){return this.groupManager.getGroupsByUserApi(r)}},{key:"addAppToGroup",value:function(r,e,t){return this.appGroupSharing.addAppToGroupApi(r,e,t)}},{key:"getAppsByGroup",value:function(r){return this.appGroupSharing.getAppsByGroupApi(r)}},{key:"updateAppInGroup",value:function(r,e,t){return this.appGroupSharing.updateAppInGroupApi(r,e,t)}},{key:"deleteAppFromGroup",value:function(r,e,t){return this.appGroupSharing.deleteAppFromGroupApi(r,e,t)}},{key:"getGroupsByApp",value:function(r){return this.appGroupSharing.getGroupsByAppApi(r)}}])}();
|
|
341
341
|
},{"../groupManager/GroupManager.js":"qJXG","./AppGroupSharing.js":"Z7AV"}],"kPfD":[function(require,module,exports) {
|
|
342
342
|
"use strict";function t(r){return(t="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})(r)}function r(){var t,e,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",u=o.toStringTag||"@@toStringTag";function a(r,o,i,u){var a=o&&o.prototype instanceof f?o:f,p=Object.create(a.prototype);return n(p,"_invoke",function(r,n,o){var i,u,a,f=0,p=o||[],s=!1,l={p:0,n:0,v:t,a:v,f:v.bind(t,4),d:function(r,n){return i=r,u=0,a=t,l.n=n,c}};function v(r,n){for(u=r,a=n,e=0;!s&&f&&!o&&e<p.length;e++){var o,i=p[e],v=l.p,y=i[2];r>3?(o=y===n)&&(a=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=v&&((o=r<2&&v<i[1])?(u=0,l.v=n,l.n=i[1]):v<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,l.n=y,u=0))}if(o||r>1)return c;throw s=!0,n}return function(o,p,y){if(f>1)throw TypeError("Generator is already running");for(s&&1===p&&v(p,y),u=p,a=y;(e=u<2?t:a)||!s;){i||(u?u<3?(u>1&&(l.n=-1),v(u,a)):l.n=a:l.v=a);try{if(f=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(s=l.n<0)?a:r.call(n,l))!==c)break}catch(e){i=t,u=1,a=e}finally{f=1}}return{value:e,done:s}}}(r,i,u),!0),p}var c={};function f(){}function p(){}function s(){}e=Object.getPrototypeOf;var l=[][i]?e(e([][i]())):(n(e={},i,function(){return this}),e),v=s.prototype=f.prototype=Object.create(l);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,n(t,u,"GeneratorFunction")),t.prototype=Object.create(v),t}return p.prototype=s,n(v,"constructor",s),n(s,"constructor",p),p.displayName="GeneratorFunction",n(s,u,"GeneratorFunction"),n(v),n(v,u,"Generator"),n(v,i,function(){return this}),n(v,"toString",function(){return"[object Generator]"}),(r=function(){return{w:a,m:y}})()}function n(t,r,e,o){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}(n=function(t,r,e,o){function u(r,e){n(t,r,function(t){return this._invoke(r,e,t)})}r?i?i(t,r,{value:e,enumerable:!o,configurable:!o,writable:!o}):t[r]=e:(u("next",0),u("throw",1),u("return",2))})(t,r,e,o)}function e(t,r,n,e,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void n(t)}a.done?r(c):Promise.resolve(c).then(e,o)}function o(t){return function(){var r=this,n=arguments;return new Promise(function(o,i){var u=t.apply(r,n);function a(t){e(u,o,i,a,c,"next",t)}function c(t){e(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 n=0;n<r.length;n++){var e=r[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,c(e.key),e)}}function a(t,r,n){return r&&u(t.prototype,r),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(r){var n=f(r,"string");return"symbol"==t(n)?n:n+""}function f(r,n){if("object"!=t(r)||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var o=e.call(r,n||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(r)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.GroupInvitation=void 0;var p=exports.GroupInvitation=function(){return a(function t(r,n){i(this,t),this.req=n,this.gudhub=r},[{key:"groupInvitationCreate",value:function(){var t=o(r().m(function t(n,e){var o;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.post({url:"/api/invitation/create",form:{sharing_groups:n,actions:e}});case 1:return t.a(2,t.v);case 2:return t.p=2,o=t.v,console.log(o),t.a(2,null)}},t,this,[[0,2]])}));return function(r,n){return t.apply(this,arguments)}}()},{key:"groupInvitationGet",value:function(){var t=o(r().m(function t(n){var e,o;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,e=new URLSearchParams({invitation_id:n}),t.n=1,this.req.axiosRequest({method:"GET",url:"".concat(this.req.root,"/api/invitation/get?").concat(e.toString())});case 1:return t.a(2,t.v);case 2:return t.p=2,o=t.v,console.log(o),t.a(2,null)}},t,this,[[0,2]])}));return function(r){return t.apply(this,arguments)}}()},{key:"groupInvitationAccept",value:function(){var t=o(r().m(function t(n){var e;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.post({url:"/api/invitation/accept",form:{invitation_id:n}});case 1:return t.a(2,t.v);case 2:return t.p=2,e=t.v,console.log(e),t.a(2,null)}},t,this,[[0,2]])}));return function(r){return t.apply(this,arguments)}}()}])}(),s=exports.default=p;
|
|
343
343
|
},{}],"XaHW":[function(require,module,exports) {
|
|
@@ -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,q(i.key),i)}}function W(e,t,r){return t&&j(e.prototype,t),r&&j(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function q(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 W(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.fieldProcessor),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){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.util.filter(e,t,r)}},{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]:{},i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.util.getFilteredItems(e,t,r.element_app_id,r.app_id,r.item_id,r.field_group,r.search,r.search_params,i)}},{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:"uploadFileFromStringWithSetValue",value:function(e){return this.fileManager.uploadFileFromStringWithSetValue(e)}},{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,q(i.key),i)}}function W(e,t,r){return t&&j(e.prototype,t),r&&j(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function q(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 W(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.fieldProcessor),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){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.util.filter(e,t,r)}},{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]:{},i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.util.getFilteredItems(e,t,r.element_app_id,r.app_id,r.item_id,r.field_group,r.search,r.search_params,i)}},{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:"uploadFileFromStringWithSetValue",value:function(e){return this.fileManager.uploadFileFromStringWithSetValue(e)}},{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:"getUserWorkspace",value:function(){return this.auth.getUserWorkspace()}},{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")
|