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,21 +31,17 @@ function convertReadStreamToReadableStream(readStream) {
35
31
  });
36
32
  }
37
33
 
38
- const health = new Command("health").description(commandDescriptions['health'] ?? '').configureHelp({
34
+ export const health = new Command("health").description(commandDescriptions['health'] ?? '').configureHelp({
39
35
  helpWidth: process.stdout.columns || 80
40
36
  })
41
37
 
42
- /**
43
- * @typedef {Object} HealthGetRequestParams
44
- * @property {boolean} overrideForCli
45
- * @property {boolean} parseOutput
46
- * @property {libClient | undefined} sdk
47
- */
48
-
49
- /**
50
- * @param {HealthGetRequestParams} params
51
- */
52
- const healthGet = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
38
+ interface HealthGetRequestParams {
39
+ overrideForCli?: boolean;
40
+ parseOutput?: boolean;
41
+ sdk?: Client;
42
+ }
43
+
44
+ export const healthGet = async ({parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetRequestParams): Promise<any> => {
53
45
  let client = !sdk ? await sdkForProject() :
54
46
  sdk;
55
47
  let apiPath = '/health';
@@ -67,17 +59,13 @@ const healthGet = async ({parseOutput = true, overrideForCli = false, sdk = unde
67
59
  return response;
68
60
 
69
61
  }
70
- /**
71
- * @typedef {Object} HealthGetAntivirusRequestParams
72
- * @property {boolean} overrideForCli
73
- * @property {boolean} parseOutput
74
- * @property {libClient | undefined} sdk
75
- */
62
+ interface HealthGetAntivirusRequestParams {
63
+ overrideForCli?: boolean;
64
+ parseOutput?: boolean;
65
+ sdk?: Client;
66
+ }
76
67
 
77
- /**
78
- * @param {HealthGetAntivirusRequestParams} params
79
- */
80
- const healthGetAntivirus = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
68
+ export const healthGetAntivirus = async ({parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetAntivirusRequestParams): Promise<any> => {
81
69
  let client = !sdk ? await sdkForProject() :
82
70
  sdk;
83
71
  let apiPath = '/health/anti-virus';
@@ -95,17 +83,13 @@ const healthGetAntivirus = async ({parseOutput = true, overrideForCli = false, s
95
83
  return response;
96
84
 
97
85
  }
98
- /**
99
- * @typedef {Object} HealthGetCacheRequestParams
100
- * @property {boolean} overrideForCli
101
- * @property {boolean} parseOutput
102
- * @property {libClient | undefined} sdk
103
- */
86
+ interface HealthGetCacheRequestParams {
87
+ overrideForCli?: boolean;
88
+ parseOutput?: boolean;
89
+ sdk?: Client;
90
+ }
104
91
 
105
- /**
106
- * @param {HealthGetCacheRequestParams} params
107
- */
108
- const healthGetCache = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
92
+ export const healthGetCache = async ({parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetCacheRequestParams): Promise<any> => {
109
93
  let client = !sdk ? await sdkForProject() :
110
94
  sdk;
111
95
  let apiPath = '/health/cache';
@@ -123,18 +107,14 @@ const healthGetCache = async ({parseOutput = true, overrideForCli = false, sdk =
123
107
  return response;
124
108
 
125
109
  }
126
- /**
127
- * @typedef {Object} HealthGetCertificateRequestParams
128
- * @property {string} domain string
129
- * @property {boolean} overrideForCli
130
- * @property {boolean} parseOutput
131
- * @property {libClient | undefined} sdk
132
- */
110
+ interface HealthGetCertificateRequestParams {
111
+ domain?: string;
112
+ overrideForCli?: boolean;
113
+ parseOutput?: boolean;
114
+ sdk?: Client;
115
+ }
133
116
 
134
- /**
135
- * @param {HealthGetCertificateRequestParams} params
136
- */
137
- const healthGetCertificate = async ({domain,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
117
+ export const healthGetCertificate = async ({domain,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetCertificateRequestParams): Promise<any> => {
138
118
  let client = !sdk ? await sdkForProject() :
139
119
  sdk;
140
120
  let apiPath = '/health/certificate';
@@ -155,17 +135,13 @@ const healthGetCertificate = async ({domain,parseOutput = true, overrideForCli =
155
135
  return response;
156
136
 
157
137
  }
158
- /**
159
- * @typedef {Object} HealthGetDBRequestParams
160
- * @property {boolean} overrideForCli
161
- * @property {boolean} parseOutput
162
- * @property {libClient | undefined} sdk
163
- */
138
+ interface HealthGetDBRequestParams {
139
+ overrideForCli?: boolean;
140
+ parseOutput?: boolean;
141
+ sdk?: Client;
142
+ }
164
143
 
165
- /**
166
- * @param {HealthGetDBRequestParams} params
167
- */
168
- const healthGetDB = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
144
+ export const healthGetDB = async ({parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetDBRequestParams): Promise<any> => {
169
145
  let client = !sdk ? await sdkForProject() :
170
146
  sdk;
171
147
  let apiPath = '/health/db';
@@ -183,17 +159,13 @@ const healthGetDB = async ({parseOutput = true, overrideForCli = false, sdk = un
183
159
  return response;
184
160
 
185
161
  }
186
- /**
187
- * @typedef {Object} HealthGetPubSubRequestParams
188
- * @property {boolean} overrideForCli
189
- * @property {boolean} parseOutput
190
- * @property {libClient | undefined} sdk
191
- */
162
+ interface HealthGetPubSubRequestParams {
163
+ overrideForCli?: boolean;
164
+ parseOutput?: boolean;
165
+ sdk?: Client;
166
+ }
192
167
 
193
- /**
194
- * @param {HealthGetPubSubRequestParams} params
195
- */
196
- const healthGetPubSub = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
168
+ export const healthGetPubSub = async ({parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetPubSubRequestParams): Promise<any> => {
197
169
  let client = !sdk ? await sdkForProject() :
198
170
  sdk;
199
171
  let apiPath = '/health/pubsub';
@@ -211,18 +183,14 @@ const healthGetPubSub = async ({parseOutput = true, overrideForCli = false, sdk
211
183
  return response;
212
184
 
213
185
  }
214
- /**
215
- * @typedef {Object} HealthGetQueueBuildsRequestParams
216
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
217
- * @property {boolean} overrideForCli
218
- * @property {boolean} parseOutput
219
- * @property {libClient | undefined} sdk
220
- */
186
+ interface HealthGetQueueBuildsRequestParams {
187
+ threshold?: number;
188
+ overrideForCli?: boolean;
189
+ parseOutput?: boolean;
190
+ sdk?: Client;
191
+ }
221
192
 
222
- /**
223
- * @param {HealthGetQueueBuildsRequestParams} params
224
- */
225
- const healthGetQueueBuilds = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
193
+ export const healthGetQueueBuilds = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetQueueBuildsRequestParams): Promise<any> => {
226
194
  let client = !sdk ? await sdkForProject() :
227
195
  sdk;
228
196
  let apiPath = '/health/queue/builds';
@@ -243,18 +211,14 @@ const healthGetQueueBuilds = async ({threshold,parseOutput = true, overrideForCl
243
211
  return response;
244
212
 
245
213
  }
246
- /**
247
- * @typedef {Object} HealthGetQueueCertificatesRequestParams
248
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
249
- * @property {boolean} overrideForCli
250
- * @property {boolean} parseOutput
251
- * @property {libClient | undefined} sdk
252
- */
214
+ interface HealthGetQueueCertificatesRequestParams {
215
+ threshold?: number;
216
+ overrideForCli?: boolean;
217
+ parseOutput?: boolean;
218
+ sdk?: Client;
219
+ }
253
220
 
254
- /**
255
- * @param {HealthGetQueueCertificatesRequestParams} params
256
- */
257
- const healthGetQueueCertificates = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
221
+ export const healthGetQueueCertificates = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetQueueCertificatesRequestParams): Promise<any> => {
258
222
  let client = !sdk ? await sdkForProject() :
259
223
  sdk;
260
224
  let apiPath = '/health/queue/certificates';
@@ -275,19 +239,15 @@ const healthGetQueueCertificates = async ({threshold,parseOutput = true, overrid
275
239
  return response;
276
240
 
277
241
  }
278
- /**
279
- * @typedef {Object} HealthGetQueueDatabasesRequestParams
280
- * @property {string} name Queue name for which to check the queue size
281
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
282
- * @property {boolean} overrideForCli
283
- * @property {boolean} parseOutput
284
- * @property {libClient | undefined} sdk
285
- */
242
+ interface HealthGetQueueDatabasesRequestParams {
243
+ name?: string;
244
+ threshold?: number;
245
+ overrideForCli?: boolean;
246
+ parseOutput?: boolean;
247
+ sdk?: Client;
248
+ }
286
249
 
287
- /**
288
- * @param {HealthGetQueueDatabasesRequestParams} params
289
- */
290
- const healthGetQueueDatabases = async ({name,threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
250
+ export const healthGetQueueDatabases = async ({name,threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetQueueDatabasesRequestParams): Promise<any> => {
291
251
  let client = !sdk ? await sdkForProject() :
292
252
  sdk;
293
253
  let apiPath = '/health/queue/databases';
@@ -311,18 +271,14 @@ const healthGetQueueDatabases = async ({name,threshold,parseOutput = true, overr
311
271
  return response;
312
272
 
313
273
  }
314
- /**
315
- * @typedef {Object} HealthGetQueueDeletesRequestParams
316
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
317
- * @property {boolean} overrideForCli
318
- * @property {boolean} parseOutput
319
- * @property {libClient | undefined} sdk
320
- */
274
+ interface HealthGetQueueDeletesRequestParams {
275
+ threshold?: number;
276
+ overrideForCli?: boolean;
277
+ parseOutput?: boolean;
278
+ sdk?: Client;
279
+ }
321
280
 
322
- /**
323
- * @param {HealthGetQueueDeletesRequestParams} params
324
- */
325
- const healthGetQueueDeletes = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
281
+ export const healthGetQueueDeletes = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetQueueDeletesRequestParams): Promise<any> => {
326
282
  let client = !sdk ? await sdkForProject() :
327
283
  sdk;
328
284
  let apiPath = '/health/queue/deletes';
@@ -343,19 +299,15 @@ const healthGetQueueDeletes = async ({threshold,parseOutput = true, overrideForC
343
299
  return response;
344
300
 
345
301
  }
346
- /**
347
- * @typedef {Object} HealthGetFailedJobsRequestParams
348
- * @property {Name} name The name of the queue
349
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
350
- * @property {boolean} overrideForCli
351
- * @property {boolean} parseOutput
352
- * @property {libClient | undefined} sdk
353
- */
302
+ interface HealthGetFailedJobsRequestParams {
303
+ name: Name;
304
+ threshold?: number;
305
+ overrideForCli?: boolean;
306
+ parseOutput?: boolean;
307
+ sdk?: Client;
308
+ }
354
309
 
355
- /**
356
- * @param {HealthGetFailedJobsRequestParams} params
357
- */
358
- const healthGetFailedJobs = async ({name,threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
310
+ export const healthGetFailedJobs = async ({name,threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetFailedJobsRequestParams): Promise<any> => {
359
311
  let client = !sdk ? await sdkForProject() :
360
312
  sdk;
361
313
  let apiPath = '/health/queue/failed/{name}'.replace('{name}', name);
@@ -376,18 +328,14 @@ const healthGetFailedJobs = async ({name,threshold,parseOutput = true, overrideF
376
328
  return response;
377
329
 
378
330
  }
379
- /**
380
- * @typedef {Object} HealthGetQueueFunctionsRequestParams
381
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
382
- * @property {boolean} overrideForCli
383
- * @property {boolean} parseOutput
384
- * @property {libClient | undefined} sdk
385
- */
331
+ interface HealthGetQueueFunctionsRequestParams {
332
+ threshold?: number;
333
+ overrideForCli?: boolean;
334
+ parseOutput?: boolean;
335
+ sdk?: Client;
336
+ }
386
337
 
387
- /**
388
- * @param {HealthGetQueueFunctionsRequestParams} params
389
- */
390
- const healthGetQueueFunctions = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
338
+ export const healthGetQueueFunctions = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetQueueFunctionsRequestParams): Promise<any> => {
391
339
  let client = !sdk ? await sdkForProject() :
392
340
  sdk;
393
341
  let apiPath = '/health/queue/functions';
@@ -408,18 +356,14 @@ const healthGetQueueFunctions = async ({threshold,parseOutput = true, overrideFo
408
356
  return response;
409
357
 
410
358
  }
411
- /**
412
- * @typedef {Object} HealthGetQueueLogsRequestParams
413
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
414
- * @property {boolean} overrideForCli
415
- * @property {boolean} parseOutput
416
- * @property {libClient | undefined} sdk
417
- */
359
+ interface HealthGetQueueLogsRequestParams {
360
+ threshold?: number;
361
+ overrideForCli?: boolean;
362
+ parseOutput?: boolean;
363
+ sdk?: Client;
364
+ }
418
365
 
419
- /**
420
- * @param {HealthGetQueueLogsRequestParams} params
421
- */
422
- const healthGetQueueLogs = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
366
+ export const healthGetQueueLogs = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetQueueLogsRequestParams): Promise<any> => {
423
367
  let client = !sdk ? await sdkForProject() :
424
368
  sdk;
425
369
  let apiPath = '/health/queue/logs';
@@ -440,18 +384,14 @@ const healthGetQueueLogs = async ({threshold,parseOutput = true, overrideForCli
440
384
  return response;
441
385
 
442
386
  }
443
- /**
444
- * @typedef {Object} HealthGetQueueMailsRequestParams
445
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
446
- * @property {boolean} overrideForCli
447
- * @property {boolean} parseOutput
448
- * @property {libClient | undefined} sdk
449
- */
387
+ interface HealthGetQueueMailsRequestParams {
388
+ threshold?: number;
389
+ overrideForCli?: boolean;
390
+ parseOutput?: boolean;
391
+ sdk?: Client;
392
+ }
450
393
 
451
- /**
452
- * @param {HealthGetQueueMailsRequestParams} params
453
- */
454
- const healthGetQueueMails = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
394
+ export const healthGetQueueMails = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetQueueMailsRequestParams): Promise<any> => {
455
395
  let client = !sdk ? await sdkForProject() :
456
396
  sdk;
457
397
  let apiPath = '/health/queue/mails';
@@ -472,18 +412,14 @@ const healthGetQueueMails = async ({threshold,parseOutput = true, overrideForCli
472
412
  return response;
473
413
 
474
414
  }
475
- /**
476
- * @typedef {Object} HealthGetQueueMessagingRequestParams
477
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
478
- * @property {boolean} overrideForCli
479
- * @property {boolean} parseOutput
480
- * @property {libClient | undefined} sdk
481
- */
415
+ interface HealthGetQueueMessagingRequestParams {
416
+ threshold?: number;
417
+ overrideForCli?: boolean;
418
+ parseOutput?: boolean;
419
+ sdk?: Client;
420
+ }
482
421
 
483
- /**
484
- * @param {HealthGetQueueMessagingRequestParams} params
485
- */
486
- const healthGetQueueMessaging = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
422
+ export const healthGetQueueMessaging = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetQueueMessagingRequestParams): Promise<any> => {
487
423
  let client = !sdk ? await sdkForProject() :
488
424
  sdk;
489
425
  let apiPath = '/health/queue/messaging';
@@ -504,18 +440,14 @@ const healthGetQueueMessaging = async ({threshold,parseOutput = true, overrideFo
504
440
  return response;
505
441
 
506
442
  }
507
- /**
508
- * @typedef {Object} HealthGetQueueMigrationsRequestParams
509
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
510
- * @property {boolean} overrideForCli
511
- * @property {boolean} parseOutput
512
- * @property {libClient | undefined} sdk
513
- */
443
+ interface HealthGetQueueMigrationsRequestParams {
444
+ threshold?: number;
445
+ overrideForCli?: boolean;
446
+ parseOutput?: boolean;
447
+ sdk?: Client;
448
+ }
514
449
 
515
- /**
516
- * @param {HealthGetQueueMigrationsRequestParams} params
517
- */
518
- const healthGetQueueMigrations = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
450
+ export const healthGetQueueMigrations = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetQueueMigrationsRequestParams): Promise<any> => {
519
451
  let client = !sdk ? await sdkForProject() :
520
452
  sdk;
521
453
  let apiPath = '/health/queue/migrations';
@@ -536,18 +468,14 @@ const healthGetQueueMigrations = async ({threshold,parseOutput = true, overrideF
536
468
  return response;
537
469
 
538
470
  }
539
- /**
540
- * @typedef {Object} HealthGetQueueStatsResourcesRequestParams
541
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
542
- * @property {boolean} overrideForCli
543
- * @property {boolean} parseOutput
544
- * @property {libClient | undefined} sdk
545
- */
471
+ interface HealthGetQueueStatsResourcesRequestParams {
472
+ threshold?: number;
473
+ overrideForCli?: boolean;
474
+ parseOutput?: boolean;
475
+ sdk?: Client;
476
+ }
546
477
 
547
- /**
548
- * @param {HealthGetQueueStatsResourcesRequestParams} params
549
- */
550
- const healthGetQueueStatsResources = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
478
+ export const healthGetQueueStatsResources = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetQueueStatsResourcesRequestParams): Promise<any> => {
551
479
  let client = !sdk ? await sdkForProject() :
552
480
  sdk;
553
481
  let apiPath = '/health/queue/stats-resources';
@@ -568,18 +496,14 @@ const healthGetQueueStatsResources = async ({threshold,parseOutput = true, overr
568
496
  return response;
569
497
 
570
498
  }
571
- /**
572
- * @typedef {Object} HealthGetQueueUsageRequestParams
573
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
574
- * @property {boolean} overrideForCli
575
- * @property {boolean} parseOutput
576
- * @property {libClient | undefined} sdk
577
- */
499
+ interface HealthGetQueueUsageRequestParams {
500
+ threshold?: number;
501
+ overrideForCli?: boolean;
502
+ parseOutput?: boolean;
503
+ sdk?: Client;
504
+ }
578
505
 
579
- /**
580
- * @param {HealthGetQueueUsageRequestParams} params
581
- */
582
- const healthGetQueueUsage = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
506
+ export const healthGetQueueUsage = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetQueueUsageRequestParams): Promise<any> => {
583
507
  let client = !sdk ? await sdkForProject() :
584
508
  sdk;
585
509
  let apiPath = '/health/queue/stats-usage';
@@ -600,18 +524,14 @@ const healthGetQueueUsage = async ({threshold,parseOutput = true, overrideForCli
600
524
  return response;
601
525
 
602
526
  }
603
- /**
604
- * @typedef {Object} HealthGetQueueWebhooksRequestParams
605
- * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
606
- * @property {boolean} overrideForCli
607
- * @property {boolean} parseOutput
608
- * @property {libClient | undefined} sdk
609
- */
527
+ interface HealthGetQueueWebhooksRequestParams {
528
+ threshold?: number;
529
+ overrideForCli?: boolean;
530
+ parseOutput?: boolean;
531
+ sdk?: Client;
532
+ }
610
533
 
611
- /**
612
- * @param {HealthGetQueueWebhooksRequestParams} params
613
- */
614
- const healthGetQueueWebhooks = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
534
+ export const healthGetQueueWebhooks = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetQueueWebhooksRequestParams): Promise<any> => {
615
535
  let client = !sdk ? await sdkForProject() :
616
536
  sdk;
617
537
  let apiPath = '/health/queue/webhooks';
@@ -632,17 +552,13 @@ const healthGetQueueWebhooks = async ({threshold,parseOutput = true, overrideFor
632
552
  return response;
633
553
 
634
554
  }
635
- /**
636
- * @typedef {Object} HealthGetStorageRequestParams
637
- * @property {boolean} overrideForCli
638
- * @property {boolean} parseOutput
639
- * @property {libClient | undefined} sdk
640
- */
555
+ interface HealthGetStorageRequestParams {
556
+ overrideForCli?: boolean;
557
+ parseOutput?: boolean;
558
+ sdk?: Client;
559
+ }
641
560
 
642
- /**
643
- * @param {HealthGetStorageRequestParams} params
644
- */
645
- const healthGetStorage = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
561
+ export const healthGetStorage = async ({parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetStorageRequestParams): Promise<any> => {
646
562
  let client = !sdk ? await sdkForProject() :
647
563
  sdk;
648
564
  let apiPath = '/health/storage';
@@ -660,17 +576,13 @@ const healthGetStorage = async ({parseOutput = true, overrideForCli = false, sdk
660
576
  return response;
661
577
 
662
578
  }
663
- /**
664
- * @typedef {Object} HealthGetStorageLocalRequestParams
665
- * @property {boolean} overrideForCli
666
- * @property {boolean} parseOutput
667
- * @property {libClient | undefined} sdk
668
- */
579
+ interface HealthGetStorageLocalRequestParams {
580
+ overrideForCli?: boolean;
581
+ parseOutput?: boolean;
582
+ sdk?: Client;
583
+ }
669
584
 
670
- /**
671
- * @param {HealthGetStorageLocalRequestParams} params
672
- */
673
- const healthGetStorageLocal = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
585
+ export const healthGetStorageLocal = async ({parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetStorageLocalRequestParams): Promise<any> => {
674
586
  let client = !sdk ? await sdkForProject() :
675
587
  sdk;
676
588
  let apiPath = '/health/storage/local';
@@ -688,17 +600,13 @@ const healthGetStorageLocal = async ({parseOutput = true, overrideForCli = false
688
600
  return response;
689
601
 
690
602
  }
691
- /**
692
- * @typedef {Object} HealthGetTimeRequestParams
693
- * @property {boolean} overrideForCli
694
- * @property {boolean} parseOutput
695
- * @property {libClient | undefined} sdk
696
- */
603
+ interface HealthGetTimeRequestParams {
604
+ overrideForCli?: boolean;
605
+ parseOutput?: boolean;
606
+ sdk?: Client;
607
+ }
697
608
 
698
- /**
699
- * @param {HealthGetTimeRequestParams} params
700
- */
701
- const healthGetTime = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
609
+ export const healthGetTime = async ({parseOutput = true, overrideForCli = false, sdk = undefined}: HealthGetTimeRequestParams): Promise<any> => {
702
610
  let client = !sdk ? await sdkForProject() :
703
611
  sdk;
704
612
  let apiPath = '/health/time';
@@ -842,28 +750,4 @@ health
842
750
  .description(`Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.`)
843
751
  .action(actionRunner(healthGetTime))
844
752
 
845
- module.exports = {
846
- health,
847
- healthGet,
848
- healthGetAntivirus,
849
- healthGetCache,
850
- healthGetCertificate,
851
- healthGetDB,
852
- healthGetPubSub,
853
- healthGetQueueBuilds,
854
- healthGetQueueCertificates,
855
- healthGetQueueDatabases,
856
- healthGetQueueDeletes,
857
- healthGetFailedJobs,
858
- healthGetQueueFunctions,
859
- healthGetQueueLogs,
860
- healthGetQueueMails,
861
- healthGetQueueMessaging,
862
- healthGetQueueMigrations,
863
- healthGetQueueStatsResources,
864
- healthGetQueueUsage,
865
- healthGetQueueWebhooks,
866
- healthGetStorage,
867
- healthGetStorageLocal,
868
- healthGetTime
869
- };
753
+