@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
|
@@ -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
|
*
|
|
@@ -1039,14 +932,14 @@ export class Databases {
|
|
|
1039
932
|
* @param {string} collectionId
|
|
1040
933
|
* @param {string} key
|
|
1041
934
|
* @param {boolean} required
|
|
935
|
+
* @param {number} xdefault
|
|
1042
936
|
* @param {number} min
|
|
1043
937
|
* @param {number} max
|
|
1044
|
-
* @param {number} xdefault
|
|
1045
938
|
* @param {string} newKey
|
|
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
|
}
|
|
@@ -1059,12 +952,6 @@ export class Databases {
|
|
|
1059
952
|
if (typeof required === 'undefined') {
|
|
1060
953
|
throw new AppwriteException('Missing required parameter: "required"');
|
|
1061
954
|
}
|
|
1062
|
-
if (typeof min === 'undefined') {
|
|
1063
|
-
throw new AppwriteException('Missing required parameter: "min"');
|
|
1064
|
-
}
|
|
1065
|
-
if (typeof max === 'undefined') {
|
|
1066
|
-
throw new AppwriteException('Missing required parameter: "max"');
|
|
1067
|
-
}
|
|
1068
955
|
if (typeof xdefault === 'undefined') {
|
|
1069
956
|
throw new AppwriteException('Missing required parameter: "xdefault"');
|
|
1070
957
|
}
|
|
@@ -1091,10 +978,7 @@ export class Databases {
|
|
|
1091
978
|
'content-type': 'application/json',
|
|
1092
979
|
}
|
|
1093
980
|
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
return await this.client.call(
|
|
981
|
+
return this.client.call(
|
|
1098
982
|
'patch',
|
|
1099
983
|
uri,
|
|
1100
984
|
apiHeaders,
|
|
@@ -1102,8 +986,6 @@ export class Databases {
|
|
|
1102
986
|
);
|
|
1103
987
|
}
|
|
1104
988
|
/**
|
|
1105
|
-
* Create integer attribute
|
|
1106
|
-
*
|
|
1107
989
|
* Create an integer attribute. Optionally, minimum and maximum values can be provided.
|
|
1108
990
|
|
|
1109
991
|
*
|
|
@@ -1118,7 +1000,7 @@ export class Databases {
|
|
|
1118
1000
|
* @throws {AppwriteException}
|
|
1119
1001
|
* @returns {Promise<Models.AttributeInteger>}
|
|
1120
1002
|
*/
|
|
1121
|
-
|
|
1003
|
+
createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger> {
|
|
1122
1004
|
if (typeof databaseId === 'undefined') {
|
|
1123
1005
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1124
1006
|
}
|
|
@@ -1157,10 +1039,7 @@ export class Databases {
|
|
|
1157
1039
|
'content-type': 'application/json',
|
|
1158
1040
|
}
|
|
1159
1041
|
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
return await this.client.call(
|
|
1042
|
+
return this.client.call(
|
|
1164
1043
|
'post',
|
|
1165
1044
|
uri,
|
|
1166
1045
|
apiHeaders,
|
|
@@ -1168,8 +1047,6 @@ export class Databases {
|
|
|
1168
1047
|
);
|
|
1169
1048
|
}
|
|
1170
1049
|
/**
|
|
1171
|
-
* Update integer attribute
|
|
1172
|
-
*
|
|
1173
1050
|
* Update an integer attribute. Changing the `default` value will not update already existing documents.
|
|
1174
1051
|
|
|
1175
1052
|
*
|
|
@@ -1177,14 +1054,14 @@ export class Databases {
|
|
|
1177
1054
|
* @param {string} collectionId
|
|
1178
1055
|
* @param {string} key
|
|
1179
1056
|
* @param {boolean} required
|
|
1057
|
+
* @param {number} xdefault
|
|
1180
1058
|
* @param {number} min
|
|
1181
1059
|
* @param {number} max
|
|
1182
|
-
* @param {number} xdefault
|
|
1183
1060
|
* @param {string} newKey
|
|
1184
1061
|
* @throws {AppwriteException}
|
|
1185
1062
|
* @returns {Promise<Models.AttributeInteger>}
|
|
1186
1063
|
*/
|
|
1187
|
-
|
|
1064
|
+
updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeInteger> {
|
|
1188
1065
|
if (typeof databaseId === 'undefined') {
|
|
1189
1066
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1190
1067
|
}
|
|
@@ -1197,12 +1074,6 @@ export class Databases {
|
|
|
1197
1074
|
if (typeof required === 'undefined') {
|
|
1198
1075
|
throw new AppwriteException('Missing required parameter: "required"');
|
|
1199
1076
|
}
|
|
1200
|
-
if (typeof min === 'undefined') {
|
|
1201
|
-
throw new AppwriteException('Missing required parameter: "min"');
|
|
1202
|
-
}
|
|
1203
|
-
if (typeof max === 'undefined') {
|
|
1204
|
-
throw new AppwriteException('Missing required parameter: "max"');
|
|
1205
|
-
}
|
|
1206
1077
|
if (typeof xdefault === 'undefined') {
|
|
1207
1078
|
throw new AppwriteException('Missing required parameter: "xdefault"');
|
|
1208
1079
|
}
|
|
@@ -1229,10 +1100,7 @@ export class Databases {
|
|
|
1229
1100
|
'content-type': 'application/json',
|
|
1230
1101
|
}
|
|
1231
1102
|
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
return await this.client.call(
|
|
1103
|
+
return this.client.call(
|
|
1236
1104
|
'patch',
|
|
1237
1105
|
uri,
|
|
1238
1106
|
apiHeaders,
|
|
@@ -1240,8 +1108,6 @@ export class Databases {
|
|
|
1240
1108
|
);
|
|
1241
1109
|
}
|
|
1242
1110
|
/**
|
|
1243
|
-
* Create IP address attribute
|
|
1244
|
-
*
|
|
1245
1111
|
* Create IP address attribute.
|
|
1246
1112
|
|
|
1247
1113
|
*
|
|
@@ -1254,7 +1120,7 @@ export class Databases {
|
|
|
1254
1120
|
* @throws {AppwriteException}
|
|
1255
1121
|
* @returns {Promise<Models.AttributeIp>}
|
|
1256
1122
|
*/
|
|
1257
|
-
|
|
1123
|
+
createIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp> {
|
|
1258
1124
|
if (typeof databaseId === 'undefined') {
|
|
1259
1125
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1260
1126
|
}
|
|
@@ -1287,10 +1153,7 @@ export class Databases {
|
|
|
1287
1153
|
'content-type': 'application/json',
|
|
1288
1154
|
}
|
|
1289
1155
|
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
return await this.client.call(
|
|
1156
|
+
return this.client.call(
|
|
1294
1157
|
'post',
|
|
1295
1158
|
uri,
|
|
1296
1159
|
apiHeaders,
|
|
@@ -1298,8 +1161,6 @@ export class Databases {
|
|
|
1298
1161
|
);
|
|
1299
1162
|
}
|
|
1300
1163
|
/**
|
|
1301
|
-
* Update IP address attribute
|
|
1302
|
-
*
|
|
1303
1164
|
* Update an ip attribute. Changing the `default` value will not update already existing documents.
|
|
1304
1165
|
|
|
1305
1166
|
*
|
|
@@ -1312,7 +1173,7 @@ export class Databases {
|
|
|
1312
1173
|
* @throws {AppwriteException}
|
|
1313
1174
|
* @returns {Promise<Models.AttributeIp>}
|
|
1314
1175
|
*/
|
|
1315
|
-
|
|
1176
|
+
updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeIp> {
|
|
1316
1177
|
if (typeof databaseId === 'undefined') {
|
|
1317
1178
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1318
1179
|
}
|
|
@@ -1345,10 +1206,7 @@ export class Databases {
|
|
|
1345
1206
|
'content-type': 'application/json',
|
|
1346
1207
|
}
|
|
1347
1208
|
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
return await this.client.call(
|
|
1209
|
+
return this.client.call(
|
|
1352
1210
|
'patch',
|
|
1353
1211
|
uri,
|
|
1354
1212
|
apiHeaders,
|
|
@@ -1356,8 +1214,6 @@ export class Databases {
|
|
|
1356
1214
|
);
|
|
1357
1215
|
}
|
|
1358
1216
|
/**
|
|
1359
|
-
* Create relationship attribute
|
|
1360
|
-
*
|
|
1361
1217
|
* Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1362
1218
|
|
|
1363
1219
|
*
|
|
@@ -1372,7 +1228,7 @@ export class Databases {
|
|
|
1372
1228
|
* @throws {AppwriteException}
|
|
1373
1229
|
* @returns {Promise<Models.AttributeRelationship>}
|
|
1374
1230
|
*/
|
|
1375
|
-
|
|
1231
|
+
createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise<Models.AttributeRelationship> {
|
|
1376
1232
|
if (typeof databaseId === 'undefined') {
|
|
1377
1233
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1378
1234
|
}
|
|
@@ -1411,10 +1267,7 @@ export class Databases {
|
|
|
1411
1267
|
'content-type': 'application/json',
|
|
1412
1268
|
}
|
|
1413
1269
|
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
return await this.client.call(
|
|
1270
|
+
return this.client.call(
|
|
1418
1271
|
'post',
|
|
1419
1272
|
uri,
|
|
1420
1273
|
apiHeaders,
|
|
@@ -1422,8 +1275,6 @@ export class Databases {
|
|
|
1422
1275
|
);
|
|
1423
1276
|
}
|
|
1424
1277
|
/**
|
|
1425
|
-
* Create string attribute
|
|
1426
|
-
*
|
|
1427
1278
|
* Create a string attribute.
|
|
1428
1279
|
|
|
1429
1280
|
*
|
|
@@ -1438,7 +1289,7 @@ export class Databases {
|
|
|
1438
1289
|
* @throws {AppwriteException}
|
|
1439
1290
|
* @returns {Promise<Models.AttributeString>}
|
|
1440
1291
|
*/
|
|
1441
|
-
|
|
1292
|
+
createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeString> {
|
|
1442
1293
|
if (typeof databaseId === 'undefined') {
|
|
1443
1294
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1444
1295
|
}
|
|
@@ -1480,10 +1331,7 @@ export class Databases {
|
|
|
1480
1331
|
'content-type': 'application/json',
|
|
1481
1332
|
}
|
|
1482
1333
|
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
return await this.client.call(
|
|
1334
|
+
return this.client.call(
|
|
1487
1335
|
'post',
|
|
1488
1336
|
uri,
|
|
1489
1337
|
apiHeaders,
|
|
@@ -1491,8 +1339,6 @@ export class Databases {
|
|
|
1491
1339
|
);
|
|
1492
1340
|
}
|
|
1493
1341
|
/**
|
|
1494
|
-
* Update string attribute
|
|
1495
|
-
*
|
|
1496
1342
|
* Update a string attribute. Changing the `default` value will not update already existing documents.
|
|
1497
1343
|
|
|
1498
1344
|
*
|
|
@@ -1506,7 +1352,7 @@ export class Databases {
|
|
|
1506
1352
|
* @throws {AppwriteException}
|
|
1507
1353
|
* @returns {Promise<Models.AttributeString>}
|
|
1508
1354
|
*/
|
|
1509
|
-
|
|
1355
|
+
updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString> {
|
|
1510
1356
|
if (typeof databaseId === 'undefined') {
|
|
1511
1357
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1512
1358
|
}
|
|
@@ -1542,10 +1388,7 @@ export class Databases {
|
|
|
1542
1388
|
'content-type': 'application/json',
|
|
1543
1389
|
}
|
|
1544
1390
|
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
return await this.client.call(
|
|
1391
|
+
return this.client.call(
|
|
1549
1392
|
'patch',
|
|
1550
1393
|
uri,
|
|
1551
1394
|
apiHeaders,
|
|
@@ -1553,8 +1396,6 @@ export class Databases {
|
|
|
1553
1396
|
);
|
|
1554
1397
|
}
|
|
1555
1398
|
/**
|
|
1556
|
-
* Create URL attribute
|
|
1557
|
-
*
|
|
1558
1399
|
* Create a URL attribute.
|
|
1559
1400
|
|
|
1560
1401
|
*
|
|
@@ -1567,7 +1408,7 @@ export class Databases {
|
|
|
1567
1408
|
* @throws {AppwriteException}
|
|
1568
1409
|
* @returns {Promise<Models.AttributeUrl>}
|
|
1569
1410
|
*/
|
|
1570
|
-
|
|
1411
|
+
createUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl> {
|
|
1571
1412
|
if (typeof databaseId === 'undefined') {
|
|
1572
1413
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1573
1414
|
}
|
|
@@ -1600,10 +1441,7 @@ export class Databases {
|
|
|
1600
1441
|
'content-type': 'application/json',
|
|
1601
1442
|
}
|
|
1602
1443
|
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
return await this.client.call(
|
|
1444
|
+
return this.client.call(
|
|
1607
1445
|
'post',
|
|
1608
1446
|
uri,
|
|
1609
1447
|
apiHeaders,
|
|
@@ -1611,8 +1449,6 @@ export class Databases {
|
|
|
1611
1449
|
);
|
|
1612
1450
|
}
|
|
1613
1451
|
/**
|
|
1614
|
-
* Update URL attribute
|
|
1615
|
-
*
|
|
1616
1452
|
* Update an url attribute. Changing the `default` value will not update already existing documents.
|
|
1617
1453
|
|
|
1618
1454
|
*
|
|
@@ -1625,7 +1461,7 @@ export class Databases {
|
|
|
1625
1461
|
* @throws {AppwriteException}
|
|
1626
1462
|
* @returns {Promise<Models.AttributeUrl>}
|
|
1627
1463
|
*/
|
|
1628
|
-
|
|
1464
|
+
updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeUrl> {
|
|
1629
1465
|
if (typeof databaseId === 'undefined') {
|
|
1630
1466
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1631
1467
|
}
|
|
@@ -1658,10 +1494,7 @@ export class Databases {
|
|
|
1658
1494
|
'content-type': 'application/json',
|
|
1659
1495
|
}
|
|
1660
1496
|
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
return await this.client.call(
|
|
1497
|
+
return this.client.call(
|
|
1665
1498
|
'patch',
|
|
1666
1499
|
uri,
|
|
1667
1500
|
apiHeaders,
|
|
@@ -1669,8 +1502,6 @@ export class Databases {
|
|
|
1669
1502
|
);
|
|
1670
1503
|
}
|
|
1671
1504
|
/**
|
|
1672
|
-
* Get attribute
|
|
1673
|
-
*
|
|
1674
1505
|
* Get attribute by ID.
|
|
1675
1506
|
*
|
|
1676
1507
|
* @param {string} databaseId
|
|
@@ -1679,7 +1510,7 @@ export class Databases {
|
|
|
1679
1510
|
* @throws {AppwriteException}
|
|
1680
1511
|
* @returns {Promise<{}>}
|
|
1681
1512
|
*/
|
|
1682
|
-
|
|
1513
|
+
getAttribute(databaseId: string, collectionId: string, key: string): Promise<{}> {
|
|
1683
1514
|
if (typeof databaseId === 'undefined') {
|
|
1684
1515
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1685
1516
|
}
|
|
@@ -1697,10 +1528,7 @@ export class Databases {
|
|
|
1697
1528
|
'content-type': 'application/json',
|
|
1698
1529
|
}
|
|
1699
1530
|
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
return await this.client.call(
|
|
1531
|
+
return this.client.call(
|
|
1704
1532
|
'get',
|
|
1705
1533
|
uri,
|
|
1706
1534
|
apiHeaders,
|
|
@@ -1708,8 +1536,6 @@ export class Databases {
|
|
|
1708
1536
|
);
|
|
1709
1537
|
}
|
|
1710
1538
|
/**
|
|
1711
|
-
* Delete attribute
|
|
1712
|
-
*
|
|
1713
1539
|
* Deletes an attribute.
|
|
1714
1540
|
*
|
|
1715
1541
|
* @param {string} databaseId
|
|
@@ -1718,7 +1544,7 @@ export class Databases {
|
|
|
1718
1544
|
* @throws {AppwriteException}
|
|
1719
1545
|
* @returns {Promise<{}>}
|
|
1720
1546
|
*/
|
|
1721
|
-
|
|
1547
|
+
deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<{}> {
|
|
1722
1548
|
if (typeof databaseId === 'undefined') {
|
|
1723
1549
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1724
1550
|
}
|
|
@@ -1736,10 +1562,7 @@ export class Databases {
|
|
|
1736
1562
|
'content-type': 'application/json',
|
|
1737
1563
|
}
|
|
1738
1564
|
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
return await this.client.call(
|
|
1565
|
+
return this.client.call(
|
|
1743
1566
|
'delete',
|
|
1744
1567
|
uri,
|
|
1745
1568
|
apiHeaders,
|
|
@@ -1747,8 +1570,6 @@ export class Databases {
|
|
|
1747
1570
|
);
|
|
1748
1571
|
}
|
|
1749
1572
|
/**
|
|
1750
|
-
* Update relationship attribute
|
|
1751
|
-
*
|
|
1752
1573
|
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1753
1574
|
|
|
1754
1575
|
*
|
|
@@ -1760,7 +1581,7 @@ export class Databases {
|
|
|
1760
1581
|
* @throws {AppwriteException}
|
|
1761
1582
|
* @returns {Promise<Models.AttributeRelationship>}
|
|
1762
1583
|
*/
|
|
1763
|
-
|
|
1584
|
+
updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise<Models.AttributeRelationship> {
|
|
1764
1585
|
if (typeof databaseId === 'undefined') {
|
|
1765
1586
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1766
1587
|
}
|
|
@@ -1784,10 +1605,7 @@ export class Databases {
|
|
|
1784
1605
|
'content-type': 'application/json',
|
|
1785
1606
|
}
|
|
1786
1607
|
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
return await this.client.call(
|
|
1608
|
+
return this.client.call(
|
|
1791
1609
|
'patch',
|
|
1792
1610
|
uri,
|
|
1793
1611
|
apiHeaders,
|
|
@@ -1795,8 +1613,6 @@ export class Databases {
|
|
|
1795
1613
|
);
|
|
1796
1614
|
}
|
|
1797
1615
|
/**
|
|
1798
|
-
* List documents
|
|
1799
|
-
*
|
|
1800
1616
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
1801
1617
|
*
|
|
1802
1618
|
* @param {string} databaseId
|
|
@@ -1805,7 +1621,7 @@ export class Databases {
|
|
|
1805
1621
|
* @throws {AppwriteException}
|
|
1806
1622
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1807
1623
|
*/
|
|
1808
|
-
|
|
1624
|
+
listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
|
|
1809
1625
|
if (typeof databaseId === 'undefined') {
|
|
1810
1626
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1811
1627
|
}
|
|
@@ -1823,10 +1639,7 @@ export class Databases {
|
|
|
1823
1639
|
'content-type': 'application/json',
|
|
1824
1640
|
}
|
|
1825
1641
|
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
return await this.client.call(
|
|
1642
|
+
return this.client.call(
|
|
1830
1643
|
'get',
|
|
1831
1644
|
uri,
|
|
1832
1645
|
apiHeaders,
|
|
@@ -1834,9 +1647,8 @@ export class Databases {
|
|
|
1834
1647
|
);
|
|
1835
1648
|
}
|
|
1836
1649
|
/**
|
|
1837
|
-
* Create document
|
|
1838
|
-
*
|
|
1839
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.
|
|
1651
|
+
|
|
1840
1652
|
*
|
|
1841
1653
|
* @param {string} databaseId
|
|
1842
1654
|
* @param {string} collectionId
|
|
@@ -1846,7 +1658,7 @@ export class Databases {
|
|
|
1846
1658
|
* @throws {AppwriteException}
|
|
1847
1659
|
* @returns {Promise<Document>}
|
|
1848
1660
|
*/
|
|
1849
|
-
|
|
1661
|
+
createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document> {
|
|
1850
1662
|
if (typeof databaseId === 'undefined') {
|
|
1851
1663
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1852
1664
|
}
|
|
@@ -1876,10 +1688,7 @@ export class Databases {
|
|
|
1876
1688
|
'content-type': 'application/json',
|
|
1877
1689
|
}
|
|
1878
1690
|
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
return await this.client.call(
|
|
1691
|
+
return this.client.call(
|
|
1883
1692
|
'post',
|
|
1884
1693
|
uri,
|
|
1885
1694
|
apiHeaders,
|
|
@@ -1887,8 +1696,6 @@ export class Databases {
|
|
|
1887
1696
|
);
|
|
1888
1697
|
}
|
|
1889
1698
|
/**
|
|
1890
|
-
* Get document
|
|
1891
|
-
*
|
|
1892
1699
|
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
1893
1700
|
*
|
|
1894
1701
|
* @param {string} databaseId
|
|
@@ -1898,7 +1705,7 @@ export class Databases {
|
|
|
1898
1705
|
* @throws {AppwriteException}
|
|
1899
1706
|
* @returns {Promise<Document>}
|
|
1900
1707
|
*/
|
|
1901
|
-
|
|
1708
|
+
getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document> {
|
|
1902
1709
|
if (typeof databaseId === 'undefined') {
|
|
1903
1710
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1904
1711
|
}
|
|
@@ -1919,10 +1726,7 @@ export class Databases {
|
|
|
1919
1726
|
'content-type': 'application/json',
|
|
1920
1727
|
}
|
|
1921
1728
|
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
return await this.client.call(
|
|
1729
|
+
return this.client.call(
|
|
1926
1730
|
'get',
|
|
1927
1731
|
uri,
|
|
1928
1732
|
apiHeaders,
|
|
@@ -1930,8 +1734,6 @@ export class Databases {
|
|
|
1930
1734
|
);
|
|
1931
1735
|
}
|
|
1932
1736
|
/**
|
|
1933
|
-
* Update document
|
|
1934
|
-
*
|
|
1935
1737
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
1936
1738
|
*
|
|
1937
1739
|
* @param {string} databaseId
|
|
@@ -1942,7 +1744,7 @@ export class Databases {
|
|
|
1942
1744
|
* @throws {AppwriteException}
|
|
1943
1745
|
* @returns {Promise<Document>}
|
|
1944
1746
|
*/
|
|
1945
|
-
|
|
1747
|
+
updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document> {
|
|
1946
1748
|
if (typeof databaseId === 'undefined') {
|
|
1947
1749
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1948
1750
|
}
|
|
@@ -1966,10 +1768,7 @@ export class Databases {
|
|
|
1966
1768
|
'content-type': 'application/json',
|
|
1967
1769
|
}
|
|
1968
1770
|
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
return await this.client.call(
|
|
1771
|
+
return this.client.call(
|
|
1973
1772
|
'patch',
|
|
1974
1773
|
uri,
|
|
1975
1774
|
apiHeaders,
|
|
@@ -1977,8 +1776,6 @@ export class Databases {
|
|
|
1977
1776
|
);
|
|
1978
1777
|
}
|
|
1979
1778
|
/**
|
|
1980
|
-
* Delete document
|
|
1981
|
-
*
|
|
1982
1779
|
* Delete a document by its unique ID.
|
|
1983
1780
|
*
|
|
1984
1781
|
* @param {string} databaseId
|
|
@@ -1987,7 +1784,7 @@ export class Databases {
|
|
|
1987
1784
|
* @throws {AppwriteException}
|
|
1988
1785
|
* @returns {Promise<{}>}
|
|
1989
1786
|
*/
|
|
1990
|
-
|
|
1787
|
+
deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}> {
|
|
1991
1788
|
if (typeof databaseId === 'undefined') {
|
|
1992
1789
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1993
1790
|
}
|
|
@@ -2005,10 +1802,7 @@ export class Databases {
|
|
|
2005
1802
|
'content-type': 'application/json',
|
|
2006
1803
|
}
|
|
2007
1804
|
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
return await this.client.call(
|
|
1805
|
+
return this.client.call(
|
|
2012
1806
|
'delete',
|
|
2013
1807
|
uri,
|
|
2014
1808
|
apiHeaders,
|
|
@@ -2016,8 +1810,6 @@ export class Databases {
|
|
|
2016
1810
|
);
|
|
2017
1811
|
}
|
|
2018
1812
|
/**
|
|
2019
|
-
* List document logs
|
|
2020
|
-
*
|
|
2021
1813
|
* Get the document activity logs list by its unique ID.
|
|
2022
1814
|
*
|
|
2023
1815
|
* @param {string} databaseId
|
|
@@ -2027,7 +1819,7 @@ export class Databases {
|
|
|
2027
1819
|
* @throws {AppwriteException}
|
|
2028
1820
|
* @returns {Promise<Models.LogList>}
|
|
2029
1821
|
*/
|
|
2030
|
-
|
|
1822
|
+
listDocumentLogs(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Models.LogList> {
|
|
2031
1823
|
if (typeof databaseId === 'undefined') {
|
|
2032
1824
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2033
1825
|
}
|
|
@@ -2048,10 +1840,7 @@ export class Databases {
|
|
|
2048
1840
|
'content-type': 'application/json',
|
|
2049
1841
|
}
|
|
2050
1842
|
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
return await this.client.call(
|
|
1843
|
+
return this.client.call(
|
|
2055
1844
|
'get',
|
|
2056
1845
|
uri,
|
|
2057
1846
|
apiHeaders,
|
|
@@ -2059,8 +1848,6 @@ export class Databases {
|
|
|
2059
1848
|
);
|
|
2060
1849
|
}
|
|
2061
1850
|
/**
|
|
2062
|
-
* List indexes
|
|
2063
|
-
*
|
|
2064
1851
|
* List indexes in the collection.
|
|
2065
1852
|
*
|
|
2066
1853
|
* @param {string} databaseId
|
|
@@ -2069,7 +1856,7 @@ export class Databases {
|
|
|
2069
1856
|
* @throws {AppwriteException}
|
|
2070
1857
|
* @returns {Promise<Models.IndexList>}
|
|
2071
1858
|
*/
|
|
2072
|
-
|
|
1859
|
+
listIndexes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.IndexList> {
|
|
2073
1860
|
if (typeof databaseId === 'undefined') {
|
|
2074
1861
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2075
1862
|
}
|
|
@@ -2087,10 +1874,7 @@ export class Databases {
|
|
|
2087
1874
|
'content-type': 'application/json',
|
|
2088
1875
|
}
|
|
2089
1876
|
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
return await this.client.call(
|
|
1877
|
+
return this.client.call(
|
|
2094
1878
|
'get',
|
|
2095
1879
|
uri,
|
|
2096
1880
|
apiHeaders,
|
|
@@ -2098,8 +1882,6 @@ export class Databases {
|
|
|
2098
1882
|
);
|
|
2099
1883
|
}
|
|
2100
1884
|
/**
|
|
2101
|
-
* Create index
|
|
2102
|
-
*
|
|
2103
1885
|
* Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
|
|
2104
1886
|
Attributes can be `key`, `fulltext`, and `unique`.
|
|
2105
1887
|
*
|
|
@@ -2112,7 +1894,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2112
1894
|
* @throws {AppwriteException}
|
|
2113
1895
|
* @returns {Promise<Models.Index>}
|
|
2114
1896
|
*/
|
|
2115
|
-
|
|
1897
|
+
createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[]): Promise<Models.Index> {
|
|
2116
1898
|
if (typeof databaseId === 'undefined') {
|
|
2117
1899
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2118
1900
|
}
|
|
@@ -2148,10 +1930,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2148
1930
|
'content-type': 'application/json',
|
|
2149
1931
|
}
|
|
2150
1932
|
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
return await this.client.call(
|
|
1933
|
+
return this.client.call(
|
|
2155
1934
|
'post',
|
|
2156
1935
|
uri,
|
|
2157
1936
|
apiHeaders,
|
|
@@ -2159,8 +1938,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2159
1938
|
);
|
|
2160
1939
|
}
|
|
2161
1940
|
/**
|
|
2162
|
-
* Get index
|
|
2163
|
-
*
|
|
2164
1941
|
* Get index by ID.
|
|
2165
1942
|
*
|
|
2166
1943
|
* @param {string} databaseId
|
|
@@ -2169,7 +1946,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2169
1946
|
* @throws {AppwriteException}
|
|
2170
1947
|
* @returns {Promise<Models.Index>}
|
|
2171
1948
|
*/
|
|
2172
|
-
|
|
1949
|
+
getIndex(databaseId: string, collectionId: string, key: string): Promise<Models.Index> {
|
|
2173
1950
|
if (typeof databaseId === 'undefined') {
|
|
2174
1951
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2175
1952
|
}
|
|
@@ -2187,10 +1964,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2187
1964
|
'content-type': 'application/json',
|
|
2188
1965
|
}
|
|
2189
1966
|
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
return await this.client.call(
|
|
1967
|
+
return this.client.call(
|
|
2194
1968
|
'get',
|
|
2195
1969
|
uri,
|
|
2196
1970
|
apiHeaders,
|
|
@@ -2198,8 +1972,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2198
1972
|
);
|
|
2199
1973
|
}
|
|
2200
1974
|
/**
|
|
2201
|
-
* Delete index
|
|
2202
|
-
*
|
|
2203
1975
|
* Delete an index.
|
|
2204
1976
|
*
|
|
2205
1977
|
* @param {string} databaseId
|
|
@@ -2208,7 +1980,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2208
1980
|
* @throws {AppwriteException}
|
|
2209
1981
|
* @returns {Promise<{}>}
|
|
2210
1982
|
*/
|
|
2211
|
-
|
|
1983
|
+
deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}> {
|
|
2212
1984
|
if (typeof databaseId === 'undefined') {
|
|
2213
1985
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2214
1986
|
}
|
|
@@ -2226,10 +1998,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2226
1998
|
'content-type': 'application/json',
|
|
2227
1999
|
}
|
|
2228
2000
|
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
return await this.client.call(
|
|
2001
|
+
return this.client.call(
|
|
2233
2002
|
'delete',
|
|
2234
2003
|
uri,
|
|
2235
2004
|
apiHeaders,
|
|
@@ -2237,8 +2006,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2237
2006
|
);
|
|
2238
2007
|
}
|
|
2239
2008
|
/**
|
|
2240
|
-
* List collection logs
|
|
2241
|
-
*
|
|
2242
2009
|
* Get the collection activity logs list by its unique ID.
|
|
2243
2010
|
*
|
|
2244
2011
|
* @param {string} databaseId
|
|
@@ -2247,7 +2014,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2247
2014
|
* @throws {AppwriteException}
|
|
2248
2015
|
* @returns {Promise<Models.LogList>}
|
|
2249
2016
|
*/
|
|
2250
|
-
|
|
2017
|
+
listCollectionLogs(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.LogList> {
|
|
2251
2018
|
if (typeof databaseId === 'undefined') {
|
|
2252
2019
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2253
2020
|
}
|
|
@@ -2265,10 +2032,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2265
2032
|
'content-type': 'application/json',
|
|
2266
2033
|
}
|
|
2267
2034
|
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
return await this.client.call(
|
|
2035
|
+
return this.client.call(
|
|
2272
2036
|
'get',
|
|
2273
2037
|
uri,
|
|
2274
2038
|
apiHeaders,
|
|
@@ -2276,8 +2040,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2276
2040
|
);
|
|
2277
2041
|
}
|
|
2278
2042
|
/**
|
|
2279
|
-
* Get collection usage stats
|
|
2280
|
-
*
|
|
2281
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.
|
|
2282
2044
|
*
|
|
2283
2045
|
* @param {string} databaseId
|
|
@@ -2286,7 +2048,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2286
2048
|
* @throws {AppwriteException}
|
|
2287
2049
|
* @returns {Promise<Models.UsageCollection>}
|
|
2288
2050
|
*/
|
|
2289
|
-
|
|
2051
|
+
getCollectionUsage(databaseId: string, collectionId: string, range?: DatabaseUsageRange): Promise<Models.UsageCollection> {
|
|
2290
2052
|
if (typeof databaseId === 'undefined') {
|
|
2291
2053
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2292
2054
|
}
|
|
@@ -2304,10 +2066,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2304
2066
|
'content-type': 'application/json',
|
|
2305
2067
|
}
|
|
2306
2068
|
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
return await this.client.call(
|
|
2069
|
+
return this.client.call(
|
|
2311
2070
|
'get',
|
|
2312
2071
|
uri,
|
|
2313
2072
|
apiHeaders,
|
|
@@ -2315,8 +2074,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2315
2074
|
);
|
|
2316
2075
|
}
|
|
2317
2076
|
/**
|
|
2318
|
-
* List database logs
|
|
2319
|
-
*
|
|
2320
2077
|
* Get the database activity logs list by its unique ID.
|
|
2321
2078
|
*
|
|
2322
2079
|
* @param {string} databaseId
|
|
@@ -2324,7 +2081,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2324
2081
|
* @throws {AppwriteException}
|
|
2325
2082
|
* @returns {Promise<Models.LogList>}
|
|
2326
2083
|
*/
|
|
2327
|
-
|
|
2084
|
+
listLogs(databaseId: string, queries?: string[]): Promise<Models.LogList> {
|
|
2328
2085
|
if (typeof databaseId === 'undefined') {
|
|
2329
2086
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2330
2087
|
}
|
|
@@ -2339,10 +2096,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2339
2096
|
'content-type': 'application/json',
|
|
2340
2097
|
}
|
|
2341
2098
|
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
return await this.client.call(
|
|
2099
|
+
return this.client.call(
|
|
2346
2100
|
'get',
|
|
2347
2101
|
uri,
|
|
2348
2102
|
apiHeaders,
|
|
@@ -2350,8 +2104,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2350
2104
|
);
|
|
2351
2105
|
}
|
|
2352
2106
|
/**
|
|
2353
|
-
* Get database usage stats
|
|
2354
|
-
*
|
|
2355
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.
|
|
2356
2108
|
*
|
|
2357
2109
|
* @param {string} databaseId
|
|
@@ -2359,7 +2111,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2359
2111
|
* @throws {AppwriteException}
|
|
2360
2112
|
* @returns {Promise<Models.UsageDatabase>}
|
|
2361
2113
|
*/
|
|
2362
|
-
|
|
2114
|
+
getDatabaseUsage(databaseId: string, range?: DatabaseUsageRange): Promise<Models.UsageDatabase> {
|
|
2363
2115
|
if (typeof databaseId === 'undefined') {
|
|
2364
2116
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2365
2117
|
}
|
|
@@ -2374,10 +2126,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2374
2126
|
'content-type': 'application/json',
|
|
2375
2127
|
}
|
|
2376
2128
|
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
return await this.client.call(
|
|
2129
|
+
return this.client.call(
|
|
2381
2130
|
'get',
|
|
2382
2131
|
uri,
|
|
2383
2132
|
apiHeaders,
|