@appwrite.io/console 0.3.0 → 0.4.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/.github/workflows/publish.yml +2 -2
- package/README.md +3 -3
- package/dist/cjs/sdk.js +1354 -1197
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1354 -1197
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +1354 -1197
- package/docs/examples/functions/create.md +1 -1
- package/docs/examples/functions/update.md +1 -1
- package/docs/examples/{projects/get-usage.md → health/get-queue-builds.md} +3 -3
- package/docs/examples/{account/create-with-invite-code.md → health/get-queue-databases.md} +3 -3
- package/docs/examples/health/get-queue-deletes.md +18 -0
- package/docs/examples/health/get-queue-mails.md +18 -0
- package/docs/examples/health/get-queue-messaging.md +18 -0
- package/docs/examples/health/get-queue-migrations.md +18 -0
- package/docs/examples/project/get-usage.md +1 -1
- package/docs/examples/teams/create-membership.md +1 -1
- package/package.json +3 -2
- package/src/client.ts +1 -1
- package/src/models.ts +147 -279
- package/src/query.ts +1 -1
- package/src/role.ts +72 -6
- package/src/services/account.ts +154 -204
- package/src/services/assistant.ts +3 -3
- package/src/services/avatars.ts +32 -31
- package/src/services/console.ts +4 -4
- package/src/services/databases.ts +195 -195
- package/src/services/functions.ts +117 -126
- package/src/services/graphql.ts +8 -8
- package/src/services/health.ts +219 -50
- package/src/services/locale.ts +31 -31
- package/src/services/migrations.ts +48 -48
- package/src/services/project.ts +40 -22
- package/src/services/projects.ts +143 -170
- package/src/services/proxy.ts +15 -15
- package/src/services/storage.ts +74 -84
- package/src/services/teams.ts +62 -66
- package/src/services/users.ts +132 -135
- package/src/services/vcs.ts +27 -27
- package/types/models.d.ts +147 -279
- package/types/role.d.ts +62 -0
- package/types/services/account.d.ts +61 -70
- package/types/services/avatars.d.ts +11 -10
- package/types/services/console.d.ts +1 -1
- package/types/services/databases.d.ts +51 -51
- package/types/services/functions.d.ts +32 -27
- package/types/services/graphql.d.ts +2 -2
- package/types/services/health.d.ts +85 -14
- package/types/services/locale.d.ts +7 -7
- package/types/services/project.d.ts +4 -2
- package/types/services/projects.d.ts +26 -36
- package/types/services/storage.d.ts +13 -13
- package/types/services/teams.d.ts +20 -20
- package/types/services/users.d.ts +45 -44
|
@@ -11,7 +11,7 @@ export class Databases extends Service {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* List
|
|
14
|
+
* List databases
|
|
15
15
|
*
|
|
16
16
|
* Get a list of all databases from the current Appwrite project. You can use
|
|
17
17
|
* the search parameter to filter your results.
|
|
@@ -22,8 +22,8 @@ export class Databases extends Service {
|
|
|
22
22
|
* @returns {Promise}
|
|
23
23
|
*/
|
|
24
24
|
async list(queries?: string[], search?: string): Promise<Models.DatabaseList> {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const apiPath = '/databases';
|
|
26
|
+
const payload: Payload = {};
|
|
27
27
|
|
|
28
28
|
if (typeof queries !== 'undefined') {
|
|
29
29
|
payload['queries'] = queries;
|
|
@@ -33,14 +33,14 @@ export class Databases extends Service {
|
|
|
33
33
|
payload['search'] = search;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const uri = new URL(this.client.config.endpoint +
|
|
36
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
37
37
|
return await this.client.call('get', uri, {
|
|
38
38
|
'content-type': 'application/json',
|
|
39
39
|
}, payload);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Create
|
|
43
|
+
* Create database
|
|
44
44
|
*
|
|
45
45
|
* Create a new Database.
|
|
46
46
|
*
|
|
@@ -60,8 +60,8 @@ export class Databases extends Service {
|
|
|
60
60
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
const apiPath = '/databases';
|
|
64
|
+
const payload: Payload = {};
|
|
65
65
|
|
|
66
66
|
if (typeof databaseId !== 'undefined') {
|
|
67
67
|
payload['databaseId'] = databaseId;
|
|
@@ -75,7 +75,7 @@ export class Databases extends Service {
|
|
|
75
75
|
payload['enabled'] = enabled;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
const uri = new URL(this.client.config.endpoint +
|
|
78
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
79
79
|
return await this.client.call('post', uri, {
|
|
80
80
|
'content-type': 'application/json',
|
|
81
81
|
}, payload);
|
|
@@ -90,21 +90,21 @@ export class Databases extends Service {
|
|
|
90
90
|
* @returns {Promise}
|
|
91
91
|
*/
|
|
92
92
|
async getUsage(range?: string): Promise<Models.UsageDatabases> {
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
const apiPath = '/databases/usage';
|
|
94
|
+
const payload: Payload = {};
|
|
95
95
|
|
|
96
96
|
if (typeof range !== 'undefined') {
|
|
97
97
|
payload['range'] = range;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
const uri = new URL(this.client.config.endpoint +
|
|
100
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
101
101
|
return await this.client.call('get', uri, {
|
|
102
102
|
'content-type': 'application/json',
|
|
103
103
|
}, payload);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
* Get
|
|
107
|
+
* Get database
|
|
108
108
|
*
|
|
109
109
|
* Get a database by its unique ID. This endpoint response returns a JSON
|
|
110
110
|
* object with the database metadata.
|
|
@@ -118,17 +118,17 @@ export class Databases extends Service {
|
|
|
118
118
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
|
|
122
|
+
const payload: Payload = {};
|
|
123
123
|
|
|
124
|
-
const uri = new URL(this.client.config.endpoint +
|
|
124
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
125
125
|
return await this.client.call('get', uri, {
|
|
126
126
|
'content-type': 'application/json',
|
|
127
127
|
}, payload);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
|
-
* Update
|
|
131
|
+
* Update database
|
|
132
132
|
*
|
|
133
133
|
* Update a database by its unique ID.
|
|
134
134
|
*
|
|
@@ -147,8 +147,8 @@ export class Databases extends Service {
|
|
|
147
147
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
|
|
151
|
+
const payload: Payload = {};
|
|
152
152
|
|
|
153
153
|
if (typeof name !== 'undefined') {
|
|
154
154
|
payload['name'] = name;
|
|
@@ -158,14 +158,14 @@ export class Databases extends Service {
|
|
|
158
158
|
payload['enabled'] = enabled;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
const uri = new URL(this.client.config.endpoint +
|
|
161
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
162
162
|
return await this.client.call('put', uri, {
|
|
163
163
|
'content-type': 'application/json',
|
|
164
164
|
}, payload);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
/**
|
|
168
|
-
* Delete
|
|
168
|
+
* Delete database
|
|
169
169
|
*
|
|
170
170
|
* Delete a database by its unique ID. Only API keys with with databases.write
|
|
171
171
|
* scope can delete a database.
|
|
@@ -179,17 +179,17 @@ export class Databases extends Service {
|
|
|
179
179
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
|
|
183
|
+
const payload: Payload = {};
|
|
184
184
|
|
|
185
|
-
const uri = new URL(this.client.config.endpoint +
|
|
185
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
186
186
|
return await this.client.call('delete', uri, {
|
|
187
187
|
'content-type': 'application/json',
|
|
188
188
|
}, payload);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
|
-
* List
|
|
192
|
+
* List collections
|
|
193
193
|
*
|
|
194
194
|
* Get a list of all collections that belong to the provided databaseId. You
|
|
195
195
|
* can use the search parameter to filter your results.
|
|
@@ -205,8 +205,8 @@ export class Databases extends Service {
|
|
|
205
205
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
const apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
|
|
209
|
+
const payload: Payload = {};
|
|
210
210
|
|
|
211
211
|
if (typeof queries !== 'undefined') {
|
|
212
212
|
payload['queries'] = queries;
|
|
@@ -216,19 +216,19 @@ export class Databases extends Service {
|
|
|
216
216
|
payload['search'] = search;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
const uri = new URL(this.client.config.endpoint +
|
|
219
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
220
220
|
return await this.client.call('get', uri, {
|
|
221
221
|
'content-type': 'application/json',
|
|
222
222
|
}, payload);
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
|
-
* Create
|
|
226
|
+
* Create collection
|
|
227
227
|
*
|
|
228
228
|
* Create a new Collection. Before using this route, you should create a new
|
|
229
229
|
* database resource using either a [server
|
|
230
|
-
* integration](/docs/server/databases#databasesCreateCollection)
|
|
231
|
-
* directly from your database console.
|
|
230
|
+
* integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
|
231
|
+
* API or directly from your database console.
|
|
232
232
|
*
|
|
233
233
|
* @param {string} databaseId
|
|
234
234
|
* @param {string} collectionId
|
|
@@ -252,8 +252,8 @@ export class Databases extends Service {
|
|
|
252
252
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
const apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
|
|
256
|
+
const payload: Payload = {};
|
|
257
257
|
|
|
258
258
|
if (typeof collectionId !== 'undefined') {
|
|
259
259
|
payload['collectionId'] = collectionId;
|
|
@@ -275,14 +275,14 @@ export class Databases extends Service {
|
|
|
275
275
|
payload['enabled'] = enabled;
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
-
const uri = new URL(this.client.config.endpoint +
|
|
278
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
279
279
|
return await this.client.call('post', uri, {
|
|
280
280
|
'content-type': 'application/json',
|
|
281
281
|
}, payload);
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
/**
|
|
285
|
-
* Get
|
|
285
|
+
* Get collection
|
|
286
286
|
*
|
|
287
287
|
* Get a collection by its unique ID. This endpoint response returns a JSON
|
|
288
288
|
* object with the collection metadata.
|
|
@@ -301,17 +301,17 @@ export class Databases extends Service {
|
|
|
301
301
|
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
305
|
+
const payload: Payload = {};
|
|
306
306
|
|
|
307
|
-
const uri = new URL(this.client.config.endpoint +
|
|
307
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
308
308
|
return await this.client.call('get', uri, {
|
|
309
309
|
'content-type': 'application/json',
|
|
310
310
|
}, payload);
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
/**
|
|
314
|
-
* Update
|
|
314
|
+
* Update collection
|
|
315
315
|
*
|
|
316
316
|
* Update a collection by its unique ID.
|
|
317
317
|
*
|
|
@@ -337,8 +337,8 @@ export class Databases extends Service {
|
|
|
337
337
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
341
|
+
const payload: Payload = {};
|
|
342
342
|
|
|
343
343
|
if (typeof name !== 'undefined') {
|
|
344
344
|
payload['name'] = name;
|
|
@@ -356,14 +356,14 @@ export class Databases extends Service {
|
|
|
356
356
|
payload['enabled'] = enabled;
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
const uri = new URL(this.client.config.endpoint +
|
|
359
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
360
360
|
return await this.client.call('put', uri, {
|
|
361
361
|
'content-type': 'application/json',
|
|
362
362
|
}, payload);
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
/**
|
|
366
|
-
* Delete
|
|
366
|
+
* Delete collection
|
|
367
367
|
*
|
|
368
368
|
* Delete a collection by its unique ID. Only users with write permissions
|
|
369
369
|
* have access to delete this resource.
|
|
@@ -382,17 +382,17 @@ export class Databases extends Service {
|
|
|
382
382
|
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
386
|
+
const payload: Payload = {};
|
|
387
387
|
|
|
388
|
-
const uri = new URL(this.client.config.endpoint +
|
|
388
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
389
389
|
return await this.client.call('delete', uri, {
|
|
390
390
|
'content-type': 'application/json',
|
|
391
391
|
}, payload);
|
|
392
392
|
}
|
|
393
393
|
|
|
394
394
|
/**
|
|
395
|
-
* List
|
|
395
|
+
* List attributes
|
|
396
396
|
*
|
|
397
397
|
*
|
|
398
398
|
* @param {string} databaseId
|
|
@@ -410,21 +410,21 @@ export class Databases extends Service {
|
|
|
410
410
|
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
|
|
414
|
-
|
|
413
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
414
|
+
const payload: Payload = {};
|
|
415
415
|
|
|
416
416
|
if (typeof queries !== 'undefined') {
|
|
417
417
|
payload['queries'] = queries;
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
-
const uri = new URL(this.client.config.endpoint +
|
|
420
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
421
421
|
return await this.client.call('get', uri, {
|
|
422
422
|
'content-type': 'application/json',
|
|
423
423
|
}, payload);
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
/**
|
|
427
|
-
* Create
|
|
427
|
+
* Create boolean attribute
|
|
428
428
|
*
|
|
429
429
|
* Create a boolean attribute.
|
|
430
430
|
*
|
|
@@ -455,8 +455,8 @@ export class Databases extends Service {
|
|
|
455
455
|
throw new AppwriteException('Missing required parameter: "required"');
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
|
|
459
|
-
|
|
458
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
459
|
+
const payload: Payload = {};
|
|
460
460
|
|
|
461
461
|
if (typeof key !== 'undefined') {
|
|
462
462
|
payload['key'] = key;
|
|
@@ -474,14 +474,14 @@ export class Databases extends Service {
|
|
|
474
474
|
payload['array'] = array;
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
-
const uri = new URL(this.client.config.endpoint +
|
|
477
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
478
478
|
return await this.client.call('post', uri, {
|
|
479
479
|
'content-type': 'application/json',
|
|
480
480
|
}, payload);
|
|
481
481
|
}
|
|
482
482
|
|
|
483
483
|
/**
|
|
484
|
-
* Update
|
|
484
|
+
* Update boolean attribute
|
|
485
485
|
*
|
|
486
486
|
*
|
|
487
487
|
* @param {string} databaseId
|
|
@@ -513,8 +513,8 @@ export class Databases extends Service {
|
|
|
513
513
|
throw new AppwriteException('Missing required parameter: "xdefault"');
|
|
514
514
|
}
|
|
515
515
|
|
|
516
|
-
|
|
517
|
-
|
|
516
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
517
|
+
const payload: Payload = {};
|
|
518
518
|
|
|
519
519
|
if (typeof required !== 'undefined') {
|
|
520
520
|
payload['required'] = required;
|
|
@@ -524,14 +524,14 @@ export class Databases extends Service {
|
|
|
524
524
|
payload['default'] = xdefault;
|
|
525
525
|
}
|
|
526
526
|
|
|
527
|
-
const uri = new URL(this.client.config.endpoint +
|
|
527
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
528
528
|
return await this.client.call('patch', uri, {
|
|
529
529
|
'content-type': 'application/json',
|
|
530
530
|
}, payload);
|
|
531
531
|
}
|
|
532
532
|
|
|
533
533
|
/**
|
|
534
|
-
* Create
|
|
534
|
+
* Create datetime attribute
|
|
535
535
|
*
|
|
536
536
|
*
|
|
537
537
|
* @param {string} databaseId
|
|
@@ -560,8 +560,8 @@ export class Databases extends Service {
|
|
|
560
560
|
throw new AppwriteException('Missing required parameter: "required"');
|
|
561
561
|
}
|
|
562
562
|
|
|
563
|
-
|
|
564
|
-
|
|
563
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
564
|
+
const payload: Payload = {};
|
|
565
565
|
|
|
566
566
|
if (typeof key !== 'undefined') {
|
|
567
567
|
payload['key'] = key;
|
|
@@ -579,14 +579,14 @@ export class Databases extends Service {
|
|
|
579
579
|
payload['array'] = array;
|
|
580
580
|
}
|
|
581
581
|
|
|
582
|
-
const uri = new URL(this.client.config.endpoint +
|
|
582
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
583
583
|
return await this.client.call('post', uri, {
|
|
584
584
|
'content-type': 'application/json',
|
|
585
585
|
}, payload);
|
|
586
586
|
}
|
|
587
587
|
|
|
588
588
|
/**
|
|
589
|
-
* Update
|
|
589
|
+
* Update dateTime attribute
|
|
590
590
|
*
|
|
591
591
|
*
|
|
592
592
|
* @param {string} databaseId
|
|
@@ -618,8 +618,8 @@ export class Databases extends Service {
|
|
|
618
618
|
throw new AppwriteException('Missing required parameter: "xdefault"');
|
|
619
619
|
}
|
|
620
620
|
|
|
621
|
-
|
|
622
|
-
|
|
621
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
622
|
+
const payload: Payload = {};
|
|
623
623
|
|
|
624
624
|
if (typeof required !== 'undefined') {
|
|
625
625
|
payload['required'] = required;
|
|
@@ -629,14 +629,14 @@ export class Databases extends Service {
|
|
|
629
629
|
payload['default'] = xdefault;
|
|
630
630
|
}
|
|
631
631
|
|
|
632
|
-
const uri = new URL(this.client.config.endpoint +
|
|
632
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
633
633
|
return await this.client.call('patch', uri, {
|
|
634
634
|
'content-type': 'application/json',
|
|
635
635
|
}, payload);
|
|
636
636
|
}
|
|
637
637
|
|
|
638
638
|
/**
|
|
639
|
-
* Create
|
|
639
|
+
* Create email attribute
|
|
640
640
|
*
|
|
641
641
|
* Create an email attribute.
|
|
642
642
|
*
|
|
@@ -667,8 +667,8 @@ export class Databases extends Service {
|
|
|
667
667
|
throw new AppwriteException('Missing required parameter: "required"');
|
|
668
668
|
}
|
|
669
669
|
|
|
670
|
-
|
|
671
|
-
|
|
670
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
671
|
+
const payload: Payload = {};
|
|
672
672
|
|
|
673
673
|
if (typeof key !== 'undefined') {
|
|
674
674
|
payload['key'] = key;
|
|
@@ -686,14 +686,14 @@ export class Databases extends Service {
|
|
|
686
686
|
payload['array'] = array;
|
|
687
687
|
}
|
|
688
688
|
|
|
689
|
-
const uri = new URL(this.client.config.endpoint +
|
|
689
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
690
690
|
return await this.client.call('post', uri, {
|
|
691
691
|
'content-type': 'application/json',
|
|
692
692
|
}, payload);
|
|
693
693
|
}
|
|
694
694
|
|
|
695
695
|
/**
|
|
696
|
-
* Update
|
|
696
|
+
* Update email attribute
|
|
697
697
|
*
|
|
698
698
|
* Update an email attribute. Changing the `default` value will not update
|
|
699
699
|
* already existing documents.
|
|
@@ -728,8 +728,8 @@ export class Databases extends Service {
|
|
|
728
728
|
throw new AppwriteException('Missing required parameter: "xdefault"');
|
|
729
729
|
}
|
|
730
730
|
|
|
731
|
-
|
|
732
|
-
|
|
731
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
732
|
+
const payload: Payload = {};
|
|
733
733
|
|
|
734
734
|
if (typeof required !== 'undefined') {
|
|
735
735
|
payload['required'] = required;
|
|
@@ -739,14 +739,14 @@ export class Databases extends Service {
|
|
|
739
739
|
payload['default'] = xdefault;
|
|
740
740
|
}
|
|
741
741
|
|
|
742
|
-
const uri = new URL(this.client.config.endpoint +
|
|
742
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
743
743
|
return await this.client.call('patch', uri, {
|
|
744
744
|
'content-type': 'application/json',
|
|
745
745
|
}, payload);
|
|
746
746
|
}
|
|
747
747
|
|
|
748
748
|
/**
|
|
749
|
-
* Create
|
|
749
|
+
* Create enum attribute
|
|
750
750
|
*
|
|
751
751
|
*
|
|
752
752
|
* @param {string} databaseId
|
|
@@ -780,8 +780,8 @@ export class Databases extends Service {
|
|
|
780
780
|
throw new AppwriteException('Missing required parameter: "required"');
|
|
781
781
|
}
|
|
782
782
|
|
|
783
|
-
|
|
784
|
-
|
|
783
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
784
|
+
const payload: Payload = {};
|
|
785
785
|
|
|
786
786
|
if (typeof key !== 'undefined') {
|
|
787
787
|
payload['key'] = key;
|
|
@@ -803,14 +803,14 @@ export class Databases extends Service {
|
|
|
803
803
|
payload['array'] = array;
|
|
804
804
|
}
|
|
805
805
|
|
|
806
|
-
const uri = new URL(this.client.config.endpoint +
|
|
806
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
807
807
|
return await this.client.call('post', uri, {
|
|
808
808
|
'content-type': 'application/json',
|
|
809
809
|
}, payload);
|
|
810
810
|
}
|
|
811
811
|
|
|
812
812
|
/**
|
|
813
|
-
* Update
|
|
813
|
+
* Update enum attribute
|
|
814
814
|
*
|
|
815
815
|
* Update an enum attribute. Changing the `default` value will not update
|
|
816
816
|
* already existing documents.
|
|
@@ -850,8 +850,8 @@ export class Databases extends Service {
|
|
|
850
850
|
throw new AppwriteException('Missing required parameter: "xdefault"');
|
|
851
851
|
}
|
|
852
852
|
|
|
853
|
-
|
|
854
|
-
|
|
853
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
854
|
+
const payload: Payload = {};
|
|
855
855
|
|
|
856
856
|
if (typeof elements !== 'undefined') {
|
|
857
857
|
payload['elements'] = elements;
|
|
@@ -865,14 +865,14 @@ export class Databases extends Service {
|
|
|
865
865
|
payload['default'] = xdefault;
|
|
866
866
|
}
|
|
867
867
|
|
|
868
|
-
const uri = new URL(this.client.config.endpoint +
|
|
868
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
869
869
|
return await this.client.call('patch', uri, {
|
|
870
870
|
'content-type': 'application/json',
|
|
871
871
|
}, payload);
|
|
872
872
|
}
|
|
873
873
|
|
|
874
874
|
/**
|
|
875
|
-
* Create
|
|
875
|
+
* Create float attribute
|
|
876
876
|
*
|
|
877
877
|
* Create a float attribute. Optionally, minimum and maximum values can be
|
|
878
878
|
* provided.
|
|
@@ -906,8 +906,8 @@ export class Databases extends Service {
|
|
|
906
906
|
throw new AppwriteException('Missing required parameter: "required"');
|
|
907
907
|
}
|
|
908
908
|
|
|
909
|
-
|
|
910
|
-
|
|
909
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
910
|
+
const payload: Payload = {};
|
|
911
911
|
|
|
912
912
|
if (typeof key !== 'undefined') {
|
|
913
913
|
payload['key'] = key;
|
|
@@ -933,14 +933,14 @@ export class Databases extends Service {
|
|
|
933
933
|
payload['array'] = array;
|
|
934
934
|
}
|
|
935
935
|
|
|
936
|
-
const uri = new URL(this.client.config.endpoint +
|
|
936
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
937
937
|
return await this.client.call('post', uri, {
|
|
938
938
|
'content-type': 'application/json',
|
|
939
939
|
}, payload);
|
|
940
940
|
}
|
|
941
941
|
|
|
942
942
|
/**
|
|
943
|
-
* Update
|
|
943
|
+
* Update float attribute
|
|
944
944
|
*
|
|
945
945
|
* Update a float attribute. Changing the `default` value will not update
|
|
946
946
|
* already existing documents.
|
|
@@ -985,8 +985,8 @@ export class Databases extends Service {
|
|
|
985
985
|
throw new AppwriteException('Missing required parameter: "xdefault"');
|
|
986
986
|
}
|
|
987
987
|
|
|
988
|
-
|
|
989
|
-
|
|
988
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
989
|
+
const payload: Payload = {};
|
|
990
990
|
|
|
991
991
|
if (typeof required !== 'undefined') {
|
|
992
992
|
payload['required'] = required;
|
|
@@ -1004,14 +1004,14 @@ export class Databases extends Service {
|
|
|
1004
1004
|
payload['default'] = xdefault;
|
|
1005
1005
|
}
|
|
1006
1006
|
|
|
1007
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1007
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1008
1008
|
return await this.client.call('patch', uri, {
|
|
1009
1009
|
'content-type': 'application/json',
|
|
1010
1010
|
}, payload);
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
1013
|
/**
|
|
1014
|
-
* Create
|
|
1014
|
+
* Create integer attribute
|
|
1015
1015
|
*
|
|
1016
1016
|
* Create an integer attribute. Optionally, minimum and maximum values can be
|
|
1017
1017
|
* provided.
|
|
@@ -1045,8 +1045,8 @@ export class Databases extends Service {
|
|
|
1045
1045
|
throw new AppwriteException('Missing required parameter: "required"');
|
|
1046
1046
|
}
|
|
1047
1047
|
|
|
1048
|
-
|
|
1049
|
-
|
|
1048
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1049
|
+
const payload: Payload = {};
|
|
1050
1050
|
|
|
1051
1051
|
if (typeof key !== 'undefined') {
|
|
1052
1052
|
payload['key'] = key;
|
|
@@ -1072,14 +1072,14 @@ export class Databases extends Service {
|
|
|
1072
1072
|
payload['array'] = array;
|
|
1073
1073
|
}
|
|
1074
1074
|
|
|
1075
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1075
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1076
1076
|
return await this.client.call('post', uri, {
|
|
1077
1077
|
'content-type': 'application/json',
|
|
1078
1078
|
}, payload);
|
|
1079
1079
|
}
|
|
1080
1080
|
|
|
1081
1081
|
/**
|
|
1082
|
-
* Update
|
|
1082
|
+
* Update integer attribute
|
|
1083
1083
|
*
|
|
1084
1084
|
* Update an integer attribute. Changing the `default` value will not update
|
|
1085
1085
|
* already existing documents.
|
|
@@ -1124,8 +1124,8 @@ export class Databases extends Service {
|
|
|
1124
1124
|
throw new AppwriteException('Missing required parameter: "xdefault"');
|
|
1125
1125
|
}
|
|
1126
1126
|
|
|
1127
|
-
|
|
1128
|
-
|
|
1127
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1128
|
+
const payload: Payload = {};
|
|
1129
1129
|
|
|
1130
1130
|
if (typeof required !== 'undefined') {
|
|
1131
1131
|
payload['required'] = required;
|
|
@@ -1143,14 +1143,14 @@ export class Databases extends Service {
|
|
|
1143
1143
|
payload['default'] = xdefault;
|
|
1144
1144
|
}
|
|
1145
1145
|
|
|
1146
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1146
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1147
1147
|
return await this.client.call('patch', uri, {
|
|
1148
1148
|
'content-type': 'application/json',
|
|
1149
1149
|
}, payload);
|
|
1150
1150
|
}
|
|
1151
1151
|
|
|
1152
1152
|
/**
|
|
1153
|
-
* Create IP
|
|
1153
|
+
* Create IP address attribute
|
|
1154
1154
|
*
|
|
1155
1155
|
* Create IP address attribute.
|
|
1156
1156
|
*
|
|
@@ -1181,8 +1181,8 @@ export class Databases extends Service {
|
|
|
1181
1181
|
throw new AppwriteException('Missing required parameter: "required"');
|
|
1182
1182
|
}
|
|
1183
1183
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1184
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1185
|
+
const payload: Payload = {};
|
|
1186
1186
|
|
|
1187
1187
|
if (typeof key !== 'undefined') {
|
|
1188
1188
|
payload['key'] = key;
|
|
@@ -1200,14 +1200,14 @@ export class Databases extends Service {
|
|
|
1200
1200
|
payload['array'] = array;
|
|
1201
1201
|
}
|
|
1202
1202
|
|
|
1203
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1203
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1204
1204
|
return await this.client.call('post', uri, {
|
|
1205
1205
|
'content-type': 'application/json',
|
|
1206
1206
|
}, payload);
|
|
1207
1207
|
}
|
|
1208
1208
|
|
|
1209
1209
|
/**
|
|
1210
|
-
* Update IP
|
|
1210
|
+
* Update IP address attribute
|
|
1211
1211
|
*
|
|
1212
1212
|
* Update an ip attribute. Changing the `default` value will not update
|
|
1213
1213
|
* already existing documents.
|
|
@@ -1242,8 +1242,8 @@ export class Databases extends Service {
|
|
|
1242
1242
|
throw new AppwriteException('Missing required parameter: "xdefault"');
|
|
1243
1243
|
}
|
|
1244
1244
|
|
|
1245
|
-
|
|
1246
|
-
|
|
1245
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1246
|
+
const payload: Payload = {};
|
|
1247
1247
|
|
|
1248
1248
|
if (typeof required !== 'undefined') {
|
|
1249
1249
|
payload['required'] = required;
|
|
@@ -1253,17 +1253,17 @@ export class Databases extends Service {
|
|
|
1253
1253
|
payload['default'] = xdefault;
|
|
1254
1254
|
}
|
|
1255
1255
|
|
|
1256
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1256
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1257
1257
|
return await this.client.call('patch', uri, {
|
|
1258
1258
|
'content-type': 'application/json',
|
|
1259
1259
|
}, payload);
|
|
1260
1260
|
}
|
|
1261
1261
|
|
|
1262
1262
|
/**
|
|
1263
|
-
* Create
|
|
1263
|
+
* Create relationship attribute
|
|
1264
1264
|
*
|
|
1265
1265
|
* Create relationship attribute. [Learn more about relationship
|
|
1266
|
-
* attributes](/docs/databases-relationships#relationship-attributes).
|
|
1266
|
+
* attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1267
1267
|
*
|
|
1268
1268
|
*
|
|
1269
1269
|
* @param {string} databaseId
|
|
@@ -1294,8 +1294,8 @@ export class Databases extends Service {
|
|
|
1294
1294
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
1295
1295
|
}
|
|
1296
1296
|
|
|
1297
|
-
|
|
1298
|
-
|
|
1297
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1298
|
+
const payload: Payload = {};
|
|
1299
1299
|
|
|
1300
1300
|
if (typeof relatedCollectionId !== 'undefined') {
|
|
1301
1301
|
payload['relatedCollectionId'] = relatedCollectionId;
|
|
@@ -1321,14 +1321,14 @@ export class Databases extends Service {
|
|
|
1321
1321
|
payload['onDelete'] = onDelete;
|
|
1322
1322
|
}
|
|
1323
1323
|
|
|
1324
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1324
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1325
1325
|
return await this.client.call('post', uri, {
|
|
1326
1326
|
'content-type': 'application/json',
|
|
1327
1327
|
}, payload);
|
|
1328
1328
|
}
|
|
1329
1329
|
|
|
1330
1330
|
/**
|
|
1331
|
-
* Create
|
|
1331
|
+
* Create string attribute
|
|
1332
1332
|
*
|
|
1333
1333
|
* Create a string attribute.
|
|
1334
1334
|
*
|
|
@@ -1365,8 +1365,8 @@ export class Databases extends Service {
|
|
|
1365
1365
|
throw new AppwriteException('Missing required parameter: "required"');
|
|
1366
1366
|
}
|
|
1367
1367
|
|
|
1368
|
-
|
|
1369
|
-
|
|
1368
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1369
|
+
const payload: Payload = {};
|
|
1370
1370
|
|
|
1371
1371
|
if (typeof key !== 'undefined') {
|
|
1372
1372
|
payload['key'] = key;
|
|
@@ -1392,14 +1392,14 @@ export class Databases extends Service {
|
|
|
1392
1392
|
payload['encrypt'] = encrypt;
|
|
1393
1393
|
}
|
|
1394
1394
|
|
|
1395
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1395
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1396
1396
|
return await this.client.call('post', uri, {
|
|
1397
1397
|
'content-type': 'application/json',
|
|
1398
1398
|
}, payload);
|
|
1399
1399
|
}
|
|
1400
1400
|
|
|
1401
1401
|
/**
|
|
1402
|
-
* Update
|
|
1402
|
+
* Update string attribute
|
|
1403
1403
|
*
|
|
1404
1404
|
* Update a string attribute. Changing the `default` value will not update
|
|
1405
1405
|
* already existing documents.
|
|
@@ -1434,8 +1434,8 @@ export class Databases extends Service {
|
|
|
1434
1434
|
throw new AppwriteException('Missing required parameter: "xdefault"');
|
|
1435
1435
|
}
|
|
1436
1436
|
|
|
1437
|
-
|
|
1438
|
-
|
|
1437
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1438
|
+
const payload: Payload = {};
|
|
1439
1439
|
|
|
1440
1440
|
if (typeof required !== 'undefined') {
|
|
1441
1441
|
payload['required'] = required;
|
|
@@ -1445,14 +1445,14 @@ export class Databases extends Service {
|
|
|
1445
1445
|
payload['default'] = xdefault;
|
|
1446
1446
|
}
|
|
1447
1447
|
|
|
1448
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1448
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1449
1449
|
return await this.client.call('patch', uri, {
|
|
1450
1450
|
'content-type': 'application/json',
|
|
1451
1451
|
}, payload);
|
|
1452
1452
|
}
|
|
1453
1453
|
|
|
1454
1454
|
/**
|
|
1455
|
-
* Create URL
|
|
1455
|
+
* Create URL attribute
|
|
1456
1456
|
*
|
|
1457
1457
|
* Create a URL attribute.
|
|
1458
1458
|
*
|
|
@@ -1483,8 +1483,8 @@ export class Databases extends Service {
|
|
|
1483
1483
|
throw new AppwriteException('Missing required parameter: "required"');
|
|
1484
1484
|
}
|
|
1485
1485
|
|
|
1486
|
-
|
|
1487
|
-
|
|
1486
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1487
|
+
const payload: Payload = {};
|
|
1488
1488
|
|
|
1489
1489
|
if (typeof key !== 'undefined') {
|
|
1490
1490
|
payload['key'] = key;
|
|
@@ -1502,14 +1502,14 @@ export class Databases extends Service {
|
|
|
1502
1502
|
payload['array'] = array;
|
|
1503
1503
|
}
|
|
1504
1504
|
|
|
1505
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1505
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1506
1506
|
return await this.client.call('post', uri, {
|
|
1507
1507
|
'content-type': 'application/json',
|
|
1508
1508
|
}, payload);
|
|
1509
1509
|
}
|
|
1510
1510
|
|
|
1511
1511
|
/**
|
|
1512
|
-
* Update URL
|
|
1512
|
+
* Update URL attribute
|
|
1513
1513
|
*
|
|
1514
1514
|
* Update an url attribute. Changing the `default` value will not update
|
|
1515
1515
|
* already existing documents.
|
|
@@ -1544,8 +1544,8 @@ export class Databases extends Service {
|
|
|
1544
1544
|
throw new AppwriteException('Missing required parameter: "xdefault"');
|
|
1545
1545
|
}
|
|
1546
1546
|
|
|
1547
|
-
|
|
1548
|
-
|
|
1547
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1548
|
+
const payload: Payload = {};
|
|
1549
1549
|
|
|
1550
1550
|
if (typeof required !== 'undefined') {
|
|
1551
1551
|
payload['required'] = required;
|
|
@@ -1555,14 +1555,14 @@ export class Databases extends Service {
|
|
|
1555
1555
|
payload['default'] = xdefault;
|
|
1556
1556
|
}
|
|
1557
1557
|
|
|
1558
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1558
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1559
1559
|
return await this.client.call('patch', uri, {
|
|
1560
1560
|
'content-type': 'application/json',
|
|
1561
1561
|
}, payload);
|
|
1562
1562
|
}
|
|
1563
1563
|
|
|
1564
1564
|
/**
|
|
1565
|
-
* Get
|
|
1565
|
+
* Get attribute
|
|
1566
1566
|
*
|
|
1567
1567
|
*
|
|
1568
1568
|
* @param {string} databaseId
|
|
@@ -1584,17 +1584,17 @@ export class Databases extends Service {
|
|
|
1584
1584
|
throw new AppwriteException('Missing required parameter: "key"');
|
|
1585
1585
|
}
|
|
1586
1586
|
|
|
1587
|
-
|
|
1588
|
-
|
|
1587
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1588
|
+
const payload: Payload = {};
|
|
1589
1589
|
|
|
1590
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1590
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1591
1591
|
return await this.client.call('get', uri, {
|
|
1592
1592
|
'content-type': 'application/json',
|
|
1593
1593
|
}, payload);
|
|
1594
1594
|
}
|
|
1595
1595
|
|
|
1596
1596
|
/**
|
|
1597
|
-
* Delete
|
|
1597
|
+
* Delete attribute
|
|
1598
1598
|
*
|
|
1599
1599
|
*
|
|
1600
1600
|
* @param {string} databaseId
|
|
@@ -1616,20 +1616,20 @@ export class Databases extends Service {
|
|
|
1616
1616
|
throw new AppwriteException('Missing required parameter: "key"');
|
|
1617
1617
|
}
|
|
1618
1618
|
|
|
1619
|
-
|
|
1620
|
-
|
|
1619
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1620
|
+
const payload: Payload = {};
|
|
1621
1621
|
|
|
1622
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1622
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1623
1623
|
return await this.client.call('delete', uri, {
|
|
1624
1624
|
'content-type': 'application/json',
|
|
1625
1625
|
}, payload);
|
|
1626
1626
|
}
|
|
1627
1627
|
|
|
1628
1628
|
/**
|
|
1629
|
-
* Update
|
|
1629
|
+
* Update relationship attribute
|
|
1630
1630
|
*
|
|
1631
1631
|
* Update relationship attribute. [Learn more about relationship
|
|
1632
|
-
* attributes](/docs/databases-relationships#relationship-attributes).
|
|
1632
|
+
* attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1633
1633
|
*
|
|
1634
1634
|
*
|
|
1635
1635
|
* @param {string} databaseId
|
|
@@ -1652,21 +1652,21 @@ export class Databases extends Service {
|
|
|
1652
1652
|
throw new AppwriteException('Missing required parameter: "key"');
|
|
1653
1653
|
}
|
|
1654
1654
|
|
|
1655
|
-
|
|
1656
|
-
|
|
1655
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1656
|
+
const payload: Payload = {};
|
|
1657
1657
|
|
|
1658
1658
|
if (typeof onDelete !== 'undefined') {
|
|
1659
1659
|
payload['onDelete'] = onDelete;
|
|
1660
1660
|
}
|
|
1661
1661
|
|
|
1662
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1662
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1663
1663
|
return await this.client.call('patch', uri, {
|
|
1664
1664
|
'content-type': 'application/json',
|
|
1665
1665
|
}, payload);
|
|
1666
1666
|
}
|
|
1667
1667
|
|
|
1668
1668
|
/**
|
|
1669
|
-
* List
|
|
1669
|
+
* List documents
|
|
1670
1670
|
*
|
|
1671
1671
|
* Get a list of all the user's documents in a given collection. You can use
|
|
1672
1672
|
* the query params to filter your results.
|
|
@@ -1686,26 +1686,26 @@ export class Databases extends Service {
|
|
|
1686
1686
|
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
1687
1687
|
}
|
|
1688
1688
|
|
|
1689
|
-
|
|
1690
|
-
|
|
1689
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1690
|
+
const payload: Payload = {};
|
|
1691
1691
|
|
|
1692
1692
|
if (typeof queries !== 'undefined') {
|
|
1693
1693
|
payload['queries'] = queries;
|
|
1694
1694
|
}
|
|
1695
1695
|
|
|
1696
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1696
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1697
1697
|
return await this.client.call('get', uri, {
|
|
1698
1698
|
'content-type': 'application/json',
|
|
1699
1699
|
}, payload);
|
|
1700
1700
|
}
|
|
1701
1701
|
|
|
1702
1702
|
/**
|
|
1703
|
-
* Create
|
|
1703
|
+
* Create document
|
|
1704
1704
|
*
|
|
1705
1705
|
* Create a new Document. Before using this route, you should create a new
|
|
1706
1706
|
* collection resource using either a [server
|
|
1707
|
-
* integration](/docs/server/databases#databasesCreateCollection)
|
|
1708
|
-
* directly from your database console.
|
|
1707
|
+
* integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
|
1708
|
+
* API or directly from your database console.
|
|
1709
1709
|
*
|
|
1710
1710
|
* @param {string} databaseId
|
|
1711
1711
|
* @param {string} collectionId
|
|
@@ -1732,8 +1732,8 @@ export class Databases extends Service {
|
|
|
1732
1732
|
throw new AppwriteException('Missing required parameter: "data"');
|
|
1733
1733
|
}
|
|
1734
1734
|
|
|
1735
|
-
|
|
1736
|
-
|
|
1735
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1736
|
+
const payload: Payload = {};
|
|
1737
1737
|
|
|
1738
1738
|
if (typeof documentId !== 'undefined') {
|
|
1739
1739
|
payload['documentId'] = documentId;
|
|
@@ -1747,14 +1747,14 @@ export class Databases extends Service {
|
|
|
1747
1747
|
payload['permissions'] = permissions;
|
|
1748
1748
|
}
|
|
1749
1749
|
|
|
1750
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1750
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1751
1751
|
return await this.client.call('post', uri, {
|
|
1752
1752
|
'content-type': 'application/json',
|
|
1753
1753
|
}, payload);
|
|
1754
1754
|
}
|
|
1755
1755
|
|
|
1756
1756
|
/**
|
|
1757
|
-
* Get
|
|
1757
|
+
* Get document
|
|
1758
1758
|
*
|
|
1759
1759
|
* Get a document by its unique ID. This endpoint response returns a JSON
|
|
1760
1760
|
* object with the document data.
|
|
@@ -1779,21 +1779,21 @@ export class Databases extends Service {
|
|
|
1779
1779
|
throw new AppwriteException('Missing required parameter: "documentId"');
|
|
1780
1780
|
}
|
|
1781
1781
|
|
|
1782
|
-
|
|
1783
|
-
|
|
1782
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
|
|
1783
|
+
const payload: Payload = {};
|
|
1784
1784
|
|
|
1785
1785
|
if (typeof queries !== 'undefined') {
|
|
1786
1786
|
payload['queries'] = queries;
|
|
1787
1787
|
}
|
|
1788
1788
|
|
|
1789
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1789
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1790
1790
|
return await this.client.call('get', uri, {
|
|
1791
1791
|
'content-type': 'application/json',
|
|
1792
1792
|
}, payload);
|
|
1793
1793
|
}
|
|
1794
1794
|
|
|
1795
1795
|
/**
|
|
1796
|
-
* Update
|
|
1796
|
+
* Update document
|
|
1797
1797
|
*
|
|
1798
1798
|
* Update a document by its unique ID. Using the patch method you can pass
|
|
1799
1799
|
* only specific fields that will get updated.
|
|
@@ -1819,8 +1819,8 @@ export class Databases extends Service {
|
|
|
1819
1819
|
throw new AppwriteException('Missing required parameter: "documentId"');
|
|
1820
1820
|
}
|
|
1821
1821
|
|
|
1822
|
-
|
|
1823
|
-
|
|
1822
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
|
|
1823
|
+
const payload: Payload = {};
|
|
1824
1824
|
|
|
1825
1825
|
if (typeof data !== 'undefined') {
|
|
1826
1826
|
payload['data'] = data;
|
|
@@ -1830,14 +1830,14 @@ export class Databases extends Service {
|
|
|
1830
1830
|
payload['permissions'] = permissions;
|
|
1831
1831
|
}
|
|
1832
1832
|
|
|
1833
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1833
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1834
1834
|
return await this.client.call('patch', uri, {
|
|
1835
1835
|
'content-type': 'application/json',
|
|
1836
1836
|
}, payload);
|
|
1837
1837
|
}
|
|
1838
1838
|
|
|
1839
1839
|
/**
|
|
1840
|
-
* Delete
|
|
1840
|
+
* Delete document
|
|
1841
1841
|
*
|
|
1842
1842
|
* Delete a document by its unique ID.
|
|
1843
1843
|
*
|
|
@@ -1860,17 +1860,17 @@ export class Databases extends Service {
|
|
|
1860
1860
|
throw new AppwriteException('Missing required parameter: "documentId"');
|
|
1861
1861
|
}
|
|
1862
1862
|
|
|
1863
|
-
|
|
1864
|
-
|
|
1863
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
|
|
1864
|
+
const payload: Payload = {};
|
|
1865
1865
|
|
|
1866
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1866
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1867
1867
|
return await this.client.call('delete', uri, {
|
|
1868
1868
|
'content-type': 'application/json',
|
|
1869
1869
|
}, payload);
|
|
1870
1870
|
}
|
|
1871
1871
|
|
|
1872
1872
|
/**
|
|
1873
|
-
* List
|
|
1873
|
+
* List document logs
|
|
1874
1874
|
*
|
|
1875
1875
|
* Get the document activity logs list by its unique ID.
|
|
1876
1876
|
*
|
|
@@ -1894,21 +1894,21 @@ export class Databases extends Service {
|
|
|
1894
1894
|
throw new AppwriteException('Missing required parameter: "documentId"');
|
|
1895
1895
|
}
|
|
1896
1896
|
|
|
1897
|
-
|
|
1898
|
-
|
|
1897
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
|
|
1898
|
+
const payload: Payload = {};
|
|
1899
1899
|
|
|
1900
1900
|
if (typeof queries !== 'undefined') {
|
|
1901
1901
|
payload['queries'] = queries;
|
|
1902
1902
|
}
|
|
1903
1903
|
|
|
1904
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1904
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1905
1905
|
return await this.client.call('get', uri, {
|
|
1906
1906
|
'content-type': 'application/json',
|
|
1907
1907
|
}, payload);
|
|
1908
1908
|
}
|
|
1909
1909
|
|
|
1910
1910
|
/**
|
|
1911
|
-
* List
|
|
1911
|
+
* List indexes
|
|
1912
1912
|
*
|
|
1913
1913
|
*
|
|
1914
1914
|
* @param {string} databaseId
|
|
@@ -1926,21 +1926,21 @@ export class Databases extends Service {
|
|
|
1926
1926
|
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
1927
1927
|
}
|
|
1928
1928
|
|
|
1929
|
-
|
|
1930
|
-
|
|
1929
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1930
|
+
const payload: Payload = {};
|
|
1931
1931
|
|
|
1932
1932
|
if (typeof queries !== 'undefined') {
|
|
1933
1933
|
payload['queries'] = queries;
|
|
1934
1934
|
}
|
|
1935
1935
|
|
|
1936
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1936
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1937
1937
|
return await this.client.call('get', uri, {
|
|
1938
1938
|
'content-type': 'application/json',
|
|
1939
1939
|
}, payload);
|
|
1940
1940
|
}
|
|
1941
1941
|
|
|
1942
1942
|
/**
|
|
1943
|
-
* Create
|
|
1943
|
+
* Create index
|
|
1944
1944
|
*
|
|
1945
1945
|
*
|
|
1946
1946
|
* @param {string} databaseId
|
|
@@ -1973,8 +1973,8 @@ export class Databases extends Service {
|
|
|
1973
1973
|
throw new AppwriteException('Missing required parameter: "attributes"');
|
|
1974
1974
|
}
|
|
1975
1975
|
|
|
1976
|
-
|
|
1977
|
-
|
|
1976
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1977
|
+
const payload: Payload = {};
|
|
1978
1978
|
|
|
1979
1979
|
if (typeof key !== 'undefined') {
|
|
1980
1980
|
payload['key'] = key;
|
|
@@ -1992,14 +1992,14 @@ export class Databases extends Service {
|
|
|
1992
1992
|
payload['orders'] = orders;
|
|
1993
1993
|
}
|
|
1994
1994
|
|
|
1995
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1995
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1996
1996
|
return await this.client.call('post', uri, {
|
|
1997
1997
|
'content-type': 'application/json',
|
|
1998
1998
|
}, payload);
|
|
1999
1999
|
}
|
|
2000
2000
|
|
|
2001
2001
|
/**
|
|
2002
|
-
* Get
|
|
2002
|
+
* Get index
|
|
2003
2003
|
*
|
|
2004
2004
|
*
|
|
2005
2005
|
* @param {string} databaseId
|
|
@@ -2021,17 +2021,17 @@ export class Databases extends Service {
|
|
|
2021
2021
|
throw new AppwriteException('Missing required parameter: "key"');
|
|
2022
2022
|
}
|
|
2023
2023
|
|
|
2024
|
-
|
|
2025
|
-
|
|
2024
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
2025
|
+
const payload: Payload = {};
|
|
2026
2026
|
|
|
2027
|
-
const uri = new URL(this.client.config.endpoint +
|
|
2027
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2028
2028
|
return await this.client.call('get', uri, {
|
|
2029
2029
|
'content-type': 'application/json',
|
|
2030
2030
|
}, payload);
|
|
2031
2031
|
}
|
|
2032
2032
|
|
|
2033
2033
|
/**
|
|
2034
|
-
* Delete
|
|
2034
|
+
* Delete index
|
|
2035
2035
|
*
|
|
2036
2036
|
*
|
|
2037
2037
|
* @param {string} databaseId
|
|
@@ -2053,17 +2053,17 @@ export class Databases extends Service {
|
|
|
2053
2053
|
throw new AppwriteException('Missing required parameter: "key"');
|
|
2054
2054
|
}
|
|
2055
2055
|
|
|
2056
|
-
|
|
2057
|
-
|
|
2056
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
2057
|
+
const payload: Payload = {};
|
|
2058
2058
|
|
|
2059
|
-
const uri = new URL(this.client.config.endpoint +
|
|
2059
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2060
2060
|
return await this.client.call('delete', uri, {
|
|
2061
2061
|
'content-type': 'application/json',
|
|
2062
2062
|
}, payload);
|
|
2063
2063
|
}
|
|
2064
2064
|
|
|
2065
2065
|
/**
|
|
2066
|
-
* List
|
|
2066
|
+
* List collection logs
|
|
2067
2067
|
*
|
|
2068
2068
|
* Get the collection activity logs list by its unique ID.
|
|
2069
2069
|
*
|
|
@@ -2082,14 +2082,14 @@ export class Databases extends Service {
|
|
|
2082
2082
|
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
2083
2083
|
}
|
|
2084
2084
|
|
|
2085
|
-
|
|
2086
|
-
|
|
2085
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
2086
|
+
const payload: Payload = {};
|
|
2087
2087
|
|
|
2088
2088
|
if (typeof queries !== 'undefined') {
|
|
2089
2089
|
payload['queries'] = queries;
|
|
2090
2090
|
}
|
|
2091
2091
|
|
|
2092
|
-
const uri = new URL(this.client.config.endpoint +
|
|
2092
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2093
2093
|
return await this.client.call('get', uri, {
|
|
2094
2094
|
'content-type': 'application/json',
|
|
2095
2095
|
}, payload);
|
|
@@ -2114,21 +2114,21 @@ export class Databases extends Service {
|
|
|
2114
2114
|
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
2115
2115
|
}
|
|
2116
2116
|
|
|
2117
|
-
|
|
2118
|
-
|
|
2117
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
2118
|
+
const payload: Payload = {};
|
|
2119
2119
|
|
|
2120
2120
|
if (typeof range !== 'undefined') {
|
|
2121
2121
|
payload['range'] = range;
|
|
2122
2122
|
}
|
|
2123
2123
|
|
|
2124
|
-
const uri = new URL(this.client.config.endpoint +
|
|
2124
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2125
2125
|
return await this.client.call('get', uri, {
|
|
2126
2126
|
'content-type': 'application/json',
|
|
2127
2127
|
}, payload);
|
|
2128
2128
|
}
|
|
2129
2129
|
|
|
2130
2130
|
/**
|
|
2131
|
-
* List
|
|
2131
|
+
* List database logs
|
|
2132
2132
|
*
|
|
2133
2133
|
* Get the database activity logs list by its unique ID.
|
|
2134
2134
|
*
|
|
@@ -2142,14 +2142,14 @@ export class Databases extends Service {
|
|
|
2142
2142
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2143
2143
|
}
|
|
2144
2144
|
|
|
2145
|
-
|
|
2146
|
-
|
|
2145
|
+
const apiPath = '/databases/{databaseId}/logs'.replace('{databaseId}', databaseId);
|
|
2146
|
+
const payload: Payload = {};
|
|
2147
2147
|
|
|
2148
2148
|
if (typeof queries !== 'undefined') {
|
|
2149
2149
|
payload['queries'] = queries;
|
|
2150
2150
|
}
|
|
2151
2151
|
|
|
2152
|
-
const uri = new URL(this.client.config.endpoint +
|
|
2152
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2153
2153
|
return await this.client.call('get', uri, {
|
|
2154
2154
|
'content-type': 'application/json',
|
|
2155
2155
|
}, payload);
|
|
@@ -2169,14 +2169,14 @@ export class Databases extends Service {
|
|
|
2169
2169
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2170
2170
|
}
|
|
2171
2171
|
|
|
2172
|
-
|
|
2173
|
-
|
|
2172
|
+
const apiPath = '/databases/{databaseId}/usage'.replace('{databaseId}', databaseId);
|
|
2173
|
+
const payload: Payload = {};
|
|
2174
2174
|
|
|
2175
2175
|
if (typeof range !== 'undefined') {
|
|
2176
2176
|
payload['range'] = range;
|
|
2177
2177
|
}
|
|
2178
2178
|
|
|
2179
|
-
const uri = new URL(this.client.config.endpoint +
|
|
2179
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2180
2180
|
return await this.client.call('get', uri, {
|
|
2181
2181
|
'content-type': 'application/json',
|
|
2182
2182
|
}, payload);
|