@nextcloud/files 3.0.0-beta.14 → 3.0.0-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,12 +1,13 @@
1
- import { getCurrentUser as c, getRequestToken as x } from "@nextcloud/auth";
1
+ import { getCurrentUser as c, getRequestToken as N } from "@nextcloud/auth";
2
2
  import { getLoggerBuilder as m } from "@nextcloud/logger";
3
- import { getCanonicalLocale as N } from "@nextcloud/l10n";
4
- import { join as R, basename as A, extname as F, dirname as d } from "path";
5
- import { generateRemoteUrl as g } from "@nextcloud/router";
6
- import { createClient as S, getPatcher as $ } from "webdav";
7
- import { request as P } from "webdav/dist/node/request.js";
8
- const B = (e) => e === null ? m().setApp("files").build() : m().setApp("files").setUid(e.uid).build(), a = B(c());
9
- class L {
3
+ import { getCanonicalLocale as A } from "@nextcloud/l10n";
4
+ import { join as R, basename as F, extname as S, dirname as d } from "path";
5
+ import { generateRemoteUrl as _ } from "@nextcloud/router";
6
+ import { createClient as $, getPatcher as V } from "webdav";
7
+ import { request as C } from "webdav/dist/node/request.js";
8
+ import q from "is-svg";
9
+ const L = (e) => e === null ? m().setApp("files").build() : m().setApp("files").setUid(e.uid).build(), o = L(c());
10
+ class T {
10
11
  _entries = [];
11
12
  registerEntry(t) {
12
13
  this.validateEntry(t), this._entries.push(t);
@@ -14,13 +15,13 @@ class L {
14
15
  unregisterEntry(t) {
15
16
  const r = typeof t == "string" ? this.getEntryIndex(t) : this.getEntryIndex(t.id);
16
17
  if (r === -1) {
17
- a.warn("Entry not found, nothing removed", { entry: t, entries: this.getEntries() });
18
+ o.warn("Entry not found, nothing removed", { entry: t, entries: this.getEntries() });
18
19
  return;
19
20
  }
20
21
  this._entries.splice(r, 1);
21
22
  }
22
- getEntries(t) {
23
- return t ? this._entries.filter((r) => typeof r.if == "function" ? r.if(t) : !0) : this._entries;
23
+ getEntries(t, r) {
24
+ return t && r ? this._entries.filter((i) => typeof i.if == "function" ? i.if(t, r) : !0) : this._entries;
24
25
  }
25
26
  getEntryIndex(t) {
26
27
  return this._entries.findIndex((r) => r.id === t);
@@ -45,17 +46,18 @@ class L {
45
46
  }
46
47
  }
47
48
  const p = function() {
48
- return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new L(), a.debug("NewFileMenu initialized")), window._nc_newfilemenu;
49
- }, l = ["B", "KB", "MB", "GB", "TB", "PB"], u = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
50
- function J(e, t = !1, r = !1) {
49
+ return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new T(), o.debug("NewFileMenu initialized")), window._nc_newfilemenu;
50
+ }, u = ["B", "KB", "MB", "GB", "TB", "PB"], l = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
51
+ function te(e, t = !1, r = !1) {
51
52
  typeof e == "string" && (e = Number(e));
52
- let n = e > 0 ? Math.floor(Math.log(e) / Math.log(r ? 1024 : 1e3)) : 0;
53
- n = Math.min((r ? u.length : l.length) - 1, n);
54
- const s = r ? u[n] : l[n];
55
- let i = (e / Math.pow(r ? 1024 : 1e3, n)).toFixed(1);
56
- return t === !0 && n === 0 ? (i !== "0.0" ? "< 1 " : "0 ") + (r ? u[1] : l[1]) : (n < 2 ? i = parseFloat(i).toFixed(0) : i = parseFloat(i).toLocaleString(N()), i + " " + s);
53
+ let i = e > 0 ? Math.floor(Math.log(e) / Math.log(r ? 1024 : 1e3)) : 0;
54
+ i = Math.min((r ? l.length : u.length) - 1, i);
55
+ const a = r ? l[i] : u[i];
56
+ let n = (e / Math.pow(r ? 1024 : 1e3, i)).toFixed(1);
57
+ return t === !0 && i === 0 ? (n !== "0.0" ? "< 1 " : "0 ") + (r ? l[1] : u[1]) : (i < 2 ? n = parseFloat(n).toFixed(0) : n = parseFloat(n).toLocaleString(A()), n + " " + a);
57
58
  }
58
- class Q {
59
+ var v = ((e) => (e.DEFAULT = "default", e.HIDDEN = "hidden", e))(v || {});
60
+ class re {
59
61
  _action;
60
62
  constructor(t) {
61
63
  this.validateAction(t), this._action = t;
@@ -105,7 +107,7 @@ class Q {
105
107
  throw new Error("Invalid execBatch function");
106
108
  if ("order" in t && typeof t.order != "number")
107
109
  throw new Error("Invalid order");
108
- if ("default" in t && typeof t.default != "boolean")
110
+ if (t.default && !Object.values(v).includes(t.default))
109
111
  throw new Error("Invalid default");
110
112
  if ("inline" in t && typeof t.inline != "function")
111
113
  throw new Error("Invalid inline function");
@@ -113,16 +115,16 @@ class Q {
113
115
  throw new Error("Invalid renderInline function");
114
116
  }
115
117
  }
116
- const X = function(e) {
117
- if (typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], a.debug("FileActions initialized")), window._nc_fileactions.find((t) => t.id === e.id)) {
118
- a.error(`FileAction ${e.id} already registered`, { action: e });
118
+ const ie = function(e) {
119
+ if (typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], o.debug("FileActions initialized")), window._nc_fileactions.find((t) => t.id === e.id)) {
120
+ o.error(`FileAction ${e.id} already registered`, { action: e });
119
121
  return;
120
122
  }
121
123
  window._nc_fileactions.push(e);
122
- }, Y = function() {
123
- return window._nc_fileactions || [];
124
+ }, ne = function() {
125
+ return typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], o.debug("FileActions initialized")), window._nc_fileactions;
124
126
  };
125
- class Z {
127
+ class oe {
126
128
  _header;
127
129
  constructor(t) {
128
130
  this.validateHeader(t), this._header = t;
@@ -155,54 +157,54 @@ class Z {
155
157
  throw new Error("Invalid updated property");
156
158
  }
157
159
  }
158
- const ee = function(e) {
159
- if (typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], a.debug("FileActions initialized")), window._nc_filelistheader.find((t) => t.id === e.id)) {
160
- a.error(`Header ${e.id} already registered`, { header: e });
160
+ const se = function(e) {
161
+ if (typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], o.debug("FileListHeaders initialized")), window._nc_filelistheader.find((t) => t.id === e.id)) {
162
+ o.error(`Header ${e.id} already registered`, { header: e });
161
163
  return;
162
164
  }
163
165
  window._nc_filelistheader.push(e);
164
- }, te = function() {
165
- return window._nc_filelistheader || [];
166
+ }, ae = function() {
167
+ return typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], o.debug("FileListHeaders initialized")), window._nc_filelistheader;
166
168
  };
