appwrite-cli 12.0.1 → 13.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +2 -2
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +145 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/lib/client.d.ts +89 -0
  8. package/dist/lib/client.d.ts.map +1 -0
  9. package/dist/lib/client.js +227 -0
  10. package/dist/lib/client.js.map +1 -0
  11. package/dist/lib/commands/account.d.ts +379 -0
  12. package/dist/lib/commands/account.d.ts.map +1 -0
  13. package/dist/lib/commands/account.js +1228 -0
  14. package/dist/lib/commands/account.js.map +1 -0
  15. package/dist/lib/commands/console.d.ts +20 -0
  16. package/dist/lib/commands/console.d.ts.map +1 -0
  17. package/dist/lib/commands/console.js +78 -0
  18. package/dist/lib/commands/console.js.map +1 -0
  19. package/dist/lib/commands/databases.d.ts +732 -0
  20. package/dist/lib/commands/databases.d.ts.map +1 -0
  21. package/dist/lib/commands/databases.js +2196 -0
  22. package/dist/lib/commands/databases.js.map +1 -0
  23. package/dist/lib/commands/functions.d.ts +310 -0
  24. package/dist/lib/commands/functions.d.ts.map +1 -0
  25. package/dist/lib/commands/functions.js +1100 -0
  26. package/dist/lib/commands/functions.js.map +1 -0
  27. package/dist/lib/commands/generic.d.ts +17 -0
  28. package/dist/lib/commands/generic.d.ts.map +1 -0
  29. package/dist/lib/commands/generic.js +279 -0
  30. package/dist/lib/commands/generic.js.map +1 -0
  31. package/dist/lib/commands/graphql.d.ts +19 -0
  32. package/dist/lib/commands/graphql.d.ts.map +1 -0
  33. package/dist/lib/commands/graphql.js +77 -0
  34. package/dist/lib/commands/graphql.js.map +1 -0
  35. package/dist/lib/commands/health.d.ts +153 -0
  36. package/dist/lib/commands/health.d.ts.map +1 -0
  37. package/dist/lib/commands/health.js +464 -0
  38. package/dist/lib/commands/health.js.map +1 -0
  39. package/dist/lib/commands/init.d.ts +3 -0
  40. package/dist/lib/commands/init.d.ts.map +1 -0
  41. package/dist/lib/commands/init.js +518 -0
  42. package/dist/lib/commands/init.js.map +1 -0
  43. package/dist/lib/commands/locale.d.ts +53 -0
  44. package/dist/lib/commands/locale.d.ts.map +1 -0
  45. package/dist/lib/commands/locale.js +165 -0
  46. package/dist/lib/commands/locale.js.map +1 -0
  47. package/dist/lib/commands/messaging.d.ts +588 -0
  48. package/dist/lib/commands/messaging.d.ts.map +1 -0
  49. package/dist/lib/commands/messaging.js +2042 -0
  50. package/dist/lib/commands/messaging.js.map +1 -0
  51. package/dist/lib/commands/migrations.d.ts +150 -0
  52. package/dist/lib/commands/migrations.d.ts.map +1 -0
  53. package/dist/lib/commands/migrations.js +524 -0
  54. package/dist/lib/commands/migrations.js.map +1 -0
  55. package/dist/lib/commands/organizations.d.ts +11 -0
  56. package/dist/lib/commands/organizations.d.ts.map +1 -0
  57. package/dist/lib/commands/organizations.js +31 -0
  58. package/dist/lib/commands/organizations.js.map +1 -0
  59. package/dist/lib/commands/project.d.ts +53 -0
  60. package/dist/lib/commands/project.d.ts.map +1 -0
  61. package/dist/lib/commands/project.js +176 -0
  62. package/dist/lib/commands/project.js.map +1 -0
  63. package/dist/lib/commands/projects.d.ts +516 -0
  64. package/dist/lib/commands/projects.d.ts.map +1 -0
  65. package/dist/lib/commands/projects.js +1590 -0
  66. package/dist/lib/commands/projects.js.map +1 -0
  67. package/dist/lib/commands/proxy.d.ts +71 -0
  68. package/dist/lib/commands/proxy.d.ts.map +1 -0
  69. package/dist/lib/commands/proxy.js +240 -0
  70. package/dist/lib/commands/proxy.js.map +1 -0
  71. package/dist/lib/commands/pull.d.ts +8 -0
  72. package/dist/lib/commands/pull.d.ts.map +1 -0
  73. package/dist/lib/commands/pull.js +455 -0
  74. package/dist/lib/commands/pull.js.map +1 -0
  75. package/dist/lib/commands/push.d.ts +4 -0
  76. package/dist/lib/commands/push.d.ts.map +1 -0
  77. package/dist/lib/commands/push.js +2154 -0
  78. package/dist/lib/commands/push.js.map +1 -0
  79. package/dist/lib/commands/run.d.ts +3 -0
  80. package/dist/lib/commands/run.d.ts.map +1 -0
  81. package/dist/lib/commands/run.js +287 -0
  82. package/dist/lib/commands/run.js.map +1 -0
  83. package/dist/lib/commands/sites.d.ts +296 -0
  84. package/dist/lib/commands/sites.d.ts.map +1 -0
  85. package/dist/lib/commands/sites.js +1046 -0
  86. package/dist/lib/commands/sites.js.map +1 -0
  87. package/dist/lib/commands/storage.d.ts +170 -0
  88. package/dist/lib/commands/storage.d.ts.map +1 -0
  89. package/dist/lib/commands/storage.js +651 -0
  90. package/dist/lib/commands/storage.js.map +1 -0
  91. package/dist/lib/commands/tables-db.d.ts +728 -0
  92. package/dist/lib/commands/tables-db.d.ts.map +1 -0
  93. package/dist/lib/commands/tables-db.js +2198 -0
  94. package/dist/lib/commands/tables-db.js.map +1 -0
  95. package/dist/lib/commands/teams.d.ts +129 -0
  96. package/dist/lib/commands/teams.d.ts.map +1 -0
  97. package/dist/lib/commands/teams.js +403 -0
  98. package/dist/lib/commands/teams.js.map +1 -0
  99. package/dist/lib/commands/tokens.d.ts +48 -0
  100. package/dist/lib/commands/tokens.d.ts.map +1 -0
  101. package/dist/lib/commands/tokens.js +156 -0
  102. package/dist/lib/commands/tokens.js.map +1 -0
  103. package/dist/lib/commands/types.d.ts +3 -0
  104. package/dist/lib/commands/types.d.ts.map +1 -0
  105. package/dist/lib/commands/types.js +155 -0
  106. package/dist/lib/commands/types.js.map +1 -0
  107. package/dist/lib/commands/update.d.ts +3 -0
  108. package/dist/lib/commands/update.d.ts.map +1 -0
  109. package/dist/lib/commands/update.js +202 -0
  110. package/dist/lib/commands/update.js.map +1 -0
  111. package/dist/lib/commands/users.d.ts +382 -0
  112. package/dist/lib/commands/users.d.ts.map +1 -0
  113. package/dist/lib/commands/users.js +1195 -0
  114. package/dist/lib/commands/users.js.map +1 -0
  115. package/dist/lib/commands/vcs.d.ts +92 -0
  116. package/dist/lib/commands/vcs.d.ts.map +1 -0
  117. package/dist/lib/commands/vcs.js +276 -0
  118. package/dist/lib/commands/vcs.js.map +1 -0
  119. package/dist/lib/config.d.ts +118 -0
  120. package/dist/lib/config.d.ts.map +1 -0
  121. package/{lib → dist/lib}/config.js +204 -325
  122. package/dist/lib/config.js.map +1 -0
  123. package/dist/lib/emulation/docker.d.ts +15 -0
  124. package/dist/lib/emulation/docker.d.ts.map +1 -0
  125. package/dist/lib/emulation/docker.js +220 -0
  126. package/dist/lib/emulation/docker.js.map +1 -0
  127. package/dist/lib/emulation/utils.d.ts +29 -0
  128. package/dist/lib/emulation/utils.d.ts.map +1 -0
  129. package/dist/lib/emulation/utils.js +168 -0
  130. package/dist/lib/emulation/utils.js.map +1 -0
  131. package/dist/lib/exception.d.ts +8 -0
  132. package/dist/lib/exception.d.ts.map +1 -0
  133. package/dist/lib/exception.js +16 -0
  134. package/dist/lib/exception.js.map +1 -0
  135. package/dist/lib/id.d.ts +7 -0
  136. package/dist/lib/id.d.ts.map +1 -0
  137. package/dist/lib/id.js +32 -0
  138. package/dist/lib/id.js.map +1 -0
  139. package/dist/lib/paginate.d.ts +10 -0
  140. package/dist/lib/paginate.d.ts.map +1 -0
  141. package/{lib → dist/lib}/paginate.js +9 -15
  142. package/dist/lib/paginate.js.map +1 -0
  143. package/dist/lib/parser.d.ts +18 -0
  144. package/dist/lib/parser.d.ts.map +1 -0
  145. package/dist/lib/parser.js +237 -0
  146. package/dist/lib/parser.js.map +1 -0
  147. package/dist/lib/questions.d.ts +59 -0
  148. package/dist/lib/questions.d.ts.map +1 -0
  149. package/dist/lib/questions.js +995 -0
  150. package/dist/lib/questions.js.map +1 -0
  151. package/dist/lib/sdks.d.ts +4 -0
  152. package/dist/lib/sdks.d.ts.map +1 -0
  153. package/dist/lib/sdks.js +51 -0
  154. package/dist/lib/sdks.js.map +1 -0
  155. package/dist/lib/spinner.d.ts +28 -0
  156. package/dist/lib/spinner.d.ts.map +1 -0
  157. package/{lib → dist/lib}/spinner.js +34 -45
  158. package/dist/lib/spinner.js.map +1 -0
  159. package/dist/lib/type-generation/attribute.d.ts +17 -0
  160. package/dist/lib/type-generation/attribute.d.ts.map +1 -0
  161. package/dist/lib/type-generation/attribute.js +19 -0
  162. package/dist/lib/type-generation/attribute.js.map +1 -0
  163. package/dist/lib/type-generation/languages/csharp.d.ts +7 -0
  164. package/dist/lib/type-generation/languages/csharp.d.ts.map +1 -0
  165. package/dist/lib/type-generation/languages/csharp.js +180 -0
  166. package/dist/lib/type-generation/languages/csharp.js.map +1 -0
  167. package/dist/lib/type-generation/languages/dart.d.ts +8 -0
  168. package/dist/lib/type-generation/languages/dart.d.ts.map +1 -0
  169. package/dist/lib/type-generation/languages/dart.js +197 -0
  170. package/dist/lib/type-generation/languages/dart.js.map +1 -0
  171. package/dist/lib/type-generation/languages/java.d.ts +7 -0
  172. package/dist/lib/type-generation/languages/java.d.ts.map +1 -0
  173. package/dist/lib/type-generation/languages/java.js +140 -0
  174. package/dist/lib/type-generation/languages/java.js.map +1 -0
  175. package/dist/lib/type-generation/languages/javascript.d.ts +9 -0
  176. package/dist/lib/type-generation/languages/javascript.d.ts.map +1 -0
  177. package/dist/lib/type-generation/languages/javascript.js +108 -0
  178. package/dist/lib/type-generation/languages/javascript.js.map +1 -0
  179. package/dist/lib/type-generation/languages/kotlin.d.ts +7 -0
  180. package/dist/lib/type-generation/languages/kotlin.d.ts.map +1 -0
  181. package/dist/lib/type-generation/languages/kotlin.js +95 -0
  182. package/dist/lib/type-generation/languages/kotlin.js.map +1 -0
  183. package/dist/lib/type-generation/languages/language.d.ts +43 -0
  184. package/dist/lib/type-generation/languages/language.d.ts.map +1 -0
  185. package/dist/lib/type-generation/languages/language.js +82 -0
  186. package/dist/lib/type-generation/languages/language.js.map +1 -0
  187. package/dist/lib/type-generation/languages/php.d.ts +7 -0
  188. package/dist/lib/type-generation/languages/php.d.ts.map +1 -0
  189. package/dist/lib/type-generation/languages/php.js +116 -0
  190. package/dist/lib/type-generation/languages/php.js.map +1 -0
  191. package/dist/lib/type-generation/languages/swift.d.ts +7 -0
  192. package/dist/lib/type-generation/languages/swift.d.ts.map +1 -0
  193. package/dist/lib/type-generation/languages/swift.js +179 -0
  194. package/dist/lib/type-generation/languages/swift.js.map +1 -0
  195. package/dist/lib/type-generation/languages/typescript.d.ts +9 -0
  196. package/dist/lib/type-generation/languages/typescript.d.ts.map +1 -0
  197. package/dist/lib/type-generation/languages/typescript.js +112 -0
  198. package/dist/lib/type-generation/languages/typescript.js.map +1 -0
  199. package/dist/lib/types.d.ts +133 -0
  200. package/dist/lib/types.d.ts.map +1 -0
  201. package/dist/lib/types.js +3 -0
  202. package/dist/lib/types.js.map +1 -0
  203. package/dist/lib/utils.d.ts +15 -0
  204. package/dist/lib/utils.d.ts.map +1 -0
  205. package/{lib → dist/lib}/utils.js +74 -120
  206. package/dist/lib/utils.js.map +1 -0
  207. package/dist/lib/validations.d.ts +2 -0
  208. package/dist/lib/validations.d.ts.map +1 -0
  209. package/dist/lib/validations.js +20 -0
  210. package/dist/lib/validations.js.map +1 -0
  211. package/docs/examples/databases/upsert-document.md +1 -2
  212. package/index.ts +152 -0
  213. package/install.ps1 +2 -5
  214. package/install.sh +1 -2
  215. package/lib/client.ts +259 -0
  216. package/lib/commands/{account.js → account.ts} +408 -662
  217. package/lib/commands/console.ts +112 -0
  218. package/lib/commands/{databases.js → databases.ts} +818 -1136
  219. package/lib/commands/{functions.js → functions.ts} +381 -526
  220. package/lib/commands/{generic.js → generic.ts} +47 -39
  221. package/lib/commands/graphql.ts +110 -0
  222. package/lib/commands/{health.js → health.ts} +168 -284
  223. package/lib/commands/{init.js → init.ts} +68 -66
  224. package/lib/commands/{locale.js → locale.ts} +75 -121
  225. package/lib/commands/{messaging.js → messaging.ts} +699 -937
  226. package/lib/commands/{migrations.js → migrations.ts} +182 -258
  227. package/lib/commands/organizations.ts +46 -0
  228. package/lib/commands/{project.js → project.ts} +75 -111
  229. package/lib/commands/{projects.js → projects.ts} +587 -843
  230. package/lib/commands/{proxy.js → proxy.ts} +94 -140
  231. package/lib/commands/{pull.js → pull.ts} +54 -44
  232. package/lib/commands/{push.js → push.ts} +235 -191
  233. package/lib/commands/{run.js → run.ts} +61 -55
  234. package/lib/commands/{sites.js → sites.ts} +364 -504
  235. package/lib/commands/{storage.js → storage.ts} +216 -292
  236. package/lib/commands/{tables-db.js → tables-db.ts} +817 -1126
  237. package/lib/commands/{teams.js → teams.ts} +162 -236
  238. package/lib/commands/{tokens.js → tokens.ts} +70 -99
  239. package/lib/commands/{types.js → types.ts} +37 -35
  240. package/lib/commands/{update.js → update.ts} +25 -27
  241. package/lib/commands/{users.js → users.ts} +426 -644
  242. package/lib/commands/{vcs.js → vcs.ts} +118 -174
  243. package/lib/config.ts +854 -0
  244. package/lib/emulation/{docker.js → docker.ts} +39 -38
  245. package/lib/emulation/utils.ts +193 -0
  246. package/lib/exception.ts +20 -0
  247. package/lib/{id.js → id.ts} +5 -5
  248. package/lib/paginate.ts +63 -0
  249. package/lib/parser.ts +238 -0
  250. package/lib/{questions.js → questions.ts} +148 -156
  251. package/lib/sdks.ts +55 -0
  252. package/lib/spinner.ts +118 -0
  253. package/lib/type-generation/attribute.ts +17 -0
  254. package/lib/type-generation/languages/{csharp.js → csharp.ts} +59 -57
  255. package/lib/type-generation/languages/{dart.js → dart.ts} +91 -89
  256. package/lib/type-generation/languages/{java.js → java.ts} +58 -56
  257. package/lib/type-generation/languages/javascript.ts +111 -0
  258. package/lib/type-generation/languages/kotlin.ts +96 -0
  259. package/lib/type-generation/languages/language.ts +119 -0
  260. package/lib/type-generation/languages/{php.js → php.ts} +55 -53
  261. package/lib/type-generation/languages/{swift.js → swift.ts} +59 -57
  262. package/lib/type-generation/languages/typescript.ts +116 -0
  263. package/lib/types.ts +150 -0
  264. package/lib/utils.ts +322 -0
  265. package/lib/validations.ts +17 -0
  266. package/package.json +21 -12
  267. package/scoop/appwrite.config.json +3 -3
  268. package/tsconfig.json +30 -0
  269. package/index.js +0 -147
  270. package/lib/client.js +0 -254
  271. package/lib/commands/console.js +0 -127
  272. package/lib/commands/graphql.js +0 -126
  273. package/lib/commands/organizations.js +0 -48
  274. package/lib/emulation/utils.js +0 -186
  275. package/lib/exception.js +0 -9
  276. package/lib/parser.js +0 -250
  277. package/lib/sdks.js +0 -60
  278. package/lib/type-generation/attribute.js +0 -19
  279. package/lib/type-generation/languages/javascript.js +0 -111
  280. package/lib/type-generation/languages/kotlin.js +0 -94
  281. package/lib/type-generation/languages/language.js +0 -125
  282. package/lib/type-generation/languages/typescript.js +0 -116
  283. package/lib/validations.js +0 -17
