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