appwrite-cli 0.18.3 → 1.0.0-RC2
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/npm-publish.yml +8 -1
- package/LICENSE.md +1 -1
- package/README.md +4 -4
- package/docs/examples/account/create-phone-session.md +1 -1
- package/docs/examples/account/get-logs.md +0 -1
- package/docs/examples/account/update-phone.md +1 -1
- package/docs/examples/avatars/get-initials.md +0 -1
- package/docs/examples/databases/create-collection.md +2 -3
- package/docs/examples/databases/create-datetime-attribute.md +7 -0
- package/docs/examples/databases/create-document.md +0 -1
- package/docs/examples/databases/list-collection-logs.md +0 -1
- package/docs/examples/databases/list-collections.md +0 -4
- package/docs/examples/databases/list-document-logs.md +0 -1
- package/docs/examples/databases/list-documents.md +0 -6
- package/docs/examples/databases/list-logs.md +0 -1
- package/docs/examples/databases/list.md +0 -4
- package/docs/examples/databases/update-collection.md +0 -1
- package/docs/examples/databases/update-document.md +0 -1
- package/docs/examples/functions/create-variable.md +4 -0
- package/docs/examples/functions/create.md +1 -2
- package/docs/examples/functions/delete-variable.md +3 -0
- package/docs/examples/functions/get-function-usage.md +3 -0
- package/docs/examples/functions/get-usage.md +0 -1
- package/docs/examples/functions/get-variable.md +3 -0
- package/docs/examples/functions/list-deployments.md +0 -4
- package/docs/examples/functions/list-executions.md +0 -3
- package/docs/examples/functions/list-variables.md +4 -0
- package/docs/examples/functions/list.md +0 -4
- package/docs/examples/functions/update-variable.md +5 -0
- package/docs/examples/functions/update.md +1 -2
- package/docs/examples/projects/list.md +0 -4
- package/docs/examples/storage/create-bucket.md +1 -1
- package/docs/examples/storage/create-file.md +0 -1
- package/docs/examples/storage/list-buckets.md +0 -4
- package/docs/examples/storage/list-files.md +0 -4
- package/docs/examples/storage/update-bucket.md +1 -1
- package/docs/examples/storage/update-file.md +0 -1
- package/docs/examples/teams/get-memberships.md +0 -4
- package/docs/examples/teams/list-logs.md +0 -1
- package/docs/examples/teams/list.md +0 -4
- package/docs/examples/users/create-argon2user.md +5 -0
- package/docs/examples/users/create-bcrypt-user.md +5 -0
- package/docs/examples/users/create-m-d5user.md +5 -0
- package/docs/examples/users/create-p-h-pass-user.md +5 -0
- package/docs/examples/users/create-s-h-a-user.md +6 -0
- package/docs/examples/users/create-scrypt-modified-user.md +8 -0
- package/docs/examples/users/create-scrypt-user.md +10 -0
- package/docs/examples/users/create.md +3 -2
- package/docs/examples/users/get-logs.md +0 -1
- package/docs/examples/users/list.md +0 -4
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +6 -3
- package/lib/commands/account.js +18 -23
- package/lib/commands/avatars.js +2 -7
- package/lib/commands/databases.js +154 -210
- package/lib/commands/functions.js +226 -92
- package/lib/commands/generic.js +3 -3
- package/lib/commands/init.js +57 -15
- package/lib/commands/projects.js +10 -30
- package/lib/commands/storage.js +53 -105
- package/lib/commands/teams.js +17 -62
- package/lib/commands/users.js +414 -36
- package/lib/questions.js +1 -1
- package/package.json +1 -1
|
@@ -12,37 +12,21 @@ const { localConfig, globalConfig } = require("../config");
|
|
|
12
12
|
|
|
13
13
|
const databases = new Command("databases").description(commandDescriptions['databases'])
|
|
14
14
|
|
|
15
|
-
const databasesList = async ({
|
|
15
|
+
const databasesList = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
|
|
16
|
+
/* @param {string[]} queries */
|
|
16
17
|
/* @param {string} search */
|
|
17
|
-
/* @param {number} limit */
|
|
18
|
-
/* @param {number} offset */
|
|
19
|
-
/* @param {string} cursor */
|
|
20
|
-
/* @param {string} cursorDirection */
|
|
21
|
-
/* @param {string} orderType */
|
|
22
18
|
|
|
23
19
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
24
20
|
let path = '/databases';
|
|
25
21
|
let payload = {};
|
|
26
22
|
|
|
27
23
|
/** Query Params */
|
|
24
|
+
if (typeof queries !== 'undefined') {
|
|
25
|
+
payload['queries'] = queries;
|
|
26
|
+
}
|
|
28
27
|
if (typeof search !== 'undefined') {
|
|
29
28
|
payload['search'] = search;
|
|
30
29
|
}
|
|
31
|
-
if (typeof limit !== 'undefined') {
|
|
32
|
-
payload['limit'] = limit;
|
|
33
|
-
}
|
|
34
|
-
if (typeof offset !== 'undefined') {
|
|
35
|
-
payload['offset'] = offset;
|
|
36
|
-
}
|
|
37
|
-
if (typeof cursor !== 'undefined') {
|
|
38
|
-
payload['cursor'] = cursor;
|
|
39
|
-
}
|
|
40
|
-
if (typeof cursorDirection !== 'undefined') {
|
|
41
|
-
payload['cursorDirection'] = cursorDirection;
|
|
42
|
-
}
|
|
43
|
-
if (typeof orderType !== 'undefined') {
|
|
44
|
-
payload['orderType'] = orderType;
|
|
45
|
-
}
|
|
46
30
|
let response = undefined;
|
|
47
31
|
response = await client.call('get', path, {
|
|
48
32
|
'content-type': 'application/json',
|
|
@@ -168,38 +152,22 @@ const databasesDelete = async ({ databaseId, parseOutput = true, sdk = undefined
|
|
|
168
152
|
return response;
|
|
169
153
|
}
|
|
170
154
|
|
|
171
|
-
const databasesListCollections = async ({ databaseId,
|
|
155
|
+
const databasesListCollections = async ({ databaseId, queries, search, parseOutput = true, sdk = undefined}) => {
|
|
172
156
|
/* @param {string} databaseId */
|
|
157
|
+
/* @param {string[]} queries */
|
|
173
158
|
/* @param {string} search */
|
|
174
|
-
/* @param {number} limit */
|
|
175
|
-
/* @param {number} offset */
|
|
176
|
-
/* @param {string} cursor */
|
|
177
|
-
/* @param {string} cursorDirection */
|
|
178
|
-
/* @param {string} orderType */
|
|
179
159
|
|
|
180
160
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
181
161
|
let path = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
|
|
182
162
|
let payload = {};
|
|
183
163
|
|
|
184
164
|
/** Query Params */
|
|
165
|
+
if (typeof queries !== 'undefined') {
|
|
166
|
+
payload['queries'] = queries;
|
|
167
|
+
}
|
|
185
168
|
if (typeof search !== 'undefined') {
|
|
186
169
|
payload['search'] = search;
|
|
187
170
|
}
|
|
188
|
-
if (typeof limit !== 'undefined') {
|
|
189
|
-
payload['limit'] = limit;
|
|
190
|
-
}
|
|
191
|
-
if (typeof offset !== 'undefined') {
|
|
192
|
-
payload['offset'] = offset;
|
|
193
|
-
}
|
|
194
|
-
if (typeof cursor !== 'undefined') {
|
|
195
|
-
payload['cursor'] = cursor;
|
|
196
|
-
}
|
|
197
|
-
if (typeof cursorDirection !== 'undefined') {
|
|
198
|
-
payload['cursorDirection'] = cursorDirection;
|
|
199
|
-
}
|
|
200
|
-
if (typeof orderType !== 'undefined') {
|
|
201
|
-
payload['orderType'] = orderType;
|
|
202
|
-
}
|
|
203
171
|
let response = undefined;
|
|
204
172
|
response = await client.call('get', path, {
|
|
205
173
|
'content-type': 'application/json',
|
|
@@ -212,13 +180,12 @@ const databasesListCollections = async ({ databaseId, search, limit, offset, cur
|
|
|
212
180
|
return response;
|
|
213
181
|
}
|
|
214
182
|
|
|
215
|
-
const databasesCreateCollection = async ({ databaseId, collectionId, name,
|
|
183
|
+
const databasesCreateCollection = async ({ databaseId, collectionId, name, permissions, documentSecurity, parseOutput = true, sdk = undefined}) => {
|
|
216
184
|
/* @param {string} databaseId */
|
|
217
185
|
/* @param {string} collectionId */
|
|
218
186
|
/* @param {string} name */
|
|
219
|
-
/* @param {string}
|
|
220
|
-
/* @param {
|
|
221
|
-
/* @param {string[]} write */
|
|
187
|
+
/* @param {string[]} permissions */
|
|
188
|
+
/* @param {boolean} documentSecurity */
|
|
222
189
|
|
|
223
190
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
224
191
|
let path = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
|
|
@@ -233,16 +200,12 @@ const databasesCreateCollection = async ({ databaseId, collectionId, name, permi
|
|
|
233
200
|
payload['name'] = name;
|
|
234
201
|
}
|
|
235
202
|
|
|
236
|
-
if (typeof
|
|
237
|
-
payload['
|
|
203
|
+
if (typeof permissions !== 'undefined') {
|
|
204
|
+
payload['permissions'] = permissions;
|
|
238
205
|
}
|
|
239
206
|
|
|
240
|
-
if (typeof
|
|
241
|
-
payload['
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
if (typeof write !== 'undefined') {
|
|
245
|
-
payload['write'] = write;
|
|
207
|
+
if (typeof documentSecurity !== 'undefined') {
|
|
208
|
+
payload['documentSecurity'] = documentSecurity;
|
|
246
209
|
}
|
|
247
210
|
|
|
248
211
|
let response = undefined;
|
|
@@ -276,13 +239,12 @@ const databasesGetCollection = async ({ databaseId, collectionId, parseOutput =
|
|
|
276
239
|
return response;
|
|
277
240
|
}
|
|
278
241
|
|
|
279
|
-
const databasesUpdateCollection = async ({ databaseId, collectionId, name,
|
|
242
|
+
const databasesUpdateCollection = async ({ databaseId, collectionId, name, permissions, documentSecurity, enabled, parseOutput = true, sdk = undefined}) => {
|
|
280
243
|
/* @param {string} databaseId */
|
|
281
244
|
/* @param {string} collectionId */
|
|
282
245
|
/* @param {string} name */
|
|
283
|
-
/* @param {string}
|
|
284
|
-
/* @param {
|
|
285
|
-
/* @param {string[]} write */
|
|
246
|
+
/* @param {string[]} permissions */
|
|
247
|
+
/* @param {boolean} documentSecurity */
|
|
286
248
|
/* @param {boolean} enabled */
|
|
287
249
|
|
|
288
250
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
@@ -294,16 +256,12 @@ const databasesUpdateCollection = async ({ databaseId, collectionId, name, permi
|
|
|
294
256
|
payload['name'] = name;
|
|
295
257
|
}
|
|
296
258
|
|
|
297
|
-
if (typeof
|
|
298
|
-
payload['
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (typeof read !== 'undefined') {
|
|
302
|
-
payload['read'] = read;
|
|
259
|
+
if (typeof permissions !== 'undefined') {
|
|
260
|
+
payload['permissions'] = permissions;
|
|
303
261
|
}
|
|
304
262
|
|
|
305
|
-
if (typeof
|
|
306
|
-
payload['
|
|
263
|
+
if (typeof documentSecurity !== 'undefined') {
|
|
264
|
+
payload['documentSecurity'] = documentSecurity;
|
|
307
265
|
}
|
|
308
266
|
|
|
309
267
|
if (typeof enabled !== 'undefined') {
|
|
@@ -401,6 +359,47 @@ const databasesCreateBooleanAttribute = async ({ databaseId, collectionId, key,
|
|
|
401
359
|
return response;
|
|
402
360
|
}
|
|
403
361
|
|
|
362
|
+
const databasesCreateDatetimeAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
|
|
363
|
+
/* @param {string} databaseId */
|
|
364
|
+
/* @param {string} collectionId */
|
|
365
|
+
/* @param {string} key */
|
|
366
|
+
/* @param {boolean} required */
|
|
367
|
+
/* @param {string} xdefault */
|
|
368
|
+
/* @param {boolean} array */
|
|
369
|
+
|
|
370
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
371
|
+
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
372
|
+
let payload = {};
|
|
373
|
+
|
|
374
|
+
/** Body Params */
|
|
375
|
+
if (typeof key !== 'undefined') {
|
|
376
|
+
payload['key'] = key;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
if (typeof required !== 'undefined') {
|
|
380
|
+
payload['required'] = required;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (typeof xdefault !== 'undefined') {
|
|
384
|
+
payload['default'] = xdefault;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (typeof array !== 'undefined') {
|
|
388
|
+
payload['array'] = array;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
let response = undefined;
|
|
392
|
+
response = await client.call('post', path, {
|
|
393
|
+
'content-type': 'application/json',
|
|
394
|
+
}, payload);
|
|
395
|
+
|
|
396
|
+
if (parseOutput) {
|
|
397
|
+
parse(response)
|
|
398
|
+
success()
|
|
399
|
+
}
|
|
400
|
+
return response;
|
|
401
|
+
}
|
|
402
|
+
|
|
404
403
|
const databasesCreateEmailAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
|
|
405
404
|
/* @param {string} databaseId */
|
|
406
405
|
/* @param {string} collectionId */
|
|
@@ -758,16 +757,10 @@ const databasesDeleteAttribute = async ({ databaseId, collectionId, key, parseOu
|
|
|
758
757
|
return response;
|
|
759
758
|
}
|
|
760
759
|
|
|
761
|
-
const databasesListDocuments = async ({ databaseId, collectionId, queries,
|
|
760
|
+
const databasesListDocuments = async ({ databaseId, collectionId, queries, parseOutput = true, sdk = undefined}) => {
|
|
762
761
|
/* @param {string} databaseId */
|
|
763
762
|
/* @param {string} collectionId */
|
|
764
763
|
/* @param {string[]} queries */
|
|
765
|
-
/* @param {number} limit */
|
|
766
|
-
/* @param {number} offset */
|
|
767
|
-
/* @param {string} cursor */
|
|
768
|
-
/* @param {string} cursorDirection */
|
|
769
|
-
/* @param {string[]} orderAttributes */
|
|
770
|
-
/* @param {string[]} orderTypes */
|
|
771
764
|
|
|
772
765
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
773
766
|
let path = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
@@ -777,24 +770,6 @@ const databasesListDocuments = async ({ databaseId, collectionId, queries, limit
|
|
|
777
770
|
if (typeof queries !== 'undefined') {
|
|
778
771
|
payload['queries'] = queries;
|
|
779
772
|
}
|
|
780
|
-
if (typeof limit !== 'undefined') {
|
|
781
|
-
payload['limit'] = limit;
|
|
782
|
-
}
|
|
783
|
-
if (typeof offset !== 'undefined') {
|
|
784
|
-
payload['offset'] = offset;
|
|
785
|
-
}
|
|
786
|
-
if (typeof cursor !== 'undefined') {
|
|
787
|
-
payload['cursor'] = cursor;
|
|
788
|
-
}
|
|
789
|
-
if (typeof cursorDirection !== 'undefined') {
|
|
790
|
-
payload['cursorDirection'] = cursorDirection;
|
|
791
|
-
}
|
|
792
|
-
if (typeof orderAttributes !== 'undefined') {
|
|
793
|
-
payload['orderAttributes'] = orderAttributes;
|
|
794
|
-
}
|
|
795
|
-
if (typeof orderTypes !== 'undefined') {
|
|
796
|
-
payload['orderTypes'] = orderTypes;
|
|
797
|
-
}
|
|
798
773
|
let response = undefined;
|
|
799
774
|
response = await client.call('get', path, {
|
|
800
775
|
'content-type': 'application/json',
|
|
@@ -807,13 +782,12 @@ const databasesListDocuments = async ({ databaseId, collectionId, queries, limit
|
|
|
807
782
|
return response;
|
|
808
783
|
}
|
|
809
784
|
|
|
810
|
-
const databasesCreateDocument = async ({ databaseId, collectionId, documentId, data,
|
|
785
|
+
const databasesCreateDocument = async ({ databaseId, collectionId, documentId, data, permissions, parseOutput = true, sdk = undefined}) => {
|
|
811
786
|
/* @param {string} databaseId */
|
|
812
787
|
/* @param {string} collectionId */
|
|
813
788
|
/* @param {string} documentId */
|
|
814
789
|
/* @param {object} data */
|
|
815
|
-
/* @param {string[]}
|
|
816
|
-
/* @param {string[]} write */
|
|
790
|
+
/* @param {string[]} permissions */
|
|
817
791
|
|
|
818
792
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
819
793
|
let path = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
@@ -828,12 +802,8 @@ const databasesCreateDocument = async ({ databaseId, collectionId, documentId, d
|
|
|
828
802
|
payload['data'] = JSON.parse(data);
|
|
829
803
|
}
|
|
830
804
|
|
|
831
|
-
if (typeof
|
|
832
|
-
payload['
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
if (typeof write !== 'undefined') {
|
|
836
|
-
payload['write'] = write;
|
|
805
|
+
if (typeof permissions !== 'undefined') {
|
|
806
|
+
payload['permissions'] = permissions;
|
|
837
807
|
}
|
|
838
808
|
|
|
839
809
|
let response = undefined;
|
|
@@ -868,13 +838,12 @@ const databasesGetDocument = async ({ databaseId, collectionId, documentId, pars
|
|
|
868
838
|
return response;
|
|
869
839
|
}
|
|
870
840
|
|
|
871
|
-
const databasesUpdateDocument = async ({ databaseId, collectionId, documentId, data,
|
|
841
|
+
const databasesUpdateDocument = async ({ databaseId, collectionId, documentId, data, permissions, parseOutput = true, sdk = undefined}) => {
|
|
872
842
|
/* @param {string} databaseId */
|
|
873
843
|
/* @param {string} collectionId */
|
|
874
844
|
/* @param {string} documentId */
|
|
875
845
|
/* @param {object} data */
|
|
876
|
-
/* @param {string[]}
|
|
877
|
-
/* @param {string[]} write */
|
|
846
|
+
/* @param {string[]} permissions */
|
|
878
847
|
|
|
879
848
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
880
849
|
let path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
|
|
@@ -885,12 +854,8 @@ const databasesUpdateDocument = async ({ databaseId, collectionId, documentId, d
|
|
|
885
854
|
payload['data'] = JSON.parse(data);
|
|
886
855
|
}
|
|
887
856
|
|
|
888
|
-
if (typeof
|
|
889
|
-
payload['
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
if (typeof write !== 'undefined') {
|
|
893
|
-
payload['write'] = write;
|
|
857
|
+
if (typeof permissions !== 'undefined') {
|
|
858
|
+
payload['permissions'] = permissions;
|
|
894
859
|
}
|
|
895
860
|
|
|
896
861
|
let response = undefined;
|
|
@@ -925,23 +890,19 @@ const databasesDeleteDocument = async ({ databaseId, collectionId, documentId, p
|
|
|
925
890
|
return response;
|
|
926
891
|
}
|
|
927
892
|
|
|
928
|
-
const databasesListDocumentLogs = async ({ databaseId, collectionId, documentId,
|
|
893
|
+
const databasesListDocumentLogs = async ({ databaseId, collectionId, documentId, queries, parseOutput = true, sdk = undefined}) => {
|
|
929
894
|
/* @param {string} databaseId */
|
|
930
895
|
/* @param {string} collectionId */
|
|
931
896
|
/* @param {string} documentId */
|
|
932
|
-
/* @param {
|
|
933
|
-
/* @param {number} offset */
|
|
897
|
+
/* @param {string[]} queries */
|
|
934
898
|
|
|
935
899
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
936
900
|
let path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
|
|
937
901
|
let payload = {};
|
|
938
902
|
|
|
939
903
|
/** Query Params */
|
|
940
|
-
if (typeof
|
|
941
|
-
payload['
|
|
942
|
-
}
|
|
943
|
-
if (typeof offset !== 'undefined') {
|
|
944
|
-
payload['offset'] = offset;
|
|
904
|
+
if (typeof queries !== 'undefined') {
|
|
905
|
+
payload['queries'] = queries;
|
|
945
906
|
}
|
|
946
907
|
let response = undefined;
|
|
947
908
|
response = await client.call('get', path, {
|
|
@@ -1055,22 +1016,18 @@ const databasesDeleteIndex = async ({ databaseId, collectionId, key, parseOutput
|
|
|
1055
1016
|
return response;
|
|
1056
1017
|
}
|
|
1057
1018
|
|
|
1058
|
-
const databasesListCollectionLogs = async ({ databaseId, collectionId,
|
|
1019
|
+
const databasesListCollectionLogs = async ({ databaseId, collectionId, queries, parseOutput = true, sdk = undefined}) => {
|
|
1059
1020
|
/* @param {string} databaseId */
|
|
1060
1021
|
/* @param {string} collectionId */
|
|
1061
|
-
/* @param {
|
|
1062
|
-
/* @param {number} offset */
|
|
1022
|
+
/* @param {string[]} queries */
|
|
1063
1023
|
|
|
1064
1024
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1065
1025
|
let path = '/databases/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1066
1026
|
let payload = {};
|
|
1067
1027
|
|
|
1068
1028
|
/** Query Params */
|
|
1069
|
-
if (typeof
|
|
1070
|
-
payload['
|
|
1071
|
-
}
|
|
1072
|
-
if (typeof offset !== 'undefined') {
|
|
1073
|
-
payload['offset'] = offset;
|
|
1029
|
+
if (typeof queries !== 'undefined') {
|
|
1030
|
+
payload['queries'] = queries;
|
|
1074
1031
|
}
|
|
1075
1032
|
let response = undefined;
|
|
1076
1033
|
response = await client.call('get', path, {
|
|
@@ -1109,21 +1066,17 @@ const databasesGetCollectionUsage = async ({ databaseId, collectionId, range, pa
|
|
|
1109
1066
|
return response;
|
|
1110
1067
|
}
|
|
1111
1068
|
|
|
1112
|
-
const databasesListLogs = async ({ databaseId,
|
|
1069
|
+
const databasesListLogs = async ({ databaseId, queries, parseOutput = true, sdk = undefined}) => {
|
|
1113
1070
|
/* @param {string} databaseId */
|
|
1114
|
-
/* @param {
|
|
1115
|
-
/* @param {number} offset */
|
|
1071
|
+
/* @param {string[]} queries */
|
|
1116
1072
|
|
|
1117
1073
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1118
1074
|
let path = '/databases/{databaseId}/logs'.replace('{databaseId}', databaseId);
|
|
1119
1075
|
let payload = {};
|
|
1120
1076
|
|
|
1121
1077
|
/** Query Params */
|
|
1122
|
-
if (typeof
|
|
1123
|
-
payload['
|
|
1124
|
-
}
|
|
1125
|
-
if (typeof offset !== 'undefined') {
|
|
1126
|
-
payload['offset'] = offset;
|
|
1078
|
+
if (typeof queries !== 'undefined') {
|
|
1079
|
+
payload['queries'] = queries;
|
|
1127
1080
|
}
|
|
1128
1081
|
let response = undefined;
|
|
1129
1082
|
response = await client.call('get', path, {
|
|
@@ -1164,18 +1117,14 @@ const databasesGetDatabaseUsage = async ({ databaseId, range, parseOutput = true
|
|
|
1164
1117
|
|
|
1165
1118
|
databases
|
|
1166
1119
|
.command(`list`)
|
|
1167
|
-
.description(
|
|
1120
|
+
.description(`Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`)
|
|
1121
|
+
.option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name`)
|
|
1168
1122
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
1169
|
-
.option(`--limit <limit>`, `Maximum number of collection to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
1170
|
-
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
1171
|
-
.option(`--cursor <cursor>`, `ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.`)
|
|
1172
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
1173
|
-
.option(`--orderType <orderType>`, `Order result by ASC or DESC order.`)
|
|
1174
1123
|
.action(actionRunner(databasesList))
|
|
1175
1124
|
|
|
1176
1125
|
databases
|
|
1177
1126
|
.command(`create`)
|
|
1178
|
-
.description(
|
|
1127
|
+
.description(`Create a new Database. `)
|
|
1179
1128
|
.requiredOption(`--databaseId <databaseId>`, `Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
|
|
1180
1129
|
.requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
|
|
1181
1130
|
.action(actionRunner(databasesCreate))
|
|
@@ -1188,68 +1137,62 @@ databases
|
|
|
1188
1137
|
|
|
1189
1138
|
databases
|
|
1190
1139
|
.command(`get`)
|
|
1191
|
-
.description(
|
|
1140
|
+
.description(`Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.`)
|
|
1192
1141
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1193
1142
|
.action(actionRunner(databasesGet))
|
|
1194
1143
|
|
|
1195
1144
|
databases
|
|
1196
1145
|
.command(`update`)
|
|
1197
|
-
.description(
|
|
1146
|
+
.description(`Update a database by its unique ID.`)
|
|
1198
1147
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1199
1148
|
.requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
|
|
1200
1149
|
.action(actionRunner(databasesUpdate))
|
|
1201
1150
|
|
|
1202
1151
|
databases
|
|
1203
1152
|
.command(`delete`)
|
|
1204
|
-
.description(
|
|
1153
|
+
.description(`Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.`)
|
|
1205
1154
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1206
1155
|
.action(actionRunner(databasesDelete))
|
|
1207
1156
|
|
|
1208
1157
|
databases
|
|
1209
1158
|
.command(`listCollections`)
|
|
1210
|
-
.description(
|
|
1159
|
+
.description(`Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.`)
|
|
1211
1160
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1161
|
+
.option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity`)
|
|
1212
1162
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
1213
|
-
.option(`--limit <limit>`, `Maximum number of collection to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
1214
|
-
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
1215
|
-
.option(`--cursor <cursor>`, `ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.`)
|
|
1216
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
1217
|
-
.option(`--orderType <orderType>`, `Order result by ASC or DESC order.`)
|
|
1218
1163
|
.action(actionRunner(databasesListCollections))
|
|
1219
1164
|
|
|
1220
1165
|
databases
|
|
1221
1166
|
.command(`createCollection`)
|
|
1222
|
-
.description(
|
|
1167
|
+
.description(`Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
|
|
1223
1168
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1224
1169
|
.requiredOption(`--collectionId <collectionId>`, `Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
|
|
1225
1170
|
.requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
|
|
1226
|
-
.
|
|
1227
|
-
.
|
|
1228
|
-
.requiredOption(`--write <write...>`, `An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.`)
|
|
1171
|
+
.option(`--permissions <permissions...>`, `An array of permissions strings. By default no user is granted with any permissions. [Learn more about permissions](/docs/permissions).`)
|
|
1172
|
+
.option(`--documentSecurity <documentSecurity>`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](/docs/permissions).`, parseBool)
|
|
1229
1173
|
.action(actionRunner(databasesCreateCollection))
|
|
1230
1174
|
|
|
1231
1175
|
databases
|
|
1232
1176
|
.command(`getCollection`)
|
|
1233
|
-
.description(
|
|
1177
|
+
.description(`Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.`)
|
|
1234
1178
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1235
1179
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID.`)
|
|
1236
1180
|
.action(actionRunner(databasesGetCollection))
|
|
1237
1181
|
|
|
1238
1182
|
databases
|
|
1239
1183
|
.command(`updateCollection`)
|
|
1240
|
-
.description(
|
|
1184
|
+
.description(`Update a collection by its unique ID.`)
|
|
1241
1185
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1242
1186
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID.`)
|
|
1243
1187
|
.requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
|
|
1244
|
-
.
|
|
1245
|
-
.option(`--
|
|
1246
|
-
.option(`--write <write...>`, `An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.`)
|
|
1188
|
+
.option(`--permissions <permissions...>`, `An array of permission strings. By default the current permission are inherited. [Learn more about permissions](/docs/permissions).`)
|
|
1189
|
+
.option(`--documentSecurity <documentSecurity>`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](/docs/permissions).`, parseBool)
|
|
1247
1190
|
.option(`--enabled <enabled>`, `Is collection enabled?`, parseBool)
|
|
1248
1191
|
.action(actionRunner(databasesUpdateCollection))
|
|
1249
1192
|
|
|
1250
1193
|
databases
|
|
1251
1194
|
.command(`deleteCollection`)
|
|
1252
|
-
.description(
|
|
1195
|
+
.description(`Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.`)
|
|
1253
1196
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1254
1197
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID.`)
|
|
1255
1198
|
.action(actionRunner(databasesDeleteCollection))
|
|
@@ -1258,14 +1201,14 @@ databases
|
|
|
1258
1201
|
.command(`listAttributes`)
|
|
1259
1202
|
.description(``)
|
|
1260
1203
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1261
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1204
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1262
1205
|
.action(actionRunner(databasesListAttributes))
|
|
1263
1206
|
|
|
1264
1207
|
databases
|
|
1265
1208
|
.command(`createBooleanAttribute`)
|
|
1266
|
-
.description(
|
|
1209
|
+
.description(`Create a boolean attribute. `)
|
|
1267
1210
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1268
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1211
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1269
1212
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
1270
1213
|
.requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
|
|
1271
1214
|
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseBool)
|
|
@@ -1273,10 +1216,21 @@ databases
|
|
|
1273
1216
|
.action(actionRunner(databasesCreateBooleanAttribute))
|
|
1274
1217
|
|
|
1275
1218
|
databases
|
|
1276
|
-
.command(`
|
|
1219
|
+
.command(`createDatetimeAttribute`)
|
|
1277
1220
|
.description(``)
|
|
1278
1221
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1279
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1222
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1223
|
+
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
1224
|
+
.requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
|
|
1225
|
+
.option(`--xdefault <xdefault>`, `Default value for the attribute in ISO 8601 format. Cannot be set when attribute is required.`)
|
|
1226
|
+
.option(`--array <array>`, `Is attribute an array?`, parseBool)
|
|
1227
|
+
.action(actionRunner(databasesCreateDatetimeAttribute))
|
|
1228
|
+
|
|
1229
|
+
databases
|
|
1230
|
+
.command(`createEmailAttribute`)
|
|
1231
|
+
.description(`Create an email attribute. `)
|
|
1232
|
+
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1233
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1280
1234
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
1281
1235
|
.requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
|
|
1282
1236
|
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
|
|
@@ -1287,7 +1241,7 @@ databases
|
|
|
1287
1241
|
.command(`createEnumAttribute`)
|
|
1288
1242
|
.description(``)
|
|
1289
1243
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1290
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1244
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1291
1245
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
1292
1246
|
.requiredOption(`--elements <elements...>`, `Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 4096 characters long.`)
|
|
1293
1247
|
.requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
|
|
@@ -1297,9 +1251,9 @@ databases
|
|
|
1297
1251
|
|
|
1298
1252
|
databases
|
|
1299
1253
|
.command(`createFloatAttribute`)
|
|
1300
|
-
.description(
|
|
1254
|
+
.description(`Create a float attribute. Optionally, minimum and maximum values can be provided. `)
|
|
1301
1255
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1302
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1256
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1303
1257
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
1304
1258
|
.requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
|
|
1305
1259
|
.option(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
|
|
@@ -1310,9 +1264,9 @@ databases
|
|
|
1310
1264
|
|
|
1311
1265
|
databases
|
|
1312
1266
|
.command(`createIntegerAttribute`)
|
|
1313
|
-
.description(
|
|
1267
|
+
.description(`Create an integer attribute. Optionally, minimum and maximum values can be provided. `)
|
|
1314
1268
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1315
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1269
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1316
1270
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
1317
1271
|
.requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
|
|
1318
1272
|
.option(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
|
|
@@ -1323,9 +1277,9 @@ databases
|
|
|
1323
1277
|
|
|
1324
1278
|
databases
|
|
1325
1279
|
.command(`createIpAttribute`)
|
|
1326
|
-
.description(
|
|
1280
|
+
.description(`Create IP address attribute. `)
|
|
1327
1281
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1328
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1282
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1329
1283
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
1330
1284
|
.requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
|
|
1331
1285
|
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
|
|
@@ -1334,9 +1288,9 @@ databases
|
|
|
1334
1288
|
|
|
1335
1289
|
databases
|
|
1336
1290
|
.command(`createStringAttribute`)
|
|
1337
|
-
.description(
|
|
1291
|
+
.description(`Create a string attribute. `)
|
|
1338
1292
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1339
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1293
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1340
1294
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
1341
1295
|
.requiredOption(`--size <size>`, `Attribute size for text attributes, in number of characters.`, parseInteger)
|
|
1342
1296
|
.requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
|
|
@@ -1346,9 +1300,9 @@ databases
|
|
|
1346
1300
|
|
|
1347
1301
|
databases
|
|
1348
1302
|
.command(`createUrlAttribute`)
|
|
1349
|
-
.description(
|
|
1303
|
+
.description(`Create a URL attribute. `)
|
|
1350
1304
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1351
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1305
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1352
1306
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
1353
1307
|
.requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
|
|
1354
1308
|
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
|
|
@@ -1359,7 +1313,7 @@ databases
|
|
|
1359
1313
|
.command(`getAttribute`)
|
|
1360
1314
|
.description(``)
|
|
1361
1315
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1362
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1316
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1363
1317
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
1364
1318
|
.action(actionRunner(databasesGetAttribute))
|
|
1365
1319
|
|
|
@@ -1367,84 +1321,75 @@ databases
|
|
|
1367
1321
|
.command(`deleteAttribute`)
|
|
1368
1322
|
.description(``)
|
|
1369
1323
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1370
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1324
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1371
1325
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
1372
1326
|
.action(actionRunner(databasesDeleteAttribute))
|
|
1373
1327
|
|
|
1374
1328
|
databases
|
|
1375
1329
|
.command(`listDocuments`)
|
|
1376
|
-
.description(
|
|
1330
|
+
.description(`Get a list of all the user's documents in a given collection. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of documents belonging to the provided collectionId. [Learn more about different API modes](/docs/admin).`)
|
|
1377
1331
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1378
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1379
|
-
.option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/
|
|
1380
|
-
.option(`--limit <limit>`, `Maximum number of documents to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
1381
|
-
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
1382
|
-
.option(`--cursor <cursor>`, `ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)`)
|
|
1383
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
1384
|
-
.option(`--orderAttributes <orderAttributes...>`, `Array of attributes used to sort results. Maximum of 100 order attributes are allowed, each 4096 characters long.`)
|
|
1385
|
-
.option(`--orderTypes <orderTypes...>`, `Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order. Maximum of 100 order types are allowed.`)
|
|
1332
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1333
|
+
.option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.`)
|
|
1386
1334
|
.action(actionRunner(databasesListDocuments))
|
|
1387
1335
|
|
|
1388
1336
|
databases
|
|
1389
1337
|
.command(`createDocument`)
|
|
1390
|
-
.description(
|
|
1338
|
+
.description(`Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
|
|
1391
1339
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1392
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1340
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.`)
|
|
1393
1341
|
.requiredOption(`--documentId <documentId>`, `Document ID. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
|
|
1394
1342
|
.requiredOption(`--data <data>`, `Document data as JSON object.`)
|
|
1395
|
-
.option(`--
|
|
1396
|
-
.option(`--write <write...>`, `An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.`)
|
|
1343
|
+
.option(`--permissions <permissions...>`, `An array of permissions strings. By default the current user is granted with all permissions. [Learn more about permissions](/docs/permissions).`)
|
|
1397
1344
|
.action(actionRunner(databasesCreateDocument))
|
|
1398
1345
|
|
|
1399
1346
|
databases
|
|
1400
1347
|
.command(`getDocument`)
|
|
1401
|
-
.description(
|
|
1348
|
+
.description(`Get a document by its unique ID. This endpoint response returns a JSON object with the document data.`)
|
|
1402
1349
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1403
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1350
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1404
1351
|
.requiredOption(`--documentId <documentId>`, `Document ID.`)
|
|
1405
1352
|
.action(actionRunner(databasesGetDocument))
|
|
1406
1353
|
|
|
1407
1354
|
databases
|
|
1408
1355
|
.command(`updateDocument`)
|
|
1409
|
-
.description(
|
|
1356
|
+
.description(`Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.`)
|
|
1410
1357
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1411
1358
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID.`)
|
|
1412
1359
|
.requiredOption(`--documentId <documentId>`, `Document ID.`)
|
|
1413
1360
|
.option(`--data <data>`, `Document data as JSON object. Include only attribute and value pairs to be updated.`)
|
|
1414
|
-
.option(`--
|
|
1415
|
-
.option(`--write <write...>`, `An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.`)
|
|
1361
|
+
.option(`--permissions <permissions...>`, `An array of permissions strings. By default the current permissions are inherited. [Learn more about permissions](/docs/permissions).`)
|
|
1416
1362
|
.action(actionRunner(databasesUpdateDocument))
|
|
1417
1363
|
|
|
1418
1364
|
databases
|
|
1419
1365
|
.command(`deleteDocument`)
|
|
1420
|
-
.description(
|
|
1366
|
+
.description(`Delete a document by its unique ID.`)
|
|
1421
1367
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1422
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1368
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1423
1369
|
.requiredOption(`--documentId <documentId>`, `Document ID.`)
|
|
1424
1370
|
.action(actionRunner(databasesDeleteDocument))
|
|
1425
1371
|
|
|
1426
1372
|
databases
|
|
1427
1373
|
.command(`listDocumentLogs`)
|
|
1428
|
-
.description(
|
|
1374
|
+
.description(`Get the document activity logs list by its unique ID.`)
|
|
1429
1375
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1430
1376
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID.`)
|
|
1431
1377
|
.requiredOption(`--documentId <documentId>`, `Document ID.`)
|
|
1432
|
-
.option(`--
|
|
1433
|
-
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
1378
|
+
.option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset`)
|
|
1434
1379
|
.action(actionRunner(databasesListDocumentLogs))
|
|
1435
1380
|
|
|
1436
1381
|
databases
|
|
1437
1382
|
.command(`listIndexes`)
|
|
1438
1383
|
.description(``)
|
|
1439
1384
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1440
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1385
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1441
1386
|
.action(actionRunner(databasesListIndexes))
|
|
1442
1387
|
|
|
1443
1388
|
databases
|
|
1444
1389
|
.command(`createIndex`)
|
|
1445
1390
|
.description(``)
|
|
1446
1391
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1447
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1392
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1448
1393
|
.requiredOption(`--key <key>`, `Index Key.`)
|
|
1449
1394
|
.requiredOption(`--type <type>`, `Index type.`)
|
|
1450
1395
|
.requiredOption(`--attributes <attributes...>`, `Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.`)
|
|
@@ -1455,7 +1400,7 @@ databases
|
|
|
1455
1400
|
.command(`getIndex`)
|
|
1456
1401
|
.description(``)
|
|
1457
1402
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1458
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1403
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1459
1404
|
.requiredOption(`--key <key>`, `Index Key.`)
|
|
1460
1405
|
.action(actionRunner(databasesGetIndex))
|
|
1461
1406
|
|
|
@@ -1463,17 +1408,16 @@ databases
|
|
|
1463
1408
|
.command(`deleteIndex`)
|
|
1464
1409
|
.description(``)
|
|
1465
1410
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1466
|
-
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/
|
|
1411
|
+
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
1467
1412
|
.requiredOption(`--key <key>`, `Index Key.`)
|
|
1468
1413
|
.action(actionRunner(databasesDeleteIndex))
|
|
1469
1414
|
|
|
1470
1415
|
databases
|
|
1471
1416
|
.command(`listCollectionLogs`)
|
|
1472
|
-
.description(
|
|
1417
|
+
.description(`Get the collection activity logs list by its unique ID.`)
|
|
1473
1418
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1474
1419
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID.`)
|
|
1475
|
-
.option(`--
|
|
1476
|
-
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
1420
|
+
.option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset`)
|
|
1477
1421
|
.action(actionRunner(databasesListCollectionLogs))
|
|
1478
1422
|
|
|
1479
1423
|
databases
|
|
@@ -1486,10 +1430,9 @@ databases
|
|
|
1486
1430
|
|
|
1487
1431
|
databases
|
|
1488
1432
|
.command(`listLogs`)
|
|
1489
|
-
.description(
|
|
1433
|
+
.description(`Get the database activity logs list by its unique ID.`)
|
|
1490
1434
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
1491
|
-
.option(`--
|
|
1492
|
-
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
1435
|
+
.option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset`)
|
|
1493
1436
|
.action(actionRunner(databasesListLogs))
|
|
1494
1437
|
|
|
1495
1438
|
databases
|
|
@@ -1515,6 +1458,7 @@ module.exports = {
|
|
|
1515
1458
|
databasesDeleteCollection,
|
|
1516
1459
|
databasesListAttributes,
|
|
1517
1460
|
databasesCreateBooleanAttribute,
|
|
1461
|
+
databasesCreateDatetimeAttribute,
|
|
1518
1462
|
databasesCreateEmailAttribute,
|
|
1519
1463
|
databasesCreateEnumAttribute,
|
|
1520
1464
|
databasesCreateFloatAttribute,
|