node-appwrite 12.0.0 → 12.1.0-rc.4

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 (296) hide show
  1. package/.travis.yml +18 -8
  2. package/dist/client.d.mts +131 -0
  3. package/dist/client.d.ts +131 -0
  4. package/dist/client.js +302 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/client.mjs +295 -0
  7. package/dist/client.mjs.map +1 -0
  8. package/dist/enums/authentication-factor.d.mts +8 -0
  9. package/dist/enums/authentication-factor.d.ts +8 -0
  10. package/dist/enums/authentication-factor.js +13 -0
  11. package/dist/enums/authentication-factor.js.map +1 -0
  12. package/dist/enums/authentication-factor.mjs +11 -0
  13. package/dist/enums/authentication-factor.mjs.map +1 -0
  14. package/dist/enums/authenticator-type.d.mts +5 -0
  15. package/dist/enums/authenticator-type.d.ts +5 -0
  16. package/dist/enums/authenticator-type.js +10 -0
  17. package/dist/enums/authenticator-type.js.map +1 -0
  18. package/dist/enums/authenticator-type.mjs +8 -0
  19. package/dist/enums/authenticator-type.mjs.map +1 -0
  20. package/dist/enums/browser.d.mts +18 -0
  21. package/dist/enums/browser.d.ts +18 -0
  22. package/dist/enums/browser.js +23 -0
  23. package/dist/enums/browser.js.map +1 -0
  24. package/dist/enums/browser.mjs +21 -0
  25. package/dist/enums/browser.mjs.map +1 -0
  26. package/dist/enums/compression.d.mts +7 -0
  27. package/dist/enums/compression.d.ts +7 -0
  28. package/dist/enums/compression.js +12 -0
  29. package/dist/enums/compression.js.map +1 -0
  30. package/dist/enums/compression.mjs +10 -0
  31. package/dist/enums/compression.mjs.map +1 -0
  32. package/dist/enums/credit-card.d.mts +20 -0
  33. package/dist/enums/credit-card.d.ts +20 -0
  34. package/dist/enums/credit-card.js +25 -0
  35. package/dist/enums/credit-card.js.map +1 -0
  36. package/dist/enums/credit-card.mjs +23 -0
  37. package/dist/enums/credit-card.mjs.map +1 -0
  38. package/dist/enums/execution-method.d.mts +10 -0
  39. package/dist/enums/execution-method.d.ts +10 -0
  40. package/dist/enums/execution-method.js +15 -0
  41. package/dist/enums/execution-method.js.map +1 -0
  42. package/dist/enums/execution-method.mjs +13 -0
  43. package/dist/enums/execution-method.mjs.map +1 -0
  44. package/dist/enums/flag.d.mts +198 -0
  45. package/dist/enums/flag.d.ts +198 -0
  46. package/dist/enums/flag.js +203 -0
  47. package/dist/enums/flag.js.map +1 -0
  48. package/dist/enums/flag.mjs +201 -0
  49. package/dist/enums/flag.mjs.map +1 -0
  50. package/dist/enums/image-format.d.mts +9 -0
  51. package/dist/enums/image-format.d.ts +9 -0
  52. package/dist/enums/image-format.js +14 -0
  53. package/dist/enums/image-format.js.map +1 -0
  54. package/dist/enums/image-format.mjs +12 -0
  55. package/dist/enums/image-format.mjs.map +1 -0
  56. package/dist/enums/image-gravity.d.mts +13 -0
  57. package/dist/enums/image-gravity.d.ts +13 -0
  58. package/dist/enums/image-gravity.js +18 -0
  59. package/dist/enums/image-gravity.js.map +1 -0
  60. package/dist/enums/image-gravity.mjs +16 -0
  61. package/dist/enums/image-gravity.mjs.map +1 -0
  62. package/dist/enums/index-type.d.mts +7 -0
  63. package/dist/enums/index-type.d.ts +7 -0
  64. package/dist/enums/index-type.js +12 -0
  65. package/dist/enums/index-type.js.map +1 -0
  66. package/dist/enums/index-type.mjs +10 -0
  67. package/dist/enums/index-type.mjs.map +1 -0
  68. package/dist/enums/messaging-provider-type.d.mts +7 -0
  69. package/dist/enums/messaging-provider-type.d.ts +7 -0
  70. package/dist/enums/messaging-provider-type.js +12 -0
  71. package/dist/enums/messaging-provider-type.js.map +1 -0
  72. package/dist/enums/messaging-provider-type.mjs +10 -0
  73. package/dist/enums/messaging-provider-type.mjs.map +1 -0
  74. package/dist/enums/name.d.mts +17 -0
  75. package/dist/enums/name.d.ts +17 -0
  76. package/dist/enums/name.js +22 -0
  77. package/dist/enums/name.js.map +1 -0
  78. package/dist/enums/name.mjs +20 -0
  79. package/dist/enums/name.mjs.map +1 -0
  80. package/dist/enums/o-auth-provider.d.mts +43 -0
  81. package/dist/enums/o-auth-provider.d.ts +43 -0
  82. package/dist/enums/o-auth-provider.js +48 -0
  83. package/dist/enums/o-auth-provider.js.map +1 -0
  84. package/dist/enums/o-auth-provider.mjs +46 -0
  85. package/dist/enums/o-auth-provider.mjs.map +1 -0
  86. package/dist/enums/password-hash.d.mts +15 -0
  87. package/dist/enums/password-hash.d.ts +15 -0
  88. package/dist/enums/password-hash.js +20 -0
  89. package/dist/enums/password-hash.js.map +1 -0
  90. package/dist/enums/password-hash.mjs +18 -0
  91. package/dist/enums/password-hash.mjs.map +1 -0
  92. package/dist/enums/relation-mutate.d.mts +7 -0
  93. package/dist/enums/relation-mutate.d.ts +7 -0
  94. package/dist/enums/relation-mutate.js +12 -0
  95. package/dist/enums/relation-mutate.js.map +1 -0
  96. package/dist/enums/relation-mutate.mjs +10 -0
  97. package/dist/enums/relation-mutate.mjs.map +1 -0
  98. package/dist/enums/relationship-type.d.mts +8 -0
  99. package/dist/enums/relationship-type.d.ts +8 -0
  100. package/dist/enums/relationship-type.js +13 -0
  101. package/dist/enums/relationship-type.js.map +1 -0
  102. package/dist/enums/relationship-type.mjs +11 -0
  103. package/dist/enums/relationship-type.mjs.map +1 -0
  104. package/dist/enums/runtime.d.mts +48 -0
  105. package/dist/enums/runtime.d.ts +48 -0
  106. package/dist/enums/runtime.js +53 -0
  107. package/dist/enums/runtime.js.map +1 -0
  108. package/dist/enums/runtime.mjs +51 -0
  109. package/dist/enums/runtime.mjs.map +1 -0
  110. package/dist/enums/smtp-encryption.d.mts +7 -0
  111. package/dist/enums/smtp-encryption.d.ts +7 -0
  112. package/dist/enums/smtp-encryption.js +12 -0
  113. package/dist/enums/smtp-encryption.js.map +1 -0
  114. package/dist/enums/smtp-encryption.mjs +10 -0
  115. package/dist/enums/smtp-encryption.mjs.map +1 -0
  116. package/dist/id.d.mts +7 -0
  117. package/dist/id.d.ts +7 -0
  118. package/dist/id.js +29 -0
  119. package/dist/id.js.map +1 -0
  120. package/dist/id.mjs +27 -0
  121. package/dist/id.mjs.map +1 -0
  122. package/dist/index.d.mts +35 -0
  123. package/dist/index.d.ts +35 -0
  124. package/dist/index.js +180 -0
  125. package/dist/index.js.map +1 -0
  126. package/dist/index.mjs +35 -0
  127. package/dist/index.mjs.map +1 -0
  128. package/dist/inputFile.d.mts +9 -0
  129. package/dist/inputFile.d.ts +9 -0
  130. package/dist/inputFile.js +23 -0
  131. package/dist/inputFile.js.map +1 -0
  132. package/dist/inputFile.mjs +21 -0
  133. package/dist/inputFile.mjs.map +1 -0
  134. package/dist/models.d.mts +2406 -0
  135. package/dist/models.d.ts +2406 -0
  136. package/dist/models.js +4 -0
  137. package/dist/models.js.map +1 -0
  138. package/dist/models.mjs +3 -0
  139. package/dist/models.mjs.map +1 -0
  140. package/dist/permission.d.mts +9 -0
  141. package/dist/permission.d.ts +9 -0
  142. package/dist/permission.js +23 -0
  143. package/dist/permission.js.map +1 -0
  144. package/dist/permission.mjs +21 -0
  145. package/dist/permission.mjs.map +1 -0
  146. package/dist/query.d.mts +35 -0
  147. package/dist/query.d.ts +35 -0
  148. package/dist/query.js +49 -0
  149. package/dist/query.js.map +1 -0
  150. package/dist/query.mjs +47 -0
  151. package/dist/query.mjs.map +1 -0
  152. package/dist/role.d.mts +72 -0
  153. package/dist/role.d.ts +72 -0
  154. package/dist/role.js +96 -0
  155. package/dist/role.js.map +1 -0
  156. package/dist/role.mjs +94 -0
  157. package/dist/role.mjs.map +1 -0
  158. package/dist/services/account.d.mts +478 -0
  159. package/dist/services/account.d.ts +478 -0
  160. package/dist/services/account.js +1331 -0
  161. package/dist/services/account.js.map +1 -0
  162. package/dist/services/account.mjs +1329 -0
  163. package/dist/services/account.mjs.map +1 -0
  164. package/dist/services/avatars.d.mts +118 -0
  165. package/dist/services/avatars.d.ts +118 -0
  166. package/dist/services/avatars.js +297 -0
  167. package/dist/services/avatars.js.map +1 -0
  168. package/dist/services/avatars.mjs +295 -0
  169. package/dist/services/avatars.mjs.map +1 -0
  170. package/dist/services/databases.d.mts +606 -0
  171. package/dist/services/databases.d.ts +606 -0
  172. package/dist/services/databases.js +1908 -0
  173. package/dist/services/databases.js.map +1 -0
  174. package/dist/services/databases.mjs +1906 -0
  175. package/dist/services/databases.mjs.map +1 -0
  176. package/dist/services/functions.d.mts +287 -0
  177. package/dist/services/functions.d.ts +287 -0
  178. package/dist/services/functions.js +837 -0
  179. package/dist/services/functions.js.map +1 -0
  180. package/dist/services/functions.mjs +835 -0
  181. package/dist/services/functions.mjs.map +1 -0
  182. package/dist/services/graphql.d.mts +30 -0
  183. package/dist/services/graphql.d.ts +30 -0
  184. package/dist/services/graphql.js +73 -0
  185. package/dist/services/graphql.js.map +1 -0
  186. package/dist/services/graphql.mjs +71 -0
  187. package/dist/services/graphql.mjs.map +1 -0
  188. package/dist/services/health.d.mts +235 -0
  189. package/dist/services/health.d.ts +235 -0
  190. package/dist/services/health.js +584 -0
  191. package/dist/services/health.js.map +1 -0
  192. package/dist/services/health.mjs +582 -0
  193. package/dist/services/health.mjs.map +1 -0
  194. package/dist/services/locale.d.mts +84 -0
  195. package/dist/services/locale.d.ts +84 -0
  196. package/dist/services/locale.js +189 -0
  197. package/dist/services/locale.js.map +1 -0
  198. package/dist/services/locale.mjs +187 -0
  199. package/dist/services/locale.mjs.map +1 -0
  200. package/dist/services/messaging.d.mts +688 -0
  201. package/dist/services/messaging.d.ts +688 -0
  202. package/dist/services/messaging.js +2152 -0
  203. package/dist/services/messaging.js.map +1 -0
  204. package/dist/services/messaging.mjs +2150 -0
  205. package/dist/services/messaging.mjs.map +1 -0
  206. package/dist/services/storage.d.mts +193 -0
  207. package/dist/services/storage.d.ts +193 -0
  208. package/dist/services/storage.js +550 -0
  209. package/dist/services/storage.js.map +1 -0
  210. package/dist/services/storage.mjs +548 -0
  211. package/dist/services/storage.mjs.map +1 -0
  212. package/dist/services/teams.d.mts +171 -0
  213. package/dist/services/teams.d.ts +171 -0
  214. package/dist/services/teams.js +466 -0
  215. package/dist/services/teams.js.map +1 -0
  216. package/dist/services/teams.mjs +464 -0
  217. package/dist/services/teams.mjs.map +1 -0
  218. package/dist/services/users.d.mts +490 -0
  219. package/dist/services/users.d.ts +490 -0
  220. package/dist/services/users.js +1464 -0
  221. package/dist/services/users.js.map +1 -0
  222. package/dist/services/users.mjs +1462 -0
  223. package/dist/services/users.mjs.map +1 -0
  224. package/docs/examples/functions/create-deployment.md +1 -1
  225. package/docs/examples/storage/create-file.md +1 -1
  226. package/package.json +35 -5
  227. package/src/client.ts +366 -0
  228. package/src/enums/authentication-factor.ts +6 -0
  229. package/src/enums/authenticator-type.ts +3 -0
  230. package/src/enums/browser.ts +16 -0
  231. package/src/enums/compression.ts +5 -0
  232. package/src/enums/credit-card.ts +18 -0
  233. package/src/enums/execution-method.ts +8 -0
  234. package/src/enums/flag.ts +196 -0
  235. package/src/enums/image-format.ts +7 -0
  236. package/src/enums/image-gravity.ts +11 -0
  237. package/src/enums/index-type.ts +5 -0
  238. package/src/enums/messaging-provider-type.ts +5 -0
  239. package/src/enums/name.ts +15 -0
  240. package/src/enums/o-auth-provider.ts +41 -0
  241. package/src/enums/password-hash.ts +13 -0
  242. package/src/enums/relation-mutate.ts +5 -0
  243. package/src/enums/relationship-type.ts +6 -0
  244. package/src/enums/runtime.ts +46 -0
  245. package/src/enums/smtp-encryption.ts +5 -0
  246. package/src/id.ts +28 -0
  247. package/src/index.ts +35 -0
  248. package/src/inputFile.ts +23 -0
  249. package/src/models.ts +2404 -0
  250. package/src/permission.ts +22 -0
  251. package/src/query.ts +101 -0
  252. package/{lib/role.js → src/role.ts} +23 -25
  253. package/src/services/account.ts +1418 -0
  254. package/src/services/avatars.ts +312 -0
  255. package/{lib/services/databases.js → src/services/databases.ts} +644 -638
  256. package/{lib/services/functions.js → src/services/functions.ts} +317 -369
  257. package/{lib/services/graphql.js → src/services/graphql.ts} +35 -34
  258. package/src/services/health.ts +629 -0
  259. package/src/services/locale.ts +205 -0
  260. package/{lib/services/messaging.js → src/services/messaging.ts} +658 -633
  261. package/{lib/services/storage.js → src/services/storage.ts} +211 -298
  262. package/{lib/services/teams.js → src/services/teams.ts} +211 -200
  263. package/{lib/services/users.js → src/services/users.ts} +603 -519
  264. package/tsconfig.json +18 -0
  265. package/tsup.config.js +19 -0
  266. package/index.d.ts +0 -6656
  267. package/index.js +0 -75
  268. package/lib/client.js +0 -245
  269. package/lib/enums/authentication-factor.js +0 -8
  270. package/lib/enums/authenticator-type.js +0 -5
  271. package/lib/enums/browser.js +0 -18
  272. package/lib/enums/compression.js +0 -7
  273. package/lib/enums/credit-card.js +0 -20
  274. package/lib/enums/execution-method.js +0 -10
  275. package/lib/enums/flag.js +0 -198
  276. package/lib/enums/image-format.js +0 -9
  277. package/lib/enums/image-gravity.js +0 -13
  278. package/lib/enums/index-type.js +0 -7
  279. package/lib/enums/messaging-provider-type.js +0 -7
  280. package/lib/enums/name.js +0 -17
  281. package/lib/enums/o-auth-provider.js +0 -43
  282. package/lib/enums/password-hash.js +0 -15
  283. package/lib/enums/relation-mutate.js +0 -7
  284. package/lib/enums/relationship-type.js +0 -8
  285. package/lib/enums/runtime.js +0 -48
  286. package/lib/enums/smtp-encryption.js +0 -7
  287. package/lib/exception.js +0 -10
  288. package/lib/id.js +0 -12
  289. package/lib/inputFile.js +0 -117
  290. package/lib/permission.js +0 -24
  291. package/lib/query.js +0 -90
  292. package/lib/service.js +0 -10
  293. package/lib/services/account.js +0 -1365
  294. package/lib/services/avatars.js +0 -325
  295. package/lib/services/health.js +0 -513
  296. package/lib/services/locale.js +0 -169
