@nextcloud/files 3.9.1 → 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 +99 -709
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1099 -40
- package/dist/index.mjs +403 -1012
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -8
- 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 -84
- package/dist/fileListFilters.d.ts +0 -90
- package/dist/fileListHeaders.d.ts +0 -27
- package/dist/files/file.d.ts +0 -16
- package/dist/files/fileType.d.ts +0 -8
- package/dist/files/folder.d.ts +0 -22
- package/dist/files/node.d.ts +0 -174
- 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";
|
|
@@ -186,6 +180,67 @@ const getFileActions = function() {
|
|
|
186
180
|
}
|
|
187
181
|
return window._nc_fileactions;
|
|
188
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
|
+
};
|
|
189
244
|
class Header {
|
|
190
245
|
_header;
|
|
191
246
|
constructor(header) {
|
|
@@ -243,673 +298,6 @@ const getFileListHeaders = function() {
|
|
|
243
298
|
}
|
|
244
299
|
return window._nc_filelistheader;
|
|
245
300
|
};
|
|
246
|
-
var Permission = /* @__PURE__ */ ((Permission2) => {
|
|
247
|
-
Permission2[Permission2["NONE"] = 0] = "NONE";
|
|
248
|
-
Permission2[Permission2["CREATE"] = 4] = "CREATE";
|
|
249
|
-
Permission2[Permission2["READ"] = 1] = "READ";
|
|
250
|
-
Permission2[Permission2["UPDATE"] = 2] = "UPDATE";
|
|
251
|
-
Permission2[Permission2["DELETE"] = 8] = "DELETE";
|
|
252
|
-
Permission2[Permission2["SHARE"] = 16] = "SHARE";
|
|
253
|
-
Permission2[Permission2["ALL"] = 31] = "ALL";
|
|
254
|
-
return Permission2;
|
|
255
|
-
})(Permission || {});
|
|
256
|
-
const defaultDavProperties = [
|
|
257
|
-
"d:getcontentlength",
|
|
258
|
-
"d:getcontenttype",
|
|
259
|
-
"d:getetag",
|
|
260
|
-
"d:getlastmodified",
|
|
261
|
-
"d:creationdate",
|
|
262
|
-
"d:displayname",
|
|
263
|
-
"d:quota-available-bytes",
|
|
264
|
-
"d:resourcetype",
|
|
265
|
-
"nc:has-preview",
|
|
266
|
-
"nc:is-encrypted",
|
|
267
|
-
"nc:mount-type",
|
|
268
|
-
"oc:comments-unread",
|
|
269
|
-
"oc:favorite",
|
|
270
|
-
"oc:fileid",
|
|
271
|
-
"oc:owner-display-name",
|
|
272
|
-
"oc:owner-id",
|
|
273
|
-
"oc:permissions",
|
|
274
|
-
"oc:size"
|
|
275
|
-
];
|
|
276
|
-
const defaultDavNamespaces = {
|
|
277
|
-
d: "DAV:",
|
|
278
|
-
nc: "http://nextcloud.org/ns",
|
|
279
|
-
oc: "http://owncloud.org/ns",
|
|
280
|
-
ocs: "http://open-collaboration-services.org/ns"
|
|
281
|
-
};
|
|
282
|
-
const registerDavProperty = function(prop, namespace = { nc: "http://nextcloud.org/ns" }) {
|
|
283
|
-
if (typeof window._nc_dav_properties === "undefined") {
|
|
284
|
-
window._nc_dav_properties = [...defaultDavProperties];
|
|
285
|
-
window._nc_dav_namespaces = { ...defaultDavNamespaces };
|
|
286
|
-
}
|
|
287
|
-
const namespaces = { ...window._nc_dav_namespaces, ...namespace };
|
|
288
|
-
if (window._nc_dav_properties.find((search) => search === prop)) {
|
|
289
|
-
logger.warn(`${prop} already registered`, { prop });
|
|
290
|
-
return false;
|
|
291
|
-
}
|
|
292
|
-
if (prop.startsWith("<") || prop.split(":").length !== 2) {
|
|
293
|
-
logger.error(`${prop} is not valid. See example: 'oc:fileid'`, { prop });
|
|
294
|
-
return false;
|
|
295
|
-
}
|
|
296
|
-
const ns = prop.split(":")[0];
|
|
297
|
-
if (!namespaces[ns]) {
|
|
298
|
-
logger.error(`${prop} namespace unknown`, { prop, namespaces });
|
|
299
|
-
return false;
|
|
300
|
-
}
|
|
301
|
-
window._nc_dav_properties.push(prop);
|
|
302
|
-
window._nc_dav_namespaces = namespaces;
|
|
303
|
-
return true;
|
|
304
|
-
};
|
|
305
|
-
const getDavProperties = function() {
|
|
306
|
-
if (typeof window._nc_dav_properties === "undefined") {
|
|
307
|
-
window._nc_dav_properties = [...defaultDavProperties];
|
|
308
|
-
}
|
|
309
|
-
return window._nc_dav_properties.map((prop) => `<${prop} />`).join(" ");
|
|
310
|
-
};
|
|
311
|
-
const getDavNameSpaces = function() {
|
|
312
|
-
if (typeof window._nc_dav_namespaces === "undefined") {
|
|
313
|
-
window._nc_dav_namespaces = { ...defaultDavNamespaces };
|
|
314
|
-
}
|
|
315
|
-
return Object.keys(window._nc_dav_namespaces).map((ns) => `xmlns:${ns}="${window._nc_dav_namespaces?.[ns]}"`).join(" ");
|
|
316
|
-
};
|
|
317
|
-
const davGetDefaultPropfind = function() {
|
|
318
|
-
return `<?xml version="1.0"?>
|
|
319
|
-
<d:propfind ${getDavNameSpaces()}>
|
|
320
|
-
<d:prop>
|
|
321
|
-
${getDavProperties()}
|
|
322
|
-
</d:prop>
|
|
323
|
-
</d:propfind>`;
|
|
324
|
-
};
|
|
325
|
-
const davGetFavoritesReport = function() {
|
|
326
|
-
return `<?xml version="1.0"?>
|
|
327
|
-
<oc:filter-files ${getDavNameSpaces()}>
|
|
328
|
-
<d:prop>
|
|
329
|
-
${getDavProperties()}
|
|
330
|
-
</d:prop>
|
|
331
|
-
<oc:filter-rules>
|
|
332
|
-
<oc:favorite>1</oc:favorite>
|
|
333
|
-
</oc:filter-rules>
|
|
334
|
-
</oc:filter-files>`;
|
|
335
|
-
};
|
|
336
|
-
const davGetRecentSearch = function(lastModified) {
|
|
337
|
-
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
338
|
-
<d:searchrequest ${getDavNameSpaces()}
|
|
339
|
-
xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
|
|
340
|
-
<d:basicsearch>
|
|
341
|
-
<d:select>
|
|
342
|
-
<d:prop>
|
|
343
|
-
${getDavProperties()}
|
|
344
|
-
</d:prop>
|
|
345
|
-
</d:select>
|
|
346
|
-
<d:from>
|
|
347
|
-
<d:scope>
|
|
348
|
-
<d:href>/files/${getCurrentUser()?.uid}/</d:href>
|
|
349
|
-
<d:depth>infinity</d:depth>
|
|
350
|
-
</d:scope>
|
|
351
|
-
</d:from>
|
|
352
|
-
<d:where>
|
|
353
|
-
<d:and>
|
|
354
|
-
<d:or>
|
|
355
|
-
<d:not>
|
|
356
|
-
<d:eq>
|
|
357
|
-
<d:prop>
|
|
358
|
-
<d:getcontenttype/>
|
|
359
|
-
</d:prop>
|
|
360
|
-
<d:literal>httpd/unix-directory</d:literal>
|
|
361
|
-
</d:eq>
|
|
362
|
-
</d:not>
|
|
363
|
-
<d:eq>
|
|
364
|
-
<d:prop>
|
|
365
|
-
<oc:size/>
|
|
366
|
-
</d:prop>
|
|
367
|
-
<d:literal>0</d:literal>
|
|
368
|
-
</d:eq>
|
|
369
|
-
</d:or>
|
|
370
|
-
<d:gt>
|
|
371
|
-
<d:prop>
|
|
372
|
-
<d:getlastmodified/>
|
|
373
|
-
</d:prop>
|
|
374
|
-
<d:literal>${lastModified}</d:literal>
|
|
375
|
-
</d:gt>
|
|
376
|
-
</d:and>
|
|
377
|
-
</d:where>
|
|
378
|
-
<d:orderby>
|
|
379
|
-
<d:order>
|
|
380
|
-
<d:prop>
|
|
381
|
-
<d:getlastmodified/>
|
|
382
|
-
</d:prop>
|
|
383
|
-
<d:descending/>
|
|
384
|
-
</d:order>
|
|
385
|
-
</d:orderby>
|
|
386
|
-
<d:limit>
|
|
387
|
-
<d:nresults>100</d:nresults>
|
|
388
|
-
<ns:firstresult>0</ns:firstresult>
|
|
389
|
-
</d:limit>
|
|
390
|
-
</d:basicsearch>
|
|
391
|
-
</d:searchrequest>`;
|
|
392
|
-
};
|
|
393
|
-
const davParsePermissions = function(permString = "") {
|
|
394
|
-
let permissions = Permission.NONE;
|
|
395
|
-
if (!permString) {
|
|
396
|
-
return permissions;
|
|
397
|
-
}
|
|
398
|
-
if (permString.includes("C") || permString.includes("K")) {
|
|
399
|
-
permissions |= Permission.CREATE;
|
|
400
|
-
}
|
|
401
|
-
if (permString.includes("G")) {
|
|
402
|
-
permissions |= Permission.READ;
|
|
403
|
-
}
|
|
404
|
-
if (permString.includes("W") || permString.includes("N") || permString.includes("V")) {
|
|
405
|
-
permissions |= Permission.UPDATE;
|
|
406
|
-
}
|
|
407
|
-
if (permString.includes("D")) {
|
|
408
|
-
permissions |= Permission.DELETE;
|
|
409
|
-
}
|
|
410
|
-
if (permString.includes("R")) {
|
|
411
|
-
permissions |= Permission.SHARE;
|
|
412
|
-
}
|
|
413
|
-
return permissions;
|
|
414
|
-
};
|
|
415
|
-
var FileType = /* @__PURE__ */ ((FileType2) => {
|
|
416
|
-
FileType2["Folder"] = "folder";
|
|
417
|
-
FileType2["File"] = "file";
|
|
418
|
-
return FileType2;
|
|
419
|
-
})(FileType || {});
|
|
420
|
-
const isDavRessource = function(source, davService) {
|
|
421
|
-
return source.match(davService) !== null;
|
|
422
|
-
};
|
|
423
|
-
const validateData = (data, davService) => {
|
|
424
|
-
if (data.id && typeof data.id !== "number") {
|
|
425
|
-
throw new Error("Invalid id type of value");
|
|
426
|
-
}
|
|
427
|
-
if (!data.source) {
|
|
428
|
-
throw new Error("Missing mandatory source");
|
|
429
|
-
}
|
|
430
|
-
try {
|
|
431
|
-
new URL(data.source);
|
|
432
|
-
} catch (e) {
|
|
433
|
-
throw new Error("Invalid source format, source must be a valid URL");
|
|
434
|
-
}
|
|
435
|
-
if (!data.source.startsWith("http")) {
|
|
436
|
-
throw new Error("Invalid source format, only http(s) is supported");
|
|
437
|
-
}
|
|
438
|
-
if (data.displayname && typeof data.displayname !== "string") {
|
|
439
|
-
throw new Error("Invalid displayname type");
|
|
440
|
-
}
|
|
441
|
-
if (data.mtime && !(data.mtime instanceof Date)) {
|
|
442
|
-
throw new Error("Invalid mtime type");
|
|
443
|
-
}
|
|
444
|
-
if (data.crtime && !(data.crtime instanceof Date)) {
|
|
445
|
-
throw new Error("Invalid crtime type");
|
|
446
|
-
}
|
|
447
|
-
if (!data.mime || typeof data.mime !== "string" || !data.mime.match(/^[-\w.]+\/[-+\w.]+$/gi)) {
|
|
448
|
-
throw new Error("Missing or invalid mandatory mime");
|
|
449
|
-
}
|
|
450
|
-
if ("size" in data && typeof data.size !== "number" && data.size !== void 0) {
|
|
451
|
-
throw new Error("Invalid size type");
|
|
452
|
-
}
|
|
453
|
-
if ("permissions" in data && data.permissions !== void 0 && !(typeof data.permissions === "number" && data.permissions >= Permission.NONE && data.permissions <= Permission.ALL)) {
|
|
454
|
-
throw new Error("Invalid permissions");
|
|
455
|
-
}
|
|
456
|
-
if (data.owner && data.owner !== null && typeof data.owner !== "string") {
|
|
457
|
-
throw new Error("Invalid owner type");
|
|
458
|
-
}
|
|
459
|
-
if (data.attributes && typeof data.attributes !== "object") {
|
|
460
|
-
throw new Error("Invalid attributes type");
|
|
461
|
-
}
|
|
462
|
-
if (data.root && typeof data.root !== "string") {
|
|
463
|
-
throw new Error("Invalid root type");
|
|
464
|
-
}
|
|
465
|
-
if (data.root && !data.root.startsWith("/")) {
|
|
466
|
-
throw new Error("Root must start with a leading slash");
|
|
467
|
-
}
|
|
468
|
-
if (data.root && !data.source.includes(data.root)) {
|
|
469
|
-
throw new Error("Root must be part of the source");
|
|
470
|
-
}
|
|
471
|
-
if (data.root && isDavRessource(data.source, davService)) {
|
|
472
|
-
const service = data.source.match(davService)[0];
|
|
473
|
-
if (!data.source.includes(join(service, data.root))) {
|
|
474
|
-
throw new Error("The root must be relative to the service. e.g /files/emma");
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
if (data.status && !Object.values(NodeStatus).includes(data.status)) {
|
|
478
|
-
throw new Error("Status must be a valid NodeStatus");
|
|
479
|
-
}
|
|
480
|
-
};
|
|
481
|
-
var NodeStatus = /* @__PURE__ */ ((NodeStatus2) => {
|
|
482
|
-
NodeStatus2["NEW"] = "new";
|
|
483
|
-
NodeStatus2["FAILED"] = "failed";
|
|
484
|
-
NodeStatus2["LOADING"] = "loading";
|
|
485
|
-
NodeStatus2["LOCKED"] = "locked";
|
|
486
|
-
return NodeStatus2;
|
|
487
|
-
})(NodeStatus || {});
|
|
488
|
-
class Node {
|
|
489
|
-
_data;
|
|
490
|
-
_attributes;
|
|
491
|
-
_knownDavService = /(remote|public)\.php\/(web)?dav/i;
|
|
492
|
-
readonlyAttributes = Object.entries(Object.getOwnPropertyDescriptors(Node.prototype)).filter((e) => typeof e[1].get === "function" && e[0] !== "__proto__").map((e) => e[0]);
|
|
493
|
-
handler = {
|
|
494
|
-
set: (target, prop, value) => {
|
|
495
|
-
if (this.readonlyAttributes.includes(prop)) {
|
|
496
|
-
return false;
|
|
497
|
-
}
|
|
498
|
-
return Reflect.set(target, prop, value);
|
|
499
|
-
},
|
|
500
|
-
deleteProperty: (target, prop) => {
|
|
501
|
-
if (this.readonlyAttributes.includes(prop)) {
|
|
502
|
-
return false;
|
|
503
|
-
}
|
|
504
|
-
return Reflect.deleteProperty(target, prop);
|
|
505
|
-
},
|
|
506
|
-
// TODO: This is deprecated and only needed for files v3
|
|
507
|
-
get: (target, prop, receiver) => {
|
|
508
|
-
if (this.readonlyAttributes.includes(prop)) {
|
|
509
|
-
logger.warn(`Accessing "Node.attributes.${prop}" is deprecated, access it directly on the Node instance.`);
|
|
510
|
-
return Reflect.get(this, prop);
|
|
511
|
-
}
|
|
512
|
-
return Reflect.get(target, prop, receiver);
|
|
513
|
-
}
|
|
514
|
-
};
|
|
515
|
-
constructor(data, davService) {
|
|
516
|
-
validateData(data, davService || this._knownDavService);
|
|
517
|
-
this._data = {
|
|
518
|
-
// TODO: Remove with next major release, this is just for compatibility
|
|
519
|
-
displayname: data.attributes?.displayname,
|
|
520
|
-
...data,
|
|
521
|
-
attributes: {}
|
|
522
|
-
};
|
|
523
|
-
this._attributes = new Proxy(this._data.attributes, this.handler);
|
|
524
|
-
this.update(data.attributes ?? {});
|
|
525
|
-
if (davService) {
|
|
526
|
-
this._knownDavService = davService;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
/**
|
|
530
|
-
* Get the source url to this object
|
|
531
|
-
* There is no setter as the source is not meant to be changed manually.
|
|
532
|
-
* You can use the rename or move method to change the source.
|
|
533
|
-
*/
|
|
534
|
-
get source() {
|
|
535
|
-
return this._data.source.replace(/\/$/i, "");
|
|
536
|
-
}
|
|
537
|
-
/**
|
|
538
|
-
* Get the encoded source url to this object for requests purposes
|
|
539
|
-
*/
|
|
540
|
-
get encodedSource() {
|
|
541
|
-
const { origin } = new URL(this.source);
|
|
542
|
-
return origin + encodePath(this.source.slice(origin.length));
|
|
543
|
-
}
|
|
544
|
-
/**
|
|
545
|
-
* Get this object name
|
|
546
|
-
* There is no setter as the source is not meant to be changed manually.
|
|
547
|
-
* You can use the rename or move method to change the source.
|
|
548
|
-
*/
|
|
549
|
-
get basename() {
|
|
550
|
-
return basename(this.source);
|
|
551
|
-
}
|
|
552
|
-
/**
|
|
553
|
-
* The nodes displayname
|
|
554
|
-
* By default the display name and the `basename` are identical,
|
|
555
|
-
* but it is possible to have a different name. This happens
|
|
556
|
-
* on the files app for example for shared folders.
|
|
557
|
-
*/
|
|
558
|
-
get displayname() {
|
|
559
|
-
return this._data.displayname || this.basename;
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* Set the displayname
|
|
563
|
-
*/
|
|
564
|
-
set displayname(displayname) {
|
|
565
|
-
this._data.displayname = displayname;
|
|
566
|
-
}
|
|
567
|
-
/**
|
|
568
|
-
* Get this object's extension
|
|
569
|
-
* There is no setter as the source is not meant to be changed manually.
|
|
570
|
-
* You can use the rename or move method to change the source.
|
|
571
|
-
*/
|
|
572
|
-
get extension() {
|
|
573
|
-
return extname(this.source);
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Get the directory path leading to this object
|
|
577
|
-
* Will use the relative path to root if available
|
|
578
|
-
*
|
|
579
|
-
* There is no setter as the source is not meant to be changed manually.
|
|
580
|
-
* You can use the rename or move method to change the source.
|
|
581
|
-
*/
|
|
582
|
-
get dirname() {
|
|
583
|
-
if (this.root) {
|
|
584
|
-
let source = this.source;
|
|
585
|
-
if (this.isDavRessource) {
|
|
586
|
-
source = source.split(this._knownDavService).pop();
|
|
587
|
-
}
|
|
588
|
-
const firstMatch = source.indexOf(this.root);
|
|
589
|
-
const root = this.root.replace(/\/$/, "");
|
|
590
|
-
return dirname(source.slice(firstMatch + root.length) || "/");
|
|
591
|
-
}
|
|
592
|
-
const url = new URL(this.source);
|
|
593
|
-
return dirname(url.pathname);
|
|
594
|
-
}
|
|
595
|
-
/**
|
|
596
|
-
* Get the file mime
|
|
597
|
-
* There is no setter as the mime is not meant to be changed
|
|
598
|
-
*/
|
|
599
|
-
get mime() {
|
|
600
|
-
return this._data.mime;
|
|
601
|
-
}
|
|
602
|
-
/**
|
|
603
|
-
* Get the file modification time
|
|
604
|
-
*/
|
|
605
|
-
get mtime() {
|
|
606
|
-
return this._data.mtime;
|
|
607
|
-
}
|
|
608
|
-
/**
|
|
609
|
-
* Set the file modification time
|
|
610
|
-
*/
|
|
611
|
-
set mtime(mtime) {
|
|
612
|
-
this._data.mtime = mtime;
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
|
-
* Get the file creation time
|
|
616
|
-
* There is no setter as the creation time is not meant to be changed
|
|
617
|
-
*/
|
|
618
|
-
get crtime() {
|
|
619
|
-
return this._data.crtime;
|
|
620
|
-
}
|
|
621
|
-
/**
|
|
622
|
-
* Get the file size
|
|
623
|
-
*/
|
|
624
|
-
get size() {
|
|
625
|
-
return this._data.size;
|
|
626
|
-
}
|
|
627
|
-
/**
|
|
628
|
-
* Set the file size
|
|
629
|
-
*/
|
|
630
|
-
set size(size) {
|
|
631
|
-
this.updateMtime();
|
|
632
|
-
this._data.size = size;
|
|
633
|
-
}
|
|
634
|
-
/**
|
|
635
|
-
* Get the file attribute
|
|
636
|
-
* This contains all additional attributes not provided by the Node class
|
|
637
|
-
*/
|
|
638
|
-
get attributes() {
|
|
639
|
-
return this._attributes;
|
|
640
|
-
}
|
|
641
|
-
/**
|
|
642
|
-
* Get the file permissions
|
|
643
|
-
*/
|
|
644
|
-
get permissions() {
|
|
645
|
-
if (this.owner === null && !this.isDavRessource) {
|
|
646
|
-
return Permission.READ;
|
|
647
|
-
}
|
|
648
|
-
return this._data.permissions !== void 0 ? this._data.permissions : Permission.NONE;
|
|
649
|
-
}
|
|
650
|
-
/**
|
|
651
|
-
* Set the file permissions
|
|
652
|
-
*/
|
|
653
|
-
set permissions(permissions) {
|
|
654
|
-
this.updateMtime();
|
|
655
|
-
this._data.permissions = permissions;
|
|
656
|
-
}
|
|
657
|
-
/**
|
|
658
|
-
* Get the file owner
|
|
659
|
-
* There is no setter as the owner is not meant to be changed
|
|
660
|
-
*/
|
|
661
|
-
get owner() {
|
|
662
|
-
if (!this.isDavRessource) {
|
|
663
|
-
return null;
|
|
664
|
-
}
|
|
665
|
-
return this._data.owner;
|
|
666
|
-
}
|
|
667
|
-
/**
|
|
668
|
-
* Is this a dav-related ressource ?
|
|
669
|
-
*/
|
|
670
|
-
get isDavRessource() {
|
|
671
|
-
return isDavRessource(this.source, this._knownDavService);
|
|
672
|
-
}
|
|
673
|
-
/**
|
|
674
|
-
* Get the dav root of this object
|
|
675
|
-
* There is no setter as the root is not meant to be changed
|
|
676
|
-
*/
|
|
677
|
-
get root() {
|
|
678
|
-
if (this._data.root) {
|
|
679
|
-
return this._data.root.replace(/^(.+)\/$/, "$1");
|
|
680
|
-
}
|
|
681
|
-
if (this.isDavRessource) {
|
|
682
|
-
const root = dirname(this.source);
|
|
683
|
-
return root.split(this._knownDavService).pop() || null;
|
|
684
|
-
}
|
|
685
|
-
return null;
|
|
686
|
-
}
|
|
687
|
-
/**
|
|
688
|
-
* Get the absolute path of this object relative to the root
|
|
689
|
-
*/
|
|
690
|
-
get path() {
|
|
691
|
-
if (this.root) {
|
|
692
|
-
let source = this.source;
|
|
693
|
-
if (this.isDavRessource) {
|
|
694
|
-
source = source.split(this._knownDavService).pop();
|
|
695
|
-
}
|
|
696
|
-
const firstMatch = source.indexOf(this.root);
|
|
697
|
-
const root = this.root.replace(/\/$/, "");
|
|
698
|
-
return source.slice(firstMatch + root.length) || "/";
|
|
699
|
-
}
|
|
700
|
-
return (this.dirname + "/" + this.basename).replace(/\/\//g, "/");
|
|
701
|
-
}
|
|
702
|
-
/**
|
|
703
|
-
* Get the node id if defined.
|
|
704
|
-
* There is no setter as the fileid is not meant to be changed
|
|
705
|
-
*/
|
|
706
|
-
get fileid() {
|
|
707
|
-
return this._data?.id;
|
|
708
|
-
}
|
|
709
|
-
/**
|
|
710
|
-
* Get the node status.
|
|
711
|
-
*/
|
|
712
|
-
get status() {
|
|
713
|
-
return this._data?.status;
|
|
714
|
-
}
|
|
715
|
-
/**
|
|
716
|
-
* Set the node status.
|
|
717
|
-
*/
|
|
718
|
-
set status(status) {
|
|
719
|
-
this._data.status = status;
|
|
720
|
-
}
|
|
721
|
-
/**
|
|
722
|
-
* Get the node data
|
|
723
|
-
*/
|
|
724
|
-
get data() {
|
|
725
|
-
return structuredClone(this._data);
|
|
726
|
-
}
|
|
727
|
-
/**
|
|
728
|
-
* Move the node to a new destination
|
|
729
|
-
*
|
|
730
|
-
* @param {string} destination the new source.
|
|
731
|
-
* e.g. https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg
|
|
732
|
-
*/
|
|
733
|
-
move(destination) {
|
|
734
|
-
validateData({ ...this._data, source: destination }, this._knownDavService);
|
|
735
|
-
const oldBasename = this.basename;
|
|
736
|
-
this._data.source = destination;
|
|
737
|
-
if (this.displayname === oldBasename && this.basename !== oldBasename) {
|
|
738
|
-
this.displayname = this.basename;
|
|
739
|
-
}
|
|
740
|
-
this.updateMtime();
|
|
741
|
-
}
|
|
742
|
-
/**
|
|
743
|
-
* Rename the node
|
|
744
|
-
* This aliases the move method for easier usage
|
|
745
|
-
*
|
|
746
|
-
* @param basename The new name of the node
|
|
747
|
-
*/
|
|
748
|
-
rename(basename2) {
|
|
749
|
-
if (basename2.includes("/")) {
|
|
750
|
-
throw new Error("Invalid basename");
|
|
751
|
-
}
|
|
752
|
-
this.move(dirname(this.source) + "/" + basename2);
|
|
753
|
-
}
|
|
754
|
-
/**
|
|
755
|
-
* Update the mtime if exists
|
|
756
|
-
*/
|
|
757
|
-
updateMtime() {
|
|
758
|
-
if (this._data.mtime) {
|
|
759
|
-
this._data.mtime = /* @__PURE__ */ new Date();
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
/**
|
|
763
|
-
* Update the attributes of the node
|
|
764
|
-
* Warning, updating attributes will NOT automatically update the mtime.
|
|
765
|
-
*
|
|
766
|
-
* @param attributes The new attributes to update on the Node attributes
|
|
767
|
-
*/
|
|
768
|
-
update(attributes) {
|
|
769
|
-
for (const [name, value] of Object.entries(attributes)) {
|
|
770
|
-
try {
|
|
771
|
-
if (value === void 0) {
|
|
772
|
-
delete this.attributes[name];
|
|
773
|
-
} else {
|
|
774
|
-
this.attributes[name] = value;
|
|
775
|
-
}
|
|
776
|
-
} catch (e) {
|
|
777
|
-
if (e instanceof TypeError) {
|
|
778
|
-
continue;
|
|
779
|
-
}
|
|
780
|
-
throw e;
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
class File extends Node {
|
|
786
|
-
get type() {
|
|
787
|
-
return FileType.File;
|
|
788
|
-
}
|
|
789
|
-
/**
|
|
790
|
-
* Returns a clone of the file
|
|
791
|
-
*/
|
|
792
|
-
clone() {
|
|
793
|
-
return new File(this.data);
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
class Folder extends Node {
|
|
797
|
-
constructor(data) {
|
|
798
|
-
super({
|
|
799
|
-
...data,
|
|
800
|
-
mime: "httpd/unix-directory"
|
|
801
|
-
});
|
|
802
|
-
}
|
|
803
|
-
get type() {
|
|
804
|
-
return FileType.Folder;
|
|
805
|
-
}
|
|
806
|
-
get extension() {
|
|
807
|
-
return null;
|
|
808
|
-
}
|
|
809
|
-
get mime() {
|
|
810
|
-
return "httpd/unix-directory";
|
|
811
|
-
}
|
|
812
|
-
/**
|
|
813
|
-
* Returns a clone of the folder
|
|
814
|
-
*/
|
|
815
|
-
clone() {
|
|
816
|
-
return new Folder(this.data);
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
function davGetRootPath() {
|
|
820
|
-
if (isPublicShare()) {
|
|
821
|
-
return `/files/${getSharingToken()}`;
|
|
822
|
-
}
|
|
823
|
-
return `/files/${getCurrentUser()?.uid}`;
|
|
824
|
-
}
|
|
825
|
-
const davRootPath = davGetRootPath();
|
|
826
|
-
function davGetRemoteURL() {
|
|
827
|
-
const url = generateRemoteUrl("dav");
|
|
828
|
-
if (isPublicShare()) {
|
|
829
|
-
return url.replace("remote.php", "public.php");
|
|
830
|
-
}
|
|
831
|
-
return url;
|
|
832
|
-
}
|
|
833
|
-
const davRemoteURL = davGetRemoteURL();
|
|
834
|
-
const davGetClient = function(remoteURL = davRemoteURL, headers = {}) {
|
|
835
|
-
const client = createClient(remoteURL, { headers });
|
|
836
|
-
function setHeaders(token) {
|
|
837
|
-
client.setHeaders({
|
|
838
|
-
...headers,
|
|
839
|
-
// Add this so the server knows it is an request from the browser
|
|
840
|
-
"X-Requested-With": "XMLHttpRequest",
|
|
841
|
-
// Inject user auth
|
|
842
|
-
requesttoken: token ?? ""
|
|
843
|
-
});
|
|
844
|
-
}
|
|
845
|
-
onRequestTokenUpdate(setHeaders);
|
|
846
|
-
setHeaders(getRequestToken());
|
|
847
|
-
const patcher = getPatcher();
|
|
848
|
-
patcher.patch("fetch", (url, options) => {
|
|
849
|
-
const headers2 = options.headers;
|
|
850
|
-
if (headers2?.method) {
|
|
851
|
-
options.method = headers2.method;
|
|
852
|
-
delete headers2.method;
|
|
853
|
-
}
|
|
854
|
-
return fetch(url, options);
|
|
855
|
-
});
|
|
856
|
-
return client;
|
|
857
|
-
};
|
|
858
|
-
const getFavoriteNodes = (davClient, path = "/", davRoot = davRootPath) => {
|
|
859
|
-
const controller = new AbortController();
|
|
860
|
-
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
|
861
|
-
onCancel(() => controller.abort());
|
|
862
|
-
try {
|
|
863
|
-
const contentsResponse = await davClient.getDirectoryContents(`${davRoot}${path}`, {
|
|
864
|
-
signal: controller.signal,
|
|
865
|
-
details: true,
|
|
866
|
-
data: davGetFavoritesReport(),
|
|
867
|
-
headers: {
|
|
868
|
-
// see davGetClient for patched webdav client
|
|
869
|
-
method: "REPORT"
|
|
870
|
-
},
|
|
871
|
-
includeSelf: true
|
|
872
|
-
});
|
|
873
|
-
const nodes = contentsResponse.data.filter((node) => node.filename !== path).map((result) => davResultToNode(result, davRoot));
|
|
874
|
-
resolve(nodes);
|
|
875
|
-
} catch (error) {
|
|
876
|
-
reject(error);
|
|
877
|
-
}
|
|
878
|
-
});
|
|
879
|
-
};
|
|
880
|
-
const davResultToNode = function(node, filesRoot = davRootPath, remoteURL = davRemoteURL) {
|
|
881
|
-
let userId = getCurrentUser()?.uid;
|
|
882
|
-
if (isPublicShare()) {
|
|
883
|
-
userId = userId ?? "anonymous";
|
|
884
|
-
} else if (!userId) {
|
|
885
|
-
throw new Error("No user id found");
|
|
886
|
-
}
|
|
887
|
-
const props = node.props;
|
|
888
|
-
const permissions = davParsePermissions(props?.permissions);
|
|
889
|
-
const owner = String(props?.["owner-id"] || userId);
|
|
890
|
-
const id = props.fileid || 0;
|
|
891
|
-
const nodeData = {
|
|
892
|
-
id,
|
|
893
|
-
source: `${remoteURL}${node.filename}`,
|
|
894
|
-
mtime: new Date(Date.parse(node.lastmod)),
|
|
895
|
-
mime: node.mime || "application/octet-stream",
|
|
896
|
-
// Manually cast to work around for https://github.com/perry-mitchell/webdav-client/pull/380
|
|
897
|
-
displayname: props.displayname !== void 0 ? String(props.displayname) : void 0,
|
|
898
|
-
size: props?.size || Number.parseInt(props.getcontentlength || "0"),
|
|
899
|
-
// The fileid is set to -1 for failed requests
|
|
900
|
-
status: id < 0 ? NodeStatus.FAILED : void 0,
|
|
901
|
-
permissions,
|
|
902
|
-
owner,
|
|
903
|
-
root: filesRoot,
|
|
904
|
-
attributes: {
|
|
905
|
-
...node,
|
|
906
|
-
...props,
|
|
907
|
-
hasPreview: props?.["has-preview"]
|
|
908
|
-
}
|
|
909
|
-
};
|
|
910
|
-
delete nodeData.attributes?.props;
|
|
911
|
-
return node.type === "file" ? new File(nodeData) : new Folder(nodeData);
|
|
912
|
-
};
|
|
913
301
|
var InvalidFilenameErrorReason = /* @__PURE__ */ ((InvalidFilenameErrorReason2) => {
|
|
914
302
|
InvalidFilenameErrorReason2["ReservedName"] = "reserved name";
|
|
915
303
|
InvalidFilenameErrorReason2["Character"] = "character";
|
|
@@ -988,16 +376,16 @@ function isFilenameValid(filename) {
|
|
|
988
376
|
}
|
|
989
377
|
function getUniqueName(name, otherNames, options) {
|
|
990
378
|
const opts = {
|
|
991
|
-
suffix: (
|
|
379
|
+
suffix: (n2) => `(${n2})`,
|
|
992
380
|
ignoreFileExtension: false,
|
|
993
381
|
...options
|
|
994
382
|
};
|
|
995
383
|
let newName = name;
|
|
996
|
-
let
|
|
384
|
+
let i2 = 1;
|
|
997
385
|
while (otherNames.includes(newName)) {
|
|
998
386
|
const ext = opts.ignoreFileExtension ? "" : extname(name);
|
|
999
387
|
const base = basename(name, ext);
|
|
1000
|
-
newName = `${base} ${opts.suffix(
|
|
388
|
+
newName = `${base} ${opts.suffix(i2++)}${ext}`;
|
|
1001
389
|
}
|
|
1002
390
|
return newName;
|
|
1003
391
|
}
|
|
@@ -1025,7 +413,7 @@ function formatFileSize(size, skipSmallSizes = false, binaryPrefixes = false, ba
|
|
|
1025
413
|
function parseFileSize(value, forceBinary = false) {
|
|
1026
414
|
try {
|
|
1027
415
|
value = `${value}`.toLocaleLowerCase().replaceAll(/\s+/g, "").replaceAll(",", ".");
|
|
1028
|
-
} catch (
|
|
416
|
+
} catch (e2) {
|
|
1029
417
|
return null;
|
|
1030
418
|
}
|
|
1031
419
|
const match = value.match(/^([0-9]*(\.[0-9]*)?)([kmgtp]?)(i?)b?$/);
|
|
@@ -1063,9 +451,9 @@ function orderBy(collection, identifiers2, orders) {
|
|
|
1063
451
|
usage: "sort"
|
|
1064
452
|
}
|
|
1065
453
|
);
|
|
1066
|
-
return [...collection].sort((
|
|
454
|
+
return [...collection].sort((a2, b2) => {
|
|
1067
455
|
for (const [index, identifier] of identifiers2.entries()) {
|
|
1068
|
-
const value = collator.compare(stringify(identifier(
|
|
456
|
+
const value = collator.compare(stringify(identifier(a2)), stringify(identifier(b2)));
|
|
1069
457
|
if (value !== 0) {
|
|
1070
458
|
return value * sorting[index];
|
|
1071
459
|
}
|
|
@@ -1247,15 +635,15 @@ var util$3 = {};
|
|
|
1247
635
|
exports.isEmptyObject = function(obj) {
|
|
1248
636
|
return Object.keys(obj).length === 0;
|
|
1249
637
|
};
|
|
1250
|
-
exports.merge = function(target,
|
|
1251
|
-
if (
|
|
1252
|
-
const keys = Object.keys(
|
|
638
|
+
exports.merge = function(target, a2, arrayMode) {
|
|
639
|
+
if (a2) {
|
|
640
|
+
const keys = Object.keys(a2);
|
|
1253
641
|
const len = keys.length;
|
|
1254
|
-
for (let
|
|
642
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
1255
643
|
if (arrayMode === "strict") {
|
|
1256
|
-
target[keys[
|
|
644
|
+
target[keys[i2]] = [a2[keys[i2]]];
|
|
1257
645
|
} else {
|
|
1258
|
-
target[keys[
|
|
646
|
+
target[keys[i2]] = a2[keys[i2]];
|
|
1259
647
|
}
|
|
1260
648
|
}
|
|
1261
649
|
}
|
|
@@ -1285,31 +673,31 @@ validator$2.validate = function(xmlData, options) {
|
|
|
1285
673
|
if (xmlData[0] === "\uFEFF") {
|
|
1286
674
|
xmlData = xmlData.substr(1);
|
|
1287
675
|
}
|
|
1288
|
-
for (let
|
|
1289
|
-
if (xmlData[
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
if (
|
|
1293
|
-
} else if (xmlData[
|
|
1294
|
-
let tagStartPos =
|
|
1295
|
-
|
|
1296
|
-
if (xmlData[
|
|
1297
|
-
|
|
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);
|
|
1298
686
|
continue;
|
|
1299
687
|
} else {
|
|
1300
688
|
let closingTag = false;
|
|
1301
|
-
if (xmlData[
|
|
689
|
+
if (xmlData[i2] === "/") {
|
|
1302
690
|
closingTag = true;
|
|
1303
|
-
|
|
691
|
+
i2++;
|
|
1304
692
|
}
|
|
1305
693
|
let tagName = "";
|
|
1306
|
-
for (;
|
|
1307
|
-
tagName += xmlData[
|
|
694
|
+
for (; i2 < xmlData.length && xmlData[i2] !== ">" && xmlData[i2] !== " " && xmlData[i2] !== " " && xmlData[i2] !== "\n" && xmlData[i2] !== "\r"; i2++) {
|
|
695
|
+
tagName += xmlData[i2];
|
|
1308
696
|
}
|
|
1309
697
|
tagName = tagName.trim();
|
|
1310
698
|
if (tagName[tagName.length - 1] === "/") {
|
|
1311
699
|
tagName = tagName.substring(0, tagName.length - 1);
|
|
1312
|
-
|
|
700
|
+
i2--;
|
|
1313
701
|
}
|
|
1314
702
|
if (!validateTagName(tagName)) {
|
|
1315
703
|
let msg;
|
|
@@ -1318,16 +706,16 @@ validator$2.validate = function(xmlData, options) {
|
|
|
1318
706
|
} else {
|
|
1319
707
|
msg = "Tag '" + tagName + "' is an invalid name.";
|
|
1320
708
|
}
|
|
1321
|
-
return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData,
|
|
709
|
+
return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i2));
|
|
1322
710
|
}
|
|
1323
|
-
const result = readAttributeStr(xmlData,
|
|
711
|
+
const result = readAttributeStr(xmlData, i2);
|
|
1324
712
|
if (result === false) {
|
|
1325
|
-
return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData,
|
|
713
|
+
return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i2));
|
|
1326
714
|
}
|
|
1327
715
|
let attrStr = result.value;
|
|
1328
|
-
|
|
716
|
+
i2 = result.index;
|
|
1329
717
|
if (attrStr[attrStr.length - 1] === "/") {
|
|
1330
|
-
const attrStrStart =
|
|
718
|
+
const attrStrStart = i2 - attrStr.length;
|
|
1331
719
|
attrStr = attrStr.substring(0, attrStr.length - 1);
|
|
1332
720
|
const isValid = validateAttributeString(attrStr, options);
|
|
1333
721
|
if (isValid === true) {
|
|
@@ -1337,7 +725,7 @@ validator$2.validate = function(xmlData, options) {
|
|
|
1337
725
|
}
|
|
1338
726
|
} else if (closingTag) {
|
|
1339
727
|
if (!result.tagClosed) {
|
|
1340
|
-
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));
|
|
1341
729
|
} else if (attrStr.trim().length > 0) {
|
|
1342
730
|
return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos));
|
|
1343
731
|
} else if (tags.length === 0) {
|
|
@@ -1359,48 +747,48 @@ validator$2.validate = function(xmlData, options) {
|
|
|
1359
747
|
} else {
|
|
1360
748
|
const isValid = validateAttributeString(attrStr, options);
|
|
1361
749
|
if (isValid !== true) {
|
|
1362
|
-
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));
|
|
1363
751
|
}
|
|
1364
752
|
if (reachedRoot === true) {
|
|
1365
|
-
return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData,
|
|
753
|
+
return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i2));
|
|
1366
754
|
} else if (options.unpairedTags.indexOf(tagName) !== -1) ;
|
|
1367
755
|
else {
|
|
1368
756
|
tags.push({ tagName, tagStartPos });
|
|
1369
757
|
}
|
|
1370
758
|
tagFound = true;
|
|
1371
759
|
}
|
|
1372
|
-
for (
|
|
1373
|
-
if (xmlData[
|
|
1374
|
-
if (xmlData[
|
|
1375
|
-
|
|
1376
|
-
|
|
760
|
+
for (i2++; i2 < xmlData.length; i2++) {
|
|
761
|
+
if (xmlData[i2] === "<") {
|
|
762
|
+
if (xmlData[i2 + 1] === "!") {
|
|
763
|
+
i2++;
|
|
764
|
+
i2 = readCommentAndCDATA(xmlData, i2);
|
|
1377
765
|
continue;
|
|
1378
|
-
} else if (xmlData[
|
|
1379
|
-
|
|
1380
|
-
if (
|
|
766
|
+
} else if (xmlData[i2 + 1] === "?") {
|
|
767
|
+
i2 = readPI(xmlData, ++i2);
|
|
768
|
+
if (i2.err) return i2;
|
|
1381
769
|
} else {
|
|
1382
770
|
break;
|
|
1383
771
|
}
|
|
1384
|
-
} else if (xmlData[
|
|
1385
|
-
const afterAmp = validateAmpersand(xmlData,
|
|
772
|
+
} else if (xmlData[i2] === "&") {
|
|
773
|
+
const afterAmp = validateAmpersand(xmlData, i2);
|
|
1386
774
|
if (afterAmp == -1)
|
|
1387
|
-
return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData,
|
|
1388
|
-
|
|
775
|
+
return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i2));
|
|
776
|
+
i2 = afterAmp;
|
|
1389
777
|
} else {
|
|
1390
|
-
if (reachedRoot === true && !isWhiteSpace(xmlData[
|
|
1391
|
-
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));
|
|
1392
780
|
}
|
|
1393
781
|
}
|
|
1394
782
|
}
|
|
1395
|
-
if (xmlData[
|
|
1396
|
-
|
|
783
|
+
if (xmlData[i2] === "<") {
|
|
784
|
+
i2--;
|
|
1397
785
|
}
|
|
1398
786
|
}
|
|
1399
787
|
} else {
|
|
1400
|
-
if (isWhiteSpace(xmlData[
|
|
788
|
+
if (isWhiteSpace(xmlData[i2])) {
|
|
1401
789
|
continue;
|
|
1402
790
|
}
|
|
1403
|
-
return getErrorObject("InvalidChar", "char '" + xmlData[
|
|
791
|
+
return getErrorObject("InvalidChar", "char '" + xmlData[i2] + "' is not expected.", getLineNumberForPosition(xmlData, i2));
|
|
1404
792
|
}
|
|
1405
793
|
}
|
|
1406
794
|
if (!tagFound) {
|
|
@@ -1408,88 +796,88 @@ validator$2.validate = function(xmlData, options) {
|
|
|
1408
796
|
} else if (tags.length == 1) {
|
|
1409
797
|
return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos));
|
|
1410
798
|
} else if (tags.length > 0) {
|
|
1411
|
-
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 });
|
|
1412
800
|
}
|
|
1413
801
|
return true;
|
|
1414
802
|
};
|
|
1415
803
|
function isWhiteSpace(char) {
|
|
1416
804
|
return char === " " || char === " " || char === "\n" || char === "\r";
|
|
1417
805
|
}
|
|
1418
|
-
function readPI(xmlData,
|
|
1419
|
-
const start =
|
|
1420
|
-
for (;
|
|
1421
|
-
if (xmlData[
|
|
1422
|
-
const tagname = xmlData.substr(start,
|
|
1423
|
-
if (
|
|
1424
|
-
return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData,
|
|
1425
|
-
} else if (xmlData[
|
|
1426
|
-
|
|
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++;
|
|
1427
815
|
break;
|
|
1428
816
|
} else {
|
|
1429
817
|
continue;
|
|
1430
818
|
}
|
|
1431
819
|
}
|
|
1432
820
|
}
|
|
1433
|
-
return
|
|
821
|
+
return i2;
|
|
1434
822
|
}
|
|
1435
|
-
function readCommentAndCDATA(xmlData,
|
|
1436
|
-
if (xmlData.length >
|
|
1437
|
-
for (
|
|
1438
|
-
if (xmlData[
|
|
1439
|
-
|
|
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;
|
|
1440
828
|
break;
|
|
1441
829
|
}
|
|
1442
830
|
}
|
|
1443
|
-
} 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") {
|
|
1444
832
|
let angleBracketsCount = 1;
|
|
1445
|
-
for (
|
|
1446
|
-
if (xmlData[
|
|
833
|
+
for (i2 += 8; i2 < xmlData.length; i2++) {
|
|
834
|
+
if (xmlData[i2] === "<") {
|
|
1447
835
|
angleBracketsCount++;
|
|
1448
|
-
} else if (xmlData[
|
|
836
|
+
} else if (xmlData[i2] === ">") {
|
|
1449
837
|
angleBracketsCount--;
|
|
1450
838
|
if (angleBracketsCount === 0) {
|
|
1451
839
|
break;
|
|
1452
840
|
}
|
|
1453
841
|
}
|
|
1454
842
|
}
|
|
1455
|
-
} else if (xmlData.length >
|
|
1456
|
-
for (
|
|
1457
|
-
if (xmlData[
|
|
1458
|
-
|
|
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;
|
|
1459
847
|
break;
|
|
1460
848
|
}
|
|
1461
849
|
}
|
|
1462
850
|
}
|
|
1463
|
-
return
|
|
851
|
+
return i2;
|
|
1464
852
|
}
|
|
1465
853
|
const doubleQuote = '"';
|
|
1466
854
|
const singleQuote = "'";
|
|
1467
|
-
function readAttributeStr(xmlData,
|
|
855
|
+
function readAttributeStr(xmlData, i2) {
|
|
1468
856
|
let attrStr = "";
|
|
1469
857
|
let startChar = "";
|
|
1470
858
|
let tagClosed = false;
|
|
1471
|
-
for (;
|
|
1472
|
-
if (xmlData[
|
|
859
|
+
for (; i2 < xmlData.length; i2++) {
|
|
860
|
+
if (xmlData[i2] === doubleQuote || xmlData[i2] === singleQuote) {
|
|
1473
861
|
if (startChar === "") {
|
|
1474
|
-
startChar = xmlData[
|
|
1475
|
-
} else if (startChar !== xmlData[
|
|
862
|
+
startChar = xmlData[i2];
|
|
863
|
+
} else if (startChar !== xmlData[i2]) ;
|
|
1476
864
|
else {
|
|
1477
865
|
startChar = "";
|
|
1478
866
|
}
|
|
1479
|
-
} else if (xmlData[
|
|
867
|
+
} else if (xmlData[i2] === ">") {
|
|
1480
868
|
if (startChar === "") {
|
|
1481
869
|
tagClosed = true;
|
|
1482
870
|
break;
|
|
1483
871
|
}
|
|
1484
872
|
}
|
|
1485
|
-
attrStr += xmlData[
|
|
873
|
+
attrStr += xmlData[i2];
|
|
1486
874
|
}
|
|
1487
875
|
if (startChar !== "") {
|
|
1488
876
|
return false;
|
|
1489
877
|
}
|
|
1490
878
|
return {
|
|
1491
879
|
value: attrStr,
|
|
1492
|
-
index:
|
|
880
|
+
index: i2,
|
|
1493
881
|
tagClosed
|
|
1494
882
|
};
|
|
1495
883
|
}
|
|
@@ -1497,57 +885,57 @@ const validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\
|
|
|
1497
885
|
function validateAttributeString(attrStr, options) {
|
|
1498
886
|
const matches = util$2.getAllMatches(attrStr, validAttrStrRegxp);
|
|
1499
887
|
const attrNames = {};
|
|
1500
|
-
for (let
|
|
1501
|
-
if (matches[
|
|
1502
|
-
return getErrorObject("InvalidAttr", "Attribute '" + matches[
|
|
1503
|
-
} else if (matches[
|
|
1504
|
-
return getErrorObject("InvalidAttr", "Attribute '" + matches[
|
|
1505
|
-
} else if (matches[
|
|
1506
|
-
return getErrorObject("InvalidAttr", "boolean attribute '" + matches[
|
|
1507
|
-
}
|
|
1508
|
-
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];
|
|
1509
897
|
if (!validateAttrName(attrName)) {
|
|
1510
|
-
return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[
|
|
898
|
+
return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i2]));
|
|
1511
899
|
}
|
|
1512
900
|
if (!attrNames.hasOwnProperty(attrName)) {
|
|
1513
901
|
attrNames[attrName] = 1;
|
|
1514
902
|
} else {
|
|
1515
|
-
return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[
|
|
903
|
+
return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i2]));
|
|
1516
904
|
}
|
|
1517
905
|
}
|
|
1518
906
|
return true;
|
|
1519
907
|
}
|
|
1520
|
-
function validateNumberAmpersand(xmlData,
|
|
908
|
+
function validateNumberAmpersand(xmlData, i2) {
|
|
1521
909
|
let re2 = /\d/;
|
|
1522
|
-
if (xmlData[
|
|
1523
|
-
|
|
910
|
+
if (xmlData[i2] === "x") {
|
|
911
|
+
i2++;
|
|
1524
912
|
re2 = /[\da-fA-F]/;
|
|
1525
913
|
}
|
|
1526
|
-
for (;
|
|
1527
|
-
if (xmlData[
|
|
1528
|
-
return
|
|
1529
|
-
if (!xmlData[
|
|
914
|
+
for (; i2 < xmlData.length; i2++) {
|
|
915
|
+
if (xmlData[i2] === ";")
|
|
916
|
+
return i2;
|
|
917
|
+
if (!xmlData[i2].match(re2))
|
|
1530
918
|
break;
|
|
1531
919
|
}
|
|
1532
920
|
return -1;
|
|
1533
921
|
}
|
|
1534
|
-
function validateAmpersand(xmlData,
|
|
1535
|
-
|
|
1536
|
-
if (xmlData[
|
|
922
|
+
function validateAmpersand(xmlData, i2) {
|
|
923
|
+
i2++;
|
|
924
|
+
if (xmlData[i2] === ";")
|
|
1537
925
|
return -1;
|
|
1538
|
-
if (xmlData[
|
|
1539
|
-
|
|
1540
|
-
return validateNumberAmpersand(xmlData,
|
|
926
|
+
if (xmlData[i2] === "#") {
|
|
927
|
+
i2++;
|
|
928
|
+
return validateNumberAmpersand(xmlData, i2);
|
|
1541
929
|
}
|
|
1542
930
|
let count = 0;
|
|
1543
|
-
for (;
|
|
1544
|
-
if (xmlData[
|
|
931
|
+
for (; i2 < xmlData.length; i2++, count++) {
|
|
932
|
+
if (xmlData[i2].match(/\w/) && count < 20)
|
|
1545
933
|
continue;
|
|
1546
|
-
if (xmlData[
|
|
934
|
+
if (xmlData[i2] === ";")
|
|
1547
935
|
break;
|
|
1548
936
|
return -1;
|
|
1549
937
|
}
|
|
1550
|
-
return
|
|
938
|
+
return i2;
|
|
1551
939
|
}
|
|
1552
940
|
function getErrorObject(code, message, lineNumber) {
|
|
1553
941
|
return {
|
|
@@ -1647,33 +1035,33 @@ class XmlNode {
|
|
|
1647
1035
|
}
|
|
1648
1036
|
var xmlNode$1 = XmlNode;
|
|
1649
1037
|
const util$1 = util$3;
|
|
1650
|
-
function readDocType$1(xmlData,
|
|
1038
|
+
function readDocType$1(xmlData, i2) {
|
|
1651
1039
|
const entities = {};
|
|
1652
|
-
if (xmlData[
|
|
1653
|
-
|
|
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;
|
|
1654
1042
|
let angleBracketsCount = 1;
|
|
1655
1043
|
let hasBody = false, comment = false;
|
|
1656
1044
|
let exp = "";
|
|
1657
|
-
for (;
|
|
1658
|
-
if (xmlData[
|
|
1659
|
-
if (hasBody && isEntity(xmlData,
|
|
1660
|
-
|
|
1661
|
-
[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);
|
|
1662
1050
|
if (val.indexOf("&") === -1)
|
|
1663
1051
|
entities[validateEntityName(entityName)] = {
|
|
1664
1052
|
regx: RegExp(`&${entityName};`, "g"),
|
|
1665
1053
|
val
|
|
1666
1054
|
};
|
|
1667
|
-
} else if (hasBody && isElement(xmlData,
|
|
1668
|
-
else if (hasBody && isAttlist(xmlData,
|
|
1669
|
-
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;
|
|
1670
1058
|
else if (isComment) comment = true;
|
|
1671
1059
|
else throw new Error("Invalid DOCTYPE");
|
|
1672
1060
|
angleBracketsCount++;
|
|
1673
1061
|
exp = "";
|
|
1674
|
-
} else if (xmlData[
|
|
1062
|
+
} else if (xmlData[i2] === ">") {
|
|
1675
1063
|
if (comment) {
|
|
1676
|
-
if (xmlData[
|
|
1064
|
+
if (xmlData[i2 - 1] === "-" && xmlData[i2 - 2] === "-") {
|
|
1677
1065
|
comment = false;
|
|
1678
1066
|
angleBracketsCount--;
|
|
1679
1067
|
}
|
|
@@ -1683,10 +1071,10 @@ function readDocType$1(xmlData, i) {
|
|
|
1683
1071
|
if (angleBracketsCount === 0) {
|
|
1684
1072
|
break;
|
|
1685
1073
|
}
|
|
1686
|
-
} else if (xmlData[
|
|
1074
|
+
} else if (xmlData[i2] === "[") {
|
|
1687
1075
|
hasBody = true;
|
|
1688
1076
|
} else {
|
|
1689
|
-
exp += xmlData[
|
|
1077
|
+
exp += xmlData[i2];
|
|
1690
1078
|
}
|
|
1691
1079
|
}
|
|
1692
1080
|
if (angleBracketsCount !== 0) {
|
|
@@ -1695,40 +1083,40 @@ function readDocType$1(xmlData, i) {
|
|
|
1695
1083
|
} else {
|
|
1696
1084
|
throw new Error(`Invalid Tag instead of DOCTYPE`);
|
|
1697
1085
|
}
|
|
1698
|
-
return { entities, i };
|
|
1086
|
+
return { entities, i: i2 };
|
|
1699
1087
|
}
|
|
1700
|
-
function readEntityExp(xmlData,
|
|
1088
|
+
function readEntityExp(xmlData, i2) {
|
|
1701
1089
|
let entityName2 = "";
|
|
1702
|
-
for (;
|
|
1703
|
-
entityName2 += xmlData[
|
|
1090
|
+
for (; i2 < xmlData.length && (xmlData[i2] !== "'" && xmlData[i2] !== '"'); i2++) {
|
|
1091
|
+
entityName2 += xmlData[i2];
|
|
1704
1092
|
}
|
|
1705
1093
|
entityName2 = entityName2.trim();
|
|
1706
1094
|
if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported");
|
|
1707
|
-
const startChar = xmlData[
|
|
1095
|
+
const startChar = xmlData[i2++];
|
|
1708
1096
|
let val2 = "";
|
|
1709
|
-
for (;
|
|
1710
|
-
val2 += xmlData[
|
|
1097
|
+
for (; i2 < xmlData.length && xmlData[i2] !== startChar; i2++) {
|
|
1098
|
+
val2 += xmlData[i2];
|
|
1711
1099
|
}
|
|
1712
|
-
return [entityName2, val2,
|
|
1100
|
+
return [entityName2, val2, i2];
|
|
1713
1101
|
}
|
|
1714
|
-
function isComment(xmlData,
|
|
1715
|
-
if (xmlData[
|
|
1102
|
+
function isComment(xmlData, i2) {
|
|
1103
|
+
if (xmlData[i2 + 1] === "!" && xmlData[i2 + 2] === "-" && xmlData[i2 + 3] === "-") return true;
|
|
1716
1104
|
return false;
|
|
1717
1105
|
}
|
|
1718
|
-
function isEntity(xmlData,
|
|
1719
|
-
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;
|
|
1720
1108
|
return false;
|
|
1721
1109
|
}
|
|
1722
|
-
function isElement(xmlData,
|
|
1723
|
-
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;
|
|
1724
1112
|
return false;
|
|
1725
1113
|
}
|
|
1726
|
-
function isAttlist(xmlData,
|
|
1727
|
-
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;
|
|
1728
1116
|
return false;
|
|
1729
1117
|
}
|
|
1730
|
-
function isNotation(xmlData,
|
|
1731
|
-
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;
|
|
1732
1120
|
return false;
|
|
1733
1121
|
}
|
|
1734
1122
|
function validateEntityName(name) {
|
|
@@ -1878,8 +1266,8 @@ let OrderedObjParser$1 = class OrderedObjParser {
|
|
|
1878
1266
|
};
|
|
1879
1267
|
function addExternalEntities(externalEntities) {
|
|
1880
1268
|
const entKeys = Object.keys(externalEntities);
|
|
1881
|
-
for (let
|
|
1882
|
-
const ent = entKeys[
|
|
1269
|
+
for (let i2 = 0; i2 < entKeys.length; i2++) {
|
|
1270
|
+
const ent = entKeys[i2];
|
|
1883
1271
|
this.lastEntities[ent] = {
|
|
1884
1272
|
regex: new RegExp("&" + ent + ";", "g"),
|
|
1885
1273
|
val: externalEntities[ent]
|
|
@@ -1930,12 +1318,12 @@ function buildAttributesMap(attrStr, jPath, tagName) {
|
|
|
1930
1318
|
const matches = util.getAllMatches(attrStr, attrsRegx);
|
|
1931
1319
|
const len = matches.length;
|
|
1932
1320
|
const attrs = {};
|
|
1933
|
-
for (let
|
|
1934
|
-
const attrName = this.resolveNameSpace(matches[
|
|
1321
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
1322
|
+
const attrName = this.resolveNameSpace(matches[i2][1]);
|
|
1935
1323
|
if (this.ignoreAttributesFn(attrName, jPath)) {
|
|
1936
1324
|
continue;
|
|
1937
1325
|
}
|
|
1938
|
-
let oldVal = matches[
|
|
1326
|
+
let oldVal = matches[i2][4];
|
|
1939
1327
|
let aName = this.options.attributeNamePrefix + attrName;
|
|
1940
1328
|
if (attrName.length) {
|
|
1941
1329
|
if (this.options.transformAttributeName) {
|
|
@@ -1981,12 +1369,12 @@ const parseXml = function(xmlData) {
|
|
|
1981
1369
|
let currentNode = xmlObj;
|
|
1982
1370
|
let textData = "";
|
|
1983
1371
|
let jPath = "";
|
|
1984
|
-
for (let
|
|
1985
|
-
const ch = xmlData[
|
|
1372
|
+
for (let i2 = 0; i2 < xmlData.length; i2++) {
|
|
1373
|
+
const ch = xmlData[i2];
|
|
1986
1374
|
if (ch === "<") {
|
|
1987
|
-
if (xmlData[
|
|
1988
|
-
const closeIndex = findClosingIndex(xmlData, ">",
|
|
1989
|
-
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();
|
|
1990
1378
|
if (this.options.removeNSPrefix) {
|
|
1991
1379
|
const colonIndex = tagName.indexOf(":");
|
|
1992
1380
|
if (colonIndex !== -1) {
|
|
@@ -2013,9 +1401,9 @@ const parseXml = function(xmlData) {
|
|
|
2013
1401
|
jPath = jPath.substring(0, propIndex);
|
|
2014
1402
|
currentNode = this.tagsNodeStack.pop();
|
|
2015
1403
|
textData = "";
|
|
2016
|
-
|
|
2017
|
-
} else if (xmlData[
|
|
2018
|
-
let tagData = readTagExp(xmlData,
|
|
1404
|
+
i2 = closeIndex;
|
|
1405
|
+
} else if (xmlData[i2 + 1] === "?") {
|
|
1406
|
+
let tagData = readTagExp(xmlData, i2, false, "?>");
|
|
2019
1407
|
if (!tagData) throw new Error("Pi Tag is not closed.");
|
|
2020
1408
|
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
2021
1409
|
if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) ;
|
|
@@ -2027,22 +1415,22 @@ const parseXml = function(xmlData) {
|
|
|
2027
1415
|
}
|
|
2028
1416
|
this.addChild(currentNode, childNode, jPath);
|
|
2029
1417
|
}
|
|
2030
|
-
|
|
2031
|
-
} else if (xmlData.substr(
|
|
2032
|
-
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.");
|
|
2033
1421
|
if (this.options.commentPropName) {
|
|
2034
|
-
const comment = xmlData.substring(
|
|
1422
|
+
const comment = xmlData.substring(i2 + 4, endIndex - 2);
|
|
2035
1423
|
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
2036
1424
|
currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]);
|
|
2037
1425
|
}
|
|
2038
|
-
|
|
2039
|
-
} else if (xmlData.substr(
|
|
2040
|
-
const result = readDocType(xmlData,
|
|
1426
|
+
i2 = endIndex;
|
|
1427
|
+
} else if (xmlData.substr(i2 + 1, 2) === "!D") {
|
|
1428
|
+
const result = readDocType(xmlData, i2);
|
|
2041
1429
|
this.docTypeEntities = result.entities;
|
|
2042
|
-
|
|
2043
|
-
} else if (xmlData.substr(
|
|
2044
|
-
const closeIndex = findClosingIndex(xmlData, "]]>",
|
|
2045
|
-
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);
|
|
2046
1434
|
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
2047
1435
|
let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true);
|
|
2048
1436
|
if (val2 == void 0) val2 = "";
|
|
@@ -2051,9 +1439,9 @@ const parseXml = function(xmlData) {
|
|
|
2051
1439
|
} else {
|
|
2052
1440
|
currentNode.add(this.options.textNodeName, val2);
|
|
2053
1441
|
}
|
|
2054
|
-
|
|
1442
|
+
i2 = closeIndex + 2;
|
|
2055
1443
|
} else {
|
|
2056
|
-
let result = readTagExp(xmlData,
|
|
1444
|
+
let result = readTagExp(xmlData, i2, this.options.removeNSPrefix);
|
|
2057
1445
|
let tagName = result.tagName;
|
|
2058
1446
|
const rawTagName = result.rawTagName;
|
|
2059
1447
|
let tagExp = result.tagExp;
|
|
@@ -2085,13 +1473,13 @@ const parseXml = function(xmlData) {
|
|
|
2085
1473
|
} else {
|
|
2086
1474
|
tagExp = tagExp.substr(0, tagExp.length - 1);
|
|
2087
1475
|
}
|
|
2088
|
-
|
|
1476
|
+
i2 = result.closeIndex;
|
|
2089
1477
|
} else if (this.options.unpairedTags.indexOf(tagName) !== -1) {
|
|
2090
|
-
|
|
1478
|
+
i2 = result.closeIndex;
|
|
2091
1479
|
} else {
|
|
2092
1480
|
const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1);
|
|
2093
1481
|
if (!result2) throw new Error(`Unexpected end of ${rawTagName}`);
|
|
2094
|
-
|
|
1482
|
+
i2 = result2.i;
|
|
2095
1483
|
tagContent = result2.tagContent;
|
|
2096
1484
|
}
|
|
2097
1485
|
const childNode = new xmlNode(tagName);
|
|
@@ -2132,11 +1520,11 @@ const parseXml = function(xmlData) {
|
|
|
2132
1520
|
currentNode = childNode;
|
|
2133
1521
|
}
|
|
2134
1522
|
textData = "";
|
|
2135
|
-
|
|
1523
|
+
i2 = closeIndex;
|
|
2136
1524
|
}
|
|
2137
1525
|
}
|
|
2138
1526
|
} else {
|
|
2139
|
-
textData += xmlData[
|
|
1527
|
+
textData += xmlData[i2];
|
|
2140
1528
|
}
|
|
2141
1529
|
}
|
|
2142
1530
|
return xmlObj.child;
|
|
@@ -2196,10 +1584,10 @@ function isItStopNode(stopNodes, jPath, currentTagName) {
|
|
|
2196
1584
|
}
|
|
2197
1585
|
return false;
|
|
2198
1586
|
}
|
|
2199
|
-
function tagExpWithClosingIndex(xmlData,
|
|
1587
|
+
function tagExpWithClosingIndex(xmlData, i2, closingChar = ">") {
|
|
2200
1588
|
let attrBoundary;
|
|
2201
1589
|
let tagExp = "";
|
|
2202
|
-
for (let index =
|
|
1590
|
+
for (let index = i2; index < xmlData.length; index++) {
|
|
2203
1591
|
let ch = xmlData[index];
|
|
2204
1592
|
if (attrBoundary) {
|
|
2205
1593
|
if (ch === attrBoundary) attrBoundary = "";
|
|
@@ -2225,16 +1613,16 @@ function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
|
|
|
2225
1613
|
tagExp += ch;
|
|
2226
1614
|
}
|
|
2227
1615
|
}
|
|
2228
|
-
function findClosingIndex(xmlData, str,
|
|
2229
|
-
const closingIndex = xmlData.indexOf(str,
|
|
1616
|
+
function findClosingIndex(xmlData, str, i2, errMsg) {
|
|
1617
|
+
const closingIndex = xmlData.indexOf(str, i2);
|
|
2230
1618
|
if (closingIndex === -1) {
|
|
2231
1619
|
throw new Error(errMsg);
|
|
2232
1620
|
} else {
|
|
2233
1621
|
return closingIndex + str.length - 1;
|
|
2234
1622
|
}
|
|
2235
1623
|
}
|
|
2236
|
-
function readTagExp(xmlData,
|
|
2237
|
-
const result = tagExpWithClosingIndex(xmlData,
|
|
1624
|
+
function readTagExp(xmlData, i2, removeNSPrefix, closingChar = ">") {
|
|
1625
|
+
const result = tagExpWithClosingIndex(xmlData, i2 + 1, closingChar);
|
|
2238
1626
|
if (!result) return;
|
|
2239
1627
|
let tagExp = result.data;
|
|
2240
1628
|
const closeIndex = result.index;
|
|
@@ -2261,41 +1649,41 @@ function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
|
|
|
2261
1649
|
rawTagName
|
|
2262
1650
|
};
|
|
2263
1651
|
}
|
|
2264
|
-
function readStopNodeData(xmlData, tagName,
|
|
2265
|
-
const startIndex =
|
|
1652
|
+
function readStopNodeData(xmlData, tagName, i2) {
|
|
1653
|
+
const startIndex = i2;
|
|
2266
1654
|
let openTagCount = 1;
|
|
2267
|
-
for (;
|
|
2268
|
-
if (xmlData[
|
|
2269
|
-
if (xmlData[
|
|
2270
|
-
const closeIndex = findClosingIndex(xmlData, ">",
|
|
2271
|
-
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();
|
|
2272
1660
|
if (closeTagName === tagName) {
|
|
2273
1661
|
openTagCount--;
|
|
2274
1662
|
if (openTagCount === 0) {
|
|
2275
1663
|
return {
|
|
2276
|
-
tagContent: xmlData.substring(startIndex,
|
|
1664
|
+
tagContent: xmlData.substring(startIndex, i2),
|
|
2277
1665
|
i: closeIndex
|
|
2278
1666
|
};
|
|
2279
1667
|
}
|
|
2280
1668
|
}
|
|
2281
|
-
|
|
2282
|
-
} else if (xmlData[
|
|
2283
|
-
const closeIndex = findClosingIndex(xmlData, "?>",
|
|
2284
|
-
|
|
2285
|
-
} else if (xmlData.substr(
|
|
2286
|
-
const closeIndex = findClosingIndex(xmlData, "-->",
|
|
2287
|
-
|
|
2288
|
-
} else if (xmlData.substr(
|
|
2289
|
-
const closeIndex = findClosingIndex(xmlData, "]]>",
|
|
2290
|
-
|
|
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;
|
|
2291
1679
|
} else {
|
|
2292
|
-
const tagData = readTagExp(xmlData,
|
|
1680
|
+
const tagData = readTagExp(xmlData, i2, ">");
|
|
2293
1681
|
if (tagData) {
|
|
2294
1682
|
const openTagName = tagData && tagData.tagName;
|
|
2295
1683
|
if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") {
|
|
2296
1684
|
openTagCount++;
|
|
2297
1685
|
}
|
|
2298
|
-
|
|
1686
|
+
i2 = tagData.closeIndex;
|
|
2299
1687
|
}
|
|
2300
1688
|
}
|
|
2301
1689
|
}
|
|
@@ -2323,8 +1711,8 @@ function prettify$1(node, options) {
|
|
|
2323
1711
|
function compress(arr, options, jPath) {
|
|
2324
1712
|
let text;
|
|
2325
1713
|
const compressedObj = {};
|
|
2326
|
-
for (let
|
|
2327
|
-
const tagObj = arr[
|
|
1714
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1715
|
+
const tagObj = arr[i2];
|
|
2328
1716
|
const property = propName$1(tagObj);
|
|
2329
1717
|
let newJpath = "";
|
|
2330
1718
|
if (jPath === void 0) newJpath = property;
|
|
@@ -2366,8 +1754,8 @@ function compress(arr, options, jPath) {
|
|
|
2366
1754
|
}
|
|
2367
1755
|
function propName$1(obj) {
|
|
2368
1756
|
const keys = Object.keys(obj);
|
|
2369
|
-
for (let
|
|
2370
|
-
const key = keys[
|
|
1757
|
+
for (let i2 = 0; i2 < keys.length; i2++) {
|
|
1758
|
+
const key = keys[i2];
|
|
2371
1759
|
if (key !== ":@") return key;
|
|
2372
1760
|
}
|
|
2373
1761
|
}
|
|
@@ -2375,8 +1763,8 @@ function assignAttributes(obj, attrMap, jpath, options) {
|
|
|
2375
1763
|
if (attrMap) {
|
|
2376
1764
|
const keys = Object.keys(attrMap);
|
|
2377
1765
|
const len = keys.length;
|
|
2378
|
-
for (let
|
|
2379
|
-
const atrrName = keys[
|
|
1766
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
1767
|
+
const atrrName = keys[i2];
|
|
2380
1768
|
if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) {
|
|
2381
1769
|
obj[atrrName] = [attrMap[atrrName]];
|
|
2382
1770
|
} else {
|
|
@@ -2460,8 +1848,8 @@ function toXml(jArray, options) {
|
|
|
2460
1848
|
function arrToStr(arr, options, jPath, indentation) {
|
|
2461
1849
|
let xmlStr = "";
|
|
2462
1850
|
let isPreviousElementTag = false;
|
|
2463
|
-
for (let
|
|
2464
|
-
const tagObj = arr[
|
|
1851
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1852
|
+
const tagObj = arr[i2];
|
|
2465
1853
|
const tagName = propName(tagObj);
|
|
2466
1854
|
if (tagName === void 0) continue;
|
|
2467
1855
|
let newJPath = "";
|
|
@@ -2528,8 +1916,8 @@ function arrToStr(arr, options, jPath, indentation) {
|
|
|
2528
1916
|
}
|
|
2529
1917
|
function propName(obj) {
|
|
2530
1918
|
const keys = Object.keys(obj);
|
|
2531
|
-
for (let
|
|
2532
|
-
const key = keys[
|
|
1919
|
+
for (let i2 = 0; i2 < keys.length; i2++) {
|
|
1920
|
+
const key = keys[i2];
|
|
2533
1921
|
if (!obj.hasOwnProperty(key)) continue;
|
|
2534
1922
|
if (key !== ":@") return key;
|
|
2535
1923
|
}
|
|
@@ -2560,8 +1948,8 @@ function isStopNode(jPath, options) {
|
|
|
2560
1948
|
}
|
|
2561
1949
|
function replaceEntitiesValue(textValue, options) {
|
|
2562
1950
|
if (textValue && textValue.length > 0 && options.processEntities) {
|
|
2563
|
-
for (let
|
|
2564
|
-
const entity = options.entities[
|
|
1951
|
+
for (let i2 = 0; i2 < options.entities.length; i2++) {
|
|
1952
|
+
const entity = options.entities[i2];
|
|
2565
1953
|
textValue = textValue.replace(entity.regex, entity.val);
|
|
2566
1954
|
}
|
|
2567
1955
|
}
|
|
@@ -2581,11 +1969,11 @@ const defaultOptions = {
|
|
|
2581
1969
|
suppressEmptyNode: false,
|
|
2582
1970
|
suppressUnpairedNode: true,
|
|
2583
1971
|
suppressBooleanAttributes: true,
|
|
2584
|
-
tagValueProcessor: function(key,
|
|
2585
|
-
return
|
|
1972
|
+
tagValueProcessor: function(key, a2) {
|
|
1973
|
+
return a2;
|
|
2586
1974
|
},
|
|
2587
|
-
attributeValueProcessor: function(attrName,
|
|
2588
|
-
return
|
|
1975
|
+
attributeValueProcessor: function(attrName, a2) {
|
|
1976
|
+
return a2;
|
|
2589
1977
|
},
|
|
2590
1978
|
preserveOrder: false,
|
|
2591
1979
|
commentPropName: false,
|
|
@@ -2676,8 +2064,8 @@ Builder.prototype.j2x = function(jObj, level, ajPath) {
|
|
|
2676
2064
|
const arrLen = jObj[key].length;
|
|
2677
2065
|
let listTagVal = "";
|
|
2678
2066
|
let listTagAttr = "";
|
|
2679
|
-
for (let
|
|
2680
|
-
const item = jObj[key][
|
|
2067
|
+
for (let j2 = 0; j2 < arrLen; j2++) {
|
|
2068
|
+
const item = jObj[key][j2];
|
|
2681
2069
|
if (typeof item === "undefined") ;
|
|
2682
2070
|
else if (item === null) {
|
|
2683
2071
|
if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar;
|
|
@@ -2710,8 +2098,8 @@ Builder.prototype.j2x = function(jObj, level, ajPath) {
|
|
|
2710
2098
|
if (this.options.attributesGroupName && key === this.options.attributesGroupName) {
|
|
2711
2099
|
const Ks = Object.keys(jObj[key]);
|
|
2712
2100
|
const L = Ks.length;
|
|
2713
|
-
for (let
|
|
2714
|
-
attrStr += this.buildAttrPairStr(Ks[
|
|
2101
|
+
for (let j2 = 0; j2 < L; j2++) {
|
|
2102
|
+
attrStr += this.buildAttrPairStr(Ks[j2], "" + jObj[key][Ks[j2]]);
|
|
2715
2103
|
}
|
|
2716
2104
|
} else {
|
|
2717
2105
|
val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath);
|
|
@@ -2787,8 +2175,8 @@ Builder.prototype.buildTextValNode = function(val2, key, attrStr, level) {
|
|
|
2787
2175
|
};
|
|
2788
2176
|
Builder.prototype.replaceEntitiesValue = function(textValue) {
|
|
2789
2177
|
if (textValue && textValue.length > 0 && this.options.processEntities) {
|
|
2790
|
-
for (let
|
|
2791
|
-
const entity = this.options.entities[
|
|
2178
|
+
for (let i2 = 0; i2 < this.options.entities.length; i2++) {
|
|
2179
|
+
const entity = this.options.entities[i2];
|
|
2792
2180
|
textValue = textValue.replace(entity.regex, entity.val);
|
|
2793
2181
|
}
|
|
2794
2182
|
}
|
|
@@ -2913,8 +2301,8 @@ const isValidView = function(view) {
|
|
|
2913
2301
|
if (!view.name || typeof view.name !== "string") {
|
|
2914
2302
|
throw new Error("View name is required and must be a string");
|
|
2915
2303
|
}
|
|
2916
|
-
if (
|
|
2917
|
-
throw new Error("View caption
|
|
2304
|
+
if ("caption" in view && typeof view.caption !== "string") {
|
|
2305
|
+
throw new Error("View caption must be a string");
|
|
2918
2306
|
}
|
|
2919
2307
|
if (!view.getContents || typeof view.getContents !== "function") {
|
|
2920
2308
|
throw new Error("View getContents is required and must be a function");
|
|
@@ -2992,7 +2380,7 @@ var re$1 = { exports: {} };
|
|
|
2992
2380
|
const re2 = exports.re = [];
|
|
2993
2381
|
const safeRe = exports.safeRe = [];
|
|
2994
2382
|
const src = exports.src = [];
|
|
2995
|
-
const
|
|
2383
|
+
const t3 = exports.t = {};
|
|
2996
2384
|
let R = 0;
|
|
2997
2385
|
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
2998
2386
|
const safeRegexReplacements = [
|
|
@@ -3010,7 +2398,7 @@ var re$1 = { exports: {} };
|
|
|
3010
2398
|
const safe = makeSafeRegex(value);
|
|
3011
2399
|
const index = R++;
|
|
3012
2400
|
debug2(name, index, value);
|
|
3013
|
-
|
|
2401
|
+
t3[name] = index;
|
|
3014
2402
|
src[index] = value;
|
|
3015
2403
|
re2[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
3016
2404
|
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
@@ -3018,46 +2406,46 @@ var re$1 = { exports: {} };
|
|
|
3018
2406
|
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
3019
2407
|
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
3020
2408
|
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
3021
|
-
createToken("MAINVERSION", `(${src[
|
|
3022
|
-
createToken("MAINVERSIONLOOSE", `(${src[
|
|
3023
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[
|
|
3024
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[
|
|
3025
|
-
createToken("PRERELEASE", `(?:-(${src[
|
|
3026
|
-
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]})*))`);
|
|
3027
2415
|
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
3028
|
-
createToken("BUILD", `(?:\\+(${src[
|
|
3029
|
-
createToken("FULLPLAIN", `v?${src[
|
|
3030
|
-
createToken("FULL", `^${src[
|
|
3031
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[
|
|
3032
|
-
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]}$`);
|
|
3033
2421
|
createToken("GTLT", "((?:<|>)?=?)");
|
|
3034
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[
|
|
3035
|
-
createToken("XRANGEIDENTIFIER", `${src[
|
|
3036
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[
|
|
3037
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[
|
|
3038
|
-
createToken("XRANGE", `^${src[
|
|
3039
|
-
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]}$`);
|
|
3040
2428
|
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH2}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH2}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH2}}))?`);
|
|
3041
|
-
createToken("COERCE", `${src[
|
|
3042
|
-
createToken("COERCEFULL", src[
|
|
3043
|
-
createToken("COERCERTL", src[
|
|
3044
|
-
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);
|
|
3045
2433
|
createToken("LONETILDE", "(?:~>?)");
|
|
3046
|
-
createToken("TILDETRIM", `(\\s*)${src[
|
|
2434
|
+
createToken("TILDETRIM", `(\\s*)${src[t3.LONETILDE]}\\s+`, true);
|
|
3047
2435
|
exports.tildeTrimReplace = "$1~";
|
|
3048
|
-
createToken("TILDE", `^${src[
|
|
3049
|
-
createToken("TILDELOOSE", `^${src[
|
|
2436
|
+
createToken("TILDE", `^${src[t3.LONETILDE]}${src[t3.XRANGEPLAIN]}$`);
|
|
2437
|
+
createToken("TILDELOOSE", `^${src[t3.LONETILDE]}${src[t3.XRANGEPLAINLOOSE]}$`);
|
|
3050
2438
|
createToken("LONECARET", "(?:\\^)");
|
|
3051
|
-
createToken("CARETTRIM", `(\\s*)${src[
|
|
2439
|
+
createToken("CARETTRIM", `(\\s*)${src[t3.LONECARET]}\\s+`, true);
|
|
3052
2440
|
exports.caretTrimReplace = "$1^";
|
|
3053
|
-
createToken("CARET", `^${src[
|
|
3054
|
-
createToken("CARETLOOSE", `^${src[
|
|
3055
|
-
createToken("COMPARATORLOOSE", `^${src[
|
|
3056
|
-
createToken("COMPARATOR", `^${src[
|
|
3057
|
-
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);
|
|
3058
2446
|
exports.comparatorTrimReplace = "$1$2$3";
|
|
3059
|
-
createToken("HYPHENRANGE", `^\\s*(${src[
|
|
3060
|
-
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*$`);
|
|
3061
2449
|
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
3062
2450
|
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
3063
2451
|
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
@@ -3076,23 +2464,23 @@ const parseOptions$1 = (options) => {
|
|
|
3076
2464
|
};
|
|
3077
2465
|
var parseOptions_1 = parseOptions$1;
|
|
3078
2466
|
const numeric = /^[0-9]+$/;
|
|
3079
|
-
const compareIdentifiers$1 = (
|
|
3080
|
-
const anum = numeric.test(
|
|
3081
|
-
const bnum = numeric.test(
|
|
2467
|
+
const compareIdentifiers$1 = (a2, b2) => {
|
|
2468
|
+
const anum = numeric.test(a2);
|
|
2469
|
+
const bnum = numeric.test(b2);
|
|
3082
2470
|
if (anum && bnum) {
|
|
3083
|
-
|
|
3084
|
-
|
|
2471
|
+
a2 = +a2;
|
|
2472
|
+
b2 = +b2;
|
|
3085
2473
|
}
|
|
3086
|
-
return
|
|
2474
|
+
return a2 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b2 ? -1 : 1;
|
|
3087
2475
|
};
|
|
3088
|
-
const rcompareIdentifiers = (
|
|
2476
|
+
const rcompareIdentifiers = (a2, b2) => compareIdentifiers$1(b2, a2);
|
|
3089
2477
|
var identifiers = {
|
|
3090
2478
|
compareIdentifiers: compareIdentifiers$1,
|
|
3091
2479
|
rcompareIdentifiers
|
|
3092
2480
|
};
|
|
3093
2481
|
const debug = debug_1;
|
|
3094
2482
|
const { MAX_LENGTH, MAX_SAFE_INTEGER } = constants;
|
|
3095
|
-
const { safeRe: re, t } = reExports;
|
|
2483
|
+
const { safeRe: re, t: t2 } = reExports;
|
|
3096
2484
|
const parseOptions = parseOptions_1;
|
|
3097
2485
|
const { compareIdentifiers } = identifiers;
|
|
3098
2486
|
let SemVer$2 = class SemVer {
|
|
@@ -3116,14 +2504,14 @@ let SemVer$2 = class SemVer {
|
|
|
3116
2504
|
this.options = options;
|
|
3117
2505
|
this.loose = !!options.loose;
|
|
3118
2506
|
this.includePrerelease = !!options.includePrerelease;
|
|
3119
|
-
const
|
|
3120
|
-
if (!
|
|
2507
|
+
const m2 = version.trim().match(options.loose ? re[t2.LOOSE] : re[t2.FULL]);
|
|
2508
|
+
if (!m2) {
|
|
3121
2509
|
throw new TypeError(`Invalid Version: ${version}`);
|
|
3122
2510
|
}
|
|
3123
2511
|
this.raw = version;
|
|
3124
|
-
this.major = +
|
|
3125
|
-
this.minor = +
|
|
3126
|
-
this.patch = +
|
|
2512
|
+
this.major = +m2[1];
|
|
2513
|
+
this.minor = +m2[2];
|
|
2514
|
+
this.patch = +m2[3];
|
|
3127
2515
|
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
3128
2516
|
throw new TypeError("Invalid major version");
|
|
3129
2517
|
}
|
|
@@ -3133,10 +2521,10 @@ let SemVer$2 = class SemVer {
|
|
|
3133
2521
|
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
3134
2522
|
throw new TypeError("Invalid patch version");
|
|
3135
2523
|
}
|
|
3136
|
-
if (!
|
|
2524
|
+
if (!m2[4]) {
|
|
3137
2525
|
this.prerelease = [];
|
|
3138
2526
|
} else {
|
|
3139
|
-
this.prerelease =
|
|
2527
|
+
this.prerelease = m2[4].split(".").map((id) => {
|
|
3140
2528
|
if (/^[0-9]+$/.test(id)) {
|
|
3141
2529
|
const num = +id;
|
|
3142
2530
|
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
@@ -3146,7 +2534,7 @@ let SemVer$2 = class SemVer {
|
|
|
3146
2534
|
return id;
|
|
3147
2535
|
});
|
|
3148
2536
|
}
|
|
3149
|
-
this.build =
|
|
2537
|
+
this.build = m2[5] ? m2[5].split(".") : [];
|
|
3150
2538
|
this.format();
|
|
3151
2539
|
}
|
|
3152
2540
|
format() {
|
|
@@ -3189,45 +2577,45 @@ let SemVer$2 = class SemVer {
|
|
|
3189
2577
|
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
3190
2578
|
return 0;
|
|
3191
2579
|
}
|
|
3192
|
-
let
|
|
2580
|
+
let i2 = 0;
|
|
3193
2581
|
do {
|
|
3194
|
-
const
|
|
3195
|
-
const
|
|
3196
|
-
debug("prerelease compare",
|
|
3197
|
-
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) {
|
|
3198
2586
|
return 0;
|
|
3199
|
-
} else if (
|
|
2587
|
+
} else if (b2 === void 0) {
|
|
3200
2588
|
return 1;
|
|
3201
|
-
} else if (
|
|
2589
|
+
} else if (a2 === void 0) {
|
|
3202
2590
|
return -1;
|
|
3203
|
-
} else if (
|
|
2591
|
+
} else if (a2 === b2) {
|
|
3204
2592
|
continue;
|
|
3205
2593
|
} else {
|
|
3206
|
-
return compareIdentifiers(
|
|
2594
|
+
return compareIdentifiers(a2, b2);
|
|
3207
2595
|
}
|
|
3208
|
-
} while (++
|
|
2596
|
+
} while (++i2);
|
|
3209
2597
|
}
|
|
3210
2598
|
compareBuild(other) {
|
|
3211
2599
|
if (!(other instanceof SemVer)) {
|
|
3212
2600
|
other = new SemVer(other, this.options);
|
|
3213
2601
|
}
|
|
3214
|
-
let
|
|
2602
|
+
let i2 = 0;
|
|
3215
2603
|
do {
|
|
3216
|
-
const
|
|
3217
|
-
const
|
|
3218
|
-
debug("build compare",
|
|
3219
|
-
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) {
|
|
3220
2608
|
return 0;
|
|
3221
|
-
} else if (
|
|
2609
|
+
} else if (b2 === void 0) {
|
|
3222
2610
|
return 1;
|
|
3223
|
-
} else if (
|
|
2611
|
+
} else if (a2 === void 0) {
|
|
3224
2612
|
return -1;
|
|
3225
|
-
} else if (
|
|
2613
|
+
} else if (a2 === b2) {
|
|
3226
2614
|
continue;
|
|
3227
2615
|
} else {
|
|
3228
|
-
return compareIdentifiers(
|
|
2616
|
+
return compareIdentifiers(a2, b2);
|
|
3229
2617
|
}
|
|
3230
|
-
} while (++
|
|
2618
|
+
} while (++i2);
|
|
3231
2619
|
}
|
|
3232
2620
|
// preminor will bump the version up to the next minor release, and immediately
|
|
3233
2621
|
// down to pre-release. premajor and prepatch work the same way.
|
|
@@ -3286,14 +2674,14 @@ let SemVer$2 = class SemVer {
|
|
|
3286
2674
|
if (this.prerelease.length === 0) {
|
|
3287
2675
|
this.prerelease = [base];
|
|
3288
2676
|
} else {
|
|
3289
|
-
let
|
|
3290
|
-
while (--
|
|
3291
|
-
if (typeof this.prerelease[
|
|
3292
|
-
this.prerelease[
|
|
3293
|
-
|
|
2677
|
+
let i2 = this.prerelease.length;
|
|
2678
|
+
while (--i2 >= 0) {
|
|
2679
|
+
if (typeof this.prerelease[i2] === "number") {
|
|
2680
|
+
this.prerelease[i2]++;
|
|
2681
|
+
i2 = -2;
|
|
3294
2682
|
}
|
|
3295
2683
|
}
|
|
3296
|
-
if (
|
|
2684
|
+
if (i2 === -1) {
|
|
3297
2685
|
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
3298
2686
|
throw new Error("invalid increment argument: identifier already exists");
|
|
3299
2687
|
}
|
|
@@ -3349,7 +2737,7 @@ const valid = (version, options) => {
|
|
|
3349
2737
|
var valid_1 = valid;
|
|
3350
2738
|
const valid$1 = /* @__PURE__ */ getDefaultExportFromCjs(valid_1);
|
|
3351
2739
|
const SemVer2 = semver;
|
|
3352
|
-
const major = (
|
|
2740
|
+
const major = (a2, loose) => new SemVer2(a2, loose).major;
|
|
3353
2741
|
var major_1 = major;
|
|
3354
2742
|
const major$1 = /* @__PURE__ */ getDefaultExportFromCjs(major_1);
|
|
3355
2743
|
class ProxyBus {
|
|
@@ -3393,15 +2781,15 @@ class SimpleBus {
|
|
|
3393
2781
|
unsubscribe(name, handler) {
|
|
3394
2782
|
this.handlers.set(
|
|
3395
2783
|
name,
|
|
3396
|
-
(this.handlers.get(name) || []).filter((
|
|
2784
|
+
(this.handlers.get(name) || []).filter((h2) => h2 !== handler)
|
|
3397
2785
|
);
|
|
3398
2786
|
}
|
|
3399
2787
|
emit(name, event) {
|
|
3400
|
-
(this.handlers.get(name) || []).forEach((
|
|
2788
|
+
(this.handlers.get(name) || []).forEach((h2) => {
|
|
3401
2789
|
try {
|
|
3402
|
-
|
|
3403
|
-
} catch (
|
|
3404
|
-
console.error("could not invoke event listener",
|
|
2790
|
+
h2(event);
|
|
2791
|
+
} catch (e2) {
|
|
2792
|
+
console.error("could not invoke event listener", e2);
|
|
3405
2793
|
}
|
|
3406
2794
|
});
|
|
3407
2795
|
}
|
|
@@ -3490,49 +2878,51 @@ const removeNewFileMenuEntry = function(entry) {
|
|
|
3490
2878
|
};
|
|
3491
2879
|
const getNewFileMenuEntries = function(context) {
|
|
3492
2880
|
const newFileMenu = getNewFileMenu();
|
|
3493
|
-
return newFileMenu.getEntries(context).sort((
|
|
3494
|
-
if (
|
|
3495
|
-
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;
|
|
3496
2884
|
}
|
|
3497
|
-
return
|
|
2885
|
+
return a2.displayName.localeCompare(b2.displayName, void 0, { numeric: true, sensitivity: "base" });
|
|
3498
2886
|
});
|
|
3499
2887
|
};
|
|
3500
2888
|
export {
|
|
3501
2889
|
Column,
|
|
3502
2890
|
DefaultType,
|
|
3503
|
-
File,
|
|
2891
|
+
q as File,
|
|
3504
2892
|
FileAction,
|
|
2893
|
+
FileListAction,
|
|
3505
2894
|
FileListFilter,
|
|
3506
|
-
FileType,
|
|
2895
|
+
F as FileType,
|
|
3507
2896
|
FilesSortingMode,
|
|
3508
|
-
Folder,
|
|
2897
|
+
s as Folder,
|
|
3509
2898
|
Header,
|
|
3510
2899
|
InvalidFilenameError,
|
|
3511
2900
|
InvalidFilenameErrorReason,
|
|
3512
2901
|
Navigation,
|
|
3513
2902
|
NewMenuEntryCategory,
|
|
3514
|
-
Node,
|
|
3515
|
-
NodeStatus,
|
|
3516
|
-
Permission,
|
|
2903
|
+
N as Node,
|
|
2904
|
+
t as NodeStatus,
|
|
2905
|
+
P as Permission,
|
|
3517
2906
|
View,
|
|
3518
2907
|
addNewFileMenuEntry,
|
|
3519
|
-
davGetClient,
|
|
3520
|
-
davGetDefaultPropfind,
|
|
3521
|
-
davGetFavoritesReport,
|
|
3522
|
-
davGetRecentSearch,
|
|
3523
|
-
davGetRemoteURL,
|
|
3524
|
-
davGetRootPath,
|
|
3525
|
-
davParsePermissions,
|
|
3526
|
-
davRemoteURL,
|
|
3527
|
-
davResultToNode,
|
|
3528
|
-
davRootPath,
|
|
3529
|
-
defaultDavNamespaces,
|
|
3530
|
-
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,
|
|
3531
2920
|
formatFileSize,
|
|
3532
|
-
getDavNameSpaces,
|
|
3533
|
-
getDavProperties,
|
|
3534
|
-
getFavoriteNodes,
|
|
2921
|
+
k as getDavNameSpaces,
|
|
2922
|
+
j as getDavProperties,
|
|
2923
|
+
e as getFavoriteNodes,
|
|
3535
2924
|
getFileActions,
|
|
2925
|
+
getFileListActions,
|
|
3536
2926
|
getFileListFilters,
|
|
3537
2927
|
getFileListHeaders,
|
|
3538
2928
|
getNavigation,
|
|
@@ -3541,8 +2931,9 @@ export {
|
|
|
3541
2931
|
isFilenameValid,
|
|
3542
2932
|
orderBy,
|
|
3543
2933
|
parseFileSize,
|
|
3544
|
-
registerDavProperty,
|
|
2934
|
+
i as registerDavProperty,
|
|
3545
2935
|
registerFileAction,
|
|
2936
|
+
registerFileListAction,
|
|
3546
2937
|
registerFileListFilter,
|
|
3547
2938
|
registerFileListHeaders,
|
|
3548
2939
|
removeNewFileMenuEntry,
|