167
- var o = ((e) => (e[e.NONE = 0] = "NONE", e[e.CREATE = 4] = "CREATE", e[e.READ = 1] = "READ", e[e.UPDATE = 2] = "UPDATE", e[e.DELETE = 8] = "DELETE", e[e.SHARE = 16] = "SHARE", e[e.ALL = 31] = "ALL", e))(o || {});
168
- const _ = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodified", "d:quota-available-bytes", "d:resourcetype", "nc:has-preview", "nc:is-encrypted", "nc:mount-type", "nc:share-attributes", "oc:comments-unread", "oc:favorite", "oc:fileid", "oc:owner-display-name", "oc:owner-id", "oc:permissions", "oc:share-types", "oc:size", "ocs:share-permissions"], y = { d: "DAV:", nc: "http://nextcloud.org/ns", oc: "http://owncloud.org/ns", ocs: "http://open-collaboration-services.org/ns" }, re = function(e, t = { nc: "http://nextcloud.org/ns" }) {
169
- typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [..._], window._nc_dav_namespaces = { ...y });
169
+ var s = ((e) => (e[e.NONE = 0] = "NONE", e[e.CREATE = 4] = "CREATE", e[e.READ = 1] = "READ", e[e.UPDATE = 2] = "UPDATE", e[e.DELETE = 8] = "DELETE", e[e.SHARE = 16] = "SHARE", e[e.ALL = 31] = "ALL", e))(s || {});
170
+ const y = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodified", "d:quota-available-bytes", "d:resourcetype", "nc:has-preview", "nc:is-encrypted", "nc:mount-type", "nc:share-attributes", "oc:comments-unread", "oc:favorite", "oc:fileid", "oc:owner-display-name", "oc:owner-id", "oc:permissions", "oc:share-types", "oc:size", "ocs:share-permissions"], E = { d: "DAV:", nc: "http://nextcloud.org/ns", oc: "http://owncloud.org/ns", ocs: "http://open-collaboration-services.org/ns" }, de = function(e, t = { nc: "http://nextcloud.org/ns" }) {
171
+ typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...y], window._nc_dav_namespaces = { ...E });
170
172
  const r = { ...window._nc_dav_namespaces, ...t };
