node-appwrite 15.0.0 → 15.0.1
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/dist/client.js +7 -4
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +7 -4
- package/dist/client.mjs.map +1 -1
- package/dist/models.d.mts +2 -2
- package/dist/models.d.ts +2 -2
- package/dist/services/account.d.mts +0 -86
- package/dist/services/account.d.ts +0 -86
- package/dist/services/account.js +86 -172
- package/dist/services/account.js.map +1 -1
- package/dist/services/account.mjs +86 -172
- package/dist/services/account.mjs.map +1 -1
- package/dist/services/avatars.d.mts +0 -14
- package/dist/services/avatars.d.ts +0 -14
- package/dist/services/avatars.js +14 -28
- package/dist/services/avatars.js.map +1 -1
- package/dist/services/avatars.mjs +14 -28
- package/dist/services/avatars.mjs.map +1 -1
- package/dist/services/databases.d.mts +0 -84
- package/dist/services/databases.d.ts +0 -84
- package/dist/services/databases.js +84 -168
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +84 -168
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +0 -48
- package/dist/services/functions.d.ts +0 -48
- package/dist/services/functions.js +48 -96
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +48 -96
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/graphql.d.mts +0 -4
- package/dist/services/graphql.d.ts +0 -4
- package/dist/services/graphql.js +4 -8
- package/dist/services/graphql.js.map +1 -1
- package/dist/services/graphql.mjs +4 -8
- package/dist/services/graphql.mjs.map +1 -1
- package/dist/services/health.d.mts +0 -46
- package/dist/services/health.d.ts +0 -46
- package/dist/services/health.js +46 -92
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +46 -92
- package/dist/services/health.mjs.map +1 -1
- package/dist/services/locale.d.mts +0 -16
- package/dist/services/locale.d.ts +0 -16
- package/dist/services/locale.js +16 -32
- package/dist/services/locale.js.map +1 -1
- package/dist/services/locale.mjs +16 -32
- package/dist/services/locale.mjs.map +1 -1
- package/dist/services/messaging.d.mts +3 -95
- package/dist/services/messaging.d.ts +3 -95
- package/dist/services/messaging.js +95 -187
- package/dist/services/messaging.js.map +1 -1
- package/dist/services/messaging.mjs +95 -187
- package/dist/services/messaging.mjs.map +1 -1
- package/dist/services/storage.d.mts +0 -26
- package/dist/services/storage.d.ts +0 -26
- package/dist/services/storage.js +26 -52
- package/dist/services/storage.js.map +1 -1
- package/dist/services/storage.mjs +26 -52
- package/dist/services/storage.mjs.map +1 -1
- package/dist/services/teams.d.mts +0 -26
- package/dist/services/teams.d.ts +0 -26
- package/dist/services/teams.js +26 -52
- package/dist/services/teams.js.map +1 -1
- package/dist/services/teams.mjs +26 -52
- package/dist/services/teams.mjs.map +1 -1
- package/dist/services/users.d.mts +0 -84
- package/dist/services/users.d.ts +0 -84
- package/dist/services/users.js +84 -168
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +84 -168
- package/dist/services/users.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -7,8 +7,6 @@ class Databases {
|
|
|
7
7
|
this.client = client;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* List databases
|
|
11
|
-
*
|
|
12
10
|
* Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.
|
|
13
11
|
*
|
|
14
12
|
* @param {string[]} queries
|
|
@@ -16,7 +14,7 @@ class Databases {
|
|
|
16
14
|
* @throws {AppwriteException}
|
|
17
15
|
* @returns {Promise<Models.DatabaseList>}
|
|
18
16
|
*/
|
|
19
|
-
|
|
17
|
+
list(queries, search) {
|
|
20
18
|
const apiPath = "/databases";
|
|
21
19
|
const payload = {};
|
|
22
20
|
if (typeof queries !== "undefined") {
|
|
@@ -29,7 +27,7 @@ class Databases {
|
|
|
29
27
|
const apiHeaders = {
|
|
30
28
|
"content-type": "application/json"
|
|
31
29
|
};
|
|
32
|
-
return
|
|
30
|
+
return this.client.call(
|
|
33
31
|
"get",
|
|
34
32
|
uri,
|
|
35
33
|
apiHeaders,
|
|
@@ -37,8 +35,6 @@ class Databases {
|
|
|
37
35
|
);
|
|
38
36
|
}
|
|
39
37
|
/**
|
|
40
|
-
* Create database
|
|
41
|
-
*
|
|
42
38
|
* Create a new Database.
|
|
43
39
|
|
|
44
40
|
*
|
|
@@ -48,7 +44,7 @@ class Databases {
|
|
|
48
44
|
* @throws {AppwriteException}
|
|
49
45
|
* @returns {Promise<Models.Database>}
|
|
50
46
|
*/
|
|
51
|
-
|
|
47
|
+
create(databaseId, name, enabled) {
|
|
52
48
|
if (typeof databaseId === "undefined") {
|
|
53
49
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
54
50
|
}
|
|
@@ -70,7 +66,7 @@ class Databases {
|
|
|
70
66
|
const apiHeaders = {
|
|
71
67
|
"content-type": "application/json"
|
|
72
68
|
};
|
|
73
|
-
return
|
|
69
|
+
return this.client.call(
|
|
74
70
|
"post",
|
|
75
71
|
uri,
|
|
76
72
|
apiHeaders,
|
|
@@ -78,15 +74,13 @@ class Databases {
|
|
|
78
74
|
);
|
|
79
75
|
}
|
|
80
76
|
/**
|
|
81
|
-
* Get database
|
|
82
|
-
*
|
|
83
77
|
* Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.
|
|
84
78
|
*
|
|
85
79
|
* @param {string} databaseId
|
|
86
80
|
* @throws {AppwriteException}
|
|
87
81
|
* @returns {Promise<Models.Database>}
|
|
88
82
|
*/
|
|
89
|
-
|
|
83
|
+
get(databaseId) {
|
|
90
84
|
if (typeof databaseId === "undefined") {
|
|
91
85
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
92
86
|
}
|
|
@@ -96,7 +90,7 @@ class Databases {
|
|
|
96
90
|
const apiHeaders = {
|
|
97
91
|
"content-type": "application/json"
|
|
98
92
|
};
|
|
99
|
-
return
|
|
93
|
+
return this.client.call(
|
|
100
94
|
"get",
|
|
101
95
|
uri,
|
|
102
96
|
apiHeaders,
|
|
@@ -104,8 +98,6 @@ class Databases {
|
|
|
104
98
|
);
|
|
105
99
|
}
|
|
106
100
|
/**
|
|
107
|
-
* Update database
|
|
108
|
-
*
|
|
109
101
|
* Update a database by its unique ID.
|
|
110
102
|
*
|
|
111
103
|
* @param {string} databaseId
|
|
@@ -114,7 +106,7 @@ class Databases {
|
|
|
114
106
|
* @throws {AppwriteException}
|
|
115
107
|
* @returns {Promise<Models.Database>}
|
|
116
108
|
*/
|
|
117
|
-
|
|
109
|
+
update(databaseId, name, enabled) {
|
|
118
110
|
if (typeof databaseId === "undefined") {
|
|
119
111
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
120
112
|
}
|
|
@@ -133,7 +125,7 @@ class Databases {
|
|
|
133
125
|
const apiHeaders = {
|
|
134
126
|
"content-type": "application/json"
|
|
135
127
|
};
|
|
136
|
-
return
|
|
128
|
+
return this.client.call(
|
|
137
129
|
"put",
|
|
138
130
|
uri,
|
|
139
131
|
apiHeaders,
|
|
@@ -141,15 +133,13 @@ class Databases {
|
|
|
141
133
|
);
|
|
142
134
|
}
|
|
143
135
|
/**
|
|
144
|
-
* Delete database
|
|
145
|
-
*
|
|
146
136
|
* Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
|
|
147
137
|
*
|
|
148
138
|
* @param {string} databaseId
|
|
149
139
|
* @throws {AppwriteException}
|
|
150
140
|
* @returns {Promise<{}>}
|
|
151
141
|
*/
|
|
152
|
-
|
|
142
|
+
delete(databaseId) {
|
|
153
143
|
if (typeof databaseId === "undefined") {
|
|
154
144
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
155
145
|
}
|
|
@@ -159,7 +149,7 @@ class Databases {
|
|
|
159
149
|
const apiHeaders = {
|
|
160
150
|
"content-type": "application/json"
|
|
161
151
|
};
|
|
162
|
-
return
|
|
152
|
+
return this.client.call(
|
|
163
153
|
"delete",
|
|
164
154
|
uri,
|
|
165
155
|
apiHeaders,
|
|
@@ -167,8 +157,6 @@ class Databases {
|
|
|
167
157
|
);
|
|
168
158
|
}
|
|
169
159
|
/**
|
|
170
|
-
* List collections
|
|
171
|
-
*
|
|
172
160
|
* Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.
|
|
173
161
|
*
|
|
174
162
|
* @param {string} databaseId
|
|
@@ -177,7 +165,7 @@ class Databases {
|
|
|
177
165
|
* @throws {AppwriteException}
|
|
178
166
|
* @returns {Promise<Models.CollectionList>}
|
|
179
167
|
*/
|
|
180
|
-
|
|
168
|
+
listCollections(databaseId, queries, search) {
|
|
181
169
|
if (typeof databaseId === "undefined") {
|
|
182
170
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
183
171
|
}
|
|
@@ -193,7 +181,7 @@ class Databases {
|
|
|
193
181
|
const apiHeaders = {
|
|
194
182
|
"content-type": "application/json"
|
|
195
183
|
};
|
|
196
|
-
return
|
|
184
|
+
return this.client.call(
|
|
197
185
|
"get",
|
|
198
186
|
uri,
|
|
199
187
|
apiHeaders,
|
|
@@ -201,8 +189,6 @@ class Databases {
|
|
|
201
189
|
);
|
|
202
190
|
}
|
|
203
191
|
/**
|
|
204
|
-
* Create collection
|
|
205
|
-
*
|
|
206
192
|
* 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.
|
|
207
193
|
*
|
|
208
194
|
* @param {string} databaseId
|
|
@@ -214,7 +200,7 @@ class Databases {
|
|
|
214
200
|
* @throws {AppwriteException}
|
|
215
201
|
* @returns {Promise<Models.Collection>}
|
|
216
202
|
*/
|
|
217
|
-
|
|
203
|
+
createCollection(databaseId, collectionId, name, permissions, documentSecurity, enabled) {
|
|
218
204
|
if (typeof databaseId === "undefined") {
|
|
219
205
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
220
206
|
}
|
|
@@ -245,7 +231,7 @@ class Databases {
|
|
|
245
231
|
const apiHeaders = {
|
|
246
232
|
"content-type": "application/json"
|
|
247
233
|
};
|
|
248
|
-
return
|
|
234
|
+
return this.client.call(
|
|
249
235
|
"post",
|
|
250
236
|
uri,
|
|
251
237
|
apiHeaders,
|
|
@@ -253,8 +239,6 @@ class Databases {
|
|
|
253
239
|
);
|
|
254
240
|
}
|
|
255
241
|
/**
|
|
256
|
-
* Get collection
|
|
257
|
-
*
|
|
258
242
|
* Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.
|
|
259
243
|
*
|
|
260
244
|
* @param {string} databaseId
|
|
@@ -262,7 +246,7 @@ class Databases {
|
|
|
262
246
|
* @throws {AppwriteException}
|
|
263
247
|
* @returns {Promise<Models.Collection>}
|
|
264
248
|
*/
|
|
265
|
-
|
|
249
|
+
getCollection(databaseId, collectionId) {
|
|
266
250
|
if (typeof databaseId === "undefined") {
|
|
267
251
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
268
252
|
}
|
|
@@ -275,7 +259,7 @@ class Databases {
|
|
|
275
259
|
const apiHeaders = {
|
|
276
260
|
"content-type": "application/json"
|
|
277
261
|
};
|
|
278
|
-
return
|
|
262
|
+
return this.client.call(
|
|
279
263
|
"get",
|
|
280
264
|
uri,
|
|
281
265
|
apiHeaders,
|
|
@@ -283,8 +267,6 @@ class Databases {
|
|
|
283
267
|
);
|
|
284
268
|
}
|
|
285
269
|
/**
|
|
286
|
-
* Update collection
|
|
287
|
-
*
|
|
288
270
|
* Update a collection by its unique ID.
|
|
289
271
|
*
|
|
290
272
|
* @param {string} databaseId
|
|
@@ -296,7 +278,7 @@ class Databases {
|
|
|
296
278
|
* @throws {AppwriteException}
|
|
297
279
|
* @returns {Promise<Models.Collection>}
|
|
298
280
|
*/
|
|
299
|
-
|
|
281
|
+
updateCollection(databaseId, collectionId, name, permissions, documentSecurity, enabled) {
|
|
300
282
|
if (typeof databaseId === "undefined") {
|
|
301
283
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
302
284
|
}
|
|
@@ -324,7 +306,7 @@ class Databases {
|
|
|
324
306
|
const apiHeaders = {
|
|
325
307
|
"content-type": "application/json"
|
|
326
308
|
};
|
|
327
|
-
return
|
|
309
|
+
return this.client.call(
|
|
328
310
|
"put",
|
|
329
311
|
uri,
|
|
330
312
|
apiHeaders,
|
|
@@ -332,8 +314,6 @@ class Databases {
|
|
|
332
314
|
);
|
|
333
315
|
}
|
|
334
316
|
/**
|
|
335
|
-
* Delete collection
|
|
336
|
-
*
|
|
337
317
|
* Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.
|
|
338
318
|
*
|
|
339
319
|
* @param {string} databaseId
|
|
@@ -341,7 +321,7 @@ class Databases {
|
|
|
341
321
|
* @throws {AppwriteException}
|
|
342
322
|
* @returns {Promise<{}>}
|
|
343
323
|
*/
|
|
344
|
-
|
|
324
|
+
deleteCollection(databaseId, collectionId) {
|
|
345
325
|
if (typeof databaseId === "undefined") {
|
|
346
326
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
347
327
|
}
|
|
@@ -354,7 +334,7 @@ class Databases {
|
|
|
354
334
|
const apiHeaders = {
|
|
355
335
|
"content-type": "application/json"
|
|
356
336
|
};
|
|
357
|
-
return
|
|
337
|
+
return this.client.call(
|
|
358
338
|
"delete",
|
|
359
339
|
uri,
|
|
360
340
|
apiHeaders,
|
|
@@ -362,8 +342,6 @@ class Databases {
|
|
|
362
342
|
);
|
|
363
343
|
}
|
|
364
344
|
/**
|
|
365
|
-
* List attributes
|
|
366
|
-
*
|
|
367
345
|
* List attributes in the collection.
|
|
368
346
|
*
|
|
369
347
|
* @param {string} databaseId
|
|
@@ -372,7 +350,7 @@ class Databases {
|
|
|
372
350
|
* @throws {AppwriteException}
|
|
373
351
|
* @returns {Promise<Models.AttributeList>}
|
|
374
352
|
*/
|
|
375
|
-
|
|
353
|
+
listAttributes(databaseId, collectionId, queries) {
|
|
376
354
|
if (typeof databaseId === "undefined") {
|
|
377
355
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
378
356
|
}
|
|
@@ -388,7 +366,7 @@ class Databases {
|
|
|
388
366
|
const apiHeaders = {
|
|
389
367
|
"content-type": "application/json"
|
|
390
368
|
};
|
|
391
|
-
return
|
|
369
|
+
return this.client.call(
|
|
392
370
|
"get",
|
|
393
371
|
uri,
|
|
394
372
|
apiHeaders,
|
|
@@ -396,8 +374,6 @@ class Databases {
|
|
|
396
374
|
);
|
|
397
375
|
}
|
|
398
376
|
/**
|
|
399
|
-
* Create boolean attribute
|
|
400
|
-
*
|
|
401
377
|
* Create a boolean attribute.
|
|
402
378
|
|
|
403
379
|
*
|
|
@@ -410,7 +386,7 @@ class Databases {
|
|
|
410
386
|
* @throws {AppwriteException}
|
|
411
387
|
* @returns {Promise<Models.AttributeBoolean>}
|
|
412
388
|
*/
|
|
413
|
-
|
|
389
|
+
createBooleanAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
414
390
|
if (typeof databaseId === "undefined") {
|
|
415
391
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
416
392
|
}
|
|
@@ -441,7 +417,7 @@ class Databases {
|
|
|
441
417
|
const apiHeaders = {
|
|
442
418
|
"content-type": "application/json"
|
|
443
419
|
};
|
|
444
|
-
return
|
|
420
|
+
return this.client.call(
|
|
445
421
|
"post",
|
|
446
422
|
uri,
|
|
447
423
|
apiHeaders,
|
|
@@ -449,8 +425,6 @@ class Databases {
|
|
|
449
425
|
);
|
|
450
426
|
}
|
|
451
427
|
/**
|
|
452
|
-
* Update boolean attribute
|
|
453
|
-
*
|
|
454
428
|
* Update a boolean attribute. Changing the `default` value will not update already existing documents.
|
|
455
429
|
*
|
|
456
430
|
* @param {string} databaseId
|
|
@@ -462,7 +436,7 @@ class Databases {
|
|
|
462
436
|
* @throws {AppwriteException}
|
|
463
437
|
* @returns {Promise<Models.AttributeBoolean>}
|
|
464
438
|
*/
|
|
465
|
-
|
|
439
|
+
updateBooleanAttribute(databaseId, collectionId, key, required, xdefault, newKey) {
|
|
466
440
|
if (typeof databaseId === "undefined") {
|
|
467
441
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
468
442
|
}
|
|
@@ -493,7 +467,7 @@ class Databases {
|
|
|
493
467
|
const apiHeaders = {
|
|
494
468
|
"content-type": "application/json"
|
|
495
469
|
};
|
|
496
|
-
return
|
|
470
|
+
return this.client.call(
|
|
497
471
|
"patch",
|
|
498
472
|
uri,
|
|
499
473
|
apiHeaders,
|
|
@@ -501,8 +475,6 @@ class Databases {
|
|
|
501
475
|
);
|
|
502
476
|
}
|
|
503
477
|
/**
|
|
504
|
-
* Create datetime attribute
|
|
505
|
-
*
|
|
506
478
|
* Create a date time attribute according to the ISO 8601 standard.
|
|
507
479
|
*
|
|
508
480
|
* @param {string} databaseId
|
|
@@ -514,7 +486,7 @@ class Databases {
|
|
|
514
486
|
* @throws {AppwriteException}
|
|
515
487
|
* @returns {Promise<Models.AttributeDatetime>}
|
|
516
488
|
*/
|
|
517
|
-
|
|
489
|
+
createDatetimeAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
518
490
|
if (typeof databaseId === "undefined") {
|
|
519
491
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
520
492
|
}
|
|
@@ -545,7 +517,7 @@ class Databases {
|
|
|
545
517
|
const apiHeaders = {
|
|
546
518
|
"content-type": "application/json"
|
|
547
519
|
};
|
|
548
|
-
return
|
|
520
|
+
return this.client.call(
|
|
549
521
|
"post",
|
|
550
522
|
uri,
|
|
551
523
|
apiHeaders,
|
|
@@ -553,8 +525,6 @@ class Databases {
|
|
|
553
525
|
);
|
|
554
526
|
}
|
|
555
527
|
/**
|
|
556
|
-
* Update dateTime attribute
|
|
557
|
-
*
|
|
558
528
|
* Update a date time attribute. Changing the `default` value will not update already existing documents.
|
|
559
529
|
*
|
|
560
530
|
* @param {string} databaseId
|
|
@@ -566,7 +536,7 @@ class Databases {
|
|
|
566
536
|
* @throws {AppwriteException}
|
|
567
537
|
* @returns {Promise<Models.AttributeDatetime>}
|
|
568
538
|
*/
|
|
569
|
-
|
|
539
|
+
updateDatetimeAttribute(databaseId, collectionId, key, required, xdefault, newKey) {
|
|
570
540
|
if (typeof databaseId === "undefined") {
|
|
571
541
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
572
542
|
}
|
|
@@ -597,7 +567,7 @@ class Databases {
|
|
|
597
567
|
const apiHeaders = {
|
|
598
568
|
"content-type": "application/json"
|
|
599
569
|
};
|
|
600
|
-
return
|
|
570
|
+
return this.client.call(
|
|
601
571
|
"patch",
|
|
602
572
|
uri,
|
|
603
573
|
apiHeaders,
|
|
@@ -605,8 +575,6 @@ class Databases {
|
|
|
605
575
|
);
|
|
606
576
|
}
|
|
607
577
|
/**
|
|
608
|
-
* Create email attribute
|
|
609
|
-
*
|
|
610
578
|
* Create an email attribute.
|
|
611
579
|
|
|
612
580
|
*
|
|
@@ -619,7 +587,7 @@ class Databases {
|
|
|
619
587
|
* @throws {AppwriteException}
|
|
620
588
|
* @returns {Promise<Models.AttributeEmail>}
|
|
621
589
|
*/
|
|
622
|
-
|
|
590
|
+
createEmailAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
623
591
|
if (typeof databaseId === "undefined") {
|
|
624
592
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
625
593
|
}
|
|
@@ -650,7 +618,7 @@ class Databases {
|
|
|
650
618
|
const apiHeaders = {
|
|
651
619
|
"content-type": "application/json"
|
|
652
620
|
};
|
|
653
|
-
return
|
|
621
|
+
return this.client.call(
|
|
654
622
|
"post",
|
|
655
623
|
uri,
|
|
656
624
|
apiHeaders,
|
|
@@ -658,8 +626,6 @@ class Databases {
|
|
|
658
626
|
);
|
|
659
627
|
}
|
|
660
628
|
/**
|
|
661
|
-
* Update email attribute
|
|
662
|
-
*
|
|
663
629
|
* Update an email attribute. Changing the `default` value will not update already existing documents.
|
|
664
630
|
|
|
665
631
|
*
|
|
@@ -672,7 +638,7 @@ class Databases {
|
|
|
672
638
|
* @throws {AppwriteException}
|
|
673
639
|
* @returns {Promise<Models.AttributeEmail>}
|
|
674
640
|
*/
|
|
675
|
-
|
|
641
|
+
updateEmailAttribute(databaseId, collectionId, key, required, xdefault, newKey) {
|
|
676
642
|
if (typeof databaseId === "undefined") {
|
|
677
643
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
678
644
|
}
|
|
@@ -703,7 +669,7 @@ class Databases {
|
|
|
703
669
|
const apiHeaders = {
|
|
704
670
|
"content-type": "application/json"
|
|
705
671
|
};
|
|
706
|
-
return
|
|
672
|
+
return this.client.call(
|
|
707
673
|
"patch",
|
|
708
674
|
uri,
|
|
709
675
|
apiHeaders,
|
|
@@ -711,8 +677,6 @@ class Databases {
|
|
|
711
677
|
);
|
|
712
678
|
}
|
|
713
679
|
/**
|
|
714
|
-
* Create enum attribute
|
|
715
|
-
*
|
|
716
680
|
* Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute.
|
|
717
681
|
|
|
718
682
|
*
|
|
@@ -726,7 +690,7 @@ class Databases {
|
|
|
726
690
|
* @throws {AppwriteException}
|
|
727
691
|
* @returns {Promise<Models.AttributeEnum>}
|
|
728
692
|
*/
|
|
729
|
-
|
|
693
|
+
createEnumAttribute(databaseId, collectionId, key, elements, required, xdefault, array) {
|
|
730
694
|
if (typeof databaseId === "undefined") {
|
|
731
695
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
732
696
|
}
|
|
@@ -763,7 +727,7 @@ class Databases {
|
|
|
763
727
|
const apiHeaders = {
|
|
764
728
|
"content-type": "application/json"
|
|
765
729
|
};
|
|
766
|
-
return
|
|
730
|
+
return this.client.call(
|
|
767
731
|
"post",
|
|
768
732
|
uri,
|
|
769
733
|
apiHeaders,
|
|
@@ -771,8 +735,6 @@ class Databases {
|
|
|
771
735
|
);
|
|
772
736
|
}
|
|
773
737
|
/**
|
|
774
|
-
* Update enum attribute
|
|
775
|
-
*
|
|
776
738
|
* Update an enum attribute. Changing the `default` value will not update already existing documents.
|
|
777
739
|
|
|
778
740
|
*
|
|
@@ -786,7 +748,7 @@ class Databases {
|
|
|
786
748
|
* @throws {AppwriteException}
|
|
787
749
|
* @returns {Promise<Models.AttributeEnum>}
|
|
788
750
|
*/
|
|
789
|
-
|
|
751
|
+
updateEnumAttribute(databaseId, collectionId, key, elements, required, xdefault, newKey) {
|
|
790
752
|
if (typeof databaseId === "undefined") {
|
|
791
753
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
792
754
|
}
|
|
@@ -823,7 +785,7 @@ class Databases {
|
|
|
823
785
|
const apiHeaders = {
|
|
824
786
|
"content-type": "application/json"
|
|
825
787
|
};
|
|
826
|
-
return
|
|
788
|
+
return this.client.call(
|
|
827
789
|
"patch",
|
|
828
790
|
uri,
|
|
829
791
|
apiHeaders,
|
|
@@ -831,8 +793,6 @@ class Databases {
|
|
|
831
793
|
);
|
|
832
794
|
}
|
|
833
795
|
/**
|
|
834
|
-
* Create float attribute
|
|
835
|
-
*
|
|
836
796
|
* Create a float attribute. Optionally, minimum and maximum values can be provided.
|
|
837
797
|
|
|
838
798
|
*
|
|
@@ -847,7 +807,7 @@ class Databases {
|
|
|
847
807
|
* @throws {AppwriteException}
|
|
848
808
|
* @returns {Promise<Models.AttributeFloat>}
|
|
849
809
|
*/
|
|
850
|
-
|
|
810
|
+
createFloatAttribute(databaseId, collectionId, key, required, min, max, xdefault, array) {
|
|
851
811
|
if (typeof databaseId === "undefined") {
|
|
852
812
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
853
813
|
}
|
|
@@ -884,7 +844,7 @@ class Databases {
|
|
|
884
844
|
const apiHeaders = {
|
|
885
845
|
"content-type": "application/json"
|
|
886
846
|
};
|
|
887
|
-
return
|
|
847
|
+
return this.client.call(
|
|
888
848
|
"post",
|
|
889
849
|
uri,
|
|
890
850
|
apiHeaders,
|
|
@@ -892,8 +852,6 @@ class Databases {
|
|
|
892
852
|
);
|
|
893
853
|
}
|
|
894
854
|
/**
|
|
895
|
-
* Update float attribute
|
|
896
|
-
*
|
|
897
855
|
* Update a float attribute. Changing the `default` value will not update already existing documents.
|
|
898
856
|
|
|
899
857
|
*
|
|
@@ -908,7 +866,7 @@ class Databases {
|
|
|
908
866
|
* @throws {AppwriteException}
|
|
909
867
|
* @returns {Promise<Models.AttributeFloat>}
|
|
910
868
|
*/
|
|
911
|
-
|
|
869
|
+
updateFloatAttribute(databaseId, collectionId, key, required, min, max, xdefault, newKey) {
|
|
912
870
|
if (typeof databaseId === "undefined") {
|
|
913
871
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
914
872
|
}
|
|
@@ -951,7 +909,7 @@ class Databases {
|
|
|
951
909
|
const apiHeaders = {
|
|
952
910
|
"content-type": "application/json"
|
|
953
911
|
};
|
|
954
|
-
return
|
|
912
|
+
return this.client.call(
|
|
955
913
|
"patch",
|
|
956
914
|
uri,
|
|
957
915
|
apiHeaders,
|
|
@@ -959,8 +917,6 @@ class Databases {
|
|
|
959
917
|
);
|
|
960
918
|
}
|
|
961
919
|
/**
|
|
962
|
-
* Create integer attribute
|
|
963
|
-
*
|
|
964
920
|
* Create an integer attribute. Optionally, minimum and maximum values can be provided.
|
|
965
921
|
|
|
966
922
|
*
|
|
@@ -975,7 +931,7 @@ class Databases {
|
|
|
975
931
|
* @throws {AppwriteException}
|
|
976
932
|
* @returns {Promise<Models.AttributeInteger>}
|
|
977
933
|
*/
|
|
978
|
-
|
|
934
|
+
createIntegerAttribute(databaseId, collectionId, key, required, min, max, xdefault, array) {
|
|
979
935
|
if (typeof databaseId === "undefined") {
|
|
980
936
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
981
937
|
}
|
|
@@ -1012,7 +968,7 @@ class Databases {
|
|
|
1012
968
|
const apiHeaders = {
|
|
1013
969
|
"content-type": "application/json"
|
|
1014
970
|
};
|
|
1015
|
-
return
|
|
971
|
+
return this.client.call(
|
|
1016
972
|
"post",
|
|
1017
973
|
uri,
|
|
1018
974
|
apiHeaders,
|
|
@@ -1020,8 +976,6 @@ class Databases {
|
|
|
1020
976
|
);
|
|
1021
977
|
}
|
|
1022
978
|
/**
|
|
1023
|
-
* Update integer attribute
|
|
1024
|
-
*
|
|
1025
979
|
* Update an integer attribute. Changing the `default` value will not update already existing documents.
|
|
1026
980
|
|
|
1027
981
|
*
|
|
@@ -1036,7 +990,7 @@ class Databases {
|
|
|
1036
990
|
* @throws {AppwriteException}
|
|
1037
991
|
* @returns {Promise<Models.AttributeInteger>}
|
|
1038
992
|
*/
|
|
1039
|
-
|
|
993
|
+
updateIntegerAttribute(databaseId, collectionId, key, required, min, max, xdefault, newKey) {
|
|
1040
994
|
if (typeof databaseId === "undefined") {
|
|
1041
995
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1042
996
|
}
|
|
@@ -1079,7 +1033,7 @@ class Databases {
|
|
|
1079
1033
|
const apiHeaders = {
|
|
1080
1034
|
"content-type": "application/json"
|
|
1081
1035
|
};
|
|
1082
|
-
return
|
|
1036
|
+
return this.client.call(
|
|
1083
1037
|
"patch",
|
|
1084
1038
|
uri,
|
|
1085
1039
|
apiHeaders,
|
|
@@ -1087,8 +1041,6 @@ class Databases {
|
|
|
1087
1041
|
);
|
|
1088
1042
|
}
|
|
1089
1043
|
/**
|
|
1090
|
-
* Create IP address attribute
|
|
1091
|
-
*
|
|
1092
1044
|
* Create IP address attribute.
|
|
1093
1045
|
|
|
1094
1046
|
*
|
|
@@ -1101,7 +1053,7 @@ class Databases {
|
|
|
1101
1053
|
* @throws {AppwriteException}
|
|
1102
1054
|
* @returns {Promise<Models.AttributeIp>}
|
|
1103
1055
|
*/
|
|
1104
|
-
|
|
1056
|
+
createIpAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
1105
1057
|
if (typeof databaseId === "undefined") {
|
|
1106
1058
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1107
1059
|
}
|
|
@@ -1132,7 +1084,7 @@ class Databases {
|
|
|
1132
1084
|
const apiHeaders = {
|
|
1133
1085
|
"content-type": "application/json"
|
|
1134
1086
|
};
|
|
1135
|
-
return
|
|
1087
|
+
return this.client.call(
|
|
1136
1088
|
"post",
|
|
1137
1089
|
uri,
|
|
1138
1090
|
apiHeaders,
|
|
@@ -1140,8 +1092,6 @@ class Databases {
|
|
|
1140
1092
|
);
|
|
1141
1093
|
}
|
|
1142
1094
|
/**
|
|
1143
|
-
* Update IP address attribute
|
|
1144
|
-
*
|
|
1145
1095
|
* Update an ip attribute. Changing the `default` value will not update already existing documents.
|
|
1146
1096
|
|
|
1147
1097
|
*
|
|
@@ -1154,7 +1104,7 @@ class Databases {
|
|
|
1154
1104
|
* @throws {AppwriteException}
|
|
1155
1105
|
* @returns {Promise<Models.AttributeIp>}
|
|
1156
1106
|
*/
|
|
1157
|
-
|
|
1107
|
+
updateIpAttribute(databaseId, collectionId, key, required, xdefault, newKey) {
|
|
1158
1108
|
if (typeof databaseId === "undefined") {
|
|
1159
1109
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1160
1110
|
}
|
|
@@ -1185,7 +1135,7 @@ class Databases {
|
|
|
1185
1135
|
const apiHeaders = {
|
|
1186
1136
|
"content-type": "application/json"
|
|
1187
1137
|
};
|
|
1188
|
-
return
|
|
1138
|
+
return this.client.call(
|
|
1189
1139
|
"patch",
|
|
1190
1140
|
uri,
|
|
1191
1141
|
apiHeaders,
|
|
@@ -1193,8 +1143,6 @@ class Databases {
|
|
|
1193
1143
|
);
|
|
1194
1144
|
}
|
|
1195
1145
|
/**
|
|
1196
|
-
* Create relationship attribute
|
|
1197
|
-
*
|
|
1198
1146
|
* Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1199
1147
|
|
|
1200
1148
|
*
|
|
@@ -1209,7 +1157,7 @@ class Databases {
|
|
|
1209
1157
|
* @throws {AppwriteException}
|
|
1210
1158
|
* @returns {Promise<Models.AttributeRelationship>}
|
|
1211
1159
|
*/
|
|
1212
|
-
|
|
1160
|
+
createRelationshipAttribute(databaseId, collectionId, relatedCollectionId, type, twoWay, key, twoWayKey, onDelete) {
|
|
1213
1161
|
if (typeof databaseId === "undefined") {
|
|
1214
1162
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1215
1163
|
}
|
|
@@ -1246,7 +1194,7 @@ class Databases {
|
|
|
1246
1194
|
const apiHeaders = {
|
|
1247
1195
|
"content-type": "application/json"
|
|
1248
1196
|
};
|
|
1249
|
-
return
|
|
1197
|
+
return this.client.call(
|
|
1250
1198
|
"post",
|
|
1251
1199
|
uri,
|
|
1252
1200
|
apiHeaders,
|
|
@@ -1254,8 +1202,6 @@ class Databases {
|
|
|
1254
1202
|
);
|
|
1255
1203
|
}
|
|
1256
1204
|
/**
|
|
1257
|
-
* Create string attribute
|
|
1258
|
-
*
|
|
1259
1205
|
* Create a string attribute.
|
|
1260
1206
|
|
|
1261
1207
|
*
|
|
@@ -1270,7 +1216,7 @@ class Databases {
|
|
|
1270
1216
|
* @throws {AppwriteException}
|
|
1271
1217
|
* @returns {Promise<Models.AttributeString>}
|
|
1272
1218
|
*/
|
|
1273
|
-
|
|
1219
|
+
createStringAttribute(databaseId, collectionId, key, size, required, xdefault, array, encrypt) {
|
|
1274
1220
|
if (typeof databaseId === "undefined") {
|
|
1275
1221
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1276
1222
|
}
|
|
@@ -1310,7 +1256,7 @@ class Databases {
|
|
|
1310
1256
|
const apiHeaders = {
|
|
1311
1257
|
"content-type": "application/json"
|
|
1312
1258
|
};
|
|
1313
|
-
return
|
|
1259
|
+
return this.client.call(
|
|
1314
1260
|
"post",
|
|
1315
1261
|
uri,
|
|
1316
1262
|
apiHeaders,
|
|
@@ -1318,8 +1264,6 @@ class Databases {
|
|
|
1318
1264
|
);
|
|
1319
1265
|
}
|
|
1320
1266
|
/**
|
|
1321
|
-
* Update string attribute
|
|
1322
|
-
*
|
|
1323
1267
|
* Update a string attribute. Changing the `default` value will not update already existing documents.
|
|
1324
1268
|
|
|
1325
1269
|
*
|
|
@@ -1333,7 +1277,7 @@ class Databases {
|
|
|
1333
1277
|
* @throws {AppwriteException}
|
|
1334
1278
|
* @returns {Promise<Models.AttributeString>}
|
|
1335
1279
|
*/
|
|
1336
|
-
|
|
1280
|
+
updateStringAttribute(databaseId, collectionId, key, required, xdefault, size, newKey) {
|
|
1337
1281
|
if (typeof databaseId === "undefined") {
|
|
1338
1282
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1339
1283
|
}
|
|
@@ -1367,7 +1311,7 @@ class Databases {
|
|
|
1367
1311
|
const apiHeaders = {
|
|
1368
1312
|
"content-type": "application/json"
|
|
1369
1313
|
};
|
|
1370
|
-
return
|
|
1314
|
+
return this.client.call(
|
|
1371
1315
|
"patch",
|
|
1372
1316
|
uri,
|
|
1373
1317
|
apiHeaders,
|
|
@@ -1375,8 +1319,6 @@ class Databases {
|
|
|
1375
1319
|
);
|
|
1376
1320
|
}
|
|
1377
1321
|
/**
|
|
1378
|
-
* Create URL attribute
|
|
1379
|
-
*
|
|
1380
1322
|
* Create a URL attribute.
|
|
1381
1323
|
|
|
1382
1324
|
*
|
|
@@ -1389,7 +1331,7 @@ class Databases {
|
|
|
1389
1331
|
* @throws {AppwriteException}
|
|
1390
1332
|
* @returns {Promise<Models.AttributeUrl>}
|
|
1391
1333
|
*/
|
|
1392
|
-
|
|
1334
|
+
createUrlAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
1393
1335
|
if (typeof databaseId === "undefined") {
|
|
1394
1336
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1395
1337
|
}
|
|
@@ -1420,7 +1362,7 @@ class Databases {
|
|
|
1420
1362
|
const apiHeaders = {
|
|
1421
1363
|
"content-type": "application/json"
|
|
1422
1364
|
};
|
|
1423
|
-
return
|
|
1365
|
+
return this.client.call(
|
|
1424
1366
|
"post",
|
|
1425
1367
|
uri,
|
|
1426
1368
|
apiHeaders,
|
|
@@ -1428,8 +1370,6 @@ class Databases {
|
|
|
1428
1370
|
);
|
|
1429
1371
|
}
|
|
1430
1372
|
/**
|
|
1431
|
-
* Update URL attribute
|
|
1432
|
-
*
|
|
1433
1373
|
* Update an url attribute. Changing the `default` value will not update already existing documents.
|
|
1434
1374
|
|
|
1435
1375
|
*
|
|
@@ -1442,7 +1382,7 @@ class Databases {
|
|
|
1442
1382
|
* @throws {AppwriteException}
|
|
1443
1383
|
* @returns {Promise<Models.AttributeUrl>}
|
|
1444
1384
|
*/
|
|
1445
|
-
|
|
1385
|
+
updateUrlAttribute(databaseId, collectionId, key, required, xdefault, newKey) {
|
|
1446
1386
|
if (typeof databaseId === "undefined") {
|
|
1447
1387
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1448
1388
|
}
|
|
@@ -1473,7 +1413,7 @@ class Databases {
|
|
|
1473
1413
|
const apiHeaders = {
|
|
1474
1414
|
"content-type": "application/json"
|
|
1475
1415
|
};
|
|
1476
|
-
return
|
|
1416
|
+
return this.client.call(
|
|
1477
1417
|
"patch",
|
|
1478
1418
|
uri,
|
|
1479
1419
|
apiHeaders,
|
|
@@ -1481,8 +1421,6 @@ class Databases {
|
|
|
1481
1421
|
);
|
|
1482
1422
|
}
|
|
1483
1423
|
/**
|
|
1484
|
-
* Get attribute
|
|
1485
|
-
*
|
|
1486
1424
|
* Get attribute by ID.
|
|
1487
1425
|
*
|
|
1488
1426
|
* @param {string} databaseId
|
|
@@ -1491,7 +1429,7 @@ class Databases {
|
|
|
1491
1429
|
* @throws {AppwriteException}
|
|
1492
1430
|
* @returns {Promise<{}>}
|
|
1493
1431
|
*/
|
|
1494
|
-
|
|
1432
|
+
getAttribute(databaseId, collectionId, key) {
|
|
1495
1433
|
if (typeof databaseId === "undefined") {
|
|
1496
1434
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1497
1435
|
}
|
|
@@ -1507,7 +1445,7 @@ class Databases {
|
|
|
1507
1445
|
const apiHeaders = {
|
|
1508
1446
|
"content-type": "application/json"
|
|
1509
1447
|
};
|
|
1510
|
-
return
|
|
1448
|
+
return this.client.call(
|
|
1511
1449
|
"get",
|
|
1512
1450
|
uri,
|
|
1513
1451
|
apiHeaders,
|
|
@@ -1515,8 +1453,6 @@ class Databases {
|
|
|
1515
1453
|
);
|
|
1516
1454
|
}
|
|
1517
1455
|
/**
|
|
1518
|
-
* Delete attribute
|
|
1519
|
-
*
|
|
1520
1456
|
* Deletes an attribute.
|
|
1521
1457
|
*
|
|
1522
1458
|
* @param {string} databaseId
|
|
@@ -1525,7 +1461,7 @@ class Databases {
|
|
|
1525
1461
|
* @throws {AppwriteException}
|
|
1526
1462
|
* @returns {Promise<{}>}
|
|
1527
1463
|
*/
|
|
1528
|
-
|
|
1464
|
+
deleteAttribute(databaseId, collectionId, key) {
|
|
1529
1465
|
if (typeof databaseId === "undefined") {
|
|
1530
1466
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1531
1467
|
}
|
|
@@ -1541,7 +1477,7 @@ class Databases {
|
|
|
1541
1477
|
const apiHeaders = {
|
|
1542
1478
|
"content-type": "application/json"
|
|
1543
1479
|
};
|
|
1544
|
-
return
|
|
1480
|
+
return this.client.call(
|
|
1545
1481
|
"delete",
|
|
1546
1482
|
uri,
|
|
1547
1483
|
apiHeaders,
|
|
@@ -1549,8 +1485,6 @@ class Databases {
|
|
|
1549
1485
|
);
|
|
1550
1486
|
}
|
|
1551
1487
|
/**
|
|
1552
|
-
* Update relationship attribute
|
|
1553
|
-
*
|
|
1554
1488
|
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1555
1489
|
|
|
1556
1490
|
*
|
|
@@ -1562,7 +1496,7 @@ class Databases {
|
|
|
1562
1496
|
* @throws {AppwriteException}
|
|
1563
1497
|
* @returns {Promise<Models.AttributeRelationship>}
|
|
1564
1498
|
*/
|
|
1565
|
-
|
|
1499
|
+
updateRelationshipAttribute(databaseId, collectionId, key, onDelete, newKey) {
|
|
1566
1500
|
if (typeof databaseId === "undefined") {
|
|
1567
1501
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1568
1502
|
}
|
|
@@ -1584,7 +1518,7 @@ class Databases {
|
|
|
1584
1518
|
const apiHeaders = {
|
|
1585
1519
|
"content-type": "application/json"
|
|
1586
1520
|
};
|
|
1587
|
-
return
|
|
1521
|
+
return this.client.call(
|
|
1588
1522
|
"patch",
|
|
1589
1523
|
uri,
|
|
1590
1524
|
apiHeaders,
|
|
@@ -1592,8 +1526,6 @@ class Databases {
|
|
|
1592
1526
|
);
|
|
1593
1527
|
}
|
|
1594
1528
|
/**
|
|
1595
|
-
* List documents
|
|
1596
|
-
*
|
|
1597
1529
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
1598
1530
|
*
|
|
1599
1531
|
* @param {string} databaseId
|
|
@@ -1602,7 +1534,7 @@ class Databases {
|
|
|
1602
1534
|
* @throws {AppwriteException}
|
|
1603
1535
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1604
1536
|
*/
|
|
1605
|
-
|
|
1537
|
+
listDocuments(databaseId, collectionId, queries) {
|
|
1606
1538
|
if (typeof databaseId === "undefined") {
|
|
1607
1539
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1608
1540
|
}
|
|
@@ -1618,7 +1550,7 @@ class Databases {
|
|
|
1618
1550
|
const apiHeaders = {
|
|
1619
1551
|
"content-type": "application/json"
|
|
1620
1552
|
};
|
|
1621
|
-
return
|
|
1553
|
+
return this.client.call(
|
|
1622
1554
|
"get",
|
|
1623
1555
|
uri,
|
|
1624
1556
|
apiHeaders,
|
|
@@ -1626,8 +1558,6 @@ class Databases {
|
|
|
1626
1558
|
);
|
|
1627
1559
|
}
|
|
1628
1560
|
/**
|
|
1629
|
-
* Create document
|
|
1630
|
-
*
|
|
1631
1561
|
* 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.
|
|
1632
1562
|
*
|
|
1633
1563
|
* @param {string} databaseId
|
|
@@ -1638,7 +1568,7 @@ class Databases {
|
|
|
1638
1568
|
* @throws {AppwriteException}
|
|
1639
1569
|
* @returns {Promise<Document>}
|
|
1640
1570
|
*/
|
|
1641
|
-
|
|
1571
|
+
createDocument(databaseId, collectionId, documentId, data, permissions) {
|
|
1642
1572
|
if (typeof databaseId === "undefined") {
|
|
1643
1573
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1644
1574
|
}
|
|
@@ -1666,7 +1596,7 @@ class Databases {
|
|
|
1666
1596
|
const apiHeaders = {
|
|
1667
1597
|
"content-type": "application/json"
|
|
1668
1598
|
};
|
|
1669
|
-
return
|
|
1599
|
+
return this.client.call(
|
|
1670
1600
|
"post",
|
|
1671
1601
|
uri,
|
|
1672
1602
|
apiHeaders,
|
|
@@ -1674,8 +1604,6 @@ class Databases {
|
|
|
1674
1604
|
);
|
|
1675
1605
|
}
|
|
1676
1606
|
/**
|
|
1677
|
-
* Get document
|
|
1678
|
-
*
|
|
1679
1607
|
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
1680
1608
|
*
|
|
1681
1609
|
* @param {string} databaseId
|
|
@@ -1685,7 +1613,7 @@ class Databases {
|
|
|
1685
1613
|
* @throws {AppwriteException}
|
|
1686
1614
|
* @returns {Promise<Document>}
|
|
1687
1615
|
*/
|
|
1688
|
-
|
|
1616
|
+
getDocument(databaseId, collectionId, documentId, queries) {
|
|
1689
1617
|
if (typeof databaseId === "undefined") {
|
|
1690
1618
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1691
1619
|
}
|
|
@@ -1704,7 +1632,7 @@ class Databases {
|
|
|
1704
1632
|
const apiHeaders = {
|
|
1705
1633
|
"content-type": "application/json"
|
|
1706
1634
|
};
|
|
1707
|
-
return
|
|
1635
|
+
return this.client.call(
|
|
1708
1636
|
"get",
|
|
1709
1637
|
uri,
|
|
1710
1638
|
apiHeaders,
|
|
@@ -1712,8 +1640,6 @@ class Databases {
|
|
|
1712
1640
|
);
|
|
1713
1641
|
}
|
|
1714
1642
|
/**
|
|
1715
|
-
* Update document
|
|
1716
|
-
*
|
|
1717
1643
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
1718
1644
|
*
|
|
1719
1645
|
* @param {string} databaseId
|
|
@@ -1724,7 +1650,7 @@ class Databases {
|
|
|
1724
1650
|
* @throws {AppwriteException}
|
|
1725
1651
|
* @returns {Promise<Document>}
|
|
1726
1652
|
*/
|
|
1727
|
-
|
|
1653
|
+
updateDocument(databaseId, collectionId, documentId, data, permissions) {
|
|
1728
1654
|
if (typeof databaseId === "undefined") {
|
|
1729
1655
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1730
1656
|
}
|
|
@@ -1746,7 +1672,7 @@ class Databases {
|
|
|
1746
1672
|
const apiHeaders = {
|
|
1747
1673
|
"content-type": "application/json"
|
|
1748
1674
|
};
|
|
1749
|
-
return
|
|
1675
|
+
return this.client.call(
|
|
1750
1676
|
"patch",
|
|
1751
1677
|
uri,
|
|
1752
1678
|
apiHeaders,
|
|
@@ -1754,8 +1680,6 @@ class Databases {
|
|
|
1754
1680
|
);
|
|
1755
1681
|
}
|
|
1756
1682
|
/**
|
|
1757
|
-
* Delete document
|
|
1758
|
-
*
|
|
1759
1683
|
* Delete a document by its unique ID.
|
|
1760
1684
|
*
|
|
1761
1685
|
* @param {string} databaseId
|
|
@@ -1764,7 +1688,7 @@ class Databases {
|
|
|
1764
1688
|
* @throws {AppwriteException}
|
|
1765
1689
|
* @returns {Promise<{}>}
|
|
1766
1690
|
*/
|
|
1767
|
-
|
|
1691
|
+
deleteDocument(databaseId, collectionId, documentId) {
|
|
1768
1692
|
if (typeof databaseId === "undefined") {
|
|
1769
1693
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1770
1694
|
}
|
|
@@ -1780,7 +1704,7 @@ class Databases {
|
|
|
1780
1704
|
const apiHeaders = {
|
|
1781
1705
|
"content-type": "application/json"
|
|
1782
1706
|
};
|
|
1783
|
-
return
|
|
1707
|
+
return this.client.call(
|
|
1784
1708
|
"delete",
|
|
1785
1709
|
uri,
|
|
1786
1710
|
apiHeaders,
|
|
@@ -1788,8 +1712,6 @@ class Databases {
|
|
|
1788
1712
|
);
|
|
1789
1713
|
}
|
|
1790
1714
|
/**
|
|
1791
|
-
* List indexes
|
|
1792
|
-
*
|
|
1793
1715
|
* List indexes in the collection.
|
|
1794
1716
|
*
|
|
1795
1717
|
* @param {string} databaseId
|
|
@@ -1798,7 +1720,7 @@ class Databases {
|
|
|
1798
1720
|
* @throws {AppwriteException}
|
|
1799
1721
|
* @returns {Promise<Models.IndexList>}
|
|
1800
1722
|
*/
|
|
1801
|
-
|
|
1723
|
+
listIndexes(databaseId, collectionId, queries) {
|
|
1802
1724
|
if (typeof databaseId === "undefined") {
|
|
1803
1725
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1804
1726
|
}
|
|
@@ -1814,7 +1736,7 @@ class Databases {
|
|
|
1814
1736
|
const apiHeaders = {
|
|
1815
1737
|
"content-type": "application/json"
|
|
1816
1738
|
};
|
|
1817
|
-
return
|
|
1739
|
+
return this.client.call(
|
|
1818
1740
|
"get",
|
|
1819
1741
|
uri,
|
|
1820
1742
|
apiHeaders,
|
|
@@ -1822,8 +1744,6 @@ class Databases {
|
|
|
1822
1744
|
);
|
|
1823
1745
|
}
|
|
1824
1746
|
/**
|
|
1825
|
-
* Create index
|
|
1826
|
-
*
|
|
1827
1747
|
* Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
|
|
1828
1748
|
Attributes can be `key`, `fulltext`, and `unique`.
|
|
1829
1749
|
*
|
|
@@ -1836,7 +1756,7 @@ class Databases {
|
|
|
1836
1756
|
* @throws {AppwriteException}
|
|
1837
1757
|
* @returns {Promise<Models.Index>}
|
|
1838
1758
|
*/
|
|
1839
|
-
|
|
1759
|
+
createIndex(databaseId, collectionId, key, type, attributes, orders) {
|
|
1840
1760
|
if (typeof databaseId === "undefined") {
|
|
1841
1761
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1842
1762
|
}
|
|
@@ -1870,7 +1790,7 @@ class Databases {
|
|
|
1870
1790
|
const apiHeaders = {
|
|
1871
1791
|
"content-type": "application/json"
|
|
1872
1792
|
};
|
|
1873
|
-
return
|
|
1793
|
+
return this.client.call(
|
|
1874
1794
|
"post",
|
|
1875
1795
|
uri,
|
|
1876
1796
|
apiHeaders,
|
|
@@ -1878,8 +1798,6 @@ class Databases {
|
|
|
1878
1798
|
);
|
|
1879
1799
|
}
|
|
1880
1800
|
/**
|
|
1881
|
-
* Get index
|
|
1882
|
-
*
|
|
1883
1801
|
* Get index by ID.
|
|
1884
1802
|
*
|
|
1885
1803
|
* @param {string} databaseId
|
|
@@ -1888,7 +1806,7 @@ class Databases {
|
|
|
1888
1806
|
* @throws {AppwriteException}
|
|
1889
1807
|
* @returns {Promise<Models.Index>}
|
|
1890
1808
|
*/
|
|
1891
|
-
|
|
1809
|
+
getIndex(databaseId, collectionId, key) {
|
|
1892
1810
|
if (typeof databaseId === "undefined") {
|
|
1893
1811
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1894
1812
|
}
|
|
@@ -1904,7 +1822,7 @@ class Databases {
|
|
|
1904
1822
|
const apiHeaders = {
|
|
1905
1823
|
"content-type": "application/json"
|
|
1906
1824
|
};
|
|
1907
|
-
return
|
|
1825
|
+
return this.client.call(
|
|
1908
1826
|
"get",
|
|
1909
1827
|
uri,
|
|
1910
1828
|
apiHeaders,
|
|
@@ -1912,8 +1830,6 @@ class Databases {
|
|
|
1912
1830
|
);
|
|
1913
1831
|
}
|
|
1914
1832
|
/**
|
|
1915
|
-
* Delete index
|
|
1916
|
-
*
|
|
1917
1833
|
* Delete an index.
|
|
1918
1834
|
*
|
|
1919
1835
|
* @param {string} databaseId
|
|
@@ -1922,7 +1838,7 @@ class Databases {
|
|
|
1922
1838
|
* @throws {AppwriteException}
|
|
1923
1839
|
* @returns {Promise<{}>}
|
|
1924
1840
|
*/
|
|
1925
|
-
|
|
1841
|
+
deleteIndex(databaseId, collectionId, key) {
|
|
1926
1842
|
if (typeof databaseId === "undefined") {
|
|
1927
1843
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1928
1844
|
}
|
|
@@ -1938,7 +1854,7 @@ class Databases {
|
|
|
1938
1854
|
const apiHeaders = {
|
|
1939
1855
|
"content-type": "application/json"
|
|
1940
1856
|
};
|
|
1941
|
-
return
|
|
1857
|
+
return this.client.call(
|
|
1942
1858
|
"delete",
|
|
1943
1859
|
uri,
|
|
1944
1860
|
apiHeaders,
|