cloudcmd 16.1.0 → 16.1.1
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/ChangeLog +7 -0
- package/HELP.md +2 -1
- package/README.md +1 -1
- package/dist/cloudcmd.common.js +1 -1
- package/dist/cloudcmd.common.js.map +1 -1
- package/dist/modules/user-menu.js +1 -1
- package/dist/modules/user-menu.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist-dev/cloudcmd.common.js +2 -2
- package/dist-dev/modules/user-menu.js +1 -1
- package/dist-dev/sw.js +1 -1
- package/package.json +3 -3
- package/server/rest/index.js +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function t(t){for(var r,u,c=t[0],i=t[1],a=t[2],d=0,f=[];d<c.length;d++)u=c[d],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&f.push(o[u][0]),o[u]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(l&&l(t);f.length;)f.shift()();return s.push.apply(s,a||[]),n()}function n(){for(var e,t=0;t<s.length;t++){for(var n=s[t],r=!0,c=1;c<n.length;c++){var i=n[c];0!==o[i]&&(r=!1)}r&&(s.splice(t--,1),e=u(u.s=n[0]))}return e}var r={},o={18:0},s=[];function u(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=e,u.c=r,u.d=function(e,t,n){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)u.d(n,r,function(t){return e[t]}.bind(null,r));return n},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var c=window.webpackJsonp=window.webpackJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var a=0;a<c.length;a++)t(c[a]);var l=i;s.push([117,0]),n()}({117:function(e,t,n){"use strict";n(181);const r=n(0),o=n(8),s=n(7),u=n(4),c=n(2),i=n(27),a=n(3),{codeFrameColumns:l}=n(118),d=n(1),f=n(11),p=n(133),m=n(134),y=n(135),h=n(136),{runSelected:b}=n(137),x=u.css,C=s();CloudCmd.UserMenu=e.exports;const{Key:g}=CloudCmd;e.exports.init=async()=>{await Promise.all([x(CloudCmd.prefix+"/dist/user-menu.css"),CloudCmd.View()])},e.exports.show=async function(){d.show.load("top");const{dirPath:e}=w,t=await fetch(`${CloudCmd.prefix}/api/v1/user-menu?dir=${e}`),n=await t.text(),[r,o]=i(p,n);if(d.hide(),r)return f.alert(S({error:r,source:n}));C(n);const{names:s,keys:u,items:a,settings:l}=h(o);if(l.run)return b(l.select,a,P);const m=c("button",{className:"cloudcmd-user-menu-button",innerText:"User Menu",notAppend:!0}),y=c("select",{className:"cloudcmd-user-menu",innerHTML:v(s),notAppend:!0,size:10});m.addEventListener("click",M(o,y)),y.addEventListener("dblclick",k(o)),y.addEventListener("keydown",j({keys:u,userMenu:o}));CloudCmd.View.show([m,y],{autoSize:!0,afterShow:()=>y.focus()})},e.exports.hide=O;const{CurrentInfo:w}=DOM;function v(e){const t=[];for(const n of e)t.push(`<option>${n}</option>`);return t.join("")}function O(){CloudCmd.View.hide()}const k=r(async(e,t)=>{const{value:n}=t.target;await P(e[n])}),M=o(async(e,t)=>{let{value:n}=t;await P(e[n])}),j=r(async(e,t)=>{let{keys:n,userMenu:r}=e;const{keyCode:o,target:s}=t,u=t.key.toUpperCase();let c;if(t.preventDefault(),t.stopPropagation(),o===g.ESC)return O();if(o===g.ENTER)c=r[s.value];else{if(!n[u])return m(s,t);c=n[u]}await P(c)}),P=async e=>{O();const[t]=await a(e,{DOM:DOM,CloudCmd:CloudCmd,tryToCatch:a});if(!t)return;const n=C();return f.alert(S({error:t,source:n}))};function S(e){let{error:t,source:n}=e;const{code:r}=t;if(!r||"frame"===r)return t.message;const[o,s]=y(t);return`<pre>${l(n,{start:{line:o,column:s}},{message:t.message,highlightCode:!1})}</pre>`}},133:function(e,t,n){"use strict";e.exports=e=>{const t={};return Function("module",e)(t),t.exports}},134:function(e,t,n){"use strict";const{J:r,K:o,UP:s,DOWN:u}=n(36);e.exports=(e,t)=>{let{keyCode:n}=t;return n===u||n===r?function(e){const{length:t}=e;e.selectedIndex===t-1?e.selectedIndex=0:++e.selectedIndex}(e):n===s||n===o?function(e){const{length:t}=e;e.selectedIndex?--e.selectedIndex:e.selectedIndex=t-1}(e):void 0}},135:function(e,t,n){"use strict";const r=e=>"number"==typeof e;e.exports=e=>{const{lineNumber:t,columnNumber:n}=e;if(r(t)&&r(n))return[t,n];const o=e.stack.indexOf(">"),s=e.stack.slice(o+1),u=s.indexOf(")"),c=s.slice(1,u),[i,a]=c.split(":");return[Number(i),Number(a)]}},136:function(e,t,n){"use strict";const{entries:r,assign:o}=Object;e.exports=e=>{const t=[],n={},s={},u={};for(const[c,i]of r(e)){if("__settings"===c){o(u,e[c]);continue}if(
|
|
1
|
+
!function(e){function t(t){for(var r,u,c=t[0],i=t[1],a=t[2],d=0,f=[];d<c.length;d++)u=c[d],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&f.push(o[u][0]),o[u]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(l&&l(t);f.length;)f.shift()();return s.push.apply(s,a||[]),n()}function n(){for(var e,t=0;t<s.length;t++){for(var n=s[t],r=!0,c=1;c<n.length;c++){var i=n[c];0!==o[i]&&(r=!1)}r&&(s.splice(t--,1),e=u(u.s=n[0]))}return e}var r={},o={18:0},s=[];function u(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=e,u.c=r,u.d=function(e,t,n){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)u.d(n,r,function(t){return e[t]}.bind(null,r));return n},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var c=window.webpackJsonp=window.webpackJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var a=0;a<c.length;a++)t(c[a]);var l=i;s.push([117,0]),n()}({117:function(e,t,n){"use strict";n(181);const r=n(0),o=n(8),s=n(7),u=n(4),c=n(2),i=n(27),a=n(3),{codeFrameColumns:l}=n(118),d=n(1),f=n(11),p=n(133),m=n(134),y=n(135),h=n(136),{runSelected:b}=n(137),x=u.css,C=s();CloudCmd.UserMenu=e.exports;const{Key:g}=CloudCmd;e.exports.init=async()=>{await Promise.all([x(CloudCmd.prefix+"/dist/user-menu.css"),CloudCmd.View()])},e.exports.show=async function(){d.show.load("top");const{dirPath:e}=w,t=await fetch(`${CloudCmd.prefix}/api/v1/user-menu?dir=${e}`),n=await t.text(),[r,o]=i(p,n);if(d.hide(),r)return f.alert(S({error:r,source:n}));C(n);const{names:s,keys:u,items:a,settings:l}=h(o);if(l.run)return b(l.select,a,P);const m=c("button",{className:"cloudcmd-user-menu-button",innerText:"User Menu",notAppend:!0}),y=c("select",{className:"cloudcmd-user-menu",innerHTML:v(s),notAppend:!0,size:10});m.addEventListener("click",M(o,y)),y.addEventListener("dblclick",k(o)),y.addEventListener("keydown",j({keys:u,userMenu:o}));CloudCmd.View.show([m,y],{autoSize:!0,afterShow:()=>y.focus()})},e.exports.hide=O;const{CurrentInfo:w}=DOM;function v(e){const t=[];for(const n of e)t.push(`<option>${n}</option>`);return t.join("")}function O(){CloudCmd.View.hide()}const k=r(async(e,t)=>{const{value:n}=t.target;await P(e[n])}),M=o(async(e,t)=>{let{value:n}=t;await P(e[n])}),j=r(async(e,t)=>{let{keys:n,userMenu:r}=e;const{keyCode:o,target:s}=t,u=t.key.toUpperCase();let c;if(t.preventDefault(),t.stopPropagation(),o===g.ESC)return O();if(o===g.ENTER)c=r[s.value];else{if(!n[u])return m(s,t);c=n[u]}await P(c)}),P=async e=>{O();const[t]=await a(e,{DOM:DOM,CloudCmd:CloudCmd,tryToCatch:a});if(!t)return;const n=C();return f.alert(S({error:t,source:n}))};function S(e){let{error:t,source:n}=e;const{code:r}=t;if(!r||"frame"===r)return t.message;const[o,s]=y(t);return`<pre>${l(n,{start:{line:o,column:s}},{message:t.message,highlightCode:!1})}</pre>`}},133:function(e,t,n){"use strict";e.exports=e=>{const t={};return Function("module",e)(t),t.exports}},134:function(e,t,n){"use strict";const{J:r,K:o,UP:s,DOWN:u}=n(36);e.exports=(e,t)=>{let{keyCode:n}=t;return n===u||n===r?function(e){const{length:t}=e;e.selectedIndex===t-1?e.selectedIndex=0:++e.selectedIndex}(e):n===s||n===o?function(e){const{length:t}=e;e.selectedIndex?--e.selectedIndex:e.selectedIndex=t-1}(e):void 0}},135:function(e,t,n){"use strict";const r=e=>"number"==typeof e;e.exports=e=>{const{lineNumber:t,columnNumber:n}=e;if(r(t)&&r(n))return[t,n];const o=e.stack.indexOf(">"),s=e.stack.slice(o+1),u=s.indexOf(")"),c=s.slice(1,u),[i,a]=c.split(":");return[Number(i),Number(a)]}},136:function(e,t,n){"use strict";const{entries:r,assign:o}=Object;e.exports=e=>{const t=[],n={},s={},u={};for(const[c,i]of r(e)){if("__settings"===c){o(u,e[c]);continue}if(c.startsWith("_"))continue;t.push(c);const[r,a]=c.split(" - ");n[r]=i,s[a]=i}return{names:t,keys:n,items:s,settings:u}}},137:function(e,t,n){"use strict";e.exports.runSelected=async(e,t,n)=>{for(const r of e)await n(t[r])}},181:function(e,t){}});
|
|
2
2
|
//# sourceMappingURL=user-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file://cloudcmd/modules/user-menu.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","18","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","117","currify","wraptile","fullstore","load","createElement","tryCatch","tryToCatch","codeFrameColumns","Images","Dialog","getUserMenu","navigate","parseError","parseUserMenu","runSelected","loadCSS","css","sourceStore","CloudCmd","Key","init","async","Promise","all","prefix","View","show","dirPath","CurrentInfo","res","fetch","source","text","error","userMenu","hide","alert","getCodeFrame","names","keys","items","settings","run","select","runUserMenu","button","className","innerText","notAppend","innerHTML","fillTemplate","size","addEventListener","onButtonClick","onDblClick","onKeyDown","autoSize","afterShow","focus","DOM","options","option","join","e","target","_ref","_ref2","keyCode","keyName","toUpperCase","preventDefault","stopPropagation","ESC","ENTER","fn","_ref3","code","message","line","column","start","highlightCode","133","menuFn","Function","134","J","K","UP","DOWN","el","selectedIndex","down","up","135","isNumber","a","lineNumber","columnNumber","before","stack","indexOf","str","after","newStr","split","Number","136","entries","assign","
|
|
1
|
+
{"version":3,"sources":["file://cloudcmd/modules/user-menu.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","18","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","117","currify","wraptile","fullstore","load","createElement","tryCatch","tryToCatch","codeFrameColumns","Images","Dialog","getUserMenu","navigate","parseError","parseUserMenu","runSelected","loadCSS","css","sourceStore","CloudCmd","Key","init","async","Promise","all","prefix","View","show","dirPath","CurrentInfo","res","fetch","source","text","error","userMenu","hide","alert","getCodeFrame","names","keys","items","settings","run","select","runUserMenu","button","className","innerText","notAppend","innerHTML","fillTemplate","size","addEventListener","onButtonClick","onDblClick","onKeyDown","autoSize","afterShow","focus","DOM","options","option","join","e","target","_ref","_ref2","keyCode","keyName","toUpperCase","preventDefault","stopPropagation","ESC","ENTER","fn","_ref3","code","message","line","column","start","highlightCode","133","menuFn","Function","134","J","K","UP","DOWN","el","selectedIndex","down","up","135","isNumber","a","lineNumber","columnNumber","before","stack","indexOf","str","after","newStr","split","Number","136","entries","assign","startsWith","137","selectedItems","selected","181"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDH,EAA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ACRC,EAAO,GACPC,EAAQ,GACRC,EAAW,GAEjB,IAAK,MAAO6D,EAAK5B,KAAOkC,EAAQ1E,GAAW,CACzC,GAAY,eAARoE,EAAsB,CACxBO,EAAOpE,EAAUP,EAASoE,IAC1B,SAGF,GAAIA,EAAIQ,WAAW,KACjB,SAGFxE,EAAMtF,KAAKsJ,GACX,MAAOjH,EAAKf,GAAQgI,EAAIG,MAAM,OAC9BlE,EAAKlD,GAAOqF,EACZlC,EAAMlE,GAAQoG,EAGhB,MAAO,CACLpC,QACAC,OACAC,QACAC,cAMEsE,IACA,SAAU9I,EAAQD,EAASJ,GAEjC,aAGAK,EAAOD,QAAQ8C,YAAcO,MAAO2F,EAAexE,EAAOI,KACxD,IAAK,MAAMqE,KAAYD,QACfpE,EAAYJ,EAAMyE,MAMtBC,IACA,SAAUjJ,EAAQD","file":"./modules/user-menu.js","sourceRoot":""}
|
package/dist/sw.js
CHANGED
|
@@ -5,5 +5,5 @@ var serviceWorkerOption = {
|
|
|
5
5
|
]
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";const r=n(1),o=n(2),i=o((t,e)=>e.waitUntil(t())),c=o((t,e)=>{const{request:n}=e,{url:r}=n,o=u(r)
|
|
8
|
+
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";const r=n(1),o=n(2),i=o((t,e)=>e.waitUntil(t())),c=o((t,e)=>{const{request:n}=e,{url:r}=n,o=u(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(o.startsWith("/api")||/^socket.io/.test(o)||e.respondWith(t(e)))}),u=t=>new URL(t).pathname,a="cloudcmd: Thu May 12 2022 14:45:07 GMT+0300 (Eastern European Summer Time)",s=(t,e)=>"/"!==t?e:(t=>new Request(t,{credentials:"same-origin"}))("/");self.addEventListener("install",i((async function(){console.info("cloudcmd: sw: install: "+a),await self.skipWaiting()}))),self.addEventListener("fetch",c((async function(t){const{request:e}=t,{url:n}=e,o=u(n),i=s(o,t.request),c=await caches.open(a),f=await c.match(e);if(f)return f;const[l,d]=await r(fetch,i,{credentials:"same-origin"});return l?new Response(l.message):(await async function(t,e){return(await caches.open(a)).put(t,e)}(e,d.clone()),d)}))),self.addEventListener("activate",i((async function(){console.info("cloudcmd: sw: activate: "+a),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))})))},function(t,e,n){"use strict";t.exports=async(t,...e)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...e)]}catch(t){return[t]}}},function(t,e,n){"use strict";const r=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const n=(...n)=>r(t,...e,...n),o=t.length-e.length-1;return(t=>[function(e){return t(...arguments)},function(e,n){return t(...arguments)},function(e,n,r){return t(...arguments)},function(e,n,r,o){return t(...arguments)},function(e,n,r,o,i){return t(...arguments)}])(n)[o]||n};t.exports=r}]);
|
|
9
9
|
//# sourceMappingURL=sw.js.map
|
package/dist/sw.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file://cloudcmd/webpack/bootstrap","file://cloudcmd/client/sw/sw.js","file://cloudcmd/node_modules/try-to-catch/lib/try-to-catch.js","file://cloudcmd/node_modules/currify/lib/currify.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","tryToCatch","require","currify","wait","f","e","waitUntil","respondWith","request","url","pathname","getPathName","test","method","a","type","isBasic","URL","NAME","getRequest","Request","credentials","createRequest","self","addEventListener","async","console","info","skipWaiting","event","newRequest","cache","caches","open","response","match","resp","fetch","Response","message","put","addToCache","clone","clients","claim","keys","deleteCache","delete","Promise","all","map","fn","args","Error","check","length","again","args2","count","arguments","b"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,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OAvCXb,KAAKC,iBAAiB,WAAYrB,GAElCsB,iBACIC,QAAQC,KAAM,2BAA0BT,SAElCK,KAAKoB,QAAQC,QACnB,MAAMC,QAAab,OAAOa,OACpBC,EAAcd,OAAOe,OAAOvD,KAAKwC,cAEjCgB,QAAQC,IAAIJ,EAAKK,IAAIJ,S,6BC5D/B/E,EAAOD,QAAU2D,MAAO0B,KAAOC,MAU/B,SAAeD,GACX,GAAkB,mBAAPA,EACP,MAAME,MAAM,4BAXhBC,CAAMH,GAEN,IACI,MAAO,CAAC,WAAYA,KAAMC,IAC5B,MAAM/C,GACJ,MAAO,CAACA,M,6BCNhB,MASMH,EAAU,CAACiD,KAAOC,KAGpB,GAeJ,SAAeD,GACX,GAAkB,mBAAPA,EACP,MAAME,MAAM,0BAnBhBC,CAAMH,GAEFC,EAAKG,QAAUJ,EAAGI,OAClB,OAAOJ,KAAMC,GAEjB,MAAMI,EAAQ,IAAIC,IACPvD,EAAQiD,KAAWC,KAASK,GAGjCC,EAAQP,EAAGI,OAASH,EAAKG,OAAS,EAGxC,MAtBM,CAACJ,GAAO,CAEd,SAAUrC,GAAI,OAAOqC,KAAMQ,YAC3B,SAAU7C,EAAG8C,GAAI,OAAOT,KAAMQ,YAC9B,SAAU7C,EAAG8C,EAAGvF,GAAI,OAAO8E,KAAMQ,YACjC,SAAU7C,EAAG8C,EAAGvF,EAAGC,GAAI,OAAO6E,KAAMQ,YACpC,SAAU7C,EAAG8C,EAAGvF,EAAGC,EAAG+B,GAAI,OAAO8C,KAAMQ,aAc1BvD,CAAEoD,GAAOE,IAEPF,GAGnBzF,EAAOD,QAAUoC","file":"sw.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","'use strict';\n\nconst codegen = require('codegen.macro');\nconst tryToCatch = require('try-to-catch');\nconst currify = require('currify');\n\nconst isDev = process.env.NODE_ENV === 'development';\n\nconst isGet = (a) => a.method === 'GET';\nconst isBasic = (a) => a.type === 'basic';\n\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {request} = e;\n const {url} = request;\n const pathname = getPathName(url);\n \n if (/\\/$/.test(url) || /\\^\\/fs/.test(pathname))\n return;\n \n if (!isGet(request))\n return;\n \n if (!isBasic(request))\n return;\n \n if (/^\\/api/.test(pathname))\n return;\n \n if (/^socket.io/.test(pathname))\n return;\n \n e.respondWith(f(e));\n});\n\nconst getPathName = (url) => new URL(url).pathname;\n\nconst date = codegen`module.exports = '\"' + Date() + '\"'`;\nconst NAME = `cloudcmd: ${date}`;\n\nconst createRequest = (a) => new Request(a, {\n credentials: 'same-origin',\n});\n\nconst getRequest = (a, request) => {\n if (a !== '/')\n return request;\n \n return createRequest('/');\n};\n\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\n\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n \n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n \n await Promise.all(keys.map(deleteCache));\n}\n\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n \n await self.skipWaiting();\n}\n\nasync function onFetch(event) {\n const {request} = event;\n const {url} = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n \n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n \n if (!isDev && response)\n return response;\n \n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin',\n });\n \n if (e)\n return new Response(e.message);\n \n await addToCache(request, resp.clone());\n \n return resp;\n}\n\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n","'use strict';\n\nmodule.exports = async (fn, ...args) => {\n check(fn);\n \n try {\n return [null, await fn(...args)];\n } catch(e) {\n return [e];\n }\n};\n\nfunction check(fn) {\n if (typeof fn !== 'function')\n throw Error('fn should be a function!');\n}\n\n","'use strict';\n\nconst f = (fn) => [\n /*eslint no-unused-vars: 0*/\n function (a) {return fn(...arguments);},\n function (a, b) {return fn(...arguments);},\n function (a, b, c) {return fn(...arguments);},\n function (a, b, c, d) {return fn(...arguments);},\n function (a, b, c, d, e) {return fn(...arguments);},\n];\n\nconst currify = (fn, ...args) => {\n check(fn);\n \n if (args.length >= fn.length)\n return fn(...args);\n \n const again = (...args2) => {\n return currify(fn, ...[...args, ...args2]);\n };\n \n const count = fn.length - args.length - 1;\n const func = f(again)[count];\n \n return func || again;\n};\n\nmodule.exports = currify;\n\nfunction check(fn) {\n if (typeof fn !== 'function')\n throw Error('fn should be function!');\n}\n\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["file://cloudcmd/webpack/bootstrap","file://cloudcmd/client/sw/sw.js","file://cloudcmd/node_modules/try-to-catch/lib/try-to-catch.js","file://cloudcmd/node_modules/currify/lib/currify.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","tryToCatch","require","currify","wait","f","e","waitUntil","respondWith","request","url","pathname","getPathName","endsWith","test","method","a","type","isBasic","startsWith","URL","NAME","getRequest","Request","credentials","createRequest","self","addEventListener","async","console","info","skipWaiting","event","newRequest","cache","caches","open","response","match","resp","fetch","Response","message","put","addToCache","clone","clients","claim","keys","deleteCache","delete","Promise","all","map","fn","args","Error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AE/B,aADoBF,OAAOC,KAAKf,IACnBsB,IAAIlC,EAAS4B,GAPpBO,CAAWnC,EAAS8B,EAAKM,SAExBN,OAvCXb,KAAKC,iBAAiB,WAAYvB,GAElCwB,iBACIC,QAAQC,KAAM,2BAA0BT,SAElCK,KAAKoB,QAAQC,QACnB,MAAMC,QAAab,OAAOa,OACpBC,EAAcd,OAAOe,OAAOzD,KAAK0C,cAEjCgB,QAAQC,IAAIJ,EAAKK,IAAIJ,S,6BC5D/BjF,EAAOD,QAAU6D,MAAO0B,KAAOC,MAU/B,SAAeD,GACX,GAAkB,mBAAPA,EACP,MAAME,MAAM,4BAXhBC,CAAMH,GAEN,IACI,MAAO,CAAC,WAAYA,KAAMC,IAC5B,MAAMjD,GACJ,MAAO,CAACA,M,6BCNhB,MASMH,EAAU,CAACmD,KAAOC,KAGpB,GAeJ,SAAeD,GACX,GAAkB,mBAAPA,EACP,MAAME,MAAM,0BAnBhBC,CAAMH,GAEFC,EAAKG,QAAUJ,EAAGI,OAClB,OAAOJ,KAAMC,GAEjB,MAAMI,EAAQ,IAAIC,IACPzD,EAAQmD,KAAWC,KAASK,GAGjCC,EAAQP,EAAGI,OAASH,EAAKG,OAAS,EAGxC,MAtBM,CAACJ,GAAO,CAEd,SAAUtC,GAAI,OAAOsC,KAAMQ,YAC3B,SAAU9C,EAAG+C,GAAI,OAAOT,KAAMQ,YAC9B,SAAU9C,EAAG+C,EAAGzF,GAAI,OAAOgF,KAAMQ,YACjC,SAAU9C,EAAG+C,EAAGzF,EAAGC,GAAI,OAAO+E,KAAMQ,YACpC,SAAU9C,EAAG+C,EAAGzF,EAAGC,EAAG+B,GAAI,OAAOgD,KAAMQ,aAc1BzD,CAAEsD,GAAOE,IAEPF,GAGnB3F,EAAOD,QAAUoC","file":"sw.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","'use strict';\n\nconst codegen = require('codegen.macro');\nconst tryToCatch = require('try-to-catch');\nconst currify = require('currify');\n\nconst isDev = process.env.NODE_ENV === 'development';\n\nconst isGet = (a) => a.method === 'GET';\nconst isBasic = (a) => a.type === 'basic';\n\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {request} = e;\n const {url} = request;\n const pathname = getPathName(url);\n \n if (url.endsWith('/') || /\\^\\/fs/.test(pathname))\n return;\n \n if (!isGet(request))\n return;\n \n if (!isBasic(request))\n return;\n \n if (pathname.startsWith('/api'))\n return;\n \n if (/^socket.io/.test(pathname))\n return;\n \n e.respondWith(f(e));\n});\n\nconst getPathName = (url) => new URL(url).pathname;\n\nconst date = codegen`module.exports = '\"' + Date() + '\"'`;\nconst NAME = `cloudcmd: ${date}`;\n\nconst createRequest = (a) => new Request(a, {\n credentials: 'same-origin',\n});\n\nconst getRequest = (a, request) => {\n if (a !== '/')\n return request;\n \n return createRequest('/');\n};\n\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\n\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n \n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n \n await Promise.all(keys.map(deleteCache));\n}\n\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n \n await self.skipWaiting();\n}\n\nasync function onFetch(event) {\n const {request} = event;\n const {url} = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n \n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n \n if (!isDev && response)\n return response;\n \n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin',\n });\n \n if (e)\n return new Response(e.message);\n \n await addToCache(request, resp.clone());\n \n return resp;\n}\n\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n","'use strict';\n\nmodule.exports = async (fn, ...args) => {\n check(fn);\n \n try {\n return [null, await fn(...args)];\n } catch(e) {\n return [e];\n }\n};\n\nfunction check(fn) {\n if (typeof fn !== 'function')\n throw Error('fn should be a function!');\n}\n\n","'use strict';\n\nconst f = (fn) => [\n /*eslint no-unused-vars: 0*/\n function (a) {return fn(...arguments);},\n function (a, b) {return fn(...arguments);},\n function (a, b, c) {return fn(...arguments);},\n function (a, b, c, d) {return fn(...arguments);},\n function (a, b, c, d, e) {return fn(...arguments);},\n];\n\nconst currify = (fn, ...args) => {\n check(fn);\n \n if (args.length >= fn.length)\n return fn(...args);\n \n const again = (...args2) => {\n return currify(fn, ...[...args, ...args2]);\n };\n \n const count = fn.length - args.length - 1;\n const func = f(again)[count];\n \n return func || again;\n};\n\nmodule.exports = currify;\n\nfunction check(fn) {\n if (typeof fn !== 'function')\n throw Error('fn should be function!');\n}\n\n"],"sourceRoot":""}
|
|
@@ -80,7 +80,7 @@ eval("\n\nlet list = [];\n\nmodule.exports.add = (el, name, fn) => {\n list.pus
|
|
|
80
80
|
/***/ (function(module, exports, __webpack_require__) {
|
|
81
81
|
|
|
82
82
|
"use strict";
|
|
83
|
-
eval("\n\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\n\nconst EventStore = __webpack_require__(/*! ./event-store */ \"./client/dom/events/event-store.js\");\n\nmodule.exports = new EventsProto();\n\nfunction EventsProto() {\n const Events = this;\n\n const getEventOptions = eventName => {\n if (eventName !== 'touchstart') return false;\n return {\n passive: true\n };\n };\n\n function parseArgs(eventName, element, listener, callback) {\n let isFunc;\n const args = [eventName, element, listener, callback];\n const EVENT_NAME = 1;\n const ELEMENT = 0;\n const type = itype(eventName);\n\n switch (type) {\n default:\n if (
|
|
83
|
+
eval("\n\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\n\nconst EventStore = __webpack_require__(/*! ./event-store */ \"./client/dom/events/event-store.js\");\n\nmodule.exports = new EventsProto();\n\nfunction EventsProto() {\n const Events = this;\n\n const getEventOptions = eventName => {\n if (eventName !== 'touchstart') return false;\n return {\n passive: true\n };\n };\n\n function parseArgs(eventName, element, listener, callback) {\n let isFunc;\n const args = [eventName, element, listener, callback];\n const EVENT_NAME = 1;\n const ELEMENT = 0;\n const type = itype(eventName);\n\n switch (type) {\n default:\n if (!type.endsWith('element')) throw Error('unknown eventName: ' + type);\n parseArgs(args[EVENT_NAME], args[ELEMENT], listener, callback);\n break;\n\n case 'string':\n isFunc = itype.function(element);\n\n if (isFunc) {\n listener = element;\n element = null;\n }\n\n if (!element) element = window;\n callback(element, [eventName, listener, getEventOptions(eventName)]);\n break;\n\n case 'array':\n for (const name of eventName) {\n parseArgs(name, element, listener, callback);\n }\n\n break;\n\n case 'object':\n for (const name of Object.keys(eventName)) {\n const eventListener = eventName[name];\n parseArgs(name, element, eventListener, callback);\n }\n\n break;\n }\n }\n /**\n * safe add event listener\n *\n * @param type\n * @param element {document by default}\n * @param listener\n */\n\n\n this.add = (type, element, listener) => {\n checkType(type);\n parseArgs(type, element, listener, (element, args) => {\n const [name, fn, options] = args;\n element.addEventListener(name, fn, options);\n EventStore.add(element, name, fn);\n });\n return Events;\n };\n /**\n * safe add event listener\n *\n * @param type\n * @param listener\n * @param element {document by default}\n */\n\n\n this.addOnce = (type, element, listener) => {\n const once = event => {\n Events.remove(type, element, once);\n listener(event);\n };\n\n if (!listener) {\n listener = element;\n element = null;\n }\n\n this.add(type, element, once);\n return Events;\n };\n /**\n * safe remove event listener\n *\n * @param type\n * @param listener\n * @param element {document by default}\n */\n\n\n this.remove = (type, element, listener) => {\n checkType(type);\n parseArgs(type, element, listener, (element, args) => {\n element.removeEventListener(...args);\n });\n return Events;\n };\n /**\n * remove all added event listeners\n *\n * @param listener\n */\n\n\n this.removeAll = () => {\n const events = EventStore.get();\n\n for (const [el, name, fn] of events) el.removeEventListener(name, fn);\n\n EventStore.clear();\n };\n /**\n * safe add event keydown listener\n *\n * @param listener\n */\n\n\n this.addKey = function () {\n const name = 'keydown';\n\n for (var _len = arguments.length, argsArr = new Array(_len), _key = 0; _key < _len; _key++) {\n argsArr[_key] = arguments[_key];\n }\n\n const args = [name, ...argsArr];\n return Events.add(...args);\n };\n /**\n * safe remove event click listener\n *\n * @param listener\n */\n\n\n this.rmKey = function () {\n const name = 'keydown';\n\n for (var _len2 = arguments.length, argsArr = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n argsArr[_key2] = arguments[_key2];\n }\n\n const args = [name, ...argsArr];\n return Events.remove(...args);\n };\n /**\n * safe add event click listener\n *\n * @param listener\n */\n\n\n this.addClick = function () {\n const name = 'click';\n\n for (var _len3 = arguments.length, argsArr = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n argsArr[_key3] = arguments[_key3];\n }\n\n const args = [name, ...argsArr];\n return Events.add(...args);\n };\n /**\n * safe remove event click listener\n *\n * @param listener\n */\n\n\n this.rmClick = function () {\n const name = 'click';\n\n for (var _len4 = arguments.length, argsArr = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n argsArr[_key4] = arguments[_key4];\n }\n\n const args = [name, ...argsArr];\n return Events.remove(...args);\n };\n\n this.addContextMenu = function () {\n const name = 'contextmenu';\n\n for (var _len5 = arguments.length, argsArr = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n argsArr[_key5] = arguments[_key5];\n }\n\n const args = [name, ...argsArr];\n return Events.add(...args);\n };\n /**\n * safe add event click listener\n *\n * @param listener\n */\n\n\n this.addError = function () {\n const name = 'error';\n\n for (var _len6 = arguments.length, argsArr = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n argsArr[_key6] = arguments[_key6];\n }\n\n const args = [name, ...argsArr];\n return Events.add(...args);\n };\n /**\n * safe add load click listener\n *\n * @param listener\n */\n\n\n this.addLoad = function () {\n const name = 'load';\n\n for (var _len7 = arguments.length, argsArr = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n argsArr[_key7] = arguments[_key7];\n }\n\n const args = [name, ...argsArr];\n return Events.add(...args);\n };\n\n function checkType(type) {\n if (!type) throw Error('type could not be empty!');\n }\n}\n\n//# sourceURL=file://cloudcmd/client/dom/events/index.js");
|
|
84
84
|
|
|
85
85
|
/***/ }),
|
|
86
86
|
|
|
@@ -92,7 +92,7 @@ eval("\n\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/
|
|
|
92
92
|
/***/ (function(module, exports, __webpack_require__) {
|
|
93
93
|
|
|
94
94
|
"use strict";
|
|
95
|
-
eval("\n/* global CloudCmd */\n\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\n\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\n\nconst load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\n\nconst RESTful = __webpack_require__(/*! ./rest */ \"./client/dom/rest.js\");\n\nconst Promises = {};\nconst FILES_JSON = 'config|modules';\nconst FILES_HTML = 'file|path|link|pathLink|media';\nconst FILES_HTML_ROOT = 'view/media-tmpl|config-tmpl|upload';\nconst DIR_HTML = '/tmpl/';\nconst DIR_HTML_FS = DIR_HTML + 'fs/';\nconst DIR_JSON = '/json/';\nconst timeout = getTimeoutOnce(2000);\nmodule.exports.get = getFile;\n\nfunction getFile(name) {\n const type = itype(name);\n check(name);\n if (type === 'string') return getModule(name);\n if (type === 'array') return Promise.all(name.map(getFile));\n}\n\nfunction check(name) {\n if (!name) throw Error('name could not be empty!');\n}\n\nfunction getModule(name) {\n const regExpHTML =
|
|
95
|
+
eval("\n/* global CloudCmd */\n\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\n\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\n\nconst load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\n\nconst RESTful = __webpack_require__(/*! ./rest */ \"./client/dom/rest.js\");\n\nconst Promises = {};\nconst FILES_JSON = 'config|modules';\nconst FILES_HTML = 'file|path|link|pathLink|media';\nconst FILES_HTML_ROOT = 'view/media-tmpl|config-tmpl|upload';\nconst DIR_HTML = '/tmpl/';\nconst DIR_HTML_FS = DIR_HTML + 'fs/';\nconst DIR_JSON = '/json/';\nconst timeout = getTimeoutOnce(2000);\nmodule.exports.get = getFile;\n\nfunction getFile(name) {\n const type = itype(name);\n check(name);\n if (type === 'string') return getModule(name);\n if (type === 'array') return Promise.all(name.map(getFile));\n}\n\nfunction check(name) {\n if (!name) throw Error('name could not be empty!');\n}\n\nfunction getModule(name) {\n const regExpHTML = RegExp(FILES_HTML + '|' + FILES_HTML_ROOT);\n const regExpJSON = RegExp(FILES_JSON);\n const isHTML = regExpHTML.test(name);\n const isJSON = regExpJSON.test(name);\n if (!isHTML && !isJSON) return showError(name);\n if (name === 'config') return getConfig();\n const path = getPath(name, isHTML, isJSON);\n return getSystemFile(path);\n}\n\nfunction getPath(name, isHTML, isJSON) {\n let path;\n const regExp = RegExp(FILES_HTML_ROOT);\n const isRoot = regExp.test(name);\n\n if (isHTML) {\n if (isRoot) path = DIR_HTML + name.replace('-tmpl', '');else path = DIR_HTML_FS + name;\n path += '.hbs';\n } else if (isJSON) {\n path = DIR_JSON + name + '.json';\n }\n\n return path;\n}\n\nfunction showError(name) {\n const str = 'Wrong file name: ' + name;\n const error = Error(str);\n throw error;\n}\n\nconst getSystemFile = promisify((file, callback) => {\n const {\n prefix\n } = CloudCmd;\n if (!Promises[file]) Promises[file] = new Promise((success, error) => {\n const url = prefix + file;\n load.ajax({\n url,\n success,\n error\n });\n });\n Promises[file].then(data => {\n callback(null, data);\n }, error => {\n Promises[file] = null;\n callback(error);\n });\n});\n\nconst getConfig = async () => {\n let is;\n if (!Promises.config) Promises.config = () => {\n is = true;\n return RESTful.Config.read();\n };\n const [, data] = await Promises.config();\n if (data) is = false;\n timeout(() => {\n if (!is) Promises.config = null;\n });\n return data;\n};\n\nfunction getTimeoutOnce(time) {\n let is;\n return callback => {\n if (is) return;\n is = true;\n setTimeout(() => {\n is = false;\n callback();\n }, time);\n };\n}\n\n//# sourceURL=file://cloudcmd/client/dom/files.js");
|
|
96
96
|
|
|
97
97
|
/***/ }),
|
|
98
98
|
|
|
@@ -211,7 +211,7 @@ eval("\n\nconst isNumber = a => typeof a === 'number';\n\nmodule.exports = error
|
|
|
211
211
|
/***/ (function(module, exports, __webpack_require__) {
|
|
212
212
|
|
|
213
213
|
"use strict";
|
|
214
|
-
eval("\n\nconst {\n entries,\n assign\n} = Object;\n\nmodule.exports = userMenu => {\n const names = [];\n const keys = {};\n const items = {};\n const settings = {};\n\n for (const [str, fn] of entries(userMenu)) {\n if (str === '__settings') {\n assign(settings, userMenu[str]);\n continue;\n }\n\n if (
|
|
214
|
+
eval("\n\nconst {\n entries,\n assign\n} = Object;\n\nmodule.exports = userMenu => {\n const names = [];\n const keys = {};\n const items = {};\n const settings = {};\n\n for (const [str, fn] of entries(userMenu)) {\n if (str === '__settings') {\n assign(settings, userMenu[str]);\n continue;\n }\n\n if (str.startsWith('_')) {\n continue;\n }\n\n names.push(str);\n const [key, name] = str.split(' - ');\n keys[key] = fn;\n items[name] = fn;\n }\n\n return {\n names,\n keys,\n items,\n settings\n };\n};\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/parse-user-menu.js");
|
|
215
215
|
|
|
216
216
|
/***/ }),
|
|
217
217
|
|
package/dist-dev/sw.js
CHANGED
|
@@ -101,7 +101,7 @@ var serviceWorkerOption = {
|
|
|
101
101
|
/***/ (function(module, exports, __webpack_require__) {
|
|
102
102
|
|
|
103
103
|
"use strict";
|
|
104
|
-
eval("\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst isDev = \"development\" === 'development';\n\nconst isGet = a => a.method === 'GET';\n\nconst isBasic = a => a.type === 'basic';\n\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (
|
|
104
|
+
eval("\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst isDev = \"development\" === 'development';\n\nconst isGet = a => a.method === 'GET';\n\nconst isBasic = a => a.type === 'basic';\n\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\n\nconst getPathName = url => new URL(url).pathname;\n\nconst date = \"Thu May 12 2022 14:45:15 GMT+0300 (Eastern European Summer Time)\";\nconst NAME = `cloudcmd: ${date}`;\n\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\n\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\n\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\n\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\n\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\n}\n\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\n\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/sw.js");
|
|
105
105
|
|
|
106
106
|
/***/ }),
|
|
107
107
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcmd",
|
|
3
|
-
"version": "16.1.
|
|
3
|
+
"version": "16.1.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "File manager for the web with console and editor",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"deepmerge": "^4.0.0",
|
|
97
97
|
"deepword": "^8.0.0",
|
|
98
98
|
"dword": "^14.0.0",
|
|
99
|
-
"edward": "^
|
|
99
|
+
"edward": "^14.0.0",
|
|
100
100
|
"es6-promisify": "^7.0.0",
|
|
101
101
|
"execon": "^1.2.0",
|
|
102
102
|
"express": "^4.13.0",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"package-json": "^7.0.0",
|
|
122
122
|
"ponse": "^7.0.0",
|
|
123
123
|
"pullout": "^4.0.0",
|
|
124
|
-
"putout": "^
|
|
124
|
+
"putout": "^26.0.1",
|
|
125
125
|
"redzip": "^2.0.0",
|
|
126
126
|
"rendy": "^3.0.0",
|
|
127
127
|
"restafary": "^11.0.0",
|
package/server/rest/index.js
CHANGED
|
@@ -87,7 +87,7 @@ function rest(config, request, response) {
|
|
|
87
87
|
*/
|
|
88
88
|
function sendData(params, config, callback) {
|
|
89
89
|
const p = params;
|
|
90
|
-
const isMD =
|
|
90
|
+
const isMD = p.name.startsWith('/markdown');
|
|
91
91
|
const rootDir = config('root');
|
|
92
92
|
|
|
93
93
|
if (isMD)
|
|
@@ -122,7 +122,7 @@ function onGET(params, config, callback) {
|
|
|
122
122
|
if (p.name[0] === '/')
|
|
123
123
|
cmd = p.name.replace('/', '');
|
|
124
124
|
|
|
125
|
-
if (
|
|
125
|
+
if (cmd.startsWith('pack')) {
|
|
126
126
|
cmd = cmd.replace(/^pack/, '');
|
|
127
127
|
streamPack(root(cmd, rootDir), p.response, packer);
|
|
128
128
|
return;
|