appwrite-cli 6.2.3 → 8.0.0

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.
Files changed (118) hide show
  1. package/README.md +4 -4
  2. package/docs/examples/console/get-resource.md +3 -0
  3. package/docs/examples/databases/create-documents.md +4 -0
  4. package/docs/examples/databases/create-index.md +1 -0
  5. package/docs/examples/databases/delete-documents.md +4 -0
  6. package/docs/examples/databases/update-documents.md +5 -0
  7. package/docs/examples/databases/upsert-document.md +6 -0
  8. package/docs/examples/databases/upsert-documents.md +4 -0
  9. package/docs/examples/functions/{create-build.md → create-duplicate-deployment.md} +1 -1
  10. package/docs/examples/functions/create-template-deployment.md +7 -0
  11. package/docs/examples/functions/create-variable.md +2 -1
  12. package/docs/examples/functions/create-vcs-deployment.md +5 -0
  13. package/docs/examples/functions/create.md +0 -4
  14. package/docs/examples/functions/get-deployment-download.md +2 -1
  15. package/docs/examples/functions/get-usage.md +1 -0
  16. package/docs/examples/functions/list-executions.md +0 -1
  17. package/docs/examples/functions/list-usage.md +2 -0
  18. package/docs/examples/functions/{update-deployment.md → update-deployment-status.md} +1 -1
  19. package/docs/examples/functions/{update-deployment-build.md → update-function-deployment.md} +1 -1
  20. package/docs/examples/functions/update-variable.md +1 -0
  21. package/docs/examples/migrations/create-csv-migration.md +4 -0
  22. package/docs/examples/project/create-variable.md +2 -1
  23. package/docs/examples/project/update-variable.md +1 -0
  24. package/docs/examples/projects/create-dev-key.md +4 -0
  25. package/docs/examples/projects/delete-dev-key.md +3 -0
  26. package/docs/examples/projects/get-dev-key.md +3 -0
  27. package/docs/examples/projects/list-dev-keys.md +3 -0
  28. package/docs/examples/projects/update-dev-key.md +5 -0
  29. package/docs/examples/proxy/create-a-p-i-rule.md +2 -0
  30. package/docs/examples/proxy/create-function-rule.md +4 -0
  31. package/docs/examples/proxy/create-redirect-rule.md +4 -0
  32. package/docs/examples/proxy/create-site-rule.md +4 -0
  33. package/docs/examples/sites/create-deployment.md +7 -0
  34. package/docs/examples/sites/create-duplicate-deployment.md +3 -0
  35. package/docs/examples/sites/create-template-deployment.md +7 -0
  36. package/docs/examples/sites/create-variable.md +5 -0
  37. package/docs/examples/sites/create-vcs-deployment.md +5 -0
  38. package/docs/examples/sites/create.md +19 -0
  39. package/docs/examples/sites/delete-deployment.md +3 -0
  40. package/docs/examples/sites/delete-log.md +3 -0
  41. package/docs/examples/sites/delete-variable.md +3 -0
  42. package/docs/examples/sites/delete.md +2 -0
  43. package/docs/examples/sites/get-deployment-download.md +4 -0
  44. package/docs/examples/sites/get-deployment.md +3 -0
  45. package/docs/examples/sites/get-log.md +3 -0
  46. package/docs/examples/sites/get-template.md +2 -0
  47. package/docs/examples/sites/get-usage.md +3 -0
  48. package/docs/examples/sites/get-variable.md +3 -0
  49. package/docs/examples/sites/get.md +2 -0
  50. package/docs/examples/sites/list-deployments.md +4 -0
  51. package/docs/examples/sites/list-frameworks.md +1 -0
  52. package/docs/examples/sites/list-logs.md +3 -0
  53. package/docs/examples/sites/list-specifications.md +1 -0
  54. package/docs/examples/sites/list-templates.md +5 -0
  55. package/docs/examples/sites/list-usage.md +2 -0
  56. package/docs/examples/sites/list-variables.md +2 -0
  57. package/docs/examples/sites/list.md +3 -0
  58. package/docs/examples/sites/update-deployment-status.md +3 -0
  59. package/docs/examples/sites/update-site-deployment.md +3 -0
  60. package/docs/examples/sites/update-variable.md +6 -0
  61. package/docs/examples/sites/update.md +19 -0
  62. package/docs/examples/storage/get-file-download.md +2 -1
  63. package/docs/examples/storage/get-file-preview.md +1 -0
  64. package/docs/examples/storage/get-file-view.md +2 -1
  65. package/docs/examples/tokens/create-file-token.md +4 -0
  66. package/docs/examples/tokens/delete.md +2 -0
  67. package/docs/examples/tokens/get.md +2 -0
  68. package/docs/examples/tokens/list.md +4 -0
  69. package/docs/examples/tokens/update.md +3 -0
  70. package/docs/examples/users/list-memberships.md +3 -1
  71. package/docs/examples/vcs/create-repository-detection.md +1 -0
  72. package/docs/examples/vcs/list-repositories.md +1 -0
  73. package/index.js +6 -2
  74. package/install.ps1 +2 -2
  75. package/install.sh +1 -1
  76. package/lib/client.js +8 -4
  77. package/lib/commands/account.js +7 -17
  78. package/lib/commands/avatars.js +7 -14
  79. package/lib/commands/console.js +50 -1
  80. package/lib/commands/databases.js +287 -55
  81. package/lib/commands/functions.js +244 -146
  82. package/lib/commands/generic.js +1 -1
  83. package/lib/commands/health.js +0 -63
  84. package/lib/commands/init.js +191 -0
  85. package/lib/commands/locale.js +0 -8
  86. package/lib/commands/messaging.js +38 -51
  87. package/lib/commands/migrations.js +50 -5
  88. package/lib/commands/project.js +12 -5
  89. package/lib/commands/projects.js +246 -27
  90. package/lib/commands/proxy.js +160 -19
  91. package/lib/commands/pull.js +124 -1
  92. package/lib/commands/push.js +338 -5
  93. package/lib/commands/sites.js +1663 -0
  94. package/lib/commands/storage.js +28 -22
  95. package/lib/commands/teams.js +2 -8
  96. package/lib/commands/tokens.js +261 -0
  97. package/lib/commands/types.js +126 -0
  98. package/lib/commands/users.js +15 -17
  99. package/lib/commands/vcs.js +60 -53
  100. package/lib/config.js +50 -0
  101. package/lib/parser.js +2 -2
  102. package/lib/questions.js +110 -1
  103. package/lib/type-generation/attribute.js +16 -0
  104. package/lib/type-generation/languages/dart.js +152 -0
  105. package/lib/type-generation/languages/java.js +121 -0
  106. package/lib/type-generation/languages/javascript.js +84 -0
  107. package/lib/type-generation/languages/kotlin.js +75 -0
  108. package/lib/type-generation/languages/language.js +125 -0
  109. package/lib/type-generation/languages/php.js +100 -0
  110. package/lib/type-generation/languages/swift.js +156 -0
  111. package/lib/type-generation/languages/typescript.js +95 -0
  112. package/package.json +2 -1
  113. package/scoop/appwrite.json +3 -3
  114. package/docs/examples/assistant/chat.md +0 -2
  115. package/docs/examples/functions/get-function-usage.md +0 -3
  116. package/docs/examples/health/get-queue-stats-usage-dump.md +0 -2
  117. package/docs/examples/proxy/create-rule.md +0 -4
  118. package/lib/commands/assistant.js +0 -85
