@conduction/nextcloud-vue 2.78.0 → 2.79.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/dist/bundled-packages.json +0 -2
- package/dist/esm/bundled-packages.json +0 -2
- package/dist/esm/components/CnActionsBar/CnActionsBar.vue2.js.map +1 -1
- package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js +113 -104
- package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js.map +1 -1
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js +12 -2
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js.map +1 -1
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +80 -0
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +115 -91
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +139 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +140 -92
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +77 -0
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +4 -2
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +61 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +173 -5
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +181 -99
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js +29 -11
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/openRegisterSource.js +252 -0
- package/dist/esm/components/CnFilesBrowser/openRegisterSource.js.map +1 -0
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +25 -2
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +3 -2
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js +100 -3
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js +4 -2
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js.map +1 -1
- package/dist/esm/components/CnQuickFilterBar/CnQuickFilterBar.vue2.js +3 -2
- package/dist/esm/components/CnQuickFilterBar/CnQuickFilterBar.vue2.js.map +1 -1
- package/dist/esm/components/CnQuickFilterBar/CnQuickFilterBar.vue3.js.map +1 -1
- package/dist/esm/components/CnSavedViewsControl/CnSavedViewsControl.vue2.js.map +1 -1
- package/dist/esm/components/CnSavedViewsControl/CnSavedViewsControl.vue3.js +1 -1
- package/dist/esm/components/CnSavedViewsControl/CnSavedViewsControl.vue3.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +30 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +13 -0
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js.map +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue3.js.map +1 -1
- package/dist/esm/composables/useAppManifest.js +8 -3
- package/dist/esm/composables/useAppManifest.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +61 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +106 -2
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/nextcloud-vue.css +314 -15
- package/dist/esm/utils/boardDate.js +193 -0
- package/dist/esm/utils/boardDate.js.map +1 -0
- package/dist/esm/utils/dynamicProperties.js +5 -1
- package/dist/esm/utils/dynamicProperties.js.map +1 -1
- package/dist/esm/utils/validateManifestV2.compiled.js +57 -6
- package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +2039 -581
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +314 -15
- package/l10n/en.json +61 -1
- package/l10n/nl.json +106 -2
- package/package.json +1 -1
- package/scripts/build-validators.js +26 -0
- package/src/components/CnActionsBar/CnActionsBar.vue +48 -39
- package/src/components/CnAppRoot/CnAppRoot.vue +12 -2
- package/src/components/CnCellRenderer/CnCellRenderer.vue +119 -2
- package/src/components/CnDashboardPage/CnDashboardPage.vue +219 -4
- package/src/components/CnDataTable/CnDataTable.md +2 -0
- package/src/components/CnDataTable/CnDataTable.vue +81 -2
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +61 -1
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +232 -11
- package/src/components/CnFilesBrowser/filesBrowser.js +43 -2
- package/src/components/CnFilesBrowser/index.js +1 -0
- package/src/components/CnFilesBrowser/openRegisterSource.js +248 -0
- package/src/components/CnFormDialog/CnFormDialog.vue +1 -1
- package/src/components/CnIndexPage/CnIndexPage.vue +27 -3
- package/src/components/CnObjectSidebar/CnFilesTab.vue +103 -4
- package/src/components/CnQuickFilterBar/CnQuickFilterBar.vue +3 -2
- package/src/components/CnSavedViewsControl/CnSavedViewsControl.vue +1 -1
- package/src/components/CnTabsWidget/CnTabsWidget.vue +30 -1
- package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +13 -0
- package/src/components/index.js +1 -1
- package/src/composables/useAppManifest.js +8 -3
- package/src/css/look-board-detail.css +10 -0
- package/src/css/look-board-index.css +92 -14
- package/src/css/look-board.css +77 -0
- package/src/css/table.css +37 -0
- package/src/index.js +4 -0
- package/src/schemas/app-manifest-v2.schema.json +46 -1
- package/src/utils/boardDate.js +189 -0
- package/src/utils/dynamicProperties.js +5 -1
- package/src/utils/validateManifestV2.compiled.js +57 -2
- package/dist/esm/_virtual/equal.js +0 -4
- package/dist/esm/_virtual/equal.js.map +0 -1
- package/dist/esm/_virtual/ucs2length.js +0 -4
- package/dist/esm/_virtual/ucs2length.js.map +0 -1
- package/dist/esm/node_modules/ajv/dist/runtime/equal.js +0 -9
- package/dist/esm/node_modules/ajv/dist/runtime/equal.js.map +0 -1
- package/dist/esm/node_modules/ajv/dist/runtime/ucs2length.js +0 -25
- package/dist/esm/node_modules/ajv/dist/runtime/ucs2length.js.map +0 -1
- package/dist/esm/node_modules/fast-deep-equal/index.js +0 -47
- package/dist/esm/node_modules/fast-deep-equal/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesBrowser.js","sources":["../../../../src/components/CnFilesBrowser/filesBrowser.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * The pure half of CnFilesBrowser: paths, crumbs and the folder lookup.\n *\n * Kept out of the component so a test can pin them without a DAV server:\n * a wrong path here sends every listing to the wrong folder, silently.\n */\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\n\n/**\n * Actions the Files app registers that cannot run on a page without the Files\n * app's own list: the details action opens the Files sidebar, which on\n * Nextcloud 34 is a store bound to the Files router and node list; the\n * folder-navigation actions route through that list; and rename turns the\n * list's own name cell into an input, which is not here. Verified on a case\n * page: Rename ran and nothing happened. The browser offers its own rename\n * instead, a dialog over a DAV move.\n *\n * @type {string[]}\n */\nexport const ACTIONS_NEEDING_THE_FILES_PAGE = ['details', 'sidebar', 'open-folder', 'view-in-folder', 'rename']\n\n/**\n * A DAV href for a node under the user's files root, as a path relative to\n * that root: `/remote.php/dav/files/admin/Open%20Registers/x/` becomes\n * `/Open Registers/x`.\n *\n * @param {string} href The href as the DAV server returned it.\n * @param {string} uid The current user's id.\n * @return {string} The user-relative path without a trailing slash, `/` at least.\n */\nexport function userRelativePathFromHref(href, uid) {\n\tlet decoded\n\ttry {\n\t\tdecoded = decodeURIComponent(String(href || ''))\n\t} catch {\n\t\tdecoded = String(href || '')\n\t}\n\tconst marker = `/dav/files/${uid}`\n\tconst at = decoded.indexOf(marker)\n\tconst rest = at === -1 ? decoded : decoded.slice(at + marker.length)\n\tconst trimmed = rest.replace(/\\/+$/, '')\n\treturn trimmed === '' ? '/' : trimmed\n}\n\n/**\n * Join a directory and a name into a path, with exactly one slash between.\n *\n * @param {string} dir The directory path.\n * @param {string} name The child name.\n * @return {string} The child's path.\n */\nexport function joinPath(dir, name) {\n\treturn `${String(dir || '').replace(/\\/+$/, '')}/${String(name || '').replace(/^\\/+/, '')}`\n}\n\n/**\n * The breadcrumb trail: every folder from the user's files root down to the\n * open folder, the way the Files app draws it.\n *\n * The folders ABOVE the browser's root are part of the trail too (a reader\n * wants to see where this folder lives), but the browser never navigates\n * above its root, so those crumbs carry `aboveRoot: true` and the component\n * links them into the Files app instead. The root reads `rootLabel` when the\n * caller gave one and its own basename otherwise; every other crumb is the\n * folder's basename.\n *\n * @param {string} rootPath The browser's root, user-relative.\n * @param {string} currentPath The open folder, user-relative, at or below the root.\n * @param {string|null} [rootLabel] What the root crumb reads; null for its basename.\n * @return {Array<{name: string, path: string, aboveRoot: boolean}>} The crumbs, outermost first.\n */\nexport function crumbsFor(rootPath, currentPath, rootLabel = null) {\n\tconst root = String(rootPath || '/').replace(/\\/+$/, '') || '/'\n\tconst current = String(currentPath || root).replace(/\\/+$/, '') || '/'\n\tconst crumbs = []\n\tlet path = ''\n\tfor (const segment of root.split('/').filter(Boolean)) {\n\t\tpath = joinPath(path, segment)\n\t\tcrumbs.push({ name: segment, path, aboveRoot: path !== root })\n\t}\n\tif (root === '/') {\n\t\tcrumbs.push({ name: rootLabel || '/', path: '/', aboveRoot: false })\n\t} else if (rootLabel) {\n\t\tcrumbs[crumbs.length - 1].name = rootLabel\n\t}\n\tif (current === root || !current.startsWith(root === '/' ? '/' : `${root}/`)) {\n\t\treturn crumbs\n\t}\n\tconst below = root === '/' ? current.slice(1) : current.slice(root.length + 1)\n\tpath = root\n\tfor (const segment of below.split('/').filter(Boolean)) {\n\t\tpath = joinPath(path, segment)\n\t\tcrumbs.push({ name: segment, path, aboveRoot: false })\n\t}\n\treturn crumbs\n}\n\n/**\n * The DAV SEARCH body that finds one node by its file id under the user's root.\n *\n * @param {number|string} fileId The Nextcloud file id.\n * @param {string} uid The current user's id.\n * @return {string} The request body.\n */\nexport function fileIdSearchBody(fileId, uid) {\n\tconst id = String(fileId).replace(/[^0-9]/g, '')\n\tconst scope = `/files/${uid}`.replace(/[<>&]/g, '')\n\treturn '<?xml version=\"1.0\"?>'\n\t\t+ '<d:searchrequest xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\"><d:basicsearch>'\n\t\t+ '<d:select><d:prop><oc:fileid/></d:prop></d:select>'\n\t\t+ `<d:from><d:scope><d:href>${scope}</d:href><d:depth>infinity</d:depth></d:scope></d:from>`\n\t\t+ `<d:where><d:eq><d:prop><oc:fileid/></d:prop><d:literal>${id}</d:literal></d:eq></d:where>`\n\t\t+ '</d:basicsearch></d:searchrequest>'\n}\n\n/**\n * The first `d:href` in a DAV multistatus body, or null.\n *\n * @param {string} xml The response body.\n * @return {string|null} The href.\n */\nexport function firstHrefIn(xml) {\n\ttry {\n\t\tconst doc = new DOMParser().parseFromString(String(xml || ''), 'application/xml')\n\t\tconst href = doc.getElementsByTagNameNS('DAV:', 'href')[0]\n\t\treturn href ? href.textContent : null\n\t} catch {\n\t\treturn null\n\t}\n}\n\n/**\n * Where an OpenRegister object keeps its files, as a user-relative path.\n *\n * The object carries the folder's file id in `@self.folder`; a DAV search\n * by that id turns it into a path the DAV client can list. Null when the\n * object has no folder, or the search cannot see it (a user the folder is\n * not shared with), in which case the caller falls back to the object's\n * files endpoint.\n *\n * @param {object} options The lookup.\n * @param {string} options.apiBase OpenRegister's API base, `/apps/openregister/api`.\n * @param {string} options.register The register slug.\n * @param {string} options.schema The schema slug.\n * @param {string} options.objectId The object's uuid.\n * @param {string} options.uid The current user's id.\n * @param {string} options.remoteUrl The DAV remote url, `…/remote.php/dav`.\n * @return {Promise<string|null>} The user-relative folder path, or null.\n */\nexport async function resolveObjectFolder({ apiBase, register, schema, objectId, uid, remoteUrl }) {\n\tif (!register || !schema || !objectId || !uid) {\n\t\treturn null\n\t}\n\tlet folderId\n\ttry {\n\t\tconst { data } = await axios.get(generateUrl(`${apiBase}/objects/{register}/{schema}/{objectId}`, { register, schema, objectId }))\n\t\tfolderId = data?.['@self']?.folder ?? null\n\t} catch {\n\t\treturn null\n\t}\n\tif (folderId === null || folderId === '' || Number.isNaN(Number(folderId))) {\n\t\treturn null\n\t}\n\ttry {\n\t\tconst response = await axios.request({\n\t\t\tmethod: 'SEARCH',\n\t\t\turl: `${remoteUrl.replace(/\\/+$/, '')}/`,\n\t\t\theaders: { 'Content-Type': 'application/xml' },\n\t\t\tdata: fileIdSearchBody(folderId, uid),\n\t\t\tresponseType: 'text',\n\t\t})\n\t\tconst href = firstHrefIn(response.data)\n\t\treturn href === null ? null : userRelativePathFromHref(href, uid)\n\t} catch {\n\t\treturn null\n\t}\n}\n"],"names":["axios"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,8BAA8B,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAC;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,CAAC,IAAI,EAAE,GAAG,EAAE;AACpD,CAAC,IAAI,QAAO;AACZ,CAAC,IAAI;AACL,EAAE,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,EAAC;AAClD,EAAE,CAAC,MAAM;AACT,EAAE,OAAO,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,EAAC;AAC9B,EAAE;AACF,CAAC,MAAM,MAAM,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,EAAC;AACnC,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAC;AACnC,CAAC,MAAM,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC,GAAG,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAC;AACrE,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,EAAC;AACzC,CAAC,OAAO,OAAO,KAAK,EAAE,GAAG,GAAG,GAAG,OAAO;AACtC,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE;AACpC,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,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C,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE;AAC7E,EAAE,OAAO,IAAI;AACb,EAAE;AACF,CAAC,IAAI;AACL,EAAE,MAAM,QAAQ,GAAG,MAAMA,cAAK,CAAC,OAAO,CAAC;AACvC,GAAG,MAAM,EAAE,QAAQ;AACnB,GAAG,GAAG,EAAE,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAC3C,GAAG,OAAO,EAAE,EAAE,cAAc,EAAE,iBAAiB,EAAE;AACjD,GAAG,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,GAAG,CAAC;AACxC,GAAG,YAAY,EAAE,MAAM;AACvB,GAAG,EAAC;AACJ,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAC;AACzC,EAAE,OAAO,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,wBAAwB,CAAC,IAAI,EAAE,GAAG,CAAC;AACnE,EAAE,CAAC,MAAM;AACT,EAAE,OAAO,IAAI;AACb,EAAE;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"filesBrowser.js","sources":["../../../../src/components/CnFilesBrowser/filesBrowser.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * The pure half of CnFilesBrowser: paths, crumbs and the folder lookup.\n *\n * Kept out of the component so a test can pin them without a DAV server:\n * a wrong path here sends every listing to the wrong folder, silently.\n */\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\n\n/**\n * Actions the Files app registers that cannot run on a page without the Files\n * app's own list: the details action opens the Files sidebar, which on\n * Nextcloud 34 is a store bound to the Files router and node list; the\n * folder-navigation actions route through that list; and rename turns the\n * list's own name cell into an input, which is not here. Verified on a case\n * page: Rename ran and nothing happened. The browser offers its own rename\n * instead, a dialog over a DAV move.\n *\n * @type {string[]}\n */\nexport const ACTIONS_NEEDING_THE_FILES_PAGE = ['details', 'sidebar', 'open-folder', 'view-in-folder', 'rename']\n\n/**\n * A DAV href for a node under the user's files root, as a path relative to\n * that root: `/remote.php/dav/files/admin/Open%20Registers/x/` becomes\n * `/Open Registers/x`.\n *\n * @param {string} href The href as the DAV server returned it.\n * @param {string} uid The current user's id.\n * @return {string} The user-relative path without a trailing slash, `/` at least.\n */\nexport function userRelativePathFromHref(href, uid) {\n\tlet decoded\n\ttry {\n\t\tdecoded = decodeURIComponent(String(href || ''))\n\t} catch {\n\t\tdecoded = String(href || '')\n\t}\n\tconst marker = `/dav/files/${uid}`\n\tconst at = decoded.indexOf(marker)\n\tconst rest = at === -1 ? decoded : decoded.slice(at + marker.length)\n\tconst trimmed = rest.replace(/\\/+$/, '')\n\treturn trimmed === '' ? '/' : trimmed\n}\n\n/**\n * Join a directory and a name into a path, with exactly one slash between.\n *\n * @param {string} dir The directory path.\n * @param {string} name The child name.\n * @return {string} The child's path.\n */\nexport function joinPath(dir, name) {\n\treturn `${String(dir || '').replace(/\\/+$/, '')}/${String(name || '').replace(/^\\/+/, '')}`\n}\n\n/**\n * The breadcrumb trail: every folder from the user's files root down to the\n * open folder, the way the Files app draws it.\n *\n * The folders ABOVE the browser's root are part of the trail too (a reader\n * wants to see where this folder lives), but the browser never navigates\n * above its root, so those crumbs carry `aboveRoot: true` and the component\n * links them into the Files app instead. The root reads `rootLabel` when the\n * caller gave one and its own basename otherwise; every other crumb is the\n * folder's basename.\n *\n * @param {string} rootPath The browser's root, user-relative.\n * @param {string} currentPath The open folder, user-relative, at or below the root.\n * @param {string|null} [rootLabel] What the root crumb reads; null for its basename.\n * @return {Array<{name: string, path: string, aboveRoot: boolean}>} The crumbs, outermost first.\n */\nexport function crumbsFor(rootPath, currentPath, rootLabel = null) {\n\tconst root = String(rootPath || '/').replace(/\\/+$/, '') || '/'\n\tconst current = String(currentPath || root).replace(/\\/+$/, '') || '/'\n\tconst crumbs = []\n\tlet path = ''\n\tfor (const segment of root.split('/').filter(Boolean)) {\n\t\tpath = joinPath(path, segment)\n\t\tcrumbs.push({ name: segment, path, aboveRoot: path !== root })\n\t}\n\tif (root === '/') {\n\t\tcrumbs.push({ name: rootLabel || '/', path: '/', aboveRoot: false })\n\t} else if (rootLabel) {\n\t\tcrumbs[crumbs.length - 1].name = rootLabel\n\t}\n\tif (current === root || !current.startsWith(root === '/' ? '/' : `${root}/`)) {\n\t\treturn crumbs\n\t}\n\tconst below = root === '/' ? current.slice(1) : current.slice(root.length + 1)\n\tpath = root\n\tfor (const segment of below.split('/').filter(Boolean)) {\n\t\tpath = joinPath(path, segment)\n\t\tcrumbs.push({ name: segment, path, aboveRoot: false })\n\t}\n\treturn crumbs\n}\n\n/**\n * The DAV SEARCH body that finds one node by its file id under the user's root.\n *\n * @param {number|string} fileId The Nextcloud file id.\n * @param {string} uid The current user's id.\n * @return {string} The request body.\n */\nexport function fileIdSearchBody(fileId, uid) {\n\tconst id = String(fileId).replace(/[^0-9]/g, '')\n\tconst scope = `/files/${uid}`.replace(/[<>&]/g, '')\n\treturn '<?xml version=\"1.0\"?>'\n\t\t+ '<d:searchrequest xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\"><d:basicsearch>'\n\t\t+ '<d:select><d:prop><oc:fileid/></d:prop></d:select>'\n\t\t+ `<d:from><d:scope><d:href>${scope}</d:href><d:depth>infinity</d:depth></d:scope></d:from>`\n\t\t+ `<d:where><d:eq><d:prop><oc:fileid/></d:prop><d:literal>${id}</d:literal></d:eq></d:where>`\n\t\t+ '</d:basicsearch></d:searchrequest>'\n}\n\n/**\n * The first `d:href` in a DAV multistatus body, or null.\n *\n * @param {string} xml The response body.\n * @return {string|null} The href.\n */\nexport function firstHrefIn(xml) {\n\ttry {\n\t\tconst doc = new DOMParser().parseFromString(String(xml || ''), 'application/xml')\n\t\tconst href = doc.getElementsByTagNameNS('DAV:', 'href')[0]\n\t\treturn href ? href.textContent : null\n\t} catch {\n\t\treturn null\n\t}\n}\n\n/**\n * Where an OpenRegister object keeps its files, as a user-relative path.\n *\n * The object carries the folder's file id in `@self.folder`; a DAV search\n * by that id turns it into a path the DAV client can list. Null when the\n * object has no folder, or the search cannot see it (a user the folder is\n * not shared with), in which case the caller falls back to the object's\n * files endpoint.\n *\n * @param {object} options The lookup.\n * @param {string} options.apiBase OpenRegister's API base, `/apps/openregister/api`.\n * @param {string} options.register The register slug.\n * @param {string} options.schema The schema slug.\n * @param {string} options.objectId The object's uuid.\n * @param {string} options.uid The current user's id.\n * @param {string} options.remoteUrl The DAV remote url, `…/remote.php/dav`.\n * @return {Promise<string|null>} The user-relative folder path, or null.\n */\nexport async function resolveObjectFolder(options) {\n\tconst info = await resolveObjectFolderInfo(options)\n\treturn info === null ? null : info.path\n}\n\n/**\n * The object's display name: `@self.name`, else `title`, else `name`. A\n * value equal to the object's uuid is no name (the folder already reads so).\n *\n * @param {object|null} object The object as OpenRegister returns it.\n * @param {string} objectId The object's uuid.\n * @return {string|null} The name, or null.\n * @spec openspec/changes/dutch-library-strings-and-files-crumb/specs/dutch-library-strings-and-files-crumb/spec.md#requirement-the-files-browser-names-the-object-in-its-root-crumb\n */\nexport function objectDisplayName(object, objectId) {\n\tconst candidates = [object?.['@self']?.name, object?.title, object?.name]\n\tfor (const candidate of candidates) {\n\t\tif (typeof candidate === 'string' && candidate.trim() !== '' && candidate.trim() !== String(objectId)) {\n\t\t\treturn candidate.trim()\n\t\t}\n\t}\n\treturn null\n}\n\n/**\n * `resolveObjectFolder`, plus the object's display name from the same read,\n * so the browser can name the root crumb after the object instead of the\n * uuid its folder is called on disk.\n *\n * @param {object} options The lookup, as for `resolveObjectFolder`.\n * @param {string} options.apiBase OpenRegister's API base, `/apps/openregister/api`.\n * @param {string} options.register The register slug.\n * @param {string} options.schema The schema slug.\n * @param {string} options.objectId The object's uuid.\n * @param {string} options.uid The current user's id.\n * @param {string} options.remoteUrl The DAV remote url, `…/remote.php/dav`.\n * @return {Promise<{path: string, name: (string|null)}|null>} The folder and the object's name, or null.\n * @spec openspec/changes/dutch-library-strings-and-files-crumb/specs/dutch-library-strings-and-files-crumb/spec.md#requirement-the-files-browser-names-the-object-in-its-root-crumb\n */\nexport async function resolveObjectFolderInfo({ apiBase, register, schema, objectId, uid, remoteUrl }) {\n\tif (!register || !schema || !objectId || !uid) {\n\t\treturn null\n\t}\n\tlet folderId\n\tlet name\n\ttry {\n\t\tconst { data } = await axios.get(generateUrl(`${apiBase}/objects/{register}/{schema}/{objectId}`, { register, schema, objectId }))\n\t\tfolderId = data?.['@self']?.folder ?? null\n\t\tname = objectDisplayName(data, objectId)\n\t} catch {\n\t\treturn null\n\t}\n\tif (folderId === null || folderId === '' || Number.isNaN(Number(folderId))) {\n\t\treturn null\n\t}\n\ttry {\n\t\tconst response = await axios.request({\n\t\t\tmethod: 'SEARCH',\n\t\t\turl: `${remoteUrl.replace(/\\/+$/, '')}/`,\n\t\t\theaders: { 'Content-Type': 'application/xml' },\n\t\t\tdata: fileIdSearchBody(folderId, uid),\n\t\t\tresponseType: 'text',\n\t\t})\n\t\tconst href = firstHrefIn(response.data)\n\t\treturn href === null ? null : { path: userRelativePathFromHref(href, uid), name }\n\t} catch {\n\t\treturn null\n\t}\n}\n"],"names":["axios"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,8BAA8B,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAC;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,CAAC,IAAI,EAAE,GAAG,EAAE;AACpD,CAAC,IAAI,QAAO;AACZ,CAAC,IAAI;AACL,EAAE,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,EAAC;AAClD,EAAE,CAAC,MAAM;AACT,EAAE,OAA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CAAC,EAAE;AAC7E,EAAE,OAAO,IAAI;AACb,EAAE;AACF,CAAC,IAAI;AACL,EAAE,MAAM,QAAQ,GAAG,MAAMA,cAAK,CAAC,OAAO,CAAC;AACvC,GAAG,MAAM,EAAE,QAAQ;AACnB,GAAG,GAAG,EAAE,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAC3C,GAAG,OAAO,EAAE,EAAE,cAAc,EAAE,iBAAiB,EAAE;AACjD,GAAG,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,GAAG,CAAC;AACxC,GAAG,YAAY,EAAE,MAAM;AACvB,GAAG,EAAC;AACJ,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAC;AACzC,EAAE,OAAO,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE,IAAI,EAAE,wBAAwB,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE;AACnF,EAAE,CAAC,MAAM;AACT,EAAE,OAAO,IAAI;AACb,EAAE;AACF;;;;"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import axios__default from '@nextcloud/axios';
|
|
2
|
+
import { FileType } from '@nextcloud/files';
|
|
3
|
+
import { generateUrl } from '@nextcloud/router';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
7
|
+
* SPDX-License-Identifier: EUPL-1.2
|
|
8
|
+
*
|
|
9
|
+
* A data source for CnFilesBrowser that reads and writes one OpenRegister
|
|
10
|
+
* object's folder through OpenRegister's own files API, not WebDAV.
|
|
11
|
+
*
|
|
12
|
+
* Why: an object's files live in the `openregister` account's home, outside
|
|
13
|
+
* every person's Files app, so a reader has no WebDAV path to them. Every call
|
|
14
|
+
* here goes through the object's access rule on the server, as the signed-in
|
|
15
|
+
* person: a listing needs read on the object, a change needs update. Nothing
|
|
16
|
+
* is shared to make the folder visible.
|
|
17
|
+
*
|
|
18
|
+
* Paths are relative to the object folder and written with a leading slash
|
|
19
|
+
* (`/`, `/Bijlagen`), the same shape the WebDAV browser uses for its own
|
|
20
|
+
* paths, so crumbs and navigation work unchanged.
|
|
21
|
+
*
|
|
22
|
+
* @spec openspec/changes/files-browser-openregister-source/specs/files-browser/spec.md
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A browser path (`/a/b`) as the API's relative path (`a/b`).
|
|
27
|
+
*
|
|
28
|
+
* @param {string} path The browser path.
|
|
29
|
+
* @return {string} The relative path, empty for the root.
|
|
30
|
+
*/
|
|
31
|
+
function toApiPath(path) {
|
|
32
|
+
return String(path || '').replace(/^\/+|\/+$/g, '')
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* One API listing entry as a row the browser can render and sort.
|
|
37
|
+
*
|
|
38
|
+
* The shape follows what the browser reads off an `@nextcloud/files` node
|
|
39
|
+
* (basename, type, mime, size, mtime, fileid, path, source, attributes), so
|
|
40
|
+
* the table, the sorter and the icons need no second code path.
|
|
41
|
+
*
|
|
42
|
+
* @param {object} entry The API entry: `{ id, name, type, mimetype, size, mtime, path }`.
|
|
43
|
+
* @return {object} The row.
|
|
44
|
+
*/
|
|
45
|
+
function entryToNode(entry) {
|
|
46
|
+
const isFolder = entry.type === 'folder';
|
|
47
|
+
return {
|
|
48
|
+
source: `openregister:${entry.id}`,
|
|
49
|
+
fileid: entry.id,
|
|
50
|
+
basename: entry.name,
|
|
51
|
+
displayname: entry.name,
|
|
52
|
+
path: `/${toApiPath(entry.path)}`,
|
|
53
|
+
type: isFolder ? FileType.Folder : FileType.File,
|
|
54
|
+
mime: isFolder ? 'httpd/unix-directory' : (entry.mimetype || ''),
|
|
55
|
+
size: typeof entry.size === 'number' ? entry.size : undefined,
|
|
56
|
+
mtime: typeof entry.mtime === 'number' ? new Date(entry.mtime * 1000) : undefined,
|
|
57
|
+
attributes: {},
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The status of a failed request, or null.
|
|
63
|
+
*
|
|
64
|
+
* @param {Error} err The error.
|
|
65
|
+
* @return {number|null} The HTTP status.
|
|
66
|
+
*/
|
|
67
|
+
function statusOf(err) {
|
|
68
|
+
return err?.response?.status ?? err?.status ?? null
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The server's own message on a failed request, or null.
|
|
73
|
+
*
|
|
74
|
+
* @param {Error} err The error.
|
|
75
|
+
* @return {string|null} The message.
|
|
76
|
+
*/
|
|
77
|
+
function messageOf(err) {
|
|
78
|
+
const data = err?.response?.data;
|
|
79
|
+
return (data && typeof data.error === 'string' && data.error !== '') ? data.error : null
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Build the OpenRegister source for one object.
|
|
84
|
+
*
|
|
85
|
+
* @param {object} options The object.
|
|
86
|
+
* @param {string} [options.apiBase] OpenRegister's API base, `/apps/openregister/api`.
|
|
87
|
+
* @param {string} options.register The register slug or id.
|
|
88
|
+
* @param {string} options.schema The schema slug or id.
|
|
89
|
+
* @param {string} options.objectId The object's uuid.
|
|
90
|
+
* @return {object} The source CnFilesBrowser takes as `source`.
|
|
91
|
+
*/
|
|
92
|
+
function createOpenRegisterSource({ apiBase = '/apps/openregister/api', register, schema, objectId }) {
|
|
93
|
+
const objectUrl = (suffix) => generateUrl(`${apiBase}/objects/{register}/{schema}/{objectId}${suffix}`, { register, schema, objectId });
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Re-throw a failed request with its status and the server's message.
|
|
97
|
+
*
|
|
98
|
+
* @param {Error} err The error.
|
|
99
|
+
* @return {never}
|
|
100
|
+
*/
|
|
101
|
+
const fail = (err) => {
|
|
102
|
+
const error = new Error(messageOf(err) || err?.message || 'Request failed');
|
|
103
|
+
error.status = statusOf(err);
|
|
104
|
+
throw error
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
kind: 'openregister',
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* List a folder.
|
|
112
|
+
*
|
|
113
|
+
* @param {string} path The browser path.
|
|
114
|
+
* @return {Promise<{folder: object, nodes: Array<object>}>} The folder (with `canChange`) and its rows.
|
|
115
|
+
*/
|
|
116
|
+
async list(path) {
|
|
117
|
+
try {
|
|
118
|
+
const { data } = await axios__default.get(objectUrl('/folder'), { params: { path: toApiPath(path) } });
|
|
119
|
+
if (!Array.isArray(data?.entries)) {
|
|
120
|
+
// Not a folder listing: an OpenRegister without these endpoints.
|
|
121
|
+
const error = new Error('This OpenRegister has no folder endpoint');
|
|
122
|
+
error.status = 501;
|
|
123
|
+
throw error
|
|
124
|
+
}
|
|
125
|
+
const relative = toApiPath(data?.path ?? path);
|
|
126
|
+
return {
|
|
127
|
+
folder: {
|
|
128
|
+
fileid: data?.folderId ?? null,
|
|
129
|
+
path: `/${relative}`,
|
|
130
|
+
basename: relative.split('/').pop() || '',
|
|
131
|
+
type: FileType.Folder,
|
|
132
|
+
canChange: data?.canChange === true,
|
|
133
|
+
},
|
|
134
|
+
nodes: data.entries.map(entryToNode),
|
|
135
|
+
}
|
|
136
|
+
} catch (err) {
|
|
137
|
+
if (err?.status && !err.response) {
|
|
138
|
+
throw err
|
|
139
|
+
}
|
|
140
|
+
return fail(err)
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Create a folder.
|
|
146
|
+
*
|
|
147
|
+
* @param {string} path Where, as a browser path.
|
|
148
|
+
* @param {string} name The new folder's name.
|
|
149
|
+
* @return {Promise<object>} The new folder's row.
|
|
150
|
+
*/
|
|
151
|
+
async createFolder(path, name) {
|
|
152
|
+
try {
|
|
153
|
+
const { data } = await axios__default.post(objectUrl('/folder'), { path: toApiPath(path), name });
|
|
154
|
+
return entryToNode(data)
|
|
155
|
+
} catch (err) {
|
|
156
|
+
return fail(err)
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Upload one file into a folder.
|
|
162
|
+
*
|
|
163
|
+
* @param {string} path The target folder, as a browser path.
|
|
164
|
+
* @param {File} file The file.
|
|
165
|
+
* @param {(percent: number) => void} [onProgress] Called with 0..100.
|
|
166
|
+
* @return {Promise<object>} The stored file's row.
|
|
167
|
+
*/
|
|
168
|
+
async upload(path, file, onProgress) {
|
|
169
|
+
const form = new FormData();
|
|
170
|
+
form.append('path', toApiPath(path));
|
|
171
|
+
form.append('files[]', file, file.name);
|
|
172
|
+
try {
|
|
173
|
+
const { data } = await axios__default.post(objectUrl('/folder/upload'), form, {
|
|
174
|
+
onUploadProgress: (progress) => {
|
|
175
|
+
if (progress?.total && typeof onProgress === 'function') {
|
|
176
|
+
onProgress(Math.round((progress.loaded / progress.total) * 100));
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
const stored = Array.isArray(data?.stored) ? data.stored : [];
|
|
181
|
+
if (stored.length === 0) {
|
|
182
|
+
const error = new Error(data?.rejected?.[0]?.error || 'The upload failed');
|
|
183
|
+
error.status = 400;
|
|
184
|
+
throw error
|
|
185
|
+
}
|
|
186
|
+
return entryToNode(stored[0])
|
|
187
|
+
} catch (err) {
|
|
188
|
+
if (err?.status && !err.response) {
|
|
189
|
+
throw err
|
|
190
|
+
}
|
|
191
|
+
return fail(err)
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Rename a file or folder.
|
|
197
|
+
*
|
|
198
|
+
* @param {object} node The row.
|
|
199
|
+
* @param {string} name The new name.
|
|
200
|
+
* @return {Promise<object>} The renamed row.
|
|
201
|
+
*/
|
|
202
|
+
async rename(node, name) {
|
|
203
|
+
try {
|
|
204
|
+
const { data } = await axios__default.put(objectUrl(`/folder/${encodeURIComponent(node.fileid)}`), { name });
|
|
205
|
+
return entryToNode(data)
|
|
206
|
+
} catch (err) {
|
|
207
|
+
return fail(err)
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Delete a file or folder.
|
|
213
|
+
*
|
|
214
|
+
* @param {object} node The row.
|
|
215
|
+
* @return {Promise<void>}
|
|
216
|
+
*/
|
|
217
|
+
async remove(node) {
|
|
218
|
+
try {
|
|
219
|
+
await axios__default.delete(objectUrl(`/folder/${encodeURIComponent(node.fileid)}`));
|
|
220
|
+
} catch (err) {
|
|
221
|
+
fail(err);
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Where a file downloads from: the object's own file endpoint, which
|
|
227
|
+
* checks read on the object.
|
|
228
|
+
*
|
|
229
|
+
* @param {object} node The row.
|
|
230
|
+
* @return {string|null} The url, or null for a folder.
|
|
231
|
+
*/
|
|
232
|
+
downloadUrl(node) {
|
|
233
|
+
if (!node?.fileid || node.type === FileType.Folder) {
|
|
234
|
+
return null
|
|
235
|
+
}
|
|
236
|
+
return objectUrl(`/files/${encodeURIComponent(node.fileid)}`)
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* A small preview of an image, through the object's preview endpoint.
|
|
241
|
+
*
|
|
242
|
+
* @param {object} node The row.
|
|
243
|
+
* @return {string} The url.
|
|
244
|
+
*/
|
|
245
|
+
previewUrl(node) {
|
|
246
|
+
return objectUrl(`/files/${encodeURIComponent(node.fileid)}/preview?width=64&height=64`)
|
|
247
|
+
},
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export { createOpenRegisterSource, entryToNode, toApiPath };
|
|
252
|
+
//# sourceMappingURL=openRegisterSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openRegisterSource.js","sources":["../../../../src/components/CnFilesBrowser/openRegisterSource.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * A data source for CnFilesBrowser that reads and writes one OpenRegister\n * object's folder through OpenRegister's own files API, not WebDAV.\n *\n * Why: an object's files live in the `openregister` account's home, outside\n * every person's Files app, so a reader has no WebDAV path to them. Every call\n * here goes through the object's access rule on the server, as the signed-in\n * person: a listing needs read on the object, a change needs update. Nothing\n * is shared to make the folder visible.\n *\n * Paths are relative to the object folder and written with a leading slash\n * (`/`, `/Bijlagen`), the same shape the WebDAV browser uses for its own\n * paths, so crumbs and navigation work unchanged.\n *\n * @spec openspec/changes/files-browser-openregister-source/specs/files-browser/spec.md\n */\nimport axios from '@nextcloud/axios'\nimport { FileType } from '@nextcloud/files'\nimport { generateUrl } from '@nextcloud/router'\n\n/**\n * A browser path (`/a/b`) as the API's relative path (`a/b`).\n *\n * @param {string} path The browser path.\n * @return {string} The relative path, empty for the root.\n */\nexport function toApiPath(path) {\n\treturn String(path || '').replace(/^\\/+|\\/+$/g, '')\n}\n\n/**\n * One API listing entry as a row the browser can render and sort.\n *\n * The shape follows what the browser reads off an `@nextcloud/files` node\n * (basename, type, mime, size, mtime, fileid, path, source, attributes), so\n * the table, the sorter and the icons need no second code path.\n *\n * @param {object} entry The API entry: `{ id, name, type, mimetype, size, mtime, path }`.\n * @return {object} The row.\n */\nexport function entryToNode(entry) {\n\tconst isFolder = entry.type === 'folder'\n\treturn {\n\t\tsource: `openregister:${entry.id}`,\n\t\tfileid: entry.id,\n\t\tbasename: entry.name,\n\t\tdisplayname: entry.name,\n\t\tpath: `/${toApiPath(entry.path)}`,\n\t\ttype: isFolder ? FileType.Folder : FileType.File,\n\t\tmime: isFolder ? 'httpd/unix-directory' : (entry.mimetype || ''),\n\t\tsize: typeof entry.size === 'number' ? entry.size : undefined,\n\t\tmtime: typeof entry.mtime === 'number' ? new Date(entry.mtime * 1000) : undefined,\n\t\tattributes: {},\n\t}\n}\n\n/**\n * The status of a failed request, or null.\n *\n * @param {Error} err The error.\n * @return {number|null} The HTTP status.\n */\nfunction statusOf(err) {\n\treturn err?.response?.status ?? err?.status ?? null\n}\n\n/**\n * The server's own message on a failed request, or null.\n *\n * @param {Error} err The error.\n * @return {string|null} The message.\n */\nfunction messageOf(err) {\n\tconst data = err?.response?.data\n\treturn (data && typeof data.error === 'string' && data.error !== '') ? data.error : null\n}\n\n/**\n * Build the OpenRegister source for one object.\n *\n * @param {object} options The object.\n * @param {string} [options.apiBase] OpenRegister's API base, `/apps/openregister/api`.\n * @param {string} options.register The register slug or id.\n * @param {string} options.schema The schema slug or id.\n * @param {string} options.objectId The object's uuid.\n * @return {object} The source CnFilesBrowser takes as `source`.\n */\nexport function createOpenRegisterSource({ apiBase = '/apps/openregister/api', register, schema, objectId }) {\n\tconst objectUrl = (suffix) => generateUrl(`${apiBase}/objects/{register}/{schema}/{objectId}${suffix}`, { register, schema, objectId })\n\n\t/**\n\t * Re-throw a failed request with its status and the server's message.\n\t *\n\t * @param {Error} err The error.\n\t * @return {never}\n\t */\n\tconst fail = (err) => {\n\t\tconst error = new Error(messageOf(err) || err?.message || 'Request failed')\n\t\terror.status = statusOf(err)\n\t\tthrow error\n\t}\n\n\treturn {\n\t\tkind: 'openregister',\n\n\t\t/**\n\t\t * List a folder.\n\t\t *\n\t\t * @param {string} path The browser path.\n\t\t * @return {Promise<{folder: object, nodes: Array<object>}>} The folder (with `canChange`) and its rows.\n\t\t */\n\t\tasync list(path) {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.get(objectUrl('/folder'), { params: { path: toApiPath(path) } })\n\t\t\t\tif (!Array.isArray(data?.entries)) {\n\t\t\t\t\t// Not a folder listing: an OpenRegister without these endpoints.\n\t\t\t\t\tconst error = new Error('This OpenRegister has no folder endpoint')\n\t\t\t\t\terror.status = 501\n\t\t\t\t\tthrow error\n\t\t\t\t}\n\t\t\t\tconst relative = toApiPath(data?.path ?? path)\n\t\t\t\treturn {\n\t\t\t\t\tfolder: {\n\t\t\t\t\t\tfileid: data?.folderId ?? null,\n\t\t\t\t\t\tpath: `/${relative}`,\n\t\t\t\t\t\tbasename: relative.split('/').pop() || '',\n\t\t\t\t\t\ttype: FileType.Folder,\n\t\t\t\t\t\tcanChange: data?.canChange === true,\n\t\t\t\t\t},\n\t\t\t\t\tnodes: data.entries.map(entryToNode),\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tif (err?.status && !err.response) {\n\t\t\t\t\tthrow err\n\t\t\t\t}\n\t\t\t\treturn fail(err)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Create a folder.\n\t\t *\n\t\t * @param {string} path Where, as a browser path.\n\t\t * @param {string} name The new folder's name.\n\t\t * @return {Promise<object>} The new folder's row.\n\t\t */\n\t\tasync createFolder(path, name) {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.post(objectUrl('/folder'), { path: toApiPath(path), name })\n\t\t\t\treturn entryToNode(data)\n\t\t\t} catch (err) {\n\t\t\t\treturn fail(err)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Upload one file into a folder.\n\t\t *\n\t\t * @param {string} path The target folder, as a browser path.\n\t\t * @param {File} file The file.\n\t\t * @param {(percent: number) => void} [onProgress] Called with 0..100.\n\t\t * @return {Promise<object>} The stored file's row.\n\t\t */\n\t\tasync upload(path, file, onProgress) {\n\t\t\tconst form = new FormData()\n\t\t\tform.append('path', toApiPath(path))\n\t\t\tform.append('files[]', file, file.name)\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.post(objectUrl('/folder/upload'), form, {\n\t\t\t\t\tonUploadProgress: (progress) => {\n\t\t\t\t\t\tif (progress?.total && typeof onProgress === 'function') {\n\t\t\t\t\t\t\tonProgress(Math.round((progress.loaded / progress.total) * 100))\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t\tconst stored = Array.isArray(data?.stored) ? data.stored : []\n\t\t\t\tif (stored.length === 0) {\n\t\t\t\t\tconst error = new Error(data?.rejected?.[0]?.error || 'The upload failed')\n\t\t\t\t\terror.status = 400\n\t\t\t\t\tthrow error\n\t\t\t\t}\n\t\t\t\treturn entryToNode(stored[0])\n\t\t\t} catch (err) {\n\t\t\t\tif (err?.status && !err.response) {\n\t\t\t\t\tthrow err\n\t\t\t\t}\n\t\t\t\treturn fail(err)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Rename a file or folder.\n\t\t *\n\t\t * @param {object} node The row.\n\t\t * @param {string} name The new name.\n\t\t * @return {Promise<object>} The renamed row.\n\t\t */\n\t\tasync rename(node, name) {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.put(objectUrl(`/folder/${encodeURIComponent(node.fileid)}`), { name })\n\t\t\t\treturn entryToNode(data)\n\t\t\t} catch (err) {\n\t\t\t\treturn fail(err)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Delete a file or folder.\n\t\t *\n\t\t * @param {object} node The row.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync remove(node) {\n\t\t\ttry {\n\t\t\t\tawait axios.delete(objectUrl(`/folder/${encodeURIComponent(node.fileid)}`))\n\t\t\t} catch (err) {\n\t\t\t\tfail(err)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Where a file downloads from: the object's own file endpoint, which\n\t\t * checks read on the object.\n\t\t *\n\t\t * @param {object} node The row.\n\t\t * @return {string|null} The url, or null for a folder.\n\t\t */\n\t\tdownloadUrl(node) {\n\t\t\tif (!node?.fileid || node.type === FileType.Folder) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn objectUrl(`/files/${encodeURIComponent(node.fileid)}`)\n\t\t},\n\n\t\t/**\n\t\t * A small preview of an image, through the object's preview endpoint.\n\t\t *\n\t\t * @param {object} node The row.\n\t\t * @return {string} The url.\n\t\t */\n\t\tpreviewUrl(node) {\n\t\t\treturn objectUrl(`/files/${encodeURIComponent(node.fileid)}/preview?width=64&height=64`)\n\t\t},\n\t}\n}\n"],"names":["axios"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;A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AAG,IAAI,CAAC,IAAI,EAAE,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,MAAM,EAAE;AACvD,IAAI,OAAO,IAAI;AACf,IAAI;AACJ,GAAG,OAAO,SAAS,CAAC,CAAC,OAAO,EAAE,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAChE,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,UAAU,CAAC,IAAI,EAAE;AACnB,GAAG,OAAO,SAAS,CAAC,CAAC,OAAO,EAAE,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,2BAA2B,CAAC,CAAC;AAC3F,GAAG;AACH,EAAE;AACF;;;;"}
|
|
@@ -3112,7 +3112,7 @@ var script = {
|
|
|
3112
3112
|
const mappedProps = propertiesFromDefinitions(
|
|
3113
3113
|
Array.isArray(records) ? records : [],
|
|
3114
3114
|
config,
|
|
3115
|
-
{ orderFrom: 1000 + Object.keys(properties).length },
|
|
3115
|
+
{ orderFrom: 1000 + Object.keys(properties).length, create: this.isCreateMode },
|
|
3116
3116
|
);
|
|
3117
3117
|
Object.assign(properties, mappedProps.properties);
|
|
3118
3118
|
required.push(...mappedProps.required);
|