miqro 6.0.12 → 6.0.13
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/README.md +2 -1
- package/build/esm/editor/common/constants.d.ts +1 -1
- package/build/esm/editor/common/constants.js +1 -1
- package/build/esm/editor/common/constants.js.map +1 -1
- package/build/esm/editor/server.js +1 -1
- package/build/esm/editor/server.js.map +1 -1
- package/build/esm/src/bin/generate-doc.js +20 -18
- package/build/esm/src/bin/generate-doc.js.map +1 -1
- package/build/esm/src/cluster.js +4 -1
- package/build/esm/src/cluster.js.map +1 -1
- package/build/esm/src/common/arguments.d.ts +1 -0
- package/build/esm/src/common/arguments.js +11 -1
- package/build/esm/src/common/arguments.js.map +1 -1
- package/build/esm/src/common/help.d.ts +1 -1
- package/build/esm/src/common/help.js +2 -1
- package/build/esm/src/common/help.js.map +1 -1
- package/build/esm/src/services/editor.js +21 -14
- package/build/esm/src/services/editor.js.map +1 -1
- package/build/esm/src/services/utils/log.js +2 -2
- package/build/esm/src/services/utils/log.js.map +1 -1
- package/build/esm/src/services/utils/server-interface.d.ts +2 -0
- package/build/esm/src/services/utils/server-interface.js +6 -0
- package/build/esm/src/services/utils/server-interface.js.map +1 -1
- package/build/esm/src/types.d.ts +2 -0
- package/build/lib.cjs +135 -123
- package/editor/common/constants.ts +1 -1
- package/editor/http/admin/editor/style.css +1 -1
- package/editor/server.ts +1 -1
- package/package.json +4 -5
- package/sea/types.json +1 -1
- package/src/bin/generate-doc.ts +21 -18
- package/src/cluster.ts +5 -1
- package/src/common/arguments.ts +13 -1
- package/src/common/help.ts +2 -1
- package/src/services/editor.tsx +24 -16
- package/src/services/utils/log.ts +2 -2
- package/src/services/utils/server-interface.ts +6 -0
- package/src/types/miqro.d.ts +2 -0
- package/src/types.ts +2 -0
package/build/lib.cjs
CHANGED
|
@@ -32,50 +32,49 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
32
32
|
));
|
|
33
33
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
34
|
|
|
35
|
-
// node_modules/cookie/index.js
|
|
36
|
-
var
|
|
37
|
-
"node_modules/cookie/index.js"(exports2) {
|
|
35
|
+
// node_modules/cookie/dist/index.js
|
|
36
|
+
var require_dist = __commonJS({
|
|
37
|
+
"node_modules/cookie/dist/index.js"(exports2) {
|
|
38
38
|
"use strict";
|
|
39
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
39
40
|
exports2.parse = parse2;
|
|
40
41
|
exports2.serialize = serialize2;
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/;
|
|
42
|
+
var cookieNameRegExp = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/;
|
|
43
|
+
var cookieValueRegExp = /^[\u0021-\u003A\u003C-\u007E]*$/;
|
|
44
44
|
var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
|
|
45
45
|
var pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
var __toString = Object.prototype.toString;
|
|
47
|
+
var NullObject = /* @__PURE__ */ (() => {
|
|
48
|
+
const C = function() {
|
|
49
|
+
};
|
|
50
|
+
C.prototype = /* @__PURE__ */ Object.create(null);
|
|
51
|
+
return C;
|
|
52
|
+
})();
|
|
53
|
+
function parse2(str, options) {
|
|
54
|
+
const obj = new NullObject();
|
|
55
|
+
const len = str.length;
|
|
56
|
+
if (len < 2)
|
|
57
|
+
return obj;
|
|
58
|
+
const dec = options?.decode || decode;
|
|
59
|
+
let index = 0;
|
|
57
60
|
do {
|
|
58
|
-
eqIdx = str.indexOf("=", index);
|
|
59
|
-
if (eqIdx === -1)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
const eqIdx = str.indexOf("=", index);
|
|
62
|
+
if (eqIdx === -1)
|
|
63
|
+
break;
|
|
64
|
+
const colonIdx = str.indexOf(";", index);
|
|
65
|
+
const endIdx = colonIdx === -1 ? len : colonIdx;
|
|
66
|
+
if (eqIdx > endIdx) {
|
|
64
67
|
index = str.lastIndexOf(";", eqIdx - 1) + 1;
|
|
65
68
|
continue;
|
|
66
69
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
valEndIdx--;
|
|
76
|
-
}
|
|
77
|
-
var val = str.slice(valStartIdx, valEndIdx);
|
|
78
|
-
obj[key] = tryDecode(val, dec);
|
|
70
|
+
const keyStartIdx = startIndex(str, index, eqIdx);
|
|
71
|
+
const keyEndIdx = endIndex(str, eqIdx, keyStartIdx);
|
|
72
|
+
const key = str.slice(keyStartIdx, keyEndIdx);
|
|
73
|
+
if (obj[key] === void 0) {
|
|
74
|
+
let valStartIdx = startIndex(str, eqIdx + 1, endIdx);
|
|
75
|
+
let valEndIdx = endIndex(str, endIdx, valStartIdx);
|
|
76
|
+
const value = dec(str.slice(valStartIdx, valEndIdx));
|
|
77
|
+
obj[key] = value;
|
|
79
78
|
}
|
|
80
79
|
index = endIdx + 1;
|
|
81
80
|
} while (index < len);
|
|
@@ -83,69 +82,67 @@ var require_cookie = __commonJS({
|
|
|
83
82
|
}
|
|
84
83
|
function startIndex(str, index, max) {
|
|
85
84
|
do {
|
|
86
|
-
|
|
87
|
-
if (code !== 32 && code !== 9)
|
|
85
|
+
const code = str.charCodeAt(index);
|
|
86
|
+
if (code !== 32 && code !== 9)
|
|
87
|
+
return index;
|
|
88
88
|
} while (++index < max);
|
|
89
89
|
return max;
|
|
90
90
|
}
|
|
91
91
|
function endIndex(str, index, min) {
|
|
92
92
|
while (index > min) {
|
|
93
|
-
|
|
94
|
-
if (code !== 32 && code !== 9)
|
|
93
|
+
const code = str.charCodeAt(--index);
|
|
94
|
+
if (code !== 32 && code !== 9)
|
|
95
|
+
return index + 1;
|
|
95
96
|
}
|
|
96
97
|
return min;
|
|
97
98
|
}
|
|
98
|
-
function serialize2(name, val,
|
|
99
|
-
|
|
100
|
-
if (typeof enc !== "function") {
|
|
101
|
-
throw new TypeError("option encode is invalid");
|
|
102
|
-
}
|
|
99
|
+
function serialize2(name, val, options) {
|
|
100
|
+
const enc = options?.encode || encodeURIComponent;
|
|
103
101
|
if (!cookieNameRegExp.test(name)) {
|
|
104
|
-
throw new TypeError(
|
|
102
|
+
throw new TypeError(`argument name is invalid: ${name}`);
|
|
105
103
|
}
|
|
106
|
-
|
|
104
|
+
const value = enc(val);
|
|
107
105
|
if (!cookieValueRegExp.test(value)) {
|
|
108
|
-
throw new TypeError(
|
|
106
|
+
throw new TypeError(`argument val is invalid: ${val}`);
|
|
109
107
|
}
|
|
110
|
-
|
|
111
|
-
if (!
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (!
|
|
115
|
-
throw new TypeError(
|
|
108
|
+
let str = name + "=" + value;
|
|
109
|
+
if (!options)
|
|
110
|
+
return str;
|
|
111
|
+
if (options.maxAge !== void 0) {
|
|
112
|
+
if (!Number.isInteger(options.maxAge)) {
|
|
113
|
+
throw new TypeError(`option maxAge is invalid: ${options.maxAge}`);
|
|
116
114
|
}
|
|
117
|
-
str += "; Max-Age=" + maxAge;
|
|
115
|
+
str += "; Max-Age=" + options.maxAge;
|
|
118
116
|
}
|
|
119
|
-
if (
|
|
120
|
-
if (!domainValueRegExp.test(
|
|
121
|
-
throw new TypeError(
|
|
117
|
+
if (options.domain) {
|
|
118
|
+
if (!domainValueRegExp.test(options.domain)) {
|
|
119
|
+
throw new TypeError(`option domain is invalid: ${options.domain}`);
|
|
122
120
|
}
|
|
123
|
-
str += "; Domain=" +
|
|
121
|
+
str += "; Domain=" + options.domain;
|
|
124
122
|
}
|
|
125
|
-
if (
|
|
126
|
-
if (!pathValueRegExp.test(
|
|
127
|
-
throw new TypeError(
|
|
123
|
+
if (options.path) {
|
|
124
|
+
if (!pathValueRegExp.test(options.path)) {
|
|
125
|
+
throw new TypeError(`option path is invalid: ${options.path}`);
|
|
128
126
|
}
|
|
129
|
-
str += "; Path=" +
|
|
127
|
+
str += "; Path=" + options.path;
|
|
130
128
|
}
|
|
131
|
-
if (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
throw new TypeError("option expires is invalid");
|
|
129
|
+
if (options.expires) {
|
|
130
|
+
if (!isDate(options.expires) || !Number.isFinite(options.expires.valueOf())) {
|
|
131
|
+
throw new TypeError(`option expires is invalid: ${options.expires}`);
|
|
135
132
|
}
|
|
136
|
-
str += "; Expires=" + expires.toUTCString();
|
|
133
|
+
str += "; Expires=" + options.expires.toUTCString();
|
|
137
134
|
}
|
|
138
|
-
if (
|
|
135
|
+
if (options.httpOnly) {
|
|
139
136
|
str += "; HttpOnly";
|
|
140
137
|
}
|
|
141
|
-
if (
|
|
138
|
+
if (options.secure) {
|
|
142
139
|
str += "; Secure";
|
|
143
140
|
}
|
|
144
|
-
if (
|
|
141
|
+
if (options.partitioned) {
|
|
145
142
|
str += "; Partitioned";
|
|
146
143
|
}
|
|
147
|
-
if (
|
|
148
|
-
|
|
144
|
+
if (options.priority) {
|
|
145
|
+
const priority = typeof options.priority === "string" ? options.priority.toLowerCase() : void 0;
|
|
149
146
|
switch (priority) {
|
|
150
147
|
case "low":
|
|
151
148
|
str += "; Priority=Low";
|
|
@@ -157,43 +154,40 @@ var require_cookie = __commonJS({
|
|
|
157
154
|
str += "; Priority=High";
|
|
158
155
|
break;
|
|
159
156
|
default:
|
|
160
|
-
throw new TypeError(
|
|
157
|
+
throw new TypeError(`option priority is invalid: ${options.priority}`);
|
|
161
158
|
}
|
|
162
159
|
}
|
|
163
|
-
if (
|
|
164
|
-
|
|
160
|
+
if (options.sameSite) {
|
|
161
|
+
const sameSite = typeof options.sameSite === "string" ? options.sameSite.toLowerCase() : options.sameSite;
|
|
165
162
|
switch (sameSite) {
|
|
166
163
|
case true:
|
|
164
|
+
case "strict":
|
|
167
165
|
str += "; SameSite=Strict";
|
|
168
166
|
break;
|
|
169
167
|
case "lax":
|
|
170
168
|
str += "; SameSite=Lax";
|
|
171
169
|
break;
|
|
172
|
-
case "strict":
|
|
173
|
-
str += "; SameSite=Strict";
|
|
174
|
-
break;
|
|
175
170
|
case "none":
|
|
176
171
|
str += "; SameSite=None";
|
|
177
172
|
break;
|
|
178
173
|
default:
|
|
179
|
-
throw new TypeError(
|
|
174
|
+
throw new TypeError(`option sameSite is invalid: ${options.sameSite}`);
|
|
180
175
|
}
|
|
181
176
|
}
|
|
182
177
|
return str;
|
|
183
178
|
}
|
|
184
179
|
function decode(str) {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
function isDate(val) {
|
|
188
|
-
return __toString.call(val) === "[object Date]";
|
|
189
|
-
}
|
|
190
|
-
function tryDecode(str, decode2) {
|
|
180
|
+
if (str.indexOf("%") === -1)
|
|
181
|
+
return str;
|
|
191
182
|
try {
|
|
192
|
-
return
|
|
183
|
+
return decodeURIComponent(str);
|
|
193
184
|
} catch (e) {
|
|
194
185
|
return str;
|
|
195
186
|
}
|
|
196
187
|
}
|
|
188
|
+
function isDate(val) {
|
|
189
|
+
return __toString.call(val) === "[object Date]";
|
|
190
|
+
}
|
|
197
191
|
}
|
|
198
192
|
});
|
|
199
193
|
|
|
@@ -202,7 +196,7 @@ var BASEEDITOR_PATH, LOG_SOCKET_PATH, LOG_WRITE_EVENT, SUPPORTED_LANGUAGES;
|
|
|
202
196
|
var init_constants = __esm({
|
|
203
197
|
"editor/common/constants.ts"() {
|
|
204
198
|
BASEEDITOR_PATH = "/admin/editor";
|
|
205
|
-
LOG_SOCKET_PATH = "/admin/socket
|
|
199
|
+
LOG_SOCKET_PATH = "/admin/socket";
|
|
206
200
|
LOG_WRITE_EVENT = "LogWrite";
|
|
207
201
|
SUPPORTED_LANGUAGES = [
|
|
208
202
|
"text",
|
|
@@ -4419,7 +4413,7 @@ var import_node_fs = require("node:fs");
|
|
|
4419
4413
|
var import_node_path = require("node:path");
|
|
4420
4414
|
|
|
4421
4415
|
// node_modules/@miqro/core/build/types.js
|
|
4422
|
-
var import_cookie2 = __toESM(
|
|
4416
|
+
var import_cookie2 = __toESM(require_dist(), 1);
|
|
4423
4417
|
var import_crypto = require("crypto");
|
|
4424
4418
|
var import_http = require("http");
|
|
4425
4419
|
|
|
@@ -5368,7 +5362,7 @@ function parsePart(req, part, value, args, mode, parser3) {
|
|
|
5368
5362
|
}
|
|
5369
5363
|
|
|
5370
5364
|
// node_modules/@miqro/core/build/middleware/session.js
|
|
5371
|
-
var import_cookie = __toESM(
|
|
5365
|
+
var import_cookie = __toESM(require_dist(), 1);
|
|
5372
5366
|
var DEFAULT_TOKEN_LOCATION = "free";
|
|
5373
5367
|
var DEFAULT_TOKEN_HEADER = "Authorization";
|
|
5374
5368
|
var DEFAULT_TOKEN_QUERY = "token";
|
|
@@ -6007,11 +6001,7 @@ function normalizePath(path) {
|
|
|
6007
6001
|
if (path.charAt(0) !== "/") {
|
|
6008
6002
|
throw new Error("path doesnt start with /");
|
|
6009
6003
|
}
|
|
6010
|
-
|
|
6011
|
-
return `${path}/`;
|
|
6012
|
-
} else {
|
|
6013
|
-
return path;
|
|
6014
|
-
}
|
|
6004
|
+
return path;
|
|
6015
6005
|
} else if (path !== "/") {
|
|
6016
6006
|
throw new Error("path of length 1 not /");
|
|
6017
6007
|
} else {
|
|
@@ -6304,9 +6294,9 @@ function routerDefaultLoggerFactory(uuid, req) {
|
|
|
6304
6294
|
} catch (e) {
|
|
6305
6295
|
urlParsingError = e;
|
|
6306
6296
|
}
|
|
6307
|
-
const pathToEnv = path.replace(/\//ig, "_").toUpperCase();
|
|
6297
|
+
const pathToEnv = path.replace(/\//ig, "_").replace(/\./ig, "_").replace(/-/ig, "_").toUpperCase();
|
|
6308
6298
|
const WORKER_IDENTIFIER = process.env["CLUSTER_NODE_NUMBER"] ? `WORKER_${process.env["CLUSTER_NODE_NUMBER"]}_` : "";
|
|
6309
|
-
const identifier = `${pathToEnv === "_" ? "" : `${pathToEnv.substring(1)}`}${method.toUpperCase()}`;
|
|
6299
|
+
const identifier = `${pathToEnv === "_" ? "" : `${pathToEnv.substring(1)}`}${pathToEnv.charAt(pathToEnv.length - 1) !== "_" ? "_" : ""}${method.toUpperCase()}`;
|
|
6310
6300
|
const upgrade = req.headers.connection?.indexOf("Upgrade") !== -1;
|
|
6311
6301
|
const logger = getLogger(`${WORKER_IDENTIFIER}${identifier}`, {
|
|
6312
6302
|
formatter: (args) => {
|
|
@@ -9268,9 +9258,9 @@ var LogProvider = class {
|
|
|
9268
9258
|
} catch (e) {
|
|
9269
9259
|
urlParsingError = e;
|
|
9270
9260
|
}
|
|
9271
|
-
const pathToEnv = path.replace(/\//ig, "_").toUpperCase();
|
|
9261
|
+
const pathToEnv = path.replace(/\//ig, "_").replace(/\./ig, "_").replace(/-/ig, "_").toUpperCase();
|
|
9272
9262
|
const WORKER_IDENTIFIER = process.env["CLUSTER_NODE_NUMBER"] ? `WORKER_${process.env["CLUSTER_NODE_NUMBER"]}_` : "";
|
|
9273
|
-
const identifier = `${pathToEnv === "_" ? "" : `${pathToEnv.substring(1)}`}${method.toUpperCase()}`;
|
|
9263
|
+
const identifier = `${pathToEnv === "_" ? "" : `${pathToEnv.substring(1)}`}${pathToEnv.charAt(pathToEnv.length - 1) !== "_" ? "_" : ""}${method.toUpperCase()}`;
|
|
9274
9264
|
const upgrade = req.headers.connection?.indexOf("Upgrade") !== -1;
|
|
9275
9265
|
const logger = this.getLogger(
|
|
9276
9266
|
`${WORKER_IDENTIFIER}${identifier}`,
|
|
@@ -13063,7 +13053,7 @@ var auth_default = {
|
|
|
13063
13053
|
// editor/server.ts
|
|
13064
13054
|
var ADMIN_EDITOR_BROWSER_OPEN_KEY = "ADMIN_EDITOR_BROWSER_OPEN_KEY$$";
|
|
13065
13055
|
var server_default = {
|
|
13066
|
-
preload:
|
|
13056
|
+
preload: (serverInterface, adminInterface) => {
|
|
13067
13057
|
if (serverInterface?.isPrimaryWorker()) {
|
|
13068
13058
|
const cache = adminInterface ? adminInterface.getCache() : serverInterface.cache;
|
|
13069
13059
|
if (!cache.has(ADMIN_EDITOR_AUTH_KEY)) {
|
|
@@ -13101,7 +13091,8 @@ var server_default = {
|
|
|
13101
13091
|
init_constants();
|
|
13102
13092
|
async function createEditorRouter(adminInterface) {
|
|
13103
13093
|
const router = new Router();
|
|
13104
|
-
|
|
13094
|
+
const innerRouter = new Router();
|
|
13095
|
+
innerRouter.use(async (req, res) => {
|
|
13105
13096
|
res.setHeader("x-uuid", req.uuid);
|
|
13106
13097
|
req.editor = adminInterface;
|
|
13107
13098
|
});
|
|
@@ -13117,14 +13108,36 @@ async function createEditorRouter(adminInterface) {
|
|
|
13117
13108
|
const reloadAPI = (await Promise.resolve().then(() => (init_reload_api(), reload_api_exports))).default;
|
|
13118
13109
|
const authHandler = SessionHandler(auth_default);
|
|
13119
13110
|
const { EditorIndex: EditorIndex2 } = await Promise.resolve().then(() => (init_editor_index(), editor_index_exports));
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
|
|
13123
|
-
|
|
13124
|
-
|
|
13125
|
-
|
|
13126
|
-
|
|
13127
|
-
|
|
13111
|
+
innerRouter.use(authHandler);
|
|
13112
|
+
innerRouter.post(`/api/fs/write`, getHandler(
|
|
13113
|
+
/*authHandler, */
|
|
13114
|
+
writeAPI
|
|
13115
|
+
));
|
|
13116
|
+
innerRouter.post(`/api/fs/rename`, getHandler(
|
|
13117
|
+
/*authHandler, */
|
|
13118
|
+
renameAPI
|
|
13119
|
+
));
|
|
13120
|
+
innerRouter.post(`/api/fs/read`, getHandler(
|
|
13121
|
+
/*authHandler, */
|
|
13122
|
+
readAPI
|
|
13123
|
+
));
|
|
13124
|
+
innerRouter.post(`/api/fs/delete`, getHandler(
|
|
13125
|
+
/*authHandler, */
|
|
13126
|
+
deleteAPI
|
|
13127
|
+
));
|
|
13128
|
+
innerRouter.get(`/api/fs/scan`, getHandler(
|
|
13129
|
+
/*authHandler, */
|
|
13130
|
+
scanAPI
|
|
13131
|
+
));
|
|
13132
|
+
innerRouter.post(`/api/server/restart`, getHandler(
|
|
13133
|
+
/*authHandler, */
|
|
13134
|
+
restartAPI
|
|
13135
|
+
));
|
|
13136
|
+
innerRouter.post(`/api/server/reload`, getHandler(
|
|
13137
|
+
/*authHandler, */
|
|
13138
|
+
reloadAPI
|
|
13139
|
+
));
|
|
13140
|
+
innerRouter.get(`/font.ttf`, async (_req, res) => {
|
|
13128
13141
|
return await res.asyncEnd({
|
|
13129
13142
|
status: 200,
|
|
13130
13143
|
headers: {
|
|
@@ -13133,10 +13146,11 @@ async function createEditorRouter(adminInterface) {
|
|
|
13133
13146
|
body: editorFont
|
|
13134
13147
|
});
|
|
13135
13148
|
});
|
|
13136
|
-
|
|
13137
|
-
|
|
13149
|
+
innerRouter.get("/", EditorIndex2(editorCSS, editorJS, false));
|
|
13150
|
+
innerRouter.use(async (req, res) => {
|
|
13138
13151
|
delete req.editor;
|
|
13139
13152
|
});
|
|
13153
|
+
router.use(innerRouter, BASEEDITOR_PATH);
|
|
13140
13154
|
return router;
|
|
13141
13155
|
}
|
|
13142
13156
|
function getHandlerOptions(router) {
|
|
@@ -13148,11 +13162,11 @@ function getHandlerOptions(router) {
|
|
|
13148
13162
|
response: router.response
|
|
13149
13163
|
};
|
|
13150
13164
|
}
|
|
13151
|
-
function getHandler(
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
|
|
13155
|
-
|
|
13165
|
+
function getHandler(router) {
|
|
13166
|
+
return {
|
|
13167
|
+
...getHandlerOptions(router),
|
|
13168
|
+
handler: router.handler
|
|
13169
|
+
};
|
|
13156
13170
|
}
|
|
13157
13171
|
|
|
13158
13172
|
// src/common/watch.ts
|
|
@@ -13425,6 +13439,12 @@ var ServerInterfaceImpl = class {
|
|
|
13425
13439
|
}
|
|
13426
13440
|
});
|
|
13427
13441
|
}
|
|
13442
|
+
getWorkerNumber() {
|
|
13443
|
+
return import_node_cluster2.default.isPrimary || process.env["CLUSTER_NODE_NUMBER"] === void 0 ? 0 : parseInt(process.env["CLUSTER_NODE_NUMBER"], 10);
|
|
13444
|
+
}
|
|
13445
|
+
getWorkerCount() {
|
|
13446
|
+
return import_node_cluster2.default.isPrimary || process.env["CLUSTER_NODE_NUMBER"] === void 0 || process.env["CLUSTER_COUNT"] === void 0 ? 1 : parseInt(process.env["CLUSTER_COUNT"], 10);
|
|
13447
|
+
}
|
|
13428
13448
|
isPrimaryWorker() {
|
|
13429
13449
|
return import_node_cluster2.default.isPrimary || process.env["CLUSTER_NODE_NUMBER"] === "0";
|
|
13430
13450
|
}
|
|
@@ -14071,14 +14091,6 @@ async function appendAPIModule(router, dir, filePath, module2) {
|
|
|
14071
14091
|
});
|
|
14072
14092
|
/*! Bundled license information:
|
|
14073
14093
|
|
|
14074
|
-
cookie/index.js:
|
|
14075
|
-
(*!
|
|
14076
|
-
* cookie
|
|
14077
|
-
* Copyright(c) 2012-2014 Roman Shtylman
|
|
14078
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
14079
|
-
* MIT Licensed
|
|
14080
|
-
*)
|
|
14081
|
-
|
|
14082
14094
|
showdown/dist/showdown.js:
|
|
14083
14095
|
(*! showdown v 2.1.0 - 21-04-2022 *)
|
|
14084
14096
|
*/
|
package/editor/server.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { EditorAdminInterface } from "./common/admin-interface.js";
|
|
|
10
10
|
const ADMIN_EDITOR_BROWSER_OPEN_KEY = "ADMIN_EDITOR_BROWSER_OPEN_KEY$$";
|
|
11
11
|
|
|
12
12
|
export default {
|
|
13
|
-
preload:
|
|
13
|
+
preload: (serverInterface: ServerInterface, adminInterface: EditorAdminInterface) => {
|
|
14
14
|
//console.dir(server);
|
|
15
15
|
if (serverInterface?.isPrimaryWorker()) {
|
|
16
16
|
const cache = (adminInterface ? adminInterface.getCache() : serverInterface.cache);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miqro",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/esm/src/lib.js",
|
|
@@ -34,23 +34,22 @@
|
|
|
34
34
|
"miqro-cluster": "build/esm/src/cluster.js"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/cookie": "^0.6.0",
|
|
38
37
|
"@types/node": "^22.10.2",
|
|
38
|
+
"@types/showdown": "2.0.6",
|
|
39
39
|
"postject": "1.0.0-alpha.6",
|
|
40
40
|
"typescript": "^5.7.2",
|
|
41
41
|
"highlight.js": "11.11.1"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@miqro/core": "^5.0.
|
|
44
|
+
"@miqro/core": "^5.0.14",
|
|
45
45
|
"@miqro/jsx": "^1.0.0",
|
|
46
46
|
"@miqro/jsx-dom": "^1.0.3",
|
|
47
|
-
"@miqro/jsx-node": "^1.0.
|
|
47
|
+
"@miqro/jsx-node": "^1.0.5",
|
|
48
48
|
"@miqro/parser": "^2.0.4",
|
|
49
49
|
"@miqro/query": "^0.0.4",
|
|
50
50
|
"@miqro/runner": "^2.0.1",
|
|
51
51
|
"@miqro/test": "^0.2.9",
|
|
52
52
|
"@miqro/test-http": "^0.1.2",
|
|
53
|
-
"@types/showdown": "2.0.6",
|
|
54
53
|
"esbuild": "0.25.4",
|
|
55
54
|
"showdown": "2.1.0"
|
|
56
55
|
}
|