@@ -66,7 +66,6 @@ const databasesList = async ({queries,search,parseOutput = true, overrideForCli
66
66
  let response = undefined;
67
67
 
68
68
  response = await client.call('get', apiPath, {
69
- 'content-type': 'application/json',
70
69
  }, payload);
71
70
 
72
71
  if (parseOutput) {
@@ -146,7 +145,6 @@ const databasesGetUsage = async ({range,parseOutput = true, overrideForCli = fal
146
145
  let response = undefined;
147
146
 
148
147
  response = await client.call('get', apiPath, {
149
- 'content-type': 'application/json',
150
148
  }, payload);
151
149
 
152
150
  if (parseOutput) {
@@ -177,7 +175,6 @@ const databasesGet = async ({databaseId,parseOutput = true, overrideForCli = fal
177
175
  let response = undefined;
178
176
 
179
177
  response = await client.call('get', apiPath, {
180
- 'content-type': 'application/json',
181
178
  }, payload);
182
179
 
183
180
  if (parseOutput) {
@@ -290,7 +287,6 @@ const databasesListCollections = async ({databaseId,queries,search,parseOutput =
290
287
  let response = undefined;
291
288
 
292
289
  response = await client.call('get', apiPath, {
293
- 'content-type': 'application/json',
294
290
  }, payload);
295
291
 
296
292
  if (parseOutput) {
@@ -378,7 +374,6 @@ const databasesGetCollection = async ({databaseId,collectionId,parseOutput = tru
378
374
  let response = undefined;
379
375
 
380
376
  response = await client.call('get', apiPath, {
381
- 'content-type': 'application/json',
382
377
  }, payload);
383
378
 
384
379
  if (parseOutput) {
@@ -499,7 +494,6 @@ const databasesListAttributes = async ({databaseId,collectionId,queries,parseOut
499
494
  let response = undefined;
500
495
 
501
496
  response = await client.call('get', apiPath, {
502
- 'content-type': 'application/json',
503
497
  }, payload);
504
498
 
505
499
  if (parseOutput) {
@@ -1483,7 +1477,6 @@ const databasesGetAttribute = async ({databaseId,collectionId,key,parseOutput =
1483
1477
  let response = undefined;
1484
1478
 
1485
1479
  response = await client.call('get', apiPath, {
1486
- 'content-type': 'application/json',
1487
1480
  }, payload);
1488
1481
 
1489
1482
  if (parseOutput) {
@@ -1593,7 +1586,6 @@ const databasesListDocuments = async ({databaseId,collectionId,queries,parseOutp
1593
1586
  let response = undefined;
1594
1587
 
1595
1588
  response = await client.call('get', apiPath, {
1596
- 'content-type': 'application/json',
1597
1589
  }, payload);
1598
1590
 
1599
1591
  if (parseOutput) {
@@ -1653,6 +1645,158 @@ const databasesCreateDocument = async ({databaseId,collectionId,documentId,data,
1653
1645
 
1654
1646
  }
1655
1647
 
1648
+ /**
1649
+ * @typedef {Object} DatabasesCreateDocumentsRequestParams
1650
+ * @property {string} databaseId Database ID.
1651
+ * @property {string} 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.
1652
+ * @property {object[]} documents Array of documents data as JSON objects.
1653
+ * @property {boolean} overrideForCli
1654
+ * @property {boolean} parseOutput
1655
+ * @property {libClient | undefined} sdk
1656
+ */
1657
+
1658
+ /**
1659
+ * @param {DatabasesCreateDocumentsRequestParams} params
1660
+ */
1661
+ const databasesCreateDocuments = async ({databaseId,collectionId,documents,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1662
+ let client = !sdk ? await sdkForProject() :
1663
+ sdk;
1664
+ let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1665
+ let payload = {};
1666
+ documents = documents === true ? [] : documents;
1667
+ if (typeof documents !== 'undefined') {
1668
+ payload['documents'] = documents;
1669
+ }
1670
+
1671
+ let response = undefined;
1672
+
1673
+ response = await client.call('post', apiPath, {
1674
+ 'content-type': 'application/json',
1675
+ }, payload);
1676
+
1677
+ if (parseOutput) {
1678
+ parse(response)
1679
+ }
1680
+
1681
+ return response;
1682
+
1683
+ }
1684
+
1685
+ /**
1686
+ * @typedef {Object} DatabasesUpsertDocumentsRequestParams
1687
+ * @property {string} databaseId Database ID.
1688
+ * @property {string} collectionId Collection ID.
1689
+ * @property {object[]} documents Array of document data as JSON objects. May contain partial documents.
1690
+ * @property {boolean} overrideForCli
1691
+ * @property {boolean} parseOutput
1692
+ * @property {libClient | undefined} sdk
1693
+ */
1694
+
1695
+ /**
1696
+ * @param {DatabasesUpsertDocumentsRequestParams} params
1697
+ */
1698
+ const databasesUpsertDocuments = async ({databaseId,collectionId,documents,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1699
+ let client = !sdk ? await sdkForProject() :
1700
+ sdk;
1701
+ let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1702
+ let payload = {};
1703
+ documents = documents === true ? [] : documents;
1704
+ if (typeof documents !== 'undefined') {
1705
+ payload['documents'] = documents;
1706
+ }
1707
+
1708
+ let response = undefined;
1709
+
1710
+ response = await client.call('put', apiPath, {
1711
+ 'content-type': 'application/json',
1712
+ }, payload);
1713
+
1714
+ if (parseOutput) {
1715
+ parse(response)
1716
+ }
1717
+
1718
+ return response;
1719
+
1720
+ }
1721
+
1722
+ /**
1723
+ * @typedef {Object} DatabasesUpdateDocumentsRequestParams
1724
+ * @property {string} databaseId Database ID.
1725
+ * @property {string} collectionId Collection ID.
1726
+ * @property {object} data Document data as JSON object. Include only attribute and value pairs to be updated.
1727
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1728
+ * @property {boolean} overrideForCli
1729
+ * @property {boolean} parseOutput
1730
+ * @property {libClient | undefined} sdk
1731
+ */
1732
+
1733
+ /**
1734
+ * @param {DatabasesUpdateDocumentsRequestParams} params
1735
+ */
1736
+ const databasesUpdateDocuments = async ({databaseId,collectionId,data,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1737
+ let client = !sdk ? await sdkForProject() :
1738
+ sdk;
1739
+ let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1740
+ let payload = {};
1741
+ if (typeof data !== 'undefined') {
1742
+ payload['data'] = JSON.parse(data);
1743
+ }
1744
+ queries = queries === true ? [] : queries;
1745
+ if (typeof queries !== 'undefined') {
1746
+ payload['queries'] = queries;
1747
+ }
1748
+
1749
+ let response = undefined;
1750
+
1751
+ response = await client.call('patch', apiPath, {
1752
+ 'content-type': 'application/json',
1753
+ }, payload);
1754
+
1755
+ if (parseOutput) {
1756
+ parse(response)
1757
+ }
1758
+
1759
+ return response;
1760
+
1761
+ }
1762
+
1763
+ /**
1764
+ * @typedef {Object} DatabasesDeleteDocumentsRequestParams
1765
+ * @property {string} databaseId Database ID.
1766
+ * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1767
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1768
+ * @property {boolean} overrideForCli
1769
+ * @property {boolean} parseOutput
1770
+ * @property {libClient | undefined} sdk
1771
+ */
1772
+
1773
+ /**
1774
+ * @param {DatabasesDeleteDocumentsRequestParams} params
1775
+ */
1776
+ const databasesDeleteDocuments = async ({databaseId,collectionId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1777
+ let client = !sdk ? await sdkForProject() :
1778
+ sdk;
1779
+ let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1780
+ let payload = {};
1781
+ queries = queries === true ? [] : queries;
1782
+ if (typeof queries !== 'undefined') {
1783
+ payload['queries'] = queries;
1784
+ }
1785
+
1786
+ let response = undefined;
1787
+
1788
+ response = await client.call('delete', apiPath, {
1789
+ 'content-type': 'application/json',
1790
+ }, payload);
1791
+
1792
+ if (parseOutput) {
1793
+ parse(response)
1794
+ }
1795
+
1796
+ return response;
1797
+
1798
+ }
1799
+
1656
1800
  /**
1657
1801
  * @typedef {Object} DatabasesGetDocumentRequestParams
1658
1802
  * @property {string} databaseId Database ID.
@@ -1679,7 +1823,6 @@ const databasesGetDocument = async ({databaseId,collectionId,documentId,queries,
1679
1823
  let response = undefined;
1680
1824
 
1681
1825
  response = await client.call('get', apiPath, {
1682
- 'content-type': 'application/json',
1683
1826
  }, payload);
1684
1827
 
1685
1828
  if (parseOutput) {
@@ -1694,6 +1837,48 @@ const databasesGetDocument = async ({databaseId,collectionId,documentId,queries,
1694
1837
 
1695
1838
  }
1696
1839
 
1840
+ /**
1841
+ * @typedef {Object} DatabasesUpsertDocumentRequestParams
1842
+ * @property {string} databaseId Database ID.
1843
+ * @property {string} collectionId Collection ID.
1844
+ * @property {string} documentId Document ID.
1845
+ * @property {object} data Document data as JSON object. Include all required attributes of the document to be created or updated.
1846
+ * @property {string[]} permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
1847
+ * @property {boolean} overrideForCli
1848
+ * @property {boolean} parseOutput
1849
+ * @property {libClient | undefined} sdk
1850
+ */
1851
+
1852
+ /**
1853
+ * @param {DatabasesUpsertDocumentRequestParams} params
1854
+ */
1855
+ const databasesUpsertDocument = async ({databaseId,collectionId,documentId,data,permissions,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1856
+ let client = !sdk ? await sdkForProject() :
1857
+ sdk;
1858
+ let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
1859
+ let payload = {};
1860
+ if (typeof data !== 'undefined') {
1861
+ payload['data'] = JSON.parse(data);
1862
+ }
1863
+ permissions = permissions === true ? [] : permissions;
1864
+ if (typeof permissions !== 'undefined') {
1865
+ payload['permissions'] = permissions;
1866
+ }
1867
+
1868
+ let response = undefined;
1869
+
1870
+ response = await client.call('put', apiPath, {
1871
+ 'content-type': 'application/json',
1872
+ }, payload);
1873
+
1874
+ if (parseOutput) {
1875
+ parse(response)
1876
+ }
1877
+
1878
+ return response;
1879
+
1880
+ }
1881
+
1697
1882
  /**
1698
1883
  * @typedef {Object} DatabasesUpdateDocumentRequestParams
1699
1884
  * @property {string} databaseId Database ID.
@@ -1795,7 +1980,6 @@ const databasesListDocumentLogs = async ({databaseId,collectionId,documentId,que
1795
1980
  let response = undefined;
1796
1981
 
1797
1982
  response = await client.call('get', apiPath, {
1798
- 'content-type': 'application/json',
1799
1983
  }, payload);
1800
1984
 
1801
1985
  if (parseOutput) {
@@ -1831,7 +2015,6 @@ const databasesListIndexes = async ({databaseId,collectionId,queries,parseOutput
1831
2015
  let response = undefined;
1832
2016
 
1833
2017
  response = await client.call('get', apiPath, {
1834
- 'content-type': 'application/json',
1835
2018
  }, payload);
1836
2019
 
1837
2020
  if (parseOutput) {
@@ -1854,6 +2037,7 @@ const databasesListIndexes = async ({databaseId,collectionId,queries,parseOutput
1854
2037
  * @property {IndexType} type Index type.
1855
2038
  * @property {string[]} attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
1856
2039
  * @property {string[]} orders Array of index orders. Maximum of 100 orders are allowed.
2040
+ * @property {number[]} lengths Length of index. Maximum of 100
1857
2041
  * @property {boolean} overrideForCli
1858
2042
  * @property {boolean} parseOutput
1859
2043
  * @property {libClient | undefined} sdk
@@ -1862,7 +2046,7 @@ const databasesListIndexes = async ({databaseId,collectionId,queries,parseOutput
1862
2046
  /**
1863
2047
  * @param {DatabasesCreateIndexRequestParams} params
1864
2048
  */
1865
- const databasesCreateIndex = async ({databaseId,collectionId,key,type,attributes,orders,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2049
+ const databasesCreateIndex = async ({databaseId,collectionId,key,type,attributes,orders,lengths,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1866
2050
  let client = !sdk ? await sdkForProject() :
1867
2051
  sdk;
1868
2052
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -1881,6 +2065,10 @@ const databasesCreateIndex = async ({databaseId,collectionId,key,type,attributes
1881
2065
  if (typeof orders !== 'undefined') {
1882
2066
  payload['orders'] = orders;
1883
2067
  }
2068
+ lengths = lengths === true ? [] : lengths;
2069
+ if (typeof lengths !== 'undefined') {
2070
+ payload['lengths'] = lengths;
2071
+ }
1884
2072
 
1885
2073
  let response = undefined;
1886
2074
 
@@ -1918,7 +2106,6 @@ const databasesGetIndex = async ({databaseId,collectionId,key,parseOutput = true
1918
2106
  let response = undefined;
1919
2107
 
1920
2108
  response = await client.call('get', apiPath, {
1921
- 'content-type': 'application/json',
1922
2109
  }, payload);
1923
2110
 
1924
2111
  if (parseOutput) {
@@ -1987,7 +2174,6 @@ const databasesListCollectionLogs = async ({databaseId,collectionId,queries,pars
1987
2174
  let response = undefined;
1988
2175
 
1989
2176
  response = await client.call('get', apiPath, {
1990
- 'content-type': 'application/json',
1991
2177
  }, payload);
1992
2178
 
1993
2179
  if (parseOutput) {
@@ -2023,7 +2209,6 @@ const databasesGetCollectionUsage = async ({databaseId,collectionId,range,parseO
2023
2209
  let response = undefined;
2024
2210
 
2025
2211
  response = await client.call('get', apiPath, {
2026
- 'content-type': 'application/json',
2027
2212
  }, payload);
2028
2213
 
2029
2214
  if (parseOutput) {
@@ -2058,7 +2243,6 @@ const databasesListLogs = async ({databaseId,queries,parseOutput = true, overrid
2058
2243
  let response = undefined;
2059
2244
 
2060
2245
  response = await client.call('get', apiPath, {
2061
- 'content-type': 'application/json',
2062
2246
  }, payload);
2063
2247
 
2064
2248
  if (parseOutput) {
@@ -2093,7 +2277,6 @@ const databasesGetDatabaseUsage = async ({databaseId,range,parseOutput = true, o
2093
2277
  let response = undefined;
2094
2278
 
2095
2279
  response = await client.call('get', apiPath, {
2096
- 'content-type': 'application/json',
2097
2280
  }, payload);
2098
2281
 
2099
2282
  if (parseOutput) {
@@ -2121,7 +2304,7 @@ databases
2121
2304
  .description(`Create a new Database. `)
2122
2305
  .requiredOption(`--database-id <database-id>`, `Unique Id. Choose a custom ID or generate a random ID with 'ID.unique()'. 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.`)
2123
2306
  .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
2124
- .option(`--enabled <enabled>`, `Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, parseBool)
2307
+ .option(`--enabled [value]`, `Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
2125
2308
  .action(actionRunner(databasesCreate))
2126
2309
 
2127
2310
  databases
@@ -2142,7 +2325,7 @@ databases
2142
2325
  .description(`Update a database by its unique ID.`)
2143
2326
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2144
2327
  .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
2145
- .option(`--enabled <enabled>`, `Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, parseBool)
2328
+ .option(`--enabled [value]`, `Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
2146
2329
  .action(actionRunner(databasesUpdate))
2147
2330
 
2148
2331
  databases
@@ -2167,8 +2350,8 @@ databases
2167
2350
  .requiredOption(`--collection-id <collection-id>`, `Unique Id. Choose a custom ID or generate a random ID with 'ID.unique()'. 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.`)
2168
2351
  .requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
2169
2352
  .option(`--permissions [permissions...]`, `An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2170
- .option(`--document-security <document-security>`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`, parseBool)
2171
- .option(`--enabled <enabled>`, `Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.`, parseBool)
2353
+ .option(`--document-security [value]`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : parseBool(value))
2354
+ .option(`--enabled [value]`, `Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
2172
2355
  .action(actionRunner(databasesCreateCollection))
2173
2356
 
2174
2357
  databases
@@ -2186,8 +2369,8 @@ databases
2186
2369
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
2187
2370
  .requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
2188
2371
  .option(`--permissions [permissions...]`, `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2189
- .option(`--document-security <document-security>`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`, parseBool)
2190
- .option(`--enabled <enabled>`, `Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.`, parseBool)
2372
+ .option(`--document-security [value]`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : parseBool(value))
2373
+ .option(`--enabled [value]`, `Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
2191
2374
  .action(actionRunner(databasesUpdateCollection))
2192
2375
 
2193
2376
  databases
@@ -2212,9 +2395,9 @@ databases
2212
2395
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2213
2396
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2214
2397
  .requiredOption(`--key <key>`, `Attribute Key.`)
2215
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2216
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseBool)
2217
- .option(`--array <array>`, `Is attribute an array?`, parseBool)
2398
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2399
+ .option(`--xdefault [value]`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, (value) => value === undefined ? true : parseBool(value))
2400
+ .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2218
2401
  .action(actionRunner(databasesCreateBooleanAttribute))
2219
2402
 
2220
2403
  databases
@@ -2223,8 +2406,8 @@ databases
2223
2406
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2224
2407
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2225
2408
  .requiredOption(`--key <key>`, `Attribute Key.`)
2226
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2227
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseBool)
2409
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2410
+ .option(`--xdefault [value]`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, (value) => value === undefined ? true : parseBool(value))
2228
2411
  .option(`--new-key <new-key>`, `New attribute key.`)
2229
2412
  .action(actionRunner(databasesUpdateBooleanAttribute))
2230
2413
 
@@ -2234,9 +2417,9 @@ databases
2234
2417
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2235
2418
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2236
2419
  .requiredOption(`--key <key>`, `Attribute Key.`)
2237
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2420
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2238
2421
  .option(`--xdefault <xdefault>`, `Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.`)
2239
- .option(`--array <array>`, `Is attribute an array?`, parseBool)
2422
+ .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2240
2423
  .action(actionRunner(databasesCreateDatetimeAttribute))
2241
2424
 
2242
2425
  databases
@@ -2245,7 +2428,7 @@ databases
2245
2428
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2246
2429
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2247
2430
  .requiredOption(`--key <key>`, `Attribute Key.`)
2248
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2431
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2249
2432
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2250
2433
  .option(`--new-key <new-key>`, `New attribute key.`)
2251
2434
  .action(actionRunner(databasesUpdateDatetimeAttribute))
@@ -2256,9 +2439,9 @@ databases
2256
2439
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2257
2440
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2258
2441
  .requiredOption(`--key <key>`, `Attribute Key.`)
2259
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2442
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2260
2443
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2261
- .option(`--array <array>`, `Is attribute an array?`, parseBool)
2444
+ .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2262
2445
  .action(actionRunner(databasesCreateEmailAttribute))
2263
2446
 
2264
2447
  databases
@@ -2267,7 +2450,7 @@ databases
2267
2450
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2268
2451
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2269
2452
  .requiredOption(`--key <key>`, `Attribute Key.`)
2270
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2453
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2271
2454
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2272
2455
  .option(`--new-key <new-key>`, `New attribute key.`)
2273
2456
  .action(actionRunner(databasesUpdateEmailAttribute))
@@ -2279,9 +2462,9 @@ databases
2279
2462
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2280
2463
  .requiredOption(`--key <key>`, `Attribute Key.`)
2281
2464
  .requiredOption(`--elements [elements...]`, `Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.`)
2282
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2465
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2283
2466
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2284
- .option(`--array <array>`, `Is attribute an array?`, parseBool)
2467
+ .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2285
2468
  .action(actionRunner(databasesCreateEnumAttribute))
2286
2469
 
2287
2470
  databases
@@ -2291,7 +2474,7 @@ databases
2291
2474
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2292
2475
  .requiredOption(`--key <key>`, `Attribute Key.`)
2293
2476
  .requiredOption(`--elements [elements...]`, `Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.`)
2294
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2477
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2295
2478
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2296
2479
  .option(`--new-key <new-key>`, `New attribute key.`)
2297
2480
  .action(actionRunner(databasesUpdateEnumAttribute))
@@ -2302,11 +2485,11 @@ databases
2302
2485
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2303
2486
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2304
2487
  .requiredOption(`--key <key>`, `Attribute Key.`)
2305
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2488
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2306
2489
  .option(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
2307
2490
  .option(`--max <max>`, `Maximum value to enforce on new documents`, parseInteger)
2308
2491
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger)
2309
- .option(`--array <array>`, `Is attribute an array?`, parseBool)
2492
+ .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2310
2493
  .action(actionRunner(databasesCreateFloatAttribute))
2311
2494
 
2312
2495
  databases
@@ -2315,7 +2498,7 @@ databases
2315
2498
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2316
2499
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2317
2500
  .requiredOption(`--key <key>`, `Attribute Key.`)
2318
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2501
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2319
2502
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger)
2320
2503
  .option(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
2321
2504
  .option(`--max <max>`, `Maximum value to enforce on new documents`, parseInteger)
@@ -2328,11 +2511,11 @@ databases
2328
2511
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2329
2512
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2330
2513
  .requiredOption(`--key <key>`, `Attribute Key.`)
2331
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2514
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2332
2515
  .option(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
2333
2516
  .option(`--max <max>`, `Maximum value to enforce on new documents`, parseInteger)
2334
2517
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger)
2335
- .option(`--array <array>`, `Is attribute an array?`, parseBool)
2518
+ .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2336
2519
  .action(actionRunner(databasesCreateIntegerAttribute))
2337
2520
 
2338
2521
  databases
@@ -2341,7 +2524,7 @@ databases
2341
2524
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2342
2525
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2343
2526
  .requiredOption(`--key <key>`, `Attribute Key.`)
2344
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2527
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2345
2528
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger)
2346
2529
  .option(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
2347
2530
  .option(`--max <max>`, `Maximum value to enforce on new documents`, parseInteger)
@@ -2354,9 +2537,9 @@ databases
2354
2537
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2355
2538
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2356
2539
  .requiredOption(`--key <key>`, `Attribute Key.`)
2357
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2540
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2358
2541
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2359
- .option(`--array <array>`, `Is attribute an array?`, parseBool)
2542
+ .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2360
2543
  .action(actionRunner(databasesCreateIpAttribute))
2361
2544
 
2362
2545
  databases
@@ -2365,7 +2548,7 @@ databases
2365
2548
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2366
2549
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2367
2550
  .requiredOption(`--key <key>`, `Attribute Key.`)
2368
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2551
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2369
2552
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2370
2553
  .option(`--new-key <new-key>`, `New attribute key.`)
2371
2554
  .action(actionRunner(databasesUpdateIpAttribute))
@@ -2377,7 +2560,7 @@ databases
2377
2560
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2378
2561
  .requiredOption(`--related-collection-id <related-collection-id>`, `Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2379
2562
  .requiredOption(`--type <type>`, `Relation type`)
2380
- .option(`--two-way <two-way>`, `Is Two Way?`, parseBool)
2563
+ .option(`--two-way [value]`, `Is Two Way?`, (value) => value === undefined ? true : parseBool(value))
2381
2564
  .option(`--key <key>`, `Attribute Key.`)
2382
2565
  .option(`--two-way-key <two-way-key>`, `Two Way Attribute Key.`)
2383
2566
  .option(`--on-delete <on-delete>`, `Constraints option`)
@@ -2390,10 +2573,10 @@ databases
2390
2573
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2391
2574
  .requiredOption(`--key <key>`, `Attribute Key.`)
2392
2575
  .requiredOption(`--size <size>`, `Attribute size for text attributes, in number of characters.`, parseInteger)
2393
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2576
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2394
2577
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2395
- .option(`--array <array>`, `Is attribute an array?`, parseBool)
2396
- .option(`--encrypt <encrypt>`, `Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.`, parseBool)
2578
+ .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2579
+ .option(`--encrypt [value]`, `Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.`, (value) => value === undefined ? true : parseBool(value))
2397
2580
  .action(actionRunner(databasesCreateStringAttribute))
2398
2581
 
2399
2582
  databases
@@ -2402,7 +2585,7 @@ databases
2402
2585
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2403
2586
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2404
2587
  .requiredOption(`--key <key>`, `Attribute Key.`)
2405
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2588
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2406
2589
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2407
2590
  .option(`--size <size>`, `Maximum size of the string attribute.`, parseInteger)
2408
2591
  .option(`--new-key <new-key>`, `New attribute key.`)
@@ -2414,9 +2597,9 @@ databases
2414
2597
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2415
2598
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2416
2599
  .requiredOption(`--key <key>`, `Attribute Key.`)
2417
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2600
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2418
2601
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2419
- .option(`--array <array>`, `Is attribute an array?`, parseBool)
2602
+ .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2420
2603
  .action(actionRunner(databasesCreateUrlAttribute))
2421
2604
 
2422
2605
  databases
@@ -2425,7 +2608,7 @@ databases
2425
2608
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2426
2609
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2427
2610
  .requiredOption(`--key <key>`, `Attribute Key.`)
2428
- .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2611
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2429
2612
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2430
2613
  .option(`--new-key <new-key>`, `New attribute key.`)
2431
2614
  .action(actionRunner(databasesUpdateUrlAttribute))
@@ -2467,7 +2650,7 @@ databases
2467
2650
 
2468
2651
  databases
2469
2652
  .command(`create-document`)
2470
- .description(`Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. `)
2653
+ .description(`Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
2471
2654
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2472
2655
  .requiredOption(`--collection-id <collection-id>`, `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.`)
2473
2656
  .requiredOption(`--document-id <document-id>`, `Document ID. Choose a custom ID or generate a random ID with 'ID.unique()'. 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.`)
@@ -2475,6 +2658,39 @@ databases
2475
2658
  .option(`--permissions [permissions...]`, `An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2476
2659
  .action(actionRunner(databasesCreateDocument))
2477
2660
 
2661
+ databases
2662
+ .command(`create-documents`)
2663
+ .description(`**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
2664
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2665
+ .requiredOption(`--collection-id <collection-id>`, `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.`)
2666
+ .requiredOption(`--documents [documents...]`, `Array of documents data as JSON objects.`)
2667
+ .action(actionRunner(databasesCreateDocuments))
2668
+
2669
+ databases
2670
+ .command(`upsert-documents`)
2671
+ .description(`**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. `)
2672
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2673
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
2674
+ .requiredOption(`--documents [documents...]`, `Array of document data as JSON objects. May contain partial documents.`)
2675
+ .action(actionRunner(databasesUpsertDocuments))
2676
+
2677
+ databases
2678
+ .command(`update-documents`)
2679
+ .description(`Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.`)
2680
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2681
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
2682
+ .option(`--data <data>`, `Document data as JSON object. Include only attribute and value pairs to be updated.`)
2683
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`)
2684
+ .action(actionRunner(databasesUpdateDocuments))
2685
+
2686
+ databases
2687
+ .command(`delete-documents`)
2688
+ .description(`**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Bulk delete documents using queries, if no queries are passed then all documents are deleted.`)
2689
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2690
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2691
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`)
2692
+ .action(actionRunner(databasesDeleteDocuments))
2693
+
2478
2694
  databases
2479
2695
  .command(`get-document`)
2480
2696
  .description(`Get a document by its unique ID. This endpoint response returns a JSON object with the document data.`)
@@ -2485,6 +2701,16 @@ databases
2485
2701
  .option(`--console`, `Get the resource console url`)
2486
2702
  .action(actionRunner(databasesGetDocument))
2487
2703
 
2704
+ databases
2705
+ .command(`upsert-document`)
2706
+ .description(`**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
2707
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2708
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
2709
+ .requiredOption(`--document-id <document-id>`, `Document ID.`)
2710
+ .requiredOption(`--data <data>`, `Document data as JSON object. Include all required attributes of the document to be created or updated.`)
2711
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2712
+ .action(actionRunner(databasesUpsertDocument))
2713
+
2488
2714
  databases
2489
2715
  .command(`update-document`)
2490
2716
  .description(`Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.`)
@@ -2530,6 +2756,7 @@ databases
2530
2756
  .requiredOption(`--type <type>`, `Index type.`)
2531
2757
  .requiredOption(`--attributes [attributes...]`, `Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.`)
2532
2758
  .option(`--orders [orders...]`, `Array of index orders. Maximum of 100 orders are allowed.`)
2759
+ .option(`--lengths [lengths...]`, `Length of index. Maximum of 100`)
2533
2760
  .action(actionRunner(databasesCreateIndex))
2534
2761
 
2535
2762
  databases
@@ -2617,7 +2844,12 @@ module.exports = {
2617
2844
  databasesUpdateRelationshipAttribute,
2618
2845
  databasesListDocuments,
2619
2846
  databasesCreateDocument,
2847
+ databasesCreateDocuments,
2848
+ databasesUpsertDocuments,
2849
+ databasesUpdateDocuments,
2850
+ databasesDeleteDocuments,
2620
2851
  databasesGetDocument,
2852
+ databasesUpsertDocument,
2621
2853
  databasesUpdateDocument,
2622
2854
  databasesDeleteDocument,
2623
2855
  databasesListDocumentLogs,