cloudcmd 19.3.1 → 19.3.3

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/dist-dev/sw.js CHANGED
@@ -9,17 +9,6 @@
9
9
  /******/ (() => { // webpackBootstrap
10
10
  /******/ var __webpack_modules__ = ({
11
11
 
12
- /***/ "./client/sw/sw.js"
13
- /*!*************************!*\
14
- !*** ./client/sw/sw.js ***!
15
- \*************************/
16
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17
-
18
- "use strict";
19
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_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__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_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 Feb 03 2026 16:22:32 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};\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__WEBPACK_IMPORTED_MODULE_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}");
20
-
21
- /***/ },
22
-
23
12
  /***/ "./node_modules/currify/lib/currify.js"
24
13
  /*!*********************************************!*\
25
14
  !*** ./node_modules/currify/lib/currify.js ***!
@@ -41,6 +30,17 @@ eval("{// shim for using process in browser\nvar process = module.exports = {};\
41
30
 
42
31
  /***/ },
43
32
 
33
+ /***/ "./client/sw/sw.js"
34
+ /*!*************************!*\
35
+ !*** ./client/sw/sw.js ***!
36
+ \*************************/
37
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
38
+
39
+ "use strict";
40
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_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__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_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 = \"Thu Feb 05 2026 14:22:42 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};\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__WEBPACK_IMPORTED_MODULE_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}");
41
+
42
+ /***/ },
43
+
44
44
  /***/ "./node_modules/try-to-catch/lib/try-to-catch.js"
45
45
  /*!*******************************************************!*\
46
46
  !*** ./node_modules/try-to-catch/lib/try-to-catch.js ***!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "19.3.1",
3
+ "version": "19.3.3",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "File manager for the web with console and editor",
@@ -100,8 +100,8 @@
100
100
  "currify": "^4.0.0",
101
101
  "deepmerge": "^4.0.0",
102
102
  "deepword": "^10.0.0",
103
- "dword": "^15.0.0",
104
- "edward": "^15.0.0",
103
+ "dword": "^16.0.0",
104
+ "edward": "^16.0.0",
105
105
  "es6-promisify": "^7.0.0",
106
106
  "execon": "^1.2.0",
107
107
  "express": "^5.1.0",
@@ -133,7 +133,7 @@
133
133
  "putout": "^41.0.0",
134
134
  "redzip": "^4.0.0",
135
135
  "rendy": "^4.1.3",
136
- "restafary": "^13.0.0",
136
+ "restafary": "^13.0.1",
137
137
  "restbox": "^4.0.0",
138
138
  "shortdate": "^2.0.0",
139
139
  "simport": "^1.0.1",
@@ -232,7 +232,8 @@
232
232
  "#dom/rest": "./client/dom/rest.js",
233
233
  "#common/util": "./common/util.js",
234
234
  "#common/cloudfunc": "./common/cloudfunc.js",
235
- "#common/entity": "./common/entity.js"
235
+ "#common/entity": "./common/entity.js",
236
+ "#server/cloudcmd": "./server/cloudcmd.js"
236
237
  },
237
238
  "engines": {
238
239
  "node": ">=22"
@@ -6,11 +6,11 @@ import {fullstore} from 'fullstore';
6
6
  import currify from 'currify';
7
7
  import apart from 'apart';
8
8
  import ponse from 'ponse';
9
- import restafary from 'restafary';
9
+ import {restafary} from 'restafary';
10
10
  import restbox from 'restbox';
11
11
  import konsole from 'console-io';
12
- import edward from 'edward';
13
- import dword from 'dword';
12
+ import {edward} from 'edward';
13
+ import {dword} from 'dword';
14
14
  import deepword from 'deepword';
15
15
  import nomine from 'nomine';
16
16
  import fileop from '@cloudcmd/fileop';
@@ -48,7 +48,7 @@ const isFn = (a) => typeof a === 'function';
48
48
 
49
49
  export default cloudcmd;
50
50
 
51
- function cloudcmd(params) {
51
+ export function cloudcmd(params) {
52
52
  const p = params || {};
53
53
  const options = p.config || {};
54
54
  const config = p.configManager || createConfig({
package/server/server.js CHANGED
@@ -10,8 +10,8 @@ import {Server} from 'socket.io';
10
10
  import tryRequire from 'tryrequire';
11
11
  import wraptile from 'wraptile';
12
12
  import compression from 'compression';
13
+ import {cloudcmd} from '#server/cloudcmd';
13
14
  import exit from './exit.js';
14
- import cloudcmd from './cloudcmd.js';
15
15
 
16
16
  const bind = (f, self) => f.bind(self);
17
17