@gudhub/core 1.1.60 → 1.1.61
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/package.json
CHANGED
package/umd/library.min.js
CHANGED
|
@@ -173,7 +173,7 @@ var e,t=arguments[3],n=require("process");!function(n){if("object"==typeof expor
|
|
|
173
173
|
},{}],"zqOZ":[function(require,module,exports) {
|
|
174
174
|
"use strict";function e(e,n){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=t(e))||n&&e&&"number"==typeof e.length){i&&(e=i);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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,c=!0,u=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return c=e.done,e},e:function(e){u=!0,a=e},f:function(){try{c||null==i.return||i.return()}finally{if(u)throw a}}}}function t(e,t){if(e){if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function i(){i=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},c=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(I){f=function(e,t,n){return e[t]=n}}function s(e,t,n,i){var o=t&&t.prototype instanceof h?t:h,a=Object.create(o.prototype),c=new k(i||[]);return r(a,"_invoke",{value:x(e,n,c)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(I){return{type:"throw",arg:I}}}e.wrap=s;var d={};function h(){}function _(){}function v(){}var m={};f(m,c,function(){return this});var y=Object.getPrototypeOf,g=y&&y(y(L([])));g&&g!==t&&n.call(g,c)&&(m=g);var w=v.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach(function(t){f(e,t,function(e){return this._invoke(t,e)})})}function E(e,t){var i;r(this,"_invoke",{value:function(r,o){function c(){return new t(function(i,c){!function i(r,o,c,u){var l=p(e[r],e,o);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==a(s)&&n.call(s,"__await")?t.resolve(s.__await).then(function(e){i("next",e,c,u)},function(e){i("throw",e,c,u)}):t.resolve(s).then(function(e){f.value=e,c(f)},function(e){return i("throw",e,c,u)})}u(l.arg)}(r,o,i,c)})}return i=i?i.then(c,c):c()}})}function x(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return j()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var c=O(a,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var u=p(e,t,n);if("normal"===u.type){if(i=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i="completed",n.method="throw",n.arg=u.arg)}}}function O(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var r=p(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:j}}function j(){return{value:void 0,done:!0}}return _.prototype=v,r(w,"constructor",{value:v,configurable:!0}),r(v,"constructor",{value:_,configurable:!0}),_.displayName=f(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,f(e,l,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},b(E.prototype),f(E.prototype,u,function(){return this}),e.AsyncIterator=E,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new E(s(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},b(w),f(w,l,"Generator"),f(w,c,function(){return this}),f(w,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=L,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;A(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:L(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function r(e,t,n,i,r,o,a){try{var c=e[o](a),u=c.value}catch(l){return void n(l)}c.done?t(u):Promise.resolve(u).then(i,r)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var a=e.apply(t,n);function c(e){r(a,i,o,c,u,"next",e)}function u(e){r(a,i,o,c,u,"throw",e)}c(void 0)})}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function l(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e){var t=s(e,"string");return"symbol"===a(t)?t:String(t)}function s(e,t){if("object"!==a(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var p=function(){function t(e){c(this,t),this.gudhub=e,this.appsConnectingMap={apps:[],fields:[],items:[],views:[]}}return l(t,[{key:"createAppsFromTemplate",value:function(e,t,n){var i=this,r=this;return new Promise(function(o){var c=100/(6*e.apps.length),u=0;r.createApps(e,function(e){u+=1,n&&n.call(i,{percent:u*c,status:e})}).then(function(e){r.createItems(e,t,function(e){"string"==typeof e?(u+=1,n&&n.call(i,{percent:u*c,status:e})):"object"===a(e)&&(n&&n.call(i,{status:"Done",apps:e}),o())})})})}},{key:"createItems",value:function(e,t,n){var i=this;return new Promise(function(r){var o=t||1e5,a=i,c=[],u=[];e.forEach(function(e){u.push(new Promise(function(t){a.gudhub.getApp(a._searchOldAppId(e.app_id,a.appsConnectingMap.apps)).then(function(r){n&&n.call(i,"GET APP: ".concat(r.app_name," (Items steps)"));var u=JSON.parse(JSON.stringify(r)),l=u.items_list.map(function(e){return{index_number:e.index_number,item_id:0,fields:[]}}).filter(function(e,t){return t<=o});a.gudhub.addNewItems(e.app_id,l).then(function(o){n&&n.call(i,"ADD NEW ITEMS: ".concat(r.app_name," (Items steps)")),e.items_list=o,a._updateMap(e.items_list,u.items_list),a._addFieldValue(u.items_list,e.items_list,a.appsConnectingMap),c.push(e),t()})})}))}),Promise.all(u).then(function(){c.forEach(function(e){e.items_list.forEach(function(e){e.fields.forEach(function(e){a.appsConnectingMap.fields.forEach(function(t){e.field_id===t.old_field_id&&(e.field_id=t.new_field_id,e.element_id=t.new_field_id)})})})}),a.deleteField(c),a.replaceValue(c,a.appsConnectingMap).then(function(){var e=[];c.forEach(function(t){e.push(new Promise(function(e){var r=t.items_list.map(function(e){return e.fields.forEach(function(e){delete e.data_id}),e});a.gudhub.updateItems(t.app_id,r).then(function(){n&&n.call(i,"REPLACE VALUE: ".concat(t.app_name," (Items steps)")),e()})}))}),Promise.all(e).then(function(){n.call(i,c),r()})})})})}},{key:"deleteField",value:function(e){e.forEach(function(e){e.items_list.forEach(function(t){t.fields=t.fields.filter(function(t){return e.field_list.findIndex(function(e){return e.field_id==t.field_id})>-1})})})}},{key:"replaceValue",value:function(e,t){var n=this;return new Promise(function(){var r=o(i().mark(function r(o){var a,c;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:a=[],c=n,e.forEach(function(e){e.field_list.forEach(function(n){"item_ref"===n.data_type&&c._replaceValueItemRef(e,n,t),a.push(new Promise(function(t){c.gudhub.ghconstructor.getInstance(n.data_type).then(function(i){return void 0===i?(console.log("ERROR WHILE GETTING INSTANCE OF ",n.data_type),void t({type:n.data_type})):"file"==i.getTemplate().constructor?c.gudhub.util.fileInstallerHelper(e.app_id,e.items_list,n.field_id).then(function(e){t(e)}):void("document"==i.getTemplate().constructor?c.documentInstallerHelper(e.app_id,e.items_list,n.field_id).then(function(e){t(i)}):t(i))})}))})}),a.length>0?Promise.all(a).then(function(e){o(e)}):o(result);case 4:case"end":return i.stop()}},r)}));return function(e){return r.apply(this,arguments)}}())}},{key:"documentInstallerHelper",value:function(t,n,r){var a=this;return new Promise(function(){var c=o(i().mark(function o(c){var u,l,f,s,p,d,h;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:u=e(n),i.prev=1,u.s();case 3:if((l=u.n()).done){i.next=18;break}if(f=l.value,s=f.item_id,!((p=f.fields.find(function(e){return e.element_id===r}))&&p.field_value&&p.field_value.length>0)){i.next=16;break}return i.next=10,a.gudhub.getDocument({_id:p.field_value});case 10:if(!(d=i.sent)||!d.data){i.next=16;break}return i.next=14,a.gudhub.createDocument({app_id:t,item_id:s,element_id:r,data:d.data});case 14:h=i.sent,p.field_value=h._id;case 16:i.next=3;break;case 18:i.next=23;break;case 20:i.prev=20,i.t0=i.catch(1),u.e(i.t0);case 23:return i.prev=23,u.f(),i.finish(23);case 26:c();case 27:case"end":return i.stop()}},o,null,[[1,20,23,26]])}));return function(e){return c.apply(this,arguments)}}())}},{key:"_replaceValueItemRef",value:function(e,t,n){e.items_list.forEach(function(e){e.fields.forEach(function(e){if(e.field_id===t.field_id&&e.field_value){var i=e.field_value.split(",");i.forEach(function(e,t){var r=e.split(".");n.apps.forEach(function(e){r[0]==e.old_app_id&&(r[0]=e.new_app_id)}),n.items.forEach(function(e){r[1]==e.old_item_id&&(r[1]=e.new_item_id)}),i[t]=r.join(".")}),e.field_value=i.join(",")}})})}},{key:"_addFieldValue",value:function(e,t,n){t.forEach(function(t){n.items.forEach(function(n){t.item_id===n.new_item_id&&e.forEach(function(e){n.old_item_id===e.item_id&&(t.fields=e.fields)})})})}},{key:"_updateMap",value:function(e,t){var n=this;t.forEach(function(t){e.forEach(function(e){t.index_number===e.index_number&&n.appsConnectingMap.items.push({old_item_id:t.item_id,new_item_id:e.item_id})})})}},{key:"_searchOldAppId",value:function(e,t){var n=0;return t.forEach(function(t){t.new_app_id===e&&(n=t.old_app_id)}),n}},{key:"createApps",value:function(e,t){var n=this,i=this,r={step_size:100/(3*e.apps.length),apps:[]};return new Promise(function(o){var a={},c=[],u=[];e.apps.forEach(function(l){i.gudhub.getApp(l).then(function(l){t&&t.call(n,"GET APP: ".concat(l.app_name," (App steps)"));var f=JSON.parse(JSON.stringify(l));a[f.app_id]=f,r.apps.push(f.icon);var s=i.prepareAppTemplate(f);s.app_name=s.app_name+" New",s.privacy=1,e.data_to_change&&(e.data_to_change.name&&(s.app_name=e.data_to_change.name),e.data_to_change.icon&&(s.icon=e.data_to_change.icon)),i.resetViewsIds(s),i.gudhub.createNewApp(s).then(function(r){t&&t.call(n,"CREATE NEW APP: ".concat(l.app_name," (App steps)")),c.push(r),i.mapApp(f,r,i.appsConnectingMap),e.apps.length==c.length&&(i.connectApps(c,i.appsConnectingMap,a),c.forEach(function(r){i.gudhub.updateApp(r).then(function(i){t&&t.call(n,"UPDATE APP: ".concat(l.app_name," (App steps)")),u.push(i),e.apps.length==u.length&&o(u)})}))})})})})}},{key:"mapApp",value:function(e,t,n){n.apps.push({old_app_id:e.app_id,new_app_id:t.app_id,old_view_init:e.view_init,new_view_init:t.view_init}),e.field_list.forEach(function(e){t.field_list.forEach(function(t){e.name_space==t.name_space&&n.fields.push({name_space:e.name_space,old_field_id:e.field_id,new_field_id:t.field_id})})}),e.views_list.forEach(function(e){t.views_list.forEach(function(t){e.name==t.name&&n.views.push({name:e.name,old_view_id:e.view_id,new_view_id:t.view_id})})})}},{key:"crawling",value:function(e,t){var n=null===e?[]:Object.keys(e),i=this;n.length>0&&n.forEach(function(n){var r=e[n];void 0!==r&&"string"!=typeof e&&(t(n,r,e),i.crawling(r,t))})}},{key:"resetViewsIds",value:function(e){e.view_init=0,this.crawling(e.views_list,function(e,t,n){"view_id"!=e&&"container_id"!=e||(n[e]=0)})}},{key:"connectApps",value:function(e,t,n){var i=this;return e.forEach(function(e){t.apps.forEach(function(n){e.view_init===n.new_view_init&&t.views.forEach(function(t){n.old_view_init===t.old_view_id&&(e.view_init=t.new_view_id)})}),i.crawling(e.field_list,function(r,o,a){if(-1!==r.indexOf("field_id")||-1!==r.indexOf("FieldId")||-1!==r.indexOf("destination_field")){var c=String(o).split(","),u=[];t.fields.forEach(function(e){c.forEach(function(t){t==e.old_field_id&&u.push(e.new_field_id)})}),u.length&&(a[r]=u.join(","))}if(-1==r.indexOf("app_id")&&-1==r.indexOf("AppId")&&-1==r.indexOf("destination_app")||t.apps.forEach(function(e){o==e.old_app_id&&(a[r]=e.new_app_id)}),-1!==r.indexOf("view_id")&&t.views.forEach(function(e){o==e.old_view_id&&(a[r]=e.new_view_id)}),-1!==r.indexOf("src")&&isFinite(o)){var l=t.apps.find(function(t){return t.new_app_id===e.app_id}).old_app_id,f=i.findPath(n[l].views_list,"container_id",o);a[r]="".concat(i.getValueByPath(e.views_list,f,"container_id"))}})}),e}},{key:"getValueByPath",value:function(e,t,n){var i=e;return t.split(".").forEach(function(e){i=i[e]}),i[n]}},{key:"findPath",value:function(e,t,n){var i=!1,r=!1,o=[];return this.crawling(e,function(e,c,u){r&&o.reverse().forEach(function(e){r&&(e.delete=!0,e.parent===u&&(r=!1,(o=o.filter(function(e){return!e.delete})).reverse()))}),i||("object"===a(u[e])&&o.push({prop:e,parent:u}),c==n&&t===e?i=!0:Object.keys(u).pop()===e&&"object"!==a(u[e])&&(r=!0))}),o.map(function(e){return e.prop}).join(".")}},{key:"prepareAppTemplate",value:function(e){var t=JSON.parse(JSON.stringify(e));return this.crawling(t.views_list,function(e,t,n){"element_id"==e&&(n.element_id=-Number(t),n.create_element=-Number(t))}),t.field_list.forEach(function(e){e.create_field=-Number(e.field_id),e.element_id=-Number(e.field_id),e.field_id=-Number(e.field_id),e.field_value=""}),t.items_list=[],delete t.app_id,delete t.icon.id,delete t.group_id,delete t.trash,delete t.last_update,delete t.file_list,t}}]),t}();exports.default=p;
|
|
175
175
|
},{}],"E7yc":[function(require,module,exports) {
|
|
176
|
-
"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e){return o(e)||i(e)||r(e)||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 r(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function i(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function o(e){if(Array.isArray(e))return u(e)}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(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,c(r.key),r)}}function a(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(t){var n=s(t,"string");return"symbol"===e(n)?n:String(n)}function s(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileHelper=void 0;var p=function(){function e(t){l(this,e),this.gudhub=t}return a(e,[{key:"fileInstallerHelper",value:function(e,n,r){var i=this;return new Promise(function(o){var u=[[]],l=Promise.resolve(),f=[];n.forEach(function(t){var n=t.item_id,i=t.fields.find(function(e){return e.element_id===r});i&&i.field_value&&i.field_value.split(".").forEach(function(t){var i={source:t,destination:{app_id:e,item_id:n,element_id:r}};10!==u[u.length-1].length?u[u.length-1].push(i):u.push([i])})}),u.forEach(function(e){l=l.then(function(){return i.gudhub.duplicateFile(e)}).then(function(e){f=[].concat(t(f),t(e))})}),l.then(function(){n.forEach(function(e){var t=e.item_id,n=e.fields.find(function(e){return e.element_id===r});n&&n.field_value&&(n.field_value="",f.forEach(function(e){e.item_id===t&&(n.field_value=n.field_value.split(",").filter(function(e){return e}).concat(e.file_id).join(","))}))}),o()})})}}]),e}();exports.FileHelper=p;
|
|
176
|
+
"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e){return o(e)||i(e)||r(e)||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 r(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function i(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function o(e){if(Array.isArray(e))return u(e)}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(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,c(r.key),r)}}function a(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(t){var n=s(t,"string");return"symbol"===e(n)?n:String(n)}function s(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileHelper=void 0;var p=function(){function e(t){l(this,e),this.gudhub=t}return a(e,[{key:"fileInstallerHelper",value:function(e,n,r){var i=this;return new Promise(function(o){var u=[[]],l=Promise.resolve(),f=[];n.forEach(function(t){var n=t.item_id,i=t.fields.find(function(e){return e.element_id===r});i&&i.field_value&&i.field_value.split(".").forEach(function(t){var i={source:t.split(",")[0],destination:{app_id:e,item_id:n,element_id:r}};10!==u[u.length-1].length?u[u.length-1].push(i):u.push([i])})}),u.forEach(function(e){l=l.then(function(){return i.gudhub.duplicateFile(e)}).then(function(e){f=[].concat(t(f),t(e))})}),l.then(function(){n.forEach(function(e){var t=e.item_id,n=e.fields.find(function(e){return e.element_id===r});n&&n.field_value&&(n.field_value="",f.forEach(function(e){e.item_id===t&&(n.field_value=n.field_value.split(",").filter(function(e){return e}).concat(e.file_id).join(","))}))}),o()})})}}]),e}();exports.FileHelper=p;
|
|
177
177
|
},{}],"AefJ":[function(require,module,exports) {
|
|
178
178
|
"use strict";function e(e,t){return JSON.stringify(e)===JSON.stringify(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.compareObjects=e;
|
|
179
179
|
},{}],"ndUf":[function(require,module,exports) {
|