171
- if (window._nc_dav_properties.find((s) => s === e))
172
- return a.error(`${e} already registered`, { prop: e }), !1;
173
+ if (window._nc_dav_properties.find((a) => a === e))
174
+ return o.error(`${e} already registered`, { prop: e }), !1;
173
175
  if (e.startsWith("<") || e.split(":").length !== 2)
174
- return a.error(`${e} is not valid. See example: 'oc:fileid'`, { prop: e }), !1;
175
- const n = e.split(":")[0];
176
- return r[n] ? (window._nc_dav_properties.push(e), window._nc_dav_namespaces = r, !0) : (a.error(`${e} namespace unknown`, { prop: e, namespaces: r }), !1);
177
- }, h = function() {
178
- return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [..._]), window._nc_dav_properties.map((e) => `<${e} />`).join(" ");
176
+ return o.error(`${e} is not valid. See example: 'oc:fileid'`, { prop: e }), !1;
177
+ const i = e.split(":")[0];
178
+ return r[i] ? (window._nc_dav_properties.push(e), window._nc_dav_namespaces = r, !0) : (o.error(`${e} namespace unknown`, { prop: e, namespaces: r }), !1);
179
179
  }, f = function() {
180
- return typeof window._nc_dav_namespaces > "u" && (window._nc_dav_namespaces = { ...y }), Object.keys(window._nc_dav_namespaces).map((e) => `xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`).join(" ");
181
- }, M = function() {
180
+ return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...y]), window._nc_dav_properties.map((e) => `<${e} />`).join(" ");
181
+ }, w = function() {
182
+ return typeof window._nc_dav_namespaces > "u" && (window._nc_dav_namespaces = { ...E }), Object.keys(window._nc_dav_namespaces).map((e) => `xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`).join(" ");
183
+ }, ce = function() {
182
184
  return `<?xml version="1.0"?>
183
- <d:propfind ${f()}>
185
+ <d:propfind ${w()}>
184
186
  <d:prop>
185
- ${h()}
187
+ ${f()}
186
188
  </d:prop>
187
189
  </d:propfind>`;
188
- }, T = function() {
190
+ }, P = function() {
189
191
  return `<?xml version="1.0"?>
190
- <oc:filter-files ${f()}>
192
+ <oc:filter-files ${w()}>
191
193
  <d:prop>
192
- ${h()}
194
+ ${f()}
193
195
  </d:prop>
194
196
  <oc:filter-rules>
195
197
  <oc:favorite>1</oc:favorite>
196
198
  </oc:filter-rules>
197
199
  </oc:filter-files>`;
198
- }, ie = function(e) {
200
+ }, ue = function(e) {
199
201
  return `<?xml version="1.0" encoding="UTF-8"?>
200
- <d:searchrequest ${f()}
202
+ <d:searchrequest ${w()}
201
203
  xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
202
204
  <d:basicsearch>
203
205
  <d:select>
204
206
  <d:prop>
205
- ${h()}
207
+ ${f()}
206
208
  </d:prop>
207
209
  </d:select>
208
210
  <d:from>
@@ -251,14 +253,14 @@ const _ = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodi
251
253
  </d:limit>
252
254
  </d:basicsearch>
253
255
  </d:searchrequest>`;
254
- }, z = function(e = "") {
255
- let t = o.NONE;
256
- return e && ((e.includes("C") || e.includes("K")) && (t |= o.CREATE), e.includes("G") && (t |= o.READ), (e.includes("W") || e.includes("N") || e.includes("V")) && (t |= o.UPDATE), e.includes("D") && (t |= o.DELETE), e.includes("R") && (t |= o.SHARE)), t;
256
+ }, B = function(e = "") {
257
+ let t = s.NONE;
258
+ return e && ((e.includes("C") || e.includes("K")) && (t |= s.CREATE), e.includes("G") && (t |= s.READ), (e.includes("W") || e.includes("N") || e.includes("V")) && (t |= s.UPDATE), e.includes("D") && (t |= s.DELETE), e.includes("R") && (t |= s.SHARE)), t;
257
259
  };