@@ -1,31 +1,27 @@
1
- const fs = require('fs');
2
- const pathLib = require('path');
3
- const tar = require("tar");
4
- const ignore = require("ignore");
5
- const { promisify } = require('util');
6
- const libClient = require('../client.js');
7
- const { getAllFiles, showConsoleLink } = require('../utils.js');
8
- const { Command } = require('commander');
9
- const { sdkForProject, sdkForConsole } = require('../sdks')
10
- const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser')
11
- const { localConfig, globalConfig } = require("../config");
12
- const { File } = require('undici');
13
- const { ReadableStream } = require('stream/web');
14
-
15
- /**
16
- * @param {fs.ReadStream} readStream
17
- * @returns {ReadableStream}
18
- */
19
- function convertReadStreamToReadableStream(readStream) {
1
+ import fs = require('fs');
2
+ import pathLib = require('path');
3
+ import tar = require('tar');
4
+ import ignore = require('ignore');
5
+ import { promisify } from 'util';
6
+ import Client from '../client';
7
+ import { getAllFiles, showConsoleLink } from '../utils';
8
+ import { Command } from 'commander';
9
+ import { sdkForProject, sdkForConsole } from '../sdks';
10
+ import { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } from '../parser';
11
+ import { localConfig, globalConfig } from '../config';
12
+ import { File } from 'undici';
13
+ import { ReadableStream } from 'stream/web';
14
+
15
+ function convertReadStreamToReadableStream(readStream: fs.ReadStream): ReadableStream {
20
16
  return new ReadableStream({
21
17
  start(controller) {
22
- readStream.on("data", (chunk) => {
18
+ readStream.on("data", (chunk: Buffer) => {
23
19
  controller.enqueue(chunk);
24
20
  });
25
21
  readStream.on("end", () => {
26
22
  controller.close();
27
23
  });
28
- readStream.on("error", (err) => {
24
+ readStream.on("error", (err: Error) => {
29
25
  controller.error(err);
30
26
  });
31
27
  },
@@ -35,24 +31,21 @@ function convertReadStreamToReadableStream(readStream) {
35
31
  });
36
32
  }
37
33
 
38
- const users = new Command("users").description(commandDescriptions['users'] ?? '').configureHelp({
34
+ export const users = new Command("users").description(commandDescriptions['users'] ?? '').configureHelp({
39
35
  helpWidth: process.stdout.columns || 80
40
36
  })
41
37
 
42
- /**
43
- * @typedef {Object} UsersListRequestParams
44
- * @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. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels
45
- * @property {string} search Search term to filter your list results. Max length: 256 chars.
46
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
47
- * @property {boolean} overrideForCli
48
- * @property {boolean} parseOutput
49
- * @property {libClient | undefined} sdk
50
- */
51
-
52
- /**
53
- * @param {UsersListRequestParams} params
54
- */
55
- const usersList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
38
+ interface UsersListRequestParams {
39
+ queries?: string[];
40
+ search?: string;
41
+ total?: boolean;
42
+ overrideForCli?: boolean;
43
+ parseOutput?: boolean;
44
+ sdk?: Client;
45
+ console?: boolean;
46
+ }
47
+
48
+ export const usersList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: UsersListRequestParams): Promise<any> => {
56
49
  let client = !sdk ? await sdkForProject() :
57
50
  sdk;
58
51
  let apiPath = '/users';
@@ -73,7 +66,7 @@ const usersList = async ({queries,search,total,parseOutput = true, overrideForCl
73
66
  }, payload);
74
67
 
75
68
  if (parseOutput) {
76
- if(console) {
69
+ if(showConsole) {
77
70
  showConsoleLink('users', 'list');
78
71
  } else {
79
72
  parse(response)
@@ -83,22 +76,18 @@ const usersList = async ({queries,search,total,parseOutput = true, overrideForCl
83
76
  return response;
84
77
 
85
78
  }
86
- /**
87
- * @typedef {Object} UsersCreateRequestParams
88
- * @property {string} userId User ID. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
89
- * @property {string} email User email.
90
- * @property {string} phone Phone number. Format this number with a leading &#039;+&#039; and a country code, e.g., +16175551212.
91
- * @property {string} password Plain text user password. Must be at least 8 chars.
92
- * @property {string} name User name. Max length: 128 chars.
93
- * @property {boolean} overrideForCli
94
- * @property {boolean} parseOutput
95
- * @property {libClient | undefined} sdk
96
- */
97
-
98
- /**
99
- * @param {UsersCreateRequestParams} params
100
- */
101
- const usersCreate = async ({userId,email,phone,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
79
+ interface UsersCreateRequestParams {
80
+ userId: string;
81
+ email?: string;
82
+ phone?: string;
83
+ password?: string;
84
+ name?: string;
85
+ overrideForCli?: boolean;
86
+ parseOutput?: boolean;
87
+ sdk?: Client;
88
+ }
89
+
90
+ export const usersCreate = async ({userId,email,phone,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateRequestParams): Promise<any> => {
102
91
  let client = !sdk ? await sdkForProject() :
103
92
  sdk;
104
93
  let apiPath = '/users';
@@ -132,21 +121,17 @@ const usersCreate = async ({userId,email,phone,password,name,parseOutput = true,
132
121
  return response;
133
122
 
134
123
  }
135
- /**
136
- * @typedef {Object} UsersCreateArgon2UserRequestParams
137
- * @property {string} userId User ID. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
138
- * @property {string} email User email.
139
- * @property {string} password User password hashed using Argon2.
140
- * @property {string} name User name. Max length: 128 chars.
141
- * @property {boolean} overrideForCli
142
- * @property {boolean} parseOutput
143
- * @property {libClient | undefined} sdk
144
- */
145
-
146
- /**
147
- * @param {UsersCreateArgon2UserRequestParams} params
148
- */
149
- const usersCreateArgon2User = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
124
+ interface UsersCreateArgon2UserRequestParams {
125
+ userId: string;
126
+ email: string;
127
+ password: string;
128
+ name?: string;
129
+ overrideForCli?: boolean;
130
+ parseOutput?: boolean;
131
+ sdk?: Client;
132
+ }
133
+
134
+ export const usersCreateArgon2User = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateArgon2UserRequestParams): Promise<any> => {
150
135
  let client = !sdk ? await sdkForProject() :
151
136
  sdk;
152
137
  let apiPath = '/users/argon2';
@@ -177,21 +162,17 @@ const usersCreateArgon2User = async ({userId,email,password,name,parseOutput = t
177
162
  return response;
178
163
 
179
164
  }
180
- /**
181
- * @typedef {Object} UsersCreateBcryptUserRequestParams
182
- * @property {string} userId User ID. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
183
- * @property {string} email User email.
184
- * @property {string} password User password hashed using Bcrypt.
185
- * @property {string} name User name. Max length: 128 chars.
186
- * @property {boolean} overrideForCli
187
- * @property {boolean} parseOutput
188
- * @property {libClient | undefined} sdk
189
- */
190
-
191
- /**
192
- * @param {UsersCreateBcryptUserRequestParams} params
193
- */
194
- const usersCreateBcryptUser = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
165
+ interface UsersCreateBcryptUserRequestParams {
166
+ userId: string;
167
+ email: string;
168
+ password: string;
169
+ name?: string;
170
+ overrideForCli?: boolean;
171
+ parseOutput?: boolean;
172
+ sdk?: Client;
173
+ }
174
+
175
+ export const usersCreateBcryptUser = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateBcryptUserRequestParams): Promise<any> => {
195
176
  let client = !sdk ? await sdkForProject() :
196
177
  sdk;
197
178
  let apiPath = '/users/bcrypt';
@@ -222,20 +203,16 @@ const usersCreateBcryptUser = async ({userId,email,password,name,parseOutput = t
222
203
  return response;
223
204
 
224
205
  }
225
- /**
226
- * @typedef {Object} UsersListIdentitiesRequestParams
227
- * @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. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry
228
- * @property {string} search Search term to filter your list results. Max length: 256 chars.
229
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
230
- * @property {boolean} overrideForCli
231
- * @property {boolean} parseOutput
232
- * @property {libClient | undefined} sdk
233
- */
234
-
235
- /**
236
- * @param {UsersListIdentitiesRequestParams} params
237
- */
238
- const usersListIdentities = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
206
+ interface UsersListIdentitiesRequestParams {
207
+ queries?: string[];
208
+ search?: string;
209
+ total?: boolean;
210
+ overrideForCli?: boolean;
211
+ parseOutput?: boolean;
212
+ sdk?: Client;
213
+ }
214
+
215
+ export const usersListIdentities = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersListIdentitiesRequestParams): Promise<any> => {
239
216
  let client = !sdk ? await sdkForProject() :
240
217
  sdk;
241
218
  let apiPath = '/users/identities';
@@ -262,18 +239,14 @@ const usersListIdentities = async ({queries,search,total,parseOutput = true, ove
262
239
  return response;
263
240
 
264
241
  }
265
- /**
266
- * @typedef {Object} UsersDeleteIdentityRequestParams
267
- * @property {string} identityId Identity ID.
268
- * @property {boolean} overrideForCli
269
- * @property {boolean} parseOutput
270
- * @property {libClient | undefined} sdk
271
- */
242
+ interface UsersDeleteIdentityRequestParams {
243
+ identityId: string;
244
+ overrideForCli?: boolean;
245
+ parseOutput?: boolean;
246
+ sdk?: Client;
247
+ }
272
248
 
273
- /**
274
- * @param {UsersDeleteIdentityRequestParams} params
275
- */
276
- const usersDeleteIdentity = async ({identityId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
249
+ export const usersDeleteIdentity = async ({identityId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersDeleteIdentityRequestParams): Promise<any> => {
277
250
  let client = !sdk ? await sdkForProject() :
278
251
  sdk;
279
252
  let apiPath = '/users/identities/{identityId}'.replace('{identityId}', identityId);
@@ -292,21 +265,17 @@ const usersDeleteIdentity = async ({identityId,parseOutput = true, overrideForCl
292
265
  return response;
293
266
 
294
267
  }
295
- /**
296
- * @typedef {Object} UsersCreateMD5UserRequestParams
297
- * @property {string} userId User ID. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
298
- * @property {string} email User email.
299
- * @property {string} password User password hashed using MD5.
300
- * @property {string} name User name. Max length: 128 chars.
301
- * @property {boolean} overrideForCli
302
- * @property {boolean} parseOutput
303
- * @property {libClient | undefined} sdk
304
- */
305
-
306
- /**
307
- * @param {UsersCreateMD5UserRequestParams} params
308
- */
309
- const usersCreateMD5User = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
268
+ interface UsersCreateMD5UserRequestParams {
269
+ userId: string;
270
+ email: string;
271
+ password: string;
272
+ name?: string;
273
+ overrideForCli?: boolean;
274
+ parseOutput?: boolean;
275
+ sdk?: Client;
276
+ }
277
+
278
+ export const usersCreateMD5User = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateMD5UserRequestParams): Promise<any> => {
310
279
  let client = !sdk ? await sdkForProject() :
311
280
  sdk;
312
281
  let apiPath = '/users/md5';
@@ -337,21 +306,17 @@ const usersCreateMD5User = async ({userId,email,password,name,parseOutput = true
337
306
  return response;
338
307
 
339
308
  }
340
- /**
341
- * @typedef {Object} UsersCreatePHPassUserRequestParams
342
- * @property {string} userId User ID. Choose a custom ID or pass the string &#039;ID.unique()&#039;to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
343
- * @property {string} email User email.
344
- * @property {string} password User password hashed using PHPass.
345
- * @property {string} name User name. Max length: 128 chars.
346
- * @property {boolean} overrideForCli
347
- * @property {boolean} parseOutput
348
- * @property {libClient | undefined} sdk
349
- */
350
-
351
- /**
352
- * @param {UsersCreatePHPassUserRequestParams} params
353
- */
354
- const usersCreatePHPassUser = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
309
+ interface UsersCreatePHPassUserRequestParams {
310
+ userId: string;
311
+ email: string;
312
+ password: string;
313
+ name?: string;
314
+ overrideForCli?: boolean;
315
+ parseOutput?: boolean;
316
+ sdk?: Client;
317
+ }
318
+
319
+ export const usersCreatePHPassUser = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreatePHPassUserRequestParams): Promise<any> => {
355
320
  let client = !sdk ? await sdkForProject() :
356
321
  sdk;
357
322
  let apiPath = '/users/phpass';
@@ -382,26 +347,22 @@ const usersCreatePHPassUser = async ({userId,email,password,name,parseOutput = t
382
347
  return response;
383
348
 
384
349
  }
385
- /**
386
- * @typedef {Object} UsersCreateScryptUserRequestParams
387
- * @property {string} userId User ID. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
388
- * @property {string} email User email.
389
- * @property {string} password User password hashed using Scrypt.
390
- * @property {string} passwordSalt Optional salt used to hash password.
391
- * @property {number} passwordCpu Optional CPU cost used to hash password.
392
- * @property {number} passwordMemory Optional memory cost used to hash password.
393
- * @property {number} passwordParallel Optional parallelization cost used to hash password.
394
- * @property {number} passwordLength Optional hash length used to hash password.
395
- * @property {string} name User name. Max length: 128 chars.
396
- * @property {boolean} overrideForCli
397
- * @property {boolean} parseOutput
398
- * @property {libClient | undefined} sdk
399
- */
400
-
401
- /**
402
- * @param {UsersCreateScryptUserRequestParams} params
403
- */
404
- const usersCreateScryptUser = async ({userId,email,password,passwordSalt,passwordCpu,passwordMemory,passwordParallel,passwordLength,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
350
+ interface UsersCreateScryptUserRequestParams {
351
+ userId: string;
352
+ email: string;
353
+ password: string;
354
+ passwordSalt: string;
355
+ passwordCpu: number;
356
+ passwordMemory: number;
357
+ passwordParallel: number;
358
+ passwordLength: number;
359
+ name?: string;
360
+ overrideForCli?: boolean;
361
+ parseOutput?: boolean;
362
+ sdk?: Client;
363
+ }
364
+
365
+ export const usersCreateScryptUser = async ({userId,email,password,passwordSalt,passwordCpu,passwordMemory,passwordParallel,passwordLength,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateScryptUserRequestParams): Promise<any> => {
405
366
  let client = !sdk ? await sdkForProject() :
406
367
  sdk;
407
368
  let apiPath = '/users/scrypt';
@@ -447,24 +408,20 @@ const usersCreateScryptUser = async ({userId,email,password,passwordSalt,passwor
447
408
  return response;
448
409
 
449
410
  }
450
- /**
451
- * @typedef {Object} UsersCreateScryptModifiedUserRequestParams
452
- * @property {string} userId User ID. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
453
- * @property {string} email User email.
454
- * @property {string} password User password hashed using Scrypt Modified.
455
- * @property {string} passwordSalt Salt used to hash password.
456
- * @property {string} passwordSaltSeparator Salt separator used to hash password.
457
- * @property {string} passwordSignerKey Signer key used to hash password.
458
- * @property {string} name User name. Max length: 128 chars.
459
- * @property {boolean} overrideForCli
460
- * @property {boolean} parseOutput
461
- * @property {libClient | undefined} sdk
462
- */
463
-
464
- /**
465
- * @param {UsersCreateScryptModifiedUserRequestParams} params
466
- */
467
- const usersCreateScryptModifiedUser = async ({userId,email,password,passwordSalt,passwordSaltSeparator,passwordSignerKey,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
411
+ interface UsersCreateScryptModifiedUserRequestParams {
412
+ userId: string;
413
+ email: string;
414
+ password: string;
415
+ passwordSalt: string;
416
+ passwordSaltSeparator: string;
417
+ passwordSignerKey: string;
418
+ name?: string;
419
+ overrideForCli?: boolean;
420
+ parseOutput?: boolean;
421
+ sdk?: Client;
422
+ }
423
+
424
+ export const usersCreateScryptModifiedUser = async ({userId,email,password,passwordSalt,passwordSaltSeparator,passwordSignerKey,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateScryptModifiedUserRequestParams): Promise<any> => {
468
425
  let client = !sdk ? await sdkForProject() :
469
426
  sdk;
470
427
  let apiPath = '/users/scrypt-modified';
@@ -504,22 +461,18 @@ const usersCreateScryptModifiedUser = async ({userId,email,password,passwordSalt
504
461
  return response;
505
462
 
506
463
  }
507
- /**
508
- * @typedef {Object} UsersCreateSHAUserRequestParams
509
- * @property {string} userId User ID. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
510
- * @property {string} email User email.
511
- * @property {string} password User password hashed using SHA.
512
- * @property {PasswordHash} passwordVersion Optional SHA version used to hash password. Allowed values are: &#039;sha1&#039;, &#039;sha224&#039;, &#039;sha256&#039;, &#039;sha384&#039;, &#039;sha512/224&#039;, &#039;sha512/256&#039;, &#039;sha512&#039;, &#039;sha3-224&#039;, &#039;sha3-256&#039;, &#039;sha3-384&#039;, &#039;sha3-512&#039;
513
- * @property {string} name User name. Max length: 128 chars.
514
- * @property {boolean} overrideForCli
515
- * @property {boolean} parseOutput
516
- * @property {libClient | undefined} sdk
517
- */
518
-
519
- /**
520
- * @param {UsersCreateSHAUserRequestParams} params
521
- */
522
- const usersCreateSHAUser = async ({userId,email,password,passwordVersion,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
464
+ interface UsersCreateSHAUserRequestParams {
465
+ userId: string;
466
+ email: string;
467
+ password: string;
468
+ passwordVersion?: PasswordHash;
469
+ name?: string;
470
+ overrideForCli?: boolean;
471
+ parseOutput?: boolean;
472
+ sdk?: Client;
473
+ }
474
+
475
+ export const usersCreateSHAUser = async ({userId,email,password,passwordVersion,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateSHAUserRequestParams): Promise<any> => {
523
476
  let client = !sdk ? await sdkForProject() :
524
477
  sdk;
525
478
  let apiPath = '/users/sha';
@@ -553,18 +506,14 @@ const usersCreateSHAUser = async ({userId,email,password,passwordVersion,name,pa
553
506
  return response;
554
507
 
555
508
  }
556
- /**
557
- * @typedef {Object} UsersGetUsageRequestParams
558
- * @property {UsageRange} range Date range.
559
- * @property {boolean} overrideForCli
560
- * @property {boolean} parseOutput
561
- * @property {libClient | undefined} sdk
562
- */
509
+ interface UsersGetUsageRequestParams {
510
+ range?: UsageRange;
511
+ overrideForCli?: boolean;
512
+ parseOutput?: boolean;
513
+ sdk?: Client;
514
+ }
563
515
 
564
- /**
565
- * @param {UsersGetUsageRequestParams} params
566
- */
567
- const usersGetUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
516
+ export const usersGetUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersGetUsageRequestParams): Promise<any> => {
568
517
  let client = !sdk ? await sdkForProject() :
569
518
  sdk;
570
519
  let apiPath = '/users/usage';
@@ -585,18 +534,15 @@ const usersGetUsage = async ({range,parseOutput = true, overrideForCli = false,
585
534
  return response;
586
535
 
587
536
  }
588
- /**
589
- * @typedef {Object} UsersGetRequestParams
590
- * @property {string} userId User ID.
591
- * @property {boolean} overrideForCli
592
- * @property {boolean} parseOutput
593
- * @property {libClient | undefined} sdk
594
- */
537
+ interface UsersGetRequestParams {
538
+ userId: string;
539
+ overrideForCli?: boolean;
540
+ parseOutput?: boolean;
541
+ sdk?: Client;
542
+ console?: boolean;
543
+ }
595
544
 
596
- /**
597
- * @param {UsersGetRequestParams} params
598
- */
599
- const usersGet = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
545
+ export const usersGet = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: UsersGetRequestParams): Promise<any> => {
600
546
  let client = !sdk ? await sdkForProject() :
601
547
  sdk;
602
548
  let apiPath = '/users/{userId}'.replace('{userId}', userId);
@@ -608,7 +554,7 @@ const usersGet = async ({userId,parseOutput = true, overrideForCli = false, sdk
608
554
  }, payload);
609
555
 
610
556
  if (parseOutput) {
611
- if(console) {
557
+ if(showConsole) {
612
558
  showConsoleLink('users', 'get', userId);
613
559
  } else {
614
560
  parse(response)
@@ -618,18 +564,14 @@ const usersGet = async ({userId,parseOutput = true, overrideForCli = false, sdk
618
564
  return response;
619
565
 
620
566
  }
621
- /**
622
- * @typedef {Object} UsersDeleteRequestParams
623
- * @property {string} userId User ID.
624
- * @property {boolean} overrideForCli
625
- * @property {boolean} parseOutput
626
- * @property {libClient | undefined} sdk
627
- */
567
+ interface UsersDeleteRequestParams {
568
+ userId: string;
569
+ overrideForCli?: boolean;
570
+ parseOutput?: boolean;
571
+ sdk?: Client;
572
+ }
628
573
 
629
- /**
630
- * @param {UsersDeleteRequestParams} params
631
- */
632
- const usersDelete = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
574
+ export const usersDelete = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersDeleteRequestParams): Promise<any> => {
633
575
  let client = !sdk ? await sdkForProject() :
634
576
  sdk;
635
577
  let apiPath = '/users/{userId}'.replace('{userId}', userId);
@@ -648,19 +590,15 @@ const usersDelete = async ({userId,parseOutput = true, overrideForCli = false, s
648
590
  return response;
649
591
 
650
592
  }
651
- /**
652
- * @typedef {Object} UsersUpdateEmailRequestParams
653
- * @property {string} userId User ID.
654
- * @property {string} email User email.
655
- * @property {boolean} overrideForCli
656
- * @property {boolean} parseOutput
657
- * @property {libClient | undefined} sdk
658
- */
593
+ interface UsersUpdateEmailRequestParams {
594
+ userId: string;
595
+ email: string;
596
+ overrideForCli?: boolean;
597
+ parseOutput?: boolean;
598
+ sdk?: Client;
599
+ }
659
600
 
660
- /**
661
- * @param {UsersUpdateEmailRequestParams} params
662
- */
663
- const usersUpdateEmail = async ({userId,email,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
601
+ export const usersUpdateEmail = async ({userId,email,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateEmailRequestParams): Promise<any> => {
664
602
  let client = !sdk ? await sdkForProject() :
665
603
  sdk;
666
604
  let apiPath = '/users/{userId}/email'.replace('{userId}', userId);
@@ -682,20 +620,16 @@ const usersUpdateEmail = async ({userId,email,parseOutput = true, overrideForCli
682
620
  return response;
683
621
 
684
622
  }
685
- /**
686
- * @typedef {Object} UsersCreateJWTRequestParams
687
- * @property {string} userId User ID.
688
- * @property {string} sessionId Session ID. Use the string &#039;recent&#039; to use the most recent session. Defaults to the most recent session.
689
- * @property {number} duration Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
690
- * @property {boolean} overrideForCli
691
- * @property {boolean} parseOutput
692
- * @property {libClient | undefined} sdk
693
- */
694
-
695
- /**
696
- * @param {UsersCreateJWTRequestParams} params
697
- */
698
- const usersCreateJWT = async ({userId,sessionId,duration,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
623
+ interface UsersCreateJWTRequestParams {
624
+ userId: string;
625
+ sessionId?: string;
626
+ duration?: number;
627
+ overrideForCli?: boolean;
628
+ parseOutput?: boolean;
629
+ sdk?: Client;
630
+ }
631
+
632
+ export const usersCreateJWT = async ({userId,sessionId,duration,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateJWTRequestParams): Promise<any> => {
699
633
  let client = !sdk ? await sdkForProject() :
700
634
  sdk;
701
635
  let apiPath = '/users/{userId}/jwts'.replace('{userId}', userId);
@@ -720,19 +654,15 @@ const usersCreateJWT = async ({userId,sessionId,duration,parseOutput = true, ove
720
654
  return response;
721
655
 
722
656
  }
723
- /**
724
- * @typedef {Object} UsersUpdateLabelsRequestParams
725
- * @property {string} userId User ID.
726
- * @property {string[]} labels Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
727
- * @property {boolean} overrideForCli
728
- * @property {boolean} parseOutput
729
- * @property {libClient | undefined} sdk
730
- */
657
+ interface UsersUpdateLabelsRequestParams {
658
+ userId: string;
659
+ labels: string[];
660
+ overrideForCli?: boolean;
661
+ parseOutput?: boolean;
662
+ sdk?: Client;
663
+ }
731
664
 
732
- /**
733
- * @param {UsersUpdateLabelsRequestParams} params
734
- */
735
- const usersUpdateLabels = async ({userId,labels,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
665
+ export const usersUpdateLabels = async ({userId,labels,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateLabelsRequestParams): Promise<any> => {
736
666
  let client = !sdk ? await sdkForProject() :
737
667
  sdk;
738
668
  let apiPath = '/users/{userId}/labels'.replace('{userId}', userId);
@@ -755,20 +685,16 @@ const usersUpdateLabels = async ({userId,labels,parseOutput = true, overrideForC
755
685
  return response;
756
686
 
757
687
  }
758
- /**
759
- * @typedef {Object} UsersListLogsRequestParams
760
- * @property {string} userId User ID.
761
- * @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). Only supported methods are limit and offset
762
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
763
- * @property {boolean} overrideForCli
764
- * @property {boolean} parseOutput
765
- * @property {libClient | undefined} sdk
766
- */
767
-
768
- /**
769
- * @param {UsersListLogsRequestParams} params
770
- */
771
- const usersListLogs = async ({userId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
688
+ interface UsersListLogsRequestParams {
689
+ userId: string;
690
+ queries?: string[];
691
+ total?: boolean;
692
+ overrideForCli?: boolean;
693
+ parseOutput?: boolean;
694
+ sdk?: Client;
695
+ }
696
+
697
+ export const usersListLogs = async ({userId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersListLogsRequestParams): Promise<any> => {
772
698
  let client = !sdk ? await sdkForProject() :
773
699
  sdk;
774
700
  let apiPath = '/users/{userId}/logs'.replace('{userId}', userId);
@@ -792,21 +718,17 @@ const usersListLogs = async ({userId,queries,total,parseOutput = true, overrideF
792
718
  return response;
793
719
 
794
720
  }
795
- /**
796
- * @typedef {Object} UsersListMembershipsRequestParams
797
- * @property {string} userId User ID.
798
- * @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. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
799
- * @property {string} search Search term to filter your list results. Max length: 256 chars.
800
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
801
- * @property {boolean} overrideForCli
802
- * @property {boolean} parseOutput
803
- * @property {libClient | undefined} sdk
804
- */
805
-
806
- /**
807
- * @param {UsersListMembershipsRequestParams} params
808
- */
809
- const usersListMemberships = async ({userId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
721
+ interface UsersListMembershipsRequestParams {
722
+ userId: string;
723
+ queries?: string[];
724
+ search?: string;
725
+ total?: boolean;
726
+ overrideForCli?: boolean;
727
+ parseOutput?: boolean;
728
+ sdk?: Client;
729
+ }
730
+
731
+ export const usersListMemberships = async ({userId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersListMembershipsRequestParams): Promise<any> => {
810
732
  let client = !sdk ? await sdkForProject() :
811
733
  sdk;
812
734
  let apiPath = '/users/{userId}/memberships'.replace('{userId}', userId);
@@ -833,19 +755,15 @@ const usersListMemberships = async ({userId,queries,search,total,parseOutput = t
833
755
  return response;
834
756
 
835
757
  }
836
- /**
837
- * @typedef {Object} UsersUpdateMFARequestParams
838
- * @property {string} userId User ID.
839
- * @property {boolean} mfa Enable or disable MFA.
840
- * @property {boolean} overrideForCli
841
- * @property {boolean} parseOutput
842
- * @property {libClient | undefined} sdk
843
- */
758
+ interface UsersUpdateMFARequestParams {
759
+ userId: string;
760
+ mfa: boolean;
761
+ overrideForCli?: boolean;
762
+ parseOutput?: boolean;
763
+ sdk?: Client;
764
+ }
844
765
 
845
- /**
846
- * @param {UsersUpdateMFARequestParams} params
847
- */
848
- const usersUpdateMFA = async ({userId,mfa,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
766
+ export const usersUpdateMFA = async ({userId,mfa,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateMFARequestParams): Promise<any> => {
849
767
  let client = !sdk ? await sdkForProject() :
850
768
  sdk;
851
769
  let apiPath = '/users/{userId}/mfa'.replace('{userId}', userId);
@@ -867,19 +785,15 @@ const usersUpdateMFA = async ({userId,mfa,parseOutput = true, overrideForCli = f
867
785
  return response;
868
786
 
869
787
  }
870
- /**
871
- * @typedef {Object} UsersDeleteMFAAuthenticatorRequestParams
872
- * @property {string} userId User ID.
873
- * @property {AuthenticatorType} type Type of authenticator.
874
- * @property {boolean} overrideForCli
875
- * @property {boolean} parseOutput
876
- * @property {libClient | undefined} sdk
877
- */
788
+ interface UsersDeleteMFAAuthenticatorRequestParams {
789
+ userId: string;
790
+ type: AuthenticatorType;
791
+ overrideForCli?: boolean;
792
+ parseOutput?: boolean;
793
+ sdk?: Client;
794
+ }
878
795
 
879
- /**
880
- * @param {UsersDeleteMFAAuthenticatorRequestParams} params
881
- */
882
- const usersDeleteMFAAuthenticator = async ({userId,type,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
796
+ export const usersDeleteMFAAuthenticator = async ({userId,type,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersDeleteMFAAuthenticatorRequestParams): Promise<any> => {
883
797
  let client = !sdk ? await sdkForProject() :
884
798
  sdk;
885
799
  let apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type);
@@ -898,18 +812,14 @@ const usersDeleteMFAAuthenticator = async ({userId,type,parseOutput = true, over
898
812
  return response;
899
813
 
900
814
  }
901
- /**
902
- * @typedef {Object} UsersListMFAFactorsRequestParams
903
- * @property {string} userId User ID.
904
- * @property {boolean} overrideForCli
905
- * @property {boolean} parseOutput
906
- * @property {libClient | undefined} sdk
907
- */
815
+ interface UsersListMFAFactorsRequestParams {
816
+ userId: string;
817
+ overrideForCli?: boolean;
818
+ parseOutput?: boolean;
819
+ sdk?: Client;
820
+ }
908
821
 
909
- /**
910
- * @param {UsersListMFAFactorsRequestParams} params
911
- */
912
- const usersListMFAFactors = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
822
+ export const usersListMFAFactors = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersListMFAFactorsRequestParams): Promise<any> => {
913
823
  let client = !sdk ? await sdkForProject() :
914
824
  sdk;
915
825
  let apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId);
@@ -927,18 +837,14 @@ const usersListMFAFactors = async ({userId,parseOutput = true, overrideForCli =
927
837
  return response;
928
838
 
929
839
  }
930
- /**
931
- * @typedef {Object} UsersGetMFARecoveryCodesRequestParams
932
- * @property {string} userId User ID.
933
- * @property {boolean} overrideForCli
934
- * @property {boolean} parseOutput
935
- * @property {libClient | undefined} sdk
936
- */
840
+ interface UsersGetMFARecoveryCodesRequestParams {
841
+ userId: string;
842
+ overrideForCli?: boolean;
843
+ parseOutput?: boolean;
844
+ sdk?: Client;
845
+ }
937
846
 
938
- /**
939
- * @param {UsersGetMFARecoveryCodesRequestParams} params
940
- */
941
- const usersGetMFARecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
847
+ export const usersGetMFARecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersGetMFARecoveryCodesRequestParams): Promise<any> => {
942
848
  let client = !sdk ? await sdkForProject() :
943
849
  sdk;
944
850
  let apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
@@ -956,18 +862,14 @@ const usersGetMFARecoveryCodes = async ({userId,parseOutput = true, overrideForC
956
862
  return response;
957
863
 
958
864
  }
959
- /**
960
- * @typedef {Object} UsersUpdateMFARecoveryCodesRequestParams
961
- * @property {string} userId User ID.
962
- * @property {boolean} overrideForCli
963
- * @property {boolean} parseOutput
964
- * @property {libClient | undefined} sdk
965
- */
865
+ interface UsersUpdateMFARecoveryCodesRequestParams {
866
+ userId: string;
867
+ overrideForCli?: boolean;
868
+ parseOutput?: boolean;
869
+ sdk?: Client;
870
+ }
966
871
 
967
- /**
968
- * @param {UsersUpdateMFARecoveryCodesRequestParams} params
969
- */
970
- const usersUpdateMFARecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
872
+ export const usersUpdateMFARecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateMFARecoveryCodesRequestParams): Promise<any> => {
971
873
  let client = !sdk ? await sdkForProject() :
972
874
  sdk;
973
875
  let apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
@@ -986,18 +888,14 @@ const usersUpdateMFARecoveryCodes = async ({userId,parseOutput = true, overrideF
986
888
  return response;
987
889
 
988
890
  }
989
- /**
990
- * @typedef {Object} UsersCreateMFARecoveryCodesRequestParams
991
- * @property {string} userId User ID.
992
- * @property {boolean} overrideForCli
993
- * @property {boolean} parseOutput
994
- * @property {libClient | undefined} sdk
995
- */
891
+ interface UsersCreateMFARecoveryCodesRequestParams {
892
+ userId: string;
893
+ overrideForCli?: boolean;
894
+ parseOutput?: boolean;
895
+ sdk?: Client;
896
+ }
996
897
 
997
- /**
998
- * @param {UsersCreateMFARecoveryCodesRequestParams} params
999
- */
1000
- const usersCreateMFARecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
898
+ export const usersCreateMFARecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateMFARecoveryCodesRequestParams): Promise<any> => {
1001
899
  let client = !sdk ? await sdkForProject() :
1002
900
  sdk;
1003
901
  let apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
@@ -1016,19 +914,15 @@ const usersCreateMFARecoveryCodes = async ({userId,parseOutput = true, overrideF
1016
914
  return response;
1017
915
 
1018
916
  }
1019
- /**
1020
- * @typedef {Object} UsersUpdateNameRequestParams
1021
- * @property {string} userId User ID.
1022
- * @property {string} name User name. Max length: 128 chars.
1023
- * @property {boolean} overrideForCli
1024
- * @property {boolean} parseOutput
1025
- * @property {libClient | undefined} sdk
1026
- */
917
+ interface UsersUpdateNameRequestParams {
918
+ userId: string;
919
+ name: string;
920
+ overrideForCli?: boolean;
921
+ parseOutput?: boolean;
922
+ sdk?: Client;
923
+ }
1027
924
 
1028
- /**
1029
- * @param {UsersUpdateNameRequestParams} params
1030
- */
1031
- const usersUpdateName = async ({userId,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
925
+ export const usersUpdateName = async ({userId,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateNameRequestParams): Promise<any> => {
1032
926
  let client = !sdk ? await sdkForProject() :
1033
927
  sdk;
1034
928
  let apiPath = '/users/{userId}/name'.replace('{userId}', userId);
@@ -1050,19 +944,15 @@ const usersUpdateName = async ({userId,name,parseOutput = true, overrideForCli =
1050
944
  return response;
1051
945
 
1052
946
  }
1053
- /**
1054
- * @typedef {Object} UsersUpdatePasswordRequestParams
1055
- * @property {string} userId User ID.
1056
- * @property {string} password New user password. Must be at least 8 chars.
1057
- * @property {boolean} overrideForCli
1058
- * @property {boolean} parseOutput
1059
- * @property {libClient | undefined} sdk
1060
- */
947
+ interface UsersUpdatePasswordRequestParams {
948
+ userId: string;
949
+ password: string;
950
+ overrideForCli?: boolean;
951
+ parseOutput?: boolean;
952
+ sdk?: Client;
953
+ }
1061
954
 
1062
- /**
1063
- * @param {UsersUpdatePasswordRequestParams} params
1064
- */
1065
- const usersUpdatePassword = async ({userId,password,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
955
+ export const usersUpdatePassword = async ({userId,password,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdatePasswordRequestParams): Promise<any> => {
1066
956
  let client = !sdk ? await sdkForProject() :
1067
957
  sdk;
1068
958
  let apiPath = '/users/{userId}/password'.replace('{userId}', userId);
@@ -1084,19 +974,15 @@ const usersUpdatePassword = async ({userId,password,parseOutput = true, override
1084
974
  return response;
1085
975
 
1086
976
  }
1087
- /**
1088
- * @typedef {Object} UsersUpdatePhoneRequestParams
1089
- * @property {string} userId User ID.
1090
- * @property {string} number User phone number.
1091
- * @property {boolean} overrideForCli
1092
- * @property {boolean} parseOutput
1093
- * @property {libClient | undefined} sdk
1094
- */
977
+ interface UsersUpdatePhoneRequestParams {
978
+ userId: string;
979
+ number: string;
980
+ overrideForCli?: boolean;
981
+ parseOutput?: boolean;
982
+ sdk?: Client;
983
+ }
1095
984
 
1096
- /**
1097
- * @param {UsersUpdatePhoneRequestParams} params
1098
- */
1099
- const usersUpdatePhone = async ({userId,number,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
985
+ export const usersUpdatePhone = async ({userId,number,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdatePhoneRequestParams): Promise<any> => {
1100
986
  let client = !sdk ? await sdkForProject() :
1101
987
  sdk;
1102
988
  let apiPath = '/users/{userId}/phone'.replace('{userId}', userId);
@@ -1118,18 +1004,14 @@ const usersUpdatePhone = async ({userId,number,parseOutput = true, overrideForCl
1118
1004
  return response;
1119
1005
 
1120
1006
  }
1121
- /**
1122
- * @typedef {Object} UsersGetPrefsRequestParams
1123
- * @property {string} userId User ID.
1124
- * @property {boolean} overrideForCli
1125
- * @property {boolean} parseOutput
1126
- * @property {libClient | undefined} sdk
1127
- */
1007
+ interface UsersGetPrefsRequestParams {
1008
+ userId: string;
1009
+ overrideForCli?: boolean;
1010
+ parseOutput?: boolean;
1011
+ sdk?: Client;
1012
+ }
1128
1013
 
1129
- /**
1130
- * @param {UsersGetPrefsRequestParams} params
1131
- */
1132
- const usersGetPrefs = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1014
+ export const usersGetPrefs = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersGetPrefsRequestParams): Promise<any> => {
1133
1015
  let client = !sdk ? await sdkForProject() :
1134
1016
  sdk;
1135
1017
  let apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
@@ -1147,19 +1029,15 @@ const usersGetPrefs = async ({userId,parseOutput = true, overrideForCli = false,
1147
1029
  return response;
1148
1030
 
1149
1031
  }
1150
- /**
1151
- * @typedef {Object} UsersUpdatePrefsRequestParams
1152
- * @property {string} userId User ID.
1153
- * @property {object} prefs Prefs key-value JSON object.
1154
- * @property {boolean} overrideForCli
1155
- * @property {boolean} parseOutput
1156
- * @property {libClient | undefined} sdk
1157
- */
1032
+ interface UsersUpdatePrefsRequestParams {
1033
+ userId: string;
1034
+ prefs: object;
1035
+ overrideForCli?: boolean;
1036
+ parseOutput?: boolean;
1037
+ sdk?: Client;
1038
+ }
1158
1039
 
1159
- /**
1160
- * @param {UsersUpdatePrefsRequestParams} params
1161
- */
1162
- const usersUpdatePrefs = async ({userId,prefs,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1040
+ export const usersUpdatePrefs = async ({userId,prefs,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdatePrefsRequestParams): Promise<any> => {
1163
1041
  let client = !sdk ? await sdkForProject() :
1164
1042
  sdk;
1165
1043
  let apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
@@ -1181,19 +1059,16 @@ const usersUpdatePrefs = async ({userId,prefs,parseOutput = true, overrideForCli
1181
1059
  return response;
1182
1060
 
1183
1061
  }
1184
- /**
1185
- * @typedef {Object} UsersListSessionsRequestParams
1186
- * @property {string} userId User ID.
1187
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
1188
- * @property {boolean} overrideForCli
1189
- * @property {boolean} parseOutput
1190
- * @property {libClient | undefined} sdk
1191
- */
1062
+ interface UsersListSessionsRequestParams {
1063
+ userId: string;
1064
+ total?: boolean;
1065
+ overrideForCli?: boolean;
1066
+ parseOutput?: boolean;
1067
+ sdk?: Client;
1068
+ console?: boolean;
1069
+ }
1192
1070
 
1193
- /**
1194
- * @param {UsersListSessionsRequestParams} params
1195
- */
1196
- const usersListSessions = async ({userId,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1071
+ export const usersListSessions = async ({userId,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: UsersListSessionsRequestParams): Promise<any> => {
1197
1072
  let client = !sdk ? await sdkForProject() :
1198
1073
  sdk;
1199
1074
  let apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
@@ -1208,7 +1083,7 @@ const usersListSessions = async ({userId,total,parseOutput = true, overrideForCl
1208
1083
  }, payload);
1209
1084
 
1210
1085
  if (parseOutput) {
1211
- if(console) {
1086
+ if(showConsole) {
1212
1087
  showConsoleLink('users', 'listSessions', userId);
1213
1088
  } else {
1214
1089
  parse(response)
@@ -1218,18 +1093,14 @@ const usersListSessions = async ({userId,total,parseOutput = true, overrideForCl
1218
1093
  return response;
1219
1094
 
1220
1095
  }
1221
- /**
1222
- * @typedef {Object} UsersCreateSessionRequestParams
1223
- * @property {string} userId User ID. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
1224
- * @property {boolean} overrideForCli
1225
- * @property {boolean} parseOutput
1226
- * @property {libClient | undefined} sdk
1227
- */
1096
+ interface UsersCreateSessionRequestParams {
1097
+ userId: string;
1098
+ overrideForCli?: boolean;
1099
+ parseOutput?: boolean;
1100
+ sdk?: Client;
1101
+ }
1228
1102
 
1229
- /**
1230
- * @param {UsersCreateSessionRequestParams} params
1231
- */
1232
- const usersCreateSession = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1103
+ export const usersCreateSession = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateSessionRequestParams): Promise<any> => {
1233
1104
  let client = !sdk ? await sdkForProject() :
1234
1105
  sdk;
1235
1106
  let apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
@@ -1248,18 +1119,14 @@ const usersCreateSession = async ({userId,parseOutput = true, overrideForCli = f
1248
1119
  return response;
1249
1120
 
1250
1121
  }
1251
- /**
1252
- * @typedef {Object} UsersDeleteSessionsRequestParams
1253
- * @property {string} userId User ID.
1254
- * @property {boolean} overrideForCli
1255
- * @property {boolean} parseOutput
1256
- * @property {libClient | undefined} sdk
1257
- */
1122
+ interface UsersDeleteSessionsRequestParams {
1123
+ userId: string;
1124
+ overrideForCli?: boolean;
1125
+ parseOutput?: boolean;
1126
+ sdk?: Client;
1127
+ }
1258
1128
 
1259
- /**
1260
- * @param {UsersDeleteSessionsRequestParams} params
1261
- */
1262
- const usersDeleteSessions = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1129
+ export const usersDeleteSessions = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersDeleteSessionsRequestParams): Promise<any> => {
1263
1130
  let client = !sdk ? await sdkForProject() :
1264
1131
  sdk;
1265
1132
  let apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
@@ -1278,19 +1145,15 @@ const usersDeleteSessions = async ({userId,parseOutput = true, overrideForCli =
1278
1145
  return response;
1279
1146
 
1280
1147
  }
1281
- /**
1282
- * @typedef {Object} UsersDeleteSessionRequestParams
1283
- * @property {string} userId User ID.
1284
- * @property {string} sessionId Session ID.
1285
- * @property {boolean} overrideForCli
1286
- * @property {boolean} parseOutput
1287
- * @property {libClient | undefined} sdk
1288
- */
1148
+ interface UsersDeleteSessionRequestParams {
1149
+ userId: string;
1150
+ sessionId: string;
1151
+ overrideForCli?: boolean;
1152
+ parseOutput?: boolean;
1153
+ sdk?: Client;
1154
+ }
1289
1155
 
1290
- /**
1291
- * @param {UsersDeleteSessionRequestParams} params
1292
- */
1293
- const usersDeleteSession = async ({userId,sessionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1156
+ export const usersDeleteSession = async ({userId,sessionId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersDeleteSessionRequestParams): Promise<any> => {
1294
1157
  let client = !sdk ? await sdkForProject() :
1295
1158
  sdk;
1296
1159
  let apiPath = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId);
@@ -1309,19 +1172,15 @@ const usersDeleteSession = async ({userId,sessionId,parseOutput = true, override
1309
1172
  return response;
1310
1173
 
1311
1174
  }
1312
- /**
1313
- * @typedef {Object} UsersUpdateStatusRequestParams
1314
- * @property {string} userId User ID.
1315
- * @property {boolean} status User Status. To activate the user pass &#039;true&#039; and to block the user pass &#039;false&#039;.
1316
- * @property {boolean} overrideForCli
1317
- * @property {boolean} parseOutput
1318
- * @property {libClient | undefined} sdk
1319
- */
1175
+ interface UsersUpdateStatusRequestParams {
1176
+ userId: string;
1177
+ status: boolean;
1178
+ overrideForCli?: boolean;
1179
+ parseOutput?: boolean;
1180
+ sdk?: Client;
1181
+ }
1320
1182
 
1321
- /**
1322
- * @param {UsersUpdateStatusRequestParams} params
1323
- */
1324
- const usersUpdateStatus = async ({userId,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1183
+ export const usersUpdateStatus = async ({userId,status,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateStatusRequestParams): Promise<any> => {
1325
1184
  let client = !sdk ? await sdkForProject() :
1326
1185
  sdk;
1327
1186
  let apiPath = '/users/{userId}/status'.replace('{userId}', userId);
@@ -1343,20 +1202,16 @@ const usersUpdateStatus = async ({userId,status,parseOutput = true, overrideForC
1343
1202
  return response;
1344
1203
 
1345
1204
  }
1346
- /**
1347
- * @typedef {Object} UsersListTargetsRequestParams
1348
- * @property {string} userId User ID.
1349
- * @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. You may filter on the following attributes: userId, providerId, identifier, providerType
1350
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
1351
- * @property {boolean} overrideForCli
1352
- * @property {boolean} parseOutput
1353
- * @property {libClient | undefined} sdk
1354
- */
1355
-
1356
- /**
1357
- * @param {UsersListTargetsRequestParams} params
1358
- */
1359
- const usersListTargets = async ({userId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1205
+ interface UsersListTargetsRequestParams {
1206
+ userId: string;
1207
+ queries?: string[];
1208
+ total?: boolean;
1209
+ overrideForCli?: boolean;
1210
+ parseOutput?: boolean;
1211
+ sdk?: Client;
1212
+ }
1213
+
1214
+ export const usersListTargets = async ({userId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersListTargetsRequestParams): Promise<any> => {
1360
1215
  let client = !sdk ? await sdkForProject() :
1361
1216
  sdk;
1362
1217
  let apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
@@ -1380,23 +1235,19 @@ const usersListTargets = async ({userId,queries,total,parseOutput = true, overri
1380
1235
  return response;
1381
1236
 
1382
1237
  }
1383
- /**
1384
- * @typedef {Object} UsersCreateTargetRequestParams
1385
- * @property {string} userId User ID.
1386
- * @property {string} targetId Target ID. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
1387
- * @property {MessagingProviderType} providerType The target provider type. Can be one of the following: &#039;email&#039;, &#039;sms&#039; or &#039;push&#039;.
1388
- * @property {string} identifier The target identifier (token, email, phone etc.)
1389
- * @property {string} providerId Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
1390
- * @property {string} name Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
1391
- * @property {boolean} overrideForCli
1392
- * @property {boolean} parseOutput
1393
- * @property {libClient | undefined} sdk
1394
- */
1395
-
1396
- /**
1397
- * @param {UsersCreateTargetRequestParams} params
1398
- */
1399
- const usersCreateTarget = async ({userId,targetId,providerType,identifier,providerId,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1238
+ interface UsersCreateTargetRequestParams {
1239
+ userId: string;
1240
+ targetId: string;
1241
+ providerType: MessagingProviderType;
1242
+ identifier: string;
1243
+ providerId?: string;
1244
+ name?: string;
1245
+ overrideForCli?: boolean;
1246
+ parseOutput?: boolean;
1247
+ sdk?: Client;
1248
+ }
1249
+
1250
+ export const usersCreateTarget = async ({userId,targetId,providerType,identifier,providerId,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateTargetRequestParams): Promise<any> => {
1400
1251
  let client = !sdk ? await sdkForProject() :
1401
1252
  sdk;
1402
1253
  let apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
@@ -1430,19 +1281,15 @@ const usersCreateTarget = async ({userId,targetId,providerType,identifier,provid
1430
1281
  return response;
1431
1282
 
1432
1283
  }
1433
- /**
1434
- * @typedef {Object} UsersGetTargetRequestParams
1435
- * @property {string} userId User ID.
1436
- * @property {string} targetId Target ID.
1437
- * @property {boolean} overrideForCli
1438
- * @property {boolean} parseOutput
1439
- * @property {libClient | undefined} sdk
1440
- */
1284
+ interface UsersGetTargetRequestParams {
1285
+ userId: string;
1286
+ targetId: string;
1287
+ overrideForCli?: boolean;
1288
+ parseOutput?: boolean;
1289
+ sdk?: Client;
1290
+ }
1441
1291
 
1442
- /**
1443
- * @param {UsersGetTargetRequestParams} params
1444
- */
1445
- const usersGetTarget = async ({userId,targetId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1292
+ export const usersGetTarget = async ({userId,targetId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersGetTargetRequestParams): Promise<any> => {
1446
1293
  let client = !sdk ? await sdkForProject() :
1447
1294
  sdk;
1448
1295
  let apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
@@ -1460,22 +1307,18 @@ const usersGetTarget = async ({userId,targetId,parseOutput = true, overrideForCl
1460
1307
  return response;
1461
1308
 
1462
1309
  }
1463
- /**
1464
- * @typedef {Object} UsersUpdateTargetRequestParams
1465
- * @property {string} userId User ID.
1466
- * @property {string} targetId Target ID.
1467
- * @property {string} identifier The target identifier (token, email, phone etc.)
1468
- * @property {string} providerId Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
1469
- * @property {string} name Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
1470
- * @property {boolean} overrideForCli
1471
- * @property {boolean} parseOutput
1472
- * @property {libClient | undefined} sdk
1473
- */
1474
-
1475
- /**
1476
- * @param {UsersUpdateTargetRequestParams} params
1477
- */
1478
- const usersUpdateTarget = async ({userId,targetId,identifier,providerId,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1310
+ interface UsersUpdateTargetRequestParams {
1311
+ userId: string;
1312
+ targetId: string;
1313
+ identifier?: string;
1314
+ providerId?: string;
1315
+ name?: string;
1316
+ overrideForCli?: boolean;
1317
+ parseOutput?: boolean;
1318
+ sdk?: Client;
1319
+ }
1320
+
1321
+ export const usersUpdateTarget = async ({userId,targetId,identifier,providerId,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateTargetRequestParams): Promise<any> => {
1479
1322
  let client = !sdk ? await sdkForProject() :
1480
1323
  sdk;
1481
1324
  let apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
@@ -1503,19 +1346,15 @@ const usersUpdateTarget = async ({userId,targetId,identifier,providerId,name,par
1503
1346
  return response;
1504
1347
 
1505
1348
  }
1506
- /**
1507
- * @typedef {Object} UsersDeleteTargetRequestParams
1508
- * @property {string} userId User ID.
1509
- * @property {string} targetId Target ID.
1510
- * @property {boolean} overrideForCli
1511
- * @property {boolean} parseOutput
1512
- * @property {libClient | undefined} sdk
1513
- */
1349
+ interface UsersDeleteTargetRequestParams {
1350
+ userId: string;
1351
+ targetId: string;
1352
+ overrideForCli?: boolean;
1353
+ parseOutput?: boolean;
1354
+ sdk?: Client;
1355
+ }
1514
1356
 
1515
- /**
1516
- * @param {UsersDeleteTargetRequestParams} params
1517
- */
1518
- const usersDeleteTarget = async ({userId,targetId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1357
+ export const usersDeleteTarget = async ({userId,targetId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersDeleteTargetRequestParams): Promise<any> => {
1519
1358
  let client = !sdk ? await sdkForProject() :
1520
1359
  sdk;
1521
1360
  let apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
@@ -1534,20 +1373,16 @@ const usersDeleteTarget = async ({userId,targetId,parseOutput = true, overrideFo
1534
1373
  return response;
1535
1374
 
1536
1375
  }
1537
- /**
1538
- * @typedef {Object} UsersCreateTokenRequestParams
1539
- * @property {string} userId User ID.
1540
- * @property {number} length Token length in characters. The default length is 6 characters
1541
- * @property {number} expire Token expiration period in seconds. The default expiration is 15 minutes.
1542
- * @property {boolean} overrideForCli
1543
- * @property {boolean} parseOutput
1544
- * @property {libClient | undefined} sdk
1545
- */
1546
-
1547
- /**
1548
- * @param {UsersCreateTokenRequestParams} params
1549
- */
1550
- const usersCreateToken = async ({userId,length,expire,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1376
+ interface UsersCreateTokenRequestParams {
1377
+ userId: string;
1378
+ length?: number;
1379
+ expire?: number;
1380
+ overrideForCli?: boolean;
1381
+ parseOutput?: boolean;
1382
+ sdk?: Client;
1383
+ }
1384
+
1385
+ export const usersCreateToken = async ({userId,length,expire,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateTokenRequestParams): Promise<any> => {
1551
1386
  let client = !sdk ? await sdkForProject() :
1552
1387
  sdk;
1553
1388
  let apiPath = '/users/{userId}/tokens'.replace('{userId}', userId);
@@ -1572,19 +1407,15 @@ const usersCreateToken = async ({userId,length,expire,parseOutput = true, overri
1572
1407
  return response;
1573
1408
 
1574
1409
  }
1575
- /**
1576
- * @typedef {Object} UsersUpdateEmailVerificationRequestParams
1577
- * @property {string} userId User ID.
1578
- * @property {boolean} emailVerification User email verification status.
1579
- * @property {boolean} overrideForCli
1580
- * @property {boolean} parseOutput
1581
- * @property {libClient | undefined} sdk
1582
- */
1410
+ interface UsersUpdateEmailVerificationRequestParams {
1411
+ userId: string;
1412
+ emailVerification: boolean;
1413
+ overrideForCli?: boolean;
1414
+ parseOutput?: boolean;
1415
+ sdk?: Client;
1416
+ }
1583
1417
 
1584
- /**
1585
- * @param {UsersUpdateEmailVerificationRequestParams} params
1586
- */
1587
- const usersUpdateEmailVerification = async ({userId,emailVerification,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1418
+ export const usersUpdateEmailVerification = async ({userId,emailVerification,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateEmailVerificationRequestParams): Promise<any> => {
1588
1419
  let client = !sdk ? await sdkForProject() :
1589
1420
  sdk;
1590
1421
  let apiPath = '/users/{userId}/verification'.replace('{userId}', userId);
@@ -1606,19 +1437,15 @@ const usersUpdateEmailVerification = async ({userId,emailVerification,parseOutpu
1606
1437
  return response;
1607
1438
 
1608
1439
  }
1609
- /**
1610
- * @typedef {Object} UsersUpdatePhoneVerificationRequestParams
1611
- * @property {string} userId User ID.
1612
- * @property {boolean} phoneVerification User phone verification status.
1613
- * @property {boolean} overrideForCli
1614
- * @property {boolean} parseOutput
1615
- * @property {libClient | undefined} sdk
1616
- */
1440
+ interface UsersUpdatePhoneVerificationRequestParams {
1441
+ userId: string;
1442
+ phoneVerification: boolean;
1443
+ overrideForCli?: boolean;
1444
+ parseOutput?: boolean;
1445
+ sdk?: Client;
1446
+ }
1617
1447
 
1618
- /**
1619
- * @param {UsersUpdatePhoneVerificationRequestParams} params
1620
- */
1621
- const usersUpdatePhoneVerification = async ({userId,phoneVerification,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1448
+ export const usersUpdatePhoneVerification = async ({userId,phoneVerification,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdatePhoneVerificationRequestParams): Promise<any> => {
1622
1449
  let client = !sdk ? await sdkForProject() :
1623
1450
  sdk;
1624
1451
  let apiPath = '/users/{userId}/verification/phone'.replace('{userId}', userId);
@@ -1645,7 +1472,7 @@ users
1645
1472
  .description(`Get a list of all the project's users. You can use the query params to filter your results.`)
1646
1473
  .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: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels`)
1647
1474
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1648
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
1475
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1649
1476
  .option(`--console`, `Get the resource console url`)
1650
1477
  .action(actionRunner(usersList))
1651
1478
 
@@ -1682,7 +1509,7 @@ users
1682
1509
  .description(`Get identities for all users.`)
1683
1510
  .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: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry`)
1684
1511
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1685
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
1512
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1686
1513
  .action(actionRunner(usersListIdentities))
1687
1514
 
1688
1515
  users
@@ -1791,7 +1618,7 @@ users
1791
1618
  .description(`Get the user activity logs list by its unique ID.`)
1792
1619
  .requiredOption(`--user-id <user-id>`, `User ID.`)
1793
1620
  .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). Only supported methods are limit and offset`)
1794
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
1621
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1795
1622
  .action(actionRunner(usersListLogs))
1796
1623
 
1797
1624
  users
@@ -1800,14 +1627,14 @@ users
1800
1627
  .requiredOption(`--user-id <user-id>`, `User ID.`)
1801
1628
  .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: userId, teamId, invited, joined, confirm, roles`)
1802
1629
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1803
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
1630
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1804
1631
  .action(actionRunner(usersListMemberships))
1805
1632
 
1806
1633
  users
1807
1634
  .command(`update-mfa`)
1808
1635
  .description(`Enable or disable MFA on a user account.`)
1809
1636
  .requiredOption(`--user-id <user-id>`, `User ID.`)
1810
- .requiredOption(`--mfa [value]`, `Enable or disable MFA.`, (value) => value === undefined ? true : parseBool(value))
1637
+ .requiredOption(`--mfa [value]`, `Enable or disable MFA.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1811
1638
  .action(actionRunner(usersUpdateMFA))
1812
1639
 
1813
1640
  users
@@ -1879,7 +1706,7 @@ users
1879
1706
  .command(`list-sessions`)
1880
1707
  .description(`Get the user sessions list by its unique ID.`)
1881
1708
  .requiredOption(`--user-id <user-id>`, `User ID.`)
1882
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
1709
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1883
1710
  .option(`--console`, `Get the resource console url`)
1884
1711
  .action(actionRunner(usersListSessions))
1885
1712
 
@@ -1906,7 +1733,7 @@ users
1906
1733
  .command(`update-status`)
1907
1734
  .description(`Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.`)
1908
1735
  .requiredOption(`--user-id <user-id>`, `User ID.`)
1909
- .requiredOption(`--status [value]`, `User Status. To activate the user pass 'true' and to block the user pass 'false'.`, (value) => value === undefined ? true : parseBool(value))
1736
+ .requiredOption(`--status [value]`, `User Status. To activate the user pass 'true' and to block the user pass 'false'.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1910
1737
  .action(actionRunner(usersUpdateStatus))
1911
1738
 
1912
1739
  users
@@ -1914,7 +1741,7 @@ users
1914
1741
  .description(`List the messaging targets that are associated with a user.`)
1915
1742
  .requiredOption(`--user-id <user-id>`, `User ID.`)
1916
1743
  .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: userId, providerId, identifier, providerType`)
1917
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
1744
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1918
1745
  .action(actionRunner(usersListTargets))
1919
1746
 
1920
1747
  users
@@ -1964,59 +1791,14 @@ users
1964
1791
  .command(`update-email-verification`)
1965
1792
  .description(`Update the user email verification status by its unique ID.`)
1966
1793
  .requiredOption(`--user-id <user-id>`, `User ID.`)
1967
- .requiredOption(`--email-verification [value]`, `User email verification status.`, (value) => value === undefined ? true : parseBool(value))
1794
+ .requiredOption(`--email-verification [value]`, `User email verification status.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1968
1795
  .action(actionRunner(usersUpdateEmailVerification))
1969
1796
 
1970
1797
  users
1971
1798
  .command(`update-phone-verification`)
1972
1799
  .description(`Update the user phone verification status by its unique ID.`)
1973
1800
  .requiredOption(`--user-id <user-id>`, `User ID.`)
1974
- .requiredOption(`--phone-verification [value]`, `User phone verification status.`, (value) => value === undefined ? true : parseBool(value))
1801
+ .requiredOption(`--phone-verification [value]`, `User phone verification status.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1975
1802
  .action(actionRunner(usersUpdatePhoneVerification))
1976
1803
 
1977
- module.exports = {
1978
- users,
1979
- usersList,
1980
- usersCreate,
1981
- usersCreateArgon2User,
1982
- usersCreateBcryptUser,
1983
- usersListIdentities,
1984
- usersDeleteIdentity,
1985
- usersCreateMD5User,
1986
- usersCreatePHPassUser,
1987
- usersCreateScryptUser,
1988
- usersCreateScryptModifiedUser,
1989
- usersCreateSHAUser,
1990
- usersGetUsage,
1991
- usersGet,
1992
- usersDelete,
1993
- usersUpdateEmail,
1994
- usersCreateJWT,
1995
- usersUpdateLabels,
1996
- usersListLogs,
1997
- usersListMemberships,
1998
- usersUpdateMFA,
1999
- usersDeleteMFAAuthenticator,
2000
- usersListMFAFactors,
2001
- usersGetMFARecoveryCodes,
2002
- usersUpdateMFARecoveryCodes,
2003
- usersCreateMFARecoveryCodes,
2004
- usersUpdateName,
2005
- usersUpdatePassword,
2006
- usersUpdatePhone,
2007
- usersGetPrefs,
2008
- usersUpdatePrefs,
2009
- usersListSessions,
2010
- usersCreateSession,
2011
- usersDeleteSessions,
2012
- usersDeleteSession,
2013
- usersUpdateStatus,
2014
- usersListTargets,
2015
- usersCreateTarget,
2016
- usersGetTarget,
2017
- usersUpdateTarget,
2018
- usersDeleteTarget,
2019
- usersCreateToken,
2020
- usersUpdateEmailVerification,
2021
- usersUpdatePhoneVerification
2022
- };
1804
+