cozy-client 24.10.2 → 25.0.3
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/CHANGELOG.md +47 -0
- package/dist/CozyClient.js +29 -8
- package/dist/CozyClient.spec.js +14 -1
- package/dist/RealTimeQueries.js +1 -0
- package/dist/RealTimeQueries.spec.jsx +8 -0
- package/dist/associations/HasMany.js +32 -10
- package/dist/associations/HasManyFiles.js +4 -6
- package/dist/associations/HasManyFiles.spec.js +0 -4
- package/dist/models/file.js +561 -11
- package/dist/models/file.spec.js +414 -48
- package/dist/types.js +1 -0
- package/package.json +3 -3
- package/types/CozyClient.d.ts +8 -1
- package/types/associations/HasMany.d.ts +12 -0
- package/types/models/file.d.ts +33 -0
- package/types/types.d.ts +4 -0
package/types/models/file.d.ts
CHANGED
|
@@ -46,6 +46,39 @@ export function hasMetadataAttribute({ file, attribute }: {
|
|
|
46
46
|
file: IOCozyFile;
|
|
47
47
|
attribute: string;
|
|
48
48
|
}): boolean;
|
|
49
|
+
export function getFullpath(client: CozyClient, dirId: string, name: string): Promise<string>;
|
|
50
|
+
export function move(client: CozyClient, fileId: string, destination: {
|
|
51
|
+
folderId: string;
|
|
52
|
+
path: string;
|
|
53
|
+
}, force?: boolean): Promise<any>;
|
|
54
|
+
export function overrideFileForPath(client: CozyClient, dirPath: string, file: object, metadata: object): Promise<IOCozyFile>;
|
|
55
|
+
export function generateNewFileNameOnConflict(filenameWithoutExtension: string): string;
|
|
56
|
+
export function generateFileNameForRevision(file: IOCozyFile, revision: object, f: Function): string;
|
|
57
|
+
export function uploadFileWithConflictStrategy(client: CozyClient, file: string | ArrayBuffer, options: FileUploadOptions): any;
|
|
58
|
+
export function readMobileFile(fileURL: string): Promise<any>;
|
|
59
|
+
export function doMobileUpload(client: CozyClient, fileURL: string, options: FileUploadOptions): Promise<any>;
|
|
60
|
+
export type FileUploadOptions = {
|
|
61
|
+
/**
|
|
62
|
+
* - The file name to upload
|
|
63
|
+
*/
|
|
64
|
+
name?: string;
|
|
65
|
+
/**
|
|
66
|
+
* - The dirId to upload the file to
|
|
67
|
+
*/
|
|
68
|
+
dirId?: string;
|
|
69
|
+
/**
|
|
70
|
+
* - An object containing the metadata to attach
|
|
71
|
+
*/
|
|
72
|
+
metadata?: object;
|
|
73
|
+
/**
|
|
74
|
+
* - The file Content-Type
|
|
75
|
+
*/
|
|
76
|
+
contentType?: string;
|
|
77
|
+
/**
|
|
78
|
+
* - Erase / rename
|
|
79
|
+
*/
|
|
80
|
+
conflictStrategy?: string;
|
|
81
|
+
};
|
|
49
82
|
import { IOCozyFile } from "../types";
|
|
50
83
|
import CozyClient from "../CozyClient";
|
|
51
84
|
import { QueryResult } from "../types";
|