Skip to content

Latest commit

 

History

History
528 lines (432 loc) · 35.7 KB

File metadata and controls

528 lines (432 loc) · 35.7 KB

Changelog

All notable changes to this project will be documented in this file.

4.0.0 - 2026-02-10

ℹ️ The release does not contain any breaking changes compared to v4.0.0-rc.3.

📝 Notes

  • 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 root property of any node, including File or Folder, is now required.
  • All methods now also accept the interface of the provided classes, meaning instead of accepting View they accept the more generic IView interface. This allows better integration with frameworks and custom implementations of the interface where needed.

DAV related export

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'

File Actions API changes

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>

Node permissions

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.

Interfaces

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({ ... })

💥 Breaking changes

  • feat(actions): standardize contexts #1124
  • fix(node): cloning #1348
  • refactor(Node)!: make Node.root a required attribute #1388
  • refactor!(navigation): pass id of view to setActive #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

🚀 Enhancements

  • 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).

🐛 Fixed bugs

  • 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

Other changes

  • 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 corepack blocking 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/files library v4 for Nextcloud 33+. Otherwise the registered entities are not picked up by the files app.

3.12.1 - 2025-12-11

🐛 Fixed bugs

  • fix(sortNodes): do not trim "extension" of folder names #1291 (susnux)

Changed

  • docs(View): improve documentation of View.emptyView #1290 (susnux)
  • chore: work around bug in corepack blocking dependency updates #1292 (susnux)
  • ci: update workflows from organization #1354 (susnux)
  • chore: align devEngines with apps #1355 (susnux)
  • Updated dependencies:
    • Bump is-svg to 6.1.0
    • Bump @nextcloud/sharing to to 0.3.0
    • Bump @nextcloud/auth to to 2.5.3
    • Bump @nextcloud/l10n to to 3.4.1
    • Bump @nextcloud/capabilities to to 1.2.1
    • Bump @nextcloud/router to to 3.1.0
    • Bump @nextcloud/paths to to 2.3.0

3.12.0 - 2025-07-24

🚀 Enhancements

  • feat(actions): allow to define hotkey for file action #1288 (susnux)

🐛 Fixed bugs

Other changes

3.11.0 - 2025-07-02

🚀 Enhancements

Fixed

Changed

  • chore: update node version to all supported ones and add devEngines #1282 (susnux)
  • chore: make package.json consistent 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

3.10.2 - 2025-02-13

Fixed

Changed

  • Updated development dependencies
  • chore(deps): Bump @nextcloud/sharing to 0.2.4
  • ci: Update workflows from organization #1177 (susnux)

3.10.1 - 2024-12-12

Full changelog

Fixed

  • 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 isDavResource instead of isDavRessource #1119 (@susnux)
  • fix(fileListAction): keep same method param pattern accross our APIs #1135 (@skjnldsv)

3.10.0 - 2024-11-13

Full changelog

Added

  • Scope package into modules #1025 (susnux) All DAV related functions are now moved to the @nextcloud/files/dav module. You can still import them from the main entrypoint, but this is now deprecated. New functions will only be available in the @nextcloud/files/dav entrypoint.
  • 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 destructive flag #1076 (susnux)

Fixed

  • fix: Document optional user property of FileListFilterChip #1075 (susnux)
  • fix deprecation warning Node.attributes.displayname should be accessed directly on the Node #1074 (dvaerum)

Changed

  • chore(deps): Bump dompurify to 3.1.6

3.9.2 - 2024-11-13

Changed

  • Updated development dependencies
  • Fix published package

3.9.1 - 2024-10-23

Broken - do not use.

3.9.0 - 2024-09-04

Full changelog

Added

  • feat: Allow views to be naturally sorted #1053 (@Pytal)

Changed

  • chore(deps-dev): Bump @nextcloud/vite-config to 2.2.2
  • chore(deps-dev): Bump vite to 5.4.0
  • chore(deps): Bump webdav to 5.7.1
  • chore(deps-dev): Bump @types/node to 22.2.0
  • chore(deps): Bump is-svg to 5.1.0
  • chore(deps): Bump @nextcloud/auth to 2.4.0
  • chore(deps-dev): Bump vite to 5.4.1
  • chore(deps-dev): Bump @types/node to 22.4.0
  • chore(deps-dev): Bump elliptic to 6.5.7
  • chore(deps-dev): Bump tslib to 2.7.0
  • chore(deps-dev): Bump @types/node to 22.5.0
  • chore(deps-dev): Bump typedoc to 0.26.6
  • chore(deps-dev): Bump vite to 5.4.2
  • chore(deps-dev): Bump @types/node to 22.5.1
  • Update dependabot-approve-merge.yml from main org #1066 (@AndyScherzinger)
  • chore(deps-dev): Bump jsdom to 25.0.0

3.8.0 - 2024-08-08

Full changelog

Added

  • feat: Allow registration of load child views callback on view #1046 (@Pytal)

Changed

  • chore(deps-dev): Bump @vitest/coverage-istanbul to 2.0.4
  • chore(deps-dev): Bump typedoc to 0.26.5
  • chore(deps): Bump @nextcloud/paths to 2.2.1
  • chore(deps): Bump @nextcloud/sharing to 0.2.3
  • chore(deps-dev): Bump vite to 5.3.5
  • chore(deps-dev): Bump jsdom to 24.1.1
  • chore(deps-dev): Bump @types/node to 20.14.12
  • chore(deps-dev): Bump typescript to 5.5.4
  • chore(deps-dev): Bump fast-xml-parser to 4.4.1
  • chore(deps-dev): Bump @vitest/coverage-istanbul to 2.0.5
  • chore(deps): Bump webdav to 5.7.0
  • chore(deps-dev): Bump @types/node to 22.1.0

