node-appwrite 9.0.0 → 10.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/README.md +2 -2
- package/docs/examples/account/create-phone-verification.md +1 -1
- package/docs/examples/account/create-recovery.md +1 -1
- package/docs/examples/account/create-verification.md +1 -1
- package/docs/examples/account/delete-identity.md +20 -0
- package/docs/examples/account/delete-session.md +1 -1
- package/docs/examples/account/delete-sessions.md +1 -1
- package/docs/examples/account/get-prefs.md +1 -1
- package/docs/examples/account/get-session.md +1 -1
- package/docs/examples/account/get.md +1 -1
- package/docs/examples/account/list-identities.md +20 -0
- package/docs/examples/account/list-logs.md +1 -1
- package/docs/examples/account/list-sessions.md +1 -1
- package/docs/examples/account/update-email.md +1 -1
- package/docs/examples/account/update-name.md +1 -1
- package/docs/examples/account/update-password.md +1 -1
- package/docs/examples/account/update-phone-verification.md +1 -1
- package/docs/examples/account/update-phone.md +1 -1
- package/docs/examples/account/update-prefs.md +1 -1
- package/docs/examples/account/update-recovery.md +1 -1
- package/docs/examples/account/update-session.md +1 -1
- package/docs/examples/account/update-status.md +1 -1
- package/docs/examples/account/update-verification.md +1 -1
- package/docs/examples/avatars/get-browser.md +1 -1
- package/docs/examples/avatars/get-credit-card.md +1 -1
- package/docs/examples/avatars/get-favicon.md +1 -1
- package/docs/examples/avatars/get-flag.md +1 -1
- package/docs/examples/avatars/get-image.md +1 -1
- package/docs/examples/avatars/get-initials.md +1 -1
- package/docs/examples/avatars/get-q-r.md +1 -1
- package/docs/examples/databases/create-boolean-attribute.md +1 -1
- package/docs/examples/databases/create-collection.md +1 -1
- package/docs/examples/databases/create-datetime-attribute.md +1 -1
- package/docs/examples/databases/create-document.md +1 -1
- package/docs/examples/databases/create-email-attribute.md +1 -1
- package/docs/examples/databases/create-enum-attribute.md +1 -1
- package/docs/examples/databases/create-float-attribute.md +1 -1
- package/docs/examples/databases/create-index.md +1 -1
- package/docs/examples/databases/create-integer-attribute.md +1 -1
- package/docs/examples/databases/create-ip-attribute.md +1 -1
- package/docs/examples/databases/create-relationship-attribute.md +1 -1
- package/docs/examples/databases/create-string-attribute.md +1 -1
- package/docs/examples/databases/create-url-attribute.md +1 -1
- package/docs/examples/databases/create.md +1 -1
- package/docs/examples/databases/delete-attribute.md +1 -1
- package/docs/examples/databases/delete-collection.md +1 -1
- package/docs/examples/databases/delete-document.md +1 -1
- package/docs/examples/databases/delete-index.md +1 -1
- package/docs/examples/databases/delete.md +1 -1
- package/docs/examples/databases/get-attribute.md +1 -1
- package/docs/examples/databases/get-collection.md +1 -1
- package/docs/examples/databases/get-document.md +1 -1
- package/docs/examples/databases/get-index.md +1 -1
- package/docs/examples/databases/get.md +1 -1
- package/docs/examples/databases/list-attributes.md +1 -1
- package/docs/examples/databases/list-collections.md +1 -1
- package/docs/examples/databases/list-documents.md +1 -1
- package/docs/examples/databases/list-indexes.md +1 -1
- package/docs/examples/databases/list.md +1 -1
- package/docs/examples/databases/update-boolean-attribute.md +1 -1
- package/docs/examples/databases/update-collection.md +1 -1
- package/docs/examples/databases/update-datetime-attribute.md +1 -1
- package/docs/examples/databases/update-document.md +1 -1
- package/docs/examples/databases/update-email-attribute.md +1 -1
- package/docs/examples/databases/update-enum-attribute.md +1 -1
- package/docs/examples/databases/update-float-attribute.md +1 -1
- package/docs/examples/databases/update-integer-attribute.md +1 -1
- package/docs/examples/databases/update-ip-attribute.md +1 -1
- package/docs/examples/databases/update-relationship-attribute.md +1 -1
- package/docs/examples/databases/update-string-attribute.md +1 -1
- package/docs/examples/databases/update-url-attribute.md +1 -1
- package/docs/examples/databases/update.md +1 -1
- package/docs/examples/functions/create-build.md +1 -1
- package/docs/examples/functions/create-deployment.md +2 -2
- package/docs/examples/functions/create-execution.md +1 -1
- package/docs/examples/functions/create-variable.md +1 -1
- package/docs/examples/functions/create.md +1 -1
- package/docs/examples/functions/delete-deployment.md +1 -1
- package/docs/examples/functions/delete-variable.md +1 -1
- package/docs/examples/functions/delete.md +1 -1
- package/docs/examples/functions/download-deployment.md +20 -0
- package/docs/examples/functions/get-deployment.md +1 -1
- package/docs/examples/functions/get-execution.md +1 -1
- package/docs/examples/functions/get-variable.md +1 -1
- package/docs/examples/functions/get.md +1 -1
- package/docs/examples/functions/list-deployments.md +1 -1
- package/docs/examples/functions/list-executions.md +1 -1
- package/docs/examples/functions/list-runtimes.md +1 -1
- package/docs/examples/functions/list-variables.md +1 -1
- package/docs/examples/functions/list.md +1 -1
- package/docs/examples/functions/update-deployment.md +1 -1
- package/docs/examples/functions/update-variable.md +1 -1
- package/docs/examples/functions/update.md +2 -2
- package/docs/examples/graphql/mutation.md +1 -1
- package/docs/examples/graphql/query.md +1 -1
- package/docs/examples/health/get-antivirus.md +1 -1
- package/docs/examples/health/get-cache.md +1 -1
- package/docs/examples/health/get-d-b.md +1 -1
- package/docs/examples/health/get-pub-sub.md +20 -0
- package/docs/examples/health/get-queue-certificates.md +1 -1
- package/docs/examples/health/get-queue-functions.md +1 -1
- package/docs/examples/health/get-queue-logs.md +1 -1
- package/docs/examples/health/get-queue-webhooks.md +1 -1
- package/docs/examples/health/get-queue.md +20 -0
- package/docs/examples/health/get-storage-local.md +1 -1
- package/docs/examples/health/get-time.md +1 -1
- package/docs/examples/health/get.md +1 -1
- package/docs/examples/locale/get.md +1 -1
- package/docs/examples/locale/list-codes.md +20 -0
- package/docs/examples/locale/list-continents.md +1 -1
- package/docs/examples/locale/list-countries-e-u.md +1 -1
- package/docs/examples/locale/list-countries-phones.md +1 -1
- package/docs/examples/locale/list-countries.md +1 -1
- package/docs/examples/locale/list-currencies.md +1 -1
- package/docs/examples/locale/list-languages.md +1 -1
- package/docs/examples/storage/create-bucket.md +1 -1
- package/docs/examples/storage/create-file.md +1 -1
- package/docs/examples/storage/delete-bucket.md +1 -1
- package/docs/examples/storage/delete-file.md +1 -1
- package/docs/examples/storage/get-bucket.md +1 -1
- package/docs/examples/storage/get-file-download.md +1 -1
- package/docs/examples/storage/get-file-preview.md +1 -1
- package/docs/examples/storage/get-file-view.md +1 -1
- package/docs/examples/storage/get-file.md +1 -1
- package/docs/examples/storage/list-buckets.md +1 -1
- package/docs/examples/storage/list-files.md +1 -1
- package/docs/examples/storage/update-bucket.md +1 -1
- package/docs/examples/storage/update-file.md +1 -1
- package/docs/examples/teams/create-membership.md +1 -1
- package/docs/examples/teams/create.md +1 -1
- package/docs/examples/teams/delete-membership.md +1 -1
- package/docs/examples/teams/delete.md +1 -1
- package/docs/examples/teams/get-membership.md +1 -1
- package/docs/examples/teams/get-prefs.md +1 -1
- package/docs/examples/teams/get.md +1 -1
- package/docs/examples/teams/list-memberships.md +1 -1
- package/docs/examples/teams/list.md +1 -1
- package/docs/examples/teams/update-membership-status.md +1 -1
- package/docs/examples/teams/{update-membership-roles.md → update-membership.md} +2 -2
- package/docs/examples/teams/update-name.md +1 -1
- package/docs/examples/teams/update-prefs.md +1 -1
- package/docs/examples/users/create-argon2user.md +1 -1
- package/docs/examples/users/create-bcrypt-user.md +1 -1
- package/docs/examples/users/create-m-d5user.md +1 -1
- package/docs/examples/users/create-p-h-pass-user.md +1 -1
- package/docs/examples/users/create-s-h-a-user.md +1 -1
- package/docs/examples/users/create-scrypt-modified-user.md +1 -1
- package/docs/examples/users/create-scrypt-user.md +1 -1
- package/docs/examples/users/create.md +1 -1
- package/docs/examples/users/delete-identity.md +20 -0
- package/docs/examples/users/delete-session.md +1 -1
- package/docs/examples/users/delete-sessions.md +1 -1
- package/docs/examples/users/delete.md +1 -1
- package/docs/examples/users/get-prefs.md +1 -1
- package/docs/examples/users/get.md +1 -1
- package/docs/examples/users/list-identities.md +20 -0
- package/docs/examples/users/list-logs.md +1 -1
- package/docs/examples/users/list-memberships.md +1 -1
- package/docs/examples/users/list-sessions.md +1 -1
- package/docs/examples/users/list.md +1 -1
- package/docs/examples/users/update-email-verification.md +1 -1
- package/docs/examples/users/update-email.md +1 -1
- package/docs/examples/users/update-labels.md +20 -0
- package/docs/examples/users/update-name.md +1 -1
- package/docs/examples/users/update-password.md +1 -1
- package/docs/examples/users/update-phone-verification.md +1 -1
- package/docs/examples/users/update-phone.md +1 -1
- package/docs/examples/users/update-prefs.md +1 -1
- package/docs/examples/users/update-status.md +1 -1
- package/index.d.ts +435 -55
- package/lib/client.js +4 -2
- package/lib/role.js +74 -3
- package/lib/services/account.js +94 -50
- package/lib/services/avatars.js +14 -14
- package/lib/services/databases.js +120 -90
- package/lib/services/functions.js +223 -65
- package/lib/services/graphql.js +4 -4
- package/lib/services/health.js +57 -22
- package/lib/services/locale.js +32 -14
- package/lib/services/storage.js +44 -34
- package/lib/services/teams.js +29 -28
- package/lib/services/users.js +135 -50
- package/package.json +2 -2
|
@@ -26,7 +26,7 @@ class Databases extends Service {
|
|
|
26
26
|
* @returns {Promise}
|
|
27
27
|
*/
|
|
28
28
|
async list(queries, search) {
|
|
29
|
-
|
|
29
|
+
const apiPath = '/databases';
|
|
30
30
|
let payload = {};
|
|
31
31
|
|
|
32
32
|
if (typeof queries !== 'undefined') {
|
|
@@ -37,7 +37,7 @@ class Databases extends Service {
|
|
|
37
37
|
payload['search'] = search;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
return await this.client.call('get',
|
|
40
|
+
return await this.client.call('get', apiPath, {
|
|
41
41
|
'content-type': 'application/json',
|
|
42
42
|
}, payload);
|
|
43
43
|
}
|
|
@@ -50,11 +50,12 @@ class Databases extends Service {
|
|
|
50
50
|
*
|
|
51
51
|
* @param {string} databaseId
|
|
52
52
|
* @param {string} name
|
|
53
|
+
* @param {boolean} enabled
|
|
53
54
|
* @throws {AppwriteException}
|
|
54
55
|
* @returns {Promise}
|
|
55
56
|
*/
|
|
56
|
-
async create(databaseId, name) {
|
|
57
|
-
|
|
57
|
+
async create(databaseId, name, enabled) {
|
|
58
|
+
const apiPath = '/databases';
|
|
58
59
|
let payload = {};
|
|
59
60
|
if (typeof databaseId === 'undefined') {
|
|
60
61
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -73,7 +74,11 @@ class Databases extends Service {
|
|
|
73
74
|
payload['name'] = name;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
if (typeof enabled !== 'undefined') {
|
|
78
|
+
payload['enabled'] = enabled;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return await this.client.call('post', apiPath, {
|
|
77
82
|
'content-type': 'application/json',
|
|
78
83
|
}, payload);
|
|
79
84
|
}
|
|
@@ -89,14 +94,14 @@ class Databases extends Service {
|
|
|
89
94
|
* @returns {Promise}
|
|
90
95
|
*/
|
|
91
96
|
async get(databaseId) {
|
|
92
|
-
|
|
97
|
+
const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
|
|
93
98
|
let payload = {};
|
|
94
99
|
if (typeof databaseId === 'undefined') {
|
|
95
100
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
96
101
|
}
|
|
97
102
|
|
|
98
103
|
|
|
99
|
-
return await this.client.call('get',
|
|
104
|
+
return await this.client.call('get', apiPath, {
|
|
100
105
|
'content-type': 'application/json',
|
|
101
106
|
}, payload);
|
|
102
107
|
}
|
|
@@ -108,11 +113,12 @@ class Databases extends Service {
|
|
|
108
113
|
*
|
|
109
114
|
* @param {string} databaseId
|
|
110
115
|
* @param {string} name
|
|
116
|
+
* @param {boolean} enabled
|
|
111
117
|
* @throws {AppwriteException}
|
|
112
118
|
* @returns {Promise}
|
|
113
119
|
*/
|
|
114
|
-
async update(databaseId, name) {
|
|
115
|
-
|
|
120
|
+
async update(databaseId, name, enabled) {
|
|
121
|
+
const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
|
|
116
122
|
let payload = {};
|
|
117
123
|
if (typeof databaseId === 'undefined') {
|
|
118
124
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -127,7 +133,11 @@ class Databases extends Service {
|
|
|
127
133
|
payload['name'] = name;
|
|
128
134
|
}
|
|
129
135
|
|
|
130
|
-
|
|
136
|
+
if (typeof enabled !== 'undefined') {
|
|
137
|
+
payload['enabled'] = enabled;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return await this.client.call('put', apiPath, {
|
|
131
141
|
'content-type': 'application/json',
|
|
132
142
|
}, payload);
|
|
133
143
|
}
|
|
@@ -143,14 +153,14 @@ class Databases extends Service {
|
|
|
143
153
|
* @returns {Promise}
|
|
144
154
|
*/
|
|
145
155
|
async delete(databaseId) {
|
|
146
|
-
|
|
156
|
+
const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
|
|
147
157
|
let payload = {};
|
|
148
158
|
if (typeof databaseId === 'undefined') {
|
|
149
159
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
150
160
|
}
|
|
151
161
|
|
|
152
162
|
|
|
153
|
-
return await this.client.call('delete',
|
|
163
|
+
return await this.client.call('delete', apiPath, {
|
|
154
164
|
'content-type': 'application/json',
|
|
155
165
|
}, payload);
|
|
156
166
|
}
|
|
@@ -168,7 +178,7 @@ class Databases extends Service {
|
|
|
168
178
|
* @returns {Promise}
|
|
169
179
|
*/
|
|
170
180
|
async listCollections(databaseId, queries, search) {
|
|
171
|
-
|
|
181
|
+
const apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
|
|
172
182
|
let payload = {};
|
|
173
183
|
if (typeof databaseId === 'undefined') {
|
|
174
184
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -183,7 +193,7 @@ class Databases extends Service {
|
|
|
183
193
|
payload['search'] = search;
|
|
184
194
|
}
|
|
185
195
|
|
|
186
|
-
return await this.client.call('get',
|
|
196
|
+
return await this.client.call('get', apiPath, {
|
|
187
197
|
'content-type': 'application/json',
|
|
188
198
|
}, payload);
|
|
189
199
|
}
|
|
@@ -201,11 +211,12 @@ class Databases extends Service {
|
|
|
201
211
|
* @param {string} name
|
|
202
212
|
* @param {string[]} permissions
|
|
203
213
|
* @param {boolean} documentSecurity
|
|
214
|
+
* @param {boolean} enabled
|
|
204
215
|
* @throws {AppwriteException}
|
|
205
216
|
* @returns {Promise}
|
|
206
217
|
*/
|
|
207
|
-
async createCollection(databaseId, collectionId, name, permissions, documentSecurity) {
|
|
208
|
-
|
|
218
|
+
async createCollection(databaseId, collectionId, name, permissions, documentSecurity, enabled) {
|
|
219
|
+
const apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
|
|
209
220
|
let payload = {};
|
|
210
221
|
if (typeof databaseId === 'undefined') {
|
|
211
222
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -236,7 +247,11 @@ class Databases extends Service {
|
|
|
236
247
|
payload['documentSecurity'] = documentSecurity;
|
|
237
248
|
}
|
|
238
249
|
|
|
239
|
-
|
|
250
|
+
if (typeof enabled !== 'undefined') {
|
|
251
|
+
payload['enabled'] = enabled;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return await this.client.call('post', apiPath, {
|
|
240
255
|
'content-type': 'application/json',
|
|
241
256
|
}, payload);
|
|
242
257
|
}
|
|
@@ -253,7 +268,7 @@ class Databases extends Service {
|
|
|
253
268
|
* @returns {Promise}
|
|
254
269
|
*/
|
|
255
270
|
async getCollection(databaseId, collectionId) {
|
|
256
|
-
|
|
271
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
257
272
|
let payload = {};
|
|
258
273
|
if (typeof databaseId === 'undefined') {
|
|
259
274
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -264,7 +279,7 @@ class Databases extends Service {
|
|
|
264
279
|
}
|
|
265
280
|
|
|
266
281
|
|
|
267
|
-
return await this.client.call('get',
|
|
282
|
+
return await this.client.call('get', apiPath, {
|
|
268
283
|
'content-type': 'application/json',
|
|
269
284
|
}, payload);
|
|
270
285
|
}
|
|
@@ -284,7 +299,7 @@ class Databases extends Service {
|
|
|
284
299
|
* @returns {Promise}
|
|
285
300
|
*/
|
|
286
301
|
async updateCollection(databaseId, collectionId, name, permissions, documentSecurity, enabled) {
|
|
287
|
-
|
|
302
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
288
303
|
let payload = {};
|
|
289
304
|
if (typeof databaseId === 'undefined') {
|
|
290
305
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -315,7 +330,7 @@ class Databases extends Service {
|
|
|
315
330
|
payload['enabled'] = enabled;
|
|
316
331
|
}
|
|
317
332
|
|
|
318
|
-
return await this.client.call('put',
|
|
333
|
+
return await this.client.call('put', apiPath, {
|
|
319
334
|
'content-type': 'application/json',
|
|
320
335
|
}, payload);
|
|
321
336
|
}
|
|
@@ -332,7 +347,7 @@ class Databases extends Service {
|
|
|
332
347
|
* @returns {Promise}
|
|
333
348
|
*/
|
|
334
349
|
async deleteCollection(databaseId, collectionId) {
|
|
335
|
-
|
|
350
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
336
351
|
let payload = {};
|
|
337
352
|
if (typeof databaseId === 'undefined') {
|
|
338
353
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -343,7 +358,7 @@ class Databases extends Service {
|
|
|
343
358
|
}
|
|
344
359
|
|
|
345
360
|
|
|
346
|
-
return await this.client.call('delete',
|
|
361
|
+
return await this.client.call('delete', apiPath, {
|
|
347
362
|
'content-type': 'application/json',
|
|
348
363
|
}, payload);
|
|
349
364
|
}
|
|
@@ -353,11 +368,12 @@ class Databases extends Service {
|
|
|
353
368
|
*
|
|
354
369
|
* @param {string} databaseId
|
|
355
370
|
* @param {string} collectionId
|
|
371
|
+
* @param {string[]} queries
|
|
356
372
|
* @throws {AppwriteException}
|
|
357
373
|
* @returns {Promise}
|
|
358
374
|
*/
|
|
359
|
-
async listAttributes(databaseId, collectionId) {
|
|
360
|
-
|
|
375
|
+
async listAttributes(databaseId, collectionId, queries) {
|
|
376
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
361
377
|
let payload = {};
|
|
362
378
|
if (typeof databaseId === 'undefined') {
|
|
363
379
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -368,7 +384,11 @@ class Databases extends Service {
|
|
|
368
384
|
}
|
|
369
385
|
|
|
370
386
|
|
|
371
|
-
|
|
387
|
+
if (typeof queries !== 'undefined') {
|
|
388
|
+
payload['queries'] = queries;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
return await this.client.call('get', apiPath, {
|
|
372
392
|
'content-type': 'application/json',
|
|
373
393
|
}, payload);
|
|
374
394
|
}
|
|
@@ -389,7 +409,7 @@ class Databases extends Service {
|
|
|
389
409
|
* @returns {Promise}
|
|
390
410
|
*/
|
|
391
411
|
async createBooleanAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
392
|
-
|
|
412
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
393
413
|
let payload = {};
|
|
394
414
|
if (typeof databaseId === 'undefined') {
|
|
395
415
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -424,7 +444,7 @@ class Databases extends Service {
|
|
|
424
444
|
payload['array'] = array;
|
|
425
445
|
}
|
|
426
446
|
|
|
427
|
-
return await this.client.call('post',
|
|
447
|
+
return await this.client.call('post', apiPath, {
|
|
428
448
|
'content-type': 'application/json',
|
|
429
449
|
}, payload);
|
|
430
450
|
}
|
|
@@ -441,7 +461,7 @@ class Databases extends Service {
|
|
|
441
461
|
* @returns {Promise}
|
|
442
462
|
*/
|
|
443
463
|
async updateBooleanAttribute(databaseId, collectionId, key, required, xdefault) {
|
|
444
|
-
|
|
464
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
445
465
|
let payload = {};
|
|
446
466
|
if (typeof databaseId === 'undefined') {
|
|
447
467
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -472,7 +492,7 @@ class Databases extends Service {
|
|
|
472
492
|
payload['default'] = xdefault;
|
|
473
493
|
}
|
|
474
494
|
|
|
475
|
-
return await this.client.call('patch',
|
|
495
|
+
return await this.client.call('patch', apiPath, {
|
|
476
496
|
'content-type': 'application/json',
|
|
477
497
|
}, payload);
|
|
478
498
|
}
|
|
@@ -490,7 +510,7 @@ class Databases extends Service {
|
|
|
490
510
|
* @returns {Promise}
|
|
491
511
|
*/
|
|
492
512
|
async createDatetimeAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
493
|
-
|
|
513
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
494
514
|
let payload = {};
|
|
495
515
|
if (typeof databaseId === 'undefined') {
|
|
496
516
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -525,7 +545,7 @@ class Databases extends Service {
|
|
|
525
545
|
payload['array'] = array;
|
|
526
546
|
}
|
|
527
547
|
|
|
528
|
-
return await this.client.call('post',
|
|
548
|
+
return await this.client.call('post', apiPath, {
|
|
529
549
|
'content-type': 'application/json',
|
|
530
550
|
}, payload);
|
|
531
551
|
}
|
|
@@ -542,7 +562,7 @@ class Databases extends Service {
|
|
|
542
562
|
* @returns {Promise}
|
|
543
563
|
*/
|
|
544
564
|
async updateDatetimeAttribute(databaseId, collectionId, key, required, xdefault) {
|
|
545
|
-
|
|
565
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
546
566
|
let payload = {};
|
|
547
567
|
if (typeof databaseId === 'undefined') {
|
|
548
568
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -573,7 +593,7 @@ class Databases extends Service {
|
|
|
573
593
|
payload['default'] = xdefault;
|
|
574
594
|
}
|
|
575
595
|
|
|
576
|
-
return await this.client.call('patch',
|
|
596
|
+
return await this.client.call('patch', apiPath, {
|
|
577
597
|
'content-type': 'application/json',
|
|
578
598
|
}, payload);
|
|
579
599
|
}
|
|
@@ -594,7 +614,7 @@ class Databases extends Service {
|
|
|
594
614
|
* @returns {Promise}
|
|
595
615
|
*/
|
|
596
616
|
async createEmailAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
597
|
-
|
|
617
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
598
618
|
let payload = {};
|
|
599
619
|
if (typeof databaseId === 'undefined') {
|
|
600
620
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -629,7 +649,7 @@ class Databases extends Service {
|
|
|
629
649
|
payload['array'] = array;
|
|
630
650
|
}
|
|
631
651
|
|
|
632
|
-
return await this.client.call('post',
|
|
652
|
+
return await this.client.call('post', apiPath, {
|
|
633
653
|
'content-type': 'application/json',
|
|
634
654
|
}, payload);
|
|
635
655
|
}
|
|
@@ -650,7 +670,7 @@ class Databases extends Service {
|
|
|
650
670
|
* @returns {Promise}
|
|
651
671
|
*/
|
|
652
672
|
async updateEmailAttribute(databaseId, collectionId, key, required, xdefault) {
|
|
653
|
-
|
|
673
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
654
674
|
let payload = {};
|
|
655
675
|
if (typeof databaseId === 'undefined') {
|
|
656
676
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -681,7 +701,7 @@ class Databases extends Service {
|
|
|
681
701
|
payload['default'] = xdefault;
|
|
682
702
|
}
|
|
683
703
|
|
|
684
|
-
return await this.client.call('patch',
|
|
704
|
+
return await this.client.call('patch', apiPath, {
|
|
685
705
|
'content-type': 'application/json',
|
|
686
706
|
}, payload);
|
|
687
707
|
}
|
|
@@ -700,7 +720,7 @@ class Databases extends Service {
|
|
|
700
720
|
* @returns {Promise}
|
|
701
721
|
*/
|
|
702
722
|
async createEnumAttribute(databaseId, collectionId, key, elements, required, xdefault, array) {
|
|
703
|
-
|
|
723
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
704
724
|
let payload = {};
|
|
705
725
|
if (typeof databaseId === 'undefined') {
|
|
706
726
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -743,7 +763,7 @@ class Databases extends Service {
|
|
|
743
763
|
payload['array'] = array;
|
|
744
764
|
}
|
|
745
765
|
|
|
746
|
-
return await this.client.call('post',
|
|
766
|
+
return await this.client.call('post', apiPath, {
|
|
747
767
|
'content-type': 'application/json',
|
|
748
768
|
}, payload);
|
|
749
769
|
}
|
|
@@ -765,7 +785,7 @@ class Databases extends Service {
|
|
|
765
785
|
* @returns {Promise}
|
|
766
786
|
*/
|
|
767
787
|
async updateEnumAttribute(databaseId, collectionId, key, elements, required, xdefault) {
|
|
768
|
-
|
|
788
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
769
789
|
let payload = {};
|
|
770
790
|
if (typeof databaseId === 'undefined') {
|
|
771
791
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -804,7 +824,7 @@ class Databases extends Service {
|
|
|
804
824
|
payload['default'] = xdefault;
|
|
805
825
|
}
|
|
806
826
|
|
|
807
|
-
return await this.client.call('patch',
|
|
827
|
+
return await this.client.call('patch', apiPath, {
|
|
808
828
|
'content-type': 'application/json',
|
|
809
829
|
}, payload);
|
|
810
830
|
}
|
|
@@ -828,7 +848,7 @@ class Databases extends Service {
|
|
|
828
848
|
* @returns {Promise}
|
|
829
849
|
*/
|
|
830
850
|
async createFloatAttribute(databaseId, collectionId, key, required, min, max, xdefault, array) {
|
|
831
|
-
|
|
851
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
832
852
|
let payload = {};
|
|
833
853
|
if (typeof databaseId === 'undefined') {
|
|
834
854
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -871,7 +891,7 @@ class Databases extends Service {
|
|
|
871
891
|
payload['array'] = array;
|
|
872
892
|
}
|
|
873
893
|
|
|
874
|
-
return await this.client.call('post',
|
|
894
|
+
return await this.client.call('post', apiPath, {
|
|
875
895
|
'content-type': 'application/json',
|
|
876
896
|
}, payload);
|
|
877
897
|
}
|
|
@@ -894,7 +914,7 @@ class Databases extends Service {
|
|
|
894
914
|
* @returns {Promise}
|
|
895
915
|
*/
|
|
896
916
|
async updateFloatAttribute(databaseId, collectionId, key, required, min, max, xdefault) {
|
|
897
|
-
|
|
917
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
898
918
|
let payload = {};
|
|
899
919
|
if (typeof databaseId === 'undefined') {
|
|
900
920
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -941,7 +961,7 @@ class Databases extends Service {
|
|
|
941
961
|
payload['default'] = xdefault;
|
|
942
962
|
}
|
|
943
963
|
|
|
944
|
-
return await this.client.call('patch',
|
|
964
|
+
return await this.client.call('patch', apiPath, {
|
|
945
965
|
'content-type': 'application/json',
|
|
946
966
|
}, payload);
|
|
947
967
|
}
|
|
@@ -965,7 +985,7 @@ class Databases extends Service {
|
|
|
965
985
|
* @returns {Promise}
|
|
966
986
|
*/
|
|
967
987
|
async createIntegerAttribute(databaseId, collectionId, key, required, min, max, xdefault, array) {
|
|
968
|
-
|
|
988
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
969
989
|
let payload = {};
|
|
970
990
|
if (typeof databaseId === 'undefined') {
|
|
971
991
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1008,7 +1028,7 @@ class Databases extends Service {
|
|
|
1008
1028
|
payload['array'] = array;
|
|
1009
1029
|
}
|
|
1010
1030
|
|
|
1011
|
-
return await this.client.call('post',
|
|
1031
|
+
return await this.client.call('post', apiPath, {
|
|
1012
1032
|
'content-type': 'application/json',
|
|
1013
1033
|
}, payload);
|
|
1014
1034
|
}
|
|
@@ -1031,7 +1051,7 @@ class Databases extends Service {
|
|
|
1031
1051
|
* @returns {Promise}
|
|
1032
1052
|
*/
|
|
1033
1053
|
async updateIntegerAttribute(databaseId, collectionId, key, required, min, max, xdefault) {
|
|
1034
|
-
|
|
1054
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1035
1055
|
let payload = {};
|
|
1036
1056
|
if (typeof databaseId === 'undefined') {
|
|
1037
1057
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1078,7 +1098,7 @@ class Databases extends Service {
|
|
|
1078
1098
|
payload['default'] = xdefault;
|
|
1079
1099
|
}
|
|
1080
1100
|
|
|
1081
|
-
return await this.client.call('patch',
|
|
1101
|
+
return await this.client.call('patch', apiPath, {
|
|
1082
1102
|
'content-type': 'application/json',
|
|
1083
1103
|
}, payload);
|
|
1084
1104
|
}
|
|
@@ -1099,7 +1119,7 @@ class Databases extends Service {
|
|
|
1099
1119
|
* @returns {Promise}
|
|
1100
1120
|
*/
|
|
1101
1121
|
async createIpAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
1102
|
-
|
|
1122
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1103
1123
|
let payload = {};
|
|
1104
1124
|
if (typeof databaseId === 'undefined') {
|
|
1105
1125
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1134,7 +1154,7 @@ class Databases extends Service {
|
|
|
1134
1154
|
payload['array'] = array;
|
|
1135
1155
|
}
|
|
1136
1156
|
|
|
1137
|
-
return await this.client.call('post',
|
|
1157
|
+
return await this.client.call('post', apiPath, {
|
|
1138
1158
|
'content-type': 'application/json',
|
|
1139
1159
|
}, payload);
|
|
1140
1160
|
}
|
|
@@ -1155,7 +1175,7 @@ class Databases extends Service {
|
|
|
1155
1175
|
* @returns {Promise}
|
|
1156
1176
|
*/
|
|
1157
1177
|
async updateIpAttribute(databaseId, collectionId, key, required, xdefault) {
|
|
1158
|
-
|
|
1178
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1159
1179
|
let payload = {};
|
|
1160
1180
|
if (typeof databaseId === 'undefined') {
|
|
1161
1181
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1186,7 +1206,7 @@ class Databases extends Service {
|
|
|
1186
1206
|
payload['default'] = xdefault;
|
|
1187
1207
|
}
|
|
1188
1208
|
|
|
1189
|
-
return await this.client.call('patch',
|
|
1209
|
+
return await this.client.call('patch', apiPath, {
|
|
1190
1210
|
'content-type': 'application/json',
|
|
1191
1211
|
}, payload);
|
|
1192
1212
|
}
|
|
@@ -1210,7 +1230,7 @@ class Databases extends Service {
|
|
|
1210
1230
|
* @returns {Promise}
|
|
1211
1231
|
*/
|
|
1212
1232
|
async createRelationshipAttribute(databaseId, collectionId, relatedCollectionId, type, twoWay, key, twoWayKey, onDelete) {
|
|
1213
|
-
|
|
1233
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1214
1234
|
let payload = {};
|
|
1215
1235
|
if (typeof databaseId === 'undefined') {
|
|
1216
1236
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1253,7 +1273,7 @@ class Databases extends Service {
|
|
|
1253
1273
|
payload['onDelete'] = onDelete;
|
|
1254
1274
|
}
|
|
1255
1275
|
|
|
1256
|
-
return await this.client.call('post',
|
|
1276
|
+
return await this.client.call('post', apiPath, {
|
|
1257
1277
|
'content-type': 'application/json',
|
|
1258
1278
|
}, payload);
|
|
1259
1279
|
}
|
|
@@ -1271,11 +1291,12 @@ class Databases extends Service {
|
|
|
1271
1291
|
* @param {boolean} required
|
|
1272
1292
|
* @param {string} xdefault
|
|
1273
1293
|
* @param {boolean} array
|
|
1294
|
+
* @param {boolean} encrypt
|
|
1274
1295
|
* @throws {AppwriteException}
|
|
1275
1296
|
* @returns {Promise}
|
|
1276
1297
|
*/
|
|
1277
|
-
async createStringAttribute(databaseId, collectionId, key, size, required, xdefault, array) {
|
|
1278
|
-
|
|
1298
|
+
async createStringAttribute(databaseId, collectionId, key, size, required, xdefault, array, encrypt) {
|
|
1299
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1279
1300
|
let payload = {};
|
|
1280
1301
|
if (typeof databaseId === 'undefined') {
|
|
1281
1302
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1318,7 +1339,11 @@ class Databases extends Service {
|
|
|
1318
1339
|
payload['array'] = array;
|
|
1319
1340
|
}
|
|
1320
1341
|
|
|
1321
|
-
|
|
1342
|
+
if (typeof encrypt !== 'undefined') {
|
|
1343
|
+
payload['encrypt'] = encrypt;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
return await this.client.call('post', apiPath, {
|
|
1322
1347
|
'content-type': 'application/json',
|
|
1323
1348
|
}, payload);
|
|
1324
1349
|
}
|
|
@@ -1339,7 +1364,7 @@ class Databases extends Service {
|
|
|
1339
1364
|
* @returns {Promise}
|
|
1340
1365
|
*/
|
|
1341
1366
|
async updateStringAttribute(databaseId, collectionId, key, required, xdefault) {
|
|
1342
|
-
|
|
1367
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1343
1368
|
let payload = {};
|
|
1344
1369
|
if (typeof databaseId === 'undefined') {
|
|
1345
1370
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1370,7 +1395,7 @@ class Databases extends Service {
|
|
|
1370
1395
|
payload['default'] = xdefault;
|
|
1371
1396
|
}
|
|
1372
1397
|
|
|
1373
|
-
return await this.client.call('patch',
|
|
1398
|
+
return await this.client.call('patch', apiPath, {
|
|
1374
1399
|
'content-type': 'application/json',
|
|
1375
1400
|
}, payload);
|
|
1376
1401
|
}
|
|
@@ -1391,7 +1416,7 @@ class Databases extends Service {
|
|
|
1391
1416
|
* @returns {Promise}
|
|
1392
1417
|
*/
|
|
1393
1418
|
async createUrlAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
1394
|
-
|
|
1419
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1395
1420
|
let payload = {};
|
|
1396
1421
|
if (typeof databaseId === 'undefined') {
|
|
1397
1422
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1426,7 +1451,7 @@ class Databases extends Service {
|
|
|
1426
1451
|
payload['array'] = array;
|
|
1427
1452
|
}
|
|
1428
1453
|
|
|
1429
|
-
return await this.client.call('post',
|
|
1454
|
+
return await this.client.call('post', apiPath, {
|
|
1430
1455
|
'content-type': 'application/json',
|
|
1431
1456
|
}, payload);
|
|
1432
1457
|
}
|
|
@@ -1447,7 +1472,7 @@ class Databases extends Service {
|
|
|
1447
1472
|
* @returns {Promise}
|
|
1448
1473
|
*/
|
|
1449
1474
|
async updateUrlAttribute(databaseId, collectionId, key, required, xdefault) {
|
|
1450
|
-
|
|
1475
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1451
1476
|
let payload = {};
|
|
1452
1477
|
if (typeof databaseId === 'undefined') {
|
|
1453
1478
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1478,7 +1503,7 @@ class Databases extends Service {
|
|
|
1478
1503
|
payload['default'] = xdefault;
|
|
1479
1504
|
}
|
|
1480
1505
|
|
|
1481
|
-
return await this.client.call('patch',
|
|
1506
|
+
return await this.client.call('patch', apiPath, {
|
|
1482
1507
|
'content-type': 'application/json',
|
|
1483
1508
|
}, payload);
|
|
1484
1509
|
}
|
|
@@ -1493,7 +1518,7 @@ class Databases extends Service {
|
|
|
1493
1518
|
* @returns {Promise}
|
|
1494
1519
|
*/
|
|
1495
1520
|
async getAttribute(databaseId, collectionId, key) {
|
|
1496
|
-
|
|
1521
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1497
1522
|
let payload = {};
|
|
1498
1523
|
if (typeof databaseId === 'undefined') {
|
|
1499
1524
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1508,7 +1533,7 @@ class Databases extends Service {
|
|
|
1508
1533
|
}
|
|
1509
1534
|
|
|
1510
1535
|
|
|
1511
|
-
return await this.client.call('get',
|
|
1536
|
+
return await this.client.call('get', apiPath, {
|
|
1512
1537
|
'content-type': 'application/json',
|
|
1513
1538
|
}, payload);
|
|
1514
1539
|
}
|
|
@@ -1523,7 +1548,7 @@ class Databases extends Service {
|
|
|
1523
1548
|
* @returns {Promise}
|
|
1524
1549
|
*/
|
|
1525
1550
|
async deleteAttribute(databaseId, collectionId, key) {
|
|
1526
|
-
|
|
1551
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1527
1552
|
let payload = {};
|
|
1528
1553
|
if (typeof databaseId === 'undefined') {
|
|
1529
1554
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1538,7 +1563,7 @@ class Databases extends Service {
|
|
|
1538
1563
|
}
|
|
1539
1564
|
|
|
1540
1565
|
|
|
1541
|
-
return await this.client.call('delete',
|
|
1566
|
+
return await this.client.call('delete', apiPath, {
|
|
1542
1567
|
'content-type': 'application/json',
|
|
1543
1568
|
}, payload);
|
|
1544
1569
|
}
|
|
@@ -1558,7 +1583,7 @@ class Databases extends Service {
|
|
|
1558
1583
|
* @returns {Promise}
|
|
1559
1584
|
*/
|
|
1560
1585
|
async updateRelationshipAttribute(databaseId, collectionId, key, onDelete) {
|
|
1561
|
-
|
|
1586
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1562
1587
|
let payload = {};
|
|
1563
1588
|
if (typeof databaseId === 'undefined') {
|
|
1564
1589
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1577,7 +1602,7 @@ class Databases extends Service {
|
|
|
1577
1602
|
payload['onDelete'] = onDelete;
|
|
1578
1603
|
}
|
|
1579
1604
|
|
|
1580
|
-
return await this.client.call('patch',
|
|
1605
|
+
return await this.client.call('patch', apiPath, {
|
|
1581
1606
|
'content-type': 'application/json',
|
|
1582
1607
|
}, payload);
|
|
1583
1608
|
}
|
|
@@ -1595,7 +1620,7 @@ class Databases extends Service {
|
|
|
1595
1620
|
* @returns {Promise}
|
|
1596
1621
|
*/
|
|
1597
1622
|
async listDocuments(databaseId, collectionId, queries) {
|
|
1598
|
-
|
|
1623
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1599
1624
|
let payload = {};
|
|
1600
1625
|
if (typeof databaseId === 'undefined') {
|
|
1601
1626
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1610,7 +1635,7 @@ class Databases extends Service {
|
|
|
1610
1635
|
payload['queries'] = queries;
|
|
1611
1636
|
}
|
|
1612
1637
|
|
|
1613
|
-
return await this.client.call('get',
|
|
1638
|
+
return await this.client.call('get', apiPath, {
|
|
1614
1639
|
'content-type': 'application/json',
|
|
1615
1640
|
}, payload);
|
|
1616
1641
|
}
|
|
@@ -1632,7 +1657,7 @@ class Databases extends Service {
|
|
|
1632
1657
|
* @returns {Promise}
|
|
1633
1658
|
*/
|
|
1634
1659
|
async createDocument(databaseId, collectionId, documentId, data, permissions) {
|
|
1635
|
-
|
|
1660
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1636
1661
|
let payload = {};
|
|
1637
1662
|
if (typeof databaseId === 'undefined') {
|
|
1638
1663
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1663,7 +1688,7 @@ class Databases extends Service {
|
|
|
1663
1688
|
payload['permissions'] = permissions;
|
|
1664
1689
|
}
|
|
1665
1690
|
|
|
1666
|
-
return await this.client.call('post',
|
|
1691
|
+
return await this.client.call('post', apiPath, {
|
|
1667
1692
|
'content-type': 'application/json',
|
|
1668
1693
|
}, payload);
|
|
1669
1694
|
}
|
|
@@ -1682,7 +1707,7 @@ class Databases extends Service {
|
|
|
1682
1707
|
* @returns {Promise}
|
|
1683
1708
|
*/
|
|
1684
1709
|
async getDocument(databaseId, collectionId, documentId, queries) {
|
|
1685
|
-
|
|
1710
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
|
|
1686
1711
|
let payload = {};
|
|
1687
1712
|
if (typeof databaseId === 'undefined') {
|
|
1688
1713
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1701,7 +1726,7 @@ class Databases extends Service {
|
|
|
1701
1726
|
payload['queries'] = queries;
|
|
1702
1727
|
}
|
|
1703
1728
|
|
|
1704
|
-
return await this.client.call('get',
|
|
1729
|
+
return await this.client.call('get', apiPath, {
|
|
1705
1730
|
'content-type': 'application/json',
|
|
1706
1731
|
}, payload);
|
|
1707
1732
|
}
|
|
@@ -1721,7 +1746,7 @@ class Databases extends Service {
|
|
|
1721
1746
|
* @returns {Promise}
|
|
1722
1747
|
*/
|
|
1723
1748
|
async updateDocument(databaseId, collectionId, documentId, data, permissions) {
|
|
1724
|
-
|
|
1749
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
|
|
1725
1750
|
let payload = {};
|
|
1726
1751
|
if (typeof databaseId === 'undefined') {
|
|
1727
1752
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1744,7 +1769,7 @@ class Databases extends Service {
|
|
|
1744
1769
|
payload['permissions'] = permissions;
|
|
1745
1770
|
}
|
|
1746
1771
|
|
|
1747
|
-
return await this.client.call('patch',
|
|
1772
|
+
return await this.client.call('patch', apiPath, {
|
|
1748
1773
|
'content-type': 'application/json',
|
|
1749
1774
|
}, payload);
|
|
1750
1775
|
}
|
|
@@ -1761,7 +1786,7 @@ class Databases extends Service {
|
|
|
1761
1786
|
* @returns {Promise}
|
|
1762
1787
|
*/
|
|
1763
1788
|
async deleteDocument(databaseId, collectionId, documentId) {
|
|
1764
|
-
|
|
1789
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
|
|
1765
1790
|
let payload = {};
|
|
1766
1791
|
if (typeof databaseId === 'undefined') {
|
|
1767
1792
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1776,7 +1801,7 @@ class Databases extends Service {
|
|
|
1776
1801
|
}
|
|
1777
1802
|
|
|
1778
1803
|
|
|
1779
|
-
return await this.client.call('delete',
|
|
1804
|
+
return await this.client.call('delete', apiPath, {
|
|
1780
1805
|
'content-type': 'application/json',
|
|
1781
1806
|
}, payload);
|
|
1782
1807
|
}
|
|
@@ -1786,11 +1811,12 @@ class Databases extends Service {
|
|
|
1786
1811
|
*
|
|
1787
1812
|
* @param {string} databaseId
|
|
1788
1813
|
* @param {string} collectionId
|
|
1814
|
+
* @param {string[]} queries
|
|
1789
1815
|
* @throws {AppwriteException}
|
|
1790
1816
|
* @returns {Promise}
|
|
1791
1817
|
*/
|
|
1792
|
-
async listIndexes(databaseId, collectionId) {
|
|
1793
|
-
|
|
1818
|
+
async listIndexes(databaseId, collectionId, queries) {
|
|
1819
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1794
1820
|
let payload = {};
|
|
1795
1821
|
if (typeof databaseId === 'undefined') {
|
|
1796
1822
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1801,7 +1827,11 @@ class Databases extends Service {
|
|
|
1801
1827
|
}
|
|
1802
1828
|
|
|
1803
1829
|
|
|
1804
|
-
|
|
1830
|
+
if (typeof queries !== 'undefined') {
|
|
1831
|
+
payload['queries'] = queries;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
return await this.client.call('get', apiPath, {
|
|
1805
1835
|
'content-type': 'application/json',
|
|
1806
1836
|
}, payload);
|
|
1807
1837
|
}
|
|
@@ -1819,7 +1849,7 @@ class Databases extends Service {
|
|
|
1819
1849
|
* @returns {Promise}
|
|
1820
1850
|
*/
|
|
1821
1851
|
async createIndex(databaseId, collectionId, key, type, attributes, orders) {
|
|
1822
|
-
|
|
1852
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1823
1853
|
let payload = {};
|
|
1824
1854
|
if (typeof databaseId === 'undefined') {
|
|
1825
1855
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1858,7 +1888,7 @@ class Databases extends Service {
|
|
|
1858
1888
|
payload['orders'] = orders;
|
|
1859
1889
|
}
|
|
1860
1890
|
|
|
1861
|
-
return await this.client.call('post',
|
|
1891
|
+
return await this.client.call('post', apiPath, {
|
|
1862
1892
|
'content-type': 'application/json',
|
|
1863
1893
|
}, payload);
|
|
1864
1894
|
}
|
|
@@ -1873,7 +1903,7 @@ class Databases extends Service {
|
|
|
1873
1903
|
* @returns {Promise}
|
|
1874
1904
|
*/
|
|
1875
1905
|
async getIndex(databaseId, collectionId, key) {
|
|
1876
|
-
|
|
1906
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1877
1907
|
let payload = {};
|
|
1878
1908
|
if (typeof databaseId === 'undefined') {
|
|
1879
1909
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1888,7 +1918,7 @@ class Databases extends Service {
|
|
|
1888
1918
|
}
|
|
1889
1919
|
|
|
1890
1920
|
|
|
1891
|
-
return await this.client.call('get',
|
|
1921
|
+
return await this.client.call('get', apiPath, {
|
|
1892
1922
|
'content-type': 'application/json',
|
|
1893
1923
|
}, payload);
|
|
1894
1924
|
}
|
|
@@ -1903,7 +1933,7 @@ class Databases extends Service {
|
|
|
1903
1933
|
* @returns {Promise}
|
|
1904
1934
|
*/
|
|
1905
1935
|
async deleteIndex(databaseId, collectionId, key) {
|
|
1906
|
-
|
|
1936
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1907
1937
|
let payload = {};
|
|
1908
1938
|
if (typeof databaseId === 'undefined') {
|
|
1909
1939
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1918,7 +1948,7 @@ class Databases extends Service {
|
|
|
1918
1948
|
}
|
|
1919
1949
|
|
|
1920
1950
|
|
|
1921
|
-
return await this.client.call('delete',
|
|
1951
|
+
return await this.client.call('delete', apiPath, {
|
|
1922
1952
|
'content-type': 'application/json',
|
|
1923
1953
|
}, payload);
|
|
1924
1954
|
}
|