appwrite-cli 4.2.1 → 5.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 (320) hide show
  1. package/.github/workflows/npm-publish.yml +1 -1
  2. package/README.md +6 -9
  3. package/docs/examples/account/{create-email-session.md → create-email-password-session.md} +1 -1
  4. package/docs/examples/account/create-email-token.md +4 -0
  5. package/docs/examples/account/create-magic-u-r-l-token.md +5 -0
  6. package/docs/examples/account/create-mfa-authenticator.md +2 -0
  7. package/docs/examples/account/create-mfa-challenge.md +2 -0
  8. package/docs/examples/account/create-mfa-recovery-codes.md +1 -0
  9. package/docs/examples/account/create-o-auth2token.md +5 -0
  10. package/docs/examples/account/create-phone-token.md +3 -0
  11. package/docs/examples/account/create-push-target.md +4 -0
  12. package/docs/examples/account/create-session.md +3 -0
  13. package/docs/examples/account/create.md +1 -1
  14. package/docs/examples/account/delete-identity.md +1 -1
  15. package/docs/examples/account/delete-mfa-authenticator.md +3 -0
  16. package/docs/examples/account/delete-push-target.md +2 -0
  17. package/docs/examples/account/delete-session.md +1 -1
  18. package/docs/examples/account/delete.md +1 -0
  19. package/docs/examples/account/get-mfa-recovery-codes.md +1 -0
  20. package/docs/examples/account/get-session.md +1 -1
  21. package/docs/examples/account/list-mfa-factors.md +1 -0
  22. package/docs/examples/account/update-m-f-a.md +2 -0
  23. package/docs/examples/account/update-magic-u-r-l-session.md +2 -2
  24. package/docs/examples/account/update-mfa-authenticator.md +3 -0
  25. package/docs/examples/account/update-mfa-challenge.md +3 -0
  26. package/docs/examples/account/update-mfa-recovery-codes.md +1 -0
  27. package/docs/examples/account/update-name.md +1 -1
  28. package/docs/examples/account/update-phone-session.md +2 -2
  29. package/docs/examples/account/update-phone-verification.md +2 -2
  30. package/docs/examples/account/update-push-target.md +3 -0
  31. package/docs/examples/account/update-recovery.md +3 -4
  32. package/docs/examples/account/update-session.md +1 -1
  33. package/docs/examples/account/update-verification.md +2 -2
  34. package/docs/examples/assistant/chat.md +1 -1
  35. package/docs/examples/avatars/get-q-r.md +1 -1
  36. package/docs/examples/databases/create-boolean-attribute.md +2 -2
  37. package/docs/examples/databases/create-collection.md +3 -3
  38. package/docs/examples/databases/create-datetime-attribute.md +2 -2
  39. package/docs/examples/databases/create-document.md +3 -3
  40. package/docs/examples/databases/create-email-attribute.md +2 -2
  41. package/docs/examples/databases/create-enum-attribute.md +2 -2
  42. package/docs/examples/databases/create-float-attribute.md +2 -2
  43. package/docs/examples/databases/create-index.md +2 -2
  44. package/docs/examples/databases/create-integer-attribute.md +2 -2
  45. package/docs/examples/databases/create-ip-attribute.md +2 -2
  46. package/docs/examples/databases/create-relationship-attribute.md +3 -3
  47. package/docs/examples/databases/create-string-attribute.md +2 -2
  48. package/docs/examples/databases/create-url-attribute.md +2 -2
  49. package/docs/examples/databases/create.md +2 -2
  50. package/docs/examples/databases/delete-attribute.md +2 -2
  51. package/docs/examples/databases/delete-collection.md +2 -2
  52. package/docs/examples/databases/delete-document.md +3 -3
  53. package/docs/examples/databases/delete-index.md +2 -2
  54. package/docs/examples/databases/delete.md +1 -1
  55. package/docs/examples/databases/get-attribute.md +2 -2
  56. package/docs/examples/databases/get-collection-usage.md +2 -2
  57. package/docs/examples/databases/get-collection.md +2 -2
  58. package/docs/examples/databases/get-database-usage.md +1 -1
  59. package/docs/examples/databases/get-document.md +3 -3
  60. package/docs/examples/databases/get-index.md +2 -2
  61. package/docs/examples/databases/get.md +1 -1
  62. package/docs/examples/databases/list-attributes.md +2 -2
  63. package/docs/examples/databases/list-collection-logs.md +2 -2
  64. package/docs/examples/databases/list-collections.md +1 -1
  65. package/docs/examples/databases/list-document-logs.md +3 -3
  66. package/docs/examples/databases/list-documents.md +2 -2
  67. package/docs/examples/databases/list-indexes.md +2 -2
  68. package/docs/examples/databases/list-logs.md +1 -1
  69. package/docs/examples/databases/update-boolean-attribute.md +2 -2
  70. package/docs/examples/databases/update-collection.md +3 -3
  71. package/docs/examples/databases/update-datetime-attribute.md +2 -2
  72. package/docs/examples/databases/update-document.md +3 -3
  73. package/docs/examples/databases/update-email-attribute.md +2 -2
  74. package/docs/examples/databases/update-enum-attribute.md +3 -3
  75. package/docs/examples/databases/update-float-attribute.md +2 -2
  76. package/docs/examples/databases/update-integer-attribute.md +2 -2
  77. package/docs/examples/databases/update-ip-attribute.md +2 -2
  78. package/docs/examples/databases/update-relationship-attribute.md +2 -2
  79. package/docs/examples/databases/update-string-attribute.md +3 -3
  80. package/docs/examples/databases/update-url-attribute.md +2 -2
  81. package/docs/examples/databases/update.md +2 -2
  82. package/docs/examples/functions/create-build.md +3 -3
  83. package/docs/examples/functions/create-deployment.md +1 -1
  84. package/docs/examples/functions/create-execution.md +1 -1
  85. package/docs/examples/functions/create-variable.md +3 -3
  86. package/docs/examples/functions/create.md +3 -3
  87. package/docs/examples/functions/delete-deployment.md +2 -2
  88. package/docs/examples/functions/delete-variable.md +2 -2
  89. package/docs/examples/functions/delete.md +1 -1
  90. package/docs/examples/functions/download-deployment.md +2 -2
  91. package/docs/examples/functions/get-deployment.md +2 -2
  92. package/docs/examples/functions/get-execution.md +2 -2
  93. package/docs/examples/functions/get-function-usage.md +1 -1
  94. package/docs/examples/functions/get-variable.md +2 -2
  95. package/docs/examples/functions/get.md +1 -1
  96. package/docs/examples/functions/list-deployments.md +1 -1
  97. package/docs/examples/functions/list-executions.md +1 -1
  98. package/docs/examples/functions/list-variables.md +1 -1
  99. package/docs/examples/functions/update-deployment.md +2 -2
  100. package/docs/examples/functions/update-variable.md +3 -3
  101. package/docs/examples/functions/update.md +2 -2
  102. package/docs/examples/health/get-certificate.md +2 -0
  103. package/docs/examples/health/get-failed-jobs.md +3 -0
  104. package/docs/examples/health/get-queue-usage-dump.md +2 -0
  105. package/docs/examples/health/get-queue-usage.md +2 -0
  106. package/docs/examples/health/get-storage.md +1 -0
  107. package/docs/examples/messaging/create-apns-provider.md +9 -0
  108. package/docs/examples/messaging/create-email.md +13 -0
  109. package/docs/examples/messaging/create-fcm-provider.md +5 -0
  110. package/docs/examples/messaging/create-mailgun-provider.md +11 -0
  111. package/docs/examples/messaging/create-msg91provider.md +7 -0
  112. package/docs/examples/messaging/create-push.md +17 -0
  113. package/docs/examples/messaging/create-sendgrid-provider.md +9 -0
  114. package/docs/examples/messaging/create-sms.md +8 -0
  115. package/docs/examples/messaging/create-smtp-provider.md +15 -0
  116. package/docs/examples/messaging/create-subscriber.md +4 -0
  117. package/docs/examples/messaging/create-telesign-provider.md +7 -0
  118. package/docs/examples/messaging/create-textmagic-provider.md +7 -0
  119. package/docs/examples/messaging/create-topic.md +4 -0
  120. package/docs/examples/messaging/create-twilio-provider.md +7 -0
  121. package/docs/examples/messaging/create-vonage-provider.md +7 -0
  122. package/docs/examples/messaging/delete-provider.md +2 -0
  123. package/docs/examples/messaging/delete-subscriber.md +3 -0
  124. package/docs/examples/messaging/delete-topic.md +2 -0
  125. package/docs/examples/messaging/delete.md +2 -0
  126. package/docs/examples/messaging/get-message.md +2 -0
  127. package/docs/examples/messaging/get-provider.md +2 -0
  128. package/docs/examples/messaging/get-subscriber.md +3 -0
  129. package/docs/examples/messaging/get-topic.md +2 -0
  130. package/docs/examples/messaging/list-message-logs.md +3 -0
  131. package/docs/examples/messaging/list-messages.md +3 -0
  132. package/docs/examples/messaging/list-provider-logs.md +3 -0
  133. package/docs/examples/messaging/list-providers.md +3 -0
  134. package/docs/examples/messaging/list-subscriber-logs.md +3 -0
  135. package/docs/examples/messaging/list-subscribers.md +4 -0
  136. package/docs/examples/messaging/list-targets.md +3 -0
  137. package/docs/examples/messaging/list-topic-logs.md +3 -0
  138. package/docs/examples/messaging/list-topics.md +3 -0
  139. package/docs/examples/messaging/update-apns-provider.md +9 -0
  140. package/docs/examples/messaging/update-email.md +12 -0
  141. package/docs/examples/messaging/update-fcm-provider.md +5 -0
  142. package/docs/examples/messaging/update-mailgun-provider.md +11 -0
  143. package/docs/examples/messaging/update-msg91provider.md +7 -0
  144. package/docs/examples/messaging/update-push.md +17 -0
  145. package/docs/examples/messaging/update-sendgrid-provider.md +9 -0
  146. package/docs/examples/messaging/update-sms.md +8 -0
  147. package/docs/examples/messaging/update-smtp-provider.md +15 -0
  148. package/docs/examples/messaging/update-telesign-provider.md +7 -0
  149. package/docs/examples/messaging/update-textmagic-provider.md +7 -0
  150. package/docs/examples/messaging/update-topic.md +4 -0
  151. package/docs/examples/messaging/update-twilio-provider.md +7 -0
  152. package/docs/examples/messaging/update-vonage-provider.md +7 -0
  153. package/docs/examples/migrations/create-appwrite-migration.md +2 -2
  154. package/docs/examples/migrations/create-firebase-migration.md +1 -1
  155. package/docs/examples/migrations/create-firebase-o-auth-migration.md +1 -1
  156. package/docs/examples/migrations/create-n-host-migration.md +6 -6
  157. package/docs/examples/migrations/create-supabase-migration.md +4 -4
  158. package/docs/examples/migrations/delete.md +1 -1
  159. package/docs/examples/migrations/get-appwrite-report.md +2 -2
  160. package/docs/examples/migrations/get-firebase-report-o-auth.md +1 -1
  161. package/docs/examples/migrations/get-firebase-report.md +1 -1
  162. package/docs/examples/migrations/get-n-host-report.md +6 -6
  163. package/docs/examples/migrations/get-supabase-report.md +4 -4
  164. package/docs/examples/migrations/get.md +1 -1
  165. package/docs/examples/migrations/retry.md +1 -1
  166. package/docs/examples/project/create-variable.md +2 -2
  167. package/docs/examples/project/delete-variable.md +1 -1
  168. package/docs/examples/project/get-usage.md +2 -0
  169. package/docs/examples/project/get-variable.md +1 -1
  170. package/docs/examples/project/update-variable.md +2 -2
  171. package/docs/examples/projects/create-key.md +2 -2
  172. package/docs/examples/projects/create-platform.md +2 -2
  173. package/docs/examples/projects/create-smtp-test.md +11 -0
  174. package/docs/examples/projects/create-webhook.md +4 -3
  175. package/docs/examples/projects/create.md +2 -2
  176. package/docs/examples/projects/delete-email-template.md +1 -1
  177. package/docs/examples/projects/delete-key.md +2 -2
  178. package/docs/examples/projects/delete-platform.md +2 -2
  179. package/docs/examples/projects/delete-sms-template.md +1 -1
  180. package/docs/examples/projects/delete-webhook.md +2 -2
  181. package/docs/examples/projects/delete.md +1 -1
  182. package/docs/examples/projects/get-email-template.md +1 -1
  183. package/docs/examples/projects/get-key.md +2 -2
  184. package/docs/examples/projects/get-platform.md +2 -2
  185. package/docs/examples/projects/get-sms-template.md +1 -1
  186. package/docs/examples/projects/get-webhook.md +2 -2
  187. package/docs/examples/projects/get.md +1 -1
  188. package/docs/examples/projects/list-keys.md +1 -1
  189. package/docs/examples/projects/list-platforms.md +1 -1
  190. package/docs/examples/projects/list-webhooks.md +1 -1
  191. package/docs/examples/projects/update-api-status-all.md +3 -0
  192. package/docs/examples/projects/update-api-status.md +4 -0
  193. package/docs/examples/projects/update-auth-duration.md +1 -1
  194. package/docs/examples/projects/update-auth-limit.md +1 -1
  195. package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
  196. package/docs/examples/projects/update-auth-password-history.md +1 -1
  197. package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
  198. package/docs/examples/projects/update-auth-status.md +1 -1
  199. package/docs/examples/projects/update-email-template.md +3 -3
  200. package/docs/examples/projects/update-key.md +3 -3
  201. package/docs/examples/projects/update-o-auth2.md +1 -1
  202. package/docs/examples/projects/update-personal-data-check.md +1 -1
  203. package/docs/examples/projects/update-platform.md +3 -3
  204. package/docs/examples/projects/update-service-status-all.md +1 -1
  205. package/docs/examples/projects/update-service-status.md +1 -1
  206. package/docs/examples/projects/update-sms-template.md +2 -2
  207. package/docs/examples/projects/update-smtp.md +11 -0
  208. package/docs/examples/projects/update-team.md +2 -2
  209. package/docs/examples/projects/update-webhook-signature.md +2 -2
  210. package/docs/examples/projects/update-webhook.md +5 -4
  211. package/docs/examples/projects/update.md +2 -2
  212. package/docs/examples/proxy/delete-rule.md +1 -1
  213. package/docs/examples/proxy/get-rule.md +1 -1
  214. package/docs/examples/proxy/update-rule-verification.md +1 -1
  215. package/docs/examples/storage/create-bucket.md +2 -2
  216. package/docs/examples/storage/create-file.md +2 -2
  217. package/docs/examples/storage/delete-bucket.md +1 -1
  218. package/docs/examples/storage/delete-file.md +2 -2
  219. package/docs/examples/storage/get-bucket-usage.md +1 -1
  220. package/docs/examples/storage/get-bucket.md +1 -1
  221. package/docs/examples/storage/get-file-download.md +2 -2
  222. package/docs/examples/storage/get-file-preview.md +2 -2
  223. package/docs/examples/storage/get-file-view.md +2 -2
  224. package/docs/examples/storage/get-file.md +2 -2
  225. package/docs/examples/storage/list-files.md +1 -1
  226. package/docs/examples/storage/update-bucket.md +2 -2
  227. package/docs/examples/storage/update-file.md +2 -2
  228. package/docs/examples/teams/create-membership.md +1 -1
  229. package/docs/examples/teams/create.md +2 -2
  230. package/docs/examples/teams/delete-membership.md +2 -2
  231. package/docs/examples/teams/delete.md +1 -1
  232. package/docs/examples/teams/get-membership.md +2 -2
  233. package/docs/examples/teams/get-prefs.md +1 -1
  234. package/docs/examples/teams/get.md +1 -1
  235. package/docs/examples/teams/list-logs.md +1 -1
  236. package/docs/examples/teams/list-memberships.md +1 -1
  237. package/docs/examples/teams/update-membership-status.md +4 -4
  238. package/docs/examples/teams/update-membership.md +2 -2
  239. package/docs/examples/teams/update-name.md +2 -2
  240. package/docs/examples/teams/update-prefs.md +1 -1
  241. package/docs/examples/users/create-argon2user.md +1 -1
  242. package/docs/examples/users/create-bcrypt-user.md +1 -1
  243. package/docs/examples/users/create-m-d5user.md +1 -1
  244. package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
  245. package/docs/examples/users/create-p-h-pass-user.md +1 -1
  246. package/docs/examples/users/create-s-h-a-user.md +1 -1
  247. package/docs/examples/users/create-scrypt-modified-user.md +4 -4
  248. package/docs/examples/users/create-scrypt-user.md +2 -2
  249. package/docs/examples/users/create-session.md +2 -0
  250. package/docs/examples/users/create-target.md +7 -0
  251. package/docs/examples/users/create-token.md +4 -0
  252. package/docs/examples/users/create.md +1 -1
  253. package/docs/examples/users/delete-identity.md +1 -1
  254. package/docs/examples/users/delete-mfa-authenticator.md +3 -0
  255. package/docs/examples/users/delete-session.md +2 -2
  256. package/docs/examples/users/delete-sessions.md +1 -1
  257. package/docs/examples/users/delete-target.md +3 -0
  258. package/docs/examples/users/delete.md +1 -1
  259. package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
  260. package/docs/examples/users/get-prefs.md +1 -1
  261. package/docs/examples/users/get-target.md +3 -0
  262. package/docs/examples/users/get-usage.md +0 -1
  263. package/docs/examples/users/get.md +1 -1
  264. package/docs/examples/users/list-logs.md +1 -1
  265. package/docs/examples/users/list-memberships.md +1 -1
  266. package/docs/examples/users/list-mfa-factors.md +2 -0
  267. package/docs/examples/users/list-sessions.md +1 -1
  268. package/docs/examples/users/list-targets.md +3 -0
  269. package/docs/examples/users/update-email-verification.md +1 -1
  270. package/docs/examples/users/update-email.md +1 -1
  271. package/docs/examples/users/update-labels.md +1 -1
  272. package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
  273. package/docs/examples/users/update-mfa.md +3 -0
  274. package/docs/examples/users/update-name.md +2 -2
  275. package/docs/examples/users/update-password.md +1 -1
  276. package/docs/examples/users/update-phone-verification.md +1 -1
  277. package/docs/examples/users/update-phone.md +1 -1
  278. package/docs/examples/users/update-prefs.md +1 -1
  279. package/docs/examples/users/update-status.md +1 -1
  280. package/docs/examples/users/update-target.md +6 -0
  281. package/docs/examples/vcs/create-repository-detection.md +2 -2
  282. package/docs/examples/vcs/create-repository.md +2 -2
  283. package/docs/examples/vcs/delete-installation.md +1 -1
  284. package/docs/examples/vcs/get-installation.md +1 -1
  285. package/docs/examples/vcs/get-repository.md +2 -2
  286. package/docs/examples/vcs/list-repositories.md +1 -1
  287. package/docs/examples/vcs/list-repository-branches.md +2 -2
  288. package/docs/examples/vcs/update-external-deployments.md +3 -3
  289. package/index.js +2 -0
  290. package/install.ps1 +2 -2
  291. package/install.sh +1 -1
  292. package/lib/client.js +9 -4
  293. package/lib/commands/account.js +966 -381
  294. package/lib/commands/assistant.js +3 -8
  295. package/lib/commands/avatars.js +32 -48
  296. package/lib/commands/console.js +3 -8
  297. package/lib/commands/databases.js +119 -265
  298. package/lib/commands/deploy.js +45 -6
  299. package/lib/commands/functions.js +59 -124
  300. package/lib/commands/generic.js +0 -1
  301. package/lib/commands/graphql.js +5 -13
  302. package/lib/commands/health.js +225 -89
  303. package/lib/commands/locale.js +17 -43
  304. package/lib/commands/messaging.js +2815 -0
  305. package/lib/commands/migrations.js +35 -85
  306. package/lib/commands/project.js +28 -38
  307. package/lib/commands/projects.js +286 -270
  308. package/lib/commands/proxy.js +12 -29
  309. package/lib/commands/storage.js +42 -87
  310. package/lib/commands/teams.js +31 -75
  311. package/lib/commands/users.js +677 -235
  312. package/lib/commands/vcs.js +19 -48
  313. package/lib/paginate.js +2 -2
  314. package/lib/parser.js +1 -0
  315. package/package.json +1 -1
  316. package/scoop/appwrite.json +3 -3
  317. package/docs/examples/account/create-magic-u-r-l-session.md +0 -4
  318. package/docs/examples/account/create-phone-session.md +0 -3
  319. package/docs/examples/projects/get-usage.md +0 -3
  320. package/docs/examples/projects/update-smtp-configuration.md +0 -11
