node-appwrite 17.2.0 → 18.0.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/README.md +67 -2
- package/dist/client.js +3 -3
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +3 -3
- package/dist/client.mjs.map +1 -1
- package/dist/enums/{v-c-s-deployment-type.js → vcs-deployment-type.js} +1 -1
- package/dist/enums/vcs-deployment-type.js.map +1 -0
- package/dist/enums/{v-c-s-deployment-type.mjs → vcs-deployment-type.mjs} +2 -2
- package/dist/enums/vcs-deployment-type.mjs.map +1 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/models.d.mts +717 -58
- package/dist/models.d.ts +717 -58
- package/dist/query.d.mts +70 -0
- package/dist/query.d.ts +70 -0
- package/dist/query.js +70 -0
- package/dist/query.js.map +1 -1
- package/dist/query.mjs +70 -0
- package/dist/query.mjs.map +1 -1
- package/dist/services/account.d.mts +625 -70
- package/dist/services/account.d.ts +625 -70
- package/dist/services/account.js +592 -292
- package/dist/services/account.js.map +1 -1
- package/dist/services/account.mjs +592 -292
- package/dist/services/account.mjs.map +1 -1
- package/dist/services/avatars.d.mts +157 -26
- package/dist/services/avatars.d.ts +157 -26
- package/dist/services/avatars.js +104 -93
- package/dist/services/avatars.js.map +1 -1
- package/dist/services/avatars.mjs +104 -93
- package/dist/services/avatars.mjs.map +1 -1
- package/dist/services/databases.d.mts +1224 -248
- package/dist/services/databases.d.ts +1224 -248
- package/dist/services/databases.js +877 -611
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +877 -611
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +530 -107
- package/dist/services/functions.d.ts +530 -107
- package/dist/services/functions.js +393 -276
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +393 -276
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/graphql.d.mts +24 -2
- package/dist/services/graphql.d.ts +24 -2
- package/dist/services/graphql.js +20 -16
- package/dist/services/graphql.js.map +1 -1
- package/dist/services/graphql.mjs +20 -16
- package/dist/services/graphql.mjs.map +1 -1
- package/dist/services/health.d.mts +175 -16
- package/dist/services/health.d.ts +175 -16
- package/dist/services/health.js +144 -115
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +144 -115
- package/dist/services/health.mjs.map +1 -1
- package/dist/services/locale.js.map +1 -1
- package/dist/services/locale.mjs.map +1 -1
- package/dist/services/messaging.d.mts +1544 -262
- package/dist/services/messaging.d.ts +1544 -262
- package/dist/services/messaging.js +1417 -592
- package/dist/services/messaging.js.map +1 -1
- package/dist/services/messaging.mjs +1417 -592
- package/dist/services/messaging.mjs.map +1 -1
- package/dist/services/sites.d.mts +495 -99
- package/dist/services/sites.d.ts +495 -99
- package/dist/services/sites.js +371 -258
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs +371 -258
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/storage.d.mts +306 -63
- package/dist/services/storage.d.ts +306 -63
- package/dist/services/storage.js +225 -158
- package/dist/services/storage.js.map +1 -1
- package/dist/services/storage.mjs +225 -158
- package/dist/services/storage.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +1549 -0
- package/dist/services/tables-db.d.ts +1549 -0
- package/dist/services/tables-db.js +2374 -0
- package/dist/services/tables-db.js.map +1 -0
- package/dist/services/tables-db.mjs +2373 -0
- package/dist/services/tables-db.mjs.map +1 -0
- package/dist/services/teams.d.mts +233 -39
- package/dist/services/teams.d.ts +233 -39
- package/dist/services/teams.js +170 -135
- package/dist/services/teams.js.map +1 -1
- package/dist/services/teams.mjs +170 -135
- package/dist/services/teams.mjs.map +1 -1
- package/dist/services/tokens.d.mts +76 -11
- package/dist/services/tokens.d.ts +76 -11
- package/dist/services/tokens.js +60 -45
- package/dist/services/tokens.js.map +1 -1
- package/dist/services/tokens.mjs +60 -45
- package/dist/services/tokens.mjs.map +1 -1
- package/dist/services/users.d.mts +842 -115
- package/dist/services/users.d.ts +842 -115
- package/dist/services/users.js +719 -408
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +719 -408
- package/dist/services/users.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/enums/v-c-s-deployment-type.js.map +0 -1
- package/dist/enums/v-c-s-deployment-type.mjs.map +0 -1
- /package/dist/enums/{v-c-s-deployment-type.d.mts → vcs-deployment-type.d.mts} +0 -0
- /package/dist/enums/{v-c-s-deployment-type.d.ts → vcs-deployment-type.d.ts} +0 -0
|
@@ -11,70 +11,178 @@ declare class Storage {
|
|
|
11
11
|
/**
|
|
12
12
|
* Get a list of all the storage buckets. You can use the query params to filter your results.
|
|
13
13
|
*
|
|
14
|
-
* @param {string[]} queries
|
|
15
|
-
* @param {string} search
|
|
14
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus
|
|
15
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
16
16
|
* @throws {AppwriteException}
|
|
17
17
|
* @returns {Promise<Models.BucketList>}
|
|
18
18
|
*/
|
|
19
|
+
listBuckets(params?: {
|
|
20
|
+
queries?: string[];
|
|
21
|
+
search?: string;
|
|
22
|
+
}): Promise<Models.BucketList>;
|
|
23
|
+
/**
|
|
24
|
+
* Get a list of all the storage buckets. You can use the query params to filter your results.
|
|
25
|
+
*
|
|
26
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus
|
|
27
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
28
|
+
* @throws {AppwriteException}
|
|
29
|
+
* @returns {Promise<Models.BucketList>}
|
|
30
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
31
|
+
*/
|
|
19
32
|
listBuckets(queries?: string[], search?: string): Promise<Models.BucketList>;
|
|
20
33
|
/**
|
|
21
34
|
* Create a new storage bucket.
|
|
22
35
|
*
|
|
23
|
-
* @param {string} bucketId
|
|
24
|
-
* @param {string} name
|
|
25
|
-
* @param {string[]} permissions
|
|
26
|
-
* @param {boolean} fileSecurity
|
|
27
|
-
* @param {boolean} enabled
|
|
28
|
-
* @param {number} maximumFileSize
|
|
29
|
-
* @param {string[]} allowedFileExtensions
|
|
30
|
-
* @param {Compression} compression
|
|
31
|
-
* @param {boolean} encryption
|
|
32
|
-
* @param {boolean} antivirus
|
|
36
|
+
* @param {string} params.bucketId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
37
|
+
* @param {string} params.name - Bucket name
|
|
38
|
+
* @param {string[]} params.permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
39
|
+
* @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
40
|
+
* @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
|
41
|
+
* @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.
|
|
42
|
+
* @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
|
43
|
+
* @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
|
44
|
+
* @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
|
45
|
+
* @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
|
33
46
|
* @throws {AppwriteException}
|
|
34
47
|
* @returns {Promise<Models.Bucket>}
|
|
35
48
|
*/
|
|
49
|
+
createBucket(params: {
|
|
50
|
+
bucketId: string;
|
|
51
|
+
name: string;
|
|
52
|
+
permissions?: string[];
|
|
53
|
+
fileSecurity?: boolean;
|
|
54
|
+
enabled?: boolean;
|
|
55
|
+
maximumFileSize?: number;
|
|
56
|
+
allowedFileExtensions?: string[];
|
|
57
|
+
compression?: Compression;
|
|
58
|
+
encryption?: boolean;
|
|
59
|
+
antivirus?: boolean;
|
|
60
|
+
}): Promise<Models.Bucket>;
|
|
61
|
+
/**
|
|
62
|
+
* Create a new storage bucket.
|
|
63
|
+
*
|
|
64
|
+
* @param {string} bucketId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
65
|
+
* @param {string} name - Bucket name
|
|
66
|
+
* @param {string[]} permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
67
|
+
* @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
68
|
+
* @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
|
69
|
+
* @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.
|
|
70
|
+
* @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
|
71
|
+
* @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
|
72
|
+
* @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
|
73
|
+
* @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
|
74
|
+
* @throws {AppwriteException}
|
|
75
|
+
* @returns {Promise<Models.Bucket>}
|
|
76
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
77
|
+
*/
|
|
36
78
|
createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>;
|
|
37
79
|
/**
|
|
38
80
|
* Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.
|
|
39
81
|
*
|
|
40
|
-
* @param {string} bucketId
|
|
82
|
+
* @param {string} params.bucketId - Bucket unique ID.
|
|
83
|
+
* @throws {AppwriteException}
|
|
84
|
+
* @returns {Promise<Models.Bucket>}
|
|
85
|
+
*/
|
|
86
|
+
getBucket(params: {
|
|
87
|
+
bucketId: string;
|
|
88
|
+
}): Promise<Models.Bucket>;
|
|
89
|
+
/**
|
|
90
|
+
* Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.
|
|
91
|
+
*
|
|
92
|
+
* @param {string} bucketId - Bucket unique ID.
|
|
41
93
|
* @throws {AppwriteException}
|
|
42
94
|
* @returns {Promise<Models.Bucket>}
|
|
95
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
43
96
|
*/
|
|
44
97
|
getBucket(bucketId: string): Promise<Models.Bucket>;
|
|
45
98
|
/**
|
|
46
99
|
* Update a storage bucket by its unique ID.
|
|
47
100
|
*
|
|
48
|
-
* @param {string} bucketId
|
|
49
|
-
* @param {string} name
|
|
50
|
-
* @param {string[]} permissions
|
|
51
|
-
* @param {boolean} fileSecurity
|
|
52
|
-
* @param {boolean} enabled
|
|
53
|
-
* @param {number} maximumFileSize
|
|
54
|
-
* @param {string[]} allowedFileExtensions
|
|
55
|
-
* @param {Compression} compression
|
|
56
|
-
* @param {boolean} encryption
|
|
57
|
-
* @param {boolean} antivirus
|
|
101
|
+
* @param {string} params.bucketId - Bucket unique ID.
|
|
102
|
+
* @param {string} params.name - Bucket name
|
|
103
|
+
* @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
104
|
+
* @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
105
|
+
* @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
|
106
|
+
* @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.
|
|
107
|
+
* @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
|
108
|
+
* @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
|
109
|
+
* @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
|
110
|
+
* @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
|
58
111
|
* @throws {AppwriteException}
|
|
59
112
|
* @returns {Promise<Models.Bucket>}
|
|
60
113
|
*/
|
|
114
|
+
updateBucket(params: {
|
|
115
|
+
bucketId: string;
|
|
116
|
+
name: string;
|
|
117
|
+
permissions?: string[];
|
|
118
|
+
fileSecurity?: boolean;
|
|
119
|
+
enabled?: boolean;
|
|
120
|
+
maximumFileSize?: number;
|
|
121
|
+
allowedFileExtensions?: string[];
|
|
122
|
+
compression?: Compression;
|
|
123
|
+
encryption?: boolean;
|
|
124
|
+
antivirus?: boolean;
|
|
125
|
+
}): Promise<Models.Bucket>;
|
|
126
|
+
/**
|
|
127
|
+
* Update a storage bucket by its unique ID.
|
|
128
|
+
*
|
|
129
|
+
* @param {string} bucketId - Bucket unique ID.
|
|
130
|
+
* @param {string} name - Bucket name
|
|
131
|
+
* @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
132
|
+
* @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
133
|
+
* @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
|
134
|
+
* @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.
|
|
135
|
+
* @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
|
136
|
+
* @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
|
137
|
+
* @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
|
138
|
+
* @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
|
139
|
+
* @throws {AppwriteException}
|
|
140
|
+
* @returns {Promise<Models.Bucket>}
|
|
141
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
142
|
+
*/
|
|
61
143
|
updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>;
|
|
62
144
|
/**
|
|
63
145
|
* Delete a storage bucket by its unique ID.
|
|
64
146
|
*
|
|
65
|
-
* @param {string} bucketId
|
|
147
|
+
* @param {string} params.bucketId - Bucket unique ID.
|
|
148
|
+
* @throws {AppwriteException}
|
|
149
|
+
* @returns {Promise<{}>}
|
|
150
|
+
*/
|
|
151
|
+
deleteBucket(params: {
|
|
152
|
+
bucketId: string;
|
|
153
|
+
}): Promise<{}>;
|
|
154
|
+
/**
|
|
155
|
+
* Delete a storage bucket by its unique ID.
|
|
156
|
+
*
|
|
157
|
+
* @param {string} bucketId - Bucket unique ID.
|
|
66
158
|
* @throws {AppwriteException}
|
|
67
159
|
* @returns {Promise<{}>}
|
|
160
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
68
161
|
*/
|
|
69
162
|
deleteBucket(bucketId: string): Promise<{}>;
|
|
70
163
|
/**
|
|
71
164
|
* Get a list of all the user files. You can use the query params to filter your results.
|
|
72
165
|
*
|
|
73
|
-
* @param {string} bucketId
|
|
74
|
-
* @param {string[]} queries
|
|
75
|
-
* @param {string} search
|
|
166
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
167
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
|
168
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
169
|
+
* @throws {AppwriteException}
|
|
170
|
+
* @returns {Promise<Models.FileList>}
|
|
171
|
+
*/
|
|
172
|
+
listFiles(params: {
|
|
173
|
+
bucketId: string;
|
|
174
|
+
queries?: string[];
|
|
175
|
+
search?: string;
|
|
176
|
+
}): Promise<Models.FileList>;
|
|
177
|
+
/**
|
|
178
|
+
* Get a list of all the user files. You can use the query params to filter your results.
|
|
179
|
+
*
|
|
180
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
181
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
|
182
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
76
183
|
* @throws {AppwriteException}
|
|
77
184
|
* @returns {Promise<Models.FileList>}
|
|
185
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
78
186
|
*/
|
|
79
187
|
listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList>;
|
|
80
188
|
/**
|
|
@@ -82,87 +190,222 @@ declare class Storage {
|
|
|
82
190
|
*
|
|
83
191
|
* Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
|
84
192
|
*
|
|
85
|
-
* When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file
|
|
193
|
+
* When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
|
86
194
|
*
|
|
87
|
-
* If you
|
|
195
|
+
* If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
|
|
88
196
|
*
|
|
89
197
|
*
|
|
90
|
-
* @param {string} bucketId
|
|
91
|
-
* @param {string} fileId
|
|
92
|
-
* @param {File} file
|
|
93
|
-
* @param {string[]} permissions
|
|
198
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
199
|
+
* @param {string} params.fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
200
|
+
* @param {File} params.file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).
|
|
201
|
+
* @param {string[]} params.permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
94
202
|
* @throws {AppwriteException}
|
|
95
203
|
* @returns {Promise<Models.File>}
|
|
96
204
|
*/
|
|
205
|
+
createFile(params: {
|
|
206
|
+
bucketId: string;
|
|
207
|
+
fileId: string;
|
|
208
|
+
file: File;
|
|
209
|
+
permissions?: string[];
|
|
210
|
+
onProgress?: (progress: UploadProgress) => void;
|
|
211
|
+
}): Promise<Models.File>;
|
|
212
|
+
/**
|
|
213
|
+
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
|
|
214
|
+
*
|
|
215
|
+
* Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
|
216
|
+
*
|
|
217
|
+
* When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
|
218
|
+
*
|
|
219
|
+
* If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
|
|
220
|
+
*
|
|
221
|
+
*
|
|
222
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
223
|
+
* @param {string} fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
224
|
+
* @param {File} file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).
|
|
225
|
+
* @param {string[]} permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
226
|
+
* @throws {AppwriteException}
|
|
227
|
+
* @returns {Promise<Models.File>}
|
|
228
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
229
|
+
*/
|
|
97
230
|
createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise<Models.File>;
|
|
98
231
|
/**
|
|
99
232
|
* Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
|
|
100
233
|
*
|
|
101
|
-
* @param {string} bucketId
|
|
102
|
-
* @param {string} fileId
|
|
234
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
235
|
+
* @param {string} params.fileId - File ID.
|
|
236
|
+
* @throws {AppwriteException}
|
|
237
|
+
* @returns {Promise<Models.File>}
|
|
238
|
+
*/
|
|
239
|
+
getFile(params: {
|
|
240
|
+
bucketId: string;
|
|
241
|
+
fileId: string;
|
|
242
|
+
}): Promise<Models.File>;
|
|
243
|
+
/**
|
|
244
|
+
* Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
|
|
245
|
+
*
|
|
246
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
247
|
+
* @param {string} fileId - File ID.
|
|
103
248
|
* @throws {AppwriteException}
|
|
104
249
|
* @returns {Promise<Models.File>}
|
|
250
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
105
251
|
*/
|
|
106
252
|
getFile(bucketId: string, fileId: string): Promise<Models.File>;
|
|
107
253
|
/**
|
|
108
254
|
* Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
|
109
255
|
*
|
|
110
|
-
* @param {string} bucketId
|
|
111
|
-
* @param {string} fileId
|
|
112
|
-
* @param {string} name
|
|
113
|
-
* @param {string[]} permissions
|
|
256
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
257
|
+
* @param {string} params.fileId - File unique ID.
|
|
258
|
+
* @param {string} params.name - Name of the file
|
|
259
|
+
* @param {string[]} params.permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
260
|
+
* @throws {AppwriteException}
|
|
261
|
+
* @returns {Promise<Models.File>}
|
|
262
|
+
*/
|
|
263
|
+
updateFile(params: {
|
|
264
|
+
bucketId: string;
|
|
265
|
+
fileId: string;
|
|
266
|
+
name?: string;
|
|
267
|
+
permissions?: string[];
|
|
268
|
+
}): Promise<Models.File>;
|
|
269
|
+
/**
|
|
270
|
+
* Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
|
271
|
+
*
|
|
272
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
273
|
+
* @param {string} fileId - File unique ID.
|
|
274
|
+
* @param {string} name - Name of the file
|
|
275
|
+
* @param {string[]} permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
114
276
|
* @throws {AppwriteException}
|
|
115
277
|
* @returns {Promise<Models.File>}
|
|
278
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
116
279
|
*/
|
|
117
280
|
updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File>;
|
|
118
281
|
/**
|
|
119
282
|
* Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
|
|
120
283
|
*
|
|
121
|
-
* @param {string} bucketId
|
|
122
|
-
* @param {string} fileId
|
|
284
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
285
|
+
* @param {string} params.fileId - File ID.
|
|
286
|
+
* @throws {AppwriteException}
|
|
287
|
+
* @returns {Promise<{}>}
|
|
288
|
+
*/
|
|
289
|
+
deleteFile(params: {
|
|
290
|
+
bucketId: string;
|
|
291
|
+
fileId: string;
|
|
292
|
+
}): Promise<{}>;
|
|
293
|
+
/**
|
|
294
|
+
* Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
|
|
295
|
+
*
|
|
296
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
297
|
+
* @param {string} fileId - File ID.
|
|
123
298
|
* @throws {AppwriteException}
|
|
124
299
|
* @returns {Promise<{}>}
|
|
300
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
125
301
|
*/
|
|
126
302
|
deleteFile(bucketId: string, fileId: string): Promise<{}>;
|
|
127
303
|
/**
|
|
128
|
-
* Get a file content by its unique ID. The endpoint response return with a
|
|
304
|
+
* Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
|
305
|
+
*
|
|
306
|
+
* @param {string} params.bucketId - Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
307
|
+
* @param {string} params.fileId - File ID.
|
|
308
|
+
* @param {string} params.token - File token for accessing this file.
|
|
309
|
+
* @throws {AppwriteException}
|
|
310
|
+
* @returns {Promise<ArrayBuffer>}
|
|
311
|
+
*/
|
|
312
|
+
getFileDownload(params: {
|
|
313
|
+
bucketId: string;
|
|
314
|
+
fileId: string;
|
|
315
|
+
token?: string;
|
|
316
|
+
}): Promise<ArrayBuffer>;
|
|
317
|
+
/**
|
|
318
|
+
* Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
|
129
319
|
*
|
|
130
|
-
* @param {string} bucketId
|
|
131
|
-
* @param {string} fileId
|
|
132
|
-
* @param {string} token
|
|
320
|
+
* @param {string} bucketId - Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
321
|
+
* @param {string} fileId - File ID.
|
|
322
|
+
* @param {string} token - File token for accessing this file.
|
|
133
323
|
* @throws {AppwriteException}
|
|
134
324
|
* @returns {Promise<ArrayBuffer>}
|
|
325
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
135
326
|
*/
|
|
136
327
|
getFileDownload(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;
|
|
137
328
|
/**
|
|
138
329
|
* Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
|
|
139
330
|
*
|
|
140
|
-
* @param {string} bucketId
|
|
141
|
-
* @param {string} fileId
|
|
142
|
-
* @param {number} width
|
|
143
|
-
* @param {number} height
|
|
144
|
-
* @param {ImageGravity} gravity
|
|
145
|
-
* @param {number} quality
|
|
146
|
-
* @param {number} borderWidth
|
|
147
|
-
* @param {string} borderColor
|
|
148
|
-
* @param {number} borderRadius
|
|
149
|
-
* @param {number} opacity
|
|
150
|
-
* @param {number} rotation
|
|
151
|
-
* @param {string} background
|
|
152
|
-
* @param {ImageFormat} output
|
|
153
|
-
* @param {string} token
|
|
331
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
332
|
+
* @param {string} params.fileId - File ID
|
|
333
|
+
* @param {number} params.width - Resize preview image width, Pass an integer between 0 to 4000.
|
|
334
|
+
* @param {number} params.height - Resize preview image height, Pass an integer between 0 to 4000.
|
|
335
|
+
* @param {ImageGravity} params.gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
|
|
336
|
+
* @param {number} params.quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
337
|
+
* @param {number} params.borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
|
|
338
|
+
* @param {string} params.borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix.
|
|
339
|
+
* @param {number} params.borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000.
|
|
340
|
+
* @param {number} params.opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
|
|
341
|
+
* @param {number} params.rotation - Preview image rotation in degrees. Pass an integer between -360 and 360.
|
|
342
|
+
* @param {string} params.background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
|
|
343
|
+
* @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp).
|
|
344
|
+
* @param {string} params.token - File token for accessing this file.
|
|
345
|
+
* @throws {AppwriteException}
|
|
346
|
+
* @returns {Promise<ArrayBuffer>}
|
|
347
|
+
*/
|
|
348
|
+
getFilePreview(params: {
|
|
349
|
+
bucketId: string;
|
|
350
|
+
fileId: string;
|
|
351
|
+
width?: number;
|
|
352
|
+
height?: number;
|
|
353
|
+
gravity?: ImageGravity;
|
|
354
|
+
quality?: number;
|
|
355
|
+
borderWidth?: number;
|
|
356
|
+
borderColor?: string;
|
|
357
|
+
borderRadius?: number;
|
|
358
|
+
opacity?: number;
|
|
359
|
+
rotation?: number;
|
|
360
|
+
background?: string;
|
|
361
|
+
output?: ImageFormat;
|
|
362
|
+
token?: string;
|
|
363
|
+
}): Promise<ArrayBuffer>;
|
|
364
|
+
/**
|
|
365
|
+
* Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
|
|
366
|
+
*
|
|
367
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
368
|
+
* @param {string} fileId - File ID
|
|
369
|
+
* @param {number} width - Resize preview image width, Pass an integer between 0 to 4000.
|
|
370
|
+
* @param {number} height - Resize preview image height, Pass an integer between 0 to 4000.
|
|
371
|
+
* @param {ImageGravity} gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
|
|
372
|
+
* @param {number} quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
373
|
+
* @param {number} borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
|
|
374
|
+
* @param {string} borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix.
|
|
375
|
+
* @param {number} borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000.
|
|
376
|
+
* @param {number} opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
|
|
377
|
+
* @param {number} rotation - Preview image rotation in degrees. Pass an integer between -360 and 360.
|
|
378
|
+
* @param {string} background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
|
|
379
|
+
* @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp).
|
|
380
|
+
* @param {string} token - File token for accessing this file.
|
|
154
381
|
* @throws {AppwriteException}
|
|
155
382
|
* @returns {Promise<ArrayBuffer>}
|
|
383
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
156
384
|
*/
|
|
157
385
|
getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string): Promise<ArrayBuffer>;
|
|
158
386
|
/**
|
|
159
|
-
* Get a file content by its unique ID. This endpoint is similar to the download method but returns with no
|
|
387
|
+
* Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
|
|
388
|
+
*
|
|
389
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
390
|
+
* @param {string} params.fileId - File ID.
|
|
391
|
+
* @param {string} params.token - File token for accessing this file.
|
|
392
|
+
* @throws {AppwriteException}
|
|
393
|
+
* @returns {Promise<ArrayBuffer>}
|
|
394
|
+
*/
|
|
395
|
+
getFileView(params: {
|
|
396
|
+
bucketId: string;
|
|
397
|
+
fileId: string;
|
|
398
|
+
token?: string;
|
|
399
|
+
}): Promise<ArrayBuffer>;
|
|
400
|
+
/**
|
|
401
|
+
* Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
|
|
160
402
|
*
|
|
161
|
-
* @param {string} bucketId
|
|
162
|
-
* @param {string} fileId
|
|
163
|
-
* @param {string} token
|
|
403
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
404
|
+
* @param {string} fileId - File ID.
|
|
405
|
+
* @param {string} token - File token for accessing this file.
|
|
164
406
|
* @throws {AppwriteException}
|
|
165
407
|
* @returns {Promise<ArrayBuffer>}
|
|
408
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
166
409
|
*/
|
|
167
410
|
getFileView(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;
|
|
168
411
|
}
|