@gudhub/core 1.1.26 → 1.1.28
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/FieldProcessor/FieldProcessor.js +7 -2
- package/GUDHUB/GHConstructor/ghconstructor.js +14 -19
- package/GUDHUB/GHConstructor/interpritate.js +19 -16
- package/GUDHUB/Storage/Storage.js +5 -1
- package/GUDHUB/gudhub.js +2 -2
- package/package.json +1 -1
- package/umd/library.min.js +5 -5
- package/umd/library.min.js.map +1 -1
|
@@ -89,8 +89,13 @@ export class FieldProcessor {
|
|
|
89
89
|
|
|
90
90
|
async getField(app_id, field_id) {
|
|
91
91
|
const app = await this.appProcessor.getApp(app_id);
|
|
92
|
-
if(!app) return null
|
|
93
|
-
|
|
92
|
+
if(!app) return null;
|
|
93
|
+
for(let i = 0; i < app.field_list.length; i++) {
|
|
94
|
+
if(app.field_list[i].field_id == field_id) {
|
|
95
|
+
return app.field_list[i];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
//!!!!! Shou Be Renamed to getFields() !!!!!!!
|
|
@@ -4,7 +4,7 @@ import createClassInstance from './createClassInstance.js';
|
|
|
4
4
|
export class GHConstructor {
|
|
5
5
|
constructor(gudhub) {
|
|
6
6
|
this.gudhub = gudhub;
|
|
7
|
-
this.cache =
|
|
7
|
+
this.cache = {};
|
|
8
8
|
this.modulesQueue = {};
|
|
9
9
|
this.angularInjector;
|
|
10
10
|
this.nodeWindow;
|
|
@@ -16,34 +16,29 @@ export class GHConstructor {
|
|
|
16
16
|
// If yes, return module from cache.
|
|
17
17
|
|
|
18
18
|
async getInstance(module_id) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
} else {
|
|
30
|
-
resolve(this.getCached(module_id));
|
|
31
|
-
}
|
|
32
|
-
});
|
|
19
|
+
if(this.getCached(module_id)) {
|
|
20
|
+
return this.getCached(module_id);
|
|
21
|
+
} else if (this.modulesQueue[module_id]) {
|
|
22
|
+
await this.modulesQueue[module_id];
|
|
23
|
+
} else {
|
|
24
|
+
this.modulesQueue[module_id] = this.createInstance(module_id);
|
|
25
|
+
await this.modulesQueue[module_id];
|
|
26
|
+
}
|
|
27
|
+
return this.getCached(module_id);
|
|
33
28
|
}
|
|
34
29
|
|
|
35
30
|
/*************** PUT TO CACHE ***************/
|
|
36
31
|
// Just pushing module to cache.
|
|
37
32
|
|
|
38
|
-
pupToCache(module) {
|
|
39
|
-
this.cache
|
|
33
|
+
pupToCache(module_id, module) {
|
|
34
|
+
this.cache[module_id] = module;
|
|
40
35
|
}
|
|
41
36
|
|
|
42
37
|
/*************** GET CACHED ***************/
|
|
43
38
|
// Find module in cache and return it.
|
|
44
39
|
|
|
45
40
|
getCached(module_id) {
|
|
46
|
-
return this.cache
|
|
41
|
+
return this.cache[module_id];
|
|
47
42
|
}
|
|
48
43
|
|
|
49
44
|
/*************** INIT ANGULAR INJECTOR ***************/
|
|
@@ -83,7 +78,7 @@ export class GHConstructor {
|
|
|
83
78
|
}
|
|
84
79
|
|
|
85
80
|
if(result) {
|
|
86
|
-
this.pupToCache(result);
|
|
81
|
+
this.pupToCache(module_id, result);
|
|
87
82
|
}
|
|
88
83
|
|
|
89
84
|
return result;
|
|
@@ -72,22 +72,25 @@ export class Interpritate {
|
|
|
72
72
|
|
|
73
73
|
/********************* GET INTERPRETATION BY ID *********************/
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
75
|
+
// We add ability to pass value as argument, to reduce number of operations in this case (getFieldValue)
|
|
76
|
+
// This helps if you call method many times, for example in calculator sum and you already have field value
|
|
77
|
+
// By default, value is null, to not break old code working with this method
|
|
78
|
+
|
|
79
|
+
// For field same as above for value
|
|
80
|
+
async getInterpretationById(appId, itemId, fieldId, interpretationId, value = null, field = null) {
|
|
81
|
+
let fieldValue = value == null ? await this.gudhub.getFieldValue(appId, itemId, fieldId) : value;
|
|
82
|
+
let fieldModel = field == null ? await this.gudhub.getField(appId, fieldId) : field;
|
|
83
|
+
if(fieldModel == null) {
|
|
84
|
+
return '';
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const instance = await this.gudhub.ghconstructor.getInstance(fieldModel.data_type);
|
|
88
|
+
const interpretatedValue = await instance.getInterpretation(fieldValue, interpretationId, fieldModel.data_type, fieldModel, itemId, appId);
|
|
89
|
+
if(interpretatedValue.html == '<span>no interpretation</span>') {
|
|
90
|
+
return fieldValue;
|
|
91
|
+
} else {
|
|
92
|
+
return interpretatedValue.html;
|
|
93
|
+
}
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
}
|
|
@@ -61,7 +61,11 @@ export class Storage {
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
getApp(app_id) {
|
|
64
|
-
|
|
64
|
+
for(let i = 0; i < this.apps_list.length; i++) {
|
|
65
|
+
if(this.apps_list[i].app_id == app_id) {
|
|
66
|
+
return this.apps_list[i];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
unsetApps() {
|
package/GUDHUB/gudhub.js
CHANGED
|
@@ -166,8 +166,8 @@ export class GudHub {
|
|
|
166
166
|
|
|
167
167
|
/******************* GET INTERPRETATION BY ID *******************/
|
|
168
168
|
|
|
169
|
-
getInterpretationById(appId, itemId, fieldId, interpretationId) {
|
|
170
|
-
return this.interpritate.getInterpretationById(appId, itemId, fieldId, interpretationId);
|
|
169
|
+
getInterpretationById(appId, itemId, fieldId, interpretationId, value, field) {
|
|
170
|
+
return this.interpritate.getInterpretationById(appId, itemId, fieldId, interpretationId, value, field);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
//============ FILTER ==========//
|
package/package.json
CHANGED
package/umd/library.min.js
CHANGED
|
@@ -106,7 +106,7 @@ var t="function"==typeof Map&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t
|
|
|
106
106
|
},{"./utils.js":"Lc8J"}],"FJWL":[function(require,module,exports) {
|
|
107
107
|
"use strict";function a(a,e){return[{name:"text",url:e+"/"+a+"text_data.js",type:"angular"},{name:"text_opt",url:e+"/"+a+"text_options_data.js",type:"angular"},{name:"number",url:e+"/"+a+"number_data.js",type:"angular"},{name:"task_board",url:e+"/"+a+"task_board_data.js",type:"angular"},{name:"visualizer",url:e+"/"+a+"visualizer_data.js",type:"angular"},{name:"enterprice_visualizer",url:e+"/"+a+"enterprice_visualizer_data.js",type:"angular"},{name:"email",url:e+"/"+a+"email_data.js",type:"angular"},{name:"date",url:e+"/"+a+"date_data.js",type:"angular"},{name:"radio_button",url:e+"/"+a+"radio_button_data.js",type:"angular"},{name:"radio_icon",url:e+"/"+a+"radio_icon_data.js",type:"angular"},{name:"twilio_phone",url:e+"/"+a+"twilio_phone_data.js",type:"angular"},{name:"twilio_autodialer",url:e+"/"+a+"twillio_autodialer_data.js",type:"angular"},{name:"color",url:e+"/"+a+"color_data.js",type:"angular"},{name:"charts",url:e+"/"+a+"charts_data.js",type:"angular"},{name:"funnel_chart",url:e+"/"+a+"funnel_chart_data.js",type:"angular"},{name:"add_items_from_template",url:e+"/"+a+"add_items_from_template_data.js",type:"angular"},{name:"item_ref",url:e+"/"+a+"itemRef_data.js",type:"angular"},{name:"calendar",js:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/main.js",css:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/style.css",type:"class"},{name:"data_ref",url:e+"/"+a+"data_ref_data.js",type:"angular"},{name:"table",url:e+"/"+a+"table_data.js",type:"angular"},{name:"tile",url:e+"/"+a+"tile_data.js",type:"angular"},{name:"file",url:e+"/"+a+"file_data.js",type:"angular"},{name:"image",url:e+"/"+a+"image_data.js",type:"angular"},{name:"text_editor",url:e+"/"+a+"text_editor_data.js",type:"angular"},{name:"tinymse",url:e+"/"+a+"tinymse_data.js",type:"angular"},{name:"duration",url:e+"/"+a+"duration_data.js",type:"angular"},{name:"user",url:e+"/"+a+"user_data.js",type:"angular"},{name:"app",url:e+"/"+a+"application_data.js",type:"angular"},{name:"field",url:e+"/"+a+"field_data.js",type:"angular"},{name:"available",url:e+"/"+a+"available_data.js",type:"angular"},{name:"view_list",url:e+"/"+a+"view_list_data.js",type:"angular"},{name:"calculator",url:e+"/"+a+"calculator_data.js",type:"angular"},{name:"string_join",url:e+"/"+a+"string_joiner_data.js",type:"angular"},{name:"signature",url:e+"/"+a+"signature_data.js",type:"angular"},{name:"sendEmail",url:e+"/"+a+"send_email_data.js",type:"angular"},{name:"boolean",url:e+"/"+a+"boolean_data.js",type:"angular"},{name:"product_gallery",url:e+"/"+a+"product_gallery_data.js",type:"angular"},{name:"online_inventory",url:e+"/"+a+"online_inventory_data.js",type:"angular"},{name:"3d_edges",url:e+"/"+a+"3d_edges_data.js",type:"angular"},{name:"color_list",url:e+"/"+a+"color_list_data.js",type:"angular"},{name:"go_to_link",url:e+"/"+a+"go_to_link_data.js",type:"angular"},{name:"go_to_view",url:e+"/"+a+"go_to_view_data.js",type:"angular"},{name:"range",url:e+"/"+a+"range_data.js",type:"angular"},{name:"barcode",url:e+"/"+a+"barcode_data.js",type:"angular"},{name:"item_remote_add",url:e+"/"+a+"item_remote_add_data.js",type:"angular"},{name:"item_remote_update",url:e+"/"+a+"item_remote_update_data.js",type:"angular"},{name:"timeline",url:e+"/"+a+"timeline_data.js",type:"angular"},{name:"delete_item",url:e+"/"+a+"delete_action.js",type:"angular"},{name:"print_doc",url:e+"/"+a+"print_doc_action.js",type:"angular"},{name:"open_item",url:e+"/"+a+"open_item_action.js",type:"angular"},{name:"edit_template",url:e+"/"+a+"edit_template_action.js",type:"angular"},{name:"open_app",url:e+"/"+a+"open_app_action.js",type:"angular"},{name:"user_settings",url:e+"/"+a+"user_settings_action.js",type:"angular"},{name:"app_sharing",url:e+"/"+a+"sharing_action.js",type:"angular"},{name:"app_constructor",url:e+"/"+a+"app_constructor_action.js",type:"angular"},{name:"export_csv",url:e+"/"+a+"export_csv.js",type:"angular"},{name:"import_csv",url:e+"/"+a+"import_csv.js",type:"angular"},{name:"add_items",url:e+"/"+a+"add_items_action.js",type:"angular"},{name:"update_items",url:e+"/"+a+"update_items_action.js",type:"angular"},{name:"install_app",url:e+"/"+a+"install_app_action.js",type:"angular"},{name:"search_action",url:e+"/"+a+"search_action.js",type:"angular"},{name:"filter_table",url:e+"/"+a+"filter_table_action.js",type:"angular"},{name:"slider",url:e+"/"+a+"slider_data.js",type:"angular"},{name:"clone_item",url:e+"/"+a+"clone_item_action.js",type:"angular"},{name:"close",url:e+"/"+a+"close_action.js",type:"angular"},{name:"phone",url:e+"/"+a+"phone_data.js",type:"angular"},{name:"link",url:e+"/"+a+"link_data.js",type:"angular"},{name:"sheduling",url:e+"/"+a+"sheduling_data.js",type:"angular"},{name:"qrcode",url:e+"/"+a+"qrcode_data.js",type:"angular"},{name:"graph2d",url:e+"/"+a+"graph2d_data.js",type:"angular"},{name:"quote_tool",url:e+"/"+a+"quote_tool_data.js",type:"angular"},{name:"cards",url:e+"/"+a+"cards_data.js",type:"angular"},{name:"jsonConstructor",url:e+"/"+a+"json_constructor_data.js",type:"angular"},{name:"button",js:"https://gudhub.com/modules/button_action/button_action.js",type:"class"},{name:"editorjs",js:"https://gudhub.com/modules/Editor-Js/dist/main.js",css:"https://gudhub.com/modules/Editor-Js/dist/style.css",type:"class"},{name:"filter_advanced",url:e+"/"+a+"filter_advanced_data.js",type:"angular"},{name:"code_editor",url:e+"/"+a+"code_editor_data.js",type:"angular"},{name:"icon",url:e+"/"+a+"icon_data.js",type:"angular"},{name:"quoteRequest",url:e+"/"+a+"quote_request_data.js",type:"angular"},{name:"view_container",url:e+"/"+a+"view_container_data.js",type:"angular"},{name:"element_ref",url:e+"/"+a+"element_ref_data.js",type:"angular"},{name:"quote_tool_objects_renderer",url:e+"/"+a+"quote_tool_objects_renderer_data.js",type:"angular"},{name:"quote_tool_objects_renderer_generator",url:e+"/"+a+"quote_tool_objects_renderer_generator_data.js",type:"angular"},{name:"trigger",url:e+"/"+a+"trigger_data.js",type:"angular"},{name:"voting",url:e+"/"+a+"voting_data.js",type:"angular"},{name:"view_tabs",url:e+"/"+a+"view_tabs.js",type:"angular"},{name:"filter_tabs",url:e+"/"+a+"filter_tabs.js",type:"angular"},{name:"gps_coords",url:e+"/"+a+"gps_coords.js",type:"angular"},{name:"google_map",url:e+"/"+a+"google_map_data.js",type:"angular"},{name:"data_migrations",url:e+"/"+a+"data_migrations.js",type:"angular"},{name:"additional_settings",url:e+"/"+a+"gh_additional_settings_data.js",type:"angular"},{name:"send_request",url:e+"/"+a+"send_request_data.js",type:"angular"},{name:"webcam",url:e+"/"+a+"webcam_data.js",type:"angular"},{name:"json_viewer",url:e+"/"+a+"json_viewer_data.js",type:"angular"},{name:"notifications",url:e+"/"+a+"notifications_data.js",type:"angular"},{name:"api",url:e+"/"+a+"api_data.js",type:"angular"},{name:"smart_input",url:e+"/"+a+"smart_input_data.js",type:"angular"},{name:"json_editor",url:e+"/"+a+"json_editor_data.js",type:"angular"},{name:"grapes_html_editor",url:e+"/"+a+"grapes_html_editor_data.js",type:"angular"},{name:"quiz",url:e+"/"+a+"quiz_data.js",type:"angular"},{name:"markdown_viewer",url:e+"/"+a+"markdown_viewer_data.js",type:"angular"},{name:"password_input",url:e+"/"+a+"password_input_data.js",type:"angular"},{name:"vs_code",url:e+"/"+a+"vs_code_data.js",type:"angular"},{name:"nested_list",js:"https://gudhub.com/modules/Nested-List/dist/main.js",css:"https://gudhub.com/modules/Nested-List/dist/style.css",type:"class"},{name:"fullcalendar",js:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/main.js",css:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/style.css",type:"class"},{name:"countertop_smart_quote",url:e+"/"+a+"countertop_smart_quote_data.js",type:"angular"},{name:"markdown_viewer_web_component",js:"https://gudhub.com/modules/markdown-it-gh-element/dist/main.js",css:"https://gudhub.com/modules/markdown-it-gh-element/dist/style.css",type:"class"}]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=a;
|
|
108
108
|
},{}],"CSHe":[function(require,module,exports) {
|
|
109
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Storage=void 0;var t=e(require("./ModulesList.js"));function e(t){return t&&t.__esModule?t:{default:t}}function r(t){return
|
|
109
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Storage=void 0;var t=e(require("./ModulesList.js"));function e(t){return t&&t.__esModule?t:{default:t}}function r(t){return u(t)||s(t)||i(t)||n()}function n(){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 i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.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)?a(t,e):void 0}}function s(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return a(t)}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e,r,n,i,s,u){try{var a=t[s](u),o=a.value}catch(p){return void r(p)}a.done?e(o):Promise.resolve(o).then(n,i)}function p(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function u(t){o(s,n,i,u,a,"next",t)}function a(t){o(s,n,i,u,a,"throw",t)}u(void 0)})}}function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach(function(e){f(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function f(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(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,n.key,n)}}function d(t,e,r){return e&&v(t.prototype,e),r&&v(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var y=function(){function e(r,n){h(this,e),this.apps_list=[],this.users_list=[],this.user={},this.modulesList=(0,t.default)(r,n),this.ghComponentsPromises=[]}return d(e,[{key:"getMainStorage",value:function(){return this}},{key:"getAppsList",value:function(){return this.apps_list}},{key:"getUser",value:function(){return this.user}},{key:"getUsersList",value:function(){return this.users_list}},{key:"getModulesList",value:function(){return this.modulesList}},{key:"getModuleUrl",value:function(t){return this.modulesList.find(function(e){return e.name==t})}},{key:"setUser",value:function(t){this.user=t,this.users_list.push(t)}},{key:"updateUser",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.avatar_128&&(t.avatar_128=t.avatar_128+"?"+(new Date).getTime()),t.avatar_512&&(t.avatar_512=t.avatar_512+"?"+(new Date).getTime()),this.user=l(l({},this.user),t),this.users_list=this.users_list.filter(function(e){return e.user_id!=t.user_id}),this.users_list.push(this.user)}},{key:"unsetUser",value:function(){this.user={}}},{key:"getApp",value:function(t){for(var e=0;e<this.apps_list.length;e++)if(this.apps_list[e].app_id==t)return this.apps_list[e]}},{key:"unsetApps",value:function(){this.apps_list=[]}},{key:"updateApp",value:function(t){return this.apps_list=this.apps_list.map(function(e){return e.app_id==t.app_id?t:e}),this.apps_list}},{key:"deleteApp",value:function(t){return this.apps_list=this.apps_list.filter(function(e){return e.app_id!=t}),this.apps_list}},{key:"updateItemsInApp",value:function(){var t=p(regeneratorRuntime.mark(function t(e,r){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getApp(r);case 2:return(n=t.sent)&&(n.items_list=updateItems(e,n.items_list,this.pipeService.emit.bind(this.pipeService),r),this.updateApp(n)),t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"addItemsToApp",value:function(){var t=p(regeneratorRuntime.mark(function t(e,n){var i,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getApp(n);case 2:return(i=t.sent)&&((s=i.items_list).push.apply(s,r(e)),this.updateApp(i),this.pipeService.emit("gh_items_update",{app_id:n},e)),t.abrupt("return",i);case 5:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"deleteItemsInApp",value:function(){var t=p(regeneratorRuntime.mark(function t(e,r){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getApp(r);case 2:return(n=t.sent)&&(n.items_list=n.items_list.filter(function(t){return!e.find(function(e){return e.item_id==t.item_id})}),this.updateApp(n)),t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()}]),e}();exports.Storage=y;
|
|
110
110
|
},{"./ModulesList.js":"FJWL"}],"p58b":[function(require,module,exports) {
|
|
111
111
|
"use strict";module.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")};
|
|
112
112
|
},{}],"pHMV":[function(require,module,exports) {
|
|
@@ -185,13 +185,13 @@ var global=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),e
|
|
|
185
185
|
var global = arguments[3];
|
|
186
186
|
var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var t=r(require("axios")),n=require("./../consts.js");function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n,r,o,a,u){try{var c=e[a](u),i=c.value}catch(s){return void n(s)}c.done?t(i):Promise.resolve(i).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var u=e.apply(t,n);function c(e){o(u,r,a,c,i,"next",e)}function i(e){o(u,r,a,c,i,"throw",e)}c(void 0)})}}function u(e,t,n,r,o){return c.apply(this,arguments)}function c(){return(c=a(regeneratorRuntime.mark(function r(o,u,c,i,s){var l,p,f,d,g,m;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,c||console.error("JS link must be provided for this data type - ".concat(u)),l=function(r){return n.IS_WEB||e.hasOwnProperty("window")||(e.window=proxy,e.document=s.document,e.Element=s.Element,e.CharacterData=s.CharacterData,e.this=proxy,e.self=proxy,e.Blob=s.Blob,e.Node=s.Node,e.navigator=s.navigator,e.HTMLElement=s.HTMLElement,e.XMLHttpRequest=s.XMLHttpRequest,e.WebSocket=s.WebSocket,e.crypto=s.crypto,e.DOMParser=s.DOMParser,e.Symbol=s.Symbol,e.document.queryCommandSupported=function(e){return console.log("QUERY COMMAND SUPPORTED: ",e),!1},e.angular=angular),new Promise(function(){var e=a(regeneratorRuntime.mark(function e(n){var o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.default.get(r).catch(function(e){console.log("Failed to fetch: ".concat(r," in ghconstructor. Module id: ").concat(u))});case 2:o=e.sent,a=encodeURIComponent(o.data),n("data:text/javascript;charset=utf-8,"+a);case 6:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}())},r.next=5,l(c);case 5:return p=r.sent,r.prev=6,r.next=9,import(p);case 9:f=r.sent,r.next=16;break;case 12:r.prev=12,r.t0=r.catch(6),console.log("Error while importing module: ".concat(u)),console.log(r.t0);case 16:return d=new f.default(u),i&&n.IS_WEB&&((g=document.createElement("link")).href=i,g.setAttribute("data-module",u),g.setAttribute("rel","stylesheet"),document.getElementsByTagName("head")[0].appendChild(g)),m={type:u,getTemplate:function(e,t,n,r,o,a){var u="false"!==n;return d.getTemplate(e,t,u,r,o,a)},getDefaultValue:function(e,t,n,r){return new Promise(function(){var o=a(regeneratorRuntime.mark(function o(a){var u,c;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!(u=d.getDefaultValue)){o.next=8;break}return o.next=4,u(e,t,n,r);case 4:c=o.sent,a(c),o.next=9;break;case 8:a(null);case 9:case"end":return o.stop()}},o)}));return function(e){return o.apply(this,arguments)}}())},getSettings:function(e,t,n){return d.getSettings(e,t,n)},filter:{getSearchOptions:function(e){var t=d;return t.filter&&t.filter.getSearchOptions?d.filter.getSearchOptions(e):[]},getDropdownValues:function(){var e=d;return e.filter&&e.filter.getDropdownValues?e.filter.getDropdownValues():[]}},getInterpretation:function(e,t,n,r,c,i){return new Promise(function(){var s=a(regeneratorRuntime.mark(function a(s){var l,p,f,g;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return l=d,a.prev=1,a.next=4,l.getInterpretation(o,e,i,c,r,n);case 4:return p=a.sent,f=p.find(function(e){return e.id==t})||p.find(function(e){return"default"==e.id}),a.next=8,f.content();case 8:g=a.sent,s({html:g}),a.next=16;break;case 12:a.prev=12,a.t0=a.catch(1),console.log("ERROR IN ".concat(u),a.t0),s({html:"<span>no interpretation</span>"});case 16:case"end":return a.stop()}},a,null,[[1,12]])}));return function(e){return s.apply(this,arguments)}}())},getInterpretationsList:function(e,t,n,r){return d.getInterpretation(e,t,n,r)},getInterpretatedValue:function(e,t,n,r){return new Promise(function(){var o=a(regeneratorRuntime.mark(function o(a){var u,c;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!(u=d.getInterpretatedValue)){o.next=8;break}return o.next=4,u(e,t,n,r);case 4:c=o.sent,a(c),o.next=9;break;case 8:a(e);case 9:case"end":return o.stop()}},o)}));return function(e){return o.apply(this,arguments)}}())},extendController:function(e){d.getActionScope(e)},runAction:function(e){try{d.runAction(e)}catch(t){}},getWindowScope:function(e){return d.getWindowScope(e)},getWindowHTML:function(e){return d.getWindowHTML(e)}},r.abrupt("return",m);case 22:r.prev=22,r.t1=r.catch(0),console.log(r.t1),console.log("Failed in createClassInstance (ghconstructor). Module id: ".concat(u,". JS url: ").concat(c));case 26:case"end":return r.stop()}},r,null,[[0,22],[6,12]])}))).apply(this,arguments)}
|
|
187
187
|
},{"axios":"O4Aa","./../consts.js":"UV2u"}],"Htuh":[function(require,module,exports) {
|
|
188
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GHConstructor=void 0;var e=
|
|
188
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GHConstructor=void 0;var e=n(require("./createAngularModuleInstance.js")),t=n(require("./createClassInstance.js"));function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n,r,u,a,i){try{var o=e[a](i),s=o.value}catch(c){return void n(c)}o.done?t(s):Promise.resolve(s).then(r,u)}function u(e){return function(){var t=this,n=arguments;return new Promise(function(u,a){var i=e.apply(t,n);function o(e){r(i,u,a,o,s,"next",e)}function s(e){r(i,u,a,o,s,"throw",e)}o(void 0)})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var s=function(){function n(e){a(this,n),this.gudhub=e,this.cache={},this.modulesQueue={},this.angularInjector,this.nodeWindow}return o(n,[{key:"getInstance",value:function(){var e=u(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.getCached(t)){e.next=4;break}return e.abrupt("return",this.getCached(t));case 4:if(!this.modulesQueue[t]){e.next=9;break}return e.next=7,this.modulesQueue[t];case 7:e.next=12;break;case 9:return this.modulesQueue[t]=this.createInstance(t),e.next=12,this.modulesQueue[t];case 12:return e.abrupt("return",this.getCached(t));case 13:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"pupToCache",value:function(e,t){this.cache[e]=t}},{key:"getCached",value:function(e){return this.cache[e]}},{key:"initAngularInjector",value:function(e){this.angularInjector=e}},{key:"initJsdomWindow",value:function(e){this.nodeWindow=e}},{key:"createInstance",value:function(){var n=u(regeneratorRuntime.mark(function n(r){var u,a;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(u=this.gudhub.storage.getModuleUrl(r)){n.next=4;break}return console.log("Cannot find module: ".concat(r)),n.abrupt("return");case 4:if("angular"!==u.type){n.next=10;break}return n.next=7,(0,e.default)(this.gudhub,r,u.url,this.angularInjector,this.nodeWindow);case 7:a=n.sent,n.next=14;break;case 10:if("class"!==u.type){n.next=14;break}return n.next=13,(0,t.default)(this.gudhub,r,u.js,u.css,this.nodeWindow);case 13:a=n.sent;case 14:return a&&this.pupToCache(r,a),n.abrupt("return",a);case 16:case"end":return n.stop()}},n,this)}));return function(e){return n.apply(this,arguments)}}()}]),n}();exports.GHConstructor=s;
|
|
189
189
|
},{"./createAngularModuleInstance.js":"osSN","./createClassInstance.js":"DsUm"}],"q0my":[function(require,module,exports) {
|
|
190
190
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppProcessor=void 0;var e=require("../consts.js");function t(e){return i(e)||n(e)||o(e)||r()}function r(){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 n(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function i(e){if(Array.isArray(e))return c(e)}function a(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 p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=o(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return p=e.done,e},e:function(e){s=!0,a=e},f:function(){try{p||null==r.return||r.return()}finally{if(s)throw a}}}}function o(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function f(e,t,r,n,i,a,p){try{var s=e[a](p),u=s.value}catch(o){return void r(o)}s.done?t(u):Promise.resolve(u).then(n,i)}function l(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function p(e){f(a,n,i,p,s,"next",e)}function s(e){f(a,n,i,p,s,"throw",e)}p(void 0)})}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e,t,r){return t&&v(e.prototype,t),r&&v(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var g=function(){function r(e,t,n,i,a,p,s){h(this,r),this.storage=e,this.pipeService=t,this.req=n,this.ws=i,this.applistReceived=!1,this.activateSW=s,this.chunksManager=a,this.util=p,this.appListeners()}return d(r,[{key:"createNewAppApi",value:function(){var e=l(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.post({url:"/api/app/create",form:{app:JSON.stringify(t)}});case 3:return(r=e.sent).from_apps_list=!0,e.abrupt("return",r);case 8:return e.prev=8,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}},e,this,[[0,8]])}));return function(t){return e.apply(this,arguments)}}()},{key:"updateAppApi",value:function(){var e=l(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.post({url:"/api/app/update",form:{app:JSON.stringify(t)}});case 3:return r=e.sent,e.abrupt("return",r);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(t){return e.apply(this,arguments)}}()},{key:"deleteAppApi",value:function(){var e=l(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.post({url:"/api/app/delete",form:{app_id:t}});case 3:return r=e.sent,e.abrupt("return",r);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(t){return e.apply(this,arguments)}}()},{key:"getAppListApi",value:function(){var e=l(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.get({url:"/api/applist/get"});case 3:return t=e.sent,e.abrupt("return",t.apps_list.map(function(e){return e.from_apps_list=!0,e}));case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(){return e.apply(this,arguments)}}()},{key:"getAppApi",value:function(){var e=l(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.get({url:"/api/app/get",params:{app_id:t}});case 3:return r=e.sent,e.abrupt("return",r);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(t){return e.apply(this,arguments)}}()},{key:"getAppListFromStorage",value:function(){return this.storage.getAppsList()}},{key:"getAppFromStorage",value:function(e){var t=this.storage.getApp(e);return t&&t.field_list.length?t:null}},{key:"addNewAppToStorage",value:function(e){return this.storage.getAppsList().push(e)}},{key:"saveAppInStorage",value:function(e){e.items_object={};for(var t=0;t<e.items_list.length;t++){e.items_object[e.items_list[t].item_id]={};for(var r=0;r<e.items_list[t].fields.length;r++)e.items_object[e.items_list[t].item_id][e.items_list[t].fields[r].field_id]=e.items_list[t].fields[r]}var n=this.storage.getApp(e.app_id);return n?(e.from_apps_list=n.from_apps_list,e.permission=n.permission,this.storage.updateApp(e)):(e.from_apps_list=!1,this.addNewAppToStorage(e)),this.getAppFromStorage(e.app_id)}},{key:"updatingAppInStorage",value:function(e){var t=this,r=this.getAppFromStorage(e.app_id);e.items_list=r.items_list,e.file_list=r.file_list,e.from_apps_list=r.from_apps_list,e.items_object=r.items_object,this.storage.updateApp(e),this.pipeService.emit("gh_app_views_update",{app_id:e.app_id},e.views_list),e.field_list.forEach(function(r){t.pipeService.emit("gh_model_update",{app_id:e.app_id,field_id:r.field_id},r)})}},{key:"deletingAppFromStorage",value:function(e){var t=this.storage.getAppsList();return t.forEach(function(r,n){r.app_id==e&&t.splice(n)}),t}},{key:"updateAppsListInStorage",value:function(){var e,t=u(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);try{for(t.s();!(e=t.n()).done;){var r=e.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){t.e(i)}finally{t.f()}}},{key:"refreshApps",value:function(){var e=l(regeneratorRuntime.mark(function e(){var t,r,n,i,a,p,s,o=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=o.length>0&&void 0!==o[0]?o[0]:[],r=u(t),e.prev=2,r.s();case 4:if((n=r.n()).done){e.next=19;break}if(null==(i=n.value)||!this.storage.getApp(i)){e.next=17;break}return e.prev=7,e.next=10,this.getAppApi(i);case 10:if(a=e.sent){for(a.items_object={},p=0;p<a.items_list.length;p++)for(a.items_object[a.items_list[p].item_id]={},s=0;s<a.items_list[p].fields.length;s++)a.items_object[a.items_list[p].item_id][a.items_list[p].fields[s].field_id]=a.items_list[p].fields[s];this.storage.updateApp(a)}e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.log(e.t0);case 17:e.next=4;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(2),r.e(e.t1);case 24:return e.prev=24,r.f(),e.finish(24);case 27:console.log("Apps refreshed: ",JSON.stringify(t));case 28:case"end":return e.stop()}},e,this,[[2,21,24,27],[7,14]])}));return function(){return e.apply(this,arguments)}}()},{key:"refreshAppsList",value:function(){var e=l(regeneratorRuntime.mark(function e(){var t,r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getAppListFromStorage(),e.next=3,this.getAppListApi();case 3:r=e.sent,n=r.map(function(e){return p(p({},e),t.find(function(t){return t.app_id===e.app_id}))}),this.updateAppsListInStorage(n),this.pipeService.emit("gh_apps_list_refreshed",{});case 7:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"getAppsList",value:function(){var e=l(regeneratorRuntime.mark(function e(){var t,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.getAppListFromStorage(),this.applistReceived){e.next=10;break}return e.next=4,this.getAppListApi();case 4:if(r=e.sent){e.next=7;break}return e.abrupt("return",null);case 7:this.updateAppsListInStorage(r),this.applistReceived=!0,t=r;case 10:return e.abrupt("return",t);case 11:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"getAppInfo",value:function(){var e=l(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAppsList();case 2:return r=e.sent,e.abrupt("return",r?r.find(function(e){return e.app_id==t}):null);case 4:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"deleteApp",value:function(){var e=l(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deleteAppApi(t);case 2:return e.abrupt("return",this.deletingAppFromStorage(t));case 3:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"getApp",value:function(){var e=l(regeneratorRuntime.mark(function e(r){var n,i,a=this,p=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(p.length>1&&void 0!==p[1]&&p[1],r){e.next=3;break}return e.abrupt("return",null);case 3:if(n=this.getAppFromStorage(r)){e.next=11;break}return e.next=7,this.getAppApi(r);case 7:if(i=e.sent){e.next=10;break}return e.abrupt("return",null);case 10:i.chunks&&i.chunks.length?(this.chunksManager.getChunks(r,i.chunks).then(function(e){i.items_list=a.util.mergeChunks([].concat(t(e),[i])),a.saveAppInStorage(i),a.pipeService.emit("gh_items_update",{app_id:r},i.items_list)}),n=i,this.saveAppInStorage(i)):(n=this.getAppFromStorage(r))||(n=i,this.saveAppInStorage(i),this.ws.addSubscription(r));case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"updateApp",value:function(){var e=l(regeneratorRuntime.mark(function e(t){var r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.views_list&&t.views_list.length&&t.show){e.next=6;break}return e.next=3,this.getApp(t.app_id);case 3:r=e.sent,t.views_list&&t.views_list.length||(t.views_list=r.views_list),void 0===t.show&&(t.show=r.show);case 6:return e.next=8,this.updateAppApi(t);case 8:return n=e.sent,this.updatingAppInStorage(n),e.abrupt("return",n);case 11:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"updateAppInfo",value:function(){var e=l(regeneratorRuntime.mark(function e(){var t,r,n=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},r=this.getAppFromStorage(t.app_id),e.abrupt("return",this.updateApp(p(p({},r),t)));case 3:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"createNewApp",value:function(){var e=l(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createNewAppApi(t);case 2:return(r=e.sent).items_object={},this.addNewAppToStorage(r),e.abrupt("return",r);case 6:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"getAppViews",value:function(){var e=l(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=5;break}return e.next=3,this.getApp(t);case 3:return r=e.sent,e.abrupt("return",r.views_list);case 5:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"clearAppProcessor",value:function(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}},{key:"appListeners",value:function(){var t=this;this.pipeService.onRoot("gh_app_get",{},function(){var e=l(regeneratorRuntime.mark(function e(r,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.app_id){e.next=5;break}return e.next=3,t.getApp(n.app_id);case 3:i=e.sent,t.pipeService.emit("gh_app_get",n,i);case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_apps_list_get",{},function(){var e=l(regeneratorRuntime.mark(function e(r,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAppsList();case 2:i=e.sent,t.pipeService.emit("gh_apps_list_get",n,i);case 4:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_delete_app",{},function(){var e=l(regeneratorRuntime.mark(function e(r,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.deleteApp(n.app_id);case 2:i=e.sent,t.pipeService.emit("gh_apps_list_update",{recipient:"all"},i);case 4:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_update",{},function(){var e=l(regeneratorRuntime.mark(function e(r,n){var i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n.app.items_list=[],n.app.file_list=[],e.next=4,t.updateApp(n.app);case 4:return i=e.sent,t.pipeService.emit("gh_app_views_update",{app_id:i.app_id},i.views_list),e.next=8,t.getAppsList();case 8:a=e.sent,t.pipeService.emit("gh_apps_list_update",{recipient:"all"},a),i.field_list.forEach(function(e){t.pipeService.emit("gh_model_update",{app_id:i.app_id,field_id:e.field_id},e)});case 11:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_view_get",{},function(){var e=l(regeneratorRuntime.mark(function e(r,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.app_id){e.next=5;break}return e.next=3,t.getApp(n.app_id);case 3:(i=e.sent).views_list.forEach(function(e,r){e.view_id==n.view_id&&t.pipeService.emit("gh_app_view_get",n,i.views_list[r])});case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_info_get",{},function(){var e=l(regeneratorRuntime.mark(function e(r,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAppInfo(n.app_id);case 2:(i=e.sent)&&t.pipeService.emit("gh_app_info_get",n,i);case 4:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_info_update",{},function(){var e=l(regeneratorRuntime.mark(function e(r,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.app){e.next=5;break}return e.next=3,t.updateAppInfo(n.app);case 3:i=e.sent,t.pipeService.emit("gh_app_info_update",{app_id:n.app.app_id},i);case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_create",{},function(){var e=l(regeneratorRuntime.mark(function e(r,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.createNewApp(n.app);case 2:return e.next=4,t.getAppsList();case 4:i=e.sent,t.pipeService.emit("gh_apps_list_update",{recipient:"all"},i);case 6:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),e.IS_WEB&&this.activateSW&&navigator.serviceWorker.addEventListener("message",function(){var e=l(regeneratorRuntime.mark(function e(r){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("refresh app"!==r.data.type){e.next=7;break}return e.next=3,t.getApp(r.data.payload.app_id);case 3:(n=e.sent)&&t.util.compareAppsItemsLists(n.items_list,r.data.payload.items_list.filter(function(e){return!e.trash}),function(e){var n=e.diff_fields_items,i=e.diff_fields_items_Ids,a=e.diff_items,p=e.newItems,s=e.deletedItems;(a.length||p.length||s.length)&&(t.pipeService.emit("gh_items_update",{app_id:r.data.payload.app_id},r.data.payload.items_list.filter(function(e){return!e.trash})),a.forEach(function(e){return t.pipeService.emit("gh_item_update",{app_id:r.data.payload.app_id,item_id:e.item_id},e)})),i.forEach(function(e){var i=n[e];i&&i.forEach(function(n){t.pipeService.emit("gh_value_update",{app_id:r.data.payload.app_id,item_id:e,field_id:n.field_id},n.field_value)})})}),r.data.payload.items_list=t.util.mergeChunks([n,r.data.payload]),t.saveAppInStorage(r.data.payload);case 7:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}())}}]),r}();exports.AppProcessor=g;
|
|
191
191
|
},{"../consts.js":"UV2u"}],"UUd3":[function(require,module,exports) {
|
|
192
192
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ItemProcessor=void 0;var e=require("../utils.js");function t(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 r(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t,r,n,i,a,s){try{var u=e[a](s),p=u.value}catch(o){return void r(o)}u.done?t(p):Promise.resolve(p).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var s=e.apply(t,r);function u(e){i(s,n,a,u,p,"next",e)}function p(e){i(s,n,a,u,p,"throw",e)}u(void 0)})}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t,r){return t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var o=function(){function t(e,r,n,i,a){s(this,t),this.storage=e,this.pipeService=r,this.req=n,this.appProcessor=i,this.util=a,this.itemListeners()}return p(t,[{key:"addItemsApi",value:function(){var e=a(regeneratorRuntime.mark(function e(t,r){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.post({url:"/api/items/add",form:{items:JSON.stringify(r),app_id:t}});case 3:return n=e.sent,e.abrupt("return",n);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(t,r){return e.apply(this,arguments)}}()},{key:"updateItemsApi",value:function(){var e=a(regeneratorRuntime.mark(function e(t,r){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.post({url:"/api/items/update",form:{items:JSON.stringify(r),app_id:t}});case 3:return n=e.sent,e.abrupt("return",n);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));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:"addItemsToStorage",value:function(){var e=a(regeneratorRuntime.mark(function e(t,r){var n,i=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.appProcessor.getApp(t);case 2:return(n=e.sent)&&(r.forEach(function(e){n.items_list.push(e),n.items_object[e.item_id]={};for(var r=0;r<e.fields.length;r++)n.items_object[e.item_id][e.fields[r].field_id]=e.fields[r];i.pipeService.emit("gh_item_update",{app_id:t},[e])}),this.pipeService.emit("gh_items_update",{app_id:t},n.items_list),this.storage.updateApp(n)),e.abrupt("return",n);case 5:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"updateItemsInStorage",value:function(){var e=a(regeneratorRuntime.mark(function e(t,r){var n,i=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.pipeService.emit("gh_items_update",{app_id:t},r),e.next=3,this.appProcessor.getApp(t);case 3:return(n=e.sent)&&r&&r.forEach(function(e){var r={app_id:t};i.pipeService.emit("gh_item_update",r,[e]),r.item_id=e.item_id,i.pipeService.emit("gh_item_update",r,e);var a=n.items_list.find(function(t){return t.item_id==e.item_id});a&&e.fields.forEach(function(e){var t=a.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[a.item_id][t.field_id]=t,i.pipeService.emit("gh_value_update",r,e.field_value)):(a.fields.push(e),i.pipeService.emit("gh_value_update",r,e.field_value))})}),e.abrupt("return",r);case 6:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"deleteItemsFromStorage",value:function(){var e=a(regeneratorRuntime.mark(function e(t){var r,n,i=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:[],e.next=3,this.appProcessor.getApp(t);case 3:(n=e.sent)&&(n.items_list=n.items_list.filter(function(e){return!r.find(function(t){return e.item_id==t.item_id})||(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 5:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"getItems",value:function(){var e=a(regeneratorRuntime.mark(function e(t){var r,n,i=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]&&i[1],e.next=3,this.appProcessor.getApp(t,r);case 3:if(n=e.sent){e.next=6;break}return e.abrupt("return",null);case 6:return e.abrupt("return",n.items_list);case 7:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"addNewItems",value:function(){var t=a(regeneratorRuntime.mark(function t(n,i){var a,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a=i.map(function(t){return r(r({},t),{},{fields:(0,e.filterFields)(t.fields)})}),t.next=3,this.addItemsApi(n,a);case 3:return s=t.sent,t.next=6,this.addItemsToStorage(n,s);case 6:return this.pipeService.emit("gh_items_add",{app_id:n},s),t.abrupt("return",s);case 8:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"updateItems",value:function(){var t=a(regeneratorRuntime.mark(function t(n,i){var a,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a=i.map(function(t){return r(r({},t),{},{fields:(0,e.filterFields)(t.fields)})}),t.next=3,this.updateItemsApi(n,a);case 3:return s=t.sent,t.next=6,this.updateItemsInStorage(n,s);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"deleteItems",value:function(){var e=a(regeneratorRuntime.mark(function e(t,r){var n=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.deleteItemsApi(r).then(function(){var e=a(regeneratorRuntime.mark(function e(r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.deleteItemsFromStorage(t,r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},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(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app_id){t.next=5;break}return t.next=3,e.getItems(n.app_id);case 3:(i=t.sent)?e.pipeService.emit("gh_items_get",n,i):e.pipeService.emit("gh_items_get",n,[]);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_items_add",{},function(){var t=a(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n&&n.app_id&&n.items)){t.next=5;break}return t.next=3,e.addNewItems(n.app_id,n.items);case 3:(i=t.sent)?e.pipeService.emit("gh_items_add",n,i):e.pipeService.emit("gh_items_add",n,[]);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_items_update",{},function(){var t=a(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n&&n.app_id&&n.items)){t.next=5;break}return t.next=3,e.updateItems(n.app_id,n.items);case 3:(i=t.sent)?e.pipeService.emit("gh_items_update",n,i):e.pipeService.emit("gh_items_update",n,[]);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_item_get",{},function(){var t=a(regeneratorRuntime.mark(function t(r,n){var i,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app_id){t.next=6;break}return t.next=3,e.getItems(n.app_id);case 3:i=t.sent,a=i.find(function(e){return e.item_id==n.item_id}),e.pipeService.emit("gh_item_get",n,a);case 6:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_filtered_items_get",{},function(){var t=a(regeneratorRuntime.mark(function t(r,n){var i,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.element_app_id){t.next=8;break}return t.next=3,e.getItems(n.element_app_id);case 3:return i=t.sent,t.next=6,e.util.getFilteredItems(i,n.filters_list,n.element_app_id,n.app_id,n.item_id,n.field_groupe,n.search,n.search_params);case 6:a=t.sent,e.pipeService.emit("gh_filtered_items_get",n,a);case 8:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_filter_items",{},function(){var t=a(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.items){t.next=5;break}return t.next=3,e.util.getFilteredItems(n.items,n.filters_list,n.element_app_id,n.app_id,n.item_id,n.field_groupe,n.search,n.search_params);case 3:i=t.sent,e.pipeService.emit("gh_filter_items",n,i);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}())}}]),t}();exports.ItemProcessor=o;
|
|
193
193
|
},{"../utils.js":"EgeI"}],"PoPF":[function(require,module,exports) {
|
|
194
|
-
"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach(function(e){r(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t,r,n,i,u,a){try{var o=e[u](a),s=o.value}catch(p){return void r(p)}o.done?t(s):Promise.resolve(s).then(n,i)}function i(e){return function(){var t=this,r=arguments;return new Promise(function(i,u){var a=e.apply(t,r);function o(e){n(a,i,u,o,s,"next",e)}function s(e){n(a,i,u,o,s,"throw",e)}o(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FieldProcessor=void 0;var s=function(){function e(t,r,n,i,a){u(this,e),this.storage=t,this.req=r,this.appProcessor=n,this.itemProcessor=i,this.pipeService=a,this.fieldListeners()}return o(e,[{key:"deleteFieldApi",value:function(e){return this.req.post({url:"/api/app/delete-field",form:{field_id:e}})}},{key:"updatedFieldApi",value:function(){var e=i(regeneratorRuntime.mark(function e(r){var n,i,u,a=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,this.appProcessor.getApp(r);case 3:return i=e.sent,u={app_id:r,app_name:i.app_name,group_id:i.group_id,icon:i.icon,field_list:i.field_list.map(function(e){return e.field_id==n.field_id?t(t({},e),n):e}),views_list:i.views_list},e.abrupt("return",this.appProcessor.updateApp(u));case 6:case"end":return e.stop()}},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.file_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,r){var n=this.storage.getApp(e);return n.field_list=n.field_list.map(function(e){return e.field_id==r.field_id?t(t({},e),r):e}),this.storage.updateApp(n),r}},{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=i(regeneratorRuntime.mark(function e(t,r){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.appProcessor.getApp(t);case 2:if(n=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:return e.abrupt("return",n.field_list.
|
|
194
|
+
"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach(function(e){r(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t,r,n,i,u,a){try{var o=e[u](a),s=o.value}catch(p){return void r(p)}o.done?t(s):Promise.resolve(s).then(n,i)}function i(e){return function(){var t=this,r=arguments;return new Promise(function(i,u){var a=e.apply(t,r);function o(e){n(a,i,u,o,s,"next",e)}function s(e){n(a,i,u,o,s,"throw",e)}o(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FieldProcessor=void 0;var s=function(){function e(t,r,n,i,a){u(this,e),this.storage=t,this.req=r,this.appProcessor=n,this.itemProcessor=i,this.pipeService=a,this.fieldListeners()}return o(e,[{key:"deleteFieldApi",value:function(e){return this.req.post({url:"/api/app/delete-field",form:{field_id:e}})}},{key:"updatedFieldApi",value:function(){var e=i(regeneratorRuntime.mark(function e(r){var n,i,u,a=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,this.appProcessor.getApp(r);case 3:return i=e.sent,u={app_id:r,app_name:i.app_name,group_id:i.group_id,icon:i.icon,field_list:i.field_list.map(function(e){return e.field_id==n.field_id?t(t({},e),n):e}),views_list:i.views_list},e.abrupt("return",this.appProcessor.updateApp(u));case 6:case"end":return e.stop()}},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.file_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,r){var n=this.storage.getApp(e);return n.field_list=n.field_list.map(function(e){return e.field_id==r.field_id?t(t({},e),r):e}),this.storage.updateApp(n),r}},{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=i(regeneratorRuntime.mark(function e(t,r){var n,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.appProcessor.getApp(t);case 2:if(n=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:i=0;case 6:if(!(i<n.field_list.length)){e.next=12;break}if(n.field_list[i].field_id!=r){e.next=9;break}return e.abrupt("return",n.field_list[i]);case 9:i++,e.next=6;break;case 12:return e.abrupt("return",null);case 13:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"getFieldModels",value:function(){var e=i(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.appProcessor.getApp(t);case 2:if(r=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:return e.abrupt("return",r.field_list);case 6:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"updateField",value:function(){var e=i(regeneratorRuntime.mark(function e(t,r){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&r){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.updatedFieldApi(t,r);case 4:return n=e.sent,e.abrupt("return",this.updateFieldInStorage(t,n));case 6:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"deleteField",value:function(){var e=i(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deleteFieldApi(r);case 2:return e.abrupt("return",this.deleteFieldInStorage(t,r));case 3:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"getFieldValue",value:function(){var e=i(regeneratorRuntime.mark(function e(t,r,n){var i,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=null,e.next=3,this.appProcessor.getApp(t);case 3:u=e.sent;try{i=u.items_object[r][n].field_value}catch(a){}return e.abrupt("return",i);case 6:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"setFieldValue",value:function(){var e=i(regeneratorRuntime.mark(function e(t,r,n,i){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&r&&n){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.setFieldValueApi(t,r,n,i);case 4:return e.abrupt("return",this.updateFieldValue(t,r,n,i));case 5:case"end":return e.stop()}},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 t=i(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n.app_id&&n.item_id&&n.field_id)){t.next=5;break}return t.next=3,e.getFieldValue(n.app_id,n.item_id,n.field_id);case 3:i=t.sent,e.pipeService.emit("gh_value_get",n,i);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_value_set",{},function(){var t=i(regeneratorRuntime.mark(function t(r,n){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n.item_id&&(e.setFieldValue(n.app_id,n.item_id,n.field_id,n.new_value),delete n.new_value);case 1:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_model_get",{},function(){var t=i(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.getField(n.app_id,n.field_id);case 3:i=t.sent,e.pipeService.emit("gh_model_get",n,i),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log("Field model: ",t.t0);case 10:case"end":return t.stop()}},t,null,[[0,7]])}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_model_update",{},function(){var t=i(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.updateField(n.app_id,n.field_model);case 2:i=t.sent,e.pipeService.emit("gh_model_update",{app_id:n.app_id,field_id:n.field_id},i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_models_get",{},function(){var t=i(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getFieldModels(n.app_id);case 2:i=t.sent,e.pipeService.emit("gh_models_get",n,i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_model_delete",{},function(){var t=i(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.deleteField(n.app_id,n.field_id);case 2:i=t.sent,e.pipeService.emit("gh_model_delete",n,i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}())}}]),e}();exports.FieldProcessor=s;
|
|
195
195
|
},{}],"XUT2":[function(require,module,exports) {
|
|
196
196
|
"use strict";function e(e){return i(e)||n(e)||t(e)||r()}function r(){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 t(e,r){if(e){if("string"==typeof e)return a(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?a(e,r):void 0}}function n(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function i(e){if(Array.isArray(e))return a(e)}function a(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function u(e,r,t,n,i,a,u){try{var o=e[a](u),s=o.value}catch(p){return void t(p)}o.done?r(s):Promise.resolve(s).then(n,i)}function o(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var a=e.apply(r,t);function o(e){u(a,n,i,o,s,"next",e)}function s(e){u(a,n,i,o,s,"throw",e)}o(void 0)})}}function s(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function p(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,r,t){return r&&p(e.prototype,r),t&&p(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileManager=void 0;var l=function(){function r(e,t,n,i){s(this,r),this.storage=e,this.pipeService=t,this.req=n,this.appProcessor=i}return c(r,[{key:"uploadFileApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t,n){var i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i={"file-0":r,app_id:t,item_id:n},e.next=4,this.req.post({url:"/file/formupload",form:i});case 4:return a=e.sent,e.abrupt("return",a);case 8:return e.prev=8,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}},e,this,[[0,8]])}));return function(r,t,n){return e.apply(this,arguments)}}()},{key:"uploadFileFromStringApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.post({url:"/file/upload",form:{file:JSON.stringify(r)}});case 3:return t=e.sent,e.abrupt("return",t);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(r){return e.apply(this,arguments)}}()},{key:"updateFileFromStringApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t,n,i,a){var u,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,u={file_name:n,extension:i,file_id:t,format:a,source:r},e.next=4,this.req.post({url:"/file/update",form:{file:JSON.stringify(u)}});case 4:return o=e.sent,e.abrupt("return",o);case 8:return e.prev=8,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}},e,this,[[0,8]])}));return function(r,t,n,i,a){return e.apply(this,arguments)}}()},{key:"duplicateFileApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.req.post({url:"/api/new/file/duplicate",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{files:JSON.stringify(r)}}));case 1:case"end":return e.stop()}},e,this)}));return function(r){return e.apply(this,arguments)}}()},{key:"downloadFileFromString",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t){var n,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isFileExists(r,t);case 2:if(!e.sent){e.next=12;break}return e.next=5,this.getFile(r,t);case 5:return n=e.sent,e.next=8,this.req.get({url:n.url+"?timestamp="+n.last_update,externalResource:!0});case 8:return i=e.sent,e.abrupt("return",{file:n,data:i,type:"file"});case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}},e,this)}));return function(r,t){return e.apply(this,arguments)}}()},{key:"duplicateFile",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t,n=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.duplicateFileApi(r);case 2:return(t=e.sent).forEach(function(e){n.addFileToStorage(e.app_id,e)}),e.abrupt("return",t);case 5:case"end":return e.stop()}},e,this)}));return function(r){return e.apply(this,arguments)}}()},{key:"deleteFileApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.get({url:"/file/delete?file_id=".concat(r)});case 3:return t=e.sent,e.abrupt("return",t);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(r){return e.apply(this,arguments)}}()},{key:"addFileToStorage",value:function(e,r){var t=this.storage.getApp(e);t&&(t.file_list.push(r),this.storage.updateApp(t),this.pipeService.emit("gh_file_upload",{app_id:e,item_id:r.item_id,file_id:r.file_id},r))}},{key:"addFilesToStorage",value:function(r,t){var n,i=this,a=this.storage.getApp(r);a&&((n=a.file_list).push.apply(n,e(t)),this.storage.updateApp(a),t.forEach(function(e){i.pipeService.emit("gh_file_upload",{app_id:r,item_id:e.item_id,file_id:e.file_id},e)}))}},{key:"deleteFileFromStorage",value:function(e,r){var t,n=this.storage.getApp(r);n&&(n.file_list=n.file_list.filter(function(r){return r.file_id!=e||(t=r,!1)}),this.storage.updateApp(n),this.pipeService.emit("gh_file_delete",{file_id:e},t))}},{key:"updateFileInStorage",value:function(e,r,t){var n=this.storage.getApp(r);n&&(n.file_list=n.file_list.map(function(r){return r.file_id==e?t:r}),this.storage.updateApp(n),this.pipeService.emit("gh_file_update",{file_id:e}))}},{key:"getFile",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.appProcessor.getApp(r);case 2:return n=e.sent,e.abrupt("return",new Promise(function(e,r){var i=n.file_list.find(function(e){return e.file_id==t});e(i||"")}));case 4:case"end":return e.stop()}},e,this)}));return function(r,t){return e.apply(this,arguments)}}()},{key:"getFiles",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t,n,i=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>1&&void 0!==i[1]?i[1]:[],e.next=3,this.appProcessor.getApp(r);case 3:return n=e.sent,e.abrupt("return",new Promise(function(e,r){var i=n.file_list.filter(function(e){return t.some(function(r){return r==e.file_id})});e(i||"")}));case 5:case"end":return e.stop()}},e,this)}));return function(r){return e.apply(this,arguments)}}()},{key:"uploadFile",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.uploadFileApi(r,t,n);case 2:return i=e.sent,this.addFileToStorage(t,i),e.abrupt("return",i);case 5:case"end":return e.stop()}},e,this)}));return function(r,t,n){return e.apply(this,arguments)}}()},{key:"uploadFileFromString",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.uploadFileFromStringApi(r);case 2:return t=e.sent,this.addFileToStorage(t.app_id,t),e.abrupt("return",t);case 5:case"end":return e.stop()}},e,this)}));return function(r){return e.apply(this,arguments)}}()},{key:"updateFileFromString",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t,n,i,a){var u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.updateFileFromStringApi(r,t,n,i,a);case 2:return u=e.sent,this.updateFileInStorage(t,u.app_id,u),e.abrupt("return",u);case 5:case"end":return e.stop()}},e,this)}));return function(r,t,n,i,a){return e.apply(this,arguments)}}()},{key:"deleteFile",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deleteFileApi(t);case 2:return this.deleteFileFromStorage(t,r),e.abrupt("return",!0);case 4:case"end":return e.stop()}},e,this)}));return function(r,t){return e.apply(this,arguments)}}()},{key:"isFileExists",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t){var n,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/,!Boolean(t)){e.next=12;break}return e.next=4,this.getFile(r,t);case 4:if(i=e.sent,!Boolean(i)){e.next=9;break}return e.abrupt("return",n.test(i.url));case 9:return e.abrupt("return",!1);case 10:e.next=13;break;case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}},e,this)}));return function(r,t){return e.apply(this,arguments)}}()}]),r}();exports.FileManager=l;
|
|
197
197
|
},{}],"KHGc":[function(require,module,exports) {
|
|
@@ -199,7 +199,7 @@ var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),export
|
|
|
199
199
|
},{}],"K1Gs":[function(require,module,exports) {
|
|
200
200
|
"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DocumentManager=void 0;var r=function(){function t(n,r){e(this,t),this.req=n,this.pipeService=r}return n(t,[{key:"createDocument",value:function(e){return this.req.post({url:"/api/new/document/insert-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}},{key:"emitDocumentInsert",value:function(e){this.pipeService.emit("gh_document_insert_one",{app_id:e.app_id,item_id:e.item_id,element_id:e.element_id})}},{key:"getDocument",value:function(e){return this.req.post({url:"/api/new/document/find-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}},{key:"getDocuments",value:function(e){return this.req.post({url:"/api/new/document/find",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}},{key:"deleteDocument",value:function(e){return this.req.post({url:"/api/new/document/remove-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}}]),t}();exports.DocumentManager=r;
|
|
201
201
|
},{}],"X4Dt":[function(require,module,exports) {
|
|
202
|
-
"use strict";function t(t,e,n,r,a,u,
|
|
202
|
+
"use strict";function t(t,e,n,r,a,u,i){try{var o=t[u](i),c=o.value}catch(s){return void n(s)}o.done?e(c):Promise.resolve(c).then(r,a)}function e(e){return function(){var n=this,r=arguments;return new Promise(function(a,u){var i=e.apply(n,r);function o(e){t(i,a,u,o,c,"next",e)}function c(e){t(i,a,u,o,c,"throw",e)}o(void 0)})}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Interpritate=void 0;var u=function(){function t(e){n(this,t),this.gudhub=e}return a(t,[{key:"getInterpretationObj",value:function(t,e,n,r){var a={},u=e.data_model.interpretation.find(function(t){return t.src==n})||e.data_model.interpretation.find(function(t){return"table"==t.src})||{id:"default"};return t.data_model&&t.data_model.interpretation&&(a=t.data_model.interpretation.find(function(t){return t.src==r})||t.data_model.interpretation.find(function(t){return t.src==n})),gudhub.mergeObjects(u,a)}},{key:"getInterpretation",value:function(t,n,r,a,u,i,o){var c=this,s=this;return new Promise(function(){var f=e(regeneratorRuntime.mark(function e(f,l){var p;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:(p=n&&n.data_type?n.data_type:r)?gudhub.ghconstructor.getInstance(p).then(function(e){var r=s.getInterpretationObj(n,e.getTemplate().model,a,o);e.getInterpretation(t,r.id,p,n,u,i).then(function(t){f(gudhub.mergeObjects(t,r))},function(t){l()})},function(t){}):f(c.getDefaultInterpretation(t,n));case 2:case"end":return e.stop()}},e)}));return function(t,e){return f.apply(this,arguments)}}())}},{key:"getDefaultInterpretation",value:function(t,e){var n=t;return e&&e.forEach(function(e){e.value==t&&""!=t&&(n=e.name)}),n}},{key:"getInterpretationById",value:function(){var t=e(regeneratorRuntime.mark(function t(e,n,r,a){var u,i,o,c,s,f,l=arguments;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(u=l.length>4&&void 0!==l[4]?l[4]:null,i=l.length>5&&void 0!==l[5]?l[5]:null,null!=u){t.next=8;break}return t.next=5,this.gudhub.getFieldValue(e,n,r);case 5:t.t0=t.sent,t.next=9;break;case 8:t.t0=u;case 9:if(o=t.t0,null!=i){t.next=16;break}return t.next=13,this.gudhub.getField(e,r);case 13:t.t1=t.sent,t.next=17;break;case 16:t.t1=i;case 17:if(null!=(c=t.t1)){t.next=20;break}return t.abrupt("return","");case 20:return t.next=22,this.gudhub.ghconstructor.getInstance(c.data_type);case 22:return s=t.sent,t.next=25,s.getInterpretation(o,a,c.data_type,c,n,e);case 25:if("<span>no interpretation</span>"!=(f=t.sent).html){t.next=30;break}return t.abrupt("return",o);case 30:return t.abrupt("return",f.html);case 31:case"end":return t.stop()}},t,this)}));return function(e,n,r,a){return t.apply(this,arguments)}}()}]),t}();exports.Interpritate=u;
|
|
203
203
|
},{}],"sPce":[function(require,module,exports) {
|
|
204
204
|
"use strict";function e(e,o){switch(o.api){case"/items/update":console.log("/items/update - ",o),e.itemProcessor.updateItemsInStorage(o.app_id,o.response);break;case"/items/add":console.log("/items/add - ",o),e.itemProcessor.addItemsToStorage(o.app_id,o.response);break;case"/items/delete":console.log("/items/delete - ",o),e.itemProcessor.deleteItemsFromStorage(o.app_id,o.response);break;case"/app/update":console.log("/app/update - ",o),e.appProcessor.updatingAppInStorage(o.response);break;case"/file/delete":console.log("file/delete - ",o),e.fileManager.deleteFileFromStorage(o.response.file_id,o.app_id);break;case"/file/upload":console.log("file/upload - ",o),e.fileManager.addFileToStorage(o.app_id,o.response);break;case"/file/formupload":console.log("file/formupload - ",o);break;case"/file/update":e.fileManager.updateFileInStorage(o.response.file_id,o.response.app_id,o.response),console.log("file/update - ",o);break;case"/new/file/duplicate":e.fileManager.addFilesToStorage(o.app_id,o.response),console.log("new/file/duplicate - ",o);break;case"/api/new/document/insert-one":e.documentManager.emitDocumentInsert(o.response),console.log("/api/new/document/insert-one - ",o);break;default:console.warn("WEBSOCKETS is not process this API:",o.api)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebsocketHandler=e;
|
|
205
205
|
},{}],"qJXG":[function(require,module,exports) {
|
|
@@ -211,7 +211,7 @@ var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),export
|
|
|
211
211
|
},{"../groupManager/GroupManager.js":"qJXG","./AppGroupSharing.js":"Z7AV"}],"XaHW":[function(require,module,exports) {
|
|
212
212
|
"use strict";function t(t,e,r,n,u,a,s){try{var o=t[a](s),i=o.value}catch(c){return void r(c)}o.done?e(i):Promise.resolve(i).then(n,u)}function e(e){return function(){var r=this,n=arguments;return new Promise(function(u,a){var s=e.apply(r,n);function o(e){t(s,u,a,o,i,"next",e)}function i(e){t(s,u,a,o,i,"throw",e)}o(void 0)})}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(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,n.key,n)}}function u(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Sharing=void 0;var a=function(){function t(e,n){r(this,t),this.req=n,this.gudhub=e}return u(t,[{key:"add",value:function(){var t=e(regeneratorRuntime.mark(function t(e,r,n){var u,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.gudhub.auth.getToken();case 3:return t.t0=t.sent,t.t1=e,t.t2=r,t.t3=n,u={token:t.t0,app_id:t.t1,user_id:t.t2,sharing_permission:t.t3},t.next=10,this.req.post({url:"/sharing/add",form:u});case 10:return a=t.sent,t.abrupt("return",a);case 14:return t.prev=14,t.t4=t.catch(0),console.log(t.t4),t.abrupt("return",null);case 18:case"end":return t.stop()}},t,this,[[0,14]])}));return function(e,r,n){return t.apply(this,arguments)}}()},{key:"update",value:function(){var t=e(regeneratorRuntime.mark(function t(e,r,n){var u,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.gudhub.auth.getToken();case 3:return t.t0=t.sent,t.t1=e,t.t2=r,t.t3=n,u={token:t.t0,app_id:t.t1,user_id:t.t2,sharing_permission:t.t3},t.next=10,this.req.post({url:"/sharing/update",form:u});case 10:return a=t.sent,t.abrupt("return",a);case 14:return t.prev=14,t.t4=t.catch(0),console.log(t.t4),t.abrupt("return",null);case 18:case"end":return t.stop()}},t,this,[[0,14]])}));return function(e,r,n){return t.apply(this,arguments)}}()},{key:"delete",value:function(){var t=e(regeneratorRuntime.mark(function t(e,r){var n,u;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.gudhub.auth.getToken();case 3:return t.t0=t.sent,t.t1=e,t.t2=r,n={token:t.t0,app_id:t.t1,user_id:t.t2},t.next=9,this.req.post({url:"/sharing/delete",form:n});case 9:return u=t.sent,t.abrupt("return",u);case 13:return t.prev=13,t.t3=t.catch(0),console.log(t.t3),t.abrupt("return",null);case 17:case"end":return t.stop()}},t,this,[[0,13]])}));return function(e,r){return t.apply(this,arguments)}}()},{key:"getAppUsers",value:function(){var t=e(regeneratorRuntime.mark(function t(e){var r,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.gudhub.auth.getToken();case 3:return t.t0=t.sent,t.t1=e,r={token:t.t0,app_id:t.t1},t.next=8,this.req.post({url:"/sharing/get-app-users",form:r});case 8:return n=t.sent,t.abrupt("return",n);case 12:return t.prev=12,t.t2=t.catch(0),console.log(t.t2),t.abrupt("return",null);case 16:case"end":return t.stop()}},t,this,[[0,12]])}));return function(e){return t.apply(this,arguments)}}()},{key:"addInvitation",value:function(){var t=e(regeneratorRuntime.mark(function t(e,r){var n,u;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.gudhub.auth.getToken();case 3:return t.t0=t.sent,t.t1=e,t.t2=r,n={token:t.t0,guests_emails:t.t1,apps:t.t2},t.next=9,this.req.post({url:"/api/invitation/add",form:n});case 9:return u=t.sent,t.abrupt("return",u);case 13:return t.prev=13,t.t3=t.catch(0),console.log(t.t3),t.abrupt("return",null);case 17:case"end":return t.stop()}},t,this,[[0,13]])}));return function(e,r){return t.apply(this,arguments)}}()}]),t}();exports.Sharing=a;
|
|
213
213
|
},{}],"U9gy":[function(require,module,exports) {
|
|
214
|
-
"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"),s=require("./Utils/Utils.js"),u=require("./Auth/Auth.js"),o=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"),g=require("./consts.js"),v=require("./WebSocket/WebsocketHandler.js"),k=require("./Utils/sharing/GroupSharing.js"),y=require("./Utils/sharing/Sharing.js");function m(e,t,r,i,n,s,u){try{var o=e[s](u),a=o.value}catch(c){return void r(c)}o.done?t(a):Promise.resolve(a).then(i,n)}function w(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var s=e.apply(t,r);function u(e){m(s,i,n,u,o,"next",e)}function o(e){m(s,i,n,u,o,"throw",e)}u(void 0)})}}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(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,i.key,i)}}function P(e,t,r){return t&&b(e.prototype,t),r&&b(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var F=function(){function m(g){var w=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{server_url:n.server_url,wss_url:n.wss_url,initWebsocket:!1,activateSW:!1,swLink:"",async_modules_path:n.async_modules_path,file_server_url:n.file_server_url};if(S(this,m),this.ghconstructor=new o.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),this.util=new s.Utils(this),this.req=new e.GudHubHttpsService(w.server_url),this.auth=new u.Auth(this.req,this.storage),this.sharing=new y.Sharing(this,this.req),this.groupSharing=new k.GroupSharing(this,this.req,this.pipeService),g&&this.storage.setUser({auth_key:g}),this.req.init(this.auth.getToken.bind(this.auth)),this.ws=new i.WebSocketApi(w.wss_url,this.auth),this.chunksManager=new h.ChunksManager(this.storage,this.pipeService,this.req,this.util),this.appProcessor=new a.AppProcessor(this.storage,this.pipeService,this.req,this.ws,this.chunksManager,this.util,w.activateSW),this.itemProcessor=new c.ItemProcessor(this.storage,this.pipeService,this.req,this.appProcessor,this.util),this.fieldProcessor=new l.FieldProcessor(this.storage,this.req,this.appProcessor,this.itemProcessor,this.pipeService),this.fileManager=new p.FileManager(this.storage,this.pipeService,this.req,this.appProcessor),this.documentManager=new f.DocumentManager(this.req,this.pipeService),w.initWebsocket){this.ws.initWebSocket(v.WebsocketHandler.bind(this,this),this.appProcessor.refreshApps.bind(this.appProcessor))}w.activateSW&&this.activateSW(w.swLink)}return P(m,[{key:"activateSW",value:function(){var e=w(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(g.IS_WEB&&"serviceWorker"in window.navigator)){e.next=14;break}return e.prev=1,e.next=4,window.navigator.serviceWorker.register(t);case 4:(r=e.sent).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.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),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;",e.t0);case 12:e.next=15;break;case 14:console.log("%cSW ->>> ServiceWorkers not supported","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;");case 15:case"end":return e.stop()}},e,null,[[1,9]])}));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,r,i,n){return this.util.prefilter(e,t,r,i,n)}},{key:"getInterpretation",value:function(e,t,r,i,n,s,u){return this.interpritate.getInterpretation(e,t,r,i,n,s,u)}},{key:"getInterpretationById",value:function(e,t,r,i){return this.interpritate.getInterpretationById(e,t,r,i)}},{key:"filter",value:function(e,t){return this.util.filter(e,t)}},{key:"group",value:function(e,t){return this.util.group(e,t)}},{key:"getFilteredItems",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.util.getFilteredItems(e,t,r.element_app_id,r.app_id,r.item_id,r.field_group,r.search,r.search_params)}},{key:"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,s){return this.util.populateWithItemRef(e,t,r,i,n,s)}},{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){return this.util.jsonConstructor(e,t,r)}},{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=w(regeneratorRuntime.mark(function e(t,r){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getItems(t);case 2:if(!(i=e.sent)){e.next=5;break}return e.abrupt("return",i.find(function(e){return e.item_id==r}));case 5:case"end":return e.stop()}},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:"getField",value:function(e,t){return this.fieldProcessor.getField(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,s,u){return this.fileManager.uploadFileFromString(e,t,r,i,n,s,u)}},{key:"updateFileFromString",value:function(e,t,r,i,n){return this.fileManager.updateFileFromString(e,t,r,i,n)}},{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:"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)}}]),m}();exports.GudHub=F;
|
|
214
|
+
"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"),s=require("./Utils/Utils.js"),u=require("./Auth/Auth.js"),o=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"),g=require("./consts.js"),v=require("./WebSocket/WebsocketHandler.js"),k=require("./Utils/sharing/GroupSharing.js"),y=require("./Utils/sharing/Sharing.js");function m(e,t,r,i,n,s,u){try{var o=e[s](u),a=o.value}catch(c){return void r(c)}o.done?t(a):Promise.resolve(a).then(i,n)}function w(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var s=e.apply(t,r);function u(e){m(s,i,n,u,o,"next",e)}function o(e){m(s,i,n,u,o,"throw",e)}u(void 0)})}}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(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,i.key,i)}}function P(e,t,r){return t&&b(e.prototype,t),r&&b(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var F=function(){function m(g){var w=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{server_url:n.server_url,wss_url:n.wss_url,initWebsocket:!1,activateSW:!1,swLink:"",async_modules_path:n.async_modules_path,file_server_url:n.file_server_url};if(S(this,m),this.ghconstructor=new o.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),this.util=new s.Utils(this),this.req=new e.GudHubHttpsService(w.server_url),this.auth=new u.Auth(this.req,this.storage),this.sharing=new y.Sharing(this,this.req),this.groupSharing=new k.GroupSharing(this,this.req,this.pipeService),g&&this.storage.setUser({auth_key:g}),this.req.init(this.auth.getToken.bind(this.auth)),this.ws=new i.WebSocketApi(w.wss_url,this.auth),this.chunksManager=new h.ChunksManager(this.storage,this.pipeService,this.req,this.util),this.appProcessor=new a.AppProcessor(this.storage,this.pipeService,this.req,this.ws,this.chunksManager,this.util,w.activateSW),this.itemProcessor=new c.ItemProcessor(this.storage,this.pipeService,this.req,this.appProcessor,this.util),this.fieldProcessor=new l.FieldProcessor(this.storage,this.req,this.appProcessor,this.itemProcessor,this.pipeService),this.fileManager=new p.FileManager(this.storage,this.pipeService,this.req,this.appProcessor),this.documentManager=new f.DocumentManager(this.req,this.pipeService),w.initWebsocket){this.ws.initWebSocket(v.WebsocketHandler.bind(this,this),this.appProcessor.refreshApps.bind(this.appProcessor))}w.activateSW&&this.activateSW(w.swLink)}return P(m,[{key:"activateSW",value:function(){var e=w(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(g.IS_WEB&&"serviceWorker"in window.navigator)){e.next=14;break}return e.prev=1,e.next=4,window.navigator.serviceWorker.register(t);case 4:(r=e.sent).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.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),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;",e.t0);case 12:e.next=15;break;case 14:console.log("%cSW ->>> ServiceWorkers not supported","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;");case 15:case"end":return e.stop()}},e,null,[[1,9]])}));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,r,i,n){return this.util.prefilter(e,t,r,i,n)}},{key:"getInterpretation",value:function(e,t,r,i,n,s,u){return this.interpritate.getInterpretation(e,t,r,i,n,s,u)}},{key:"getInterpretationById",value:function(e,t,r,i,n,s){return this.interpritate.getInterpretationById(e,t,r,i,n,s)}},{key:"filter",value:function(e,t){return this.util.filter(e,t)}},{key:"group",value:function(e,t){return this.util.group(e,t)}},{key:"getFilteredItems",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.util.getFilteredItems(e,t,r.element_app_id,r.app_id,r.item_id,r.field_group,r.search,r.search_params)}},{key:"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,s){return this.util.populateWithItemRef(e,t,r,i,n,s)}},{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){return this.util.jsonConstructor(e,t,r)}},{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=w(regeneratorRuntime.mark(function e(t,r){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getItems(t);case 2:if(!(i=e.sent)){e.next=5;break}return e.abrupt("return",i.find(function(e){return e.item_id==r}));case 5:case"end":return e.stop()}},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:"getField",value:function(e,t){return this.fieldProcessor.getField(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,s,u){return this.fileManager.uploadFileFromString(e,t,r,i,n,s,u)}},{key:"updateFileFromString",value:function(e,t,r,i,n){return this.fileManager.updateFileFromString(e,t,r,i,n)}},{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:"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)}}]),m}();exports.GudHub=F;
|
|
215
215
|
},{"./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/Sharing.js":"XaHW"}],"iRRN":[function(require,module,exports) {
|
|
216
216
|
"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=e.GudHub;exports.default=r;
|
|
217
217
|
},{"regenerator-runtime/runtime.js":"KA2S","./GUDHUB/gudhub.js":"U9gy"}]},{},["iRRN"], "GudHubLibrary")
|