@@ -37,7 +37,7 @@ function convertReadStreamToReadableStream(readStream) {
37
37
 
38
38
  const databases = new Command("databases").description(commandDescriptions['databases']).configureHelp({
39
39
  helpWidth: process.stdout.columns || 80
40
- })
40
+ })
41
41
 
42
42
  /**
43
43
  * @typedef {Object} DatabasesListRequestParams
@@ -52,7 +52,6 @@ const databases = new Command("databases").description(commandDescriptions['data
52
52
  */
53
53
  const databasesList = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
54
54
  let client = !sdk ? await sdkForProject() : sdk;
55
-
56
55
  let apiPath = '/databases';
57
56
  let payload = {};
58
57
  if (typeof queries !== 'undefined') {
@@ -62,14 +61,12 @@ const databasesList = async ({ queries, search, parseOutput = true, sdk = undefi
62
61
  payload['search'] = search;
63
62
  }
64
63
 
65
-
66
64
  let response = undefined;
67
-
65
+
68
66
  response = await client.call('get', apiPath, {
69
67
  'content-type': 'application/json',
70
68
  }, payload);
71
69
 
72
-
73
70
  if (parseOutput) {
74
71
  parse(response)
75
72
  success()
@@ -92,7 +89,6 @@ const databasesList = async ({ queries, search, parseOutput = true, sdk = undefi
92
89
  */
93
90
  const databasesCreate = async ({ databaseId, name, enabled, parseOutput = true, sdk = undefined}) => {
94
91
  let client = !sdk ? await sdkForProject() : sdk;
95
-
96
92
  let apiPath = '/databases';
97
93
  let payload = {};
98
94
  if (typeof databaseId !== 'undefined') {
@@ -105,14 +101,12 @@ const databasesCreate = async ({ databaseId, name, enabled, parseOutput = true,
105
101
  payload['enabled'] = enabled;
106
102
  }
107
103
 
108
-
109
104
  let response = undefined;
110
-
105
+
111
106
  response = await client.call('post', apiPath, {
112
107
  'content-type': 'application/json',
113
108
  }, payload);
114
109
 
115
-
116
110
  if (parseOutput) {
117
111
  parse(response)
118
112
  success()
@@ -123,7 +117,7 @@ const databasesCreate = async ({ databaseId, name, enabled, parseOutput = true,
123
117
 
124
118
  /**
125
119
  * @typedef {Object} DatabasesGetUsageRequestParams
126
- * @property {string} range 'Date range.
120
+ * @property {DatabaseUsageRange} range 'Date range.
127
121
  * @property {boolean} parseOutput
128
122
  * @property {libClient | undefined} sdk
129
123
  */
@@ -133,21 +127,18 @@ const databasesCreate = async ({ databaseId, name, enabled, parseOutput = true,
133
127
  */
134
128
  const databasesGetUsage = async ({ range, parseOutput = true, sdk = undefined}) => {
135
129
  let client = !sdk ? await sdkForProject() : sdk;
136
-
137
130
  let apiPath = '/databases/usage';
138
131
  let payload = {};
139
132
  if (typeof range !== 'undefined') {
140
133
  payload['range'] = range;
141
134
  }
142
135
 
143
-
144
136
  let response = undefined;
145
-
137
+
146
138
  response = await client.call('get', apiPath, {
147
139
  'content-type': 'application/json',
148
140
  }, payload);
149
141
 
150
-
151
142
  if (parseOutput) {
152
143
  parse(response)
153
144
  success()
@@ -168,18 +159,15 @@ const databasesGetUsage = async ({ range, parseOutput = true, sdk = undefined})
168
159
  */
169
160
  const databasesGet = async ({ databaseId, parseOutput = true, sdk = undefined}) => {
170
161
  let client = !sdk ? await sdkForProject() : sdk;
171
-
172
162
  let apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
173
163
  let payload = {};
174
164
 
175
-
176
165
  let response = undefined;
177
-
166
+
178
167
  response = await client.call('get', apiPath, {
179
168
  'content-type': 'application/json',
180
169
  }, payload);
181
170
 
182
-
183
171
  if (parseOutput) {
184
172
  parse(response)
185
173
  success()
@@ -202,7 +190,6 @@ const databasesGet = async ({ databaseId, parseOutput = true, sdk = undefined})
202
190
  */
203
191
  const databasesUpdate = async ({ databaseId, name, enabled, parseOutput = true, sdk = undefined}) => {
204
192
  let client = !sdk ? await sdkForProject() : sdk;
205
-
206
193
  let apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
207
194
  let payload = {};
208
195
  if (typeof name !== 'undefined') {
@@ -212,14 +199,12 @@ const databasesUpdate = async ({ databaseId, name, enabled, parseOutput = true,
212
199
  payload['enabled'] = enabled;
213
200
  }
214
201
 
215
-
216
202
  let response = undefined;
217
-
203
+
218
204
  response = await client.call('put', apiPath, {
219
205
  'content-type': 'application/json',
220
206
  }, payload);
221
207
 
222
-
223
208
  if (parseOutput) {
224
209
  parse(response)
225
210
  success()
@@ -240,18 +225,15 @@ const databasesUpdate = async ({ databaseId, name, enabled, parseOutput = true,
240
225
  */
241
226
  const databasesDelete = async ({ databaseId, parseOutput = true, sdk = undefined}) => {
242
227
  let client = !sdk ? await sdkForProject() : sdk;
243
-
244
228
  let apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
245
229
  let payload = {};
246
230
 
247
-
248
231
  let response = undefined;
249
-
232
+
250
233
  response = await client.call('delete', apiPath, {
251
234
  'content-type': 'application/json',
252
235
  }, payload);
253
236
 
254
-
255
237
  if (parseOutput) {
256
238
  parse(response)
257
239
  success()
@@ -274,7 +256,6 @@ const databasesDelete = async ({ databaseId, parseOutput = true, sdk = undefined
274
256
  */
275
257
  const databasesListCollections = async ({ databaseId, queries, search, parseOutput = true, sdk = undefined}) => {
276
258
  let client = !sdk ? await sdkForProject() : sdk;
277
-
278
259
  let apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
279
260
  let payload = {};
280
261
  if (typeof queries !== 'undefined') {
@@ -284,14 +265,12 @@ const databasesListCollections = async ({ databaseId, queries, search, parseOutp
284
265
  payload['search'] = search;
285
266
  }
286
267
 
287
-
288
268
  let response = undefined;
289
-
269
+
290
270
  response = await client.call('get', apiPath, {
291
271
  'content-type': 'application/json',
292
272
  }, payload);
293
273
 
294
-
295
274
  if (parseOutput) {
296
275
  parse(response)
297
276
  success()
@@ -317,7 +296,6 @@ const databasesListCollections = async ({ databaseId, queries, search, parseOutp
317
296
  */
318
297
  const databasesCreateCollection = async ({ databaseId, collectionId, name, permissions, documentSecurity, enabled, parseOutput = true, sdk = undefined}) => {
319
298
  let client = !sdk ? await sdkForProject() : sdk;
320
-
321
299
  let apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
322
300
  let payload = {};
323
301
  if (typeof collectionId !== 'undefined') {
@@ -337,14 +315,12 @@ const databasesCreateCollection = async ({ databaseId, collectionId, name, permi
337
315
  payload['enabled'] = enabled;
338
316
  }
339
317
 
340
-
341
318
  let response = undefined;
342
-
319
+
343
320
  response = await client.call('post', apiPath, {
344
321
  'content-type': 'application/json',
345
322
  }, payload);
346
323
 
347
-
348
324
  if (parseOutput) {
349
325
  parse(response)
350
326
  success()
@@ -366,18 +342,15 @@ const databasesCreateCollection = async ({ databaseId, collectionId, name, permi
366
342
  */
367
343
  const databasesGetCollection = async ({ databaseId, collectionId, parseOutput = true, sdk = undefined}) => {
368
344
  let client = !sdk ? await sdkForProject() : sdk;
369
-
370
345
  let apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
371
346
  let payload = {};
372
347
 
373
-
374
348
  let response = undefined;
375
-
349
+
376
350
  response = await client.call('get', apiPath, {
377
351
  'content-type': 'application/json',
378
352
  }, payload);
379
353
 
380
-
381
354
  if (parseOutput) {
382
355
  parse(response)
383
356
  success()
@@ -403,7 +376,6 @@ const databasesGetCollection = async ({ databaseId, collectionId, parseOutput =
403
376
  */
404
377
  const databasesUpdateCollection = async ({ databaseId, collectionId, name, permissions, documentSecurity, enabled, parseOutput = true, sdk = undefined}) => {
405
378
  let client = !sdk ? await sdkForProject() : sdk;
406
-
407
379
  let apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
408
380
  let payload = {};
409
381
  if (typeof name !== 'undefined') {
@@ -420,14 +392,12 @@ const databasesUpdateCollection = async ({ databaseId, collectionId, name, permi
420
392
  payload['enabled'] = enabled;
421
393
  }
422
394
 
423
-
424
395
  let response = undefined;
425
-
396
+
426
397
  response = await client.call('put', apiPath, {
427
398
  'content-type': 'application/json',
428
399
  }, payload);
429
400
 
430
-
431
401
  if (parseOutput) {
432
402
  parse(response)
433
403
  success()
@@ -449,18 +419,15 @@ const databasesUpdateCollection = async ({ databaseId, collectionId, name, permi
449
419
  */
450
420
  const databasesDeleteCollection = async ({ databaseId, collectionId, parseOutput = true, sdk = undefined}) => {
451
421
  let client = !sdk ? await sdkForProject() : sdk;
452
-
453
422
  let apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
454
423
  let payload = {};
455
424
 
456
-
457
425
  let response = undefined;
458
-
426
+
459
427
  response = await client.call('delete', apiPath, {
460
428
  'content-type': 'application/json',
461
429
  }, payload);
462
430
 
463
-
464
431
  if (parseOutput) {
465
432
  parse(response)
466
433
  success()
@@ -483,21 +450,18 @@ const databasesDeleteCollection = async ({ databaseId, collectionId, parseOutput
483
450
  */
484
451
  const databasesListAttributes = async ({ databaseId, collectionId, queries, parseOutput = true, sdk = undefined}) => {
485
452
  let client = !sdk ? await sdkForProject() : sdk;
486
-
487
453
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
488
454
  let payload = {};
489
455
  if (typeof queries !== 'undefined') {
490
456
  payload['queries'] = queries;
491
457
  }
492
458
 
493
-
494
459
  let response = undefined;
495
-
460
+
496
461
  response = await client.call('get', apiPath, {
497
462
  'content-type': 'application/json',
498
463
  }, payload);
499
464
 
500
-
501
465
  if (parseOutput) {
502
466
  parse(response)
503
467
  success()
@@ -523,7 +487,6 @@ const databasesListAttributes = async ({ databaseId, collectionId, queries, pars
523
487
  */
524
488
  const databasesCreateBooleanAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
525
489
  let client = !sdk ? await sdkForProject() : sdk;
526
-
527
490
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
528
491
  let payload = {};
529
492
  if (typeof key !== 'undefined') {
@@ -539,14 +502,12 @@ const databasesCreateBooleanAttribute = async ({ databaseId, collectionId, key,
539
502
  payload['array'] = array;
540
503
  }
541
504
 
542
-
543
505
  let response = undefined;
544
-
506
+
545
507
  response = await client.call('post', apiPath, {
546
508
  'content-type': 'application/json',
547
509
  }, payload);
548
510
 
549
-
550
511
  if (parseOutput) {
551
512
  parse(response)
552
513
  success()
@@ -571,7 +532,6 @@ const databasesCreateBooleanAttribute = async ({ databaseId, collectionId, key,
571
532
  */
572
533
  const databasesUpdateBooleanAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
573
534
  let client = !sdk ? await sdkForProject() : sdk;
574
-
575
535
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
576
536
  let payload = {};
577
537
  if (typeof required !== 'undefined') {
@@ -581,14 +541,12 @@ const databasesUpdateBooleanAttribute = async ({ databaseId, collectionId, key,
581
541
  payload['default'] = xdefault;
582
542
  }
583
543
 
584
-
585
544
  let response = undefined;
586
-
545
+
587
546
  response = await client.call('patch', apiPath, {
588
547
  'content-type': 'application/json',
589
548
  }, payload);
590
549
 
591
-
592
550
  if (parseOutput) {
593
551
  parse(response)
594
552
  success()
@@ -603,7 +561,7 @@ const databasesUpdateBooleanAttribute = async ({ databaseId, collectionId, key,
603
561
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
604
562
  * @property {string} key Attribute Key.
605
563
  * @property {boolean} required Is attribute required?
606
- * @property {string} xdefault Default value for the attribute in ISO 8601 format. Cannot be set when attribute is required.
564
+ * @property {string} 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.
607
565
  * @property {boolean} array Is attribute an array?
608
566
  * @property {boolean} parseOutput
609
567
  * @property {libClient | undefined} sdk
@@ -614,7 +572,6 @@ const databasesUpdateBooleanAttribute = async ({ databaseId, collectionId, key,
614
572
  */
615
573
  const databasesCreateDatetimeAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
616
574
  let client = !sdk ? await sdkForProject() : sdk;
617
-
618
575
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
619
576
  let payload = {};
620
577
  if (typeof key !== 'undefined') {
@@ -630,14 +587,12 @@ const databasesCreateDatetimeAttribute = async ({ databaseId, collectionId, key,
630
587
  payload['array'] = array;
631
588
  }
632
589
 
633
-
634
590
  let response = undefined;
635
-
591
+
636
592
  response = await client.call('post', apiPath, {
637
593
  'content-type': 'application/json',
638
594
  }, payload);
639
595
 
640
-
641
596
  if (parseOutput) {
642
597
  parse(response)
643
598
  success()
@@ -662,7 +617,6 @@ const databasesCreateDatetimeAttribute = async ({ databaseId, collectionId, key,
662
617
  */
663
618
  const databasesUpdateDatetimeAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
664
619
  let client = !sdk ? await sdkForProject() : sdk;
665
-
666
620
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
667
621
  let payload = {};
668
622
  if (typeof required !== 'undefined') {
@@ -672,14 +626,12 @@ const databasesUpdateDatetimeAttribute = async ({ databaseId, collectionId, key,
672
626
  payload['default'] = xdefault;
673
627
  }
674
628
 
675
-
676
629
  let response = undefined;
677
-
630
+
678
631
  response = await client.call('patch', apiPath, {
679
632
  'content-type': 'application/json',
680
633
  }, payload);
681
634
 
682
-
683
635
  if (parseOutput) {
684
636
  parse(response)
685
637
  success()
@@ -705,7 +657,6 @@ const databasesUpdateDatetimeAttribute = async ({ databaseId, collectionId, key,
705
657
  */
706
658
  const databasesCreateEmailAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
707
659
  let client = !sdk ? await sdkForProject() : sdk;
708
-
709
660
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
710
661
  let payload = {};
711
662
  if (typeof key !== 'undefined') {
@@ -721,14 +672,12 @@ const databasesCreateEmailAttribute = async ({ databaseId, collectionId, key, re
721
672
  payload['array'] = array;
722
673
  }
723
674
 
724
-
725
675
  let response = undefined;
726
-
676
+
727
677
  response = await client.call('post', apiPath, {
728
678
  'content-type': 'application/json',
729
679
  }, payload);
730
680
 
731
-
732
681
  if (parseOutput) {
733
682
  parse(response)
734
683
  success()
@@ -753,7 +702,6 @@ const databasesCreateEmailAttribute = async ({ databaseId, collectionId, key, re
753
702
  */
754
703
  const databasesUpdateEmailAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
755
704
  let client = !sdk ? await sdkForProject() : sdk;
756
-
757
705
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
758
706
  let payload = {};
759
707
  if (typeof required !== 'undefined') {
@@ -763,14 +711,12 @@ const databasesUpdateEmailAttribute = async ({ databaseId, collectionId, key, re
763
711
  payload['default'] = xdefault;
764
712
  }
765
713
 
766
-
767
714
  let response = undefined;
768
-
715
+
769
716
  response = await client.call('patch', apiPath, {
770
717
  'content-type': 'application/json',
771
718
  }, payload);
772
719
 
773
-
774
720
  if (parseOutput) {
775
721
  parse(response)
776
722
  success()
@@ -797,7 +743,6 @@ const databasesUpdateEmailAttribute = async ({ databaseId, collectionId, key, re
797
743
  */
798
744
  const databasesCreateEnumAttribute = async ({ databaseId, collectionId, key, elements, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
799
745
  let client = !sdk ? await sdkForProject() : sdk;
800
-
801
746
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
802
747
  let payload = {};
803
748
  if (typeof key !== 'undefined') {
@@ -817,14 +762,12 @@ const databasesCreateEnumAttribute = async ({ databaseId, collectionId, key, ele
817
762
  payload['array'] = array;
818
763
  }
819
764
 
820
-
821
765
  let response = undefined;
822
-
766
+
823
767
  response = await client.call('post', apiPath, {
824
768
  'content-type': 'application/json',
825
769
  }, payload);
826
770
 
827
-
828
771
  if (parseOutput) {
829
772
  parse(response)
830
773
  success()
@@ -850,7 +793,6 @@ const databasesCreateEnumAttribute = async ({ databaseId, collectionId, key, ele
850
793
  */
851
794
  const databasesUpdateEnumAttribute = async ({ databaseId, collectionId, key, elements, required, xdefault, parseOutput = true, sdk = undefined}) => {
852
795
  let client = !sdk ? await sdkForProject() : sdk;
853
-
854
796
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
855
797
  let payload = {};
856
798
  elements = elements === true ? [] : elements;
@@ -864,14 +806,12 @@ const databasesUpdateEnumAttribute = async ({ databaseId, collectionId, key, ele
864
806
  payload['default'] = xdefault;
865
807
  }
866
808
 
867
-
868
809
  let response = undefined;
869
-
810
+
870
811
  response = await client.call('patch', apiPath, {
871
812
  'content-type': 'application/json',
872
813
  }, payload);
873
814
 
874
-
875
815
  if (parseOutput) {
876
816
  parse(response)
877
817
  success()
@@ -899,7 +839,6 @@ const databasesUpdateEnumAttribute = async ({ databaseId, collectionId, key, ele
899
839
  */
900
840
  const databasesCreateFloatAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, array, parseOutput = true, sdk = undefined}) => {
901
841
  let client = !sdk ? await sdkForProject() : sdk;
902
-
903
842
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
904
843
  let payload = {};
905
844
  if (typeof key !== 'undefined') {
@@ -921,14 +860,12 @@ const databasesCreateFloatAttribute = async ({ databaseId, collectionId, key, re
921
860
  payload['array'] = array;
922
861
  }
923
862
 
924
-
925
863
  let response = undefined;
926
-
864
+
927
865
  response = await client.call('post', apiPath, {
928
866
  'content-type': 'application/json',
929
867
  }, payload);
930
868
 
931
-
932
869
  if (parseOutput) {
933
870
  parse(response)
934
871
  success()
@@ -955,7 +892,6 @@ const databasesCreateFloatAttribute = async ({ databaseId, collectionId, key, re
955
892
  */
956
893
  const databasesUpdateFloatAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, parseOutput = true, sdk = undefined}) => {
957
894
  let client = !sdk ? await sdkForProject() : sdk;
958
-
959
895
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
960
896
  let payload = {};
961
897
  if (typeof required !== 'undefined') {
@@ -971,14 +907,12 @@ const databasesUpdateFloatAttribute = async ({ databaseId, collectionId, key, re
971
907
  payload['default'] = xdefault;
972
908
  }
973
909
 
974
-
975
910
  let response = undefined;
976
-
911
+
977
912
  response = await client.call('patch', apiPath, {
978
913
  'content-type': 'application/json',
979
914
  }, payload);
980
915
 
981
-
982
916
  if (parseOutput) {
983
917
  parse(response)
984
918
  success()
@@ -1006,7 +940,6 @@ const databasesUpdateFloatAttribute = async ({ databaseId, collectionId, key, re
1006
940
  */
1007
941
  const databasesCreateIntegerAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, array, parseOutput = true, sdk = undefined}) => {
1008
942
  let client = !sdk ? await sdkForProject() : sdk;
1009
-
1010
943
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1011
944
  let payload = {};
1012
945
  if (typeof key !== 'undefined') {
@@ -1028,14 +961,12 @@ const databasesCreateIntegerAttribute = async ({ databaseId, collectionId, key,
1028
961
  payload['array'] = array;
1029
962
  }
1030
963
 
1031
-
1032
964
  let response = undefined;
1033
-
965
+
1034
966
  response = await client.call('post', apiPath, {
1035
967
  'content-type': 'application/json',
1036
968
  }, payload);
1037
969
 
1038
-
1039
970
  if (parseOutput) {
1040
971
  parse(response)
1041
972
  success()
@@ -1062,7 +993,6 @@ const databasesCreateIntegerAttribute = async ({ databaseId, collectionId, key,
1062
993
  */
1063
994
  const databasesUpdateIntegerAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, parseOutput = true, sdk = undefined}) => {
1064
995
  let client = !sdk ? await sdkForProject() : sdk;
1065
-
1066
996
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1067
997
  let payload = {};
1068
998
  if (typeof required !== 'undefined') {
@@ -1078,14 +1008,12 @@ const databasesUpdateIntegerAttribute = async ({ databaseId, collectionId, key,
1078
1008
  payload['default'] = xdefault;
1079
1009
  }
1080
1010
 
1081
-
1082
1011
  let response = undefined;
1083
-
1012
+
1084
1013
  response = await client.call('patch', apiPath, {
1085
1014
  'content-type': 'application/json',
1086
1015
  }, payload);
1087
1016
 
1088
-
1089
1017
  if (parseOutput) {
1090
1018
  parse(response)
1091
1019
  success()
@@ -1111,7 +1039,6 @@ const databasesUpdateIntegerAttribute = async ({ databaseId, collectionId, key,
1111
1039
  */
1112
1040
  const databasesCreateIpAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
1113
1041
  let client = !sdk ? await sdkForProject() : sdk;
1114
-
1115
1042
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1116
1043
  let payload = {};
1117
1044
  if (typeof key !== 'undefined') {
@@ -1127,14 +1054,12 @@ const databasesCreateIpAttribute = async ({ databaseId, collectionId, key, requi
1127
1054
  payload['array'] = array;
1128
1055
  }
1129
1056
 
1130
-
1131
1057
  let response = undefined;
1132
-
1058
+
1133
1059
  response = await client.call('post', apiPath, {
1134
1060
  'content-type': 'application/json',
1135
1061
  }, payload);
1136
1062
 
1137
-
1138
1063
  if (parseOutput) {
1139
1064
  parse(response)
1140
1065
  success()
@@ -1159,7 +1084,6 @@ const databasesCreateIpAttribute = async ({ databaseId, collectionId, key, requi
1159
1084
  */
1160
1085
  const databasesUpdateIpAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
1161
1086
  let client = !sdk ? await sdkForProject() : sdk;
1162
-
1163
1087
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1164
1088
  let payload = {};
1165
1089
  if (typeof required !== 'undefined') {
@@ -1169,14 +1093,12 @@ const databasesUpdateIpAttribute = async ({ databaseId, collectionId, key, requi
1169
1093
  payload['default'] = xdefault;
1170
1094
  }
1171
1095
 
1172
-
1173
1096
  let response = undefined;
1174
-
1097
+
1175
1098
  response = await client.call('patch', apiPath, {
1176
1099
  'content-type': 'application/json',
1177
1100
  }, payload);
1178
1101
 
1179
-
1180
1102
  if (parseOutput) {
1181
1103
  parse(response)
1182
1104
  success()
@@ -1190,11 +1112,11 @@ const databasesUpdateIpAttribute = async ({ databaseId, collectionId, key, requi
1190
1112
  * @property {string} databaseId Database ID.
1191
1113
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1192
1114
  * @property {string} relatedCollectionId Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1193
- * @property {string} type Relation type
1115
+ * @property {RelationshipType} type Relation type
1194
1116
  * @property {boolean} twoWay Is Two Way?
1195
1117
  * @property {string} key Attribute Key.
1196
1118
  * @property {string} twoWayKey Two Way Attribute Key.
1197
- * @property {string} onDelete Constraints option
1119
+ * @property {RelationMutate} onDelete Constraints option
1198
1120
  * @property {boolean} parseOutput
1199
1121
  * @property {libClient | undefined} sdk
1200
1122
  */
@@ -1204,7 +1126,6 @@ const databasesUpdateIpAttribute = async ({ databaseId, collectionId, key, requi
1204
1126
  */
1205
1127
  const databasesCreateRelationshipAttribute = async ({ databaseId, collectionId, relatedCollectionId, type, twoWay, key, twoWayKey, onDelete, parseOutput = true, sdk = undefined}) => {
1206
1128
  let client = !sdk ? await sdkForProject() : sdk;
1207
-
1208
1129
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1209
1130
  let payload = {};
1210
1131
  if (typeof relatedCollectionId !== 'undefined') {
@@ -1226,14 +1147,12 @@ const databasesCreateRelationshipAttribute = async ({ databaseId, collectionId,
1226
1147
  payload['onDelete'] = onDelete;
1227
1148
  }
1228
1149
 
1229
-
1230
1150
  let response = undefined;
1231
-
1151
+
1232
1152
  response = await client.call('post', apiPath, {
1233
1153
  'content-type': 'application/json',
1234
1154
  }, payload);
1235
1155
 
1236
-
1237
1156
  if (parseOutput) {
1238
1157
  parse(response)
1239
1158
  success()
@@ -1261,7 +1180,6 @@ const databasesCreateRelationshipAttribute = async ({ databaseId, collectionId,
1261
1180
  */
1262
1181
  const databasesCreateStringAttribute = async ({ databaseId, collectionId, key, size, required, xdefault, array, encrypt, parseOutput = true, sdk = undefined}) => {
1263
1182
  let client = !sdk ? await sdkForProject() : sdk;
1264
-
1265
1183
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1266
1184
  let payload = {};
1267
1185
  if (typeof key !== 'undefined') {
@@ -1283,14 +1201,12 @@ const databasesCreateStringAttribute = async ({ databaseId, collectionId, key, s
1283
1201
  payload['encrypt'] = encrypt;
1284
1202
  }
1285
1203
 
1286
-
1287
1204
  let response = undefined;
1288
-
1205
+
1289
1206
  response = await client.call('post', apiPath, {
1290
1207
  'content-type': 'application/json',
1291
1208
  }, payload);
1292
1209
 
1293
-
1294
1210
  if (parseOutput) {
1295
1211
  parse(response)
1296
1212
  success()
@@ -1315,7 +1231,6 @@ const databasesCreateStringAttribute = async ({ databaseId, collectionId, key, s
1315
1231
  */
1316
1232
  const databasesUpdateStringAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
1317
1233
  let client = !sdk ? await sdkForProject() : sdk;
1318
-
1319
1234
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1320
1235
  let payload = {};
1321
1236
  if (typeof required !== 'undefined') {
@@ -1325,14 +1240,12 @@ const databasesUpdateStringAttribute = async ({ databaseId, collectionId, key, r
1325
1240
  payload['default'] = xdefault;
1326
1241
  }
1327
1242
 
1328
-
1329
1243
  let response = undefined;
1330
-
1244
+
1331
1245
  response = await client.call('patch', apiPath, {
1332
1246
  'content-type': 'application/json',
1333
1247
  }, payload);
1334
1248
 
1335
-
1336
1249
  if (parseOutput) {
1337
1250
  parse(response)
1338
1251
  success()
@@ -1358,7 +1271,6 @@ const databasesUpdateStringAttribute = async ({ databaseId, collectionId, key, r
1358
1271
  */
1359
1272
  const databasesCreateUrlAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
1360
1273
  let client = !sdk ? await sdkForProject() : sdk;
1361
-
1362
1274
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1363
1275
  let payload = {};
1364
1276
  if (typeof key !== 'undefined') {
@@ -1374,14 +1286,12 @@ const databasesCreateUrlAttribute = async ({ databaseId, collectionId, key, requ
1374
1286
  payload['array'] = array;
1375
1287
  }
1376
1288
 
1377
-
1378
1289
  let response = undefined;
1379
-
1290
+
1380
1291
  response = await client.call('post', apiPath, {
1381
1292
  'content-type': 'application/json',
1382
1293
  }, payload);
1383
1294
 
1384
-
1385
1295
  if (parseOutput) {
1386
1296
  parse(response)
1387
1297
  success()
@@ -1406,7 +1316,6 @@ const databasesCreateUrlAttribute = async ({ databaseId, collectionId, key, requ
1406
1316
  */
1407
1317
  const databasesUpdateUrlAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
1408
1318
  let client = !sdk ? await sdkForProject() : sdk;
1409
-
1410
1319
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1411
1320
  let payload = {};
1412
1321
  if (typeof required !== 'undefined') {
@@ -1416,14 +1325,12 @@ const databasesUpdateUrlAttribute = async ({ databaseId, collectionId, key, requ
1416
1325
  payload['default'] = xdefault;
1417
1326
  }
1418
1327
 
1419
-
1420
1328
  let response = undefined;
1421
-
1329
+
1422
1330
  response = await client.call('patch', apiPath, {
1423
1331
  'content-type': 'application/json',
1424
1332
  }, payload);
1425
1333
 
1426
-
1427
1334
  if (parseOutput) {
1428
1335
  parse(response)
1429
1336
  success()
@@ -1446,18 +1353,15 @@ const databasesUpdateUrlAttribute = async ({ databaseId, collectionId, key, requ
1446
1353
  */
1447
1354
  const databasesGetAttribute = async ({ databaseId, collectionId, key, parseOutput = true, sdk = undefined}) => {
1448
1355
  let client = !sdk ? await sdkForProject() : sdk;
1449
-
1450
1356
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1451
1357
  let payload = {};
1452
1358
 
1453
-
1454
1359
  let response = undefined;
1455
-
1360
+
1456
1361
  response = await client.call('get', apiPath, {
1457
1362
  'content-type': 'application/json',
1458
1363
  }, payload);
1459
1364
 
1460
-
1461
1365
  if (parseOutput) {
1462
1366
  parse(response)
1463
1367
  success()
@@ -1480,18 +1384,15 @@ const databasesGetAttribute = async ({ databaseId, collectionId, key, parseOutpu
1480
1384
  */
1481
1385
  const databasesDeleteAttribute = async ({ databaseId, collectionId, key, parseOutput = true, sdk = undefined}) => {
1482
1386
  let client = !sdk ? await sdkForProject() : sdk;
1483
-
1484
1387
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1485
1388
  let payload = {};
1486
1389
 
1487
-
1488
1390
  let response = undefined;
1489
-
1391
+
1490
1392
  response = await client.call('delete', apiPath, {
1491
1393
  'content-type': 'application/json',
1492
1394
  }, payload);
1493
1395
 
1494
-
1495
1396
  if (parseOutput) {
1496
1397
  parse(response)
1497
1398
  success()
@@ -1505,7 +1406,7 @@ const databasesDeleteAttribute = async ({ databaseId, collectionId, key, parseOu
1505
1406
  * @property {string} databaseId Database ID.
1506
1407
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1507
1408
  * @property {string} key Attribute Key.
1508
- * @property {string} onDelete Constraints option
1409
+ * @property {RelationMutate} onDelete Constraints option
1509
1410
  * @property {boolean} parseOutput
1510
1411
  * @property {libClient | undefined} sdk
1511
1412
  */
@@ -1515,21 +1416,18 @@ const databasesDeleteAttribute = async ({ databaseId, collectionId, key, parseOu
1515
1416
  */
1516
1417
  const databasesUpdateRelationshipAttribute = async ({ databaseId, collectionId, key, onDelete, parseOutput = true, sdk = undefined}) => {
1517
1418
  let client = !sdk ? await sdkForProject() : sdk;
1518
-
1519
1419
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1520
1420
  let payload = {};
1521
1421
  if (typeof onDelete !== 'undefined') {
1522
1422
  payload['onDelete'] = onDelete;
1523
1423
  }
1524
1424
 
1525
-
1526
1425
  let response = undefined;
1527
-
1426
+
1528
1427
  response = await client.call('patch', apiPath, {
1529
1428
  'content-type': 'application/json',
1530
1429
  }, payload);
1531
1430
 
1532
-
1533
1431
  if (parseOutput) {
1534
1432
  parse(response)
1535
1433
  success()
@@ -1552,21 +1450,18 @@ const databasesUpdateRelationshipAttribute = async ({ databaseId, collectionId,
1552
1450
  */
1553
1451
  const databasesListDocuments = async ({ databaseId, collectionId, queries, parseOutput = true, sdk = undefined}) => {
1554
1452
  let client = !sdk ? await sdkForProject() : sdk;
1555
-
1556
1453
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1557
1454
  let payload = {};
1558
1455
  if (typeof queries !== 'undefined') {
1559
1456
  payload['queries'] = queries;
1560
1457
  }
1561
1458
 
1562
-
1563
1459
  let response = undefined;
1564
-
1460
+
1565
1461
  response = await client.call('get', apiPath, {
1566
1462
  'content-type': 'application/json',
1567
1463
  }, payload);
1568
1464
 
1569
-
1570
1465
  if (parseOutput) {
1571
1466
  parse(response)
1572
1467
  success()
@@ -1591,7 +1486,6 @@ const databasesListDocuments = async ({ databaseId, collectionId, queries, parse
1591
1486
  */
1592
1487
  const databasesCreateDocument = async ({ databaseId, collectionId, documentId, data, permissions, parseOutput = true, sdk = undefined}) => {
1593
1488
  let client = !sdk ? await sdkForProject() : sdk;
1594
-
1595
1489
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1596
1490
  let payload = {};
1597
1491
  if (typeof documentId !== 'undefined') {
@@ -1605,14 +1499,12 @@ const databasesCreateDocument = async ({ databaseId, collectionId, documentId, d
1605
1499
  payload['permissions'] = permissions;
1606
1500
  }
1607
1501
 
1608
-
1609
1502
  let response = undefined;
1610
-
1503
+
1611
1504
  response = await client.call('post', apiPath, {
1612
1505
  'content-type': 'application/json',
1613
1506
  }, payload);
1614
1507
 
1615
-
1616
1508
  if (parseOutput) {
1617
1509
  parse(response)
1618
1510
  success()
@@ -1626,7 +1518,7 @@ const databasesCreateDocument = async ({ databaseId, collectionId, documentId, d
1626
1518
  * @property {string} databaseId Database ID.
1627
1519
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1628
1520
  * @property {string} documentId Document ID.
1629
- * @property {string[]} 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 method allowed is select.
1521
+ * @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.
1630
1522
  * @property {boolean} parseOutput
1631
1523
  * @property {libClient | undefined} sdk
1632
1524
  */
@@ -1636,21 +1528,18 @@ const databasesCreateDocument = async ({ databaseId, collectionId, documentId, d
1636
1528
  */
1637
1529
  const databasesGetDocument = async ({ databaseId, collectionId, documentId, queries, parseOutput = true, sdk = undefined}) => {
1638
1530
  let client = !sdk ? await sdkForProject() : sdk;
1639
-
1640
1531
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
1641
1532
  let payload = {};
1642
1533
  if (typeof queries !== 'undefined') {
1643
1534
  payload['queries'] = queries;
1644
1535
  }
1645
1536
 
1646
-
1647
1537
  let response = undefined;
1648
-
1538
+
1649
1539
  response = await client.call('get', apiPath, {
1650
1540
  'content-type': 'application/json',
1651
1541
  }, payload);
1652
1542
 
1653
-
1654
1543
  if (parseOutput) {
1655
1544
  parse(response)
1656
1545
  success()
@@ -1675,7 +1564,6 @@ const databasesGetDocument = async ({ databaseId, collectionId, documentId, quer
1675
1564
  */
1676
1565
  const databasesUpdateDocument = async ({ databaseId, collectionId, documentId, data, permissions, parseOutput = true, sdk = undefined}) => {
1677
1566
  let client = !sdk ? await sdkForProject() : sdk;
1678
-
1679
1567
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
1680
1568
  let payload = {};
1681
1569
  if (typeof data !== 'undefined') {
@@ -1686,14 +1574,12 @@ const databasesUpdateDocument = async ({ databaseId, collectionId, documentId, d
1686
1574
  payload['permissions'] = permissions;
1687
1575
  }
1688
1576
 
1689
-
1690
1577
  let response = undefined;
1691
-
1578
+
1692
1579
  response = await client.call('patch', apiPath, {
1693
1580
  'content-type': 'application/json',
1694
1581
  }, payload);
1695
1582
 
1696
-
1697
1583
  if (parseOutput) {
1698
1584
  parse(response)
1699
1585
  success()
@@ -1716,18 +1602,15 @@ const databasesUpdateDocument = async ({ databaseId, collectionId, documentId, d
1716
1602
  */
1717
1603
  const databasesDeleteDocument = async ({ databaseId, collectionId, documentId, parseOutput = true, sdk = undefined}) => {
1718
1604
  let client = !sdk ? await sdkForProject() : sdk;
1719
-
1720
1605
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
1721
1606
  let payload = {};
1722
1607
 
1723
-
1724
1608
  let response = undefined;
1725
-
1609
+
1726
1610
  response = await client.call('delete', apiPath, {
1727
1611
  'content-type': 'application/json',
1728
1612
  }, payload);
1729
1613
 
1730
-
1731
1614
  if (parseOutput) {
1732
1615
  parse(response)
1733
1616
  success()
@@ -1751,21 +1634,18 @@ const databasesDeleteDocument = async ({ databaseId, collectionId, documentId, p
1751
1634
  */
1752
1635
  const databasesListDocumentLogs = async ({ databaseId, collectionId, documentId, queries, parseOutput = true, sdk = undefined}) => {
1753
1636
  let client = !sdk ? await sdkForProject() : sdk;
1754
-
1755
1637
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
1756
1638
  let payload = {};
1757
1639
  if (typeof queries !== 'undefined') {
1758
1640
  payload['queries'] = queries;
1759
1641
  }
1760
1642
 
1761
-
1762
1643
  let response = undefined;
1763
-
1644
+
1764
1645
  response = await client.call('get', apiPath, {
1765
1646
  'content-type': 'application/json',
1766
1647
  }, payload);
1767
1648
 
1768
-
1769
1649
  if (parseOutput) {
1770
1650
  parse(response)
1771
1651
  success()
@@ -1788,21 +1668,18 @@ const databasesListDocumentLogs = async ({ databaseId, collectionId, documentId,
1788
1668
  */
1789
1669
  const databasesListIndexes = async ({ databaseId, collectionId, queries, parseOutput = true, sdk = undefined}) => {
1790
1670
  let client = !sdk ? await sdkForProject() : sdk;
1791
-
1792
1671
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1793
1672
  let payload = {};
1794
1673
  if (typeof queries !== 'undefined') {
1795
1674
  payload['queries'] = queries;
1796
1675
  }
1797
1676
 
1798
-
1799
1677
  let response = undefined;
1800
-
1678
+
1801
1679
  response = await client.call('get', apiPath, {
1802
1680
  'content-type': 'application/json',
1803
1681
  }, payload);
1804
1682
 
1805
-
1806
1683
  if (parseOutput) {
1807
1684
  parse(response)
1808
1685
  success()
@@ -1816,7 +1693,7 @@ const databasesListIndexes = async ({ databaseId, collectionId, queries, parseOu
1816
1693
  * @property {string} databaseId Database ID.
1817
1694
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1818
1695
  * @property {string} key Index Key.
1819
- * @property {string} type Index type.
1696
+ * @property {IndexType} type Index type.
1820
1697
  * @property {string[]} attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
1821
1698
  * @property {string[]} orders Array of index orders. Maximum of 100 orders are allowed.
1822
1699
  * @property {boolean} parseOutput
@@ -1828,7 +1705,6 @@ const databasesListIndexes = async ({ databaseId, collectionId, queries, parseOu
1828
1705
  */
1829
1706
  const databasesCreateIndex = async ({ databaseId, collectionId, key, type, attributes, orders, parseOutput = true, sdk = undefined}) => {
1830
1707
  let client = !sdk ? await sdkForProject() : sdk;
1831
-
1832
1708
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1833
1709
  let payload = {};
1834
1710
  if (typeof key !== 'undefined') {
@@ -1846,14 +1722,12 @@ const databasesCreateIndex = async ({ databaseId, collectionId, key, type, attri
1846
1722
  payload['orders'] = orders;
1847
1723
  }
1848
1724
 
1849
-
1850
1725
  let response = undefined;
1851
-
1726
+
1852
1727
  response = await client.call('post', apiPath, {
1853
1728
  'content-type': 'application/json',
1854
1729
  }, payload);
1855
1730
 
1856
-
1857
1731
  if (parseOutput) {
1858
1732
  parse(response)
1859
1733
  success()
@@ -1876,18 +1750,15 @@ const databasesCreateIndex = async ({ databaseId, collectionId, key, type, attri
1876
1750
  */
1877
1751
  const databasesGetIndex = async ({ databaseId, collectionId, key, parseOutput = true, sdk = undefined}) => {
1878
1752
  let client = !sdk ? await sdkForProject() : sdk;
1879
-
1880
1753
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1881
1754
  let payload = {};
1882
1755
 
1883
-
1884
1756
  let response = undefined;
1885
-
1757
+
1886
1758
  response = await client.call('get', apiPath, {
1887
1759
  'content-type': 'application/json',
1888
1760
  }, payload);
1889
1761
 
1890
-
1891
1762
  if (parseOutput) {
1892
1763
  parse(response)
1893
1764
  success()
@@ -1910,18 +1781,15 @@ const databasesGetIndex = async ({ databaseId, collectionId, key, parseOutput =
1910
1781
  */
1911
1782
  const databasesDeleteIndex = async ({ databaseId, collectionId, key, parseOutput = true, sdk = undefined}) => {
1912
1783
  let client = !sdk ? await sdkForProject() : sdk;
1913
-
1914
1784
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1915
1785
  let payload = {};
1916
1786
 
1917
-
1918
1787
  let response = undefined;
1919
-
1788
+
1920
1789
  response = await client.call('delete', apiPath, {
1921
1790
  'content-type': 'application/json',
1922
1791
  }, payload);
1923
1792
 
1924
-
1925
1793
  if (parseOutput) {
1926
1794
  parse(response)
1927
1795
  success()
@@ -1944,21 +1812,18 @@ const databasesDeleteIndex = async ({ databaseId, collectionId, key, parseOutput
1944
1812
  */
1945
1813
  const databasesListCollectionLogs = async ({ databaseId, collectionId, queries, parseOutput = true, sdk = undefined}) => {
1946
1814
  let client = !sdk ? await sdkForProject() : sdk;
1947
-
1948
1815
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1949
1816
  let payload = {};
1950
1817
  if (typeof queries !== 'undefined') {
1951
1818
  payload['queries'] = queries;
1952
1819
  }
1953
1820
 
1954
-
1955
1821
  let response = undefined;
1956
-
1822
+
1957
1823
  response = await client.call('get', apiPath, {
1958
1824
  'content-type': 'application/json',
1959
1825
  }, payload);
1960
1826
 
1961
-
1962
1827
  if (parseOutput) {
1963
1828
  parse(response)
1964
1829
  success()
@@ -1971,7 +1836,7 @@ const databasesListCollectionLogs = async ({ databaseId, collectionId, queries,
1971
1836
  * @typedef {Object} DatabasesGetCollectionUsageRequestParams
1972
1837
  * @property {string} databaseId Database ID.
1973
1838
  * @property {string} collectionId Collection ID.
1974
- * @property {string} range Date range.
1839
+ * @property {DatabaseUsageRange} range Date range.
1975
1840
  * @property {boolean} parseOutput
1976
1841
  * @property {libClient | undefined} sdk
1977
1842
  */
@@ -1981,21 +1846,18 @@ const databasesListCollectionLogs = async ({ databaseId, collectionId, queries,
1981
1846
  */
1982
1847
  const databasesGetCollectionUsage = async ({ databaseId, collectionId, range, parseOutput = true, sdk = undefined}) => {
1983
1848
  let client = !sdk ? await sdkForProject() : sdk;
1984
-
1985
1849
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1986
1850
  let payload = {};
1987
1851
  if (typeof range !== 'undefined') {
1988
1852
  payload['range'] = range;
1989
1853
  }
1990
1854
 
1991
-
1992
1855
  let response = undefined;
1993
-
1856
+
1994
1857
  response = await client.call('get', apiPath, {
1995
1858
  'content-type': 'application/json',
1996
1859
  }, payload);
1997
1860
 
1998
-
1999
1861
  if (parseOutput) {
2000
1862
  parse(response)
2001
1863
  success()
@@ -2017,21 +1879,18 @@ const databasesGetCollectionUsage = async ({ databaseId, collectionId, range, pa
2017
1879
  */
2018
1880
  const databasesListLogs = async ({ databaseId, queries, parseOutput = true, sdk = undefined}) => {
2019
1881
  let client = !sdk ? await sdkForProject() : sdk;
2020
-
2021
1882
  let apiPath = '/databases/{databaseId}/logs'.replace('{databaseId}', databaseId);
2022
1883
  let payload = {};
2023
1884
  if (typeof queries !== 'undefined') {
2024
1885
  payload['queries'] = queries;
2025
1886
  }
2026
1887
 
2027
-
2028
1888
  let response = undefined;
2029
-
1889
+
2030
1890
  response = await client.call('get', apiPath, {
2031
1891
  'content-type': 'application/json',
2032
1892
  }, payload);
2033
1893
 
2034
-
2035
1894
  if (parseOutput) {
2036
1895
  parse(response)
2037
1896
  success()
@@ -2043,7 +1902,7 @@ const databasesListLogs = async ({ databaseId, queries, parseOutput = true, sdk
2043
1902
  /**
2044
1903
  * @typedef {Object} DatabasesGetDatabaseUsageRequestParams
2045
1904
  * @property {string} databaseId Database ID.
2046
- * @property {string} range 'Date range.
1905
+ * @property {DatabaseUsageRange} range 'Date range.
2047
1906
  * @property {boolean} parseOutput
2048
1907
  * @property {libClient | undefined} sdk
2049
1908
  */
@@ -2053,21 +1912,18 @@ const databasesListLogs = async ({ databaseId, queries, parseOutput = true, sdk
2053
1912
  */
2054
1913
  const databasesGetDatabaseUsage = async ({ databaseId, range, parseOutput = true, sdk = undefined}) => {
2055
1914
  let client = !sdk ? await sdkForProject() : sdk;
2056
-
2057
1915
  let apiPath = '/databases/{databaseId}/usage'.replace('{databaseId}', databaseId);
2058
1916
  let payload = {};
2059
1917
  if (typeof range !== 'undefined') {
2060
1918
  payload['range'] = range;
2061
1919
  }
2062
1920
 
2063
-
2064
1921
  let response = undefined;
2065
-
1922
+
2066
1923
  response = await client.call('get', apiPath, {
2067
1924
  'content-type': 'application/json',
2068
1925
  }, payload);
2069
1926
 
2070
-
2071
1927
  if (parseOutput) {
2072
1928
  parse(response)
2073
1929
  success()
@@ -2076,7 +1932,6 @@ const databasesGetDatabaseUsage = async ({ databaseId, range, parseOutput = true
2076
1932
  return response;
2077
1933
  }
2078
1934
 
2079
-
2080
1935
  databases
2081
1936
  .command(`list`)
2082
1937
  .description(`Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`)
@@ -2164,7 +2019,7 @@ databases
2164
2019
 
2165
2020
  databases
2166
2021
  .command(`listAttributes`)
2167
- .description(``)
2022
+ .description(`List attributes in the collection.`)
2168
2023
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2169
2024
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2170
2025
  .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. You may filter on the following attributes: key, type, size, required, array, status, error`)
@@ -2183,7 +2038,7 @@ databases
2183
2038
 
2184
2039
  databases
2185
2040
  .command(`updateBooleanAttribute`)
2186
- .description(``)
2041
+ .description(`Update a boolean attribute. Changing the 'default' value will not update already existing documents.`)
2187
2042
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2188
2043
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2189
2044
  .requiredOption(`--key <key>`, `Attribute Key.`)
@@ -2193,18 +2048,18 @@ databases
2193
2048
 
2194
2049
  databases
2195
2050
  .command(`createDatetimeAttribute`)
2196
- .description(``)
2051
+ .description(`Create a date time attribute according to the ISO 8601 standard.`)
2197
2052
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2198
2053
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2199
2054
  .requiredOption(`--key <key>`, `Attribute Key.`)
2200
2055
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2201
- .option(`--xdefault <xdefault>`, `Default value for the attribute in ISO 8601 format. Cannot be set when attribute is required.`)
2056
+ .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.`)
2202
2057
  .option(`--array <array>`, `Is attribute an array?`, parseBool)
2203
2058
  .action(actionRunner(databasesCreateDatetimeAttribute))
2204
2059
 
2205
2060
  databases
2206
2061
  .command(`updateDatetimeAttribute`)
2207
- .description(``)
2062
+ .description(`Update a date time attribute. Changing the 'default' value will not update already existing documents.`)
2208
2063
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2209
2064
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2210
2065
  .requiredOption(`--key <key>`, `Attribute Key.`)
@@ -2235,7 +2090,7 @@ databases
2235
2090
 
2236
2091
  databases
2237
2092
  .command(`createEnumAttribute`)
2238
- .description(``)
2093
+ .description(`Create an enumeration attribute. The 'elements' param acts as a white-list of accepted values for this attribute. `)
2239
2094
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2240
2095
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2241
2096
  .requiredOption(`--key <key>`, `Attribute Key.`)
@@ -2386,7 +2241,7 @@ databases
2386
2241
 
2387
2242
  databases
2388
2243
  .command(`getAttribute`)
2389
- .description(``)
2244
+ .description(`Get attribute by ID.`)
2390
2245
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2391
2246
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2392
2247
  .requiredOption(`--key <key>`, `Attribute Key.`)
@@ -2394,7 +2249,7 @@ databases
2394
2249
 
2395
2250
  databases
2396
2251
  .command(`deleteAttribute`)
2397
- .description(``)
2252
+ .description(`Deletes an attribute.`)
2398
2253
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2399
2254
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2400
2255
  .requiredOption(`--key <key>`, `Attribute Key.`)
@@ -2433,7 +2288,7 @@ databases
2433
2288
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2434
2289
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2435
2290
  .requiredOption(`--documentId <documentId>`, `Document ID.`)
2436
- .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 method allowed is select.`)
2291
+ .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.`)
2437
2292
  .action(actionRunner(databasesGetDocument))
2438
2293
 
2439
2294
  databases
@@ -2465,7 +2320,7 @@ databases
2465
2320
 
2466
2321
  databases
2467
2322
  .command(`listIndexes`)
2468
- .description(``)
2323
+ .description(`List indexes in the collection.`)
2469
2324
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2470
2325
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2471
2326
  .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. You may filter on the following attributes: key, type, status, attributes, error`)
@@ -2473,7 +2328,7 @@ databases
2473
2328
 
2474
2329
  databases
2475
2330
  .command(`createIndex`)
2476
- .description(``)
2331
+ .description(`Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be 'key', 'fulltext', and 'unique'.`)
2477
2332
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2478
2333
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2479
2334
  .requiredOption(`--key <key>`, `Index Key.`)
@@ -2484,7 +2339,7 @@ databases
2484
2339
 
2485
2340
  databases
2486
2341
  .command(`getIndex`)
2487
- .description(``)
2342
+ .description(`Get index by ID.`)
2488
2343
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2489
2344
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2490
2345
  .requiredOption(`--key <key>`, `Index Key.`)
@@ -2492,7 +2347,7 @@ databases
2492
2347
 
2493
2348
  databases
2494
2349
  .command(`deleteIndex`)
2495
- .description(``)
2350
+ .description(`Delete an index.`)
2496
2351
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2497
2352
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2498
2353
  .requiredOption(`--key <key>`, `Index Key.`)
@@ -2528,55 +2383,54 @@ databases
2528
2383
  .option(`--range <range>`, `'Date range.`)
2529
2384
  .action(actionRunner(databasesGetDatabaseUsage))
2530
2385
 
2531
-
2532
2386
  module.exports = {
2533
2387
  databases,
2534
- databasesList,
2535
- databasesCreate,
2536
- databasesGetUsage,
2537
- databasesGet,
2538
- databasesUpdate,
2539
- databasesDelete,
2540
- databasesListCollections,
2541
- databasesCreateCollection,
2542
- databasesGetCollection,
2543
- databasesUpdateCollection,
2544
- databasesDeleteCollection,
2545
- databasesListAttributes,
2546
- databasesCreateBooleanAttribute,
2547
- databasesUpdateBooleanAttribute,
2548
- databasesCreateDatetimeAttribute,
2549
- databasesUpdateDatetimeAttribute,
2550
- databasesCreateEmailAttribute,
2551
- databasesUpdateEmailAttribute,
2552
- databasesCreateEnumAttribute,
2553
- databasesUpdateEnumAttribute,
2554
- databasesCreateFloatAttribute,
2555
- databasesUpdateFloatAttribute,
2556
- databasesCreateIntegerAttribute,
2557
- databasesUpdateIntegerAttribute,
2558
- databasesCreateIpAttribute,
2559
- databasesUpdateIpAttribute,
2560
- databasesCreateRelationshipAttribute,
2561
- databasesCreateStringAttribute,
2562
- databasesUpdateStringAttribute,
2563
- databasesCreateUrlAttribute,
2564
- databasesUpdateUrlAttribute,
2565
- databasesGetAttribute,
2566
- databasesDeleteAttribute,
2567
- databasesUpdateRelationshipAttribute,
2568
- databasesListDocuments,
2569
- databasesCreateDocument,
2570
- databasesGetDocument,
2571
- databasesUpdateDocument,
2572
- databasesDeleteDocument,
2573
- databasesListDocumentLogs,
2574
- databasesListIndexes,
2575
- databasesCreateIndex,
2576
- databasesGetIndex,
2577
- databasesDeleteIndex,
2578
- databasesListCollectionLogs,
2579
- databasesGetCollectionUsage,
2580
- databasesListLogs,
2581
- databasesGetDatabaseUsage
2388
+ databasesList,
2389
+ databasesCreate,
2390
+ databasesGetUsage,
2391
+ databasesGet,
2392
+ databasesUpdate,
2393
+ databasesDelete,
2394
+ databasesListCollections,
2395
+ databasesCreateCollection,
2396
+ databasesGetCollection,
2397
+ databasesUpdateCollection,
2398
+ databasesDeleteCollection,
2399
+ databasesListAttributes,
2400
+ databasesCreateBooleanAttribute,
2401
+ databasesUpdateBooleanAttribute,
2402
+ databasesCreateDatetimeAttribute,
2403
+ databasesUpdateDatetimeAttribute,
2404
+ databasesCreateEmailAttribute,
2405
+ databasesUpdateEmailAttribute,
2406
+ databasesCreateEnumAttribute,
2407
+ databasesUpdateEnumAttribute,
2408
+ databasesCreateFloatAttribute,
2409
+ databasesUpdateFloatAttribute,
2410
+ databasesCreateIntegerAttribute,
2411
+ databasesUpdateIntegerAttribute,
2412
+ databasesCreateIpAttribute,
2413
+ databasesUpdateIpAttribute,
2414
+ databasesCreateRelationshipAttribute,
2415
+ databasesCreateStringAttribute,
2416
+ databasesUpdateStringAttribute,
2417
+ databasesCreateUrlAttribute,
2418
+ databasesUpdateUrlAttribute,
2419
+ databasesGetAttribute,
2420
+ databasesDeleteAttribute,
2421
+ databasesUpdateRelationshipAttribute,
2422
+ databasesListDocuments,
2423
+ databasesCreateDocument,
2424
+ databasesGetDocument,
2425
+ databasesUpdateDocument,
2426
+ databasesDeleteDocument,
2427
+ databasesListDocumentLogs,
2428
+ databasesListIndexes,
2429
+ databasesCreateIndex,
2430
+ databasesGetIndex,
2431
+ databasesDeleteIndex,
2432
+ databasesListCollectionLogs,
2433
+ databasesGetCollectionUsage,
2434
+ databasesListLogs,
2435
+ databasesGetDatabaseUsage
2582
2436
  };