@nextcloud/files 3.9.2 → 3.10.0
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 +63 -26
- package/dist/chunks/dav-BBwoJ8WE.cjs +703 -0
- package/dist/chunks/dav-BBwoJ8WE.cjs.map +1 -0
- package/dist/chunks/dav-DxfiR0wZ.mjs +704 -0
- package/dist/chunks/dav-DxfiR0wZ.mjs.map +1 -0
- package/dist/dav.cjs +19 -0
- package/dist/dav.cjs.map +1 -0
- package/dist/dav.d.ts +370 -0
- package/dist/dav.mjs +19 -0
- package/dist/dav.mjs.map +1 -0
- package/dist/index.cjs +106 -692
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1099 -39
- package/dist/index.mjs +410 -995
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -10
- package/dist/dav/dav.d.ts +0 -56
- package/dist/dav/davPermissions.d.ts +0 -6
- package/dist/dav/davProperties.d.ts +0 -57
- package/dist/fileAction.d.ts +0 -79
- package/dist/fileListFilters.d.ts +0 -86
- package/dist/fileListHeaders.d.ts +0 -27
- package/dist/files/file.d.ts +0 -12
- package/dist/files/fileType.d.ts +0 -8
- package/dist/files/folder.d.ts +0 -18
- package/dist/files/node.d.ts +0 -166
- package/dist/files/nodeData.d.ts +0 -54
- package/dist/navigation/column.d.ts +0 -28
- package/dist/navigation/index.d.ts +0 -7
- package/dist/navigation/navigation.d.ts +0 -74
- package/dist/navigation/view.d.ts +0 -92
- package/dist/newFileMenu.d.ts +0 -66
- package/dist/permissions.d.ts +0 -16
- package/dist/utils/fileSize.d.ts +0 -25
- package/dist/utils/fileSorting.d.ts +0 -35
- package/dist/utils/filename-validation.d.ts +0 -51
- package/dist/utils/filename.d.ts +0 -24
- package/dist/utils/logger.d.ts +0 -2
- package/dist/utils/sorting.d.ts +0 -12
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { join, basename, extname, dirname } from "path";
|
|
4
|
-
import { encodePath } from "@nextcloud/paths";
|
|
5
|
-
import { generateRemoteUrl } from "@nextcloud/router";
|
|
6
|
-
import { CancelablePromise } from "cancelable-promise";
|
|
7
|
-
import { createClient, getPatcher } from "webdav";
|
|
8
|
-
import { isPublicShare, getSharingToken } from "@nextcloud/sharing/public";
|
|
1
|
+
import { o as logger } from "./chunks/dav-DxfiR0wZ.mjs";
|
|
2
|
+
import { q, F, s, N, t, P, c, l, m, n, a, g, p, b, r, d, h, f, k, j, e, i } from "./chunks/dav-DxfiR0wZ.mjs";
|
|
9
3
|
import { getCapabilities } from "@nextcloud/capabilities";
|
|
4
|
+
import { extname, basename } from "path";
|
|
10
5
|
import { getCanonicalLocale, getLanguage } from "@nextcloud/l10n";
|
|
11
6
|
import { TypedEventTarget } from "typescript-event-target";
|
|
12
|
-
const logger = getLoggerBuilder().setApp("@nextcloud/files").detectUser().build();
|
|
13
7
|
var NewMenuEntryCategory = /* @__PURE__ */ ((NewMenuEntryCategory2) => {
|
|
14
8
|
NewMenuEntryCategory2[NewMenuEntryCategory2["UploadFromDevice"] = 0] = "UploadFromDevice";
|
|
15
9
|
NewMenuEntryCategory2[NewMenuEntryCategory2["CreateNew"] = 1] = "CreateNew";
|
|
@@ -117,6 +111,9 @@ class FileAction {
|
|
|
117
111
|
get default() {
|
|
118
112
|
return this._action.default;
|
|
119
113
|
}
|
|
114
|
+
get destructive() {
|
|
115
|
+
return this._action.destructive;
|
|
116
|
+
}
|
|
120
117
|
get inline() {
|
|
121
118
|
return this._action.inline;
|
|
122
119
|
}
|
|
@@ -148,6 +145,9 @@ class FileAction {
|
|
|
148
145
|
if ("order" in action && typeof action.order !== "number") {
|
|
149
146
|
throw new Error("Invalid order");
|
|
150
147
|
}
|
|
148
|
+
if (action.destructive !== void 0 && typeof action.destructive !== "boolean") {
|
|
149
|
+
throw new Error("Invalid destructive flag");
|
|
150
|
+
}
|
|
151
151
|
if ("parent" in action && typeof action.parent !== "string") {
|
|
152
152
|
throw new Error("Invalid parent");
|
|
153
153
|
}
|
|
@@ -180,6 +180,67 @@ const getFileActions = function() {
|
|
|
180
180
|
}
|
|
181
181
|
return window._nc_fileactions;
|
|
182
182
|
};
|
|
183
|
+
class FileListAction {
|
|
184
|
+
_action;
|
|
185
|
+
constructor(action) {
|
|
186
|
+
this.validateAction(action);
|
|
187
|
+
this._action = action;
|
|
188
|
+
}
|
|
189
|
+
get id() {
|
|
190
|
+
return this._action.id;
|
|
191
|
+
}
|
|
192
|
+
get displayName() {
|
|
193
|
+
return this._action.displayName;
|
|
194
|
+
}
|
|
195
|
+
get iconSvgInline() {
|
|
196
|
+
return this._action.iconSvgInline;
|
|
197
|
+
}
|
|
198
|
+
get order() {
|
|
199
|
+
return this._action.order;
|
|
200
|
+
}
|
|
201
|
+
get enabled() {
|
|
202
|
+
return this._action.enabled;
|
|
203
|
+
}
|
|
204
|
+
get exec() {
|
|
205
|
+
return this._action.exec;
|
|
206
|
+
}
|
|
207
|
+
validateAction(action) {
|
|
208
|
+
if (!action.id || typeof action.id !== "string") {
|
|
209
|
+
throw new Error("Invalid id");
|
|
210
|
+
}
|
|
211
|
+
if (!action.displayName || typeof action.displayName !== "function") {
|
|
212
|
+
throw new Error("Invalid displayName function");
|
|
213
|
+
}
|
|
214
|
+
if (!action.iconSvgInline || typeof action.iconSvgInline !== "function") {
|
|
215
|
+
throw new Error("Invalid iconSvgInline function");
|
|
216
|
+
}
|
|
217
|
+
if ("order" in action && typeof action.order !== "number") {
|
|
218
|
+
throw new Error("Invalid order");
|
|
219
|
+
}
|
|
220
|
+
if ("enabled" in action && typeof action.enabled !== "function") {
|
|
221
|
+
throw new Error("Invalid enabled function");
|
|
222
|
+
}
|
|
223
|
+
if (!action.exec || typeof action.exec !== "function") {
|
|
224
|
+
throw new Error("Invalid exec function");
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
const registerFileListAction = (action) => {
|
|
229
|
+
if (typeof window._nc_filelistactions === "undefined") {
|
|
230
|
+
window._nc_filelistactions = [];
|
|
231
|
+
}
|
|
232
|
+
if (window._nc_filelistactions.find((listAction) => listAction.id === action.id)) {
|
|
233
|
+
logger.error(`FileListAction with id "${action.id}" is already registered`, { action });
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
window._nc_filelistactions.push(action);
|
|
237
|
+
};
|
|
238
|
+
const getFileListActions = () => {
|
|
239
|
+
if (typeof window._nc_filelistactions === "undefined") {
|
|
240
|
+
window._nc_filelistactions = [];
|
|
241
|
+
}
|
|
242
|
+
return window._nc_filelistactions;
|
|
243
|
+
};
|
|
183
244
|
class Header {
|
|
184
245
|
_header;
|
|
185
246
|
constructor(header) {
|
|
@@ -237,655 +298,6 @@ const getFileListHeaders = function() {
|
|
|
237
298
|
}
|
|
238
299
|
return window._nc_filelistheader;
|
|
239
300
|
};
|
|
240
|
-
var Permission = /* @__PURE__ */ ((Permission2) => {
|
|
241
|
-
Permission2[Permission2["NONE"] = 0] = "NONE";
|
|
242
|
-
Permission2[Permission2["CREATE"] = 4] = "CREATE";
|
|
243
|
-
Permission2[Permission2["READ"] = 1] = "READ";
|
|
244
|
-
Permission2[Permission2["UPDATE"] = 2] = "UPDATE";
|
|
245
|
-
Permission2[Permission2["DELETE"] = 8] = "DELETE";
|
|
246
|
-
Permission2[Permission2["SHARE"] = 16] = "SHARE";
|
|
247
|
-
Permission2[Permission2["ALL"] = 31] = "ALL";
|
|
248
|
-
return Permission2;
|
|
249
|
-
})(Permission || {});
|
|
250
|
-
const defaultDavProperties = [
|
|
251
|
-
"d:getcontentlength",
|
|
252
|
-
"d:getcontenttype",
|
|
253
|
-
"d:getetag",
|
|
254
|
-
"d:getlastmodified",
|
|
255
|
-
"d:creationdate",
|
|
256
|
-
"d:displayname",
|
|
257
|
-
"d:quota-available-bytes",
|
|
258
|
-
"d:resourcetype",
|
|
259
|
-
"nc:has-preview",
|
|
260
|
-
"nc:is-encrypted",
|
|
261
|
-
"nc:mount-type",
|
|
262
|
-
"oc:comments-unread",
|
|
263
|
-
"oc:favorite",
|
|
264
|
-
"oc:fileid",
|
|
265
|
-
"oc:owner-display-name",
|
|
266
|
-
"oc:owner-id",
|
|
267
|
-
"oc:permissions",
|
|
268
|
-
"oc:size"
|
|
269
|
-
];
|
|
270
|
-
const defaultDavNamespaces = {
|
|
271
|
-
d: "DAV:",
|
|
272
|
-
nc: "http://nextcloud.org/ns",
|
|
273
|
-
oc: "http://owncloud.org/ns",
|
|
274
|
-
ocs: "http://open-collaboration-services.org/ns"
|
|
275
|
-
};
|
|
276
|
-
const registerDavProperty = function(prop, namespace = { nc: "http://nextcloud.org/ns" }) {
|
|
277
|
-
if (typeof window._nc_dav_properties === "undefined") {
|
|
278
|
-
window._nc_dav_properties = [...defaultDavProperties];
|
|
279
|
-
window._nc_dav_namespaces = { ...defaultDavNamespaces };
|
|
280
|
-
}
|
|
281
|
-
const namespaces = { ...window._nc_dav_namespaces, ...namespace };
|
|
282
|
-
if (window._nc_dav_properties.find((search) => search === prop)) {
|
|
283
|
-
logger.warn(`${prop} already registered`, { prop });
|
|
284
|
-
return false;
|
|
285
|
-
}
|
|
286
|
-
if (prop.startsWith("<") || prop.split(":").length !== 2) {
|
|
287
|
-
logger.error(`${prop} is not valid. See example: 'oc:fileid'`, { prop });
|
|
288
|
-
return false;
|
|
289
|
-
}
|
|
290
|
-
const ns = prop.split(":")[0];
|
|
291
|
-
if (!namespaces[ns]) {
|
|
292
|
-
logger.error(`${prop} namespace unknown`, { prop, namespaces });
|
|
293
|
-
return false;
|
|
294
|
-
}
|
|
295
|
-
window._nc_dav_properties.push(prop);
|
|
296
|
-
window._nc_dav_namespaces = namespaces;
|
|
297
|
-
return true;
|
|
298
|
-
};
|
|
299
|
-
const getDavProperties = function() {
|
|
300
|
-
if (typeof window._nc_dav_properties === "undefined") {
|
|
301
|
-
window._nc_dav_properties = [...defaultDavProperties];
|
|
302
|
-
}
|
|
303
|
-
return window._nc_dav_properties.map((prop) => `<${prop} />`).join(" ");
|
|
304
|
-
};
|
|
305
|
-
const getDavNameSpaces = function() {
|
|
306
|
-
if (typeof window._nc_dav_namespaces === "undefined") {
|
|
307
|
-
window._nc_dav_namespaces = { ...defaultDavNamespaces };
|
|
308
|
-
}
|
|
309
|
-
return Object.keys(window._nc_dav_namespaces).map((ns) => `xmlns:${ns}="${window._nc_dav_namespaces?.[ns]}"`).join(" ");
|
|
310
|
-
};
|
|
311
|
-
const davGetDefaultPropfind = function() {
|
|
312
|
-
return `<?xml version="1.0"?>
|
|
313
|
-
<d:propfind ${getDavNameSpaces()}>
|
|
314
|
-
<d:prop>
|
|
315
|
-
${getDavProperties()}
|
|
316
|
-
</d:prop>
|
|
317
|
-
</d:propfind>`;
|
|
318
|
-
};
|
|
319
|
-
const davGetFavoritesReport = function() {
|
|
320
|
-
return `<?xml version="1.0"?>
|
|
321
|
-
<oc:filter-files ${getDavNameSpaces()}>
|
|
322
|
-
<d:prop>
|
|
323
|
-
${getDavProperties()}
|
|
324
|
-
</d:prop>
|
|
325
|
-
<oc:filter-rules>
|
|
326
|
-
<oc:favorite>1</oc:favorite>
|
|
327
|
-
</oc:filter-rules>
|
|
328
|
-
</oc:filter-files>`;
|
|
329
|
-
};
|
|
330
|
-
const davGetRecentSearch = function(lastModified) {
|
|
331
|
-
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
332
|
-
<d:searchrequest ${getDavNameSpaces()}
|
|
333
|
-
xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
|
|
334
|
-
<d:basicsearch>
|
|
335
|
-
<d:select>
|
|
336
|
-
<d:prop>
|
|
337
|
-
${getDavProperties()}
|
|
338
|
-
</d:prop>
|
|
339
|
-
</d:select>
|
|
340
|
-
<d:from>
|
|
341
|
-
<d:scope>
|
|
342
|
-
<d:href>/files/${getCurrentUser()?.uid}/</d:href>
|
|
343
|
-
<d:depth>infinity</d:depth>
|
|
344
|
-
</d:scope>
|
|
345
|
-
</d:from>
|
|
346
|
-
<d:where>
|
|
347
|
-
<d:and>
|
|
348
|
-
<d:or>
|
|
349
|
-
<d:not>
|
|
350
|
-
<d:eq>
|
|
351
|
-
<d:prop>
|
|
352
|
-
<d:getcontenttype/>
|
|
353
|
-
</d:prop>
|
|
354
|
-
<d:literal>httpd/unix-directory</d:literal>
|
|
355
|
-
</d:eq>
|
|
356
|
-
</d:not>
|
|
357
|
-
<d:eq>
|
|
358
|
-
<d:prop>
|
|
359
|
-
<oc:size/>
|
|
360
|
-
</d:prop>
|
|
361
|
-
<d:literal>0</d:literal>
|
|
362
|
-
</d:eq>
|
|
363
|
-
</d:or>
|
|
364
|
-
<d:gt>
|
|
365
|
-
<d:prop>
|
|
366
|
-
<d:getlastmodified/>
|
|
367
|
-
</d:prop>
|
|
368
|
-
<d:literal>${lastModified}</d:literal>
|
|
369
|
-
</d:gt>
|
|
370
|
-
</d:and>
|
|
371
|
-
</d:where>
|
|
372
|
-
<d:orderby>
|
|
373
|
-
<d:order>
|
|
374
|
-
<d:prop>
|
|
375
|
-
<d:getlastmodified/>
|
|
376
|
-
</d:prop>
|
|
377
|
-
<d:descending/>
|
|
378
|
-
</d:order>
|
|
379
|
-
</d:orderby>
|
|
380
|
-
<d:limit>
|
|
381
|
-
<d:nresults>100</d:nresults>
|
|
382
|
-
<ns:firstresult>0</ns:firstresult>
|
|
383
|
-
</d:limit>
|
|
384
|
-
</d:basicsearch>
|
|
385
|
-
</d:searchrequest>`;
|
|
386
|
-
};
|
|
387
|
-
const davParsePermissions = function(permString = "") {
|
|
388
|
-
let permissions = Permission.NONE;
|
|
389
|
-
if (!permString) {
|
|
390
|
-
return permissions;
|
|
391
|
-
}
|
|
392
|
-
if (permString.includes("C") || permString.includes("K")) {
|
|
393
|
-
permissions |= Permission.CREATE;
|
|
394
|
-
}
|
|
395
|
-
if (permString.includes("G")) {
|
|
396
|
-
permissions |= Permission.READ;
|
|
397
|
-
}
|
|
398
|
-
if (permString.includes("W") || permString.includes("N") || permString.includes("V")) {
|
|
399
|
-
permissions |= Permission.UPDATE;
|
|
400
|
-
}
|
|
401
|
-
if (permString.includes("D")) {
|
|
402
|
-
permissions |= Permission.DELETE;
|
|
403
|
-
}
|
|
404
|
-
if (permString.includes("R")) {
|
|
405
|
-
permissions |= Permission.SHARE;
|
|
406
|
-
}
|
|
407
|
-
return permissions;
|
|
408
|
-
};
|
|
409
|
-
var FileType = /* @__PURE__ */ ((FileType2) => {
|
|
410
|
-
FileType2["Folder"] = "folder";
|
|
411
|
-
FileType2["File"] = "file";
|
|
412
|
-
return FileType2;
|
|
413
|
-
})(FileType || {});
|
|
414
|
-
const isDavRessource = function(source, davService) {
|
|
415
|
-
return source.match(davService) !== null;
|
|
416
|
-
};
|
|
417
|
-
const validateData = (data, davService) => {
|
|
418
|
-
if (data.id && typeof data.id !== "number") {
|
|
419
|
-
throw new Error("Invalid id type of value");
|
|
420
|
-
}
|
|
421
|
-
if (!data.source) {
|
|
422
|
-
throw new Error("Missing mandatory source");
|
|
423
|
-
}
|
|
424
|
-
try {
|
|
425
|
-
new URL(data.source);
|
|
426
|
-
} catch (e) {
|
|
427
|
-
throw new Error("Invalid source format, source must be a valid URL");
|
|
428
|
-
}
|
|
429
|
-
if (!data.source.startsWith("http")) {
|
|
430
|
-
throw new Error("Invalid source format, only http(s) is supported");
|
|
431
|
-
}
|
|
432
|
-
if (data.displayname && typeof data.displayname !== "string") {
|
|
433
|
-
throw new Error("Invalid displayname type");
|
|
434
|
-
}
|
|
435
|
-
if (data.mtime && !(data.mtime instanceof Date)) {
|
|
436
|
-
throw new Error("Invalid mtime type");
|
|
437
|
-
}
|
|
438
|
-
if (data.crtime && !(data.crtime instanceof Date)) {
|
|
439
|
-
throw new Error("Invalid crtime type");
|
|
440
|
-
}
|
|
441
|
-
if (!data.mime || typeof data.mime !== "string" || !data.mime.match(/^[-\w.]+\/[-+\w.]+$/gi)) {
|
|
442
|
-
throw new Error("Missing or invalid mandatory mime");
|
|
443
|
-
}
|
|
444
|
-
if ("size" in data && typeof data.size !== "number" && data.size !== void 0) {
|
|
445
|
-
throw new Error("Invalid size type");
|
|
446
|
-
}
|
|
447
|
-
if ("permissions" in data && data.permissions !== void 0 && !(typeof data.permissions === "number" && data.permissions >= Permission.NONE && data.permissions <= Permission.ALL)) {
|
|
448
|
-
throw new Error("Invalid permissions");
|
|
449
|
-
}
|
|
450
|
-
if (data.owner && data.owner !== null && typeof data.owner !== "string") {
|
|
451
|
-
throw new Error("Invalid owner type");
|
|
452
|
-
}
|
|
453
|
-
if (data.attributes && typeof data.attributes !== "object") {
|
|
454
|
-
throw new Error("Invalid attributes type");
|
|
455
|
-
}
|
|
456
|
-
if (data.root && typeof data.root !== "string") {
|
|
457
|
-
throw new Error("Invalid root type");
|
|
458
|
-
}
|
|
459
|
-
if (data.root && !data.root.startsWith("/")) {
|
|
460
|
-
throw new Error("Root must start with a leading slash");
|
|
461
|
-
}
|
|
462
|
-
if (data.root && !data.source.includes(data.root)) {
|
|
463
|
-
throw new Error("Root must be part of the source");
|
|
464
|
-
}
|
|
465
|
-
if (data.root && isDavRessource(data.source, davService)) {
|
|
466
|
-
const service = data.source.match(davService)[0];
|
|
467
|
-
if (!data.source.includes(join(service, data.root))) {
|
|
468
|
-
throw new Error("The root must be relative to the service. e.g /files/emma");
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
if (data.status && !Object.values(NodeStatus).includes(data.status)) {
|
|
472
|
-
throw new Error("Status must be a valid NodeStatus");
|
|
473
|
-
}
|
|
474
|
-
};
|
|
475
|
-
var NodeStatus = /* @__PURE__ */ ((NodeStatus2) => {
|
|
476
|
-
NodeStatus2["NEW"] = "new";
|
|
477
|
-
NodeStatus2["FAILED"] = "failed";
|
|
478
|
-
NodeStatus2["LOADING"] = "loading";
|
|
479
|
-
NodeStatus2["LOCKED"] = "locked";
|
|
480
|
-
return NodeStatus2;
|
|
481
|
-
})(NodeStatus || {});
|
|
482
|
-
class Node {
|
|
483
|
-
_data;
|
|
484
|
-
_attributes;
|
|
485
|
-
_knownDavService = /(remote|public)\.php\/(web)?dav/i;
|
|
486
|
-
readonlyAttributes = Object.entries(Object.getOwnPropertyDescriptors(Node.prototype)).filter((e) => typeof e[1].get === "function" && e[0] !== "__proto__").map((e) => e[0]);
|
|
487
|
-
handler = {
|
|
488
|
-
set: (target, prop, value) => {
|
|
489
|
-
if (this.readonlyAttributes.includes(prop)) {
|
|
490
|
-
return false;
|
|
491
|
-
}
|
|
492
|
-
return Reflect.set(target, prop, value);
|
|
493
|
-
},
|
|
494
|
-
deleteProperty: (target, prop) => {
|
|
495
|
-
if (this.readonlyAttributes.includes(prop)) {
|
|
496
|
-
return false;
|
|
497
|
-
}
|
|
498
|
-
return Reflect.deleteProperty(target, prop);
|
|
499
|
-
},
|
|
500
|
-
// TODO: This is deprecated and only needed for files v3
|
|
501
|
-
get: (target, prop, receiver) => {
|
|
502
|
-
if (this.readonlyAttributes.includes(prop)) {
|
|
503
|
-
logger.warn(`Accessing "Node.attributes.${prop}" is deprecated, access it directly on the Node instance.`);
|
|
504
|
-
return Reflect.get(this, prop);
|
|
505
|
-
}
|
|
506
|
-
return Reflect.get(target, prop, receiver);
|
|
507
|
-
}
|
|
508
|
-
};
|
|
509
|
-
constructor(data, davService) {
|
|
510
|
-
validateData(data, davService || this._knownDavService);
|
|
511
|
-
this._data = {
|
|
512
|
-
// TODO: Remove with next major release, this is just for compatibility
|
|
513
|
-
displayname: data.attributes?.displayname,
|
|
514
|
-
...data,
|
|
515
|
-
attributes: {}
|
|
516
|
-
};
|
|
517
|
-
this._attributes = new Proxy(this._data.attributes, this.handler);
|
|
518
|
-
this.update(data.attributes ?? {});
|
|
519
|
-
if (davService) {
|
|
520
|
-
this._knownDavService = davService;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
/**
|
|
524
|
-
* Get the source url to this object
|
|
525
|
-
* There is no setter as the source is not meant to be changed manually.
|
|
526
|
-
* You can use the rename or move method to change the source.
|
|
527
|
-
*/
|
|
528
|
-
get source() {
|
|
529
|
-
return this._data.source.replace(/\/$/i, "");
|
|
530
|
-
}
|
|
531
|
-
/**
|
|
532
|
-
* Get the encoded source url to this object for requests purposes
|
|
533
|
-
*/
|
|
534
|
-
get encodedSource() {
|
|
535
|
-
const { origin } = new URL(this.source);
|
|
536
|
-
return origin + encodePath(this.source.slice(origin.length));
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Get this object name
|
|
540
|
-
* There is no setter as the source is not meant to be changed manually.
|
|
541
|
-
* You can use the rename or move method to change the source.
|
|
542
|
-
*/
|
|
543
|
-
get basename() {
|
|
544
|
-
return basename(this.source);
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* The nodes displayname
|
|
548
|
-
* By default the display name and the `basename` are identical,
|
|
549
|
-
* but it is possible to have a different name. This happens
|
|
550
|
-
* on the files app for example for shared folders.
|
|
551
|
-
*/
|
|
552
|
-
get displayname() {
|
|
553
|
-
return this._data.displayname || this.basename;
|
|
554
|
-
}
|
|
555
|
-
/**
|
|
556
|
-
* Set the displayname
|
|
557
|
-
*/
|
|
558
|
-
set displayname(displayname) {
|
|
559
|
-
this._data.displayname = displayname;
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* Get this object's extension
|
|
563
|
-
* There is no setter as the source is not meant to be changed manually.
|
|
564
|
-
* You can use the rename or move method to change the source.
|
|
565
|
-
*/
|
|
566
|
-
get extension() {
|
|
567
|
-
return extname(this.source);
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* Get the directory path leading to this object
|
|
571
|
-
* Will use the relative path to root if available
|
|
572
|
-
*
|
|
573
|
-
* There is no setter as the source is not meant to be changed manually.
|
|
574
|
-
* You can use the rename or move method to change the source.
|
|
575
|
-
*/
|
|
576
|
-
get dirname() {
|
|
577
|
-
if (this.root) {
|
|
578
|
-
let source = this.source;
|
|
579
|
-
if (this.isDavRessource) {
|
|
580
|
-
source = source.split(this._knownDavService).pop();
|
|
581
|
-
}
|
|
582
|
-
const firstMatch = source.indexOf(this.root);
|
|
583
|
-
const root = this.root.replace(/\/$/, "");
|
|
584
|
-
return dirname(source.slice(firstMatch + root.length) || "/");
|
|
585
|
-
}
|
|
586
|
-
const url = new URL(this.source);
|
|
587
|
-
return dirname(url.pathname);
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* Get the file mime
|
|
591
|
-
* There is no setter as the mime is not meant to be changed
|
|
592
|
-
*/
|
|
593
|
-
get mime() {
|
|
594
|
-
return this._data.mime;
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* Get the file modification time
|
|
598
|
-
*/
|
|
599
|
-
get mtime() {
|
|
600
|
-
return this._data.mtime;
|
|
601
|
-
}
|
|
602
|
-
/**
|
|
603
|
-
* Set the file modification time
|
|
604
|
-
*/
|
|
605
|
-
set mtime(mtime) {
|
|
606
|
-
this._data.mtime = mtime;
|
|
607
|
-
}
|
|
608
|
-
/**
|
|
609
|
-
* Get the file creation time
|
|
610
|
-
* There is no setter as the creation time is not meant to be changed
|
|
611
|
-
*/
|
|
612
|
-
get crtime() {
|
|
613
|
-
return this._data.crtime;
|
|
614
|
-
}
|
|
615
|
-
/**
|
|
616
|
-
* Get the file size
|
|
617
|
-
*/
|
|
618
|
-
get size() {
|
|
619
|
-
return this._data.size;
|
|
620
|
-
}
|
|
621
|
-
/**
|
|
622
|
-
* Set the file size
|
|
623
|
-
*/
|
|
624
|
-
set size(size) {
|
|
625
|
-
this.updateMtime();
|
|
626
|
-
this._data.size = size;
|
|
627
|
-
}
|
|
628
|
-
/**
|
|
629
|
-
* Get the file attribute
|
|
630
|
-
* This contains all additional attributes not provided by the Node class
|
|
631
|
-
*/
|
|
632
|
-
get attributes() {
|
|
633
|
-
return this._attributes;
|
|
634
|
-
}
|
|
635
|
-
/**
|
|
636
|
-
* Get the file permissions
|
|
637
|
-
*/
|
|
638
|
-
get permissions() {
|
|
639
|
-
if (this.owner === null && !this.isDavRessource) {
|
|
640
|
-
return Permission.READ;
|
|
641
|
-
}
|
|
642
|
-
return this._data.permissions !== void 0 ? this._data.permissions : Permission.NONE;
|
|
643
|
-
}
|
|
644
|
-
/**
|
|
645
|
-
* Set the file permissions
|
|
646
|
-
*/
|
|
647
|
-
set permissions(permissions) {
|
|
648
|
-
this.updateMtime();
|
|
649
|
-
this._data.permissions = permissions;
|
|
650
|
-
}
|
|
651
|
-
/**
|
|
652
|
-
* Get the file owner
|
|
653
|
-
* There is no setter as the owner is not meant to be changed
|
|
654
|
-
*/
|
|
655
|
-
get owner() {
|
|
656
|
-
if (!this.isDavRessource) {
|
|
657
|
-
return null;
|
|
658
|
-
}
|
|
659
|
-
return this._data.owner;
|
|
660
|
-
}
|
|
661
|
-
/**
|
|
662
|
-
* Is this a dav-related ressource ?
|
|
663
|
-
*/
|
|
664
|
-
get isDavRessource() {
|
|
665
|
-
return isDavRessource(this.source, this._knownDavService);
|
|
666
|
-
}
|
|
667
|
-
/**
|
|
668
|
-
* Get the dav root of this object
|
|
669
|
-
* There is no setter as the root is not meant to be changed
|
|
670
|
-
*/
|
|
671
|
-
get root() {
|
|
672
|
-
if (this._data.root) {
|
|
673
|
-
return this._data.root.replace(/^(.+)\/$/, "$1");
|
|
674
|
-
}
|
|
675
|
-
if (this.isDavRessource) {
|
|
676
|
-
const root = dirname(this.source);
|
|
677
|
-
return root.split(this._knownDavService).pop() || null;
|
|
678
|
-
}
|
|
679
|
-
return null;
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
* Get the absolute path of this object relative to the root
|
|
683
|
-
*/
|
|
684
|
-
get path() {
|
|
685
|
-
if (this.root) {
|
|
686
|
-
let source = this.source;
|
|
687
|
-
if (this.isDavRessource) {
|
|
688
|
-
source = source.split(this._knownDavService).pop();
|
|
689
|
-
}
|
|
690
|
-
const firstMatch = source.indexOf(this.root);
|
|
691
|
-
const root = this.root.replace(/\/$/, "");
|
|
692
|
-
return source.slice(firstMatch + root.length) || "/";
|
|
693
|
-
}
|
|
694
|
-
return (this.dirname + "/" + this.basename).replace(/\/\//g, "/");
|
|
695
|
-
}
|
|
696
|
-
/**
|
|
697
|
-
* Get the node id if defined.
|
|
698
|
-
* There is no setter as the fileid is not meant to be changed
|
|
699
|
-
*/
|
|
700
|
-
get fileid() {
|
|
701
|
-
return this._data?.id;
|
|
702
|
-
}
|
|
703
|
-
/**
|
|
704
|
-
* Get the node status.
|
|
705
|
-
*/
|
|
706
|
-
get status() {
|
|
707
|
-
return this._data?.status;
|
|
708
|
-
}
|
|
709
|
-
/**
|
|
710
|
-
* Set the node status.
|
|
711
|
-
*/
|
|
712
|
-
set status(status) {
|
|
713
|
-
this._data.status = status;
|
|
714
|
-
}
|
|
715
|
-
/**
|
|
716
|
-
* Move the node to a new destination
|
|
717
|
-
*
|
|
718
|
-
* @param {string} destination the new source.
|
|
719
|
-
* e.g. https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg
|
|
720
|
-
*/
|
|
721
|
-
move(destination) {
|
|
722
|
-
validateData({ ...this._data, source: destination }, this._knownDavService);
|
|
723
|
-
const oldBasename = this.basename;
|
|
724
|
-
this._data.source = destination;
|
|
725
|
-
if (this.displayname === oldBasename && this.basename !== oldBasename) {
|
|
726
|
-
this.displayname = this.basename;
|
|
727
|
-
}
|
|
728
|
-
this.updateMtime();
|
|
729
|
-
}
|
|
730
|
-
/**
|
|
731
|
-
* Rename the node
|
|
732
|
-
* This aliases the move method for easier usage
|
|
733
|
-
*
|
|
734
|
-
* @param basename The new name of the node
|
|
735
|
-
*/
|
|
736
|
-
rename(basename2) {
|
|
737
|
-
if (basename2.includes("/")) {
|
|
738
|
-
throw new Error("Invalid basename");
|
|
739
|
-
}
|
|
740
|
-
this.move(dirname(this.source) + "/" + basename2);
|
|
741
|
-
}
|
|
742
|
-
/**
|
|
743
|
-
* Update the mtime if exists
|
|
744
|
-
*/
|
|
745
|
-
updateMtime() {
|
|
746
|
-
if (this._data.mtime) {
|
|
747
|
-
this._data.mtime = /* @__PURE__ */ new Date();
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
/**
|
|
751
|
-
* Update the attributes of the node
|
|
752
|
-
* Warning, updating attributes will NOT automatically update the mtime.
|
|
753
|
-
*
|
|
754
|
-
* @param attributes The new attributes to update on the Node attributes
|
|
755
|
-
*/
|
|
756
|
-
update(attributes) {
|
|
757
|
-
for (const [name, value] of Object.entries(attributes)) {
|
|
758
|
-
try {
|
|
759
|
-
if (value === void 0) {
|
|
760
|
-
delete this.attributes[name];
|
|
761
|
-
} else {
|
|
762
|
-
this.attributes[name] = value;
|
|
763
|
-
}
|
|
764
|
-
} catch (e) {
|
|
765
|
-
if (e instanceof TypeError) {
|
|
766
|
-
continue;
|
|
767
|
-
}
|
|
768
|
-
throw e;
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
class File extends Node {
|
|
774
|
-
get type() {
|
|
775
|
-
return FileType.File;
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
class Folder extends Node {
|
|
779
|
-
constructor(data) {
|
|
780
|
-
super({
|
|
781
|
-
...data,
|
|
782
|
-
mime: "httpd/unix-directory"
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
get type() {
|
|
786
|
-
return FileType.Folder;
|
|
787
|
-
}
|
|
788
|
-
get extension() {
|
|
789
|
-
return null;
|
|
790
|
-
}
|
|
791
|
-
get mime() {
|
|
792
|
-
return "httpd/unix-directory";
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
function davGetRootPath() {
|
|
796
|
-
if (isPublicShare()) {
|
|
797
|
-
return `/files/${getSharingToken()}`;
|
|
798
|
-
}
|
|
799
|
-
return `/files/${getCurrentUser()?.uid}`;
|
|
800
|
-
}
|
|
801
|
-
const davRootPath = davGetRootPath();
|
|
802
|
-
function davGetRemoteURL() {
|
|
803
|
-
const url = generateRemoteUrl("dav");
|
|
804
|
-
if (isPublicShare()) {
|
|
805
|
-
return url.replace("remote.php", "public.php");
|
|
806
|
-
}
|
|
807
|
-
return url;
|
|
808
|
-
}
|
|
809
|
-
const davRemoteURL = davGetRemoteURL();
|
|
810
|
-
const davGetClient = function(remoteURL = davRemoteURL, headers = {}) {
|
|
811
|
-
const client = createClient(remoteURL, { headers });
|
|
812
|
-
function setHeaders(token) {
|
|
813
|
-
client.setHeaders({
|
|
814
|
-
...headers,
|
|
815
|
-
// Add this so the server knows it is an request from the browser
|
|
816
|
-
"X-Requested-With": "XMLHttpRequest",
|
|
817
|
-
// Inject user auth
|
|
818
|
-
requesttoken: token ?? ""
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
onRequestTokenUpdate(setHeaders);
|
|
822
|
-
setHeaders(getRequestToken());
|
|
823
|
-
const patcher = getPatcher();
|
|
824
|
-
patcher.patch("fetch", (url, options) => {
|
|
825
|
-
const headers2 = options.headers;
|
|
826
|
-
if (headers2?.method) {
|
|
827
|
-
options.method = headers2.method;
|
|
828
|
-
delete headers2.method;
|
|
829
|
-
}
|
|
830
|
-
return fetch(url, options);
|
|
831
|
-
});
|
|
832
|
-
return client;
|
|
833
|
-
};
|
|
834
|
-
const getFavoriteNodes = (davClient, path = "/", davRoot = davRootPath) => {
|
|
835
|
-
const controller = new AbortController();
|
|
836
|
-
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
|
837
|
-
onCancel(() => controller.abort());
|
|
838
|
-
try {
|
|
839
|
-
const contentsResponse = await davClient.getDirectoryContents(`${davRoot}${path}`, {
|
|
840
|
-
signal: controller.signal,
|
|
841
|
-
details: true,
|
|
842
|
-
data: davGetFavoritesReport(),
|
|
843
|
-
headers: {
|
|
844
|
-
// see davGetClient for patched webdav client
|
|
845
|
-
method: "REPORT"
|
|
846
|
-
},
|
|
847
|
-
includeSelf: true
|
|
848
|
-
});
|
|
849
|
-
const nodes = contentsResponse.data.filter((node) => node.filename !== path).map((result) => davResultToNode(result, davRoot));
|
|
850
|
-
resolve(nodes);
|
|
851
|
-
} catch (error) {
|
|
852
|
-
reject(error);
|
|
853
|
-
}
|
|
854
|
-
});
|
|
855
|
-
};
|
|
856
|
-
const davResultToNode = function(node, filesRoot = davRootPath, remoteURL = davRemoteURL) {
|
|
857
|
-
let userId = getCurrentUser()?.uid;
|
|
858
|
-
if (isPublicShare()) {
|
|
859
|
-
userId = userId ?? "anonymous";
|
|
860
|
-
} else if (!userId) {
|
|
861
|
-
throw new Error("No user id found");
|
|
862
|
-
}
|
|
863
|
-
const props = node.props;
|
|
864
|
-
const permissions = davParsePermissions(props?.permissions);
|
|
865
|
-
const owner = String(props?.["owner-id"] || userId);
|
|
866
|
-
const id = props.fileid || 0;
|
|
867
|
-
const nodeData = {
|
|
868
|
-
id,
|
|
869
|
-
source: `${remoteURL}${node.filename}`,
|
|
870
|
-
mtime: new Date(Date.parse(node.lastmod)),
|
|
871
|
-
mime: node.mime || "application/octet-stream",
|
|
872
|
-
// Manually cast to work around for https://github.com/perry-mitchell/webdav-client/pull/380
|
|
873
|
-
displayname: props.displayname !== void 0 ? String(props.displayname) : void 0,
|
|
874
|
-
size: props?.size || Number.parseInt(props.getcontentlength || "0"),
|
|
875
|
-
// The fileid is set to -1 for failed requests
|
|
876
|
-
status: id < 0 ? NodeStatus.FAILED : void 0,
|
|
877
|
-
permissions,
|
|
878
|
-
owner,
|
|
879
|
-
root: filesRoot,
|
|
880
|
-
attributes: {
|
|
881
|
-
...node,
|
|
882
|
-
...props,
|
|
883
|
-
hasPreview: props?.["has-preview"]
|
|
884
|
-
}
|
|
885
|
-
};
|
|
886
|
-
delete nodeData.attributes?.props;
|
|
887
|
-
return node.type === "file" ? new File(nodeData) : new Folder(nodeData);
|
|
888
|
-
};
|
|
889
301
|
var InvalidFilenameErrorReason = /* @__PURE__ */ ((InvalidFilenameErrorReason2) => {
|
|
890
302
|
InvalidFilenameErrorReason2["ReservedName"] = "reserved name";
|
|
891
303
|
InvalidFilenameErrorReason2["Character"] = "character";
|
|
@@ -964,16 +376,16 @@ function isFilenameValid(filename) {
|
|
|
964
376
|
}
|
|
965
377
|
function getUniqueName(name, otherNames, options) {
|
|
966
378
|
const opts = {
|
|
967
|
-
suffix: (
|
|
379
|
+
suffix: (n2) => `(${n2})`,
|
|
968
380
|
ignoreFileExtension: false,
|
|
969
381
|
...options
|
|
970
382
|
};
|
|
971
383
|
let newName = name;
|
|
972
|
-
let
|
|
384
|
+
let i2 = 1;
|
|
973
385
|
while (otherNames.includes(newName)) {
|
|
974
386
|
const ext = opts.ignoreFileExtension ? "" : extname(name);
|
|
975
387
|
const base = basename(name, ext);
|
|
976
|
-
newName = `${base} ${opts.suffix(
|
|
388
|
+
newName = `${base} ${opts.suffix(i2++)}${ext}`;
|
|
977
389
|
}
|
|
978
390
|
return newName;
|
|
979
391
|
}
|
|
@@ -1001,7 +413,7 @@ function formatFileSize(size, skipSmallSizes = false, binaryPrefixes = false, ba
|
|
|
1001
413
|
function parseFileSize(value, forceBinary = false) {
|
|
1002
414
|
try {
|
|
1003
415
|
value = `${value}`.toLocaleLowerCase().replaceAll(/\s+/g, "").replaceAll(",", ".");
|
|
1004
|
-
} catch (
|
|
416
|
+
} catch (e2) {
|
|
1005
417
|
return null;
|
|
1006
418
|
}
|
|
1007
419
|
const match = value.match(/^([0-9]*(\.[0-9]*)?)([kmgtp]?)(i?)b?$/);
|
|
@@ -1039,9 +451,9 @@ function orderBy(collection, identifiers2, orders) {
|
|
|
1039
451
|
usage: "sort"
|
|
1040
452
|
}
|
|
1041
453
|
);
|
|
1042
|
-
return [...collection].sort((
|
|
454
|
+
return [...collection].sort((a2, b2) => {
|
|
1043
455
|
for (const [index, identifier] of identifiers2.entries()) {
|
|
1044
|
-
const value = collator.compare(stringify(identifier(
|
|
456
|
+
const value = collator.compare(stringify(identifier(a2)), stringify(identifier(b2)));
|
|
1045
457
|
if (value !== 0) {
|
|
1046
458
|
return value * sorting[index];
|
|
1047
459
|
}
|
|
@@ -1072,7 +484,7 @@ function sortNodes(nodes, options = {}) {
|
|
|
1072
484
|
// 3: Use sorting mode if NOT basename (to be able to use display name too)
|
|
1073
485
|
...sortingOptions.sortingMode !== "basename" ? [(v) => v[sortingOptions.sortingMode]] : [],
|
|
1074
486
|
// 4: Use display name if available, fallback to name
|
|
1075
|
-
(v) => basename2(v.attributes?.displayname || v.basename),
|
|
487
|
+
(v) => basename2(v.displayname || v.attributes?.displayname || v.basename),
|
|
1076
488
|
// 5: Finally, use basename if all previous sorting methods failed
|
|
1077
489
|
(v) => v.basename
|
|
1078
490
|
];
|
|
@@ -1223,15 +635,15 @@ var util$3 = {};
|
|
|
1223
635
|
exports.isEmptyObject = function(obj) {
|
|
1224
636
|
return Object.keys(obj).length === 0;
|
|
1225
637
|
};
|
|
1226
|
-
exports.merge = function(target,
|
|
1227
|
-
if (
|
|
1228
|
-
const keys = Object.keys(
|
|
638
|
+
exports.merge = function(target, a2, arrayMode) {
|
|
639
|
+
if (a2) {
|
|
640
|
+
const keys = Object.keys(a2);
|
|
1229
641
|
const len = keys.length;
|
|
1230
|
-
for (let
|
|
642
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
1231
643
|
if (arrayMode === "strict") {
|
|
1232
|
-
target[keys[
|
|
644
|
+
target[keys[i2]] = [a2[keys[i2]]];
|
|
1233
645
|
} else {
|
|
1234
|
-
target[keys[
|
|
646
|
+
target[keys[i2]] = a2[keys[i2]];
|
|
1235
647
|
}
|
|
1236
648
|
}
|
|
1237
649
|
}
|
|
@@ -1261,31 +673,31 @@ validator$2.validate = function(xmlData, options) {
|
|
|
1261
673
|
if (xmlData[0] === "\uFEFF") {
|
|
1262
674
|
xmlData = xmlData.substr(1);
|
|
1263
675
|
}
|
|
1264
|
-
for (let
|
|
1265
|
-
if (xmlData[
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
if (
|
|
1269
|
-
} else if (xmlData[
|
|
1270
|
-
let tagStartPos =
|
|
1271
|
-
|
|
1272
|
-
if (xmlData[
|
|
1273
|
-
|
|
676
|
+
for (let i2 = 0; i2 < xmlData.length; i2++) {
|
|
677
|
+
if (xmlData[i2] === "<" && xmlData[i2 + 1] === "?") {
|
|
678
|
+
i2 += 2;
|
|
679
|
+
i2 = readPI(xmlData, i2);
|
|
680
|
+
if (i2.err) return i2;
|
|
681
|
+
} else if (xmlData[i2] === "<") {
|
|
682
|
+
let tagStartPos = i2;
|
|
683
|
+
i2++;
|
|
684
|
+
if (xmlData[i2] === "!") {
|
|
685
|
+
i2 = readCommentAndCDATA(xmlData, i2);
|
|
1274
686
|
continue;
|
|
1275
687
|
} else {
|
|
1276
688
|
let closingTag = false;
|
|
1277
|
-
if (xmlData[
|
|
689
|
+
if (xmlData[i2] === "/") {
|
|
1278
690
|
closingTag = true;
|
|
1279
|
-
|
|
691
|
+
i2++;
|
|
1280
692
|
}
|
|
1281
693
|
let tagName = "";
|
|
1282
|
-
for (;
|
|
1283
|
-
tagName += xmlData[
|
|
694
|
+
for (; i2 < xmlData.length && xmlData[i2] !== ">" && xmlData[i2] !== " " && xmlData[i2] !== " " && xmlData[i2] !== "\n" && xmlData[i2] !== "\r"; i2++) {
|
|
695
|
+
tagName += xmlData[i2];
|
|
1284
696
|
}
|
|
1285
697
|
tagName = tagName.trim();
|
|
1286
698
|
if (tagName[tagName.length - 1] === "/") {
|
|
1287
699
|
tagName = tagName.substring(0, tagName.length - 1);
|
|
1288
|
-
|
|
700
|
+
i2--;
|
|
1289
701
|
}
|
|
1290
702
|
if (!validateTagName(tagName)) {
|
|
1291
703
|
let msg;
|
|
@@ -1294,16 +706,16 @@ validator$2.validate = function(xmlData, options) {
|
|
|
1294
706
|
} else {
|
|
1295
707
|
msg = "Tag '" + tagName + "' is an invalid name.";
|
|
1296
708
|
}
|
|
1297
|
-
return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData,
|
|
709
|
+
return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i2));
|
|
1298
710
|
}
|
|
1299
|
-
const result = readAttributeStr(xmlData,
|
|
711
|
+
const result = readAttributeStr(xmlData, i2);
|
|
1300
712
|
if (result === false) {
|
|
1301
|
-
return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData,
|
|
713
|
+
return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i2));
|
|
1302
714
|
}
|
|
1303
715
|
let attrStr = result.value;
|
|
1304
|
-
|
|
716
|
+
i2 = result.index;
|
|
1305
717
|
if (attrStr[attrStr.length - 1] === "/") {
|
|
1306
|
-
const attrStrStart =
|
|
718
|
+
const attrStrStart = i2 - attrStr.length;
|
|
1307
719
|
attrStr = attrStr.substring(0, attrStr.length - 1);
|
|
1308
720
|
const isValid = validateAttributeString(attrStr, options);
|
|
1309
721
|
if (isValid === true) {
|
|
@@ -1313,7 +725,7 @@ validator$2.validate = function(xmlData, options) {
|
|
|
1313
725
|
}
|
|
1314
726
|
} else if (closingTag) {
|
|
1315
727
|
if (!result.tagClosed) {
|
|
1316
|
-
return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData,
|
|
728
|
+
return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i2));
|
|
1317
729
|
} else if (attrStr.trim().length > 0) {
|
|
1318
730
|
return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos));
|
|
1319
731
|
} else if (tags.length === 0) {
|
|
@@ -1335,48 +747,48 @@ validator$2.validate = function(xmlData, options) {
|
|
|
1335
747
|
} else {
|
|
1336
748
|
const isValid = validateAttributeString(attrStr, options);
|
|
1337
749
|
if (isValid !== true) {
|
|
1338
|
-
return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData,
|
|
750
|
+
return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i2 - attrStr.length + isValid.err.line));
|
|
1339
751
|
}
|
|
1340
752
|
if (reachedRoot === true) {
|
|
1341
|
-
return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData,
|
|
753
|
+
return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i2));
|
|
1342
754
|
} else if (options.unpairedTags.indexOf(tagName) !== -1) ;
|
|
1343
755
|
else {
|
|
1344
756
|
tags.push({ tagName, tagStartPos });
|
|
1345
757
|
}
|
|
1346
758
|
tagFound = true;
|
|
1347
759
|
}
|
|
1348
|
-
for (
|
|
1349
|
-
if (xmlData[
|
|
1350
|
-
if (xmlData[
|
|
1351
|
-
|
|
1352
|
-
|
|
760
|
+
for (i2++; i2 < xmlData.length; i2++) {
|
|
761
|
+
if (xmlData[i2] === "<") {
|
|
762
|
+
if (xmlData[i2 + 1] === "!") {
|
|
763
|
+
i2++;
|
|
764
|
+
i2 = readCommentAndCDATA(xmlData, i2);
|
|
1353
765
|
continue;
|
|
1354
|
-
} else if (xmlData[
|
|
1355
|
-
|
|
1356
|
-
if (
|
|
766
|
+
} else if (xmlData[i2 + 1] === "?") {
|
|
767
|
+
i2 = readPI(xmlData, ++i2);
|
|
768
|
+
if (i2.err) return i2;
|
|
1357
769
|
} else {
|
|
1358
770
|
break;
|
|
1359
771
|
}
|
|
1360
|
-
} else if (xmlData[
|
|
1361
|
-
const afterAmp = validateAmpersand(xmlData,
|
|
772
|
+
} else if (xmlData[i2] === "&") {
|
|
773
|
+
const afterAmp = validateAmpersand(xmlData, i2);
|
|
1362
774
|
if (afterAmp == -1)
|
|
1363
|
-
return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData,
|
|
1364
|
-
|
|
775
|
+
return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i2));
|
|
776
|
+
i2 = afterAmp;
|
|
1365
777
|
} else {
|
|
1366
|
-
if (reachedRoot === true && !isWhiteSpace(xmlData[
|
|
1367
|
-
return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData,
|
|
778
|
+
if (reachedRoot === true && !isWhiteSpace(xmlData[i2])) {
|
|
779
|
+
return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i2));
|
|
1368
780
|
}
|
|
1369
781
|
}
|
|
1370
782
|
}
|
|
1371
|
-
if (xmlData[
|
|
1372
|
-
|
|
783
|
+
if (xmlData[i2] === "<") {
|
|
784
|
+
i2--;
|
|
1373
785
|
}
|
|
1374
786
|
}
|
|
1375
787
|
} else {
|
|
1376
|
-
if (isWhiteSpace(xmlData[
|
|
788
|
+
if (isWhiteSpace(xmlData[i2])) {
|
|
1377
789
|
continue;
|
|
1378
790
|
}
|
|
1379
|
-
return getErrorObject("InvalidChar", "char '" + xmlData[
|
|
791
|
+
return getErrorObject("InvalidChar", "char '" + xmlData[i2] + "' is not expected.", getLineNumberForPosition(xmlData, i2));
|
|
1380
792
|
}
|
|
1381
793
|
}
|
|
1382
794
|
if (!tagFound) {
|
|
@@ -1384,88 +796,88 @@ validator$2.validate = function(xmlData, options) {
|
|
|
1384
796
|
} else if (tags.length == 1) {
|
|
1385
797
|
return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos));
|
|
1386
798
|
} else if (tags.length > 0) {
|
|
1387
|
-
return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((
|
|
799
|
+
return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
|
|
1388
800
|
}
|
|
1389
801
|
return true;
|
|
1390
802
|
};
|
|
1391
803
|
function isWhiteSpace(char) {
|
|
1392
804
|
return char === " " || char === " " || char === "\n" || char === "\r";
|
|
1393
805
|
}
|
|
1394
|
-
function readPI(xmlData,
|
|
1395
|
-
const start =
|
|
1396
|
-
for (;
|
|
1397
|
-
if (xmlData[
|
|
1398
|
-
const tagname = xmlData.substr(start,
|
|
1399
|
-
if (
|
|
1400
|
-
return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData,
|
|
1401
|
-
} else if (xmlData[
|
|
1402
|
-
|
|
806
|
+
function readPI(xmlData, i2) {
|
|
807
|
+
const start = i2;
|
|
808
|
+
for (; i2 < xmlData.length; i2++) {
|
|
809
|
+
if (xmlData[i2] == "?" || xmlData[i2] == " ") {
|
|
810
|
+
const tagname = xmlData.substr(start, i2 - start);
|
|
811
|
+
if (i2 > 5 && tagname === "xml") {
|
|
812
|
+
return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i2));
|
|
813
|
+
} else if (xmlData[i2] == "?" && xmlData[i2 + 1] == ">") {
|
|
814
|
+
i2++;
|
|
1403
815
|
break;
|
|
1404
816
|
} else {
|
|
1405
817
|
continue;
|
|
1406
818
|
}
|
|
1407
819
|
}
|
|
1408
820
|
}
|
|
1409
|
-
return
|
|
821
|
+
return i2;
|
|
1410
822
|
}
|
|
1411
|
-
function readCommentAndCDATA(xmlData,
|
|
1412
|
-
if (xmlData.length >
|
|
1413
|
-
for (
|
|
1414
|
-
if (xmlData[
|
|
1415
|
-
|
|
823
|
+
function readCommentAndCDATA(xmlData, i2) {
|
|
824
|
+
if (xmlData.length > i2 + 5 && xmlData[i2 + 1] === "-" && xmlData[i2 + 2] === "-") {
|
|
825
|
+
for (i2 += 3; i2 < xmlData.length; i2++) {
|
|
826
|
+
if (xmlData[i2] === "-" && xmlData[i2 + 1] === "-" && xmlData[i2 + 2] === ">") {
|
|
827
|
+
i2 += 2;
|
|
1416
828
|
break;
|
|
1417
829
|
}
|
|
1418
830
|
}
|
|
1419
|
-
} else if (xmlData.length >
|
|
831
|
+
} else if (xmlData.length > i2 + 8 && xmlData[i2 + 1] === "D" && xmlData[i2 + 2] === "O" && xmlData[i2 + 3] === "C" && xmlData[i2 + 4] === "T" && xmlData[i2 + 5] === "Y" && xmlData[i2 + 6] === "P" && xmlData[i2 + 7] === "E") {
|
|
1420
832
|
let angleBracketsCount = 1;
|
|
1421
|
-
for (
|
|
1422
|
-
if (xmlData[
|
|
833
|
+
for (i2 += 8; i2 < xmlData.length; i2++) {
|
|
834
|
+
if (xmlData[i2] === "<") {
|
|
1423
835
|
angleBracketsCount++;
|
|
1424
|
-
} else if (xmlData[
|
|
836
|
+
} else if (xmlData[i2] === ">") {
|
|
1425
837
|
angleBracketsCount--;
|
|
1426
838
|
if (angleBracketsCount === 0) {
|
|
1427
839
|
break;
|
|
1428
840
|
}
|
|
1429
841
|
}
|
|
1430
842
|
}
|
|
1431
|
-
} else if (xmlData.length >
|
|
1432
|
-
for (
|
|
1433
|
-
if (xmlData[
|
|
1434
|
-
|
|
843
|
+
} else if (xmlData.length > i2 + 9 && xmlData[i2 + 1] === "[" && xmlData[i2 + 2] === "C" && xmlData[i2 + 3] === "D" && xmlData[i2 + 4] === "A" && xmlData[i2 + 5] === "T" && xmlData[i2 + 6] === "A" && xmlData[i2 + 7] === "[") {
|
|
844
|
+
for (i2 += 8; i2 < xmlData.length; i2++) {
|
|
845
|
+
if (xmlData[i2] === "]" && xmlData[i2 + 1] === "]" && xmlData[i2 + 2] === ">") {
|
|
846
|
+
i2 += 2;
|
|
1435
847
|
break;
|
|
1436
848
|
}
|
|
1437
849
|
}
|
|
1438
850
|
}
|
|
1439
|
-
return
|
|
851
|
+
return i2;
|
|
1440
852
|
}
|
|
1441
853
|
const doubleQuote = '"';
|
|
1442
854
|
const singleQuote = "'";
|
|
1443
|
-
function readAttributeStr(xmlData,
|
|
855
|
+
function readAttributeStr(xmlData, i2) {
|
|
1444
856
|
let attrStr = "";
|
|
1445
857
|
let startChar = "";
|
|
1446
858
|
let tagClosed = false;
|
|
1447
|
-
for (;
|
|
1448
|
-
if (xmlData[
|
|
859
|
+
for (; i2 < xmlData.length; i2++) {
|
|
860
|
+
if (xmlData[i2] === doubleQuote || xmlData[i2] === singleQuote) {
|
|
1449
861
|
if (startChar === "") {
|
|
1450
|
-
startChar = xmlData[
|
|
1451
|
-
} else if (startChar !== xmlData[
|
|
862
|
+
startChar = xmlData[i2];
|
|
863
|
+
} else if (startChar !== xmlData[i2]) ;
|
|
1452
864
|
else {
|
|
1453
865
|
startChar = "";
|
|
1454
866
|
}
|
|
1455
|
-
} else if (xmlData[
|
|
867
|
+
} else if (xmlData[i2] === ">") {
|
|
1456
868
|
if (startChar === "") {
|
|
1457
869
|
tagClosed = true;
|
|
1458
870
|
break;
|
|
1459
871
|
}
|
|
1460
872
|
}
|
|
1461
|
-
attrStr += xmlData[
|
|
873
|
+
attrStr += xmlData[i2];
|
|
1462
874
|
}
|
|
1463
875
|
if (startChar !== "") {
|
|
1464
876
|
return false;
|
|
1465
877
|
}
|
|
1466
878
|
return {
|
|
1467
879
|
value: attrStr,
|
|
1468
|
-
index:
|
|
880
|
+
index: i2,
|
|
1469
881
|
tagClosed
|
|
1470
882
|
};
|
|
1471
883
|
}
|
|
@@ -1473,57 +885,57 @@ const validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\
|
|
|
1473
885
|
function validateAttributeString(attrStr, options) {
|
|
1474
886
|
const matches = util$2.getAllMatches(attrStr, validAttrStrRegxp);
|
|
1475
887
|
const attrNames = {};
|
|
1476
|
-
for (let
|
|
1477
|
-
if (matches[
|
|
1478
|
-
return getErrorObject("InvalidAttr", "Attribute '" + matches[
|
|
1479
|
-
} else if (matches[
|
|
1480
|
-
return getErrorObject("InvalidAttr", "Attribute '" + matches[
|
|
1481
|
-
} else if (matches[
|
|
1482
|
-
return getErrorObject("InvalidAttr", "boolean attribute '" + matches[
|
|
1483
|
-
}
|
|
1484
|
-
const attrName = matches[
|
|
888
|
+
for (let i2 = 0; i2 < matches.length; i2++) {
|
|
889
|
+
if (matches[i2][1].length === 0) {
|
|
890
|
+
return getErrorObject("InvalidAttr", "Attribute '" + matches[i2][2] + "' has no space in starting.", getPositionFromMatch(matches[i2]));
|
|
891
|
+
} else if (matches[i2][3] !== void 0 && matches[i2][4] === void 0) {
|
|
892
|
+
return getErrorObject("InvalidAttr", "Attribute '" + matches[i2][2] + "' is without value.", getPositionFromMatch(matches[i2]));
|
|
893
|
+
} else if (matches[i2][3] === void 0 && !options.allowBooleanAttributes) {
|
|
894
|
+
return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i2][2] + "' is not allowed.", getPositionFromMatch(matches[i2]));
|
|
895
|
+
}
|
|
896
|
+
const attrName = matches[i2][2];
|
|
1485
897
|
if (!validateAttrName(attrName)) {
|
|
1486
|
-
return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[
|
|
898
|
+
return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i2]));
|
|
1487
899
|
}
|
|
1488
900
|
if (!attrNames.hasOwnProperty(attrName)) {
|
|
1489
901
|
attrNames[attrName] = 1;
|
|
1490
902
|
} else {
|
|
1491
|
-
return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[
|
|
903
|
+
return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i2]));
|
|
1492
904
|
}
|
|
1493
905
|
}
|
|
1494
906
|
return true;
|
|
1495
907
|
}
|
|
1496
|
-
function validateNumberAmpersand(xmlData,
|
|
908
|
+
function validateNumberAmpersand(xmlData, i2) {
|
|
1497
909
|
let re2 = /\d/;
|
|
1498
|
-
if (xmlData[
|
|
1499
|
-
|
|
910
|
+
if (xmlData[i2] === "x") {
|
|
911
|
+
i2++;
|
|
1500
912
|
re2 = /[\da-fA-F]/;
|
|
1501
913
|
}
|
|
1502
|
-
for (;
|
|
1503
|
-
if (xmlData[
|
|
1504
|
-
return
|
|
1505
|
-
if (!xmlData[
|
|
914
|
+
for (; i2 < xmlData.length; i2++) {
|
|
915
|
+
if (xmlData[i2] === ";")
|
|
916
|
+
return i2;
|
|
917
|
+
if (!xmlData[i2].match(re2))
|
|
1506
918
|
break;
|
|
1507
919
|
}
|
|
1508
920
|
return -1;
|
|
1509
921
|
}
|
|
1510
|
-
function validateAmpersand(xmlData,
|
|
1511
|
-
|
|
1512
|
-
if (xmlData[
|
|
922
|
+
function validateAmpersand(xmlData, i2) {
|
|
923
|
+
i2++;
|
|
924
|
+
if (xmlData[i2] === ";")
|
|
1513
925
|
return -1;
|
|
1514
|
-
if (xmlData[
|
|
1515
|
-
|
|
1516
|
-
return validateNumberAmpersand(xmlData,
|
|
926
|
+
if (xmlData[i2] === "#") {
|
|
927
|
+
i2++;
|
|
928
|
+
return validateNumberAmpersand(xmlData, i2);
|
|
1517
929
|
}
|
|
1518
930
|
let count = 0;
|
|
1519
|
-
for (;
|
|
1520
|
-
if (xmlData[
|
|
931
|
+
for (; i2 < xmlData.length; i2++, count++) {
|
|
932
|
+
if (xmlData[i2].match(/\w/) && count < 20)
|
|
1521
933
|
continue;
|
|
1522
|
-
if (xmlData[
|
|
934
|
+
if (xmlData[i2] === ";")
|
|
1523
935
|
break;
|
|
1524
936
|
return -1;
|
|
1525
937
|
}
|
|
1526
|
-
return
|
|
938
|
+
return i2;
|
|
1527
939
|
}
|
|
1528
940
|
function getErrorObject(code, message, lineNumber) {
|
|
1529
941
|
return {
|
|
@@ -1623,33 +1035,33 @@ class XmlNode {
|
|
|
1623
1035
|
}
|
|
1624
1036
|
var xmlNode$1 = XmlNode;
|
|
1625
1037
|
const util$1 = util$3;
|
|
1626
|
-
function readDocType$1(xmlData,
|
|
1038
|
+
function readDocType$1(xmlData, i2) {
|
|
1627
1039
|
const entities = {};
|
|
1628
|
-
if (xmlData[
|
|
1629
|
-
|
|
1040
|
+
if (xmlData[i2 + 3] === "O" && xmlData[i2 + 4] === "C" && xmlData[i2 + 5] === "T" && xmlData[i2 + 6] === "Y" && xmlData[i2 + 7] === "P" && xmlData[i2 + 8] === "E") {
|
|
1041
|
+
i2 = i2 + 9;
|
|
1630
1042
|
let angleBracketsCount = 1;
|
|
1631
1043
|
let hasBody = false, comment = false;
|
|
1632
1044
|
let exp = "";
|
|
1633
|
-
for (;
|
|
1634
|
-
if (xmlData[
|
|
1635
|
-
if (hasBody && isEntity(xmlData,
|
|
1636
|
-
|
|
1637
|
-
[entityName, val,
|
|
1045
|
+
for (; i2 < xmlData.length; i2++) {
|
|
1046
|
+
if (xmlData[i2] === "<" && !comment) {
|
|
1047
|
+
if (hasBody && isEntity(xmlData, i2)) {
|
|
1048
|
+
i2 += 7;
|
|
1049
|
+
[entityName, val, i2] = readEntityExp(xmlData, i2 + 1);
|
|
1638
1050
|
if (val.indexOf("&") === -1)
|
|
1639
1051
|
entities[validateEntityName(entityName)] = {
|
|
1640
1052
|
regx: RegExp(`&${entityName};`, "g"),
|
|
1641
1053
|
val
|
|
1642
1054
|
};
|
|
1643
|
-
} else if (hasBody && isElement(xmlData,
|
|
1644
|
-
else if (hasBody && isAttlist(xmlData,
|
|
1645
|
-
else if (hasBody && isNotation(xmlData,
|
|
1055
|
+
} else if (hasBody && isElement(xmlData, i2)) i2 += 8;
|
|
1056
|
+
else if (hasBody && isAttlist(xmlData, i2)) i2 += 8;
|
|
1057
|
+
else if (hasBody && isNotation(xmlData, i2)) i2 += 9;
|
|
1646
1058
|
else if (isComment) comment = true;
|
|
1647
1059
|
else throw new Error("Invalid DOCTYPE");
|
|
1648
1060
|
angleBracketsCount++;
|
|
1649
1061
|
exp = "";
|
|
1650
|
-
} else if (xmlData[
|
|
1062
|
+
} else if (xmlData[i2] === ">") {
|
|
1651
1063
|
if (comment) {
|
|
1652
|
-
if (xmlData[
|
|
1064
|
+
if (xmlData[i2 - 1] === "-" && xmlData[i2 - 2] === "-") {
|
|
1653
1065
|
comment = false;
|
|
1654
1066
|
angleBracketsCount--;
|
|
1655
1067
|
}
|
|
@@ -1659,10 +1071,10 @@ function readDocType$1(xmlData, i) {
|
|
|
1659
1071
|
if (angleBracketsCount === 0) {
|
|
1660
1072
|
break;
|
|
1661
1073
|
}
|
|
1662
|
-
} else if (xmlData[
|
|
1074
|
+
} else if (xmlData[i2] === "[") {
|
|
1663
1075
|
hasBody = true;
|
|
1664
1076
|
} else {
|
|
1665
|
-
exp += xmlData[
|
|
1077
|
+
exp += xmlData[i2];
|
|
1666
1078
|
}
|
|
1667
1079
|
}
|
|
1668
1080
|
if (angleBracketsCount !== 0) {
|
|
@@ -1671,40 +1083,40 @@ function readDocType$1(xmlData, i) {
|
|
|
1671
1083
|
} else {
|
|
1672
1084
|
throw new Error(`Invalid Tag instead of DOCTYPE`);
|
|
1673
1085
|
}
|
|
1674
|
-
return { entities, i };
|
|
1086
|
+
return { entities, i: i2 };
|
|
1675
1087
|
}
|
|
1676
|
-
function readEntityExp(xmlData,
|
|
1088
|
+
function readEntityExp(xmlData, i2) {
|
|
1677
1089
|
let entityName2 = "";
|
|
1678
|
-
for (;
|
|
1679
|
-
entityName2 += xmlData[
|
|
1090
|
+
for (; i2 < xmlData.length && (xmlData[i2] !== "'" && xmlData[i2] !== '"'); i2++) {
|
|
1091
|
+
entityName2 += xmlData[i2];
|
|
1680
1092
|
}
|
|
1681
1093
|
entityName2 = entityName2.trim();
|
|
1682
1094
|
if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported");
|
|
1683
|
-
const startChar = xmlData[
|
|
1095
|
+
const startChar = xmlData[i2++];
|
|
1684
1096
|
let val2 = "";
|
|
1685
|
-
for (;
|
|
1686
|
-
val2 += xmlData[
|
|
1097
|
+
for (; i2 < xmlData.length && xmlData[i2] !== startChar; i2++) {
|
|
1098
|
+
val2 += xmlData[i2];
|
|
1687
1099
|
}
|
|
1688
|
-
return [entityName2, val2,
|
|
1100
|
+
return [entityName2, val2, i2];
|
|
1689
1101
|
}
|
|
1690
|
-
function isComment(xmlData,
|
|
1691
|
-
if (xmlData[
|
|
1102
|
+
function isComment(xmlData, i2) {
|
|
1103
|
+
if (xmlData[i2 + 1] === "!" && xmlData[i2 + 2] === "-" && xmlData[i2 + 3] === "-") return true;
|
|
1692
1104
|
return false;
|
|
1693
1105
|
}
|
|
1694
|
-
function isEntity(xmlData,
|
|
1695
|
-
if (xmlData[
|
|
1106
|
+
function isEntity(xmlData, i2) {
|
|
1107
|
+
if (xmlData[i2 + 1] === "!" && xmlData[i2 + 2] === "E" && xmlData[i2 + 3] === "N" && xmlData[i2 + 4] === "T" && xmlData[i2 + 5] === "I" && xmlData[i2 + 6] === "T" && xmlData[i2 + 7] === "Y") return true;
|
|
1696
1108
|
return false;
|
|
1697
1109
|
}
|
|
1698
|
-
function isElement(xmlData,
|
|
1699
|
-
if (xmlData[
|
|
1110
|
+
function isElement(xmlData, i2) {
|
|
1111
|
+
if (xmlData[i2 + 1] === "!" && xmlData[i2 + 2] === "E" && xmlData[i2 + 3] === "L" && xmlData[i2 + 4] === "E" && xmlData[i2 + 5] === "M" && xmlData[i2 + 6] === "E" && xmlData[i2 + 7] === "N" && xmlData[i2 + 8] === "T") return true;
|
|
1700
1112
|
return false;
|
|
1701
1113
|
}
|
|
1702
|
-
function isAttlist(xmlData,
|
|
1703
|
-
if (xmlData[
|
|
1114
|
+
function isAttlist(xmlData, i2) {
|
|
1115
|
+
if (xmlData[i2 + 1] === "!" && xmlData[i2 + 2] === "A" && xmlData[i2 + 3] === "T" && xmlData[i2 + 4] === "T" && xmlData[i2 + 5] === "L" && xmlData[i2 + 6] === "I" && xmlData[i2 + 7] === "S" && xmlData[i2 + 8] === "T") return true;
|
|
1704
1116
|
return false;
|
|
1705
1117
|
}
|
|
1706
|
-
function isNotation(xmlData,
|
|
1707
|
-
if (xmlData[
|
|
1118
|
+
function isNotation(xmlData, i2) {
|
|
1119
|
+
if (xmlData[i2 + 1] === "!" && xmlData[i2 + 2] === "N" && xmlData[i2 + 3] === "O" && xmlData[i2 + 4] === "T" && xmlData[i2 + 5] === "A" && xmlData[i2 + 6] === "T" && xmlData[i2 + 7] === "I" && xmlData[i2 + 8] === "O" && xmlData[i2 + 9] === "N") return true;
|
|
1708
1120
|
return false;
|
|
1709
1121
|
}
|
|
1710
1122
|
function validateEntityName(name) {
|
|
@@ -1854,8 +1266,8 @@ let OrderedObjParser$1 = class OrderedObjParser {
|
|
|
1854
1266
|
};
|
|
1855
1267
|
function addExternalEntities(externalEntities) {
|
|
1856
1268
|
const entKeys = Object.keys(externalEntities);
|
|
1857
|
-
for (let
|
|
1858
|
-
const ent = entKeys[
|
|
1269
|
+
for (let i2 = 0; i2 < entKeys.length; i2++) {
|
|
1270
|
+
const ent = entKeys[i2];
|
|
1859
1271
|
this.lastEntities[ent] = {
|
|
1860
1272
|
regex: new RegExp("&" + ent + ";", "g"),
|
|
1861
1273
|
val: externalEntities[ent]
|
|
@@ -1906,12 +1318,12 @@ function buildAttributesMap(attrStr, jPath, tagName) {
|
|
|
1906
1318
|
const matches = util.getAllMatches(attrStr, attrsRegx);
|
|
1907
1319
|
const len = matches.length;
|
|
1908
1320
|
const attrs = {};
|
|
1909
|
-
for (let
|
|
1910
|
-
const attrName = this.resolveNameSpace(matches[
|
|
1321
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
1322
|
+
const attrName = this.resolveNameSpace(matches[i2][1]);
|
|
1911
1323
|
if (this.ignoreAttributesFn(attrName, jPath)) {
|
|
1912
1324
|
continue;
|
|
1913
1325
|
}
|
|
1914
|
-
let oldVal = matches[
|
|
1326
|
+
let oldVal = matches[i2][4];
|
|
1915
1327
|
let aName = this.options.attributeNamePrefix + attrName;
|
|
1916
1328
|
if (attrName.length) {
|
|
1917
1329
|
if (this.options.transformAttributeName) {
|
|
@@ -1957,12 +1369,12 @@ const parseXml = function(xmlData) {
|
|
|
1957
1369
|
let currentNode = xmlObj;
|
|
1958
1370
|
let textData = "";
|
|
1959
1371
|
let jPath = "";
|
|
1960
|
-
for (let
|
|
1961
|
-
const ch = xmlData[
|
|
1372
|
+
for (let i2 = 0; i2 < xmlData.length; i2++) {
|
|
1373
|
+
const ch = xmlData[i2];
|
|
1962
1374
|
if (ch === "<") {
|
|
1963
|
-
if (xmlData[
|
|
1964
|
-
const closeIndex = findClosingIndex(xmlData, ">",
|
|
1965
|
-
let tagName = xmlData.substring(
|
|
1375
|
+
if (xmlData[i2 + 1] === "/") {
|
|
1376
|
+
const closeIndex = findClosingIndex(xmlData, ">", i2, "Closing Tag is not closed.");
|
|
1377
|
+
let tagName = xmlData.substring(i2 + 2, closeIndex).trim();
|
|
1966
1378
|
if (this.options.removeNSPrefix) {
|
|
1967
1379
|
const colonIndex = tagName.indexOf(":");
|
|
1968
1380
|
if (colonIndex !== -1) {
|
|
@@ -1989,9 +1401,9 @@ const parseXml = function(xmlData) {
|
|
|
1989
1401
|
jPath = jPath.substring(0, propIndex);
|
|
1990
1402
|
currentNode = this.tagsNodeStack.pop();
|
|
1991
1403
|
textData = "";
|
|
1992
|
-
|
|
1993
|
-
} else if (xmlData[
|
|
1994
|
-
let tagData = readTagExp(xmlData,
|
|
1404
|
+
i2 = closeIndex;
|
|
1405
|
+
} else if (xmlData[i2 + 1] === "?") {
|
|
1406
|
+
let tagData = readTagExp(xmlData, i2, false, "?>");
|
|
1995
1407
|
if (!tagData) throw new Error("Pi Tag is not closed.");
|
|
1996
1408
|
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
1997
1409
|
if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) ;
|
|
@@ -2003,22 +1415,22 @@ const parseXml = function(xmlData) {
|
|
|
2003
1415
|
}
|
|
2004
1416
|
this.addChild(currentNode, childNode, jPath);
|
|
2005
1417
|
}
|
|
2006
|
-
|
|
2007
|
-
} else if (xmlData.substr(
|
|
2008
|
-
const endIndex = findClosingIndex(xmlData, "-->",
|
|
1418
|
+
i2 = tagData.closeIndex + 1;
|
|
1419
|
+
} else if (xmlData.substr(i2 + 1, 3) === "!--") {
|
|
1420
|
+
const endIndex = findClosingIndex(xmlData, "-->", i2 + 4, "Comment is not closed.");
|
|
2009
1421
|
if (this.options.commentPropName) {
|
|
2010
|
-
const comment = xmlData.substring(
|
|
1422
|
+
const comment = xmlData.substring(i2 + 4, endIndex - 2);
|
|
2011
1423
|
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
2012
1424
|
currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]);
|
|
2013
1425
|
}
|
|
2014
|
-
|
|
2015
|
-
} else if (xmlData.substr(
|
|
2016
|
-
const result = readDocType(xmlData,
|
|
1426
|
+
i2 = endIndex;
|
|
1427
|
+
} else if (xmlData.substr(i2 + 1, 2) === "!D") {
|
|
1428
|
+
const result = readDocType(xmlData, i2);
|
|
2017
1429
|
this.docTypeEntities = result.entities;
|
|
2018
|
-
|
|
2019
|
-
} else if (xmlData.substr(
|
|
2020
|
-
const closeIndex = findClosingIndex(xmlData, "]]>",
|
|
2021
|
-
const tagExp = xmlData.substring(
|
|
1430
|
+
i2 = result.i;
|
|
1431
|
+
} else if (xmlData.substr(i2 + 1, 2) === "![") {
|
|
1432
|
+
const closeIndex = findClosingIndex(xmlData, "]]>", i2, "CDATA is not closed.") - 2;
|
|
1433
|
+
const tagExp = xmlData.substring(i2 + 9, closeIndex);
|
|
2022
1434
|
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
2023
1435
|
let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true);
|
|
2024
1436
|
if (val2 == void 0) val2 = "";
|
|
@@ -2027,9 +1439,9 @@ const parseXml = function(xmlData) {
|
|
|
2027
1439
|
} else {
|
|
2028
1440
|
currentNode.add(this.options.textNodeName, val2);
|
|
2029
1441
|
}
|
|
2030
|
-
|
|
1442
|
+
i2 = closeIndex + 2;
|
|
2031
1443
|
} else {
|
|
2032
|
-
let result = readTagExp(xmlData,
|
|
1444
|
+
let result = readTagExp(xmlData, i2, this.options.removeNSPrefix);
|
|
2033
1445
|
let tagName = result.tagName;
|
|
2034
1446
|
const rawTagName = result.rawTagName;
|
|
2035
1447
|
let tagExp = result.tagExp;
|
|
@@ -2061,13 +1473,13 @@ const parseXml = function(xmlData) {
|
|
|
2061
1473
|
} else {
|
|
2062
1474
|
tagExp = tagExp.substr(0, tagExp.length - 1);
|
|
2063
1475
|
}
|
|
2064
|
-
|
|
1476
|
+
i2 = result.closeIndex;
|
|
2065
1477
|
} else if (this.options.unpairedTags.indexOf(tagName) !== -1) {
|
|
2066
|
-
|
|
1478
|
+
i2 = result.closeIndex;
|
|
2067
1479
|
} else {
|
|
2068
1480
|
const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1);
|
|
2069
1481
|
if (!result2) throw new Error(`Unexpected end of ${rawTagName}`);
|
|
2070
|
-
|
|
1482
|
+
i2 = result2.i;
|
|
2071
1483
|
tagContent = result2.tagContent;
|
|
2072
1484
|
}
|
|
2073
1485
|
const childNode = new xmlNode(tagName);
|
|
@@ -2108,11 +1520,11 @@ const parseXml = function(xmlData) {
|
|
|
2108
1520
|
currentNode = childNode;
|
|
2109
1521
|
}
|
|
2110
1522
|
textData = "";
|
|
2111
|
-
|
|
1523
|
+
i2 = closeIndex;
|
|
2112
1524
|
}
|
|
2113
1525
|
}
|
|
2114
1526
|
} else {
|
|
2115
|
-
textData += xmlData[
|
|
1527
|
+
textData += xmlData[i2];
|
|
2116
1528
|
}
|
|
2117
1529
|
}
|
|
2118
1530
|
return xmlObj.child;
|
|
@@ -2172,10 +1584,10 @@ function isItStopNode(stopNodes, jPath, currentTagName) {
|
|
|
2172
1584
|
}
|
|
2173
1585
|
return false;
|
|
2174
1586
|
}
|
|
2175
|
-
function tagExpWithClosingIndex(xmlData,
|
|
1587
|
+
function tagExpWithClosingIndex(xmlData, i2, closingChar = ">") {
|
|
2176
1588
|
let attrBoundary;
|
|
2177
1589
|
let tagExp = "";
|
|
2178
|
-
for (let index =
|
|
1590
|
+
for (let index = i2; index < xmlData.length; index++) {
|
|
2179
1591
|
let ch = xmlData[index];
|
|
2180
1592
|
if (attrBoundary) {
|
|
2181
1593
|
if (ch === attrBoundary) attrBoundary = "";
|
|
@@ -2201,16 +1613,16 @@ function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
|
|
|
2201
1613
|
tagExp += ch;
|
|
2202
1614
|
}
|
|
2203
1615
|
}
|
|
2204
|
-
function findClosingIndex(xmlData, str,
|
|
2205
|
-
const closingIndex = xmlData.indexOf(str,
|
|
1616
|
+
function findClosingIndex(xmlData, str, i2, errMsg) {
|
|
1617
|
+
const closingIndex = xmlData.indexOf(str, i2);
|
|
2206
1618
|
if (closingIndex === -1) {
|
|
2207
1619
|
throw new Error(errMsg);
|
|
2208
1620
|
} else {
|
|
2209
1621
|
return closingIndex + str.length - 1;
|
|
2210
1622
|
}
|
|
2211
1623
|
}
|
|
2212
|
-
function readTagExp(xmlData,
|
|
2213
|
-
const result = tagExpWithClosingIndex(xmlData,
|
|
1624
|
+
function readTagExp(xmlData, i2, removeNSPrefix, closingChar = ">") {
|
|
1625
|
+
const result = tagExpWithClosingIndex(xmlData, i2 + 1, closingChar);
|
|
2214
1626
|
if (!result) return;
|
|
2215
1627
|
let tagExp = result.data;
|
|
2216
1628
|
const closeIndex = result.index;
|
|
@@ -2237,41 +1649,41 @@ function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
|
|
|
2237
1649
|
rawTagName
|
|
2238
1650
|
};
|
|
2239
1651
|
}
|
|
2240
|
-
function readStopNodeData(xmlData, tagName,
|
|
2241
|
-
const startIndex =
|
|
1652
|
+
function readStopNodeData(xmlData, tagName, i2) {
|
|
1653
|
+
const startIndex = i2;
|
|
2242
1654
|
let openTagCount = 1;
|
|
2243
|
-
for (;
|
|
2244
|
-
if (xmlData[
|
|
2245
|
-
if (xmlData[
|
|
2246
|
-
const closeIndex = findClosingIndex(xmlData, ">",
|
|
2247
|
-
let closeTagName = xmlData.substring(
|
|
1655
|
+
for (; i2 < xmlData.length; i2++) {
|
|
1656
|
+
if (xmlData[i2] === "<") {
|
|
1657
|
+
if (xmlData[i2 + 1] === "/") {
|
|
1658
|
+
const closeIndex = findClosingIndex(xmlData, ">", i2, `${tagName} is not closed`);
|
|
1659
|
+
let closeTagName = xmlData.substring(i2 + 2, closeIndex).trim();
|
|
2248
1660
|
if (closeTagName === tagName) {
|
|
2249
1661
|
openTagCount--;
|
|
2250
1662
|
if (openTagCount === 0) {
|
|
2251
1663
|
return {
|
|
2252
|
-
tagContent: xmlData.substring(startIndex,
|
|
1664
|
+
tagContent: xmlData.substring(startIndex, i2),
|
|
2253
1665
|
i: closeIndex
|
|
2254
1666
|
};
|
|
2255
1667
|
}
|
|
2256
1668
|
}
|
|
2257
|
-
|
|
2258
|
-
} else if (xmlData[
|
|
2259
|
-
const closeIndex = findClosingIndex(xmlData, "?>",
|
|
2260
|
-
|
|
2261
|
-
} else if (xmlData.substr(
|
|
2262
|
-
const closeIndex = findClosingIndex(xmlData, "-->",
|
|
2263
|
-
|
|
2264
|
-
} else if (xmlData.substr(
|
|
2265
|
-
const closeIndex = findClosingIndex(xmlData, "]]>",
|
|
2266
|
-
|
|
1669
|
+
i2 = closeIndex;
|
|
1670
|
+
} else if (xmlData[i2 + 1] === "?") {
|
|
1671
|
+
const closeIndex = findClosingIndex(xmlData, "?>", i2 + 1, "StopNode is not closed.");
|
|
1672
|
+
i2 = closeIndex;
|
|
1673
|
+
} else if (xmlData.substr(i2 + 1, 3) === "!--") {
|
|
1674
|
+
const closeIndex = findClosingIndex(xmlData, "-->", i2 + 3, "StopNode is not closed.");
|
|
1675
|
+
i2 = closeIndex;
|
|
1676
|
+
} else if (xmlData.substr(i2 + 1, 2) === "![") {
|
|
1677
|
+
const closeIndex = findClosingIndex(xmlData, "]]>", i2, "StopNode is not closed.") - 2;
|
|
1678
|
+
i2 = closeIndex;
|
|
2267
1679
|
} else {
|
|
2268
|
-
const tagData = readTagExp(xmlData,
|
|
1680
|
+
const tagData = readTagExp(xmlData, i2, ">");
|
|
2269
1681
|
if (tagData) {
|
|
2270
1682
|
const openTagName = tagData && tagData.tagName;
|
|
2271
1683
|
if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") {
|
|
2272
1684
|
openTagCount++;
|
|
2273
1685
|
}
|
|
2274
|
-
|
|
1686
|
+
i2 = tagData.closeIndex;
|
|
2275
1687
|
}
|
|
2276
1688
|
}
|
|
2277
1689
|
}
|
|
@@ -2299,8 +1711,8 @@ function prettify$1(node, options) {
|
|
|
2299
1711
|
function compress(arr, options, jPath) {
|
|
2300
1712
|
let text;
|
|
2301
1713
|
const compressedObj = {};
|
|
2302
|
-
for (let
|
|
2303
|
-
const tagObj = arr[
|
|
1714
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1715
|
+
const tagObj = arr[i2];
|
|
2304
1716
|
const property = propName$1(tagObj);
|
|
2305
1717
|
let newJpath = "";
|
|
2306
1718
|
if (jPath === void 0) newJpath = property;
|
|
@@ -2342,8 +1754,8 @@ function compress(arr, options, jPath) {
|
|
|
2342
1754
|
}
|
|
2343
1755
|
function propName$1(obj) {
|
|
2344
1756
|
const keys = Object.keys(obj);
|
|
2345
|
-
for (let
|
|
2346
|
-
const key = keys[
|
|
1757
|
+
for (let i2 = 0; i2 < keys.length; i2++) {
|
|
1758
|
+
const key = keys[i2];
|
|
2347
1759
|
if (key !== ":@") return key;
|
|
2348
1760
|
}
|
|
2349
1761
|
}
|
|
@@ -2351,8 +1763,8 @@ function assignAttributes(obj, attrMap, jpath, options) {
|
|
|
2351
1763
|
if (attrMap) {
|
|
2352
1764
|
const keys = Object.keys(attrMap);
|
|
2353
1765
|
const len = keys.length;
|
|
2354
|
-
for (let
|
|
2355
|
-
const atrrName = keys[
|
|
1766
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
1767
|
+
const atrrName = keys[i2];
|
|
2356
1768
|
if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) {
|
|
2357
1769
|
obj[atrrName] = [attrMap[atrrName]];
|
|
2358
1770
|
} else {
|
|
@@ -2436,8 +1848,8 @@ function toXml(jArray, options) {
|
|
|
2436
1848
|
function arrToStr(arr, options, jPath, indentation) {
|
|
2437
1849
|
let xmlStr = "";
|
|
2438
1850
|
let isPreviousElementTag = false;
|
|
2439
|
-
for (let
|
|
2440
|
-
const tagObj = arr[
|
|
1851
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1852
|
+
const tagObj = arr[i2];
|
|
2441
1853
|
const tagName = propName(tagObj);
|
|
2442
1854
|
if (tagName === void 0) continue;
|
|
2443
1855
|
let newJPath = "";
|
|
@@ -2504,8 +1916,8 @@ function arrToStr(arr, options, jPath, indentation) {
|
|
|
2504
1916
|
}
|
|
2505
1917
|
function propName(obj) {
|
|
2506
1918
|
const keys = Object.keys(obj);
|
|
2507
|
-
for (let
|
|
2508
|
-
const key = keys[
|
|
1919
|
+
for (let i2 = 0; i2 < keys.length; i2++) {
|
|
1920
|
+
const key = keys[i2];
|
|
2509
1921
|
if (!obj.hasOwnProperty(key)) continue;
|
|
2510
1922
|
if (key !== ":@") return key;
|
|
2511
1923
|
}
|
|
@@ -2536,8 +1948,8 @@ function isStopNode(jPath, options) {
|
|
|
2536
1948
|
}
|
|
2537
1949
|
function replaceEntitiesValue(textValue, options) {
|
|
2538
1950
|
if (textValue && textValue.length > 0 && options.processEntities) {
|
|
2539
|
-
for (let
|
|
2540
|
-
const entity = options.entities[
|
|
1951
|
+
for (let i2 = 0; i2 < options.entities.length; i2++) {
|
|
1952
|
+
const entity = options.entities[i2];
|
|
2541
1953
|
textValue = textValue.replace(entity.regex, entity.val);
|
|
2542
1954
|
}
|
|
2543
1955
|
}
|
|
@@ -2557,11 +1969,11 @@ const defaultOptions = {
|
|
|
2557
1969
|
suppressEmptyNode: false,
|
|
2558
1970
|
suppressUnpairedNode: true,
|
|
2559
1971
|
suppressBooleanAttributes: true,
|
|
2560
|
-
tagValueProcessor: function(key,
|
|
2561
|
-
return
|
|
1972
|
+
tagValueProcessor: function(key, a2) {
|
|
1973
|
+
return a2;
|
|
2562
1974
|
},
|
|
2563
|
-
attributeValueProcessor: function(attrName,
|
|
2564
|
-
return
|
|
1975
|
+
attributeValueProcessor: function(attrName, a2) {
|
|
1976
|
+
return a2;
|
|
2565
1977
|
},
|
|
2566
1978
|
preserveOrder: false,
|
|
2567
1979
|
commentPropName: false,
|
|
@@ -2652,8 +2064,8 @@ Builder.prototype.j2x = function(jObj, level, ajPath) {
|
|
|
2652
2064
|
const arrLen = jObj[key].length;
|
|
2653
2065
|
let listTagVal = "";
|
|
2654
2066
|
let listTagAttr = "";
|
|
2655
|
-
for (let
|
|
2656
|
-
const item = jObj[key][
|
|
2067
|
+
for (let j2 = 0; j2 < arrLen; j2++) {
|
|
2068
|
+
const item = jObj[key][j2];
|
|
2657
2069
|
if (typeof item === "undefined") ;
|
|
2658
2070
|
else if (item === null) {
|
|
2659
2071
|
if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar;
|
|
@@ -2686,8 +2098,8 @@ Builder.prototype.j2x = function(jObj, level, ajPath) {
|
|
|
2686
2098
|
if (this.options.attributesGroupName && key === this.options.attributesGroupName) {
|
|
2687
2099
|
const Ks = Object.keys(jObj[key]);
|
|
2688
2100
|
const L = Ks.length;
|
|
2689
|
-
for (let
|
|
2690
|
-
attrStr += this.buildAttrPairStr(Ks[
|
|
2101
|
+
for (let j2 = 0; j2 < L; j2++) {
|
|
2102
|
+
attrStr += this.buildAttrPairStr(Ks[j2], "" + jObj[key][Ks[j2]]);
|
|
2691
2103
|
}
|
|
2692
2104
|
} else {
|
|
2693
2105
|
val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath);
|
|
@@ -2763,8 +2175,8 @@ Builder.prototype.buildTextValNode = function(val2, key, attrStr, level) {
|
|
|
2763
2175
|
};
|
|
2764
2176
|
Builder.prototype.replaceEntitiesValue = function(textValue) {
|
|
2765
2177
|
if (textValue && textValue.length > 0 && this.options.processEntities) {
|
|
2766
|
-
for (let
|
|
2767
|
-
const entity = this.options.entities[
|
|
2178
|
+
for (let i2 = 0; i2 < this.options.entities.length; i2++) {
|
|
2179
|
+
const entity = this.options.entities[i2];
|
|
2768
2180
|
textValue = textValue.replace(entity.regex, entity.val);
|
|
2769
2181
|
}
|
|
2770
2182
|
}
|
|
@@ -2889,8 +2301,8 @@ const isValidView = function(view) {
|
|
|
2889
2301
|
if (!view.name || typeof view.name !== "string") {
|
|
2890
2302
|
throw new Error("View name is required and must be a string");
|
|
2891
2303
|
}
|
|
2892
|
-
if (
|
|
2893
|
-
throw new Error("View caption
|
|
2304
|
+
if ("caption" in view && typeof view.caption !== "string") {
|
|
2305
|
+
throw new Error("View caption must be a string");
|
|
2894
2306
|
}
|
|
2895
2307
|
if (!view.getContents || typeof view.getContents !== "function") {
|
|
2896
2308
|
throw new Error("View getContents is required and must be a function");
|
|
@@ -2968,7 +2380,7 @@ var re$1 = { exports: {} };
|
|
|
2968
2380
|
const re2 = exports.re = [];
|
|
2969
2381
|
const safeRe = exports.safeRe = [];
|
|
2970
2382
|
const src = exports.src = [];
|
|
2971
|
-
const
|
|
2383
|
+
const t3 = exports.t = {};
|
|
2972
2384
|
let R = 0;
|
|
2973
2385
|
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
2974
2386
|
const safeRegexReplacements = [
|
|
@@ -2986,7 +2398,7 @@ var re$1 = { exports: {} };
|
|
|
2986
2398
|
const safe = makeSafeRegex(value);
|
|
2987
2399
|
const index = R++;
|
|
2988
2400
|
debug2(name, index, value);
|
|
2989
|
-
|
|
2401
|
+
t3[name] = index;
|
|
2990
2402
|
src[index] = value;
|
|
2991
2403
|
re2[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
2992
2404
|
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
@@ -2994,46 +2406,46 @@ var re$1 = { exports: {} };
|
|
|
2994
2406
|
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
2995
2407
|
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
2996
2408
|
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
2997
|
-
createToken("MAINVERSION", `(${src[
|
|
2998
|
-
createToken("MAINVERSIONLOOSE", `(${src[
|
|
2999
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[
|
|
3000
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[
|
|
3001
|
-
createToken("PRERELEASE", `(?:-(${src[
|
|
3002
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[
|
|
2409
|
+
createToken("MAINVERSION", `(${src[t3.NUMERICIDENTIFIER]})\\.(${src[t3.NUMERICIDENTIFIER]})\\.(${src[t3.NUMERICIDENTIFIER]})`);
|
|
2410
|
+
createToken("MAINVERSIONLOOSE", `(${src[t3.NUMERICIDENTIFIERLOOSE]})\\.(${src[t3.NUMERICIDENTIFIERLOOSE]})\\.(${src[t3.NUMERICIDENTIFIERLOOSE]})`);
|
|
2411
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t3.NUMERICIDENTIFIER]}|${src[t3.NONNUMERICIDENTIFIER]})`);
|
|
2412
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t3.NUMERICIDENTIFIERLOOSE]}|${src[t3.NONNUMERICIDENTIFIER]})`);
|
|
2413
|
+
createToken("PRERELEASE", `(?:-(${src[t3.PRERELEASEIDENTIFIER]}(?:\\.${src[t3.PRERELEASEIDENTIFIER]})*))`);
|
|
2414
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t3.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t3.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
3003
2415
|
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
3004
|
-
createToken("BUILD", `(?:\\+(${src[
|
|
3005
|
-
createToken("FULLPLAIN", `v?${src[
|
|
3006
|
-
createToken("FULL", `^${src[
|
|
3007
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[
|
|
3008
|
-
createToken("LOOSE", `^${src[
|
|
2416
|
+
createToken("BUILD", `(?:\\+(${src[t3.BUILDIDENTIFIER]}(?:\\.${src[t3.BUILDIDENTIFIER]})*))`);
|
|
2417
|
+
createToken("FULLPLAIN", `v?${src[t3.MAINVERSION]}${src[t3.PRERELEASE]}?${src[t3.BUILD]}?`);
|
|
2418
|
+
createToken("FULL", `^${src[t3.FULLPLAIN]}$`);
|
|
2419
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t3.MAINVERSIONLOOSE]}${src[t3.PRERELEASELOOSE]}?${src[t3.BUILD]}?`);
|
|
2420
|
+
createToken("LOOSE", `^${src[t3.LOOSEPLAIN]}$`);
|
|
3009
2421
|
createToken("GTLT", "((?:<|>)?=?)");
|
|
3010
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[
|
|
3011
|
-
createToken("XRANGEIDENTIFIER", `${src[
|
|
3012
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[
|
|
3013
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[
|
|
3014
|
-
createToken("XRANGE", `^${src[
|
|
3015
|
-
createToken("XRANGELOOSE", `^${src[
|
|
2422
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t3.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
2423
|
+
createToken("XRANGEIDENTIFIER", `${src[t3.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
2424
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t3.XRANGEIDENTIFIER]})(?:\\.(${src[t3.XRANGEIDENTIFIER]})(?:\\.(${src[t3.XRANGEIDENTIFIER]})(?:${src[t3.PRERELEASE]})?${src[t3.BUILD]}?)?)?`);
|
|
2425
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t3.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t3.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t3.XRANGEIDENTIFIERLOOSE]})(?:${src[t3.PRERELEASELOOSE]})?${src[t3.BUILD]}?)?)?`);
|
|
2426
|
+
createToken("XRANGE", `^${src[t3.GTLT]}\\s*${src[t3.XRANGEPLAIN]}$`);
|
|
2427
|
+
createToken("XRANGELOOSE", `^${src[t3.GTLT]}\\s*${src[t3.XRANGEPLAINLOOSE]}$`);
|
|
3016
2428
|
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH2}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH2}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH2}}))?`);
|
|
3017
|
-
createToken("COERCE", `${src[
|
|
3018
|
-
createToken("COERCEFULL", src[
|
|
3019
|
-
createToken("COERCERTL", src[
|
|
3020
|
-
createToken("COERCERTLFULL", src[
|
|
2429
|
+
createToken("COERCE", `${src[t3.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
2430
|
+
createToken("COERCEFULL", src[t3.COERCEPLAIN] + `(?:${src[t3.PRERELEASE]})?(?:${src[t3.BUILD]})?(?:$|[^\\d])`);
|
|
2431
|
+
createToken("COERCERTL", src[t3.COERCE], true);
|
|
2432
|
+
createToken("COERCERTLFULL", src[t3.COERCEFULL], true);
|
|
3021
2433
|
createToken("LONETILDE", "(?:~>?)");
|
|
3022
|
-
createToken("TILDETRIM", `(\\s*)${src[
|
|
2434
|
+
createToken("TILDETRIM", `(\\s*)${src[t3.LONETILDE]}\\s+`, true);
|
|
3023
2435
|
exports.tildeTrimReplace = "$1~";
|
|
3024
|
-
createToken("TILDE", `^${src[
|
|
3025
|
-
createToken("TILDELOOSE", `^${src[
|
|
2436
|
+
createToken("TILDE", `^${src[t3.LONETILDE]}${src[t3.XRANGEPLAIN]}$`);
|
|
2437
|
+
createToken("TILDELOOSE", `^${src[t3.LONETILDE]}${src[t3.XRANGEPLAINLOOSE]}$`);
|
|
3026
2438
|
createToken("LONECARET", "(?:\\^)");
|
|
3027
|
-
createToken("CARETTRIM", `(\\s*)${src[
|
|
2439
|
+
createToken("CARETTRIM", `(\\s*)${src[t3.LONECARET]}\\s+`, true);
|
|
3028
2440
|
exports.caretTrimReplace = "$1^";
|
|
3029
|
-
createToken("CARET", `^${src[
|
|
3030
|
-
createToken("CARETLOOSE", `^${src[
|
|
3031
|
-
createToken("COMPARATORLOOSE", `^${src[
|
|
3032
|
-
createToken("COMPARATOR", `^${src[
|
|
3033
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[
|
|
2441
|
+
createToken("CARET", `^${src[t3.LONECARET]}${src[t3.XRANGEPLAIN]}$`);
|
|
2442
|
+
createToken("CARETLOOSE", `^${src[t3.LONECARET]}${src[t3.XRANGEPLAINLOOSE]}$`);
|
|
2443
|
+
createToken("COMPARATORLOOSE", `^${src[t3.GTLT]}\\s*(${src[t3.LOOSEPLAIN]})$|^$`);
|
|
2444
|
+
createToken("COMPARATOR", `^${src[t3.GTLT]}\\s*(${src[t3.FULLPLAIN]})$|^$`);
|
|
2445
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t3.GTLT]}\\s*(${src[t3.LOOSEPLAIN]}|${src[t3.XRANGEPLAIN]})`, true);
|
|
3034
2446
|
exports.comparatorTrimReplace = "$1$2$3";
|
|
3035
|
-
createToken("HYPHENRANGE", `^\\s*(${src[
|
|
3036
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[
|
|
2447
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t3.XRANGEPLAIN]})\\s+-\\s+(${src[t3.XRANGEPLAIN]})\\s*$`);
|
|
2448
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t3.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t3.XRANGEPLAINLOOSE]})\\s*$`);
|
|
3037
2449
|
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
3038
2450
|
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
3039
2451
|
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
@@ -3052,23 +2464,23 @@ const parseOptions$1 = (options) => {
|
|
|
3052
2464
|
};
|
|
3053
2465
|
var parseOptions_1 = parseOptions$1;
|
|
3054
2466
|
const numeric = /^[0-9]+$/;
|
|
3055
|
-
const compareIdentifiers$1 = (
|
|
3056
|
-
const anum = numeric.test(
|
|
3057
|
-
const bnum = numeric.test(
|
|
2467
|
+
const compareIdentifiers$1 = (a2, b2) => {
|
|
2468
|
+
const anum = numeric.test(a2);
|
|
2469
|
+
const bnum = numeric.test(b2);
|
|
3058
2470
|
if (anum && bnum) {
|
|
3059
|
-
|
|
3060
|
-
|
|
2471
|
+
a2 = +a2;
|
|
2472
|
+
b2 = +b2;
|
|
3061
2473
|
}
|
|
3062
|
-
return
|
|
2474
|
+
return a2 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b2 ? -1 : 1;
|
|
3063
2475
|
};
|
|
3064
|
-
const rcompareIdentifiers = (
|
|
2476
|
+
const rcompareIdentifiers = (a2, b2) => compareIdentifiers$1(b2, a2);
|
|
3065
2477
|
var identifiers = {
|
|
3066
2478
|
compareIdentifiers: compareIdentifiers$1,
|
|
3067
2479
|
rcompareIdentifiers
|
|
3068
2480
|
};
|
|
3069
2481
|
const debug = debug_1;
|
|
3070
2482
|
const { MAX_LENGTH, MAX_SAFE_INTEGER } = constants;
|
|
3071
|
-
const { safeRe: re, t } = reExports;
|
|
2483
|
+
const { safeRe: re, t: t2 } = reExports;
|
|
3072
2484
|
const parseOptions = parseOptions_1;
|
|
3073
2485
|
const { compareIdentifiers } = identifiers;
|
|
3074
2486
|
let SemVer$2 = class SemVer {
|
|
@@ -3092,14 +2504,14 @@ let SemVer$2 = class SemVer {
|
|
|
3092
2504
|
this.options = options;
|
|
3093
2505
|
this.loose = !!options.loose;
|
|
3094
2506
|
this.includePrerelease = !!options.includePrerelease;
|
|
3095
|
-
const
|
|
3096
|
-
if (!
|
|
2507
|
+
const m2 = version.trim().match(options.loose ? re[t2.LOOSE] : re[t2.FULL]);
|
|
2508
|
+
if (!m2) {
|
|
3097
2509
|
throw new TypeError(`Invalid Version: ${version}`);
|
|
3098
2510
|
}
|
|
3099
2511
|
this.raw = version;
|
|
3100
|
-
this.major = +
|
|
3101
|
-
this.minor = +
|
|
3102
|
-
this.patch = +
|
|
2512
|
+
this.major = +m2[1];
|
|
2513
|
+
this.minor = +m2[2];
|
|
2514
|
+
this.patch = +m2[3];
|
|
3103
2515
|
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
3104
2516
|
throw new TypeError("Invalid major version");
|
|
3105
2517
|
}
|
|
@@ -3109,10 +2521,10 @@ let SemVer$2 = class SemVer {
|
|
|
3109
2521
|
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
3110
2522
|
throw new TypeError("Invalid patch version");
|
|
3111
2523
|
}
|
|
3112
|
-
if (!
|
|
2524
|
+
if (!m2[4]) {
|
|
3113
2525
|
this.prerelease = [];
|
|
3114
2526
|
} else {
|
|
3115
|
-
this.prerelease =
|
|
2527
|
+
this.prerelease = m2[4].split(".").map((id) => {
|
|
3116
2528
|
if (/^[0-9]+$/.test(id)) {
|
|
3117
2529
|
const num = +id;
|
|
3118
2530
|
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
@@ -3122,7 +2534,7 @@ let SemVer$2 = class SemVer {
|
|
|
3122
2534
|
return id;
|
|
3123
2535
|
});
|
|
3124
2536
|
}
|
|
3125
|
-
this.build =
|
|
2537
|
+
this.build = m2[5] ? m2[5].split(".") : [];
|
|
3126
2538
|
this.format();
|
|
3127
2539
|
}
|
|
3128
2540
|
format() {
|
|
@@ -3165,45 +2577,45 @@ let SemVer$2 = class SemVer {
|
|
|
3165
2577
|
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
3166
2578
|
return 0;
|
|
3167
2579
|
}
|
|
3168
|
-
let
|
|
2580
|
+
let i2 = 0;
|
|
3169
2581
|
do {
|
|
3170
|
-
const
|
|
3171
|
-
const
|
|
3172
|
-
debug("prerelease compare",
|
|
3173
|
-
if (
|
|
2582
|
+
const a2 = this.prerelease[i2];
|
|
2583
|
+
const b2 = other.prerelease[i2];
|
|
2584
|
+
debug("prerelease compare", i2, a2, b2);
|
|
2585
|
+
if (a2 === void 0 && b2 === void 0) {
|
|
3174
2586
|
return 0;
|
|
3175
|
-
} else if (
|
|
2587
|
+
} else if (b2 === void 0) {
|
|
3176
2588
|
return 1;
|
|
3177
|
-
} else if (
|
|
2589
|
+
} else if (a2 === void 0) {
|
|
3178
2590
|
return -1;
|
|
3179
|
-
} else if (
|
|
2591
|
+
} else if (a2 === b2) {
|
|
3180
2592
|
continue;
|
|
3181
2593
|
} else {
|
|
3182
|
-
return compareIdentifiers(
|
|
2594
|
+
return compareIdentifiers(a2, b2);
|
|
3183
2595
|
}
|
|
3184
|
-
} while (++
|
|
2596
|
+
} while (++i2);
|
|
3185
2597
|
}
|
|
3186
2598
|
compareBuild(other) {
|
|
3187
2599
|
if (!(other instanceof SemVer)) {
|
|
3188
2600
|
other = new SemVer(other, this.options);
|
|
3189
2601
|
}
|
|
3190
|
-
let
|
|
2602
|
+
let i2 = 0;
|
|
3191
2603
|
do {
|
|
3192
|
-
const
|
|
3193
|
-
const
|
|
3194
|
-
debug("build compare",
|
|
3195
|
-
if (
|
|
2604
|
+
const a2 = this.build[i2];
|
|
2605
|
+
const b2 = other.build[i2];
|
|
2606
|
+
debug("build compare", i2, a2, b2);
|
|
2607
|
+
if (a2 === void 0 && b2 === void 0) {
|
|
3196
2608
|
return 0;
|
|
3197
|
-
} else if (
|
|
2609
|
+
} else if (b2 === void 0) {
|
|
3198
2610
|
return 1;
|
|
3199
|
-
} else if (
|
|
2611
|
+
} else if (a2 === void 0) {
|
|
3200
2612
|
return -1;
|
|
3201
|
-
} else if (
|
|
2613
|
+
} else if (a2 === b2) {
|
|
3202
2614
|
continue;
|
|
3203
2615
|
} else {
|
|
3204
|
-
return compareIdentifiers(
|
|
2616
|
+
return compareIdentifiers(a2, b2);
|
|
3205
2617
|
}
|
|
3206
|
-
} while (++
|
|
2618
|
+
} while (++i2);
|
|
3207
2619
|
}
|
|
3208
2620
|
// preminor will bump the version up to the next minor release, and immediately
|
|
3209
2621
|
// down to pre-release. premajor and prepatch work the same way.
|
|
@@ -3262,14 +2674,14 @@ let SemVer$2 = class SemVer {
|
|
|
3262
2674
|
if (this.prerelease.length === 0) {
|
|
3263
2675
|
this.prerelease = [base];
|
|
3264
2676
|
} else {
|
|
3265
|
-
let
|
|
3266
|
-
while (--
|
|
3267
|
-
if (typeof this.prerelease[
|
|
3268
|
-
this.prerelease[
|
|
3269
|
-
|
|
2677
|
+
let i2 = this.prerelease.length;
|
|
2678
|
+
while (--i2 >= 0) {
|
|
2679
|
+
if (typeof this.prerelease[i2] === "number") {
|
|
2680
|
+
this.prerelease[i2]++;
|
|
2681
|
+
i2 = -2;
|
|
3270
2682
|
}
|
|
3271
2683
|
}
|
|
3272
|
-
if (
|
|
2684
|
+
if (i2 === -1) {
|
|
3273
2685
|
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
3274
2686
|
throw new Error("invalid increment argument: identifier already exists");
|
|
3275
2687
|
}
|
|
@@ -3325,7 +2737,7 @@ const valid = (version, options) => {
|
|
|
3325
2737
|
var valid_1 = valid;
|
|
3326
2738
|
const valid$1 = /* @__PURE__ */ getDefaultExportFromCjs(valid_1);
|
|
3327
2739
|
const SemVer2 = semver;
|
|
3328
|
-
const major = (
|
|
2740
|
+
const major = (a2, loose) => new SemVer2(a2, loose).major;
|
|
3329
2741
|
var major_1 = major;
|
|
3330
2742
|
const major$1 = /* @__PURE__ */ getDefaultExportFromCjs(major_1);
|
|
3331
2743
|
class ProxyBus {
|
|
@@ -3369,15 +2781,15 @@ class SimpleBus {
|
|
|
3369
2781
|
unsubscribe(name, handler) {
|
|
3370
2782
|
this.handlers.set(
|
|
3371
2783
|
name,
|
|
3372
|
-
(this.handlers.get(name) || []).filter((
|
|
2784
|
+
(this.handlers.get(name) || []).filter((h2) => h2 !== handler)
|
|
3373
2785
|
);
|
|
3374
2786
|
}
|
|
3375
2787
|
emit(name, event) {
|
|
3376
|
-
(this.handlers.get(name) || []).forEach((
|
|
2788
|
+
(this.handlers.get(name) || []).forEach((h2) => {
|
|
3377
2789
|
try {
|
|
3378
|
-
|
|
3379
|
-
} catch (
|
|
3380
|
-
console.error("could not invoke event listener",
|
|
2790
|
+
h2(event);
|
|
2791
|
+
} catch (e2) {
|
|
2792
|
+
console.error("could not invoke event listener", e2);
|
|
3381
2793
|
}
|
|
3382
2794
|
});
|
|
3383
2795
|
}
|
|
@@ -3466,49 +2878,51 @@ const removeNewFileMenuEntry = function(entry) {
|
|
|
3466
2878
|
};
|
|
3467
2879
|
const getNewFileMenuEntries = function(context) {
|
|
3468
2880
|
const newFileMenu = getNewFileMenu();
|
|
3469
|
-
return newFileMenu.getEntries(context).sort((
|
|
3470
|
-
if (
|
|
3471
|
-
return
|
|
2881
|
+
return newFileMenu.getEntries(context).sort((a2, b2) => {
|
|
2882
|
+
if (a2.order !== void 0 && b2.order !== void 0 && a2.order !== b2.order) {
|
|
2883
|
+
return a2.order - b2.order;
|
|
3472
2884
|
}
|
|
3473
|
-
return
|
|
2885
|
+
return a2.displayName.localeCompare(b2.displayName, void 0, { numeric: true, sensitivity: "base" });
|
|
3474
2886
|
});
|
|
3475
2887
|
};
|
|
3476
2888
|
export {
|
|
3477
2889
|
Column,
|
|
3478
2890
|
DefaultType,
|
|
3479
|
-
File,
|
|
2891
|
+
q as File,
|
|
3480
2892
|
FileAction,
|
|
2893
|
+
FileListAction,
|
|
3481
2894
|
FileListFilter,
|
|
3482
|
-
FileType,
|
|
2895
|
+
F as FileType,
|
|
3483
2896
|
FilesSortingMode,
|
|
3484
|
-
Folder,
|
|
2897
|
+
s as Folder,
|
|
3485
2898
|
Header,
|
|
3486
2899
|
InvalidFilenameError,
|
|
3487
2900
|
InvalidFilenameErrorReason,
|
|
3488
2901
|
Navigation,
|
|
3489
2902
|
NewMenuEntryCategory,
|
|
3490
|
-
Node,
|
|
3491
|
-
NodeStatus,
|
|
3492
|
-
Permission,
|
|
2903
|
+
N as Node,
|
|
2904
|
+
t as NodeStatus,
|
|
2905
|
+
P as Permission,
|
|
3493
2906
|
View,
|
|
3494
2907
|
addNewFileMenuEntry,
|
|
3495
|
-
davGetClient,
|
|
3496
|
-
davGetDefaultPropfind,
|
|
3497
|
-
davGetFavoritesReport,
|
|
3498
|
-
davGetRecentSearch,
|
|
3499
|
-
davGetRemoteURL,
|
|
3500
|
-
davGetRootPath,
|
|
3501
|
-
davParsePermissions,
|
|
3502
|
-
davRemoteURL,
|
|
3503
|
-
davResultToNode,
|
|
3504
|
-
davRootPath,
|
|
3505
|
-
defaultDavNamespaces,
|
|
3506
|
-
defaultDavProperties,
|
|
2908
|
+
c as davGetClient,
|
|
2909
|
+
l as davGetDefaultPropfind,
|
|
2910
|
+
m as davGetFavoritesReport,
|
|
2911
|
+
n as davGetRecentSearch,
|
|
2912
|
+
a as davGetRemoteURL,
|
|
2913
|
+
g as davGetRootPath,
|
|
2914
|
+
p as davParsePermissions,
|
|
2915
|
+
b as davRemoteURL,
|
|
2916
|
+
r as davResultToNode,
|
|
2917
|
+
d as davRootPath,
|
|
2918
|
+
h as defaultDavNamespaces,
|
|
2919
|
+
f as defaultDavProperties,
|
|
3507
2920
|
formatFileSize,
|
|
3508
|
-
getDavNameSpaces,
|
|
3509
|
-
getDavProperties,
|
|
3510
|
-
getFavoriteNodes,
|
|
2921
|
+
k as getDavNameSpaces,
|
|
2922
|
+
j as getDavProperties,
|
|
2923
|
+
e as getFavoriteNodes,
|
|
3511
2924
|
getFileActions,
|
|
2925
|
+
getFileListActions,
|
|
3512
2926
|
getFileListFilters,
|
|
3513
2927
|
getFileListHeaders,
|
|
3514
2928
|
getNavigation,
|
|
@@ -3517,8 +2931,9 @@ export {
|
|
|
3517
2931
|
isFilenameValid,
|
|
3518
2932
|
orderBy,
|
|
3519
2933
|
parseFileSize,
|
|
3520
|
-
registerDavProperty,
|
|
2934
|
+
i as registerDavProperty,
|
|
3521
2935
|
registerFileAction,
|
|
2936
|
+
registerFileListAction,
|
|
3522
2937
|
registerFileListFilter,
|
|
3523
2938
|
registerFileListHeaders,
|
|
3524
2939
|
removeNewFileMenuEntry,
|