3.7.0 - 2024-07-25

Full changelog

Added

  • feat: Implement API for file list filters #1027 (susnux)

Fixed

  • fix(dav): Cast displayname to string in resultToNode #1028 (susnux)
  • fix: Correctly export public API #1026 (susnux)

Changed

  • chore(deps): Bump @nextcloud/paths to 2.2.

3.6.0 - 2024-07-18

Full Changelog

Added

  • feat(filename): Improve filename validation to support Nextcloud 30 capabilities #1013 (susnux)
  • feat(node): Add displayname as top level attribute #1019 (susnux)

Fixed

  • fix: Node.move should also adjust the displayname #1018 (susnux)

Changed

  • 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/sharing to 0.2.
  • Updated development dependencies

3.5.1 - 2024-06-20

Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.5.0...v3.5.1

Fixed

  • fix davResultToNode on public shares (#993)
  • fix: make davRootPath and davRemoteURL support public shares (#996)
  • fix(dav): Add displayname and creationdate to default props (#991)
  • fix(sorting): The display name attribute is called displayname not displayName for DAV (#992)

Changed

  • chore(deps-dev): Bump ws to 8.17.
  • chore: Update development dependencies

3.5.0 - 2024-06-17

Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.4.1...v3.5.0

Added

  • feat: Add filename util getUniqueName to generate a unique name (#986)
  • feat: Export public interfaces of Node, File and Folder (#976)
  • feat(navigation): Allow to listen for active navigation changes (#987)

Fixed

  • fix(dav): Set status in davResultToNode when fileid is negative (#985)
  • fix: When sorting by filename the extension should only be considered if the basename is equal (#984)

Changed

  • Add SPDX headers (#980)
  • Updated development dependencies

3.4.1 - 2024-06-05

Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.4.0...v3.4.1

Fixed

  • fix(node): remove auto mtime update on attributes change and allow mtime set #974 (@skjnldsv)

Changed

  • chore(deps-dev): Bump vite to 5.2.12
  • chore(deps-dev): Bump @types/node to 20.13.0
  • chore(deps-dev): Bump jsdom to 24.1.0

3.4.0 - 2024-05-29

Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.3.1...v3.4.0

Added

  • feat: Add sortNodes and generic orderBy #961 (@susnux)

Fixed

  • fix(Node): Do not drop readonly attributes but only forbid updating them #967 (@susnux)

Changed

  • 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-parser to 4.4.0

3.3.1 - 2024-05-23

Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.3.0...v3.3.1

Fixed

  • fix: Export NewMenuEntryCategory from package #960 (@susnux)

3.3.0 - 2024-05-21

Added

  • feat: Add and export isFilenameValid function #951 (@susnux)
  • feat(files): allow updating attributes #947 (@skjnldsv)
  • feat(new-menu): Allow to set the category for entries #952 (@susnux)

Fixed

  • 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)

Changed

Dependencies

  • chore(deps): Bump @nextcloud/auth to 2.3.0
  • chore(deps): Bump @nextcloud/l10n to 3.1.0
  • chore(deps): Bump @nextcloud/logger to 3.0.2
  • chore(deps): Bump @nextcloud/router to 3.0.1
  • chore(deps): Bump is-svg to 5.0.1
  • chore(deps): Bump webdav to 5.6.0

Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.2.1...v3.3.0

3.2.1 - 2024-04-22

Changed

  • fix: Update NPM version to LTS version 10
  • Updated development dependencies

3.2.0 - 2024-04-15

Full Changelog: https://github.com/nextcloud-libraries/nextcloud-files/compare/v3.1.1...v3.2.0

Enhancements

  • feat(dav): Make getFavoriteNodes cancelable #923 (@Pytal)

Changed

  • Updated webdav from 5.4.0 to 5.5.0
  • Updated development dependencies

3.1.1 - 2024-03-24

Fixed

  • fix(dav): various typings and owner string cast #882 (@skjnldsv)
  • fix(dav): remove sharing attributes from default dav fetch and change duplicate registration from error to warn #902 (@skjnldsv)

Changed

  • Update @nextcloud/router from 2.2.1 to 3.0.0
  • Update webdav from 5.3.2 to 5.4.0

3.1.0 - 2023-12-21

Enhancements

  • enh(dav): Allow to set custom headers when creating the DAV client #849 (@susnux)

Fixed

  • fix(Node): Handle slash as root path for public webdav endpoint #847 (@susnux)
  • fix(dav): davResultToNode real owner #862 (@skjnldsv)

Changed

  • Update webdav from 5.3.0 to 5.3.1
  • Update dev dependencies

3.0.0 - 2023-11-08

Breaking

Enhancements

Fixed

  • Fix resultToNode by 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

2.1.0 – 2021-09-28

Changed

  • Dependency updates

2.0.0 – 2021-04-07

Changed

  • Browserslist config updated, which means some older browsers are not supported anymore
  • Dependency updates

1.1.0 - 2020-06-04

Changed

  • formatFileSize works without the global OC
  • Dependency updates

1.0.1 - 2020-03-19

Changed

  • Dependency updates

Fixed

  • Update vulnerable packages