@nextcloud/files 3.4.1 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
+ <!--
2
+ - SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
3
+ - SPDX-License-Identifier: AGPL-3.0-or-later
4
+ -->
1
5
  # @nextcloud/files
2
- [![npm last version](https://img.shields.io/npm/v/@nextcloud/files.svg?style=flat-square)](https://www.npmjs.com/package/@nextcloud/files) [![Code coverage](https://img.shields.io/codecov/c/github/nextcloud-libraries/nextcloud-files?style=flat-square)](https://app.codecov.io/gh/nextcloud-libraries/nextcloud-files) [![Project documentation](https://img.shields.io/badge/documentation-online-blue?style=flat-square)](https://nextcloud-libraries.github.io/nextcloud-files/)
6
+ [![npm last version](https://img.shields.io/npm/v/@nextcloud/files.svg?style=flat-square)](https://www.npmjs.com/package/@nextcloud/files) [![REUSE status](https://api.reuse.software/badge/github.com/nextcloud-libraries/nextcloud-files)](https://api.reuse.software/info/github.com/nextcloud-libraries/nextcloud-files) [![Code coverage](https://img.shields.io/codecov/c/github/nextcloud-libraries/nextcloud-files?style=flat-square)](https://app.codecov.io/gh/nextcloud-libraries/nextcloud-files) [![Project documentation](https://img.shields.io/badge/documentation-online-blue?style=flat-square)](https://nextcloud-libraries.github.io/nextcloud-files/)
3
7
 
4
8
  Nextcloud Files helpers for Nextcloud apps and libraries
5
9
 
package/dist/dav/dav.d.ts CHANGED
@@ -2,12 +2,23 @@ import { FileStat, WebDAVClient } from 'webdav';
2
2
  import { Node } from '../files/node';
3
3
  import { CancelablePromise } from 'cancelable-promise';
4
4
 
5
+ /**
6
+ * Get the DAV root path for the current user or public share
7
+ */
8
+ export declare function davGetRootPath(): string;
5
9
  /**
6
10
  * The DAV root path for the current user
11
+ * This is a cached version of `davGetRemoteURL`
7
12
  */
8
13
  export declare const davRootPath: string;
14
+ /**
15
+ * Get the DAV remote URL used as base URL for the WebDAV client
16
+ * It also handles public shares
17
+ */
18
+ export declare function davGetRemoteURL(): string;
9
19
  /**
10
20
  * The DAV remote URL used as base URL for the WebDAV client
21
+ * This is a cached version of `davGetRemoteURL`
11
22
  */
12
23
  export declare const davRemoteURL: string;
13
24
  /**
@@ -1,6 +1,12 @@
1
1
  import { FileType } from './fileType';
2
- import { Node } from './node';
2
+ import { INode, Node } from './node';
3
3
 
4
4
  export declare class File extends Node {
5
5
  get type(): FileType;
6
6
  }
7
+ /**
8
+ * Interface of the File class
9
+ */
10
+ export interface IFile extends INode {
11
+ readonly type: FileType.File;
12
+ }
@@ -1,23 +1,6 @@
1
1
  /**
2
- * @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
3
- *
4
- * @author John Molakvoæ <skjnldsv@protonmail.com>
5
- *
6
- * @license AGPL-3.0-or-later
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU Affero General Public License as
10
- * published by the Free Software Foundation, either version 3 of the
11
- * License, or (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU Affero General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU Affero General Public License
19
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
- *
2
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
3
+ * SPDX-License-Identifier: AGPL-3.0-or-later
21
4
  */
22
5
  export declare enum FileType {
23
6
  Folder = "folder",
@@ -1,5 +1,5 @@
1
1
  import { FileType } from './fileType';
2
- import { Node } from './node';
2
+ import { INode, Node } from './node';
3
3
  import { NodeData } from './nodeData';
4
4
 
5
5
  export declare class Folder extends Node {
@@ -8,3 +8,11 @@ export declare class Folder extends Node {
8
8
  get extension(): string | null;
9
9
  get mime(): string;
10
10
  }
11
+ /**
12
+ * Interface of the folder class
13
+ */
14
+ export interface IFolder extends INode {
15
+ readonly type: FileType.Folder;
16
+ readonly extension: null;
17
+ readonly mime: 'httpd/unix-directory';
18
+ }
@@ -149,3 +149,7 @@ export declare abstract class Node {
149
149
  */
150
150
  update(attributes: Attribute): void;
151
151
  }
152
+ /**
153
+ * Interface of the node class
154
+ */
155
+ export type INode = Pick<Node, keyof Node>;