cloudcmd 19.21.0 → 19.21.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 +5 -0
- package/HELP.md +2 -1
- package/README.md +1 -1
- package/dist/sw.js +1 -1
- package/dist-dev/sw.js +1 -1
- package/package.json +1 -1
- package/server/cloudcmd.js +12 -0
package/ChangeLog
CHANGED
package/HELP.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Cloud Commander v19.21.
|
|
1
|
+
# Cloud Commander v19.21.1
|
|
2
2
|
|
|
3
3
|
### [Main][MainURL] [Blog][BlogURL] [Demo][DemoURL] [Deploy](#deploy)
|
|
4
4
|
|
|
@@ -1122,6 +1122,7 @@ There are a lot of ways to be involved in `Cloud Commander` development:
|
|
|
1122
1122
|
|
|
1123
1123
|
## Version history
|
|
1124
1124
|
|
|
1125
|
+
- *2026.09.29*, **[v19.21.1](//github.com/coderaiser/cloudcmd/releases/tag/v19.21.1)**
|
|
1125
1126
|
- *2026.09.18*, **[v19.21.0](//github.com/coderaiser/cloudcmd/releases/tag/v19.21.0)**
|
|
1126
1127
|
- *2026.09.16*, **[v19.20.8](//github.com/coderaiser/cloudcmd/releases/tag/v19.20.8)**
|
|
1127
1128
|
- *2026.09.16*, **[v19.20.7](//github.com/coderaiser/cloudcmd/releases/tag/v19.20.7)**
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Cloud Commander v19.21.
|
|
1
|
+
# Cloud Commander v19.21.1 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL] [![Deploy on InstaPods][DeployInstaPodsIMG]][DeployInstaPodsURL]
|
|
2
2
|
|
|
3
3
|
### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL]
|
|
4
4
|
|
package/dist/sw.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{var t={4299(t){"use strict";let e=(t,...n)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),n.length>=t.length)return t(...n);let r=(...r)=>e(t,...n,...r);return[function(t){return r(...arguments)},function(t,e){return r(...arguments)},function(t,e,n){return r(...arguments)},function(t,e,n,i){return r(...arguments)},function(t,e,n,i,o){return r(...arguments)}][t.length-n.length-1]||r};t.exports=e},5606(t){var e,n,r,i=t.exports={};function o(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}function c(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}var
|
|
1
|
+
(()=>{var t={4299(t){"use strict";let e=(t,...n)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),n.length>=t.length)return t(...n);let r=(...r)=>e(t,...n,...r);return[function(t){return r(...arguments)},function(t,e){return r(...arguments)},function(t,e,n){return r(...arguments)},function(t,e,n,i){return r(...arguments)},function(t,e,n,i,o){return r(...arguments)}][t.length-n.length-1]||r};t.exports=e},5606(t){var e,n,r,i=t.exports={};function o(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}function c(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}var u=[],s=!1,l=-1;function f(){s&&r&&(s=!1,r.length?u=r.concat(u):l=-1,u.length&&h())}function h(){if(!s){var t=c(f);s=!0;for(var e=u.length;e;){for(r=u,u=[];++l<e;)r&&r[l].run();l=-1,e=u.length}r=null,s=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new d(t,e)),1!==u.length||s||c(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}(()=>{"use strict";n(5606);let t=async(t,...e)=>{var n=t;if("function"!=typeof n)throw Error("fn should be a function!");try{return[null,await t(...e)]}catch(t){return[t]}};var e=n(4299);let r=e((t,e)=>e.waitUntil(t())),i=e((t,e)=>{let{request:n}=e,{url:r}=n,i=o(r);r.endsWith("/")||/\^\/fs/.test(i)||"GET"===n.method&&("basic"!==n.type||i.startsWith("/api")||/^socket.io/.test(i)||e.respondWith(t(e)))}),o=t=>new URL(t).pathname,a="cloudcmd: Tue Sep 29 2026 08:57:04 GMT+0300 (Eastern European Summer Time)";async function c(){console.info(`cloudcmd: sw: activate: ${a}`),await globalThis.clients.claim();let t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))}async function u(e){var n,r;let{request:i}=e,{url:c}=i,u=(n=o(c),r=e.request,"/"!==n?r:new Request("/",{credentials:"same-origin"})),l=await caches.open(a),f=await l.match(i);if(f)return f;let[h,d]=await t(fetch,u,{credentials:"same-origin"});return h?new Response(h.message):(await s(i,d.clone()),d)}async function s(t,e){return(await caches.open(a)).put(t,e)}globalThis.addEventListener("install",r(async function t(){console.info(`cloudcmd: sw: install: ${a}`),await globalThis.skipWaiting()})),globalThis.addEventListener("fetch",i(u)),globalThis.addEventListener("activate",r(c))})()})();
|
|
2
2
|
//# sourceMappingURL=sw.js.map
|
package/dist-dev/sw.js
CHANGED
|
@@ -23,7 +23,7 @@ eval("{// shim for using process in browser\nvar process = module.exports = {};\
|
|
|
23
23
|
\*************************/
|
|
24
24
|
(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
"use strict";
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* import */ var node_process__rspack_import_0 = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* import */ var try_to_catch__rspack_import_1 = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* import */ var currify__rspack_import_2 = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__rspack_import_2((f, e) => e.waitUntil(f()));\nconst respondWith = currify__rspack_import_2((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 = \"
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* import */ var node_process__rspack_import_0 = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* import */ var try_to_catch__rspack_import_1 = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* import */ var currify__rspack_import_2 = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__rspack_import_2((f, e) => e.waitUntil(f()));\nconst respondWith = currify__rspack_import_2((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 Sep 29 2026 08:57:06 GMT+0300 (Eastern European Summer 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};\nglobalThis.addEventListener('install', wait(onInstall));\nglobalThis.addEventListener('fetch', respondWith(onFetch));\nglobalThis.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await globalThis.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 globalThis.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 (0,try_to_catch__rspack_import_1.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//Users/coderaiser/cloudcmd/client/sw/sw.js\n}");
|
|
27
27
|
|
|
28
28
|
},
|
|
29
29
|
"./node_modules/try-to-catch/lib/try-to-catch.js"
|
package/package.json
CHANGED
package/server/cloudcmd.js
CHANGED
|
@@ -186,6 +186,11 @@ function listen({prefixSocket, socket, config}) {
|
|
|
186
186
|
distributeExport(config, socket);
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
+
function cutPrefix(prefix, req, next) {
|
|
190
|
+
req.url = req.url.replace(prefix, '') || '/';
|
|
191
|
+
next();
|
|
192
|
+
}
|
|
193
|
+
|
|
189
194
|
function cloudcmdMiddle({modules, config}) {
|
|
190
195
|
const online = apart(config, 'online');
|
|
191
196
|
const cache = false;
|
|
@@ -200,8 +205,15 @@ function cloudcmdMiddle({modules, config}) {
|
|
|
200
205
|
|
|
201
206
|
const dropbox = config('dropbox');
|
|
202
207
|
const dropboxToken = config('dropboxToken');
|
|
208
|
+
const prefix = prefixer(config('prefix'));
|
|
203
209
|
|
|
204
210
|
const funcs = clean([
|
|
211
|
+
prefix && ((req, res, next) => {
|
|
212
|
+
if (!req.url.startsWith(prefix))
|
|
213
|
+
return next();
|
|
214
|
+
|
|
215
|
+
cutPrefix(prefix, req, next);
|
|
216
|
+
}),
|
|
205
217
|
config('console') && konsole({
|
|
206
218
|
online,
|
|
207
219
|
}),
|