cloudcmd 16.9.0 → 16.9.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 CHANGED
@@ -1,3 +1,8 @@
1
+ 2023.01.18, v16.9.1
2
+
3
+ fix:
4
+ - static: user-menu: convert flac to mp3
5
+
1
6
  2023.01.17, v16.9.0
2
7
 
3
8
  feature:
package/HELP.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cloud Commander v16.9.0
1
+ # Cloud Commander v16.9.1
2
2
 
3
3
  ### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL]
4
4
 
@@ -1085,6 +1085,7 @@ There are a lot of ways to be involved in `Cloud Commander` development:
1085
1085
 
1086
1086
  ## Version history
1087
1087
 
1088
+ - *2023.01.18*, **[v16.9.1](//github.com/coderaiser/cloudcmd/releases/tag/v16.9.1)**
1088
1089
  - *2023.01.17*, **[v16.9.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.9.0)**
1089
1090
  - *2023.01.16*, **[v16.8.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.8.0)**
1090
1091
  - *2023.01.15*, **[v16.7.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.7.0)**
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cloud Commander v16.9.0 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL]
1
+ # Cloud Commander v16.9.1 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL]
2
2
 
3
3
  ### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL]
4
4
 
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);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: Tue Jan 17 2023 18:19:37 GMT+0200 (Eastern European Standard 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}]);
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=a(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)))}),a=t=>new URL(t).pathname,u="cloudcmd: Wed Jan 18 2023 11:11:47 GMT+0200 (Eastern European Standard Time)",s=(t,e)=>"/"!==t?e:(t=>new Request(t,{credentials:"same-origin"}))("/");self.addEventListener("install",i((async function(){console.info("cloudcmd: sw: install: "+u),await self.skipWaiting()}))),self.addEventListener("fetch",c((async function(t){const{request:e}=t,{url:n}=e,o=a(n),i=s(o,t.request),c=await caches.open(u),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(u)).put(t,e)}(e,d.clone()),d)}))),self.addEventListener("activate",i((async function(){console.info("cloudcmd: sw: activate: "+u),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-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\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\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});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Tue Jan 17 2023 18:19:44 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\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}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\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}\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");
104
+ eval("\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\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});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Wed Jan 18 2023 11:11:53 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\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}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\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}\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.9.0",
3
+ "version": "16.9.1",
4
4
  "type": "commonjs",
5
5
  "commitType": "colon",
6
6
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const RENAME_FILE = 'Rename file';
4
- const CDN = 'https://cdn.jsdelivr.net/gh/cloudcmd/user-menu@';
4
+ const CDN = 'https://cdn.jsdelivr.net/gh/cloudcmd/user-menu@1.1.1';
5
5
 
6
6
  module.exports = {
7
7
  '__settings': {
@@ -13,46 +13,47 @@ module.exports = {
13
13
  [`F2 - ${RENAME_FILE}`]: async ({DOM}) => {
14
14
  await DOM.renameCurrent();
15
15
  },
16
-
16
+
17
17
  'F6 - Copy URL to current file': async ({DOM}) => {
18
- const {copyURLToCurrentFile} = await import(`${CDN}@1.1.0/menu/copy-url-to-current-file.js`);
18
+ const {copyURLToCurrentFile} = await import(`${CDN}/menu/copy-url-to-current-file.js`);
19
19
  await copyURLToCurrentFile({DOM});
20
20
  },
21
-
21
+
22
22
  'R - cd /': async ({CloudCmd}) => {
23
23
  await CloudCmd.changeDir('/');
24
24
  },
25
25
  'Y - Convert YouTube to MP3': async ({CloudCmd, DOM}) => {
26
- const {convertYouTubeToMp3} = await import(`${CDN}@v1.1.0/menu/convert-youtube-to-mp3.js`);
26
+ const {convertYouTubeToMp3} = await import(`${CDN}/menu/convert-youtube-to-mp3.js`);
27
27
  await convertYouTubeToMp3({CloudCmd, DOM});
28
28
  },
29
-
29
+
30
30
  'F - Convert flac to mp3 [ffmpeg]': async ({CloudCmd, DOM}) => {
31
- const {convertFlacToMp3} = await import(`${CDN}@v1.1.0/menu/ffmpeg.js`);
31
+ const {convertFlacToMp3} = await import(`${CDN}/menu/ffmpeg.js`);
32
32
  await convertFlacToMp3({CloudCmd, DOM});
33
33
  },
34
34
  'M - Convert mpeg to mp3 [ffmpeg]': async ({CloudCmd, DOM}) => {
35
- const {convertMp4ToMp3} = await import(`${CDN}@v1.1.0/menu/ffmpeg.js`);
35
+ const {convertMp4ToMp3} = await import(`${CDN}/menu/ffmpeg.js`);
36
36
  await convertMp4ToMp3({CloudCmd, DOM});
37
37
  },
38
-
38
+
39
39
  'C - Create User Menu File': async ({DOM, CloudCmd}) => {
40
- const {Dialog} = DOM;
41
- const currentFile = DOM.getCurrentByName('.cloudcmd.menu.js')
42
-
40
+ const {
41
+ Dialog,
42
+ CurrentInfo,
43
+ } = DOM;
44
+ const currentFile = DOM.getCurrentByName('.cloudcmd.menu.js');
45
+
43
46
  if (currentFile) {
44
47
  const [cancel] = await Dialog.confirm(`Looks like file '.cloudcmd.menu.js' already exists. Overwrite?`);
45
-
48
+
46
49
  if (cancel)
47
50
  return;
48
51
  }
49
-
50
- const {CurrentInfo} = DOM;
52
+
51
53
  const {dirPath} = CurrentInfo;
52
54
  const path = `${dirPath}.cloudcmd.menu.js`;
53
55
  const {prefix} = CloudCmd;
54
-
55
-
56
+
56
57
  const data = await readDefaultMenu({prefix});
57
58
  await createDefaultMenu({
58
59
  path,
@@ -68,25 +69,25 @@ module.exports = {
68
69
  getCurrentByName,
69
70
  selectFile,
70
71
  } = DOM;
71
-
72
+
72
73
  const {
73
74
  files,
74
75
  filesPassive,
75
76
  panel,
76
77
  panelPassive,
77
78
  } = CurrentInfo;
78
-
79
+
79
80
  const names = getFilenames(files);
80
81
  const namesPassive = getFilenames(filesPassive);
81
-
82
+
82
83
  const selectedNames = compare(names, namesPassive);
83
84
  const selectedNamesPassive = compare(namesPassive, names);
84
-
85
+
85
86
  selectNames(selectedNames, panel, {
86
87
  selectFile,
87
88
  getCurrentByName,
88
89
  });
89
-
90
+
90
91
  selectNames(selectedNamesPassive, panelPassive, {
91
92
  selectFile,
92
93
  getCurrentByName,
@@ -96,19 +97,19 @@ module.exports = {
96
97
 
97
98
  async function createDefaultMenu({path, data, DOM, CloudCmd}) {
98
99
  const {IO} = DOM;
99
-
100
+
100
101
  await IO.write(path, data);
101
102
  await CloudCmd.refresh();
102
-
103
+
103
104
  DOM.setCurrentByName('.cloudcmd.menu.js');
104
-
105
+
105
106
  await CloudCmd.EditFile.show();
106
107
  }
107
108
 
108
109
  async function readDefaultMenu({prefix}) {
109
110
  const res = await fetch(`${prefix}/api/v1/user-menu/default`);
110
111
  const data = await res.text();
111
-
112
+
112
113
  return data;
113
114
  }
114
115
 
@@ -123,14 +124,14 @@ function selectNames(names, panel, {selectFile, getCurrentByName}) {
123
124
  module.exports._compare = compare;
124
125
  function compare(a, b) {
125
126
  const result = [];
126
-
127
+
127
128
  for (const el of a) {
128
129
  if (b.includes(el))
129
130
  continue;
130
-
131
+
131
132
  result.push(el);
132
133
  }
133
-
134
+
134
135
  return result;
135
136
  }
136
137