All notable changes to this project will be documented in this file.
ℹ️ The release does not contain any breaking changes compared to v4.0.0-rc.3.
- This package now is a pure ES module.
- Due to breaking changes this major version is only compatible with the files app of Nextcloud 33 or later.
- The Node API was changed, the
rootproperty of any node, includingFileorFolder, is now required. - All methods now also accept the interface of the provided classes,
meaning instead of accepting
Viewthey accept the more genericIViewinterface. This allows better integration with frameworks and custom implementations of the interface where needed.
The DAV related exports from the main entry point were deprecated
for a long time and are now removed from it.
Instead you have to use the @nextcloud/files/dav entry point.
For example:
- import { davRemoteURL } from '@nextcloud/files'
+ import { defaultRemoteURL } from '@nextcloud/files/dav'The FileAction API has been changed to provide a more consistent
set of context to the action handlers.
We're now using destructuring objects for the context parameters.
For example:
type ActionContext = {
nodes: INode[],
view: IView,
folder: IFolder,
contents: INode[],
}
- action.exec(view: View, folder: Folder, dir: string): Promise<boolean>
+ action.exec({ nodes, view, folder, contents }): Promise<boolean>To make work with nodes easier a new constant has been introduced:
Permission.WRITE is set for files where the content can be changed
(whereas Permission.UPDATE only indicates the file can be updates as in renamed or moved).
This is similar to the Permission.CREATE for folders.
Note that this is only valid for WebDAV nodes, for other APIs that are using the permissions it depends how they interpret them.
Where feasible this library now only requires using objects matching a given interface and not instantiating a class. The reason here is that this allows for easier extending, which can be used to keep track of some internal state.
Moreover classes could never be verified because
the prototypes were not globally shared thus every applicaton would create different class instances.
Meaning e.g. a FileAction of app A would not satisfy instanceof FileAction in app B.
So with v4 of this library those classes have been removed, instead just make sure to implement the provided interfaces.
- import { FileAction } from '@nextcloud/files'
+ import type { IFileAction } from '@nextcloud/files'
- const action = new FileAction({ ... })
+ const action: IFileAction = { ... }- import { FileAction, registerFileAction } from '@nextcloud/files'
+ import { registerFileAction } from '@nextcloud/files'
- registerFileAction(new FileAction({ ... }))
+ registerFileAction({ ... })- feat(actions): standardize contexts #1124
- fix(node): cloning #1348
- refactor(Node)!: make
Node.roota required attribute #1388 - refactor!(navigation): pass
idof view tosetActive#1418 - refactor!: migrate from cancelable promise to AbortSignal #1428
- refactor(actions)!: rename content to contents #1386
- refactor!: use interfaces where possible instead of instances #1417
- refactor!: More classes are replaces with interfaces where real class instances are not needed #1475
- refactor(column)!: use interfaces rather than instances #1443
- refactor(headers)!: use interfaces where possible #1484
- chore(Node)!: remove deprecated
isDavRessource#1390 - chore!: drop deprecated DAV exports from main entry point #1384
- chore!: remove deprecated filename validation fallbacks for Nextcloud 29 and below #1383
- chore!: remove deprecated
NewMenuEntry.iconClass#1385 - chore!: remove commonjs entry point #1420
- feat: allow file list filers with display names #1456
- feat: add separate permission to check for writable files #1455
- feat(node): allow to cast as JSON #1349
- feat(sidebar): provide public API to register a sidebar tab with web components #1419
- feat(sidebar): provide a proxy for the files sidebar #1306
- feat(sidebar): properly implement sidebar Proxy for Nextcloud 33+ #1447
- feat(sidebar): allow to postpone definition of sidebar tabs #1459
- feat(navigation): allow to register multiple views in one batch #1476
- feat(node): add support for string based snowflake ids #1495
- feat(registry): Add new registry to listen for registration events #1483
This allows to listen for changes on registered objects (views, filters, etc). So you can react when something new was registered. This allows to creates a reactive state with any framework (e.g. Vue 3).
- fix(actions): add type exports #1381
- fix(actions): only pass a single node to renderInline #1391
- fix(actions): add back nodes contents to view action params #1392
- fix(sortNodes): do not trim "extension" of folder names #1291
- fix(node): better special character encoding and detection #1398
- fix(column): validate interface rather than the instance type #1442
- fix(view): ensure all optional properties are validated #1438
- fix: properly export all public API #1485
- docs(View): improve documentation of
View.emptyView#1290 - ci: update dependencies also on stable3 #1400
- ci: drop npm token publishing and use trusted publisher #1416
- ci: add workflow to check for Typescript issues #1439
- chore: align devEngines with apps #1355
- chore: remove legacy node attributes deprecation #1379
- chore: work around bug in
corepackblocking dependency updates #1292 - chore(deps): align and update vitest dependencies #1389
- chore: adjust types to only use interfaces if possible #1440
- chore(deps): Bump typescript-event-target from 1.1.1 to 1.1.2 #1450
- chore: update to ESLint v9 #1457
- refactor: drop dependency on Node modules #1421
- refactor: scope global state to major version of library #1492
To prevent apps breaking the files app with outdated library versions, all registered actions, views etc are now scoped. Meaning you have to use a compatible library version, e.g. its required to use the@nextcloud/fileslibrary v4 for Nextcloud 33+. Otherwise the registered entities are not picked up by the files app.
- docs(View): improve documentation of
View.emptyView#1290 (susnux) - chore: work around bug in
corepackblocking dependency updates #1292 (susnux) - ci: update workflows from organization #1354 (susnux)
- chore: align devEngines with apps #1355 (susnux)
- Updated dependencies:
- Bump
is-svgto 6.1.0 - Bump
@nextcloud/sharingto to 0.3.0 - Bump
@nextcloud/authto to 2.5.3 - Bump
@nextcloud/l10nto to 3.4.1 - Bump
@nextcloud/capabilitiesto to 1.2.1 - Bump
@nextcloud/routerto to 3.1.0 - Bump
@nextcloud/pathsto to 2.3.0
- Bump
- fix(sorting): also check attributes #1285 (skjnldsv)
- fix(sorting): adjust attribute fallback condition #1286 (skjnldsv)
- feat: allow changing Node mime type #1234 (skjnldsv)
- feat(view): add
hiddenattribute to the View #1281 (susnux)
- fix(sorting): fallback basename to empty string just in case #1197 (skjnldsv)
- fix: also validate Node data on setter #1235 (skjnldsv)
- fix: do not update mtime on move/rename #1236 (skjnldsv)
- chore: update node version to all supported ones and add
devEngines#1282 (susnux) - chore: make
package.jsonconsistent and update authors #1280 (susnux) - chore(deps): Bump @nextcloud/auth to 2.5.1
- chore(deps): Bump @nextcloud/l10n to 3.3.0
- chore(deps): Bump is-svg to 6.0.0
- chore(deps): Bump webdav to 5.8.0
- fix: ensure FileListAction return
bool|nullonexec#1145 (skjnldsv) - fix: Correctly export DAV types #1176 (susnux)
- fix(deps): typedoc-plugin-missing-exports as dev dependency #1183 (max-nextcloud)
- Updated development dependencies
- chore(deps): Bump
@nextcloud/sharingto 0.2.4 - ci: Update workflows from organization #1177 (susnux)
- fix: Allow omitting icon for file list actions #1143 (Pytal)
- fix: Do not rollup types #1142 (@susnux)
- fix: Make types of File and Folder more explicit #1118 (@susnux)
- fix: Typo in method name
isDavResourceinstead ofisDavRessource#1119 (@susnux) - fix(fileListAction): keep same method param pattern accross our APIs #1135 (@skjnldsv)
- Scope package into modules #1025 (susnux)
All DAV related functions are now moved to the
@nextcloud/files/davmodule. You can still import them from the main entrypoint, but this is now deprecated. New functions will only be available in the@nextcloud/files/daventrypoint. - feat: Add reset method to file list filters #1116 (susnux)
- feat: Add current folder context for file list actions #1113 (Pytal)
- feat: Allow cloning a node #1077 (Pytal)
- feat(FileAction): Allow to set
destructiveflag #1076 (susnux)
- fix: Document optional
userproperty of FileListFilterChip #1075 (susnux) - fix deprecation warning
Node.attributes.displaynameshould be accessed directly on theNode#1074 (dvaerum)
- chore(deps): Bump
dompurifyto 3.1.6
- Updated development dependencies
- Fix published package
Broken - do not use.
- chore(deps-dev): Bump
@nextcloud/vite-configto 2.2.2 - chore(deps-dev): Bump
viteto 5.4.0 - chore(deps): Bump
webdavto 5.7.1 - chore(deps-dev): Bump
@types/nodeto 22.2.0 - chore(deps): Bump
is-svgto 5.1.0 - chore(deps): Bump
@nextcloud/authto 2.4.0 - chore(deps-dev): Bump
viteto 5.4.1 - chore(deps-dev): Bump
@types/nodeto 22.4.0 - chore(deps-dev): Bump
ellipticto 6.5.7 - chore(deps-dev): Bump
tslibto 2.7.0 - chore(deps-dev): Bump
@types/nodeto 22.5.0 - chore(deps-dev): Bump
typedocto 0.26.6 - chore(deps-dev): Bump
viteto 5.4.2 - chore(deps-dev): Bump
@types/nodeto 22.5.1 - Update dependabot-approve-merge.yml from main org #1066 (@AndyScherzinger)
- chore(deps-dev): Bump
jsdomto 25.0.0
- chore(deps-dev): Bump
@vitest/coverage-istanbulto 2.0.4 - chore(deps-dev): Bump
typedocto 0.26.5 - chore(deps): Bump
@nextcloud/pathsto 2.2.1 - chore(deps): Bump
@nextcloud/sharingto 0.2.3 - chore(deps-dev): Bump
viteto 5.3.5 - chore(deps-dev): Bump
jsdomto 24.1.1 - chore(deps-dev): Bump
@types/nodeto 20.14.12 - chore(deps-dev): Bump
typescriptto 5.5.4 - chore(deps-dev): Bump
fast-xml-parserto 4.4.1 - chore(deps-dev): Bump
@vitest/coverage-istanbulto 2.0.5 - chore(deps): Bump
webdavto 5.7.0 - chore(deps-dev): Bump
@types/nodeto 22.1.0
- fix(dav): Cast displayname to string in
resultToNode#1028 (susnux) - fix: Correctly export public API #1026 (susnux)
- chore(deps): Bump
@nextcloud/pathsto 2.2.
- feat(filename): Improve filename validation to support Nextcloud 30 capabilities #1013 (susnux)
- feat(node): Add
displaynameas top level attribute #1019 (susnux)
- Update README.md to add more info about the webDAV client #1007 (StCyr)
- test: Add missing test case for sorting equal values and ESLint warning #1014 (susnux)
- Migrate REUSE to TOML format #1012 (AndyScherzinger)
- Bump
@nextcloud/sharingto 0.2. - Updated development dependencies
Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.5.0...v3.5.1
- fix
davResultToNodeon public shares (#993) - fix: make
davRootPathanddavRemoteURLsupport public shares (#996) - fix(dav): Add
displaynameandcreationdateto default props (#991) - fix(sorting): The display name attribute is called
displaynamenotdisplayNamefor DAV (#992)
- chore(deps-dev): Bump
wsto 8.17. - chore: Update development dependencies
Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.4.1...v3.5.0
- feat: Add filename util
getUniqueNameto generate a unique name (#986) - feat: Export public interfaces of
Node,FileandFolder(#976) - feat(navigation): Allow to listen for active navigation changes (#987)
- fix(dav): Set
statusindavResultToNodewhen fileid is negative (#985) - fix: When sorting by filename the extension should only be considered if the basename is equal (#984)
- Add SPDX headers (#980)
- Updated development dependencies
Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.4.0...v3.4.1
- chore(deps-dev): Bump
viteto 5.2.12 - chore(deps-dev): Bump
@types/nodeto 20.13.0 - chore(deps-dev): Bump
jsdomto 24.1.0
Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.3.1...v3.4.0
- chore(deps-dev): Bump @codecov/vite-plugin from 0.0.1-beta.6 to 0.0.1-beta.8 #965 (@dependabot)
- chore(deps-dev): Bump
fast-xml-parserto 4.4.0
Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.3.0...v3.3.1
- feat: Add and export
isFilenameValidfunction #951 (@susnux) - feat(files): allow updating attributes #947 (@skjnldsv)
- feat(new-menu): Allow to set the category for entries #952 (@susnux)
- fix: Update workflows from organization #932 (@susnux)
- fix(fileAction): cover parent getter in tests #950 (@skjnldsv)
- fix(navigation): files import #949 (@skjnldsv)
- fix(dav): Add fallback for owner of dav nodes on public shares #959 (@susnux)
- chore(deps): Bump
@nextcloud/authto 2.3.0 - chore(deps): Bump
@nextcloud/l10nto 3.1.0 - chore(deps): Bump
@nextcloud/loggerto 3.0.2 - chore(deps): Bump
@nextcloud/routerto 3.0.1 - chore(deps): Bump
is-svgto 5.0.1 - chore(deps): Bump
webdavto 5.6.0
Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.2.1...v3.3.0
- fix: Update NPM version to LTS version 10
- Updated development dependencies
Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.1.1...v3.2.0
- Updated webdav from 5.4.0 to 5.5.0
- Updated development dependencies
- fix(dav): various typings and owner string cast #882 (@skjnldsv)
- fix(dav): remove sharing attributes from default dav fetch and change duplicate registration from
errortowarn#902 (@skjnldsv)
- Update
@nextcloud/routerfrom 2.2.1 to 3.0.0 - Update
webdavfrom 5.3.2 to 5.4.0
- fix(Node): Handle slash as root path for public webdav endpoint #847 (@susnux)
- fix(dav): davResultToNode real owner #862 (@skjnldsv)
- Update webdav from 5.3.0 to 5.3.1
- Update dev dependencies
- Node requirements are now node 20 and npm 9
- Lots of new APIs:
Nodestandards: https://nextcloud-libraries.github.io/nextcloud-files/classes/Node.htmlFileAction: https://nextcloud-libraries.github.io/nextcloud-files/classes/FileAction.htmlHeader: https://nextcloud-libraries.github.io/nextcloud-files/classes/Header.htmlView: https://nextcloud-libraries.github.io/nextcloud-files/classes/View.html- Works in sync with
Column: https://nextcloud-libraries.github.io/nextcloud-files/classes/Column.html
- Works in sync with
- Lots of changes with Nextcloud 28, please see server changelog as well
- Add context to getEntries #484 (@skjnldsv)
- Add DAV functions for fetching nodes from Nextcloud #706 (@susnux)
- Add File and Folder API #501 (@skjnldsv)
- Add newFileMenu and refactor library with rollup #420 (@skjnldsv)
- Also use context from exposed method #486 (@skjnldsv)
- feat: add action title #767 (@skjnldsv)
- feat: add FileListHeader #717 (@skjnldsv)
- feat: migrate Navigation and update FileAction from server #732 (@skjnldsv)
- feat: provide fileList names as newFileMenu handler argument #752 (@skjnldsv)
- feat: support nested actions #814 (@skjnldsv)
- feat: support new file menu entry order #781 (@skjnldsv)
- feat: use Folder as filemenu context #731 (@skjnldsv)
- feat(actions): also test doc build on pull requests #621 (@skjnldsv)
- feat(dav): Add "recent files" SEARCH payload as an export #710 (@susnux)
- feat(FileAction): add file action support #608 (@skjnldsv)
- feat(files): add encodedSource #794 (@skjnldsv)
- feat(files): add node status #744 (@skjnldsv)
- feat(files): update mtime on attributes tampering #602 (@skjnldsv)
- feat(node): allow and recommend to provide a specific root #574 (@skjnldsv)
- feat(parseFileSize): Added
parseFileSizefunction to parse a human readable file size to number of bytes #769 (@susnux) - feat(permissions): add webdav permissions parser #565 (@skjnldsv)
- Fix
resultToNodeby adding some documenation how to use #741 (@susnux) - Fix decimal prefixes and add option for binary prefixes per IEC 80000-13 #536 (@Zipdox)
- Fix templateName usage and errors strings #494 (@skjnldsv)
- fix: allow undefined properties in File and Folder #683 (@skjnldsv)
- fix: also export Node #573 (@skjnldsv)
- fix: Bring back Typescript definitions #712 (@susnux)
- fix: Do not export the declaration of window.OC #667 (@skjnldsv)
- fix: do not update mtime if not already defined #709 (@skjnldsv)
- fix: fileid definition and fallback #681 (@skjnldsv)
- fix: force bundle
is-svg#740 (@skjnldsv) - fix: getNewFileMenuEntries usage #734 (@skjnldsv)
- fix: headers and actions empty variable init #724 (@skjnldsv)
- fix: Node import type #754 (@skjnldsv)
- fix: prevent invalid roots to be defined #577 (@skjnldsv)
- fix: use Node and not string for the new file menu handler arg #753 (@skjnldsv)
- fix!(humanFileSize): Revert changes to default file sizes #822 (@susnux)
- fix(dav): Fix DAV functions to make work with them easier #725 (@susnux)
- fix(dav): use of webdav library #821 (@pulsejet)
- fix(fileActions): improve typing and add silent actions #625 (@skjnldsv)
- fix(formatFileSize): Fix default value for
binaryPrefixes#770 (@susnux) - fix(newfilemenu): better sorting and proper fallback to displayName #806 (@skjnldsv)
- fix(newfilemenu): fix handler requirement, deprecate iconClass and fix context #742 (@skjnldsv)
- fix(node): allow negative file ids #716 (@skjnldsv)
- fix(node): default permissions should be NONE and fix undefined return #630 (@skjnldsv)
- Replace deprecated String.prototype.substr() #390 (@CommanderRoot)
Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v2.1.0...v3.0.0
- Dependency updates
- Browserslist config updated, which means some older browsers are not supported anymore
- Dependency updates
- formatFileSize works without the global OC
- Dependency updates
- Dependency updates
- Update vulnerable packages