From 3d1836ad34d80318b59389edb89ba02678b687d5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 13 May 2020 17:48:16 +0000 Subject: Bump @babel/core from 7.9.0 to 7.9.6 Bumps [@babel/core](https://github.com/babel/babel) from 7.9.0 to 7.9.6. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) - [Commits](https://github.com/babel/babel/compare/v7.9.0...v7.9.6) Signed-off-by: dependabot-preview[bot] Signed-off-by: npmbuildbot[bot] --- apps/workflowengine/js/workflowengine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/workflowengine/js') diff --git a/apps/workflowengine/js/workflowengine.js b/apps/workflowengine/js/workflowengine.js index 9105c4c3bab..91d2e196213 100644 --- a/apps/workflowengine/js/workflowengine.js +++ b/apps/workflowengine/js/workflowengine.js @@ -322,7 +322,7 @@ var r,a;r=this,a=function(e){var t=function(e){return new t.lib.init(e)};functio * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * - */a.default.use(o.a);var _=new o.a.Store({state:{rules:[],scope:Object(c.loadState)("workflowengine","scope"),appstoreEnabled:Object(c.loadState)("workflowengine","appstoreenabled"),operations:Object(c.loadState)("workflowengine","operators"),plugins:a.default.observable({checks:{},operators:{}}),entities:Object(c.loadState)("workflowengine","entities"),events:Object(c.loadState)("workflowengine","entities").map((function(e){return e.events.map((function(t){return h({id:"".concat(e.id,"::").concat(t.eventName),entity:e},t)}))})).flat(),checks:Object(c.loadState)("workflowengine","checks")},mutations:{addRule:function(e,t){e.rules.push(h(h({},t),{},{valid:!0}))},updateRule:function(e,t){var n=e.rules.findIndex((function(e){return t.id===e.id})),r=Object.assign({},t);a.default.set(e.rules,n,r)},removeRule:function(e,t){var n=e.rules.findIndex((function(e){return t.id===e.id}));e.rules.splice(n,1)},addPluginCheck:function(e,t){a.default.set(e.plugins.checks,t.class,t)},addPluginOperator:function(e,t){t=Object.assign({color:"var(--color-primary-element)"},t,e.operations[t.id]||{}),void 0!==e.operations[t.id]&&a.default.set(e.operations,t.id,t)}},actions:{fetchRules:function(e){return f(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.a.get(d(""));case 2:n=t.sent,r=n.data,Object.values(r.ocs.data).flat().forEach((function(t){e.commit("addRule",t)}));case 5:case"end":return t.stop()}}),t)})))()},createNewRule:function(e,t){var n=null,r=[];!1===t.isComplex&&""===t.fixedEntity&&(r=[(n=(n=e.state.entities.find((function(e){return t.entities&&t.entities[0]===e.id})))||Object.values(e.state.entities)[0]).events[0].eventName]),e.commit("addRule",{id:-(new Date).getTime(),class:t.id,entity:n?n.id:t.fixedEntity,events:r,name:"",checks:[{class:null,operator:null,value:""}],operation:t.operation||""})},updateRule:function(e,t){e.commit("updateRule",h(h({},t),{},{events:"string"==typeof t.events?JSON.parse(t.events):t.events}))},removeRule:function(e,t){e.commit("removeRule",t)},pushUpdateRule:function(e,t){return f(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(0!==e.state.scope){n.next=3;break}return n.next=3,m()();case 3:if(!(t.id<0)){n.next=9;break}return n.next=6,s.a.post(d(""),t);case 6:r=n.sent,n.next=12;break;case 9:return n.next=11,s.a.put(d("/".concat(t.id)),t);case 11:r=n.sent;case 12:a.default.set(t,"id",r.data.ocs.data.id),e.commit("updateRule",t);case 14:case"end":return n.stop()}}),n)})))()},deleteRule:function(e,t){return f(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,m()();case 2:return n.next=4,s.a.delete(d("/".concat(t.id)));case 4:e.commit("removeRule",t);case 5:case"end":return n.stop()}}),n)})))()},setValid:function(e,t){var n=t.rule,r=t.valid;n.valid=r,e.commit("updateRule",n)}},getters:{getRules:function(e){return e.rules.filter((function(t){return void 0!==e.operations[t.class]})).sort((function(e,t){return e.id-t.id||t.class-e.class}))},getOperationForRule:function(e){return function(t){return e.operations[t.class]}},getEntityForOperation:function(e){return function(t){return e.entities.find((function(e){return t.fixedEntity===e.id}))}},getEventsForOperation:function(e){return function(t){return e.events}},getChecksForEntity:function(e){return function(t){return Object.values(e.checks).filter((function(e){return e.supportedEntities.indexOf(t)>-1||0===e.supportedEntities.length})).map((function(t){return e.plugins.checks[t.id]})).reduce((function(e,t){return e[t.class]=t,e}),{})}}}}),b=r(344),v=r.n(b),y=r(85),L=r.n(y),T=r(86),w=r.n(T),z=r(9),O=r.n(z),x=r(346),k={name:"Event",components:{Multiselect:O.a},props:{rule:{type:Object,required:!0}},computed:{entity:function(){return this.$store.getters.getEntityForOperation(this.operation)},operation:function(){return this.$store.getters.getOperationForRule(this.rule)},allEvents:function(){return this.$store.getters.getEventsForOperation(this.operation)},currentEvent:function(){var e=this;return this.allEvents.filter((function(t){return t.entity.id===e.rule.entity&&-1!==e.rule.events.indexOf(t.eventName)}))}},methods:{updateEvent:function(e){if(0!==e.length){var n=this.rule.entity,r=e.map((function(e){return e.entity.id})).filter((function(e,t,n){return n.indexOf(e)===t})),a=null;a=r.length>1?r.filter((function(e){return e!==n}))[0]:r[0],this.$set(this.rule,"entity",a),this.$set(this.rule,"events",e.filter((function(e){return e.entity.id===a})).map((function(e){return e.eventName}))),this.$emit("update",this.rule)}else Object(x.showWarning)(t("workflowengine","At least one event must be selected"))}}};r(475);function N(e,t,n,r,a,o,i,s){var c,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),i?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},l._ssrRegister=c):a&&(c=s?function(){a.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:a),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(e,t){return c.call(t),u(e,t)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:l}}var S=N(k,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"event"},[e.operation.isComplex&&""!==e.operation.fixedEntity?n("div",{staticClass:"isComplex"},[n("img",{staticClass:"option__icon",attrs:{src:e.entity.icon}}),e._v(" "),n("span",{staticClass:"option__title option__title_single"},[e._v(e._s(e.operation.triggerHint))])]):n("Multiselect",{attrs:{value:e.currentEvent,options:e.allEvents,"track-by":"id",multiple:!0,"auto-limit":!1,disabled:e.allEvents.length<=1},on:{input:e.updateEvent},scopedSlots:e._u([{key:"selection",fn:function(t){var r=t.values,a=(t.search,t.isOpen);return[r.length&&!a?n("div",{staticClass:"eventlist"},[n("img",{staticClass:"option__icon",attrs:{src:r[0].entity.icon}}),e._v(" "),e._l(r,(function(t,a){return n("span",{key:t.id,staticClass:"text option__title option__title_single"},[e._v(e._s(t.displayName)+" "),a+1-1&&t.$delete(t.rule.checks,r),t.$store.dispatch("updateRule",t.rule);case 3:case"end":return n.stop()}}),n)})))()}}},I=(r(481),N(j,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.operation?n("div",{staticClass:"section rule",style:{borderLeftColor:e.operation.color||""}},[n("div",{staticClass:"trigger"},[n("p",[n("span",[e._v(e._s(e.t("workflowengine","When")))]),e._v(" "),n("Event",{attrs:{rule:e.rule},on:{update:e.updateRule}})],1),e._v(" "),e._l(e.rule.checks,(function(t,r){return n("p",{key:r},[n("span",[e._v(e._s(e.t("workflowengine","and")))]),e._v(" "),n("Check",{attrs:{check:t,rule:e.rule},on:{update:e.updateRule,validate:e.validate,remove:function(n){return e.removeCheck(t)}}})],1)})),e._v(" "),n("p",[n("span"),e._v(" "),e.lastCheckComplete?n("input",{staticClass:"check--add",attrs:{type:"button",value:"Add a new filter"},on:{click:function(t){return e.rule.checks.push({class:null,operator:null,value:""})}}}):e._e()])],2),e._v(" "),n("div",{staticClass:"flow-icon icon-confirm"}),e._v(" "),n("div",{staticClass:"action"},[n("Operation",{attrs:{operation:e.operation,colored:!1}},[e.operation.options?n(e.operation.options,{tag:"component",on:{input:e.updateOperation},model:{value:e.rule.operation,callback:function(t){e.$set(e.rule,"operation",t)},expression:"rule.operation"}}):e._e()],1),e._v(" "),n("div",{staticClass:"buttons"},[n("button",{staticClass:"status-button icon",class:e.ruleStatus.class,on:{click:e.saveRule}},[e._v("\n\t\t\t\t"+e._s(e.ruleStatus.title)+"\n\t\t\t")]),e._v(" "),e.rule.id<-1||e.dirty?n("button",{on:{click:e.cancelRule}},[e._v("\n\t\t\t\t"+e._s(e.t("workflowengine","Cancel"))+"\n\t\t\t")]):e.dirty?e._e():n("button",{on:{click:e.deleteRule}},[e._v("\n\t\t\t\t"+e._s(e.t("workflowengine","Delete"))+"\n\t\t\t")])]),e._v(" "),e.error?n("p",{staticClass:"error-message"},[e._v("\n\t\t\t"+e._s(e.error)+"\n\t\t")]):e._e()],1)]):e._e()}),[],!1,null,"1680636e",null).exports);function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t3},getMainOperations:function(){return this.showMoreOperations?Object.values(this.operations):Object.values(this.operations).slice(0,3)},showAppStoreHint:function(){return 0===this.scope&&this.appstoreEnabled&&OC.isUserAdmin()}}),mounted:function(){this.$store.dispatch("fetchRules")},methods:{createNewRule:function(e){this.$store.dispatch("createNewRule",e)}}},U=(r(483),N(F,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"workflowengine"}},[n("div",{staticClass:"section"},[n("h2",[e._v(e._s(e.t("workflowengine","Available flows")))]),e._v(" "),0===e.scope?n("p",{staticClass:"settings-hint"},[n("a",{attrs:{href:"https://nextcloud.com/developer/"}},[e._v(e._s(e.t("workflowengine","For details on how to write your own flow, check out the development documentation.")))])]):e._e(),e._v(" "),n("transition-group",{staticClass:"actions",attrs:{name:"slide",tag:"div"}},[e._l(e.getMainOperations,(function(t){return n("Operation",{key:t.id,attrs:{operation:t},nativeOn:{click:function(n){return e.createNewRule(t)}}})})),e._v(" "),e.showAppStoreHint?n("a",{key:"add",staticClass:"actions__item colored more",attrs:{href:e.appstoreUrl}},[n("div",{staticClass:"icon icon-add"}),e._v(" "),n("div",{staticClass:"actions__item__description"},[n("h3",[e._v(e._s(e.t("workflowengine","More flows")))]),e._v(" "),n("small",[e._v(e._s(e.t("workflowengine","Browse the app store")))])])]):e._e()],2),e._v(" "),e.hasMoreOperations?n("div",{staticClass:"actions__more"},[n("button",{staticClass:"icon",class:e.showMoreOperations?"icon-triangle-n":"icon-triangle-s",on:{click:function(t){e.showMoreOperations=!e.showMoreOperations}}},[e._v("\n\t\t\t\t"+e._s(e.showMoreOperations?e.t("workflowengine","Show less"):e.t("workflowengine","Show more"))+"\n\t\t\t")])]):e._e(),e._v(" "),0===e.scope?n("h2",{staticClass:"configured-flows"},[e._v("\n\t\t\t"+e._s(e.t("workflowengine","Configured flows"))+"\n\t\t")]):n("h2",{staticClass:"configured-flows"},[e._v("\n\t\t\t"+e._s(e.t("workflowengine","Your flows"))+"\n\t\t")])],1),e._v(" "),e.rules.length>0?n("transition-group",{attrs:{name:"slide"}},e._l(e.rules,(function(e){return n("Rule",{key:e.id,attrs:{rule:e}})})),1):e._e()],1)}),[],!1,null,"7000c295",null).exports),G=/^\/(.*)\/([gui]{0,3})$/,Q=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2][0-9]|[1-9])$/,V=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(1([01][0-9]|2[0-8])|[1-9][0-9]|[0-9])$/,J={props:{value:{type:String,default:""},check:{type:Object,default:function(){return{}}}},data:function(){return{newValue:""}},watch:{value:{immediate:!0,handler:function(e){this.updateInternalValue(e)}}},methods:{updateInternalValue:function(e){this.newValue=e}}};function $(e){return function(e){if(Array.isArray(e))return K(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(e,t)}(e)||function(){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 K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){n["@attributes"]={};for(var r=0;r\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t'}).then((function(e){return te(e.data)})).then((function(t){e.tags=t,e.inputValObjects=e.getValueObject()})).catch(console.error.bind(this))},methods:{getValueObject:function(){var e=this;return 0===this.tags.length?[]:this.multiple?this.value.filter((function(e){return""!==e})).map((function(t){return e.tags.find((function(e){return e.id===t}))})):this.tags.find((function(t){return t.id===e.value}))},update:function(){this.multiple?this.$emit("input",this.inputValObjects.map((function(e){return e.id}))):null===this.inputValObjects?this.$emit("input",""):this.$emit("input",this.inputValObjects.id)},tagLabel:function(e){var n=e.displayName,r=e.userVisible,a=e.userAssignable;return!1===r?t("systemtags","%s (invisible)").replace("%s",n):!1===a?t("systemtags","%s (restricted)").replace("%s",n):n}}},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Multiselect",{staticClass:"multiselect-vue",attrs:{options:e.tags,"options-limit":5,placeholder:e.label,"track-by":"id","custom-label":e.tagLabel,multiple:e.multiple,"close-on-select":!1,"tag-width":60,disabled:e.disabled},on:{input:e.update},scopedSlots:e._u([{key:"option",fn:function(t){return[e._v("\n\t\t"+e._s(e.tagLabel(t.option))+"\n\t")]}}]),model:{value:e.inputValObjects,callback:function(t){e.inputValObjects=t},expression:"inputValObjects"}},[n("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("core","No results")))])])}),[],!1,null,null,null).exports,ae=N({name:"FileSystemTag",components:{MultiselectTag:re},props:{value:{type:String,default:""}},data:function(){return{newValue:[]}},watch:{value:function(){this.updateValue()}},beforeMount:function(){this.updateValue()},methods:{updateValue:function(){""!==this.value?this.newValue=this.value:this.newValue=null},update:function(){this.$emit("input",this.newValue||"")}}},(function(){var e=this,t=e.$createElement;return(e._self._c||t)("MultiselectTag",{attrs:{multiple:!1,label:e.t("workflowengine","Select a tag")},on:{input:e.update},model:{value:e.newValue,callback:function(t){e.newValue=t},expression:"newValue"}})}),[],!1,null,"31f5522d",null).exports,oe=function(e){return e.value.startsWith("/")?[{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")}]},ie=[{class:"OCA\\WorkflowEngine\\Check\\FileName",name:t("workflowengine","File name"),operators:oe,placeholder:function(e){return"matches"===e.operator||"!matches"===e.operator?"/^dummy-.+$/i":"filename.txt"},validate:function(e){return"matches"!==e.operator&&"!matches"!==e.operator||!!(t=e.value)&&null!==G.exec(t);var t}},{class:"OCA\\WorkflowEngine\\Check\\FileMimeType",name:t("workflowengine","File MIME type"),operators:oe,component:ee},{class:"OCA\\WorkflowEngine\\Check\\FileSize",name:t("workflowengine","File size (upload)"),operators:[{operator:"less",name:t("workflowengine","less")},{operator:"!greater",name:t("workflowengine","less or equals")},{operator:"!less",name:t("workflowengine","greater or equals")},{operator:"greater",name:t("workflowengine","greater")}],placeholder:function(e){return"5 MB"},validate:function(e){return!!e.value&&null!==e.value.match(/^[0-9]+[ ]?[kmgt]?b$/i)}},{class:"OCA\\WorkflowEngine\\Check\\RequestRemoteAddress",name:t("workflowengine","Request remote address"),operators:[{operator:"matchesIPv4",name:t("workflowengine","matches IPv4")},{operator:"!matchesIPv4",name:t("workflowengine","does not match IPv4")},{operator:"matchesIPv6",name:t("workflowengine","matches IPv6")},{operator:"!matchesIPv6",name:t("workflowengine","does not match IPv6")}],placeholder:function(e){return"matchesIPv6"===e.operator||"!matchesIPv6"===e.operator?"::1/128":"127.0.0.1/32"},validate:function(e){return"matchesIPv6"===e.operator||"!matchesIPv6"===e.operator?!!(t=e.value)&&null!==V.exec(t):function(e){return!!e&&null!==Q.exec(e)}(e.value);var t}},{class:"OCA\\WorkflowEngine\\Check\\FileSystemTags",name:t("workflowengine","File system tag"),operators:[{operator:"is",name:t("workflowengine","is tagged with")},{operator:"!is",name:t("workflowengine","is not tagged with")}],component:ae}];function se(e){return function(e){if(Array.isArray(e))return ce(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}(e)||function(){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 ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1||0===e.supportedEntities.length})).map((function(t){return e.plugins.checks[t.id]})).reduce((function(e,t){return e[t.class]=t,e}),{})}}}}),b=r(344),v=r.n(b),y=r(85),L=r.n(y),T=r(86),w=r.n(T),z=r(9),O=r.n(z),x=r(346),k={name:"Event",components:{Multiselect:O.a},props:{rule:{type:Object,required:!0}},computed:{entity:function(){return this.$store.getters.getEntityForOperation(this.operation)},operation:function(){return this.$store.getters.getOperationForRule(this.rule)},allEvents:function(){return this.$store.getters.getEventsForOperation(this.operation)},currentEvent:function(){var e=this;return this.allEvents.filter((function(t){return t.entity.id===e.rule.entity&&-1!==e.rule.events.indexOf(t.eventName)}))}},methods:{updateEvent:function(e){if(0!==e.length){var n=this.rule.entity,r=e.map((function(e){return e.entity.id})).filter((function(e,t,n){return n.indexOf(e)===t})),a=null;a=r.length>1?r.filter((function(e){return e!==n}))[0]:r[0],this.$set(this.rule,"entity",a),this.$set(this.rule,"events",e.filter((function(e){return e.entity.id===a})).map((function(e){return e.eventName}))),this.$emit("update",this.rule)}else Object(x.showWarning)(t("workflowengine","At least one event must be selected"))}}};r(475);function N(e,t,n,r,a,o,i,s){var c,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),i?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},l._ssrRegister=c):a&&(c=s?function(){a.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:a),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(e,t){return c.call(t),u(e,t)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:l}}var S=N(k,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"event"},[e.operation.isComplex&&""!==e.operation.fixedEntity?n("div",{staticClass:"isComplex"},[n("img",{staticClass:"option__icon",attrs:{src:e.entity.icon}}),e._v(" "),n("span",{staticClass:"option__title option__title_single"},[e._v(e._s(e.operation.triggerHint))])]):n("Multiselect",{attrs:{value:e.currentEvent,options:e.allEvents,"track-by":"id",multiple:!0,"auto-limit":!1,disabled:e.allEvents.length<=1},on:{input:e.updateEvent},scopedSlots:e._u([{key:"selection",fn:function(t){var r=t.values,a=(t.search,t.isOpen);return[r.length&&!a?n("div",{staticClass:"eventlist"},[n("img",{staticClass:"option__icon",attrs:{src:r[0].entity.icon}}),e._v(" "),e._l(r,(function(t,a){return n("span",{key:t.id,staticClass:"text option__title option__title_single"},[e._v(e._s(t.displayName)+" "),a+1-1&&t.$delete(t.rule.checks,r),t.$store.dispatch("updateRule",t.rule);case 3:case"end":return n.stop()}}),n)})))()}}},I=(r(481),N(j,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.operation?n("div",{staticClass:"section rule",style:{borderLeftColor:e.operation.color||""}},[n("div",{staticClass:"trigger"},[n("p",[n("span",[e._v(e._s(e.t("workflowengine","When")))]),e._v(" "),n("Event",{attrs:{rule:e.rule},on:{update:e.updateRule}})],1),e._v(" "),e._l(e.rule.checks,(function(t,r){return n("p",{key:r},[n("span",[e._v(e._s(e.t("workflowengine","and")))]),e._v(" "),n("Check",{attrs:{check:t,rule:e.rule},on:{update:e.updateRule,validate:e.validate,remove:function(n){return e.removeCheck(t)}}})],1)})),e._v(" "),n("p",[n("span"),e._v(" "),e.lastCheckComplete?n("input",{staticClass:"check--add",attrs:{type:"button",value:"Add a new filter"},on:{click:function(t){return e.rule.checks.push({class:null,operator:null,value:""})}}}):e._e()])],2),e._v(" "),n("div",{staticClass:"flow-icon icon-confirm"}),e._v(" "),n("div",{staticClass:"action"},[n("Operation",{attrs:{operation:e.operation,colored:!1}},[e.operation.options?n(e.operation.options,{tag:"component",on:{input:e.updateOperation},model:{value:e.rule.operation,callback:function(t){e.$set(e.rule,"operation",t)},expression:"rule.operation"}}):e._e()],1),e._v(" "),n("div",{staticClass:"buttons"},[n("button",{staticClass:"status-button icon",class:e.ruleStatus.class,on:{click:e.saveRule}},[e._v("\n\t\t\t\t"+e._s(e.ruleStatus.title)+"\n\t\t\t")]),e._v(" "),e.rule.id<-1||e.dirty?n("button",{on:{click:e.cancelRule}},[e._v("\n\t\t\t\t"+e._s(e.t("workflowengine","Cancel"))+"\n\t\t\t")]):e.dirty?e._e():n("button",{on:{click:e.deleteRule}},[e._v("\n\t\t\t\t"+e._s(e.t("workflowengine","Delete"))+"\n\t\t\t")])]),e._v(" "),e.error?n("p",{staticClass:"error-message"},[e._v("\n\t\t\t"+e._s(e.error)+"\n\t\t")]):e._e()],1)]):e._e()}),[],!1,null,"1680636e",null).exports);function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t3},getMainOperations:function(){return this.showMoreOperations?Object.values(this.operations):Object.values(this.operations).slice(0,3)},showAppStoreHint:function(){return 0===this.scope&&this.appstoreEnabled&&OC.isUserAdmin()}}),mounted:function(){this.$store.dispatch("fetchRules")},methods:{createNewRule:function(e){this.$store.dispatch("createNewRule",e)}}},U=(r(483),N(F,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"workflowengine"}},[n("div",{staticClass:"section"},[n("h2",[e._v(e._s(e.t("workflowengine","Available flows")))]),e._v(" "),0===e.scope?n("p",{staticClass:"settings-hint"},[n("a",{attrs:{href:"https://nextcloud.com/developer/"}},[e._v(e._s(e.t("workflowengine","For details on how to write your own flow, check out the development documentation.")))])]):e._e(),e._v(" "),n("transition-group",{staticClass:"actions",attrs:{name:"slide",tag:"div"}},[e._l(e.getMainOperations,(function(t){return n("Operation",{key:t.id,attrs:{operation:t},nativeOn:{click:function(n){return e.createNewRule(t)}}})})),e._v(" "),e.showAppStoreHint?n("a",{key:"add",staticClass:"actions__item colored more",attrs:{href:e.appstoreUrl}},[n("div",{staticClass:"icon icon-add"}),e._v(" "),n("div",{staticClass:"actions__item__description"},[n("h3",[e._v(e._s(e.t("workflowengine","More flows")))]),e._v(" "),n("small",[e._v(e._s(e.t("workflowengine","Browse the app store")))])])]):e._e()],2),e._v(" "),e.hasMoreOperations?n("div",{staticClass:"actions__more"},[n("button",{staticClass:"icon",class:e.showMoreOperations?"icon-triangle-n":"icon-triangle-s",on:{click:function(t){e.showMoreOperations=!e.showMoreOperations}}},[e._v("\n\t\t\t\t"+e._s(e.showMoreOperations?e.t("workflowengine","Show less"):e.t("workflowengine","Show more"))+"\n\t\t\t")])]):e._e(),e._v(" "),0===e.scope?n("h2",{staticClass:"configured-flows"},[e._v("\n\t\t\t"+e._s(e.t("workflowengine","Configured flows"))+"\n\t\t")]):n("h2",{staticClass:"configured-flows"},[e._v("\n\t\t\t"+e._s(e.t("workflowengine","Your flows"))+"\n\t\t")])],1),e._v(" "),e.rules.length>0?n("transition-group",{attrs:{name:"slide"}},e._l(e.rules,(function(e){return n("Rule",{key:e.id,attrs:{rule:e}})})),1):e._e()],1)}),[],!1,null,"7000c295",null).exports),G=/^\/(.*)\/([gui]{0,3})$/,Q=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2][0-9]|[1-9])$/,V=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(1([01][0-9]|2[0-8])|[1-9][0-9]|[0-9])$/,J={props:{value:{type:String,default:""},check:{type:Object,default:function(){return{}}}},data:function(){return{newValue:""}},watch:{value:{immediate:!0,handler:function(e){this.updateInternalValue(e)}}},methods:{updateInternalValue:function(e){this.newValue=e}}};function $(e){return function(e){if(Array.isArray(e))return K(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(e,t)}(e)||function(){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 K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){n["@attributes"]={};for(var r=0;r\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t'}).then((function(e){return te(e.data)})).then((function(t){e.tags=t,e.inputValObjects=e.getValueObject()})).catch(console.error.bind(this))},methods:{getValueObject:function(){var e=this;return 0===this.tags.length?[]:this.multiple?this.value.filter((function(e){return""!==e})).map((function(t){return e.tags.find((function(e){return e.id===t}))})):this.tags.find((function(t){return t.id===e.value}))},update:function(){this.multiple?this.$emit("input",this.inputValObjects.map((function(e){return e.id}))):null===this.inputValObjects?this.$emit("input",""):this.$emit("input",this.inputValObjects.id)},tagLabel:function(e){var n=e.displayName,r=e.userVisible,a=e.userAssignable;return!1===r?t("systemtags","%s (invisible)").replace("%s",n):!1===a?t("systemtags","%s (restricted)").replace("%s",n):n}}},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Multiselect",{staticClass:"multiselect-vue",attrs:{options:e.tags,"options-limit":5,placeholder:e.label,"track-by":"id","custom-label":e.tagLabel,multiple:e.multiple,"close-on-select":!1,"tag-width":60,disabled:e.disabled},on:{input:e.update},scopedSlots:e._u([{key:"option",fn:function(t){return[e._v("\n\t\t"+e._s(e.tagLabel(t.option))+"\n\t")]}}]),model:{value:e.inputValObjects,callback:function(t){e.inputValObjects=t},expression:"inputValObjects"}},[n("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("core","No results")))])])}),[],!1,null,null,null).exports,ae=N({name:"FileSystemTag",components:{MultiselectTag:re},props:{value:{type:String,default:""}},data:function(){return{newValue:[]}},watch:{value:function(){this.updateValue()}},beforeMount:function(){this.updateValue()},methods:{updateValue:function(){""!==this.value?this.newValue=this.value:this.newValue=null},update:function(){this.$emit("input",this.newValue||"")}}},(function(){var e=this,t=e.$createElement;return(e._self._c||t)("MultiselectTag",{attrs:{multiple:!1,label:e.t("workflowengine","Select a tag")},on:{input:e.update},model:{value:e.newValue,callback:function(t){e.newValue=t},expression:"newValue"}})}),[],!1,null,"31f5522d",null).exports,oe=function(e){return e.value.startsWith("/")?[{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")}]},ie=[{class:"OCA\\WorkflowEngine\\Check\\FileName",name:t("workflowengine","File name"),operators:oe,placeholder:function(e){return"matches"===e.operator||"!matches"===e.operator?"/^dummy-.+$/i":"filename.txt"},validate:function(e){return"matches"!==e.operator&&"!matches"!==e.operator||!!(t=e.value)&&null!==G.exec(t);var t}},{class:"OCA\\WorkflowEngine\\Check\\FileMimeType",name:t("workflowengine","File MIME type"),operators:oe,component:ee},{class:"OCA\\WorkflowEngine\\Check\\FileSize",name:t("workflowengine","File size (upload)"),operators:[{operator:"less",name:t("workflowengine","less")},{operator:"!greater",name:t("workflowengine","less or equals")},{operator:"!less",name:t("workflowengine","greater or equals")},{operator:"greater",name:t("workflowengine","greater")}],placeholder:function(e){return"5 MB"},validate:function(e){return!!e.value&&null!==e.value.match(/^[0-9]+[ ]?[kmgt]?b$/i)}},{class:"OCA\\WorkflowEngine\\Check\\RequestRemoteAddress",name:t("workflowengine","Request remote address"),operators:[{operator:"matchesIPv4",name:t("workflowengine","matches IPv4")},{operator:"!matchesIPv4",name:t("workflowengine","does not match IPv4")},{operator:"matchesIPv6",name:t("workflowengine","matches IPv6")},{operator:"!matchesIPv6",name:t("workflowengine","does not match IPv6")}],placeholder:function(e){return"matchesIPv6"===e.operator||"!matchesIPv6"===e.operator?"::1/128":"127.0.0.1/32"},validate:function(e){return"matchesIPv6"===e.operator||"!matchesIPv6"===e.operator?!!(t=e.value)&&null!==V.exec(t):function(e){return!!e&&null!==Q.exec(e)}(e.value);var t}},{class:"OCA\\WorkflowEngine\\Check\\FileSystemTags",name:t("workflowengine","File system tag"),operators:[{operator:"is",name:t("workflowengine","is tagged with")},{operator:"!is",name:t("workflowengine","is not tagged with")}],component:ae}];function se(e){return function(e){if(Array.isArray(e))return ce(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}(e)||function(){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 ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n * -- cgit v1.2.3