258
- var w = ((e) => (e.Folder = "folder", e.File = "file", e))(w || {});
259
- const E = function(e, t) {
260
+ var h = ((e) => (e.Folder = "folder", e.File = "file", e))(h || {});
261
+ const b = function(e, t) {
260
262
  return e.match(t) !== null;
261
- }, v = (e, t) => {
263
+ }, g = (e, t) => {
262
264
  if (e.id && typeof e.id != "number")
263
265
  throw new Error("Invalid id type of value");
264
266
  if (!e.source)
@@ -278,7 +280,7 @@ const E = function(e, t) {
278
280
  throw new Error("Missing or invalid mandatory mime");
279
281
  if ("size" in e && typeof e.size != "number" && e.size !== void 0)
280
282
  throw new Error("Invalid size type");
281
- if ("permissions" in e && e.permissions !== void 0 && !(typeof e.permissions == "number" && e.permissions >= o.NONE && e.permissions <= o.ALL))
283
+ if ("permissions" in e && e.permissions !== void 0 && !(typeof e.permissions == "number" && e.permissions >= s.NONE && e.permissions <= s.ALL))
282
284
  throw new Error("Invalid permissions");
283
285
  if (e.owner && e.owner !== null && typeof e.owner != "string")
284
286
  throw new Error("Invalid owner type");
@@ -290,29 +292,29 @@ const E = function(e, t) {
290
292
  throw new Error("Root must start with a leading slash");
291
293
  if (e.root && !e.source.includes(e.root))
292
294
  throw new Error("Root must be part of the source");
293
- if (e.root && E(e.source, t)) {
295
+ if (e.root && b(e.source, t)) {
294
296
  const r = e.source.match(t)[0];
295
297
  if (!e.source.includes(R(r, e.root)))
296
298
  throw new Error("The root must be relative to the service. e.g /files/emma");
297
299
  }
298
300
  };
299
- class b {
301
+ class I {
300
302
  _data;
301
303
  _attributes;
302
304
  _knownDavService = /(remote|public)\.php\/(web)?dav/i;
303
305
  constructor(t, r) {
304
- v(t, r || this._knownDavService), this._data = t;
305
- const n = { set: (s, i, D) => (this.updateMtime(), Reflect.set(s, i, D)), deleteProperty: (s, i) => (this.updateMtime(), Reflect.deleteProperty(s, i)) };
306
- this._attributes = new Proxy(t.attributes || {}, n), delete this._data.attributes, r && (this._knownDavService = r);
306
+ g(t, r || this._knownDavService), this._data = t;
307
+ const i = { set: (a, n, D) => (this.updateMtime(), Reflect.set(a, n, D)), deleteProperty: (a, n) => (this.updateMtime(), Reflect.deleteProperty(a, n)) };
308
+ this._attributes = new Proxy(t.attributes || {}, i), delete this._data.attributes, r && (this._knownDavService = r);
307
309
  }
308
310
  get source() {
309
311
  return this._data.source.replace(/\/$/i, "");
310
312
  }
311
313
  get basename() {
312
- return A(this.source);
314
+ return F(this.source);
313
315
  }
314
316
  get extension() {
315
- return F(this.source);
317
+ return S(this.source);
316
318
  }
317
319
  get dirname() {
318
320
  if (this.root) {
@@ -338,13 +340,13 @@ class b {
338
340
  return this._attributes;
339
341
  }
340
342
  get permissions() {
341
- return this.owner === null && !this.isDavRessource ? o.READ : this._data.permissions !== void 0 ? this._data.permissions : o.NONE;
343
+ return this.owner === null && !this.isDavRessource ? s.READ : this._data.permissions !== void 0 ? this._data.permissions : s.NONE;
342
344
  }
343
345
  get owner() {
344
346
  return this.isDavRessource ? this._data.owner : null;
345
347
  }
346
348
  get isDavRessource() {
347
- return E(this.source, this._knownDavService);
349
+ return b(this.source, this._knownDavService);
348
350
  }
349
351
  get root() {
350
352
  return this._data.root ? this._data.root.replace(/^(.+)\/$/, "$1") : this.isDavRessource && d(this.source).split(this._knownDavService).pop() || null;
@@ -360,7 +362,7 @@ class b {
360
362
  return this._data?.id || this.attributes?.fileid;
361
363
  }
362
364
  move(t) {
363
- v({ ...this._data, source: t }, this._knownDavService), this._data.source = t, this.updateMtime();
365
+ g({ ...this._data, source: t }, this._knownDavService), this._data.source = t, this.updateMtime();
364
366
  }
365
367
  rename(t) {
366
368
  if (t.includes("/"))
@@ -371,17 +373,17 @@ class b {
371
373
  this._data.mtime && (this._data.mtime = /* @__PURE__ */ new Date());
372
374
  }
373
375
  }
374
- class q extends b {
376
+ class z extends I {
375
377
  get type() {
376
- return w.File;
378
+ return h.File;
377
379
  }
378
380
  }
379
- class C extends b {
381
+ class M extends I {
380
382
  constructor(t) {
381
383
  super({ ...t, mime: "httpd/unix-directory" });
382
384
  }
383
385
  get type() {
384
- return w.Folder;
386
+ return h.Folder;
385
387
  }
386
388
  get extension() {
387
389
  return null;
@@ -390,47 +392,190 @@ class C extends b {
390
392
  return "httpd/unix-directory";
391
393
  }
392
394
  }
393
- const I = `/files/${c()?.uid}`, U = g("dav" + I), ne = function(e = U) {
394
- const t = S(e, { headers: { requesttoken: x() || "" } });
395
- return $().patch("request", (r) => (r.headers?.method && (r.method = r.headers.method, delete r.headers.method), P(r))), t;
396
- }, oe = async (e, t = "/") => (await e.getDirectoryContents(t, { details: !0, data: t === "/" ? T() : M(), headers: { method: t === "/" ? "REPORT" : "PROPFIND" }, includeSelf: !0 })).data.filter((r) => r.filename !== t).map((r) => k(r)), k = function(e, t = I) {
397
- const r = e.props, n = z(r?.permissions), s = c()?.uid, i = { id: r?.fileid || 0, source: g(`dav${t}${e.filename}`), mtime: new Date(Date.parse(e.lastmod)), mime: e.mime, size: r?.size || 0, permissions: n, owner: s, root: t, attributes: { ...e, ...r, hasPreview: r?.["has-preview"] } };
398
- return delete i.attributes?.props, e.type === "file" ? new q(i) : new C(i);
399
- }, se = function(e) {
395
+ const x = `/files/${c()?.uid}`, k = _("dav"), le = function(e = k) {
396
+ const t = $(e, { headers: { requesttoken: N() || "" } });
397
+ return V().patch("request", (r) => (r.headers?.method && (r.method = r.headers.method, delete r.headers.method), C(r))), t;
398
+ }, pe = async (e, t = "/", r = x) => (await e.getDirectoryContents(`${r}${t}`, { details: !0, data: P(), headers: { method: "REPORT" }, includeSelf: !0 })).data.filter((i) => i.filename !== t).map((i) => H(i, r)), H = function(e, t = x) {
399
+ const r = e.props, i = B(r?.permissions), a = c()?.uid, n = { id: r?.fileid || 0, source: _(`dav${t}${e.filename}`), mtime: new Date(Date.parse(e.lastmod)), mime: e.mime, size: r?.size || Number.parseInt(r.getcontentlength || "0"), permissions: i, owner: a, root: t, attributes: { ...e, ...r, hasPreview: r?.["has-preview"] } };
400
+ return delete n.attributes?.props, e.type === "file" ? new z(n) : new M(n);
401
+ };
402
+ class U {
403
+ _views = [];
404
+ _currentView = null;
405
+ register(t) {
406
+ if (this._views.find((r) => r.id === t.id))
407
+ throw new Error(`View id ${t.id} is already registered`);
408
+ this._views.push(t);
409
+ }
410
+ remove(t) {
411
+ const r = this._views.findIndex((i) => i.id === t);
412
+ r !== -1 && this._views.splice(r, 1);
413
+ }
414
+ get views() {
415
+ return this._views;
416
+ }
417
+ setActive(t) {
418
+ this._currentView = t;
419
+ }
420
+ get active() {
421
+ return this._currentView;
422
+ }
423
+ }
424
+ const fe = function() {
425
+ return typeof window._nc_navigation > "u" && (window._nc_navigation = new U(), o.debug("Navigation service initialized")), window._nc_navigation;
426
+ };
427
+ class O {
428
+ _column;
429
+ constructor(t) {
430
+ K(t), this._column = t;
431
+ }
432
+ get id() {
433
+ return this._column.id;
434
+ }
435
+ get title() {
436
+ return this._column.title;
437
+ }
438
+ get render() {
439
+ return this._column.render;
440
+ }
441
+ get sort() {
442
+ return this._column.sort;
443
+ }
444
+ get summary() {
445
+ return this._column.summary;
446
+ }
447
+ }
448
+ const K = function(e) {
449
+ if (!e.id || typeof e.id != "string")
450
+ throw new Error("A column id is required");
451
+ if (!e.title || typeof e.title != "string")
452
+ throw new Error("A column title is required");
453
+ if (!e.render || typeof e.render != "function")
454
+ throw new Error("A render function is required");
455
+ if (e.sort && typeof e.sort != "function")
456
+ throw new Error("Column sortFunction must be a function");
457
+ if (e.summary && typeof e.summary != "function")
458
+ throw new Error("Column summary must be a function");
459
+ return !0;
460
+ };
461
+ class we {
462
+ _view;
463
+ constructor(t) {
464
+ G(t), this._view = t;
465
+ }
466
+ get id() {
467
+ return this._view.id;
468
+ }
469
+ get name() {
470
+ return this._view.name;
471
+ }
472
+ get caption() {
473
+ return this._view.caption;
474
+ }
475
+ get emptyTitle() {
476
+ return this._view.emptyTitle;
477
+ }
478
+ get emptyCaption() {
479
+ return this._view.emptyCaption;
480
+ }
481
+ get getContents() {
482
+ return this._view.getContents;
483
+ }
484
+ get icon() {
485
+ return this._view.icon;
486
+ }
487
+ get order() {
488
+ return this._view.order;
489
+ }
490
+ get params() {
491
+ return this._view.params;
492
+ }
493
+ get columns() {
494
+ return this._view.columns;
495
+ }
496
+ get emptyView() {
497
+ return this._view.emptyView;
498
+ }
499
+ get parent() {
500
+ return this._view.parent;
501
+ }
502
+ get sticky() {
503
+ return this._view.sticky;
504
+ }
505
+ get expanded() {
506
+ return this._view.expanded;
507
+ }
508
+ get defaultSortKey() {
509
+ return this._view.defaultSortKey;
510
+ }
511
+ }
512
+ const G = function(e) {
513
+ if (!e.id || typeof e.id != "string")
514
+ throw new Error("View id is required and must be a string");
515
+ if (!e.name || typeof e.name != "string")
516
+ throw new Error("View name is required and must be a string");
517
+ if (e.columns && e.columns.length > 0 && (!e.caption || typeof e.caption != "string"))
518
+ throw new Error("View caption is required for top-level views and must be a string");
519
+ if (!e.getContents || typeof e.getContents != "function")
520
+ throw new Error("View getContents is required and must be a function");
521
+ if (!e.icon || typeof e.icon != "string" || !q(e.icon))
522
+ throw new Error("View icon is required and must be a valid svg string");
523
+ if (!("order" in e) || typeof e.order != "number")
524
+ throw new Error("View order is required and must be a number");
525
+ if (e.columns && e.columns.forEach((t) => {
526
+ if (!(t instanceof O))
527
+ throw new Error("View columns must be an array of Column. Invalid column found");
528
+ }), e.emptyView && typeof e.emptyView != "function")
529
+ throw new Error("View emptyView must be a function");
530
+ if (e.parent && typeof e.parent != "string")
531
+ throw new Error("View parent must be a string");
532
+ if ("sticky" in e && typeof e.sticky != "boolean")
533
+ throw new Error("View sticky must be a boolean");
534
+ if ("expanded" in e && typeof e.expanded != "boolean")
535
+ throw new Error("View expanded must be a boolean");
536
+ if (e.defaultSortKey && typeof e.defaultSortKey != "string")
537
+ throw new Error("View defaultSortKey must be a string");
538
+ return !0;
539
+ }, he = function(e) {
400
540
  return p().registerEntry(e);
401
- }, ae = function(e) {
541
+ }, me = function(e) {
402
542
  return p().unregisterEntry(e);
403
- }, de = function(e) {
543
+ }, ge = function(e) {
404
544
  return p().getEntries(e);
405
545
  };
406
546
  export {
407
- q as File,
408
- Q as FileAction,
409
- w as FileType,
410
- C as Folder,
411
- Z as Header,
412
- b as Node,
413
- o as Permission,
414
- se as addNewFileMenuEntry,
415
- U as davDefaultRootUrl,
416
- ne as davGetClient,
417
- M as davGetDefaultPropfind,
418
- T as davGetFavoritesReport,
419
- ie as davGetRecentSearch,
420
- z as davParsePermissions,
421
- k as davResultToNode,
422
- I as davRootPath,
423
- y as defaultDavNamespaces,
424
- _ as defaultDavProperties,
425
- J as formatFileSize,
426
- f as getDavNameSpaces,
427
- h as getDavProperties,
428
- oe as getFavoriteNodes,
429
- Y as getFileActions,
430
- te as getFileListHeaders,
431
- de as getNewFileMenuEntries,
432
- re as registerDavProperty,
433
- X as registerFileAction,
434
- ee as registerFileListHeaders,
435
- ae as removeNewFileMenuEntry
547
+ O as Column,
548
+ v as DefaultType,
549
+ z as File,
550
+ re as FileAction,
551
+ h as FileType,
552
+ M as Folder,
553
+ oe as Header,
554
+ U as Navigation,
555
+ I as Node,
556
+ s as Permission,
557
+ we as View,
558
+ he as addNewFileMenuEntry,
559
+ le as davGetClient,
560
+ ce as davGetDefaultPropfind,
561
+ P as davGetFavoritesReport,
562
+ ue as davGetRecentSearch,
563
+ B as davParsePermissions,
564
+ k as davRemoteURL,
565
+ H as davResultToNode,
566
+ x as davRootPath,
567
+ E as defaultDavNamespaces,
568
+ y as defaultDavProperties,
569
+ te as formatFileSize,
570
+ w as getDavNameSpaces,
571
+ f as getDavProperties,
572
+ pe as getFavoriteNodes,
573
+ ne as getFileActions,
574
+ ae as getFileListHeaders,
575
+ fe as getNavigation,
576
+ ge as getNewFileMenuEntries,
577
+ de as registerDavProperty,
578
+ ie as registerFileAction,
579
+ se as registerFileListHeaders,
580
+ me as removeNewFileMenuEntry
436
581
  };