appwrite-cli 12.0.0 → 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 +8 -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} +410 -664
  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} +122 -173
  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 -48
  255. package/lib/type-generation/languages/{dart.js → dart.ts} +91 -80
  256. package/lib/type-generation/languages/{java.js → java.ts} +58 -47
  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 -48
  261. package/lib/type-generation/languages/{swift.js → swift.ts} +59 -48
  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 -16
  279. package/lib/type-generation/languages/javascript.js +0 -102
  280. package/lib/type-generation/languages/kotlin.js +0 -85
  281. package/lib/type-generation/languages/language.js +0 -125
  282. package/lib/type-generation/languages/typescript.js +0 -107
  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 sites = new Command("sites").description(commandDescriptions['sites'] ?? '').configureHelp({
34
+ export const sites = new Command("sites").description(commandDescriptions['sites'] ?? '').configureHelp({
39
35
  helpWidth: process.stdout.columns || 80
40
36
  })
41
37
 
42
- /**
43
- * @typedef {Object} SitesListRequestParams
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, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId
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 {SitesListRequestParams} params
54
- */
55
- const sitesList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
38
+ interface SitesListRequestParams {
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 sitesList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: SitesListRequestParams): Promise<any> => {
56
49
  let client = !sdk ? await sdkForProject() :
57
50
  sdk;
58
51
  let apiPath = '/sites';
@@ -73,7 +66,7 @@ const sitesList = 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('sites', 'list');
78
71
  } else {
79
72
  parse(response)
@@ -83,35 +76,31 @@ const sitesList = async ({queries,search,total,parseOutput = true, overrideForCl
83
76
  return response;
84
77
 
85
78
  }
86
- /**
87
- * @typedef {Object} SitesCreateRequestParams
88
- * @property {string} siteId Site 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} name Site name. Max length: 128 chars.
90
- * @property {Framework} framework Sites framework.
91
- * @property {BuildRuntime} buildRuntime Runtime to use during build step.
92
- * @property {boolean} enabled Is site enabled? When set to &#039;disabled&#039;, users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
93
- * @property {boolean} logging When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
94
- * @property {number} timeout Maximum request time in seconds.
95
- * @property {string} installCommand Install Command.
96
- * @property {string} buildCommand Build Command.
97
- * @property {string} outputDirectory Output Directory for site.
98
- * @property {Adapter} adapter Framework adapter defining rendering strategy. Allowed values are: static, ssr
99
- * @property {string} installationId Appwrite Installation ID for VCS (Version Control System) deployment.
100
- * @property {string} fallbackFile Fallback file for single page application sites.
101
- * @property {string} providerRepositoryId Repository ID of the repo linked to the site.
102
- * @property {string} providerBranch Production branch for the repo linked to the site.
103
- * @property {boolean} providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
104
- * @property {string} providerRootDirectory Path to site code in the linked repo.
105
- * @property {string} specification Framework specification for the site and builds.
106
- * @property {boolean} overrideForCli
107
- * @property {boolean} parseOutput
108
- * @property {libClient | undefined} sdk
109
- */
110
-
111
- /**
112
- * @param {SitesCreateRequestParams} params
113
- */
114
- const sitesCreate = async ({siteId,name,framework,buildRuntime,enabled,logging,timeout,installCommand,buildCommand,outputDirectory,adapter,installationId,fallbackFile,providerRepositoryId,providerBranch,providerSilentMode,providerRootDirectory,specification,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
79
+ interface SitesCreateRequestParams {
80
+ siteId: string;
81
+ name: string;
82
+ framework: Framework;
83
+ buildRuntime: BuildRuntime;
84
+ enabled?: boolean;
85
+ logging?: boolean;
86
+ timeout?: number;
87
+ installCommand?: string;
88
+ buildCommand?: string;
89
+ outputDirectory?: string;
90
+ adapter?: Adapter;
91
+ installationId?: string;
92
+ fallbackFile?: string;
93
+ providerRepositoryId?: string;
94
+ providerBranch?: string;
95
+ providerSilentMode?: boolean;
96
+ providerRootDirectory?: string;
97
+ specification?: string;
98
+ overrideForCli?: boolean;
99
+ parseOutput?: boolean;
100
+ sdk?: Client;
101
+ }
102
+
103
+ export const sitesCreate = async ({siteId,name,framework,buildRuntime,enabled,logging,timeout,installCommand,buildCommand,outputDirectory,adapter,installationId,fallbackFile,providerRepositoryId,providerBranch,providerSilentMode,providerRootDirectory,specification,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesCreateRequestParams): Promise<any> => {
115
104
  let client = !sdk ? await sdkForProject() :
116
105
  sdk;
117
106
  let apiPath = '/sites';
@@ -184,17 +173,14 @@ const sitesCreate = async ({siteId,name,framework,buildRuntime,enabled,logging,t
184
173
  return response;
185
174
 
186
175
  }
187
- /**
188
- * @typedef {Object} SitesListFrameworksRequestParams
189
- * @property {boolean} overrideForCli
190
- * @property {boolean} parseOutput
191
- * @property {libClient | undefined} sdk
192
- */
193
-
194
- /**
195
- * @param {SitesListFrameworksRequestParams} params
196
- */
197
- const sitesListFrameworks = async ({parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
176
+ interface SitesListFrameworksRequestParams {
177
+ overrideForCli?: boolean;
178
+ parseOutput?: boolean;
179
+ sdk?: Client;
180
+ console?: boolean;
181
+ }
182
+
183
+ export const sitesListFrameworks = async ({parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: SitesListFrameworksRequestParams): Promise<any> => {
198
184
  let client = !sdk ? await sdkForProject() :
199
185
  sdk;
200
186
  let apiPath = '/sites/frameworks';
@@ -206,7 +192,7 @@ const sitesListFrameworks = async ({parseOutput = true, overrideForCli = false,
206
192
  }, payload);
207
193
 
208
194
  if (parseOutput) {
209
- if(console) {
195
+ if(showConsole) {
210
196
  showConsoleLink('sites', 'listFrameworks');
211
197
  } else {
212
198
  parse(response)
@@ -216,17 +202,14 @@ const sitesListFrameworks = async ({parseOutput = true, overrideForCli = false,
216
202
  return response;
217
203
 
218
204
  }
219
- /**
220
- * @typedef {Object} SitesListSpecificationsRequestParams
221
- * @property {boolean} overrideForCli
222
- * @property {boolean} parseOutput
223
- * @property {libClient | undefined} sdk
224
- */
225
-
226
- /**
227
- * @param {SitesListSpecificationsRequestParams} params
228
- */
229
- const sitesListSpecifications = async ({parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
205
+ interface SitesListSpecificationsRequestParams {
206
+ overrideForCli?: boolean;
207
+ parseOutput?: boolean;
208
+ sdk?: Client;
209
+ console?: boolean;
210
+ }
211
+
212
+ export const sitesListSpecifications = async ({parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: SitesListSpecificationsRequestParams): Promise<any> => {
230
213
  let client = !sdk ? await sdkForProject() :
231
214
  sdk;
232
215
  let apiPath = '/sites/specifications';
@@ -238,7 +221,7 @@ const sitesListSpecifications = async ({parseOutput = true, overrideForCli = fal
238
221
  }, payload);
239
222
 
240
223
  if (parseOutput) {
241
- if(console) {
224
+ if(showConsole) {
242
225
  showConsoleLink('sites', 'listSpecifications');
243
226
  } else {
244
227
  parse(response)
@@ -248,21 +231,18 @@ const sitesListSpecifications = async ({parseOutput = true, overrideForCli = fal
248
231
  return response;
249
232
 
250
233
  }
251
- /**
252
- * @typedef {Object} SitesListTemplatesRequestParams
253
- * @property {string[]} frameworks List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.
254
- * @property {string[]} useCases List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.
255
- * @property {number} limit Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
256
- * @property {number} offset Offset the list of returned templates. Maximum offset is 5000.
257
- * @property {boolean} overrideForCli
258
- * @property {boolean} parseOutput
259
- * @property {libClient | undefined} sdk
260
- */
261
-
262
- /**
263
- * @param {SitesListTemplatesRequestParams} params
264
- */
265
- const sitesListTemplates = async ({frameworks,useCases,limit,offset,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
234
+ interface SitesListTemplatesRequestParams {
235
+ frameworks?: string[];
236
+ useCases?: string[];
237
+ limit?: number;
238
+ offset?: number;
239
+ overrideForCli?: boolean;
240
+ parseOutput?: boolean;
241
+ sdk?: Client;
242
+ console?: boolean;
243
+ }
244
+
245
+ export const sitesListTemplates = async ({frameworks,useCases,limit,offset,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: SitesListTemplatesRequestParams): Promise<any> => {
266
246
  let client = !sdk ? await sdkForProject() :
267
247
  sdk;
268
248
  let apiPath = '/sites/templates';
@@ -286,7 +266,7 @@ const sitesListTemplates = async ({frameworks,useCases,limit,offset,parseOutput
286
266
  }, payload);
287
267
 
288
268
  if (parseOutput) {
289
- if(console) {
269
+ if(showConsole) {
290
270
  showConsoleLink('sites', 'listTemplates');
291
271
  } else {
292
272
  parse(response)
@@ -296,18 +276,15 @@ const sitesListTemplates = async ({frameworks,useCases,limit,offset,parseOutput
296
276
  return response;
297
277
 
298
278
  }
299
- /**
300
- * @typedef {Object} SitesGetTemplateRequestParams
301
- * @property {string} templateId Template ID.
302
- * @property {boolean} overrideForCli
303
- * @property {boolean} parseOutput
304
- * @property {libClient | undefined} sdk
305
- */
306
-
307
- /**
308
- * @param {SitesGetTemplateRequestParams} params
309
- */
310
- const sitesGetTemplate = async ({templateId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
279
+ interface SitesGetTemplateRequestParams {
280
+ templateId: string;
281
+ overrideForCli?: boolean;
282
+ parseOutput?: boolean;
283
+ sdk?: Client;
284
+ console?: boolean;
285
+ }
286
+
287
+ export const sitesGetTemplate = async ({templateId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: SitesGetTemplateRequestParams): Promise<any> => {
311
288
  let client = !sdk ? await sdkForProject() :
312
289
  sdk;
313
290
  let apiPath = '/sites/templates/{templateId}'.replace('{templateId}', templateId);
@@ -319,7 +296,7 @@ const sitesGetTemplate = async ({templateId,parseOutput = true, overrideForCli =
319
296
  }, payload);
320
297
 
321
298
  if (parseOutput) {
322
- if(console) {
299
+ if(showConsole) {
323
300
  showConsoleLink('sites', 'getTemplate', templateId);
324
301
  } else {
325
302
  parse(response)
@@ -329,18 +306,15 @@ const sitesGetTemplate = async ({templateId,parseOutput = true, overrideForCli =
329
306
  return response;
330
307
 
331
308
  }
332
- /**
333
- * @typedef {Object} SitesListUsageRequestParams
334
- * @property {UsageRange} range Date range.
335
- * @property {boolean} overrideForCli
336
- * @property {boolean} parseOutput
337
- * @property {libClient | undefined} sdk
338
- */
339
-
340
- /**
341
- * @param {SitesListUsageRequestParams} params
342
- */
343
- const sitesListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
309
+ interface SitesListUsageRequestParams {
310
+ range?: UsageRange;
311
+ overrideForCli?: boolean;
312
+ parseOutput?: boolean;
313
+ sdk?: Client;
314
+ console?: boolean;
315
+ }
316
+
317
+ export const sitesListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: SitesListUsageRequestParams): Promise<any> => {
344
318
  let client = !sdk ? await sdkForProject() :
345
319
  sdk;
346
320
  let apiPath = '/sites/usage';
@@ -355,7 +329,7 @@ const sitesListUsage = async ({range,parseOutput = true, overrideForCli = false,
355
329
  }, payload);
356
330
 
357
331
  if (parseOutput) {
358
- if(console) {
332
+ if(showConsole) {
359
333
  showConsoleLink('sites', 'listUsage');
360
334
  } else {
361
335
  parse(response)
@@ -365,18 +339,15 @@ const sitesListUsage = async ({range,parseOutput = true, overrideForCli = false,
365
339
  return response;
366
340
 
367
341
  }
368
- /**
369
- * @typedef {Object} SitesGetRequestParams
370
- * @property {string} siteId Site ID.
371
- * @property {boolean} overrideForCli
372
- * @property {boolean} parseOutput
373
- * @property {libClient | undefined} sdk
374
- */
375
-
376
- /**
377
- * @param {SitesGetRequestParams} params
378
- */
379
- const sitesGet = async ({siteId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
342
+ interface SitesGetRequestParams {
343
+ siteId: string;
344
+ overrideForCli?: boolean;
345
+ parseOutput?: boolean;
346
+ sdk?: Client;
347
+ console?: boolean;
348
+ }
349
+
350
+ export const sitesGet = async ({siteId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: SitesGetRequestParams): Promise<any> => {
380
351
  let client = !sdk ? await sdkForProject() :
381
352
  sdk;
382
353
  let apiPath = '/sites/{siteId}'.replace('{siteId}', siteId);
@@ -388,7 +359,7 @@ const sitesGet = async ({siteId,parseOutput = true, overrideForCli = false, sdk
388
359
  }, payload);
389
360
 
390
361
  if (parseOutput) {
391
- if(console) {
362
+ if(showConsole) {
392
363
  showConsoleLink('sites', 'get', siteId);
393
364
  } else {
394
365
  parse(response)
@@ -398,35 +369,31 @@ const sitesGet = async ({siteId,parseOutput = true, overrideForCli = false, sdk
398
369
  return response;
399
370
 
400
371
  }
401
- /**
402
- * @typedef {Object} SitesUpdateRequestParams
403
- * @property {string} siteId Site ID.
404
- * @property {string} name Site name. Max length: 128 chars.
405
- * @property {Framework} framework Sites framework.
406
- * @property {boolean} enabled Is site enabled? When set to &#039;disabled&#039;, users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
407
- * @property {boolean} logging When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
408
- * @property {number} timeout Maximum request time in seconds.
409
- * @property {string} installCommand Install Command.
410
- * @property {string} buildCommand Build Command.
411
- * @property {string} outputDirectory Output Directory for site.
412
- * @property {BuildRuntime} buildRuntime Runtime to use during build step.
413
- * @property {Adapter} adapter Framework adapter defining rendering strategy. Allowed values are: static, ssr
414
- * @property {string} fallbackFile Fallback file for single page application sites.
415
- * @property {string} installationId Appwrite Installation ID for VCS (Version Control System) deployment.
416
- * @property {string} providerRepositoryId Repository ID of the repo linked to the site.
417
- * @property {string} providerBranch Production branch for the repo linked to the site.
418
- * @property {boolean} providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
419
- * @property {string} providerRootDirectory Path to site code in the linked repo.
420
- * @property {string} specification Framework specification for the site and builds.
421
- * @property {boolean} overrideForCli
422
- * @property {boolean} parseOutput
423
- * @property {libClient | undefined} sdk
424
- */
425
-
426
- /**
427
- * @param {SitesUpdateRequestParams} params
428
- */
429
- const sitesUpdate = async ({siteId,name,framework,enabled,logging,timeout,installCommand,buildCommand,outputDirectory,buildRuntime,adapter,fallbackFile,installationId,providerRepositoryId,providerBranch,providerSilentMode,providerRootDirectory,specification,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
372
+ interface SitesUpdateRequestParams {
373
+ siteId: string;
374
+ name: string;
375
+ framework: Framework;
376
+ enabled?: boolean;
377
+ logging?: boolean;
378
+ timeout?: number;
379
+ installCommand?: string;
380
+ buildCommand?: string;
381
+ outputDirectory?: string;
382
+ buildRuntime?: BuildRuntime;
383
+ adapter?: Adapter;
384
+ fallbackFile?: string;
385
+ installationId?: string;
386
+ providerRepositoryId?: string;
387
+ providerBranch?: string;
388
+ providerSilentMode?: boolean;
389
+ providerRootDirectory?: string;
390
+ specification?: string;
391
+ overrideForCli?: boolean;
392
+ parseOutput?: boolean;
393
+ sdk?: Client;
394
+ }
395
+
396
+ export const sitesUpdate = async ({siteId,name,framework,enabled,logging,timeout,installCommand,buildCommand,outputDirectory,buildRuntime,adapter,fallbackFile,installationId,providerRepositoryId,providerBranch,providerSilentMode,providerRootDirectory,specification,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesUpdateRequestParams): Promise<any> => {
430
397
  let client = !sdk ? await sdkForProject() :
431
398
  sdk;
432
399
  let apiPath = '/sites/{siteId}'.replace('{siteId}', siteId);
@@ -496,18 +463,14 @@ const sitesUpdate = async ({siteId,name,framework,enabled,logging,timeout,instal
496
463
  return response;
497
464
 
498
465
  }
499
- /**
500
- * @typedef {Object} SitesDeleteRequestParams
501
- * @property {string} siteId Site ID.
502
- * @property {boolean} overrideForCli
503
- * @property {boolean} parseOutput
504
- * @property {libClient | undefined} sdk
505
- */
506
-
507
- /**
508
- * @param {SitesDeleteRequestParams} params
509
- */
510
- const sitesDelete = async ({siteId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
466
+ interface SitesDeleteRequestParams {
467
+ siteId: string;
468
+ overrideForCli?: boolean;
469
+ parseOutput?: boolean;
470
+ sdk?: Client;
471
+ }
472
+
473
+ export const sitesDelete = async ({siteId,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesDeleteRequestParams): Promise<any> => {
511
474
  let client = !sdk ? await sdkForProject() :
512
475
  sdk;
513
476
  let apiPath = '/sites/{siteId}'.replace('{siteId}', siteId);
@@ -526,19 +489,15 @@ const sitesDelete = async ({siteId,parseOutput = true, overrideForCli = false, s
526
489
  return response;
527
490
 
528
491
  }
529
- /**
530
- * @typedef {Object} SitesUpdateSiteDeploymentRequestParams
531
- * @property {string} siteId Site ID.
532
- * @property {string} deploymentId Deployment ID.
533
- * @property {boolean} overrideForCli
534
- * @property {boolean} parseOutput
535
- * @property {libClient | undefined} sdk
536
- */
537
-
538
- /**
539
- * @param {SitesUpdateSiteDeploymentRequestParams} params
540
- */
541
- const sitesUpdateSiteDeployment = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
492
+ interface SitesUpdateSiteDeploymentRequestParams {
493
+ siteId: string;
494
+ deploymentId: string;
495
+ overrideForCli?: boolean;
496
+ parseOutput?: boolean;
497
+ sdk?: Client;
498
+ }
499
+
500
+ export const sitesUpdateSiteDeployment = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesUpdateSiteDeploymentRequestParams): Promise<any> => {
542
501
  let client = !sdk ? await sdkForProject() :
543
502
  sdk;
544
503
  let apiPath = '/sites/{siteId}/deployment'.replace('{siteId}', siteId);
@@ -560,21 +519,18 @@ const sitesUpdateSiteDeployment = async ({siteId,deploymentId,parseOutput = true
560
519
  return response;
561
520
 
562
521
  }
563
- /**
564
- * @typedef {Object} SitesListDeploymentsRequestParams
565
- * @property {string} siteId Site ID.
566
- * @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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
567
- * @property {string} search Search term to filter your list results. Max length: 256 chars.
568
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
569
- * @property {boolean} overrideForCli
570
- * @property {boolean} parseOutput
571
- * @property {libClient | undefined} sdk
572
- */
573
-
574
- /**
575
- * @param {SitesListDeploymentsRequestParams} params
576
- */
577
- const sitesListDeployments = async ({siteId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
522
+ interface SitesListDeploymentsRequestParams {
523
+ siteId: string;
524
+ queries?: string[];
525
+ search?: string;
526
+ total?: boolean;
527
+ overrideForCli?: boolean;
528
+ parseOutput?: boolean;
529
+ sdk?: Client;
530
+ console?: boolean;
531
+ }
532
+
533
+ export const sitesListDeployments = async ({siteId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: SitesListDeploymentsRequestParams): Promise<any> => {
578
534
  let client = !sdk ? await sdkForProject() :
579
535
  sdk;
580
536
  let apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId);
@@ -595,7 +551,7 @@ const sitesListDeployments = async ({siteId,queries,search,total,parseOutput = t
595
551
  }, payload);
596
552
 
597
553
  if (parseOutput) {
598
- if(console) {
554
+ if(showConsole) {
599
555
  showConsoleLink('sites', 'listDeployments', siteId);
600
556
  } else {
601
557
  parse(response)
@@ -605,24 +561,20 @@ const sitesListDeployments = async ({siteId,queries,search,total,parseOutput = t
605
561
  return response;
606
562
 
607
563
  }
608
- /**
609
- * @typedef {Object} SitesCreateDeploymentRequestParams
610
- * @property {string} siteId Site ID.
611
- * @property {string} code Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
612
- * @property {boolean} activate Automatically activate the deployment when it is finished building.
613
- * @property {string} installCommand Install Commands.
614
- * @property {string} buildCommand Build Commands.
615
- * @property {string} outputDirectory Output Directory.
616
- * @property {boolean} overrideForCli
617
- * @property {boolean} parseOutput
618
- * @property {libClient | undefined} sdk
619
- * @property {CallableFunction} onProgress
620
- */
621
-
622
- /**
623
- * @param {SitesCreateDeploymentRequestParams} params
624
- */
625
- const sitesCreateDeployment = async ({siteId,code,activate,installCommand,buildCommand,outputDirectory,parseOutput = true, overrideForCli = false, sdk = undefined,onProgress = () => {}}) => {
564
+ interface SitesCreateDeploymentRequestParams {
565
+ siteId: string;
566
+ code: string;
567
+ activate: boolean;
568
+ installCommand?: string;
569
+ buildCommand?: string;
570
+ outputDirectory?: string;
571
+ overrideForCli?: boolean;
572
+ parseOutput?: boolean;
573
+ sdk?: Client;
574
+ onProgress?: (progress: number) => void;
575
+ }
576
+
577
+ export const sitesCreateDeployment = async ({siteId,code,activate,installCommand,buildCommand,outputDirectory,parseOutput = true, overrideForCli = false, sdk = undefined,onProgress = () => {}}: SitesCreateDeploymentRequestParams): Promise<any> => {
626
578
  let client = !sdk ? await sdkForProject() :
627
579
  sdk;
628
580
  let apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId);
@@ -773,19 +725,15 @@ const sitesCreateDeployment = async ({siteId,code,activate,installCommand,buildC
773
725
 
774
726
  return response;
775
727
  }
776
- /**
777
- * @typedef {Object} SitesCreateDuplicateDeploymentRequestParams
778
- * @property {string} siteId Site ID.
779
- * @property {string} deploymentId Deployment ID.
780
- * @property {boolean} overrideForCli
781
- * @property {boolean} parseOutput
782
- * @property {libClient | undefined} sdk
783
- */
784
-
785
- /**
786
- * @param {SitesCreateDuplicateDeploymentRequestParams} params
787
- */
788
- const sitesCreateDuplicateDeployment = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
728
+ interface SitesCreateDuplicateDeploymentRequestParams {
729
+ siteId: string;
730
+ deploymentId: string;
731
+ overrideForCli?: boolean;
732
+ parseOutput?: boolean;
733
+ sdk?: Client;
734
+ }
735
+
736
+ export const sitesCreateDuplicateDeployment = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesCreateDuplicateDeploymentRequestParams): Promise<any> => {
789
737
  let client = !sdk ? await sdkForProject() :
790
738
  sdk;
791
739
  let apiPath = '/sites/{siteId}/deployments/duplicate'.replace('{siteId}', siteId);
@@ -807,24 +755,20 @@ const sitesCreateDuplicateDeployment = async ({siteId,deploymentId,parseOutput =
807
755
  return response;
808
756
 
809
757
  }
810
- /**
811
- * @typedef {Object} SitesCreateTemplateDeploymentRequestParams
812
- * @property {string} siteId Site ID.
813
- * @property {string} repository Repository name of the template.
814
- * @property {string} owner The name of the owner of the template.
815
- * @property {string} rootDirectory Path to site code in the template repo.
816
- * @property {TemplateReferenceType} type Type for the reference provided. Can be commit, branch, or tag
817
- * @property {string} reference Reference value, can be a commit hash, branch name, or release tag
818
- * @property {boolean} activate Automatically activate the deployment when it is finished building.
819
- * @property {boolean} overrideForCli
820
- * @property {boolean} parseOutput
821
- * @property {libClient | undefined} sdk
822
- */
823
-
824
- /**
825
- * @param {SitesCreateTemplateDeploymentRequestParams} params
826
- */
827
- const sitesCreateTemplateDeployment = async ({siteId,repository,owner,rootDirectory,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
758
+ interface SitesCreateTemplateDeploymentRequestParams {
759
+ siteId: string;
760
+ repository: string;
761
+ owner: string;
762
+ rootDirectory: string;
763
+ type: TemplateReferenceType;
764
+ reference: string;
765
+ activate?: boolean;
766
+ overrideForCli?: boolean;
767
+ parseOutput?: boolean;
768
+ sdk?: Client;
769
+ }
770
+
771
+ export const sitesCreateTemplateDeployment = async ({siteId,repository,owner,rootDirectory,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesCreateTemplateDeploymentRequestParams): Promise<any> => {
828
772
  let client = !sdk ? await sdkForProject() :
829
773
  sdk;
830
774
  let apiPath = '/sites/{siteId}/deployments/template'.replace('{siteId}', siteId);
@@ -861,21 +805,17 @@ const sitesCreateTemplateDeployment = async ({siteId,repository,owner,rootDirect
861
805
  return response;
862
806
 
863
807
  }
864
- /**
865
- * @typedef {Object} SitesCreateVcsDeploymentRequestParams
866
- * @property {string} siteId Site ID.
867
- * @property {VCSReferenceType} type Type of reference passed. Allowed values are: branch, commit
868
- * @property {string} reference VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
869
- * @property {boolean} activate Automatically activate the deployment when it is finished building.
870
- * @property {boolean} overrideForCli
871
- * @property {boolean} parseOutput
872
- * @property {libClient | undefined} sdk
873
- */
874
-
875
- /**
876
- * @param {SitesCreateVcsDeploymentRequestParams} params
877
- */
878
- const sitesCreateVcsDeployment = async ({siteId,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
808
+ interface SitesCreateVcsDeploymentRequestParams {
809
+ siteId: string;
810
+ type: VCSReferenceType;
811
+ reference: string;
812
+ activate?: boolean;
813
+ overrideForCli?: boolean;
814
+ parseOutput?: boolean;
815
+ sdk?: Client;
816
+ }
817
+
818
+ export const sitesCreateVcsDeployment = async ({siteId,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesCreateVcsDeploymentRequestParams): Promise<any> => {
879
819
  let client = !sdk ? await sdkForProject() :
880
820
  sdk;
881
821
  let apiPath = '/sites/{siteId}/deployments/vcs'.replace('{siteId}', siteId);
@@ -903,19 +843,16 @@ const sitesCreateVcsDeployment = async ({siteId,type,reference,activate,parseOut
903
843
  return response;
904
844
 
905
845
  }
906
- /**
907
- * @typedef {Object} SitesGetDeploymentRequestParams
908
- * @property {string} siteId Site ID.
909
- * @property {string} deploymentId Deployment ID.
910
- * @property {boolean} overrideForCli
911
- * @property {boolean} parseOutput
912
- * @property {libClient | undefined} sdk
913
- */
914
-
915
- /**
916
- * @param {SitesGetDeploymentRequestParams} params
917
- */
918
- const sitesGetDeployment = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
846
+ interface SitesGetDeploymentRequestParams {
847
+ siteId: string;
848
+ deploymentId: string;
849
+ overrideForCli?: boolean;
850
+ parseOutput?: boolean;
851
+ sdk?: Client;
852
+ console?: boolean;
853
+ }
854
+
855
+ export const sitesGetDeployment = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: SitesGetDeploymentRequestParams): Promise<any> => {
919
856
  let client = !sdk ? await sdkForProject() :
920
857
  sdk;
921
858
  let apiPath = '/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
@@ -927,7 +864,7 @@ const sitesGetDeployment = async ({siteId,deploymentId,parseOutput = true, overr
927
864
  }, payload);
928
865
 
929
866
  if (parseOutput) {
930
- if(console) {
867
+ if(showConsole) {
931
868
  showConsoleLink('sites', 'getDeployment', siteId, deploymentId);
932
869
  } else {
933
870
  parse(response)
@@ -937,19 +874,15 @@ const sitesGetDeployment = async ({siteId,deploymentId,parseOutput = true, overr
937
874
  return response;
938
875
 
939
876
  }
940
- /**
941
- * @typedef {Object} SitesDeleteDeploymentRequestParams
942
- * @property {string} siteId Site ID.
943
- * @property {string} deploymentId Deployment ID.
944
- * @property {boolean} overrideForCli
945
- * @property {boolean} parseOutput
946
- * @property {libClient | undefined} sdk
947
- */
948
-
949
- /**
950
- * @param {SitesDeleteDeploymentRequestParams} params
951
- */
952
- const sitesDeleteDeployment = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
877
+ interface SitesDeleteDeploymentRequestParams {
878
+ siteId: string;
879
+ deploymentId: string;
880
+ overrideForCli?: boolean;
881
+ parseOutput?: boolean;
882
+ sdk?: Client;
883
+ }
884
+
885
+ export const sitesDeleteDeployment = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesDeleteDeploymentRequestParams): Promise<any> => {
953
886
  let client = !sdk ? await sdkForProject() :
954
887
  sdk;
955
888
  let apiPath = '/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
@@ -968,21 +901,18 @@ const sitesDeleteDeployment = async ({siteId,deploymentId,parseOutput = true, ov
968
901
  return response;
969
902
 
970
903
  }
971
- /**
972
- * @typedef {Object} SitesGetDeploymentDownloadRequestParams
973
- * @property {string} siteId Site ID.
974
- * @property {string} deploymentId Deployment ID.
975
- * @property {DeploymentDownloadType} type Deployment file to download. Can be: &quot;source&quot;, &quot;output&quot;.
976
- * @property {boolean} overrideForCli
977
- * @property {boolean} parseOutput
978
- * @property {libClient | undefined} sdk
979
- * @property {string} destination
980
- */
981
-
982
- /**
983
- * @param {SitesGetDeploymentDownloadRequestParams} params
984
- */
985
- const sitesGetDeploymentDownload = async ({siteId,deploymentId,type,parseOutput = true, overrideForCli = false, sdk = undefined, destination, console}) => {
904
+ interface SitesGetDeploymentDownloadRequestParams {
905
+ siteId: string;
906
+ deploymentId: string;
907
+ type?: DeploymentDownloadType;
908
+ overrideForCli?: boolean;
909
+ parseOutput?: boolean;
910
+ sdk?: Client;
911
+ destination?: string;
912
+ console?: boolean;
913
+ }
914
+
915
+ export const sitesGetDeploymentDownload = async ({siteId,deploymentId,type,parseOutput = true, overrideForCli = false, sdk = undefined, destination, console: showConsole}: SitesGetDeploymentDownloadRequestParams): Promise<any> => {
986
916
  let client = !sdk ? await sdkForProject() :
987
917
  sdk;
988
918
  let apiPath = '/sites/{siteId}/deployments/{deploymentId}/download'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
@@ -1008,7 +938,7 @@ const sitesGetDeploymentDownload = async ({siteId,deploymentId,type,parseOutput
1008
938
 
1009
939
  fs.writeFileSync(destination, response);
1010
940
  if (parseOutput) {
1011
- if(console) {
941
+ if(showConsole) {
1012
942
  showConsoleLink('sites', 'getDeploymentDownload', siteId, deploymentId);
1013
943
  } else {
1014
944
  parse(response)
@@ -1018,19 +948,15 @@ const sitesGetDeploymentDownload = async ({siteId,deploymentId,type,parseOutput
1018
948
  return response;
1019
949
 
1020
950
  }
1021
- /**
1022
- * @typedef {Object} SitesUpdateDeploymentStatusRequestParams
1023
- * @property {string} siteId Site ID.
1024
- * @property {string} deploymentId Deployment ID.
1025
- * @property {boolean} overrideForCli
1026
- * @property {boolean} parseOutput
1027
- * @property {libClient | undefined} sdk
1028
- */
1029
-
1030
- /**
1031
- * @param {SitesUpdateDeploymentStatusRequestParams} params
1032
- */
1033
- const sitesUpdateDeploymentStatus = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
951
+ interface SitesUpdateDeploymentStatusRequestParams {
952
+ siteId: string;
953
+ deploymentId: string;
954
+ overrideForCli?: boolean;
955
+ parseOutput?: boolean;
956
+ sdk?: Client;
957
+ }
958
+
959
+ export const sitesUpdateDeploymentStatus = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesUpdateDeploymentStatusRequestParams): Promise<any> => {
1034
960
  let client = !sdk ? await sdkForProject() :
1035
961
  sdk;
1036
962
  let apiPath = '/sites/{siteId}/deployments/{deploymentId}/status'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
@@ -1049,20 +975,16 @@ const sitesUpdateDeploymentStatus = async ({siteId,deploymentId,parseOutput = tr
1049
975
  return response;
1050
976
 
1051
977
  }
1052
- /**
1053
- * @typedef {Object} SitesListLogsRequestParams
1054
- * @property {string} siteId Site ID.
1055
- * @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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
1056
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
1057
- * @property {boolean} overrideForCli
1058
- * @property {boolean} parseOutput
1059
- * @property {libClient | undefined} sdk
1060
- */
1061
-
1062
- /**
1063
- * @param {SitesListLogsRequestParams} params
1064
- */
1065
- const sitesListLogs = async ({siteId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
978
+ interface SitesListLogsRequestParams {
979
+ siteId: string;
980
+ queries?: string[];
981
+ total?: boolean;
982
+ overrideForCli?: boolean;
983
+ parseOutput?: boolean;
984
+ sdk?: Client;
985
+ }
986
+
987
+ export const sitesListLogs = async ({siteId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesListLogsRequestParams): Promise<any> => {
1066
988
  let client = !sdk ? await sdkForProject() :
1067
989
  sdk;
1068
990
  let apiPath = '/sites/{siteId}/logs'.replace('{siteId}', siteId);
@@ -1086,19 +1008,16 @@ const sitesListLogs = async ({siteId,queries,total,parseOutput = true, overrideF
1086
1008
  return response;
1087
1009
 
1088
1010
  }
1089
- /**
1090
- * @typedef {Object} SitesGetLogRequestParams
1091
- * @property {string} siteId Site ID.
1092
- * @property {string} logId Log ID.
1093
- * @property {boolean} overrideForCli
1094
- * @property {boolean} parseOutput
1095
- * @property {libClient | undefined} sdk
1096
- */
1097
-
1098
- /**
1099
- * @param {SitesGetLogRequestParams} params
1100
- */
1101
- const sitesGetLog = async ({siteId,logId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1011
+ interface SitesGetLogRequestParams {
1012
+ siteId: string;
1013
+ logId: string;
1014
+ overrideForCli?: boolean;
1015
+ parseOutput?: boolean;
1016
+ sdk?: Client;
1017
+ console?: boolean;
1018
+ }
1019
+
1020
+ export const sitesGetLog = async ({siteId,logId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: SitesGetLogRequestParams): Promise<any> => {
1102
1021
  let client = !sdk ? await sdkForProject() :
1103
1022
  sdk;
1104
1023
  let apiPath = '/sites/{siteId}/logs/{logId}'.replace('{siteId}', siteId).replace('{logId}', logId);
@@ -1110,7 +1029,7 @@ const sitesGetLog = async ({siteId,logId,parseOutput = true, overrideForCli = fa
1110
1029
  }, payload);
1111
1030
 
1112
1031
  if (parseOutput) {
1113
- if(console) {
1032
+ if(showConsole) {
1114
1033
  showConsoleLink('sites', 'getLog', siteId, logId);
1115
1034
  } else {
1116
1035
  parse(response)
@@ -1120,19 +1039,15 @@ const sitesGetLog = async ({siteId,logId,parseOutput = true, overrideForCli = fa
1120
1039
  return response;
1121
1040
 
1122
1041
  }
1123
- /**
1124
- * @typedef {Object} SitesDeleteLogRequestParams
1125
- * @property {string} siteId Site ID.
1126
- * @property {string} logId Log ID.
1127
- * @property {boolean} overrideForCli
1128
- * @property {boolean} parseOutput
1129
- * @property {libClient | undefined} sdk
1130
- */
1131
-
1132
- /**
1133
- * @param {SitesDeleteLogRequestParams} params
1134
- */
1135
- const sitesDeleteLog = async ({siteId,logId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1042
+ interface SitesDeleteLogRequestParams {
1043
+ siteId: string;
1044
+ logId: string;
1045
+ overrideForCli?: boolean;
1046
+ parseOutput?: boolean;
1047
+ sdk?: Client;
1048
+ }
1049
+
1050
+ export const sitesDeleteLog = async ({siteId,logId,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesDeleteLogRequestParams): Promise<any> => {
1136
1051
  let client = !sdk ? await sdkForProject() :
1137
1052
  sdk;
1138
1053
  let apiPath = '/sites/{siteId}/logs/{logId}'.replace('{siteId}', siteId).replace('{logId}', logId);
@@ -1151,19 +1066,15 @@ const sitesDeleteLog = async ({siteId,logId,parseOutput = true, overrideForCli =
1151
1066
  return response;
1152
1067
 
1153
1068
  }
1154
- /**
1155
- * @typedef {Object} SitesGetUsageRequestParams
1156
- * @property {string} siteId Site ID.
1157
- * @property {UsageRange} range Date range.
1158
- * @property {boolean} overrideForCli
1159
- * @property {boolean} parseOutput
1160
- * @property {libClient | undefined} sdk
1161
- */
1162
-
1163
- /**
1164
- * @param {SitesGetUsageRequestParams} params
1165
- */
1166
- const sitesGetUsage = async ({siteId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1069
+ interface SitesGetUsageRequestParams {
1070
+ siteId: string;
1071
+ range?: UsageRange;
1072
+ overrideForCli?: boolean;
1073
+ parseOutput?: boolean;
1074
+ sdk?: Client;
1075
+ }
1076
+
1077
+ export const sitesGetUsage = async ({siteId,range,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesGetUsageRequestParams): Promise<any> => {
1167
1078
  let client = !sdk ? await sdkForProject() :
1168
1079
  sdk;
1169
1080
  let apiPath = '/sites/{siteId}/usage'.replace('{siteId}', siteId);
@@ -1184,18 +1095,14 @@ const sitesGetUsage = async ({siteId,range,parseOutput = true, overrideForCli =
1184
1095
  return response;
1185
1096
 
1186
1097
  }
1187
- /**
1188
- * @typedef {Object} SitesListVariablesRequestParams
1189
- * @property {string} siteId Site unique ID.
1190
- * @property {boolean} overrideForCli
1191
- * @property {boolean} parseOutput
1192
- * @property {libClient | undefined} sdk
1193
- */
1194
-
1195
- /**
1196
- * @param {SitesListVariablesRequestParams} params
1197
- */
1198
- const sitesListVariables = async ({siteId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1098
+ interface SitesListVariablesRequestParams {
1099
+ siteId: string;
1100
+ overrideForCli?: boolean;
1101
+ parseOutput?: boolean;
1102
+ sdk?: Client;
1103
+ }
1104
+
1105
+ export const sitesListVariables = async ({siteId,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesListVariablesRequestParams): Promise<any> => {
1199
1106
  let client = !sdk ? await sdkForProject() :
1200
1107
  sdk;
1201
1108
  let apiPath = '/sites/{siteId}/variables'.replace('{siteId}', siteId);
@@ -1213,21 +1120,17 @@ const sitesListVariables = async ({siteId,parseOutput = true, overrideForCli = f
1213
1120
  return response;
1214
1121
 
1215
1122
  }
1216
- /**
1217
- * @typedef {Object} SitesCreateVariableRequestParams
1218
- * @property {string} siteId Site unique ID.
1219
- * @property {string} key Variable key. Max length: 255 chars.
1220
- * @property {string} value Variable value. Max length: 8192 chars.
1221
- * @property {boolean} secret Secret variables can be updated or deleted, but only sites can read them during build and runtime.
1222
- * @property {boolean} overrideForCli
1223
- * @property {boolean} parseOutput
1224
- * @property {libClient | undefined} sdk
1225
- */
1226
-
1227
- /**
1228
- * @param {SitesCreateVariableRequestParams} params
1229
- */
1230
- const sitesCreateVariable = async ({siteId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1123
+ interface SitesCreateVariableRequestParams {
1124
+ siteId: string;
1125
+ key: string;
1126
+ value: string;
1127
+ secret?: boolean;
1128
+ overrideForCli?: boolean;
1129
+ parseOutput?: boolean;
1130
+ sdk?: Client;
1131
+ }
1132
+
1133
+ export const sitesCreateVariable = async ({siteId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesCreateVariableRequestParams): Promise<any> => {
1231
1134
  let client = !sdk ? await sdkForProject() :
1232
1135
  sdk;
1233
1136
  let apiPath = '/sites/{siteId}/variables'.replace('{siteId}', siteId);
@@ -1255,19 +1158,15 @@ const sitesCreateVariable = async ({siteId,key,value,secret,parseOutput = true,
1255
1158
  return response;
1256
1159
 
1257
1160
  }
1258
- /**
1259
- * @typedef {Object} SitesGetVariableRequestParams
1260
- * @property {string} siteId Site unique ID.
1261
- * @property {string} variableId Variable unique ID.
1262
- * @property {boolean} overrideForCli
1263
- * @property {boolean} parseOutput
1264
- * @property {libClient | undefined} sdk
1265
- */
1266
-
1267
- /**
1268
- * @param {SitesGetVariableRequestParams} params
1269
- */
1270
- const sitesGetVariable = async ({siteId,variableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1161
+ interface SitesGetVariableRequestParams {
1162
+ siteId: string;
1163
+ variableId: string;
1164
+ overrideForCli?: boolean;
1165
+ parseOutput?: boolean;
1166
+ sdk?: Client;
1167
+ }
1168
+
1169
+ export const sitesGetVariable = async ({siteId,variableId,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesGetVariableRequestParams): Promise<any> => {
1271
1170
  let client = !sdk ? await sdkForProject() :
1272
1171
  sdk;
1273
1172
  let apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId);
@@ -1285,22 +1184,18 @@ const sitesGetVariable = async ({siteId,variableId,parseOutput = true, overrideF
1285
1184
  return response;
1286
1185
 
1287
1186
  }
1288
- /**
1289
- * @typedef {Object} SitesUpdateVariableRequestParams
1290
- * @property {string} siteId Site unique ID.
1291
- * @property {string} variableId Variable unique ID.
1292
- * @property {string} key Variable key. Max length: 255 chars.
1293
- * @property {string} value Variable value. Max length: 8192 chars.
1294
- * @property {boolean} secret Secret variables can be updated or deleted, but only sites can read them during build and runtime.
1295
- * @property {boolean} overrideForCli
1296
- * @property {boolean} parseOutput
1297
- * @property {libClient | undefined} sdk
1298
- */
1299
-
1300
- /**
1301
- * @param {SitesUpdateVariableRequestParams} params
1302
- */
1303
- const sitesUpdateVariable = async ({siteId,variableId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1187
+ interface SitesUpdateVariableRequestParams {
1188
+ siteId: string;
1189
+ variableId: string;
1190
+ key: string;
1191
+ value?: string;
1192
+ secret?: boolean;
1193
+ overrideForCli?: boolean;
1194
+ parseOutput?: boolean;
1195
+ sdk?: Client;
1196
+ }
1197
+
1198
+ export const sitesUpdateVariable = async ({siteId,variableId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesUpdateVariableRequestParams): Promise<any> => {
1304
1199
  let client = !sdk ? await sdkForProject() :
1305
1200
  sdk;
1306
1201
  let apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId);
@@ -1328,19 +1223,15 @@ const sitesUpdateVariable = async ({siteId,variableId,key,value,secret,parseOutp
1328
1223
  return response;
1329
1224
 
1330
1225
  }
1331
- /**
1332
- * @typedef {Object} SitesDeleteVariableRequestParams
1333
- * @property {string} siteId Site unique ID.
1334
- * @property {string} variableId Variable unique ID.
1335
- * @property {boolean} overrideForCli
1336
- * @property {boolean} parseOutput
1337
- * @property {libClient | undefined} sdk
1338
- */
1339
-
1340
- /**
1341
- * @param {SitesDeleteVariableRequestParams} params
1342
- */
1343
- const sitesDeleteVariable = async ({siteId,variableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1226
+ interface SitesDeleteVariableRequestParams {
1227
+ siteId: string;
1228
+ variableId: string;
1229
+ overrideForCli?: boolean;
1230
+ parseOutput?: boolean;
1231
+ sdk?: Client;
1232
+ }
1233
+
1234
+ export const sitesDeleteVariable = async ({siteId,variableId,parseOutput = true, overrideForCli = false, sdk = undefined}: SitesDeleteVariableRequestParams): Promise<any> => {
1344
1235
  let client = !sdk ? await sdkForProject() :
1345
1236
  sdk;
1346
1237
  let apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId);
@@ -1364,7 +1255,7 @@ sites
1364
1255
  .description(`Get a list of all the project's sites. You can use the query params to filter your results.`)
1365
1256
  .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, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId`)
1366
1257
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1367
- .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))
1258
+ .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))
1368
1259
  .option(`--console`, `Get the resource console url`)
1369
1260
  .action(actionRunner(sitesList))
1370
1261
 
@@ -1375,8 +1266,8 @@ sites
1375
1266
  .requiredOption(`--name <name>`, `Site name. Max length: 128 chars.`)
1376
1267
  .requiredOption(`--framework <framework>`, `Sites framework.`)
1377
1268
  .requiredOption(`--build-runtime <build-runtime>`, `Runtime to use during build step.`)
1378
- .option(`--enabled [value]`, `Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
1379
- .option(`--logging [value]`, `When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.`, (value) => value === undefined ? true : parseBool(value))
1269
+ .option(`--enabled [value]`, `Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1270
+ .option(`--logging [value]`, `When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1380
1271
  .option(`--timeout <timeout>`, `Maximum request time in seconds.`, parseInteger)
1381
1272
  .option(`--install-command <install-command>`, `Install Command.`)
1382
1273
  .option(`--build-command <build-command>`, `Build Command.`)
@@ -1386,7 +1277,7 @@ sites
1386
1277
  .option(`--fallback-file <fallback-file>`, `Fallback file for single page application sites.`)
1387
1278
  .option(`--provider-repository-id <provider-repository-id>`, `Repository ID of the repo linked to the site.`)
1388
1279
  .option(`--provider-branch <provider-branch>`, `Production branch for the repo linked to the site.`)
1389
- .option(`--provider-silent-mode [value]`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.`, (value) => value === undefined ? true : parseBool(value))
1280
+ .option(`--provider-silent-mode [value]`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1390
1281
  .option(`--provider-root-directory <provider-root-directory>`, `Path to site code in the linked repo.`)
1391
1282
  .option(`--specification <specification>`, `Framework specification for the site and builds.`)
1392
1283
  .action(actionRunner(sitesCreate))
@@ -1440,8 +1331,8 @@ sites
1440
1331
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
1441
1332
  .requiredOption(`--name <name>`, `Site name. Max length: 128 chars.`)
1442
1333
  .requiredOption(`--framework <framework>`, `Sites framework.`)
1443
- .option(`--enabled [value]`, `Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
1444
- .option(`--logging [value]`, `When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.`, (value) => value === undefined ? true : parseBool(value))
1334
+ .option(`--enabled [value]`, `Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1335
+ .option(`--logging [value]`, `When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1445
1336
  .option(`--timeout <timeout>`, `Maximum request time in seconds.`, parseInteger)
1446
1337
  .option(`--install-command <install-command>`, `Install Command.`)
1447
1338
  .option(`--build-command <build-command>`, `Build Command.`)
@@ -1452,7 +1343,7 @@ sites
1452
1343
  .option(`--installation-id <installation-id>`, `Appwrite Installation ID for VCS (Version Control System) deployment.`)
1453
1344
  .option(`--provider-repository-id <provider-repository-id>`, `Repository ID of the repo linked to the site.`)
1454
1345
  .option(`--provider-branch <provider-branch>`, `Production branch for the repo linked to the site.`)
1455
- .option(`--provider-silent-mode [value]`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.`, (value) => value === undefined ? true : parseBool(value))
1346
+ .option(`--provider-silent-mode [value]`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1456
1347
  .option(`--provider-root-directory <provider-root-directory>`, `Path to site code in the linked repo.`)
1457
1348
  .option(`--specification <specification>`, `Framework specification for the site and builds.`)
1458
1349
  .action(actionRunner(sitesUpdate))
@@ -1476,7 +1367,7 @@ sites
1476
1367
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
1477
1368
  .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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type`)
1478
1369
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1479
- .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))
1370
+ .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))
1480
1371
  .option(`--console`, `Get the resource console url`)
1481
1372
  .action(actionRunner(sitesListDeployments))
1482
1373
 
@@ -1485,7 +1376,7 @@ sites
1485
1376
  .description(`Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.`)
1486
1377
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
1487
1378
  .requiredOption(`--code <code>`, `Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.`)
1488
- .requiredOption(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
1379
+ .requiredOption(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1489
1380
  .option(`--install-command <install-command>`, `Install Commands.`)
1490
1381
  .option(`--build-command <build-command>`, `Build Commands.`)
1491
1382
  .option(`--output-directory <output-directory>`, `Output Directory.`)
@@ -1507,7 +1398,7 @@ sites
1507
1398
  .requiredOption(`--root-directory <root-directory>`, `Path to site code in the template repo.`)
1508
1399
  .requiredOption(`--type <type>`, `Type for the reference provided. Can be commit, branch, or tag`)
1509
1400
  .requiredOption(`--reference <reference>`, `Reference value, can be a commit hash, branch name, or release tag`)
1510
- .option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
1401
+ .option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1511
1402
  .action(actionRunner(sitesCreateTemplateDeployment))
1512
1403
 
1513
1404
  sites
@@ -1516,7 +1407,7 @@ sites
1516
1407
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
1517
1408
  .requiredOption(`--type <type>`, `Type of reference passed. Allowed values are: branch, commit`)
1518
1409
  .requiredOption(`--reference <reference>`, `VCS reference to create deployment from. Depending on type this can be: branch name, commit hash`)
1519
- .option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
1410
+ .option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1520
1411
  .action(actionRunner(sitesCreateVcsDeployment))
1521
1412
 
1522
1413
  sites
@@ -1556,7 +1447,7 @@ sites
1556
1447
  .description(`Get a list of all site logs. You can use the query params to filter your results.`)
1557
1448
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
1558
1449
  .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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId`)
1559
- .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))
1450
+ .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))
1560
1451
  .action(actionRunner(sitesListLogs))
1561
1452
 
1562
1453
  sites
@@ -1593,7 +1484,7 @@ sites
1593
1484
  .requiredOption(`--site-id <site-id>`, `Site unique ID.`)
1594
1485
  .requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
1595
1486
  .requiredOption(`--value <value>`, `Variable value. Max length: 8192 chars.`)
1596
- .option(`--secret [value]`, `Secret variables can be updated or deleted, but only sites can read them during build and runtime.`, (value) => value === undefined ? true : parseBool(value))
1487
+ .option(`--secret [value]`, `Secret variables can be updated or deleted, but only sites can read them during build and runtime.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1597
1488
  .action(actionRunner(sitesCreateVariable))
1598
1489
 
1599
1490
  sites
@@ -1610,7 +1501,7 @@ sites
1610
1501
  .requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
1611
1502
  .requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
1612
1503
  .option(`--value <value>`, `Variable value. Max length: 8192 chars.`)
1613
- .option(`--secret [value]`, `Secret variables can be updated or deleted, but only sites can read them during build and runtime.`, (value) => value === undefined ? true : parseBool(value))
1504
+ .option(`--secret [value]`, `Secret variables can be updated or deleted, but only sites can read them during build and runtime.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
1614
1505
  .action(actionRunner(sitesUpdateVariable))
1615
1506
 
1616
1507
  sites
@@ -1620,35 +1511,4 @@ sites
1620
1511
  .requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
1621
1512
  .action(actionRunner(sitesDeleteVariable))
1622
1513
 
1623
- module.exports = {
1624
- sites,
1625
- sitesList,
1626
- sitesCreate,
1627
- sitesListFrameworks,
1628
- sitesListSpecifications,
1629
- sitesListTemplates,
1630
- sitesGetTemplate,
1631
- sitesListUsage,
1632
- sitesGet,
1633
- sitesUpdate,
1634
- sitesDelete,
1635
- sitesUpdateSiteDeployment,
1636
- sitesListDeployments,
1637
- sitesCreateDeployment,
1638
- sitesCreateDuplicateDeployment,
1639
- sitesCreateTemplateDeployment,
1640
- sitesCreateVcsDeployment,
1641
- sitesGetDeployment,
1642
- sitesDeleteDeployment,
1643
- sitesGetDeploymentDownload,
1644
- sitesUpdateDeploymentStatus,
1645
- sitesListLogs,
1646
- sitesGetLog,
1647
- sitesDeleteLog,
1648
- sitesGetUsage,
1649
- sitesListVariables,
1650
- sitesCreateVariable,
1651
- sitesGetVariable,
1652
- sitesUpdateVariable,
1653
- sitesDeleteVariable
1654
- };
1514
+