@appwrite.io/console 1.5.1 → 1.6.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 +4 -4
- package/dist/cjs/sdk.js +7714 -9758
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +7714 -9758
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +7714 -9758
- package/docs/examples/databases/update-float-attribute.md +2 -2
- package/docs/examples/databases/update-integer-attribute.md +2 -2
- package/docs/examples/health/{get-queue-usage-count.md → get-queue-stats-resources.md} +1 -1
- package/docs/examples/health/{get-queue-usage-dump.md → get-queue-stats-usage-dump.md} +1 -1
- package/docs/examples/organizations/create.md +5 -1
- package/docs/examples/organizations/update-plan.md +5 -1
- package/docs/examples/organizations/validate-invoice.md +14 -0
- package/package.json +1 -1
- package/src/client.ts +21 -4
- package/src/enums/credit-card.ts +1 -0
- package/src/enums/name.ts +3 -2
- package/src/enums/o-auth-provider.ts +1 -0
- package/src/enums/runtime.ts +3 -0
- package/src/models.ts +202 -5
- package/src/services/account.ts +126 -430
- package/src/services/assistant.ts +2 -7
- package/src/services/avatars.ts +7 -21
- package/src/services/backups.ts +24 -84
- package/src/services/console.ts +14 -49
- package/src/services/databases.ts +99 -350
- package/src/services/functions.ts +55 -192
- package/src/services/graphql.ts +4 -14
- package/src/services/health.ts +55 -207
- package/src/services/locale.ts +16 -56
- package/src/services/messaging.ts +92 -322
- package/src/services/migrations.ts +24 -84
- package/src/services/organizations.ts +118 -196
- package/src/services/project.ts +12 -42
- package/src/services/projects.ts +92 -322
- package/src/services/proxy.ts +10 -35
- package/src/services/storage.ts +27 -93
- package/src/services/teams.ts +28 -98
- package/src/services/users.ts +86 -301
- package/src/services/vcs.ts +20 -70
- package/types/enums/credit-card.d.ts +2 -1
- package/types/enums/name.d.ts +3 -2
- package/types/enums/o-auth-provider.d.ts +1 -0
- package/types/enums/runtime.d.ts +3 -0
- package/types/models.d.ts +202 -5
- package/types/services/account.d.ts +4 -128
- package/types/services/assistant.d.ts +0 -2
- package/types/services/avatars.d.ts +0 -14
- package/types/services/backups.d.ts +0 -24
- package/types/services/console.d.ts +0 -14
- package/types/services/databases.d.ts +5 -100
- package/types/services/functions.d.ts +0 -56
- package/types/services/graphql.d.ts +0 -4
- package/types/services/health.d.ts +5 -64
- package/types/services/locale.d.ts +0 -16
- package/types/services/messaging.d.ts +0 -92
- package/types/services/migrations.d.ts +0 -24
- package/types/services/organizations.d.ts +21 -60
- package/types/services/project.d.ts +0 -12
- package/types/services/projects.d.ts +0 -92
- package/types/services/proxy.d.ts +0 -10
- package/types/services/storage.d.ts +0 -30
- package/types/services/teams.d.ts +0 -28
- package/types/services/users.d.ts +0 -86
- package/types/services/vcs.d.ts +0 -20
- package/docs/examples/health/get-queue.md +0 -11
package/src/services/proxy.ts
CHANGED
|
@@ -11,8 +11,6 @@ export class Proxy {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* List rules
|
|
15
|
-
*
|
|
16
14
|
* Get a list of all the proxy rules. You can use the query params to filter your results.
|
|
17
15
|
*
|
|
18
16
|
* @param {string[]} queries
|
|
@@ -20,7 +18,7 @@ export class Proxy {
|
|
|
20
18
|
* @throws {AppwriteException}
|
|
21
19
|
* @returns {Promise<Models.ProxyRuleList>}
|
|
22
20
|
*/
|
|
23
|
-
|
|
21
|
+
listRules(queries?: string[], search?: string): Promise<Models.ProxyRuleList> {
|
|
24
22
|
const apiPath = '/proxy/rules';
|
|
25
23
|
const payload: Payload = {};
|
|
26
24
|
if (typeof queries !== 'undefined') {
|
|
@@ -35,10 +33,7 @@ export class Proxy {
|
|
|
35
33
|
'content-type': 'application/json',
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return await this.client.call(
|
|
36
|
+
return this.client.call(
|
|
42
37
|
'get',
|
|
43
38
|
uri,
|
|
44
39
|
apiHeaders,
|
|
@@ -46,8 +41,6 @@ export class Proxy {
|
|
|
46
41
|
);
|
|
47
42
|
}
|
|
48
43
|
/**
|
|
49
|
-
* Create rule
|
|
50
|
-
*
|
|
51
44
|
* Create a new proxy rule.
|
|
52
45
|
*
|
|
53
46
|
* @param {string} domain
|
|
@@ -56,7 +49,7 @@ export class Proxy {
|
|
|
56
49
|
* @throws {AppwriteException}
|
|
57
50
|
* @returns {Promise<Models.ProxyRule>}
|
|
58
51
|
*/
|
|
59
|
-
|
|
52
|
+
createRule(domain: string, resourceType: ResourceType, resourceId?: string): Promise<Models.ProxyRule> {
|
|
60
53
|
if (typeof domain === 'undefined') {
|
|
61
54
|
throw new AppwriteException('Missing required parameter: "domain"');
|
|
62
55
|
}
|
|
@@ -80,10 +73,7 @@ export class Proxy {
|
|
|
80
73
|
'content-type': 'application/json',
|
|
81
74
|
}
|
|
82
75
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return await this.client.call(
|
|
76
|
+
return this.client.call(
|
|
87
77
|
'post',
|
|
88
78
|
uri,
|
|
89
79
|
apiHeaders,
|
|
@@ -91,15 +81,13 @@ export class Proxy {
|
|
|
91
81
|
);
|
|
92
82
|
}
|
|
93
83
|
/**
|
|
94
|
-
* Get rule
|
|
95
|
-
*
|
|
96
84
|
* Get a proxy rule by its unique ID.
|
|
97
85
|
*
|
|
98
86
|
* @param {string} ruleId
|
|
99
87
|
* @throws {AppwriteException}
|
|
100
88
|
* @returns {Promise<Models.ProxyRule>}
|
|
101
89
|
*/
|
|
102
|
-
|
|
90
|
+
getRule(ruleId: string): Promise<Models.ProxyRule> {
|
|
103
91
|
if (typeof ruleId === 'undefined') {
|
|
104
92
|
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
105
93
|
}
|
|
@@ -111,10 +99,7 @@ export class Proxy {
|
|
|
111
99
|
'content-type': 'application/json',
|
|
112
100
|
}
|
|
113
101
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return await this.client.call(
|
|
102
|
+
return this.client.call(
|
|
118
103
|
'get',
|
|
119
104
|
uri,
|
|
120
105
|
apiHeaders,
|
|
@@ -122,15 +107,13 @@ export class Proxy {
|
|
|
122
107
|
);
|
|
123
108
|
}
|
|
124
109
|
/**
|
|
125
|
-
* Delete rule
|
|
126
|
-
*
|
|
127
110
|
* Delete a proxy rule by its unique ID.
|
|
128
111
|
*
|
|
129
112
|
* @param {string} ruleId
|
|
130
113
|
* @throws {AppwriteException}
|
|
131
114
|
* @returns {Promise<{}>}
|
|
132
115
|
*/
|
|
133
|
-
|
|
116
|
+
deleteRule(ruleId: string): Promise<{}> {
|
|
134
117
|
if (typeof ruleId === 'undefined') {
|
|
135
118
|
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
136
119
|
}
|
|
@@ -142,10 +125,7 @@ export class Proxy {
|
|
|
142
125
|
'content-type': 'application/json',
|
|
143
126
|
}
|
|
144
127
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return await this.client.call(
|
|
128
|
+
return this.client.call(
|
|
149
129
|
'delete',
|
|
150
130
|
uri,
|
|
151
131
|
apiHeaders,
|
|
@@ -153,15 +133,13 @@ export class Proxy {
|
|
|
153
133
|
);
|
|
154
134
|
}
|
|
155
135
|
/**
|
|
156
|
-
* Update rule verification status
|
|
157
|
-
*
|
|
158
136
|
* Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.
|
|
159
137
|
*
|
|
160
138
|
* @param {string} ruleId
|
|
161
139
|
* @throws {AppwriteException}
|
|
162
140
|
* @returns {Promise<Models.ProxyRule>}
|
|
163
141
|
*/
|
|
164
|
-
|
|
142
|
+
updateRuleVerification(ruleId: string): Promise<Models.ProxyRule> {
|
|
165
143
|
if (typeof ruleId === 'undefined') {
|
|
166
144
|
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
167
145
|
}
|
|
@@ -173,10 +151,7 @@ export class Proxy {
|
|
|
173
151
|
'content-type': 'application/json',
|
|
174
152
|
}
|
|
175
153
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
return await this.client.call(
|
|
154
|
+
return this.client.call(
|
|
180
155
|
'patch',
|
|
181
156
|
uri,
|
|
182
157
|
apiHeaders,
|
package/src/services/storage.ts
CHANGED
|
@@ -14,8 +14,6 @@ export class Storage {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* List buckets
|
|
18
|
-
*
|
|
19
17
|
* Get a list of all the storage buckets. You can use the query params to filter your results.
|
|
20
18
|
*
|
|
21
19
|
* @param {string[]} queries
|
|
@@ -23,7 +21,7 @@ export class Storage {
|
|
|
23
21
|
* @throws {AppwriteException}
|
|
24
22
|
* @returns {Promise<Models.BucketList>}
|
|
25
23
|
*/
|
|
26
|
-
|
|
24
|
+
listBuckets(queries?: string[], search?: string): Promise<Models.BucketList> {
|
|
27
25
|
const apiPath = '/storage/buckets';
|
|
28
26
|
const payload: Payload = {};
|
|
29
27
|
if (typeof queries !== 'undefined') {
|
|
@@ -38,10 +36,7 @@ export class Storage {
|
|
|
38
36
|
'content-type': 'application/json',
|
|
39
37
|
}
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return await this.client.call(
|
|
39
|
+
return this.client.call(
|
|
45
40
|
'get',
|
|
46
41
|
uri,
|
|
47
42
|
apiHeaders,
|
|
@@ -49,8 +44,6 @@ export class Storage {
|
|
|
49
44
|
);
|
|
50
45
|
}
|
|
51
46
|
/**
|
|
52
|
-
* Create bucket
|
|
53
|
-
*
|
|
54
47
|
* Create a new storage bucket.
|
|
55
48
|
*
|
|
56
49
|
* @param {string} bucketId
|
|
@@ -66,7 +59,7 @@ export class Storage {
|
|
|
66
59
|
* @throws {AppwriteException}
|
|
67
60
|
* @returns {Promise<Models.Bucket>}
|
|
68
61
|
*/
|
|
69
|
-
|
|
62
|
+
createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket> {
|
|
70
63
|
if (typeof bucketId === 'undefined') {
|
|
71
64
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
72
65
|
}
|
|
@@ -111,10 +104,7 @@ export class Storage {
|
|
|
111
104
|
'content-type': 'application/json',
|
|
112
105
|
}
|
|
113
106
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return await this.client.call(
|
|
107
|
+
return this.client.call(
|
|
118
108
|
'post',
|
|
119
109
|
uri,
|
|
120
110
|
apiHeaders,
|
|
@@ -122,15 +112,13 @@ export class Storage {
|
|
|
122
112
|
);
|
|
123
113
|
}
|
|
124
114
|
/**
|
|
125
|
-
* Get bucket
|
|
126
|
-
*
|
|
127
115
|
* Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.
|
|
128
116
|
*
|
|
129
117
|
* @param {string} bucketId
|
|
130
118
|
* @throws {AppwriteException}
|
|
131
119
|
* @returns {Promise<Models.Bucket>}
|
|
132
120
|
*/
|
|
133
|
-
|
|
121
|
+
getBucket(bucketId: string): Promise<Models.Bucket> {
|
|
134
122
|
if (typeof bucketId === 'undefined') {
|
|
135
123
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
136
124
|
}
|
|
@@ -142,10 +130,7 @@ export class Storage {
|
|
|
142
130
|
'content-type': 'application/json',
|
|
143
131
|
}
|
|
144
132
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return await this.client.call(
|
|
133
|
+
return this.client.call(
|
|
149
134
|
'get',
|
|
150
135
|
uri,
|
|
151
136
|
apiHeaders,
|
|
@@ -153,8 +138,6 @@ export class Storage {
|
|
|
153
138
|
);
|
|
154
139
|
}
|
|
155
140
|
/**
|
|
156
|
-
* Update bucket
|
|
157
|
-
*
|
|
158
141
|
* Update a storage bucket by its unique ID.
|
|
159
142
|
*
|
|
160
143
|
* @param {string} bucketId
|
|
@@ -170,7 +153,7 @@ export class Storage {
|
|
|
170
153
|
* @throws {AppwriteException}
|
|
171
154
|
* @returns {Promise<Models.Bucket>}
|
|
172
155
|
*/
|
|
173
|
-
|
|
156
|
+
updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket> {
|
|
174
157
|
if (typeof bucketId === 'undefined') {
|
|
175
158
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
176
159
|
}
|
|
@@ -212,10 +195,7 @@ export class Storage {
|
|
|
212
195
|
'content-type': 'application/json',
|
|
213
196
|
}
|
|
214
197
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
return await this.client.call(
|
|
198
|
+
return this.client.call(
|
|
219
199
|
'put',
|
|
220
200
|
uri,
|
|
221
201
|
apiHeaders,
|
|
@@ -223,15 +203,13 @@ export class Storage {
|
|
|
223
203
|
);
|
|
224
204
|
}
|
|
225
205
|
/**
|
|
226
|
-
* Delete bucket
|
|
227
|
-
*
|
|
228
206
|
* Delete a storage bucket by its unique ID.
|
|
229
207
|
*
|
|
230
208
|
* @param {string} bucketId
|
|
231
209
|
* @throws {AppwriteException}
|
|
232
210
|
* @returns {Promise<{}>}
|
|
233
211
|
*/
|
|
234
|
-
|
|
212
|
+
deleteBucket(bucketId: string): Promise<{}> {
|
|
235
213
|
if (typeof bucketId === 'undefined') {
|
|
236
214
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
237
215
|
}
|
|
@@ -243,10 +221,7 @@ export class Storage {
|
|
|
243
221
|
'content-type': 'application/json',
|
|
244
222
|
}
|
|
245
223
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
return await this.client.call(
|
|
224
|
+
return this.client.call(
|
|
250
225
|
'delete',
|
|
251
226
|
uri,
|
|
252
227
|
apiHeaders,
|
|
@@ -254,8 +229,6 @@ export class Storage {
|
|
|
254
229
|
);
|
|
255
230
|
}
|
|
256
231
|
/**
|
|
257
|
-
* List files
|
|
258
|
-
*
|
|
259
232
|
* Get a list of all the user files. You can use the query params to filter your results.
|
|
260
233
|
*
|
|
261
234
|
* @param {string} bucketId
|
|
@@ -264,7 +237,7 @@ export class Storage {
|
|
|
264
237
|
* @throws {AppwriteException}
|
|
265
238
|
* @returns {Promise<Models.FileList>}
|
|
266
239
|
*/
|
|
267
|
-
|
|
240
|
+
listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList> {
|
|
268
241
|
if (typeof bucketId === 'undefined') {
|
|
269
242
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
270
243
|
}
|
|
@@ -282,10 +255,7 @@ export class Storage {
|
|
|
282
255
|
'content-type': 'application/json',
|
|
283
256
|
}
|
|
284
257
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return await this.client.call(
|
|
258
|
+
return this.client.call(
|
|
289
259
|
'get',
|
|
290
260
|
uri,
|
|
291
261
|
apiHeaders,
|
|
@@ -293,8 +263,6 @@ export class Storage {
|
|
|
293
263
|
);
|
|
294
264
|
}
|
|
295
265
|
/**
|
|
296
|
-
* Create file
|
|
297
|
-
*
|
|
298
266
|
* 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.
|
|
299
267
|
|
|
300
268
|
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.
|
|
@@ -311,7 +279,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
311
279
|
* @throws {AppwriteException}
|
|
312
280
|
* @returns {Promise<Models.File>}
|
|
313
281
|
*/
|
|
314
|
-
|
|
282
|
+
createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress = (progress: UploadProgress) => {}): Promise<Models.File> {
|
|
315
283
|
if (typeof bucketId === 'undefined') {
|
|
316
284
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
317
285
|
}
|
|
@@ -338,10 +306,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
338
306
|
'content-type': 'multipart/form-data',
|
|
339
307
|
}
|
|
340
308
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
return await this.client.chunkedUpload(
|
|
309
|
+
return this.client.chunkedUpload(
|
|
345
310
|
'post',
|
|
346
311
|
uri,
|
|
347
312
|
apiHeaders,
|
|
@@ -350,8 +315,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
350
315
|
);
|
|
351
316
|
}
|
|
352
317
|
/**
|
|
353
|
-
* Get file
|
|
354
|
-
*
|
|
355
318
|
* Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
|
|
356
319
|
*
|
|
357
320
|
* @param {string} bucketId
|
|
@@ -359,7 +322,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
359
322
|
* @throws {AppwriteException}
|
|
360
323
|
* @returns {Promise<Models.File>}
|
|
361
324
|
*/
|
|
362
|
-
|
|
325
|
+
getFile(bucketId: string, fileId: string): Promise<Models.File> {
|
|
363
326
|
if (typeof bucketId === 'undefined') {
|
|
364
327
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
365
328
|
}
|
|
@@ -374,10 +337,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
374
337
|
'content-type': 'application/json',
|
|
375
338
|
}
|
|
376
339
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
return await this.client.call(
|
|
340
|
+
return this.client.call(
|
|
381
341
|
'get',
|
|
382
342
|
uri,
|
|
383
343
|
apiHeaders,
|
|
@@ -385,8 +345,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
385
345
|
);
|
|
386
346
|
}
|
|
387
347
|
/**
|
|
388
|
-
* Update file
|
|
389
|
-
*
|
|
390
348
|
* Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
|
391
349
|
*
|
|
392
350
|
* @param {string} bucketId
|
|
@@ -396,7 +354,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
396
354
|
* @throws {AppwriteException}
|
|
397
355
|
* @returns {Promise<Models.File>}
|
|
398
356
|
*/
|
|
399
|
-
|
|
357
|
+
updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File> {
|
|
400
358
|
if (typeof bucketId === 'undefined') {
|
|
401
359
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
402
360
|
}
|
|
@@ -417,10 +375,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
417
375
|
'content-type': 'application/json',
|
|
418
376
|
}
|
|
419
377
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
return await this.client.call(
|
|
378
|
+
return this.client.call(
|
|
424
379
|
'put',
|
|
425
380
|
uri,
|
|
426
381
|
apiHeaders,
|
|
@@ -428,8 +383,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
428
383
|
);
|
|
429
384
|
}
|
|
430
385
|
/**
|
|
431
|
-
* Delete file
|
|
432
|
-
*
|
|
433
386
|
* Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
|
|
434
387
|
*
|
|
435
388
|
* @param {string} bucketId
|
|
@@ -437,7 +390,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
437
390
|
* @throws {AppwriteException}
|
|
438
391
|
* @returns {Promise<{}>}
|
|
439
392
|
*/
|
|
440
|
-
|
|
393
|
+
deleteFile(bucketId: string, fileId: string): Promise<{}> {
|
|
441
394
|
if (typeof bucketId === 'undefined') {
|
|
442
395
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
443
396
|
}
|
|
@@ -452,10 +405,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
452
405
|
'content-type': 'application/json',
|
|
453
406
|
}
|
|
454
407
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
return await this.client.call(
|
|
408
|
+
return this.client.call(
|
|
459
409
|
'delete',
|
|
460
410
|
uri,
|
|
461
411
|
apiHeaders,
|
|
@@ -463,8 +413,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
463
413
|
);
|
|
464
414
|
}
|
|
465
415
|
/**
|
|
466
|
-
* Get file for download
|
|
467
|
-
*
|
|
468
416
|
* 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.
|
|
469
417
|
*
|
|
470
418
|
* @param {string} bucketId
|
|
@@ -492,12 +440,10 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
492
440
|
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
493
441
|
uri.searchParams.append(key, value);
|
|
494
442
|
}
|
|
495
|
-
|
|
443
|
+
|
|
496
444
|
return uri.toString();
|
|
497
445
|
}
|
|
498
446
|
/**
|
|
499
|
-
* Get file preview
|
|
500
|
-
*
|
|
501
447
|
* 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.
|
|
502
448
|
*
|
|
503
449
|
* @param {string} bucketId
|
|
@@ -569,12 +515,10 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
569
515
|
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
570
516
|
uri.searchParams.append(key, value);
|
|
571
517
|
}
|
|
572
|
-
|
|
518
|
+
|
|
573
519
|
return uri.toString();
|
|
574
520
|
}
|
|
575
521
|
/**
|
|
576
|
-
* Get file for view
|
|
577
|
-
*
|
|
578
522
|
* Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
|
|
579
523
|
*
|
|
580
524
|
* @param {string} bucketId
|
|
@@ -602,12 +546,10 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
602
546
|
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
603
547
|
uri.searchParams.append(key, value);
|
|
604
548
|
}
|
|
605
|
-
|
|
549
|
+
|
|
606
550
|
return uri.toString();
|
|
607
551
|
}
|
|
608
552
|
/**
|
|
609
|
-
* Get storage usage stats
|
|
610
|
-
*
|
|
611
553
|
* Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
|
|
612
554
|
|
|
613
555
|
*
|
|
@@ -615,7 +557,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
615
557
|
* @throws {AppwriteException}
|
|
616
558
|
* @returns {Promise<Models.UsageStorage>}
|
|
617
559
|
*/
|
|
618
|
-
|
|
560
|
+
getUsage(range?: StorageUsageRange): Promise<Models.UsageStorage> {
|
|
619
561
|
const apiPath = '/storage/usage';
|
|
620
562
|
const payload: Payload = {};
|
|
621
563
|
if (typeof range !== 'undefined') {
|
|
@@ -627,10 +569,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
627
569
|
'content-type': 'application/json',
|
|
628
570
|
}
|
|
629
571
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
return await this.client.call(
|
|
572
|
+
return this.client.call(
|
|
634
573
|
'get',
|
|
635
574
|
uri,
|
|
636
575
|
apiHeaders,
|
|
@@ -638,8 +577,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
638
577
|
);
|
|
639
578
|
}
|
|
640
579
|
/**
|
|
641
|
-
* Get bucket usage stats
|
|
642
|
-
*
|
|
643
580
|
* Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
|
|
644
581
|
|
|
645
582
|
*
|
|
@@ -648,7 +585,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
648
585
|
* @throws {AppwriteException}
|
|
649
586
|
* @returns {Promise<Models.UsageBuckets>}
|
|
650
587
|
*/
|
|
651
|
-
|
|
588
|
+
getBucketUsage(bucketId: string, range?: StorageUsageRange): Promise<Models.UsageBuckets> {
|
|
652
589
|
if (typeof bucketId === 'undefined') {
|
|
653
590
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
654
591
|
}
|
|
@@ -663,10 +600,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
663
600
|
'content-type': 'application/json',
|
|
664
601
|
}
|
|
665
602
|
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
return await this.client.call(
|
|
603
|
+
return this.client.call(
|
|
670
604
|
'get',
|
|
671
605
|
uri,
|
|
672
606
|
apiHeaders,
|