@appwrite.io/console 1.5.2 → 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 +3 -3
- package/dist/cjs/sdk.js +7673 -9723
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +7673 -9723
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +7673 -9723
- package/docs/examples/organizations/validate-invoice.md +14 -0
- package/package.json +1 -1
- package/src/client.ts +21 -4
- package/src/enums/o-auth-provider.ts +1 -0
- package/src/models.ts +118 -6
- 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 +96 -336
- package/src/services/functions.ts +55 -192
- package/src/services/graphql.ts +4 -14
- package/src/services/health.ts +50 -175
- 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 +86 -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/o-auth-provider.d.ts +1 -0
- package/types/models.d.ts +118 -6
- 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 +0 -96
- package/types/services/functions.d.ts +0 -56
- package/types/services/graphql.d.ts +0 -4
- package/types/services/health.d.ts +0 -50
- 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 +11 -58
- 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
|
@@ -14,8 +14,6 @@ export class Databases {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* List databases
|
|
18
|
-
*
|
|
19
17
|
* Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.
|
|
20
18
|
*
|
|
21
19
|
* @param {string[]} queries
|
|
@@ -23,7 +21,7 @@ export class Databases {
|
|
|
23
21
|
* @throws {AppwriteException}
|
|
24
22
|
* @returns {Promise<Models.DatabaseList>}
|
|
25
23
|
*/
|
|
26
|
-
|
|
24
|
+
list(queries?: string[], search?: string): Promise<Models.DatabaseList> {
|
|
27
25
|
const apiPath = '/databases';
|
|
28
26
|
const payload: Payload = {};
|
|
29
27
|
if (typeof queries !== 'undefined') {
|
|
@@ -38,10 +36,7 @@ export class Databases {
|
|
|
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 Databases {
|
|
|
49
44
|
);
|
|
50
45
|
}
|
|
51
46
|
/**
|
|
52
|
-
* Create database
|
|
53
|
-
*
|
|
54
47
|
* Create a new Database.
|
|
55
48
|
|
|
56
49
|
*
|
|
@@ -60,7 +53,7 @@ export class Databases {
|
|
|
60
53
|
* @throws {AppwriteException}
|
|
61
54
|
* @returns {Promise<Models.Database>}
|
|
62
55
|
*/
|
|
63
|
-
|
|
56
|
+
create(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database> {
|
|
64
57
|
if (typeof databaseId === 'undefined') {
|
|
65
58
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
66
59
|
}
|
|
@@ -84,10 +77,7 @@ export class Databases {
|
|
|
84
77
|
'content-type': 'application/json',
|
|
85
78
|
}
|
|
86
79
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return await this.client.call(
|
|
80
|
+
return this.client.call(
|
|
91
81
|
'post',
|
|
92
82
|
uri,
|
|
93
83
|
apiHeaders,
|
|
@@ -95,15 +85,13 @@ export class Databases {
|
|
|
95
85
|
);
|
|
96
86
|
}
|
|
97
87
|
/**
|
|
98
|
-
* Get databases usage stats
|
|
99
|
-
*
|
|
100
88
|
* Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and 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.
|
|
101
89
|
*
|
|
102
90
|
* @param {DatabaseUsageRange} range
|
|
103
91
|
* @throws {AppwriteException}
|
|
104
92
|
* @returns {Promise<Models.UsageDatabases>}
|
|
105
93
|
*/
|
|
106
|
-
|
|
94
|
+
getUsage(range?: DatabaseUsageRange): Promise<Models.UsageDatabases> {
|
|
107
95
|
const apiPath = '/databases/usage';
|
|
108
96
|
const payload: Payload = {};
|
|
109
97
|
if (typeof range !== 'undefined') {
|
|
@@ -115,10 +103,7 @@ export class Databases {
|
|
|
115
103
|
'content-type': 'application/json',
|
|
116
104
|
}
|
|
117
105
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return await this.client.call(
|
|
106
|
+
return this.client.call(
|
|
122
107
|
'get',
|
|
123
108
|
uri,
|
|
124
109
|
apiHeaders,
|
|
@@ -126,15 +111,13 @@ export class Databases {
|
|
|
126
111
|
);
|
|
127
112
|
}
|
|
128
113
|
/**
|
|
129
|
-
* Get database
|
|
130
|
-
*
|
|
131
114
|
* Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.
|
|
132
115
|
*
|
|
133
116
|
* @param {string} databaseId
|
|
134
117
|
* @throws {AppwriteException}
|
|
135
118
|
* @returns {Promise<Models.Database>}
|
|
136
119
|
*/
|
|
137
|
-
|
|
120
|
+
get(databaseId: string): Promise<Models.Database> {
|
|
138
121
|
if (typeof databaseId === 'undefined') {
|
|
139
122
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
140
123
|
}
|
|
@@ -146,10 +129,7 @@ export class Databases {
|
|
|
146
129
|
'content-type': 'application/json',
|
|
147
130
|
}
|
|
148
131
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return await this.client.call(
|
|
132
|
+
return this.client.call(
|
|
153
133
|
'get',
|
|
154
134
|
uri,
|
|
155
135
|
apiHeaders,
|
|
@@ -157,8 +137,6 @@ export class Databases {
|
|
|
157
137
|
);
|
|
158
138
|
}
|
|
159
139
|
/**
|
|
160
|
-
* Update database
|
|
161
|
-
*
|
|
162
140
|
* Update a database by its unique ID.
|
|
163
141
|
*
|
|
164
142
|
* @param {string} databaseId
|
|
@@ -167,7 +145,7 @@ export class Databases {
|
|
|
167
145
|
* @throws {AppwriteException}
|
|
168
146
|
* @returns {Promise<Models.Database>}
|
|
169
147
|
*/
|
|
170
|
-
|
|
148
|
+
update(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database> {
|
|
171
149
|
if (typeof databaseId === 'undefined') {
|
|
172
150
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
173
151
|
}
|
|
@@ -188,10 +166,7 @@ export class Databases {
|
|
|
188
166
|
'content-type': 'application/json',
|
|
189
167
|
}
|
|
190
168
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return await this.client.call(
|
|
169
|
+
return this.client.call(
|
|
195
170
|
'put',
|
|
196
171
|
uri,
|
|
197
172
|
apiHeaders,
|
|
@@ -199,15 +174,13 @@ export class Databases {
|
|
|
199
174
|
);
|
|
200
175
|
}
|
|
201
176
|
/**
|
|
202
|
-
* Delete database
|
|
203
|
-
*
|
|
204
177
|
* Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
|
|
205
178
|
*
|
|
206
179
|
* @param {string} databaseId
|
|
207
180
|
* @throws {AppwriteException}
|
|
208
181
|
* @returns {Promise<{}>}
|
|
209
182
|
*/
|
|
210
|
-
|
|
183
|
+
delete(databaseId: string): Promise<{}> {
|
|
211
184
|
if (typeof databaseId === 'undefined') {
|
|
212
185
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
213
186
|
}
|
|
@@ -219,10 +192,7 @@ export class Databases {
|
|
|
219
192
|
'content-type': 'application/json',
|
|
220
193
|
}
|
|
221
194
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return await this.client.call(
|
|
195
|
+
return this.client.call(
|
|
226
196
|
'delete',
|
|
227
197
|
uri,
|
|
228
198
|
apiHeaders,
|
|
@@ -230,8 +200,6 @@ export class Databases {
|
|
|
230
200
|
);
|
|
231
201
|
}
|
|
232
202
|
/**
|
|
233
|
-
* List collections
|
|
234
|
-
*
|
|
235
203
|
* Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.
|
|
236
204
|
*
|
|
237
205
|
* @param {string} databaseId
|
|
@@ -240,7 +208,7 @@ export class Databases {
|
|
|
240
208
|
* @throws {AppwriteException}
|
|
241
209
|
* @returns {Promise<Models.CollectionList>}
|
|
242
210
|
*/
|
|
243
|
-
|
|
211
|
+
listCollections(databaseId: string, queries?: string[], search?: string): Promise<Models.CollectionList> {
|
|
244
212
|
if (typeof databaseId === 'undefined') {
|
|
245
213
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
246
214
|
}
|
|
@@ -258,10 +226,7 @@ export class Databases {
|
|
|
258
226
|
'content-type': 'application/json',
|
|
259
227
|
}
|
|
260
228
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return await this.client.call(
|
|
229
|
+
return this.client.call(
|
|
265
230
|
'get',
|
|
266
231
|
uri,
|
|
267
232
|
apiHeaders,
|
|
@@ -269,8 +234,6 @@ export class Databases {
|
|
|
269
234
|
);
|
|
270
235
|
}
|
|
271
236
|
/**
|
|
272
|
-
* Create collection
|
|
273
|
-
*
|
|
274
237
|
* Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
|
|
275
238
|
*
|
|
276
239
|
* @param {string} databaseId
|
|
@@ -282,7 +245,7 @@ export class Databases {
|
|
|
282
245
|
* @throws {AppwriteException}
|
|
283
246
|
* @returns {Promise<Models.Collection>}
|
|
284
247
|
*/
|
|
285
|
-
|
|
248
|
+
createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection> {
|
|
286
249
|
if (typeof databaseId === 'undefined') {
|
|
287
250
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
288
251
|
}
|
|
@@ -315,10 +278,7 @@ export class Databases {
|
|
|
315
278
|
'content-type': 'application/json',
|
|
316
279
|
}
|
|
317
280
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
return await this.client.call(
|
|
281
|
+
return this.client.call(
|
|
322
282
|
'post',
|
|
323
283
|
uri,
|
|
324
284
|
apiHeaders,
|
|
@@ -326,8 +286,6 @@ export class Databases {
|
|
|
326
286
|
);
|
|
327
287
|
}
|
|
328
288
|
/**
|
|
329
|
-
* Get collection
|
|
330
|
-
*
|
|
331
289
|
* Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.
|
|
332
290
|
*
|
|
333
291
|
* @param {string} databaseId
|
|
@@ -335,7 +293,7 @@ export class Databases {
|
|
|
335
293
|
* @throws {AppwriteException}
|
|
336
294
|
* @returns {Promise<Models.Collection>}
|
|
337
295
|
*/
|
|
338
|
-
|
|
296
|
+
getCollection(databaseId: string, collectionId: string): Promise<Models.Collection> {
|
|
339
297
|
if (typeof databaseId === 'undefined') {
|
|
340
298
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
341
299
|
}
|
|
@@ -350,10 +308,7 @@ export class Databases {
|
|
|
350
308
|
'content-type': 'application/json',
|
|
351
309
|
}
|
|
352
310
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
return await this.client.call(
|
|
311
|
+
return this.client.call(
|
|
357
312
|
'get',
|
|
358
313
|
uri,
|
|
359
314
|
apiHeaders,
|
|
@@ -361,8 +316,6 @@ export class Databases {
|
|
|
361
316
|
);
|
|
362
317
|
}
|
|
363
318
|
/**
|
|
364
|
-
* Update collection
|
|
365
|
-
*
|
|
366
319
|
* Update a collection by its unique ID.
|
|
367
320
|
*
|
|
368
321
|
* @param {string} databaseId
|
|
@@ -374,7 +327,7 @@ export class Databases {
|
|
|
374
327
|
* @throws {AppwriteException}
|
|
375
328
|
* @returns {Promise<Models.Collection>}
|
|
376
329
|
*/
|
|
377
|
-
|
|
330
|
+
updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection> {
|
|
378
331
|
if (typeof databaseId === 'undefined') {
|
|
379
332
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
380
333
|
}
|
|
@@ -404,10 +357,7 @@ export class Databases {
|
|
|
404
357
|
'content-type': 'application/json',
|
|
405
358
|
}
|
|
406
359
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
return await this.client.call(
|
|
360
|
+
return this.client.call(
|
|
411
361
|
'put',
|
|
412
362
|
uri,
|
|
413
363
|
apiHeaders,
|
|
@@ -415,8 +365,6 @@ export class Databases {
|
|
|
415
365
|
);
|
|
416
366
|
}
|
|
417
367
|
/**
|
|
418
|
-
* Delete collection
|
|
419
|
-
*
|
|
420
368
|
* Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.
|
|
421
369
|
*
|
|
422
370
|
* @param {string} databaseId
|
|
@@ -424,7 +372,7 @@ export class Databases {
|
|
|
424
372
|
* @throws {AppwriteException}
|
|
425
373
|
* @returns {Promise<{}>}
|
|
426
374
|
*/
|
|
427
|
-
|
|
375
|
+
deleteCollection(databaseId: string, collectionId: string): Promise<{}> {
|
|
428
376
|
if (typeof databaseId === 'undefined') {
|
|
429
377
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
430
378
|
}
|
|
@@ -439,10 +387,7 @@ export class Databases {
|
|
|
439
387
|
'content-type': 'application/json',
|
|
440
388
|
}
|
|
441
389
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
return await this.client.call(
|
|
390
|
+
return this.client.call(
|
|
446
391
|
'delete',
|
|
447
392
|
uri,
|
|
448
393
|
apiHeaders,
|
|
@@ -450,8 +395,6 @@ export class Databases {
|
|
|
450
395
|
);
|
|
451
396
|
}
|
|
452
397
|
/**
|
|
453
|
-
* List attributes
|
|
454
|
-
*
|
|
455
398
|
* List attributes in the collection.
|
|
456
399
|
*
|
|
457
400
|
* @param {string} databaseId
|
|
@@ -460,7 +403,7 @@ export class Databases {
|
|
|
460
403
|
* @throws {AppwriteException}
|
|
461
404
|
* @returns {Promise<Models.AttributeList>}
|
|
462
405
|
*/
|
|
463
|
-
|
|
406
|
+
listAttributes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.AttributeList> {
|
|
464
407
|
if (typeof databaseId === 'undefined') {
|
|
465
408
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
466
409
|
}
|
|
@@ -478,10 +421,7 @@ export class Databases {
|
|
|
478
421
|
'content-type': 'application/json',
|
|
479
422
|
}
|
|
480
423
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
return await this.client.call(
|
|
424
|
+
return this.client.call(
|
|
485
425
|
'get',
|
|
486
426
|
uri,
|
|
487
427
|
apiHeaders,
|
|
@@ -489,8 +429,6 @@ export class Databases {
|
|
|
489
429
|
);
|
|
490
430
|
}
|
|
491
431
|
/**
|
|
492
|
-
* Create boolean attribute
|
|
493
|
-
*
|
|
494
432
|
* Create a boolean attribute.
|
|
495
433
|
|
|
496
434
|
*
|
|
@@ -503,7 +441,7 @@ export class Databases {
|
|
|
503
441
|
* @throws {AppwriteException}
|
|
504
442
|
* @returns {Promise<Models.AttributeBoolean>}
|
|
505
443
|
*/
|
|
506
|
-
|
|
444
|
+
createBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise<Models.AttributeBoolean> {
|
|
507
445
|
if (typeof databaseId === 'undefined') {
|
|
508
446
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
509
447
|
}
|
|
@@ -536,10 +474,7 @@ export class Databases {
|
|
|
536
474
|
'content-type': 'application/json',
|
|
537
475
|
}
|
|
538
476
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
return await this.client.call(
|
|
477
|
+
return this.client.call(
|
|
543
478
|
'post',
|
|
544
479
|
uri,
|
|
545
480
|
apiHeaders,
|
|
@@ -547,8 +482,6 @@ export class Databases {
|
|
|
547
482
|
);
|
|
548
483
|
}
|
|
549
484
|
/**
|
|
550
|
-
* Update boolean attribute
|
|
551
|
-
*
|
|
552
485
|
* Update a boolean attribute. Changing the `default` value will not update already existing documents.
|
|
553
486
|
*
|
|
554
487
|
* @param {string} databaseId
|
|
@@ -560,7 +493,7 @@ export class Databases {
|
|
|
560
493
|
* @throws {AppwriteException}
|
|
561
494
|
* @returns {Promise<Models.AttributeBoolean>}
|
|
562
495
|
*/
|
|
563
|
-
|
|
496
|
+
updateBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, newKey?: string): Promise<Models.AttributeBoolean> {
|
|
564
497
|
if (typeof databaseId === 'undefined') {
|
|
565
498
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
566
499
|
}
|
|
@@ -593,10 +526,7 @@ export class Databases {
|
|
|
593
526
|
'content-type': 'application/json',
|
|
594
527
|
}
|
|
595
528
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
return await this.client.call(
|
|
529
|
+
return this.client.call(
|
|
600
530
|
'patch',
|
|
601
531
|
uri,
|
|
602
532
|
apiHeaders,
|
|
@@ -604,8 +534,6 @@ export class Databases {
|
|
|
604
534
|
);
|
|
605
535
|
}
|
|
606
536
|
/**
|
|
607
|
-
* Create datetime attribute
|
|
608
|
-
*
|
|
609
537
|
* Create a date time attribute according to the ISO 8601 standard.
|
|
610
538
|
*
|
|
611
539
|
* @param {string} databaseId
|
|
@@ -617,7 +545,7 @@ export class Databases {
|
|
|
617
545
|
* @throws {AppwriteException}
|
|
618
546
|
* @returns {Promise<Models.AttributeDatetime>}
|
|
619
547
|
*/
|
|
620
|
-
|
|
548
|
+
createDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeDatetime> {
|
|
621
549
|
if (typeof databaseId === 'undefined') {
|
|
622
550
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
623
551
|
}
|
|
@@ -650,10 +578,7 @@ export class Databases {
|
|
|
650
578
|
'content-type': 'application/json',
|
|
651
579
|
}
|
|
652
580
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
return await this.client.call(
|
|
581
|
+
return this.client.call(
|
|
657
582
|
'post',
|
|
658
583
|
uri,
|
|
659
584
|
apiHeaders,
|
|
@@ -661,8 +586,6 @@ export class Databases {
|
|
|
661
586
|
);
|
|
662
587
|
}
|
|
663
588
|
/**
|
|
664
|
-
* Update dateTime attribute
|
|
665
|
-
*
|
|
666
589
|
* Update a date time attribute. Changing the `default` value will not update already existing documents.
|
|
667
590
|
*
|
|
668
591
|
* @param {string} databaseId
|
|
@@ -674,7 +597,7 @@ export class Databases {
|
|
|
674
597
|
* @throws {AppwriteException}
|
|
675
598
|
* @returns {Promise<Models.AttributeDatetime>}
|
|
676
599
|
*/
|
|
677
|
-
|
|
600
|
+
updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeDatetime> {
|
|
678
601
|
if (typeof databaseId === 'undefined') {
|
|
679
602
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
680
603
|
}
|
|
@@ -707,10 +630,7 @@ export class Databases {
|
|
|
707
630
|
'content-type': 'application/json',
|
|
708
631
|
}
|
|
709
632
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
return await this.client.call(
|
|
633
|
+
return this.client.call(
|
|
714
634
|
'patch',
|
|
715
635
|
uri,
|
|
716
636
|
apiHeaders,
|
|
@@ -718,8 +638,6 @@ export class Databases {
|
|
|
718
638
|
);
|
|
719
639
|
}
|
|
720
640
|
/**
|
|
721
|
-
* Create email attribute
|
|
722
|
-
*
|
|
723
641
|
* Create an email attribute.
|
|
724
642
|
|
|
725
643
|
*
|
|
@@ -732,7 +650,7 @@ export class Databases {
|
|
|
732
650
|
* @throws {AppwriteException}
|
|
733
651
|
* @returns {Promise<Models.AttributeEmail>}
|
|
734
652
|
*/
|
|
735
|
-
|
|
653
|
+
createEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail> {
|
|
736
654
|
if (typeof databaseId === 'undefined') {
|
|
737
655
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
738
656
|
}
|
|
@@ -765,10 +683,7 @@ export class Databases {
|
|
|
765
683
|
'content-type': 'application/json',
|
|
766
684
|
}
|
|
767
685
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
return await this.client.call(
|
|
686
|
+
return this.client.call(
|
|
772
687
|
'post',
|
|
773
688
|
uri,
|
|
774
689
|
apiHeaders,
|
|
@@ -776,8 +691,6 @@ export class Databases {
|
|
|
776
691
|
);
|
|
777
692
|
}
|
|
778
693
|
/**
|
|
779
|
-
* Update email attribute
|
|
780
|
-
*
|
|
781
694
|
* Update an email attribute. Changing the `default` value will not update already existing documents.
|
|
782
695
|
|
|
783
696
|
*
|
|
@@ -790,7 +703,7 @@ export class Databases {
|
|
|
790
703
|
* @throws {AppwriteException}
|
|
791
704
|
* @returns {Promise<Models.AttributeEmail>}
|
|
792
705
|
*/
|
|
793
|
-
|
|
706
|
+
updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEmail> {
|
|
794
707
|
if (typeof databaseId === 'undefined') {
|
|
795
708
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
796
709
|
}
|
|
@@ -823,10 +736,7 @@ export class Databases {
|
|
|
823
736
|
'content-type': 'application/json',
|
|
824
737
|
}
|
|
825
738
|
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
return await this.client.call(
|
|
739
|
+
return this.client.call(
|
|
830
740
|
'patch',
|
|
831
741
|
uri,
|
|
832
742
|
apiHeaders,
|
|
@@ -834,8 +744,6 @@ export class Databases {
|
|
|
834
744
|
);
|
|
835
745
|
}
|
|
836
746
|
/**
|
|
837
|
-
* Create enum attribute
|
|
838
|
-
*
|
|
839
747
|
* Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute.
|
|
840
748
|
|
|
841
749
|
*
|
|
@@ -849,7 +757,7 @@ export class Databases {
|
|
|
849
757
|
* @throws {AppwriteException}
|
|
850
758
|
* @returns {Promise<Models.AttributeEnum>}
|
|
851
759
|
*/
|
|
852
|
-
|
|
760
|
+
createEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum> {
|
|
853
761
|
if (typeof databaseId === 'undefined') {
|
|
854
762
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
855
763
|
}
|
|
@@ -888,10 +796,7 @@ export class Databases {
|
|
|
888
796
|
'content-type': 'application/json',
|
|
889
797
|
}
|
|
890
798
|
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
return await this.client.call(
|
|
799
|
+
return this.client.call(
|
|
895
800
|
'post',
|
|
896
801
|
uri,
|
|
897
802
|
apiHeaders,
|
|
@@ -899,8 +804,6 @@ export class Databases {
|
|
|
899
804
|
);
|
|
900
805
|
}
|
|
901
806
|
/**
|
|
902
|
-
* Update enum attribute
|
|
903
|
-
*
|
|
904
807
|
* Update an enum attribute. Changing the `default` value will not update already existing documents.
|
|
905
808
|
|
|
906
809
|
*
|
|
@@ -914,7 +817,7 @@ export class Databases {
|
|
|
914
817
|
* @throws {AppwriteException}
|
|
915
818
|
* @returns {Promise<Models.AttributeEnum>}
|
|
916
819
|
*/
|
|
917
|
-
|
|
820
|
+
updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEnum> {
|
|
918
821
|
if (typeof databaseId === 'undefined') {
|
|
919
822
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
920
823
|
}
|
|
@@ -953,10 +856,7 @@ export class Databases {
|
|
|
953
856
|
'content-type': 'application/json',
|
|
954
857
|
}
|
|
955
858
|
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
return await this.client.call(
|
|
859
|
+
return this.client.call(
|
|
960
860
|
'patch',
|
|
961
861
|
uri,
|
|
962
862
|
apiHeaders,
|
|
@@ -964,8 +864,6 @@ export class Databases {
|
|
|
964
864
|
);
|
|
965
865
|
}
|
|
966
866
|
/**
|
|
967
|
-
* Create float attribute
|
|
968
|
-
*
|
|
969
867
|
* Create a float attribute. Optionally, minimum and maximum values can be provided.
|
|
970
868
|
|
|
971
869
|
*
|
|
@@ -980,7 +878,7 @@ export class Databases {
|
|
|
980
878
|
* @throws {AppwriteException}
|
|
981
879
|
* @returns {Promise<Models.AttributeFloat>}
|
|
982
880
|
*/
|
|
983
|
-
|
|
881
|
+
createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeFloat> {
|
|
984
882
|
if (typeof databaseId === 'undefined') {
|
|
985
883
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
986
884
|
}
|
|
@@ -1019,10 +917,7 @@ export class Databases {
|
|
|
1019
917
|
'content-type': 'application/json',
|
|
1020
918
|
}
|
|
1021
919
|
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
return await this.client.call(
|
|
920
|
+
return this.client.call(
|
|
1026
921
|
'post',
|
|
1027
922
|
uri,
|
|
1028
923
|
apiHeaders,
|
|
@@ -1030,8 +925,6 @@ export class Databases {
|
|
|
1030
925
|
);
|
|
1031
926
|
}
|
|
1032
927
|
/**
|
|
1033
|
-
* Update float attribute
|
|
1034
|
-
*
|
|
1035
928
|
* Update a float attribute. Changing the `default` value will not update already existing documents.
|
|
1036
929
|
|
|
1037
930
|
*
|
|
@@ -1046,7 +939,7 @@ export class Databases {
|
|
|
1046
939
|
* @throws {AppwriteException}
|
|
1047
940
|
* @returns {Promise<Models.AttributeFloat>}
|
|
1048
941
|
*/
|
|
1049
|
-
|
|
942
|
+
updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeFloat> {
|
|
1050
943
|
if (typeof databaseId === 'undefined') {
|
|
1051
944
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1052
945
|
}
|
|
@@ -1085,10 +978,7 @@ export class Databases {
|
|
|
1085
978
|
'content-type': 'application/json',
|
|
1086
979
|
}
|
|
1087
980
|
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
return await this.client.call(
|
|
981
|
+
return this.client.call(
|
|
1092
982
|
'patch',
|
|
1093
983
|
uri,
|
|
1094
984
|
apiHeaders,
|
|
@@ -1096,8 +986,6 @@ export class Databases {
|
|
|
1096
986
|
);
|
|
1097
987
|
}
|
|
1098
988
|
/**
|
|
1099
|
-
* Create integer attribute
|
|
1100
|
-
*
|
|
1101
989
|
* Create an integer attribute. Optionally, minimum and maximum values can be provided.
|
|
1102
990
|
|
|
1103
991
|
*
|
|
@@ -1112,7 +1000,7 @@ export class Databases {
|
|
|
1112
1000
|
* @throws {AppwriteException}
|
|
1113
1001
|
* @returns {Promise<Models.AttributeInteger>}
|
|
1114
1002
|
*/
|
|
1115
|
-
|
|
1003
|
+
createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger> {
|
|
1116
1004
|
if (typeof databaseId === 'undefined') {
|
|
1117
1005
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1118
1006
|
}
|
|
@@ -1151,10 +1039,7 @@ export class Databases {
|
|
|
1151
1039
|
'content-type': 'application/json',
|
|
1152
1040
|
}
|
|
1153
1041
|
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
return await this.client.call(
|
|
1042
|
+
return this.client.call(
|
|
1158
1043
|
'post',
|
|
1159
1044
|
uri,
|
|
1160
1045
|
apiHeaders,
|
|
@@ -1162,8 +1047,6 @@ export class Databases {
|
|
|
1162
1047
|
);
|
|
1163
1048
|
}
|
|
1164
1049
|
/**
|
|
1165
|
-
* Update integer attribute
|
|
1166
|
-
*
|
|
1167
1050
|
* Update an integer attribute. Changing the `default` value will not update already existing documents.
|
|
1168
1051
|
|
|
1169
1052
|
*
|
|
@@ -1178,7 +1061,7 @@ export class Databases {
|
|
|
1178
1061
|
* @throws {AppwriteException}
|
|
1179
1062
|
* @returns {Promise<Models.AttributeInteger>}
|
|
1180
1063
|
*/
|
|
1181
|
-
|
|
1064
|
+
updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeInteger> {
|
|
1182
1065
|
if (typeof databaseId === 'undefined') {
|
|
1183
1066
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1184
1067
|
}
|
|
@@ -1217,10 +1100,7 @@ export class Databases {
|
|
|
1217
1100
|
'content-type': 'application/json',
|
|
1218
1101
|
}
|
|
1219
1102
|
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
return await this.client.call(
|
|
1103
|
+
return this.client.call(
|
|
1224
1104
|
'patch',
|
|
1225
1105
|
uri,
|
|
1226
1106
|
apiHeaders,
|
|
@@ -1228,8 +1108,6 @@ export class Databases {
|
|
|
1228
1108
|
);
|
|
1229
1109
|
}
|
|
1230
1110
|
/**
|
|
1231
|
-
* Create IP address attribute
|
|
1232
|
-
*
|
|
1233
1111
|
* Create IP address attribute.
|
|
1234
1112
|
|
|
1235
1113
|
*
|
|
@@ -1242,7 +1120,7 @@ export class Databases {
|
|
|
1242
1120
|
* @throws {AppwriteException}
|
|
1243
1121
|
* @returns {Promise<Models.AttributeIp>}
|
|
1244
1122
|
*/
|
|
1245
|
-
|
|
1123
|
+
createIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp> {
|
|
1246
1124
|
if (typeof databaseId === 'undefined') {
|
|
1247
1125
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1248
1126
|
}
|
|
@@ -1275,10 +1153,7 @@ export class Databases {
|
|
|
1275
1153
|
'content-type': 'application/json',
|
|
1276
1154
|
}
|
|
1277
1155
|
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
return await this.client.call(
|
|
1156
|
+
return this.client.call(
|
|
1282
1157
|
'post',
|
|
1283
1158
|
uri,
|
|
1284
1159
|
apiHeaders,
|
|
@@ -1286,8 +1161,6 @@ export class Databases {
|
|
|
1286
1161
|
);
|
|
1287
1162
|
}
|
|
1288
1163
|
/**
|
|
1289
|
-
* Update IP address attribute
|
|
1290
|
-
*
|
|
1291
1164
|
* Update an ip attribute. Changing the `default` value will not update already existing documents.
|
|
1292
1165
|
|
|
1293
1166
|
*
|
|
@@ -1300,7 +1173,7 @@ export class Databases {
|
|
|
1300
1173
|
* @throws {AppwriteException}
|
|
1301
1174
|
* @returns {Promise<Models.AttributeIp>}
|
|
1302
1175
|
*/
|
|
1303
|
-
|
|
1176
|
+
updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeIp> {
|
|
1304
1177
|
if (typeof databaseId === 'undefined') {
|
|
1305
1178
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1306
1179
|
}
|
|
@@ -1333,10 +1206,7 @@ export class Databases {
|
|
|
1333
1206
|
'content-type': 'application/json',
|
|
1334
1207
|
}
|
|
1335
1208
|
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
return await this.client.call(
|
|
1209
|
+
return this.client.call(
|
|
1340
1210
|
'patch',
|
|
1341
1211
|
uri,
|
|
1342
1212
|
apiHeaders,
|
|
@@ -1344,8 +1214,6 @@ export class Databases {
|
|
|
1344
1214
|
);
|
|
1345
1215
|
}
|
|
1346
1216
|
/**
|
|
1347
|
-
* Create relationship attribute
|
|
1348
|
-
*
|
|
1349
1217
|
* Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1350
1218
|
|
|
1351
1219
|
*
|
|
@@ -1360,7 +1228,7 @@ export class Databases {
|
|
|
1360
1228
|
* @throws {AppwriteException}
|
|
1361
1229
|
* @returns {Promise<Models.AttributeRelationship>}
|
|
1362
1230
|
*/
|
|
1363
|
-
|
|
1231
|
+
createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise<Models.AttributeRelationship> {
|
|
1364
1232
|
if (typeof databaseId === 'undefined') {
|
|
1365
1233
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1366
1234
|
}
|
|
@@ -1399,10 +1267,7 @@ export class Databases {
|
|
|
1399
1267
|
'content-type': 'application/json',
|
|
1400
1268
|
}
|
|
1401
1269
|
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
return await this.client.call(
|
|
1270
|
+
return this.client.call(
|
|
1406
1271
|
'post',
|
|
1407
1272
|
uri,
|
|
1408
1273
|
apiHeaders,
|
|
@@ -1410,8 +1275,6 @@ export class Databases {
|
|
|
1410
1275
|
);
|
|
1411
1276
|
}
|
|
1412
1277
|
/**
|
|
1413
|
-
* Create string attribute
|
|
1414
|
-
*
|
|
1415
1278
|
* Create a string attribute.
|
|
1416
1279
|
|
|
1417
1280
|
*
|
|
@@ -1426,7 +1289,7 @@ export class Databases {
|
|
|
1426
1289
|
* @throws {AppwriteException}
|
|
1427
1290
|
* @returns {Promise<Models.AttributeString>}
|
|
1428
1291
|
*/
|
|
1429
|
-
|
|
1292
|
+
createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeString> {
|
|
1430
1293
|
if (typeof databaseId === 'undefined') {
|
|
1431
1294
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1432
1295
|
}
|
|
@@ -1468,10 +1331,7 @@ export class Databases {
|
|
|
1468
1331
|
'content-type': 'application/json',
|
|
1469
1332
|
}
|
|
1470
1333
|
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
return await this.client.call(
|
|
1334
|
+
return this.client.call(
|
|
1475
1335
|
'post',
|
|
1476
1336
|
uri,
|
|
1477
1337
|
apiHeaders,
|
|
@@ -1479,8 +1339,6 @@ export class Databases {
|
|
|
1479
1339
|
);
|
|
1480
1340
|
}
|
|
1481
1341
|
/**
|
|
1482
|
-
* Update string attribute
|
|
1483
|
-
*
|
|
1484
1342
|
* Update a string attribute. Changing the `default` value will not update already existing documents.
|
|
1485
1343
|
|
|
1486
1344
|
*
|
|
@@ -1494,7 +1352,7 @@ export class Databases {
|
|
|
1494
1352
|
* @throws {AppwriteException}
|
|
1495
1353
|
* @returns {Promise<Models.AttributeString>}
|
|
1496
1354
|
*/
|
|
1497
|
-
|
|
1355
|
+
updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString> {
|
|
1498
1356
|
if (typeof databaseId === 'undefined') {
|
|
1499
1357
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1500
1358
|
}
|
|
@@ -1530,10 +1388,7 @@ export class Databases {
|
|
|
1530
1388
|
'content-type': 'application/json',
|
|
1531
1389
|
}
|
|
1532
1390
|
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
return await this.client.call(
|
|
1391
|
+
return this.client.call(
|
|
1537
1392
|
'patch',
|
|
1538
1393
|
uri,
|
|
1539
1394
|
apiHeaders,
|
|
@@ -1541,8 +1396,6 @@ export class Databases {
|
|
|
1541
1396
|
);
|
|
1542
1397
|
}
|
|
1543
1398
|
/**
|
|
1544
|
-
* Create URL attribute
|
|
1545
|
-
*
|
|
1546
1399
|
* Create a URL attribute.
|
|
1547
1400
|
|
|
1548
1401
|
*
|
|
@@ -1555,7 +1408,7 @@ export class Databases {
|
|
|
1555
1408
|
* @throws {AppwriteException}
|
|
1556
1409
|
* @returns {Promise<Models.AttributeUrl>}
|
|
1557
1410
|
*/
|
|
1558
|
-
|
|
1411
|
+
createUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl> {
|
|
1559
1412
|
if (typeof databaseId === 'undefined') {
|
|
1560
1413
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1561
1414
|
}
|
|
@@ -1588,10 +1441,7 @@ export class Databases {
|
|
|
1588
1441
|
'content-type': 'application/json',
|
|
1589
1442
|
}
|
|
1590
1443
|
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
return await this.client.call(
|
|
1444
|
+
return this.client.call(
|
|
1595
1445
|
'post',
|
|
1596
1446
|
uri,
|
|
1597
1447
|
apiHeaders,
|
|
@@ -1599,8 +1449,6 @@ export class Databases {
|
|
|
1599
1449
|
);
|
|
1600
1450
|
}
|
|
1601
1451
|
/**
|
|
1602
|
-
* Update URL attribute
|
|
1603
|
-
*
|
|
1604
1452
|
* Update an url attribute. Changing the `default` value will not update already existing documents.
|
|
1605
1453
|
|
|
1606
1454
|
*
|
|
@@ -1613,7 +1461,7 @@ export class Databases {
|
|
|
1613
1461
|
* @throws {AppwriteException}
|
|
1614
1462
|
* @returns {Promise<Models.AttributeUrl>}
|
|
1615
1463
|
*/
|
|
1616
|
-
|
|
1464
|
+
updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeUrl> {
|
|
1617
1465
|
if (typeof databaseId === 'undefined') {
|
|
1618
1466
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1619
1467
|
}
|
|
@@ -1646,10 +1494,7 @@ export class Databases {
|
|
|
1646
1494
|
'content-type': 'application/json',
|
|
1647
1495
|
}
|
|
1648
1496
|
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
return await this.client.call(
|
|
1497
|
+
return this.client.call(
|
|
1653
1498
|
'patch',
|
|
1654
1499
|
uri,
|
|
1655
1500
|
apiHeaders,
|
|
@@ -1657,8 +1502,6 @@ export class Databases {
|
|
|
1657
1502
|
);
|
|
1658
1503
|
}
|
|
1659
1504
|
/**
|
|
1660
|
-
* Get attribute
|
|
1661
|
-
*
|
|
1662
1505
|
* Get attribute by ID.
|
|
1663
1506
|
*
|
|
1664
1507
|
* @param {string} databaseId
|
|
@@ -1667,7 +1510,7 @@ export class Databases {
|
|
|
1667
1510
|
* @throws {AppwriteException}
|
|
1668
1511
|
* @returns {Promise<{}>}
|
|
1669
1512
|
*/
|
|
1670
|
-
|
|
1513
|
+
getAttribute(databaseId: string, collectionId: string, key: string): Promise<{}> {
|
|
1671
1514
|
if (typeof databaseId === 'undefined') {
|
|
1672
1515
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1673
1516
|
}
|
|
@@ -1685,10 +1528,7 @@ export class Databases {
|
|
|
1685
1528
|
'content-type': 'application/json',
|
|
1686
1529
|
}
|
|
1687
1530
|
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
return await this.client.call(
|
|
1531
|
+
return this.client.call(
|
|
1692
1532
|
'get',
|
|
1693
1533
|
uri,
|
|
1694
1534
|
apiHeaders,
|
|
@@ -1696,8 +1536,6 @@ export class Databases {
|
|
|
1696
1536
|
);
|
|
1697
1537
|
}
|
|
1698
1538
|
/**
|
|
1699
|
-
* Delete attribute
|
|
1700
|
-
*
|
|
1701
1539
|
* Deletes an attribute.
|
|
1702
1540
|
*
|
|
1703
1541
|
* @param {string} databaseId
|
|
@@ -1706,7 +1544,7 @@ export class Databases {
|
|
|
1706
1544
|
* @throws {AppwriteException}
|
|
1707
1545
|
* @returns {Promise<{}>}
|
|
1708
1546
|
*/
|
|
1709
|
-
|
|
1547
|
+
deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<{}> {
|
|
1710
1548
|
if (typeof databaseId === 'undefined') {
|
|
1711
1549
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1712
1550
|
}
|
|
@@ -1724,10 +1562,7 @@ export class Databases {
|
|
|
1724
1562
|
'content-type': 'application/json',
|
|
1725
1563
|
}
|
|
1726
1564
|
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
return await this.client.call(
|
|
1565
|
+
return this.client.call(
|
|
1731
1566
|
'delete',
|
|
1732
1567
|
uri,
|
|
1733
1568
|
apiHeaders,
|
|
@@ -1735,8 +1570,6 @@ export class Databases {
|
|
|
1735
1570
|
);
|
|
1736
1571
|
}
|
|
1737
1572
|
/**
|
|
1738
|
-
* Update relationship attribute
|
|
1739
|
-
*
|
|
1740
1573
|
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1741
1574
|
|
|
1742
1575
|
*
|
|
@@ -1748,7 +1581,7 @@ export class Databases {
|
|
|
1748
1581
|
* @throws {AppwriteException}
|
|
1749
1582
|
* @returns {Promise<Models.AttributeRelationship>}
|
|
1750
1583
|
*/
|
|
1751
|
-
|
|
1584
|
+
updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise<Models.AttributeRelationship> {
|
|
1752
1585
|
if (typeof databaseId === 'undefined') {
|
|
1753
1586
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1754
1587
|
}
|
|
@@ -1772,10 +1605,7 @@ export class Databases {
|
|
|
1772
1605
|
'content-type': 'application/json',
|
|
1773
1606
|
}
|
|
1774
1607
|
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
return await this.client.call(
|
|
1608
|
+
return this.client.call(
|
|
1779
1609
|
'patch',
|
|
1780
1610
|
uri,
|
|
1781
1611
|
apiHeaders,
|
|
@@ -1783,8 +1613,6 @@ export class Databases {
|
|
|
1783
1613
|
);
|
|
1784
1614
|
}
|
|
1785
1615
|
/**
|
|
1786
|
-
* List documents
|
|
1787
|
-
*
|
|
1788
1616
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
1789
1617
|
*
|
|
1790
1618
|
* @param {string} databaseId
|
|
@@ -1793,7 +1621,7 @@ export class Databases {
|
|
|
1793
1621
|
* @throws {AppwriteException}
|
|
1794
1622
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1795
1623
|
*/
|
|
1796
|
-
|
|
1624
|
+
listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
|
|
1797
1625
|
if (typeof databaseId === 'undefined') {
|
|
1798
1626
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1799
1627
|
}
|
|
@@ -1811,10 +1639,7 @@ export class Databases {
|
|
|
1811
1639
|
'content-type': 'application/json',
|
|
1812
1640
|
}
|
|
1813
1641
|
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
return await this.client.call(
|
|
1642
|
+
return this.client.call(
|
|
1818
1643
|
'get',
|
|
1819
1644
|
uri,
|
|
1820
1645
|
apiHeaders,
|
|
@@ -1822,8 +1647,6 @@ export class Databases {
|
|
|
1822
1647
|
);
|
|
1823
1648
|
}
|
|
1824
1649
|
/**
|
|
1825
|
-
* Create document
|
|
1826
|
-
*
|
|
1827
1650
|
* Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
|
|
1828
1651
|
|
|
1829
1652
|
*
|
|
@@ -1835,7 +1658,7 @@ export class Databases {
|
|
|
1835
1658
|
* @throws {AppwriteException}
|
|
1836
1659
|
* @returns {Promise<Document>}
|
|
1837
1660
|
*/
|
|
1838
|
-
|
|
1661
|
+
createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document> {
|
|
1839
1662
|
if (typeof databaseId === 'undefined') {
|
|
1840
1663
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1841
1664
|
}
|
|
@@ -1865,10 +1688,7 @@ export class Databases {
|
|
|
1865
1688
|
'content-type': 'application/json',
|
|
1866
1689
|
}
|
|
1867
1690
|
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
return await this.client.call(
|
|
1691
|
+
return this.client.call(
|
|
1872
1692
|
'post',
|
|
1873
1693
|
uri,
|
|
1874
1694
|
apiHeaders,
|
|
@@ -1876,8 +1696,6 @@ export class Databases {
|
|
|
1876
1696
|
);
|
|
1877
1697
|
}
|
|
1878
1698
|
/**
|
|
1879
|
-
* Get document
|
|
1880
|
-
*
|
|
1881
1699
|
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
1882
1700
|
*
|
|
1883
1701
|
* @param {string} databaseId
|
|
@@ -1887,7 +1705,7 @@ export class Databases {
|
|
|
1887
1705
|
* @throws {AppwriteException}
|
|
1888
1706
|
* @returns {Promise<Document>}
|
|
1889
1707
|
*/
|
|
1890
|
-
|
|
1708
|
+
getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document> {
|
|
1891
1709
|
if (typeof databaseId === 'undefined') {
|
|
1892
1710
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1893
1711
|
}
|
|
@@ -1908,10 +1726,7 @@ export class Databases {
|
|
|
1908
1726
|
'content-type': 'application/json',
|
|
1909
1727
|
}
|
|
1910
1728
|
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
return await this.client.call(
|
|
1729
|
+
return this.client.call(
|
|
1915
1730
|
'get',
|
|
1916
1731
|
uri,
|
|
1917
1732
|
apiHeaders,
|
|
@@ -1919,8 +1734,6 @@ export class Databases {
|
|
|
1919
1734
|
);
|
|
1920
1735
|
}
|
|
1921
1736
|
/**
|
|
1922
|
-
* Update document
|
|
1923
|
-
*
|
|
1924
1737
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
1925
1738
|
*
|
|
1926
1739
|
* @param {string} databaseId
|
|
@@ -1931,7 +1744,7 @@ export class Databases {
|
|
|
1931
1744
|
* @throws {AppwriteException}
|
|
1932
1745
|
* @returns {Promise<Document>}
|
|
1933
1746
|
*/
|
|
1934
|
-
|
|
1747
|
+
updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document> {
|
|
1935
1748
|
if (typeof databaseId === 'undefined') {
|
|
1936
1749
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1937
1750
|
}
|
|
@@ -1955,10 +1768,7 @@ export class Databases {
|
|
|
1955
1768
|
'content-type': 'application/json',
|
|
1956
1769
|
}
|
|
1957
1770
|
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
return await this.client.call(
|
|
1771
|
+
return this.client.call(
|
|
1962
1772
|
'patch',
|
|
1963
1773
|
uri,
|
|
1964
1774
|
apiHeaders,
|
|
@@ -1966,8 +1776,6 @@ export class Databases {
|
|
|
1966
1776
|
);
|
|
1967
1777
|
}
|
|
1968
1778
|
/**
|
|
1969
|
-
* Delete document
|
|
1970
|
-
*
|
|
1971
1779
|
* Delete a document by its unique ID.
|
|
1972
1780
|
*
|
|
1973
1781
|
* @param {string} databaseId
|
|
@@ -1976,7 +1784,7 @@ export class Databases {
|
|
|
1976
1784
|
* @throws {AppwriteException}
|
|
1977
1785
|
* @returns {Promise<{}>}
|
|
1978
1786
|
*/
|
|
1979
|
-
|
|
1787
|
+
deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}> {
|
|
1980
1788
|
if (typeof databaseId === 'undefined') {
|
|
1981
1789
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1982
1790
|
}
|
|
@@ -1994,10 +1802,7 @@ export class Databases {
|
|
|
1994
1802
|
'content-type': 'application/json',
|
|
1995
1803
|
}
|
|
1996
1804
|
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
return await this.client.call(
|
|
1805
|
+
return this.client.call(
|
|
2001
1806
|
'delete',
|
|
2002
1807
|
uri,
|
|
2003
1808
|
apiHeaders,
|
|
@@ -2005,8 +1810,6 @@ export class Databases {
|
|
|
2005
1810
|
);
|
|
2006
1811
|
}
|
|
2007
1812
|
/**
|
|
2008
|
-
* List document logs
|
|
2009
|
-
*
|
|
2010
1813
|
* Get the document activity logs list by its unique ID.
|
|
2011
1814
|
*
|
|
2012
1815
|
* @param {string} databaseId
|
|
@@ -2016,7 +1819,7 @@ export class Databases {
|
|
|
2016
1819
|
* @throws {AppwriteException}
|
|
2017
1820
|
* @returns {Promise<Models.LogList>}
|
|
2018
1821
|
*/
|
|
2019
|
-
|
|
1822
|
+
listDocumentLogs(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Models.LogList> {
|
|
2020
1823
|
if (typeof databaseId === 'undefined') {
|
|
2021
1824
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2022
1825
|
}
|
|
@@ -2037,10 +1840,7 @@ export class Databases {
|
|
|
2037
1840
|
'content-type': 'application/json',
|
|
2038
1841
|
}
|
|
2039
1842
|
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
return await this.client.call(
|
|
1843
|
+
return this.client.call(
|
|
2044
1844
|
'get',
|
|
2045
1845
|
uri,
|
|
2046
1846
|
apiHeaders,
|
|
@@ -2048,8 +1848,6 @@ export class Databases {
|
|
|
2048
1848
|
);
|
|
2049
1849
|
}
|
|
2050
1850
|
/**
|
|
2051
|
-
* List indexes
|
|
2052
|
-
*
|
|
2053
1851
|
* List indexes in the collection.
|
|
2054
1852
|
*
|
|
2055
1853
|
* @param {string} databaseId
|
|
@@ -2058,7 +1856,7 @@ export class Databases {
|
|
|
2058
1856
|
* @throws {AppwriteException}
|
|
2059
1857
|
* @returns {Promise<Models.IndexList>}
|
|
2060
1858
|
*/
|
|
2061
|
-
|
|
1859
|
+
listIndexes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.IndexList> {
|
|
2062
1860
|
if (typeof databaseId === 'undefined') {
|
|
2063
1861
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2064
1862
|
}
|
|
@@ -2076,10 +1874,7 @@ export class Databases {
|
|
|
2076
1874
|
'content-type': 'application/json',
|
|
2077
1875
|
}
|
|
2078
1876
|
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
return await this.client.call(
|
|
1877
|
+
return this.client.call(
|
|
2083
1878
|
'get',
|
|
2084
1879
|
uri,
|
|
2085
1880
|
apiHeaders,
|
|
@@ -2087,8 +1882,6 @@ export class Databases {
|
|
|
2087
1882
|
);
|
|
2088
1883
|
}
|
|
2089
1884
|
/**
|
|
2090
|
-
* Create index
|
|
2091
|
-
*
|
|
2092
1885
|
* Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
|
|
2093
1886
|
Attributes can be `key`, `fulltext`, and `unique`.
|
|
2094
1887
|
*
|
|
@@ -2101,7 +1894,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2101
1894
|
* @throws {AppwriteException}
|
|
2102
1895
|
* @returns {Promise<Models.Index>}
|
|
2103
1896
|
*/
|
|
2104
|
-
|
|
1897
|
+
createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[]): Promise<Models.Index> {
|
|
2105
1898
|
if (typeof databaseId === 'undefined') {
|
|
2106
1899
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2107
1900
|
}
|
|
@@ -2137,10 +1930,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2137
1930
|
'content-type': 'application/json',
|
|
2138
1931
|
}
|
|
2139
1932
|
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
return await this.client.call(
|
|
1933
|
+
return this.client.call(
|
|
2144
1934
|
'post',
|
|
2145
1935
|
uri,
|
|
2146
1936
|
apiHeaders,
|
|
@@ -2148,8 +1938,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2148
1938
|
);
|
|
2149
1939
|
}
|
|
2150
1940
|
/**
|
|
2151
|
-
* Get index
|
|
2152
|
-
*
|
|
2153
1941
|
* Get index by ID.
|
|
2154
1942
|
*
|
|
2155
1943
|
* @param {string} databaseId
|
|
@@ -2158,7 +1946,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2158
1946
|
* @throws {AppwriteException}
|
|
2159
1947
|
* @returns {Promise<Models.Index>}
|
|
2160
1948
|
*/
|
|
2161
|
-
|
|
1949
|
+
getIndex(databaseId: string, collectionId: string, key: string): Promise<Models.Index> {
|
|
2162
1950
|
if (typeof databaseId === 'undefined') {
|
|
2163
1951
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2164
1952
|
}
|
|
@@ -2176,10 +1964,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2176
1964
|
'content-type': 'application/json',
|
|
2177
1965
|
}
|
|
2178
1966
|
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
return await this.client.call(
|
|
1967
|
+
return this.client.call(
|
|
2183
1968
|
'get',
|
|
2184
1969
|
uri,
|
|
2185
1970
|
apiHeaders,
|
|
@@ -2187,8 +1972,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2187
1972
|
);
|
|
2188
1973
|
}
|
|
2189
1974
|
/**
|
|
2190
|
-
* Delete index
|
|
2191
|
-
*
|
|
2192
1975
|
* Delete an index.
|
|
2193
1976
|
*
|
|
2194
1977
|
* @param {string} databaseId
|
|
@@ -2197,7 +1980,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2197
1980
|
* @throws {AppwriteException}
|
|
2198
1981
|
* @returns {Promise<{}>}
|
|
2199
1982
|
*/
|
|
2200
|
-
|
|
1983
|
+
deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}> {
|
|
2201
1984
|
if (typeof databaseId === 'undefined') {
|
|
2202
1985
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2203
1986
|
}
|
|
@@ -2215,10 +1998,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2215
1998
|
'content-type': 'application/json',
|
|
2216
1999
|
}
|
|
2217
2000
|
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
return await this.client.call(
|
|
2001
|
+
return this.client.call(
|
|
2222
2002
|
'delete',
|
|
2223
2003
|
uri,
|
|
2224
2004
|
apiHeaders,
|
|
@@ -2226,8 +2006,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2226
2006
|
);
|
|
2227
2007
|
}
|
|
2228
2008
|
/**
|
|
2229
|
-
* List collection logs
|
|
2230
|
-
*
|
|
2231
2009
|
* Get the collection activity logs list by its unique ID.
|
|
2232
2010
|
*
|
|
2233
2011
|
* @param {string} databaseId
|
|
@@ -2236,7 +2014,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2236
2014
|
* @throws {AppwriteException}
|
|
2237
2015
|
* @returns {Promise<Models.LogList>}
|
|
2238
2016
|
*/
|
|
2239
|
-
|
|
2017
|
+
listCollectionLogs(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.LogList> {
|
|
2240
2018
|
if (typeof databaseId === 'undefined') {
|
|
2241
2019
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2242
2020
|
}
|
|
@@ -2254,10 +2032,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2254
2032
|
'content-type': 'application/json',
|
|
2255
2033
|
}
|
|
2256
2034
|
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
return await this.client.call(
|
|
2035
|
+
return this.client.call(
|
|
2261
2036
|
'get',
|
|
2262
2037
|
uri,
|
|
2263
2038
|
apiHeaders,
|
|
@@ -2265,8 +2040,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2265
2040
|
);
|
|
2266
2041
|
}
|
|
2267
2042
|
/**
|
|
2268
|
-
* Get collection usage stats
|
|
2269
|
-
*
|
|
2270
2043
|
* Get usage metrics and statistics for a collection. Returning the total number of documents. 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.
|
|
2271
2044
|
*
|
|
2272
2045
|
* @param {string} databaseId
|
|
@@ -2275,7 +2048,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2275
2048
|
* @throws {AppwriteException}
|
|
2276
2049
|
* @returns {Promise<Models.UsageCollection>}
|
|
2277
2050
|
*/
|
|
2278
|
-
|
|
2051
|
+
getCollectionUsage(databaseId: string, collectionId: string, range?: DatabaseUsageRange): Promise<Models.UsageCollection> {
|
|
2279
2052
|
if (typeof databaseId === 'undefined') {
|
|
2280
2053
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2281
2054
|
}
|
|
@@ -2293,10 +2066,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2293
2066
|
'content-type': 'application/json',
|
|
2294
2067
|
}
|
|
2295
2068
|
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
return await this.client.call(
|
|
2069
|
+
return this.client.call(
|
|
2300
2070
|
'get',
|
|
2301
2071
|
uri,
|
|
2302
2072
|
apiHeaders,
|
|
@@ -2304,8 +2074,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2304
2074
|
);
|
|
2305
2075
|
}
|
|
2306
2076
|
/**
|
|
2307
|
-
* List database logs
|
|
2308
|
-
*
|
|
2309
2077
|
* Get the database activity logs list by its unique ID.
|
|
2310
2078
|
*
|
|
2311
2079
|
* @param {string} databaseId
|
|
@@ -2313,7 +2081,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2313
2081
|
* @throws {AppwriteException}
|
|
2314
2082
|
* @returns {Promise<Models.LogList>}
|
|
2315
2083
|
*/
|
|
2316
|
-
|
|
2084
|
+
listLogs(databaseId: string, queries?: string[]): Promise<Models.LogList> {
|
|
2317
2085
|
if (typeof databaseId === 'undefined') {
|
|
2318
2086
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2319
2087
|
}
|
|
@@ -2328,10 +2096,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2328
2096
|
'content-type': 'application/json',
|
|
2329
2097
|
}
|
|
2330
2098
|
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
return await this.client.call(
|
|
2099
|
+
return this.client.call(
|
|
2335
2100
|
'get',
|
|
2336
2101
|
uri,
|
|
2337
2102
|
apiHeaders,
|
|
@@ -2339,8 +2104,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2339
2104
|
);
|
|
2340
2105
|
}
|
|
2341
2106
|
/**
|
|
2342
|
-
* Get database usage stats
|
|
2343
|
-
*
|
|
2344
2107
|
* Get usage metrics and statistics for a database. You can view the total number of collections, documents, and 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.
|
|
2345
2108
|
*
|
|
2346
2109
|
* @param {string} databaseId
|
|
@@ -2348,7 +2111,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2348
2111
|
* @throws {AppwriteException}
|
|
2349
2112
|
* @returns {Promise<Models.UsageDatabase>}
|
|
2350
2113
|
*/
|
|
2351
|
-
|
|
2114
|
+
getDatabaseUsage(databaseId: string, range?: DatabaseUsageRange): Promise<Models.UsageDatabase> {
|
|
2352
2115
|
if (typeof databaseId === 'undefined') {
|
|
2353
2116
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2354
2117
|
}
|
|
@@ -2363,10 +2126,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2363
2126
|
'content-type': 'application/json',
|
|
2364
2127
|
}
|
|
2365
2128
|
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
return await this.client.call(
|
|
2129
|
+
return this.client.call(
|
|
2370
2130
|
'get',
|
|
2371
2131
|
uri,
|
|
2372
2132
|
apiHeaders,
|