@@ -0,0 +1,629 @@
1
+ import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
2
+ import type { Models } from '../models';
3
+ import { Name } from '../enums/name';
4
+
5
+ export class Health {
6
+ client: Client;
7
+
8
+ constructor(client: Client) {
9
+ this.client = client;
10
+ }
11
+
12
+ /**
13
+ * Get HTTP
14
+ *
15
+ * Check the Appwrite HTTP server is up and responsive.
16
+ *
17
+ * @throws {AppwriteException}
18
+ * @returns {Promise<Models.HealthStatus>}
19
+ */
20
+ async get(): Promise<Models.HealthStatus> {
21
+ const apiPath = '/health';
22
+ const payload: Payload = {};
23
+ const uri = new URL(this.client.config.endpoint + apiPath);
24
+
25
+ const apiHeaders: { [header: string]: string } = {
26
+ 'content-type': 'application/json',
27
+ }
28
+
29
+ return await this.client.call(
30
+ 'get',
31
+ uri,
32
+ apiHeaders,
33
+ payload,
34
+ );
35
+ }
36
+ /**
37
+ * Get antivirus
38
+ *
39
+ * Check the Appwrite Antivirus server is up and connection is successful.
40
+ *
41
+ * @throws {AppwriteException}
42
+ * @returns {Promise<Models.HealthAntivirus>}
43
+ */
44
+ async getAntivirus(): Promise<Models.HealthAntivirus> {
45
+ const apiPath = '/health/anti-virus';
46
+ const payload: Payload = {};
47
+ const uri = new URL(this.client.config.endpoint + apiPath);
48
+
49
+ const apiHeaders: { [header: string]: string } = {
50
+ 'content-type': 'application/json',
51
+ }
52
+
53
+ return await this.client.call(
54
+ 'get',
55
+ uri,
56
+ apiHeaders,
57
+ payload,
58
+ );
59
+ }
60
+ /**
61
+ * Get cache
62
+ *
63
+ * Check the Appwrite in-memory cache servers are up and connection is successful.
64
+ *
65
+ * @throws {AppwriteException}
66
+ * @returns {Promise<Models.HealthStatus>}
67
+ */
68
+ async getCache(): Promise<Models.HealthStatus> {
69
+ const apiPath = '/health/cache';
70
+ const payload: Payload = {};
71
+ const uri = new URL(this.client.config.endpoint + apiPath);
72
+
73
+ const apiHeaders: { [header: string]: string } = {
74
+ 'content-type': 'application/json',
75
+ }
76
+
77
+ return await this.client.call(
78
+ 'get',
79
+ uri,
80
+ apiHeaders,
81
+ payload,
82
+ );
83
+ }
84
+ /**
85
+ * Get the SSL certificate for a domain
86
+ *
87
+ * Get the SSL certificate for a domain
88
+ *
89
+ * @param {string} domain
90
+ * @throws {AppwriteException}
91
+ * @returns {Promise<Models.HealthCertificate>}
92
+ */
93
+ async getCertificate(domain?: string): Promise<Models.HealthCertificate> {
94
+ const apiPath = '/health/certificate';
95
+ const payload: Payload = {};
96
+ if (typeof domain !== 'undefined') {
97
+ payload['domain'] = domain;
98
+ }
99
+ const uri = new URL(this.client.config.endpoint + apiPath);
100
+
101
+ const apiHeaders: { [header: string]: string } = {
102
+ 'content-type': 'application/json',
103
+ }
104
+
105
+ return await this.client.call(
106
+ 'get',
107
+ uri,
108
+ apiHeaders,
109
+ payload,
110
+ );
111
+ }
112
+ /**
113
+ * Get DB
114
+ *
115
+ * Check the Appwrite database servers are up and connection is successful.
116
+ *
117
+ * @throws {AppwriteException}
118
+ * @returns {Promise<Models.HealthStatus>}
119
+ */
120
+ async getDB(): Promise<Models.HealthStatus> {
121
+ const apiPath = '/health/db';
122
+ const payload: Payload = {};
123
+ const uri = new URL(this.client.config.endpoint + apiPath);
124
+
125
+ const apiHeaders: { [header: string]: string } = {
126
+ 'content-type': 'application/json',
127
+ }
128
+
129
+ return await this.client.call(
130
+ 'get',
131
+ uri,
132
+ apiHeaders,
133
+ payload,
134
+ );
135
+ }
136
+ /**
137
+ * Get pubsub
138
+ *
139
+ * Check the Appwrite pub-sub servers are up and connection is successful.
140
+ *
141
+ * @throws {AppwriteException}
142
+ * @returns {Promise<Models.HealthStatus>}
143
+ */
144
+ async getPubSub(): Promise<Models.HealthStatus> {
145
+ const apiPath = '/health/pubsub';
146
+ const payload: Payload = {};
147
+ const uri = new URL(this.client.config.endpoint + apiPath);
148
+
149
+ const apiHeaders: { [header: string]: string } = {
150
+ 'content-type': 'application/json',
151
+ }
152
+
153
+ return await this.client.call(
154
+ 'get',
155
+ uri,
156
+ apiHeaders,
157
+ payload,
158
+ );
159
+ }
160
+ /**
161
+ * Get queue
162
+ *
163
+ * Check the Appwrite queue messaging servers are up and connection is successful.
164
+ *
165
+ * @throws {AppwriteException}
166
+ * @returns {Promise<Models.HealthStatus>}
167
+ */
168
+ async getQueue(): Promise<Models.HealthStatus> {
169
+ const apiPath = '/health/queue';
170
+ const payload: Payload = {};
171
+ const uri = new URL(this.client.config.endpoint + apiPath);
172
+
173
+ const apiHeaders: { [header: string]: string } = {
174
+ 'content-type': 'application/json',
175
+ }
176
+
177
+ return await this.client.call(
178
+ 'get',
179
+ uri,
180
+ apiHeaders,
181
+ payload,
182
+ );
183
+ }
184
+ /**
185
+ * Get builds queue
186
+ *
187
+ * Get the number of builds that are waiting to be processed in the Appwrite internal queue server.
188
+ *
189
+ * @param {number} threshold
190
+ * @throws {AppwriteException}
191
+ * @returns {Promise<Models.HealthQueue>}
192
+ */
193
+ async getQueueBuilds(threshold?: number): Promise<Models.HealthQueue> {
194
+ const apiPath = '/health/queue/builds';
195
+ const payload: Payload = {};
196
+ if (typeof threshold !== 'undefined') {
197
+ payload['threshold'] = threshold;
198
+ }
199
+ const uri = new URL(this.client.config.endpoint + apiPath);
200
+
201
+ const apiHeaders: { [header: string]: string } = {
202
+ 'content-type': 'application/json',
203
+ }
204
+
205
+ return await this.client.call(
206
+ 'get',
207
+ uri,
208
+ apiHeaders,
209
+ payload,
210
+ );
211
+ }
212
+ /**
213
+ * Get certificates queue
214
+ *
215
+ * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.
216
+ *
217
+ * @param {number} threshold
218
+ * @throws {AppwriteException}
219
+ * @returns {Promise<Models.HealthQueue>}
220
+ */
221
+ async getQueueCertificates(threshold?: number): Promise<Models.HealthQueue> {
222
+ const apiPath = '/health/queue/certificates';
223
+ const payload: Payload = {};
224
+ if (typeof threshold !== 'undefined') {
225
+ payload['threshold'] = threshold;
226
+ }
227
+ const uri = new URL(this.client.config.endpoint + apiPath);
228
+
229
+ const apiHeaders: { [header: string]: string } = {
230
+ 'content-type': 'application/json',
231
+ }
232
+
233
+ return await this.client.call(
234
+ 'get',
235
+ uri,
236
+ apiHeaders,
237
+ payload,
238
+ );
239
+ }
240
+ /**
241
+ * Get databases queue
242
+ *
243
+ * Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.
244
+ *
245
+ * @param {string} name
246
+ * @param {number} threshold
247
+ * @throws {AppwriteException}
248
+ * @returns {Promise<Models.HealthQueue>}
249
+ */
250
+ async getQueueDatabases(name?: string, threshold?: number): Promise<Models.HealthQueue> {
251
+ const apiPath = '/health/queue/databases';
252
+ const payload: Payload = {};
253
+ if (typeof name !== 'undefined') {
254
+ payload['name'] = name;
255
+ }
256
+ if (typeof threshold !== 'undefined') {
257
+ payload['threshold'] = threshold;
258
+ }
259
+ const uri = new URL(this.client.config.endpoint + apiPath);
260
+
261
+ const apiHeaders: { [header: string]: string } = {
262
+ 'content-type': 'application/json',
263
+ }
264
+
265
+ return await this.client.call(
266
+ 'get',
267
+ uri,
268
+ apiHeaders,
269
+ payload,
270
+ );
271
+ }
272
+ /**
273
+ * Get deletes queue
274
+ *
275
+ * Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.
276
+ *
277
+ * @param {number} threshold
278
+ * @throws {AppwriteException}
279
+ * @returns {Promise<Models.HealthQueue>}
280
+ */
281
+ async getQueueDeletes(threshold?: number): Promise<Models.HealthQueue> {
282
+ const apiPath = '/health/queue/deletes';
283
+ const payload: Payload = {};
284
+ if (typeof threshold !== 'undefined') {
285
+ payload['threshold'] = threshold;
286
+ }
287
+ const uri = new URL(this.client.config.endpoint + apiPath);
288
+
289
+ const apiHeaders: { [header: string]: string } = {
290
+ 'content-type': 'application/json',
291
+ }
292
+
293
+ return await this.client.call(
294
+ 'get',
295
+ uri,
296
+ apiHeaders,
297
+ payload,
298
+ );
299
+ }
300
+ /**
301
+ * Get number of failed queue jobs
302
+ *
303
+ * Returns the amount of failed jobs in a given queue.
304
+
305
+ *
306
+ * @param {Name} name
307
+ * @param {number} threshold
308
+ * @throws {AppwriteException}
309
+ * @returns {Promise<Models.HealthQueue>}
310
+ */
311
+ async getFailedJobs(name: Name, threshold?: number): Promise<Models.HealthQueue> {
312
+ if (typeof name === 'undefined') {
313
+ throw new AppwriteException('Missing required parameter: "name"');
314
+ }
315
+ const apiPath = '/health/queue/failed/{name}'.replace('{name}', name);
316
+ const payload: Payload = {};
317
+ if (typeof threshold !== 'undefined') {
318
+ payload['threshold'] = threshold;
319
+ }
320
+ const uri = new URL(this.client.config.endpoint + apiPath);
321
+
322
+ const apiHeaders: { [header: string]: string } = {
323
+ 'content-type': 'application/json',
324
+ }
325
+
326
+ return await this.client.call(
327
+ 'get',
328
+ uri,
329
+ apiHeaders,
330
+ payload,
331
+ );
332
+ }
333
+ /**
334
+ * Get functions queue
335
+ *
336
+ * Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.
337
+ *
338
+ * @param {number} threshold
339
+ * @throws {AppwriteException}
340
+ * @returns {Promise<Models.HealthQueue>}
341
+ */
342
+ async getQueueFunctions(threshold?: number): Promise<Models.HealthQueue> {
343
+ const apiPath = '/health/queue/functions';
344
+ const payload: Payload = {};
345
+ if (typeof threshold !== 'undefined') {
346
+ payload['threshold'] = threshold;
347
+ }
348
+ const uri = new URL(this.client.config.endpoint + apiPath);
349
+
350
+ const apiHeaders: { [header: string]: string } = {
351
+ 'content-type': 'application/json',
352
+ }
353
+
354
+ return await this.client.call(
355
+ 'get',
356
+ uri,
357
+ apiHeaders,
358
+ payload,
359
+ );
360
+ }
361
+ /**
362
+ * Get logs queue
363
+ *
364
+ * Get the number of logs that are waiting to be processed in the Appwrite internal queue server.
365
+ *
366
+ * @param {number} threshold
367
+ * @throws {AppwriteException}
368
+ * @returns {Promise<Models.HealthQueue>}
369
+ */
370
+ async getQueueLogs(threshold?: number): Promise<Models.HealthQueue> {
371
+ const apiPath = '/health/queue/logs';
372
+ const payload: Payload = {};
373
+ if (typeof threshold !== 'undefined') {
374
+ payload['threshold'] = threshold;
375
+ }
376
+ const uri = new URL(this.client.config.endpoint + apiPath);
377
+
378
+ const apiHeaders: { [header: string]: string } = {
379
+ 'content-type': 'application/json',
380
+ }
381
+
382
+ return await this.client.call(
383
+ 'get',
384
+ uri,
385
+ apiHeaders,
386
+ payload,
387
+ );
388
+ }
389
+ /**
390
+ * Get mails queue
391
+ *
392
+ * Get the number of mails that are waiting to be processed in the Appwrite internal queue server.
393
+ *
394
+ * @param {number} threshold
395
+ * @throws {AppwriteException}
396
+ * @returns {Promise<Models.HealthQueue>}
397
+ */
398
+ async getQueueMails(threshold?: number): Promise<Models.HealthQueue> {
399
+ const apiPath = '/health/queue/mails';
400
+ const payload: Payload = {};
401
+ if (typeof threshold !== 'undefined') {
402
+ payload['threshold'] = threshold;
403
+ }
404
+ const uri = new URL(this.client.config.endpoint + apiPath);
405
+
406
+ const apiHeaders: { [header: string]: string } = {
407
+ 'content-type': 'application/json',
408
+ }
409
+
410
+ return await this.client.call(
411
+ 'get',
412
+ uri,
413
+ apiHeaders,
414
+ payload,
415
+ );
416
+ }
417
+ /**
418
+ * Get messaging queue
419
+ *
420
+ * Get the number of messages that are waiting to be processed in the Appwrite internal queue server.
421
+ *
422
+ * @param {number} threshold
423
+ * @throws {AppwriteException}
424
+ * @returns {Promise<Models.HealthQueue>}
425
+ */
426
+ async getQueueMessaging(threshold?: number): Promise<Models.HealthQueue> {
427
+ const apiPath = '/health/queue/messaging';
428
+ const payload: Payload = {};
429
+ if (typeof threshold !== 'undefined') {
430
+ payload['threshold'] = threshold;
431
+ }
432
+ const uri = new URL(this.client.config.endpoint + apiPath);
433
+
434
+ const apiHeaders: { [header: string]: string } = {
435
+ 'content-type': 'application/json',
436
+ }
437
+
438
+ return await this.client.call(
439
+ 'get',
440
+ uri,
441
+ apiHeaders,
442
+ payload,
443
+ );
444
+ }
445
+ /**
446
+ * Get migrations queue
447
+ *
448
+ * Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.
449
+ *
450
+ * @param {number} threshold
451
+ * @throws {AppwriteException}
452
+ * @returns {Promise<Models.HealthQueue>}
453
+ */
454
+ async getQueueMigrations(threshold?: number): Promise<Models.HealthQueue> {
455
+ const apiPath = '/health/queue/migrations';
456
+ const payload: Payload = {};
457
+ if (typeof threshold !== 'undefined') {
458
+ payload['threshold'] = threshold;
459
+ }
460
+ const uri = new URL(this.client.config.endpoint + apiPath);
461
+
462
+ const apiHeaders: { [header: string]: string } = {
463
+ 'content-type': 'application/json',
464
+ }
465
+
466
+ return await this.client.call(
467
+ 'get',
468
+ uri,
469
+ apiHeaders,
470
+ payload,
471
+ );
472
+ }
473
+ /**
474
+ * Get usage queue
475
+ *
476
+ * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.
477
+ *
478
+ * @param {number} threshold
479
+ * @throws {AppwriteException}
480
+ * @returns {Promise<Models.HealthQueue>}
481
+ */
482
+ async getQueueUsage(threshold?: number): Promise<Models.HealthQueue> {
483
+ const apiPath = '/health/queue/usage';
484
+ const payload: Payload = {};
485
+ if (typeof threshold !== 'undefined') {
486
+ payload['threshold'] = threshold;
487
+ }
488
+ const uri = new URL(this.client.config.endpoint + apiPath);
489
+
490
+ const apiHeaders: { [header: string]: string } = {
491
+ 'content-type': 'application/json',
492
+ }
493
+
494
+ return await this.client.call(
495
+ 'get',
496
+ uri,
497
+ apiHeaders,
498
+ payload,
499
+ );
500
+ }
501
+ /**
502
+ * Get usage dump queue
503
+ *
504
+ * Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server.
505
+ *
506
+ * @param {number} threshold
507
+ * @throws {AppwriteException}
508
+ * @returns {Promise<Models.HealthQueue>}
509
+ */
510
+ async getQueueUsageDump(threshold?: number): Promise<Models.HealthQueue> {
511
+ const apiPath = '/health/queue/usage-dump';
512
+ const payload: Payload = {};
513
+ if (typeof threshold !== 'undefined') {
514
+ payload['threshold'] = threshold;
515
+ }
516
+ const uri = new URL(this.client.config.endpoint + apiPath);
517
+
518
+ const apiHeaders: { [header: string]: string } = {
519
+ 'content-type': 'application/json',
520
+ }
521
+
522
+ return await this.client.call(
523
+ 'get',
524
+ uri,
525
+ apiHeaders,
526
+ payload,
527
+ );
528
+ }
529
+ /**
530
+ * Get webhooks queue
531
+ *
532
+ * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.
533
+ *
534
+ * @param {number} threshold
535
+ * @throws {AppwriteException}
536
+ * @returns {Promise<Models.HealthQueue>}
537
+ */
538
+ async getQueueWebhooks(threshold?: number): Promise<Models.HealthQueue> {
539
+ const apiPath = '/health/queue/webhooks';
540
+ const payload: Payload = {};
541
+ if (typeof threshold !== 'undefined') {
542
+ payload['threshold'] = threshold;
543
+ }
544
+ const uri = new URL(this.client.config.endpoint + apiPath);
545
+
546
+ const apiHeaders: { [header: string]: string } = {
547
+ 'content-type': 'application/json',
548
+ }
549
+
550
+ return await this.client.call(
551
+ 'get',
552
+ uri,
553
+ apiHeaders,
554
+ payload,
555
+ );
556
+ }
557
+ /**
558
+ * Get storage
559
+ *
560
+ * Check the Appwrite storage device is up and connection is successful.
561
+ *
562
+ * @throws {AppwriteException}
563
+ * @returns {Promise<Models.HealthStatus>}
564
+ */
565
+ async getStorage(): Promise<Models.HealthStatus> {
566
+ const apiPath = '/health/storage';
567
+ const payload: Payload = {};
568
+ const uri = new URL(this.client.config.endpoint + apiPath);
569
+
570
+ const apiHeaders: { [header: string]: string } = {
571
+ 'content-type': 'application/json',
572
+ }
573
+
574
+ return await this.client.call(
575
+ 'get',
576
+ uri,
577
+ apiHeaders,
578
+ payload,
579
+ );
580
+ }
581
+ /**
582
+ * Get local storage
583
+ *
584
+ * Check the Appwrite local storage device is up and connection is successful.
585
+ *
586
+ * @throws {AppwriteException}
587
+ * @returns {Promise<Models.HealthStatus>}
588
+ */
589
+ async getStorageLocal(): Promise<Models.HealthStatus> {
590
+ const apiPath = '/health/storage/local';
591
+ const payload: Payload = {};
592
+ const uri = new URL(this.client.config.endpoint + apiPath);
593
+
594
+ const apiHeaders: { [header: string]: string } = {
595
+ 'content-type': 'application/json',
596
+ }
597
+
598
+ return await this.client.call(
599
+ 'get',
600
+ uri,
601
+ apiHeaders,
602
+ payload,
603
+ );
604
+ }
605
+ /**
606
+ * Get time
607
+ *
608
+ * 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.
609
+ *
610
+ * @throws {AppwriteException}
611
+ * @returns {Promise<Models.HealthTime>}
612
+ */
613
+ async getTime(): Promise<Models.HealthTime> {
614
+ const apiPath = '/health/time';
615
+ const payload: Payload = {};
616
+ const uri = new URL(this.client.config.endpoint + apiPath);
617
+
618
+ const apiHeaders: { [header: string]: string } = {
619
+ 'content-type': 'application/json',
620
+ }
621
+
622
+ return await this.client.call(
623
+ 'get',
624
+ uri,
625
+ apiHeaders,
626
+ payload,
627
+ );
628
+ }
629
+ }