@appwrite.io/console 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (595) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/README.md +3 -3
  3. package/dist/cjs/sdk.js +6731 -3907
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +6729 -3908
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +6731 -3907
  8. package/docs/examples/account/create-anonymous-session.md +1 -1
  9. package/docs/examples/account/create-billing-address.md +1 -1
  10. package/docs/examples/account/create-email-password-session.md +1 -1
  11. package/docs/examples/account/create-email-token.md +1 -1
  12. package/docs/examples/account/create-j-w-t.md +1 -1
  13. package/docs/examples/account/create-magic-u-r-l-token.md +1 -1
  14. package/docs/examples/account/create-mfa-authenticator.md +1 -1
  15. package/docs/examples/account/create-mfa-challenge.md +1 -1
  16. package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
  17. package/docs/examples/account/create-o-auth2session.md +1 -1
  18. package/docs/examples/account/create-o-auth2token.md +1 -1
  19. package/docs/examples/account/create-payment-method.md +1 -1
  20. package/docs/examples/account/create-phone-token.md +1 -1
  21. package/docs/examples/account/create-phone-verification.md +1 -1
  22. package/docs/examples/account/create-push-target.md +1 -1
  23. package/docs/examples/account/create-recovery.md +1 -1
  24. package/docs/examples/account/create-session.md +1 -1
  25. package/docs/examples/account/create-verification.md +1 -1
  26. package/docs/examples/account/create.md +1 -1
  27. package/docs/examples/account/delete-billing-address.md +1 -1
  28. package/docs/examples/account/delete-identity.md +1 -1
  29. package/docs/examples/account/delete-mfa-authenticator.md +1 -1
  30. package/docs/examples/account/delete-payment-method.md +1 -1
  31. package/docs/examples/account/delete-push-target.md +1 -1
  32. package/docs/examples/account/delete-session.md +1 -1
  33. package/docs/examples/account/delete-sessions.md +1 -1
  34. package/docs/examples/account/delete.md +1 -1
  35. package/docs/examples/account/get-billing-address.md +1 -1
  36. package/docs/examples/account/get-coupon.md +1 -1
  37. package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
  38. package/docs/examples/account/get-payment-method.md +1 -1
  39. package/docs/examples/account/get-prefs.md +1 -1
  40. package/docs/examples/account/get-session.md +1 -1
  41. package/docs/examples/account/get.md +1 -1
  42. package/docs/examples/account/list-billing-addresses.md +1 -1
  43. package/docs/examples/account/list-identities.md +1 -1
  44. package/docs/examples/account/list-invoices.md +1 -1
  45. package/docs/examples/account/list-logs.md +1 -1
  46. package/docs/examples/account/list-mfa-factors.md +1 -1
  47. package/docs/examples/account/list-payment-methods.md +1 -1
  48. package/docs/examples/account/list-sessions.md +1 -1
  49. package/docs/examples/account/update-billing-address.md +1 -1
  50. package/docs/examples/account/update-email.md +1 -1
  51. package/docs/examples/account/update-m-f-a.md +1 -1
  52. package/docs/examples/account/update-magic-u-r-l-session.md +1 -1
  53. package/docs/examples/account/update-mfa-authenticator.md +1 -1
  54. package/docs/examples/account/update-mfa-challenge.md +1 -1
  55. package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
  56. package/docs/examples/account/update-name.md +1 -1
  57. package/docs/examples/account/update-password.md +1 -1
  58. package/docs/examples/account/update-payment-method-mandate-options.md +1 -1
  59. package/docs/examples/account/update-payment-method-provider.md +1 -1
  60. package/docs/examples/account/update-payment-method.md +1 -1
  61. package/docs/examples/account/update-phone-session.md +1 -1
  62. package/docs/examples/account/update-phone-verification.md +1 -1
  63. package/docs/examples/account/update-phone.md +1 -1
  64. package/docs/examples/account/update-prefs.md +1 -1
  65. package/docs/examples/account/update-push-target.md +1 -1
  66. package/docs/examples/account/update-recovery.md +1 -1
  67. package/docs/examples/account/update-session.md +1 -1
  68. package/docs/examples/account/update-status.md +1 -1
  69. package/docs/examples/account/update-verification.md +1 -1
  70. package/docs/examples/assistant/chat.md +1 -1
  71. package/docs/examples/avatars/get-browser.md +2 -2
  72. package/docs/examples/avatars/get-credit-card.md +2 -2
  73. package/docs/examples/avatars/get-favicon.md +1 -1
  74. package/docs/examples/avatars/get-flag.md +2 -2
  75. package/docs/examples/avatars/get-image.md +1 -1
  76. package/docs/examples/avatars/get-initials.md +1 -1
  77. package/docs/examples/avatars/get-q-r.md +1 -1
  78. package/docs/examples/backups/create-archive.md +1 -1
  79. package/docs/examples/backups/create-policy.md +1 -1
  80. package/docs/examples/backups/create-restoration.md +1 -1
  81. package/docs/examples/backups/delete-archive.md +1 -1
  82. package/docs/examples/backups/delete-policy.md +1 -1
  83. package/docs/examples/backups/get-archive.md +1 -1
  84. package/docs/examples/backups/get-policy.md +1 -1
  85. package/docs/examples/backups/get-restoration.md +1 -1
  86. package/docs/examples/backups/list-archives.md +1 -1
  87. package/docs/examples/backups/list-policies.md +1 -1
  88. package/docs/examples/backups/list-restorations.md +1 -1
  89. package/docs/examples/backups/update-policy.md +1 -1
  90. package/docs/examples/console/create-program-membership.md +1 -1
  91. package/docs/examples/console/create-source.md +1 -1
  92. package/docs/examples/console/get-campaign.md +1 -1
  93. package/docs/examples/console/get-coupon.md +1 -1
  94. package/docs/examples/console/get-resource.md +14 -0
  95. package/docs/examples/console/plans.md +1 -1
  96. package/docs/examples/console/regions.md +1 -1
  97. package/docs/examples/console/variables.md +1 -1
  98. package/docs/examples/databases/create-boolean-attribute.md +1 -1
  99. package/docs/examples/databases/create-collection.md +1 -1
  100. package/docs/examples/databases/create-datetime-attribute.md +1 -1
  101. package/docs/examples/databases/create-document.md +4 -2
  102. package/docs/examples/databases/create-documents.md +15 -0
  103. package/docs/examples/databases/create-email-attribute.md +1 -1
  104. package/docs/examples/databases/create-enum-attribute.md +1 -1
  105. package/docs/examples/databases/create-float-attribute.md +1 -1
  106. package/docs/examples/databases/create-index.md +3 -2
  107. package/docs/examples/databases/create-integer-attribute.md +1 -1
  108. package/docs/examples/databases/create-ip-attribute.md +1 -1
  109. package/docs/examples/databases/create-relationship-attribute.md +1 -1
  110. package/docs/examples/databases/create-string-attribute.md +1 -1
  111. package/docs/examples/databases/create-url-attribute.md +1 -1
  112. package/docs/examples/databases/create.md +1 -1
  113. package/docs/examples/databases/delete-attribute.md +1 -1
  114. package/docs/examples/databases/delete-collection.md +1 -1
  115. package/docs/examples/databases/delete-document.md +1 -1
  116. package/docs/examples/databases/delete-documents.md +15 -0
  117. package/docs/examples/databases/delete-index.md +1 -1
  118. package/docs/examples/databases/delete.md +1 -1
  119. package/docs/examples/databases/get-attribute.md +1 -1
  120. package/docs/examples/databases/get-collection-usage.md +1 -1
  121. package/docs/examples/databases/get-collection.md +1 -1
  122. package/docs/examples/databases/get-database-usage.md +1 -1
  123. package/docs/examples/databases/get-document.md +1 -1
  124. package/docs/examples/databases/get-index.md +1 -1
  125. package/docs/examples/databases/get-usage.md +1 -1
  126. package/docs/examples/databases/get.md +1 -1
  127. package/docs/examples/databases/list-attributes.md +1 -1
  128. package/docs/examples/databases/list-collection-logs.md +1 -1
  129. package/docs/examples/databases/list-collections.md +1 -1
  130. package/docs/examples/databases/list-document-logs.md +1 -1
  131. package/docs/examples/databases/list-documents.md +1 -1
  132. package/docs/examples/databases/list-indexes.md +1 -1
  133. package/docs/examples/databases/list-logs.md +1 -1
  134. package/docs/examples/databases/list.md +1 -1
  135. package/docs/examples/databases/update-boolean-attribute.md +1 -1
  136. package/docs/examples/databases/update-collection.md +1 -1
  137. package/docs/examples/databases/update-datetime-attribute.md +1 -1
  138. package/docs/examples/databases/update-document.md +1 -1
  139. package/docs/examples/databases/update-documents.md +16 -0
  140. package/docs/examples/databases/update-email-attribute.md +1 -1
  141. package/docs/examples/databases/update-enum-attribute.md +1 -1
  142. package/docs/examples/databases/update-float-attribute.md +1 -1
  143. package/docs/examples/databases/update-integer-attribute.md +1 -1
  144. package/docs/examples/databases/update-ip-attribute.md +1 -1
  145. package/docs/examples/databases/update-relationship-attribute.md +1 -1
  146. package/docs/examples/databases/update-string-attribute.md +1 -1
  147. package/docs/examples/databases/update-url-attribute.md +1 -1
  148. package/docs/examples/databases/update.md +1 -1
  149. package/docs/examples/databases/upsert-documents.md +15 -0
  150. package/docs/examples/domains/create-preset-google-workspace.md +13 -0
  151. package/docs/examples/domains/create-preset-i-cloud.md +13 -0
  152. package/docs/examples/domains/create-preset-mailgun.md +13 -0
  153. package/docs/examples/domains/create-preset-outlook.md +13 -0
  154. package/docs/examples/domains/create-preset-proton-mail.md +13 -0
  155. package/docs/examples/domains/create-preset-zoho.md +13 -0
  156. package/docs/examples/domains/create-record-a-a-a-a.md +17 -0
  157. package/docs/examples/domains/create-record-a.md +17 -0
  158. package/docs/examples/domains/create-record-alias.md +17 -0
  159. package/docs/examples/domains/create-record-c-a-a.md +17 -0
  160. package/docs/examples/domains/create-record-c-n-a-m-e.md +17 -0
  161. package/docs/examples/domains/create-record-h-t-t-p-s.md +17 -0
  162. package/docs/examples/domains/create-record-m-x.md +18 -0
  163. package/docs/examples/domains/create-record-n-s.md +17 -0
  164. package/docs/examples/domains/create-record-s-r-v.md +20 -0
  165. package/docs/examples/domains/create-record-t-x-t.md +17 -0
  166. package/docs/examples/domains/create.md +14 -0
  167. package/docs/examples/domains/delete-record.md +14 -0
  168. package/docs/examples/domains/delete.md +13 -0
  169. package/docs/examples/domains/get-preset-google-workspace.md +13 -0
  170. package/docs/examples/domains/get-preset-i-cloud.md +13 -0
  171. package/docs/examples/domains/get-preset-mailgun.md +13 -0
  172. package/docs/examples/domains/get-preset-outlook.md +13 -0
  173. package/docs/examples/domains/get-preset-proton-mail.md +13 -0
  174. package/docs/examples/domains/get-preset-zoho.md +13 -0
  175. package/docs/examples/domains/get-record.md +14 -0
  176. package/docs/examples/domains/get-zone.md +13 -0
  177. package/docs/examples/domains/get.md +13 -0
  178. package/docs/examples/domains/list-records.md +14 -0
  179. package/docs/examples/domains/list.md +14 -0
  180. package/docs/examples/domains/update-nameservers.md +13 -0
  181. package/docs/examples/domains/update-record-a-a-a-a.md +18 -0
  182. package/docs/examples/domains/update-record-a.md +18 -0
  183. package/docs/examples/domains/update-record-alias.md +18 -0
  184. package/docs/examples/domains/update-record-c-a-a.md +18 -0
  185. package/docs/examples/domains/update-record-c-n-a-m-e.md +18 -0
  186. package/docs/examples/domains/update-record-h-t-t-p-s.md +18 -0
  187. package/docs/examples/domains/update-record-m-x.md +19 -0
  188. package/docs/examples/domains/update-record-n-s.md +18 -0
  189. package/docs/examples/domains/update-record-s-r-v.md +21 -0
  190. package/docs/examples/domains/update-record-t-x-t.md +18 -0
  191. package/docs/examples/domains/update-team.md +14 -0
  192. package/docs/examples/domains/update-zone.md +14 -0
  193. package/docs/examples/functions/create-deployment.md +1 -1
  194. package/docs/examples/functions/create-duplicate-deployment.md +15 -0
  195. package/docs/examples/functions/create-execution.md +1 -1
  196. package/docs/examples/functions/create-template-deployment.md +18 -0
  197. package/docs/examples/functions/create-variable.md +3 -2
  198. package/docs/examples/functions/create-vcs-deployment.md +16 -0
  199. package/docs/examples/functions/create.md +3 -3
  200. package/docs/examples/functions/delete-deployment.md +1 -1
  201. package/docs/examples/functions/delete-execution.md +1 -1
  202. package/docs/examples/functions/delete-variable.md +1 -1
  203. package/docs/examples/functions/delete.md +1 -1
  204. package/docs/examples/functions/get-deployment-download.md +4 -3
  205. package/docs/examples/functions/get-deployment.md +1 -1
  206. package/docs/examples/functions/get-execution.md +1 -1
  207. package/docs/examples/functions/get-template.md +1 -1
  208. package/docs/examples/functions/get-usage.md +2 -1
  209. package/docs/examples/functions/get-variable.md +1 -1
  210. package/docs/examples/functions/get.md +1 -1
  211. package/docs/examples/functions/list-deployments.md +1 -1
  212. package/docs/examples/functions/list-executions.md +2 -3
  213. package/docs/examples/functions/list-runtimes.md +1 -1
  214. package/docs/examples/functions/list-specifications.md +1 -1
  215. package/docs/examples/functions/list-templates.md +1 -1
  216. package/docs/examples/functions/list-usage.md +13 -0
  217. package/docs/examples/functions/list-variables.md +1 -1
  218. package/docs/examples/functions/list.md +1 -1
  219. package/docs/examples/functions/update-deployment-status.md +14 -0
  220. package/docs/examples/functions/update-function-deployment.md +14 -0
  221. package/docs/examples/functions/update-variable.md +3 -2
  222. package/docs/examples/functions/update.md +1 -1
  223. package/docs/examples/graphql/mutation.md +1 -1
  224. package/docs/examples/graphql/query.md +1 -1
  225. package/docs/examples/health/get-antivirus.md +1 -1
  226. package/docs/examples/health/get-cache.md +1 -1
  227. package/docs/examples/health/get-certificate.md +1 -1
  228. package/docs/examples/health/get-d-b.md +1 -1
  229. package/docs/examples/health/get-failed-jobs.md +1 -1
  230. package/docs/examples/health/get-pub-sub.md +1 -1
  231. package/docs/examples/health/get-queue-billing-aggregation.md +1 -1
  232. package/docs/examples/health/get-queue-builds.md +1 -1
  233. package/docs/examples/health/get-queue-certificates.md +1 -1
  234. package/docs/examples/health/get-queue-databases.md +1 -1
  235. package/docs/examples/health/get-queue-deletes.md +1 -1
  236. package/docs/examples/health/get-queue-functions.md +1 -1
  237. package/docs/examples/health/get-queue-logs.md +1 -1
  238. package/docs/examples/health/get-queue-mails.md +1 -1
  239. package/docs/examples/health/get-queue-messaging.md +1 -1
  240. package/docs/examples/health/get-queue-migrations.md +1 -1
  241. package/docs/examples/health/get-queue-priority-builds.md +1 -1
  242. package/docs/examples/health/get-queue-region-manager.md +13 -0
  243. package/docs/examples/health/get-queue-stats-resources.md +1 -1
  244. package/docs/examples/health/get-queue-usage.md +1 -1
  245. package/docs/examples/health/get-queue-webhooks.md +1 -1
  246. package/docs/examples/health/get-storage-local.md +1 -1
  247. package/docs/examples/health/get-storage.md +1 -1
  248. package/docs/examples/health/get-time.md +1 -1
  249. package/docs/examples/health/get.md +1 -1
  250. package/docs/examples/locale/get.md +1 -1
  251. package/docs/examples/locale/list-codes.md +1 -1
  252. package/docs/examples/locale/list-continents.md +1 -1
  253. package/docs/examples/locale/list-countries-e-u.md +1 -1
  254. package/docs/examples/locale/list-countries-phones.md +1 -1
  255. package/docs/examples/locale/list-countries.md +1 -1
  256. package/docs/examples/locale/list-currencies.md +1 -1
  257. package/docs/examples/locale/list-languages.md +1 -1
  258. package/docs/examples/messaging/create-apns-provider.md +1 -1
  259. package/docs/examples/messaging/create-email.md +1 -1
  260. package/docs/examples/messaging/create-fcm-provider.md +1 -1
  261. package/docs/examples/messaging/create-mailgun-provider.md +1 -1
  262. package/docs/examples/messaging/create-msg91provider.md +1 -1
  263. package/docs/examples/messaging/create-push.md +1 -1
  264. package/docs/examples/messaging/create-sendgrid-provider.md +1 -1
  265. package/docs/examples/messaging/create-sms.md +1 -1
  266. package/docs/examples/messaging/create-smtp-provider.md +1 -1
  267. package/docs/examples/messaging/create-subscriber.md +1 -1
  268. package/docs/examples/messaging/create-telesign-provider.md +1 -1
  269. package/docs/examples/messaging/create-textmagic-provider.md +1 -1
  270. package/docs/examples/messaging/create-topic.md +1 -1
  271. package/docs/examples/messaging/create-twilio-provider.md +1 -1
  272. package/docs/examples/messaging/create-vonage-provider.md +1 -1
  273. package/docs/examples/messaging/delete-provider.md +1 -1
  274. package/docs/examples/messaging/delete-subscriber.md +1 -1
  275. package/docs/examples/messaging/delete-topic.md +1 -1
  276. package/docs/examples/messaging/delete.md +1 -1
  277. package/docs/examples/messaging/get-message.md +1 -1
  278. package/docs/examples/messaging/get-provider.md +1 -1
  279. package/docs/examples/messaging/get-subscriber.md +1 -1
  280. package/docs/examples/messaging/get-topic.md +1 -1
  281. package/docs/examples/messaging/list-message-logs.md +1 -1
  282. package/docs/examples/messaging/list-messages.md +1 -1
  283. package/docs/examples/messaging/list-provider-logs.md +1 -1
  284. package/docs/examples/messaging/list-providers.md +1 -1
  285. package/docs/examples/messaging/list-subscriber-logs.md +1 -1
  286. package/docs/examples/messaging/list-subscribers.md +1 -1
  287. package/docs/examples/messaging/list-targets.md +1 -1
  288. package/docs/examples/messaging/list-topic-logs.md +1 -1
  289. package/docs/examples/messaging/list-topics.md +1 -1
  290. package/docs/examples/messaging/update-apns-provider.md +1 -1
  291. package/docs/examples/messaging/update-email.md +1 -1
  292. package/docs/examples/messaging/update-fcm-provider.md +1 -1
  293. package/docs/examples/messaging/update-mailgun-provider.md +1 -1
  294. package/docs/examples/messaging/update-msg91provider.md +1 -1
  295. package/docs/examples/messaging/update-push.md +1 -1
  296. package/docs/examples/messaging/update-sendgrid-provider.md +1 -1
  297. package/docs/examples/messaging/update-sms.md +1 -1
  298. package/docs/examples/messaging/update-smtp-provider.md +1 -1
  299. package/docs/examples/messaging/update-telesign-provider.md +1 -1
  300. package/docs/examples/messaging/update-textmagic-provider.md +1 -1
  301. package/docs/examples/messaging/update-topic.md +1 -1
  302. package/docs/examples/messaging/update-twilio-provider.md +1 -1
  303. package/docs/examples/messaging/update-vonage-provider.md +1 -1
  304. package/docs/examples/migrations/create-appwrite-migration.md +1 -1
  305. package/docs/examples/migrations/create-csv-migration.md +15 -0
  306. package/docs/examples/migrations/create-firebase-migration.md +1 -1
  307. package/docs/examples/migrations/create-n-host-migration.md +1 -1
  308. package/docs/examples/migrations/create-supabase-migration.md +1 -1
  309. package/docs/examples/migrations/delete.md +1 -1
  310. package/docs/examples/migrations/get-appwrite-report.md +1 -1
  311. package/docs/examples/migrations/get-firebase-report.md +1 -1
  312. package/docs/examples/migrations/get-n-host-report.md +1 -1
  313. package/docs/examples/migrations/get-supabase-report.md +1 -1
  314. package/docs/examples/migrations/get.md +1 -1
  315. package/docs/examples/migrations/list.md +1 -1
  316. package/docs/examples/migrations/retry.md +1 -1
  317. package/docs/examples/organizations/add-credit.md +1 -1
  318. package/docs/examples/organizations/create-invoice-payment.md +1 -1
  319. package/docs/examples/organizations/create.md +1 -1
  320. package/docs/examples/organizations/delete-backup-payment-method.md +1 -1
  321. package/docs/examples/organizations/delete-billing-address.md +1 -1
  322. package/docs/examples/organizations/delete-default-payment-method.md +1 -1
  323. package/docs/examples/organizations/delete.md +1 -1
  324. package/docs/examples/organizations/get-aggregation.md +1 -1
  325. package/docs/examples/organizations/get-billing-address.md +1 -1
  326. package/docs/examples/organizations/get-credit.md +1 -1
  327. package/docs/examples/organizations/get-invoice-download.md +1 -1
  328. package/docs/examples/organizations/get-invoice-view.md +1 -1
  329. package/docs/examples/organizations/get-invoice.md +1 -1
  330. package/docs/examples/organizations/get-payment-method.md +1 -1
  331. package/docs/examples/organizations/get-plan.md +1 -1
  332. package/docs/examples/organizations/get-scopes.md +1 -1
  333. package/docs/examples/organizations/list-aggregations.md +1 -1
  334. package/docs/examples/organizations/list-credits.md +1 -1
  335. package/docs/examples/organizations/list-invoices.md +1 -1
  336. package/docs/examples/organizations/list.md +1 -1
  337. package/docs/examples/organizations/set-backup-payment-method.md +1 -1
  338. package/docs/examples/organizations/set-billing-address.md +1 -1
  339. package/docs/examples/organizations/set-billing-email.md +1 -1
  340. package/docs/examples/organizations/set-billing-tax-id.md +1 -1
  341. package/docs/examples/organizations/set-default-payment-method.md +1 -1
  342. package/docs/examples/organizations/update-budget.md +1 -1
  343. package/docs/examples/organizations/update-plan.md +1 -1
  344. package/docs/examples/organizations/validate-invoice.md +1 -1
  345. package/docs/examples/project/create-variable.md +3 -2
  346. package/docs/examples/project/delete-variable.md +1 -1
  347. package/docs/examples/project/get-usage.md +1 -1
  348. package/docs/examples/project/get-variable.md +1 -1
  349. package/docs/examples/project/list-variables.md +1 -1
  350. package/docs/examples/project/update-variable.md +3 -2
  351. package/docs/examples/projects/create-dev-key.md +15 -0
  352. package/docs/examples/projects/create-j-w-t.md +1 -1
  353. package/docs/examples/projects/create-key.md +1 -1
  354. package/docs/examples/projects/create-platform.md +1 -1
  355. package/docs/examples/projects/create-smtp-test.md +1 -1
  356. package/docs/examples/projects/create-webhook.md +1 -1
  357. package/docs/examples/projects/create.md +2 -2
  358. package/docs/examples/projects/delete-dev-key.md +14 -0
  359. package/docs/examples/projects/delete-email-template.md +1 -1
  360. package/docs/examples/projects/delete-key.md +1 -1
  361. package/docs/examples/projects/delete-platform.md +1 -1
  362. package/docs/examples/projects/delete-sms-template.md +1 -1
  363. package/docs/examples/projects/delete-webhook.md +1 -1
  364. package/docs/examples/projects/delete.md +1 -1
  365. package/docs/examples/projects/get-dev-key.md +14 -0
  366. package/docs/examples/projects/get-email-template.md +1 -1
  367. package/docs/examples/projects/get-key.md +1 -1
  368. package/docs/examples/projects/get-platform.md +1 -1
  369. package/docs/examples/projects/get-sms-template.md +1 -1
  370. package/docs/examples/projects/get-webhook.md +1 -1
  371. package/docs/examples/projects/get.md +1 -1
  372. package/docs/examples/projects/list-dev-keys.md +14 -0
  373. package/docs/examples/projects/list-keys.md +1 -1
  374. package/docs/examples/projects/list-platforms.md +1 -1
  375. package/docs/examples/projects/list-webhooks.md +1 -1
  376. package/docs/examples/projects/list.md +1 -1
  377. package/docs/examples/projects/update-api-status-all.md +1 -1
  378. package/docs/examples/projects/update-api-status.md +1 -1
  379. package/docs/examples/projects/update-auth-duration.md +1 -1
  380. package/docs/examples/projects/update-auth-limit.md +1 -1
  381. package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
  382. package/docs/examples/projects/update-auth-password-history.md +1 -1
  383. package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
  384. package/docs/examples/projects/update-auth-status.md +1 -1
  385. package/docs/examples/projects/update-dev-key.md +16 -0
  386. package/docs/examples/projects/update-email-template.md +1 -1
  387. package/docs/examples/projects/update-key.md +1 -1
  388. package/docs/examples/projects/update-memberships-privacy.md +1 -1
  389. package/docs/examples/projects/update-mock-numbers.md +1 -1
  390. package/docs/examples/projects/update-o-auth2.md +1 -1
  391. package/docs/examples/projects/update-personal-data-check.md +1 -1
  392. package/docs/examples/projects/update-platform.md +1 -1
  393. package/docs/examples/projects/update-service-status-all.md +1 -1
  394. package/docs/examples/projects/update-service-status.md +1 -1
  395. package/docs/examples/projects/update-session-alerts.md +1 -1
  396. package/docs/examples/projects/update-sms-template.md +1 -1
  397. package/docs/examples/projects/update-smtp.md +1 -1
  398. package/docs/examples/projects/update-team.md +1 -1
  399. package/docs/examples/projects/update-webhook-signature.md +1 -1
  400. package/docs/examples/projects/update-webhook.md +1 -1
  401. package/docs/examples/projects/update.md +1 -1
  402. package/docs/examples/proxy/create-a-p-i-rule.md +13 -0
  403. package/docs/examples/proxy/create-function-rule.md +15 -0
  404. package/docs/examples/proxy/create-redirect-rule.md +15 -0
  405. package/docs/examples/proxy/create-site-rule.md +15 -0
  406. package/docs/examples/proxy/delete-rule.md +1 -1
  407. package/docs/examples/proxy/get-rule.md +1 -1
  408. package/docs/examples/proxy/list-rules.md +1 -1
  409. package/docs/examples/proxy/update-rule-verification.md +1 -1
  410. package/docs/examples/sites/create-deployment.md +18 -0
  411. package/docs/examples/sites/create-duplicate-deployment.md +14 -0
  412. package/docs/examples/sites/create-template-deployment.md +18 -0
  413. package/docs/examples/sites/create-variable.md +16 -0
  414. package/docs/examples/sites/create-vcs-deployment.md +16 -0
  415. package/docs/examples/sites/create.md +30 -0
  416. package/docs/examples/sites/delete-deployment.md +14 -0
  417. package/docs/examples/sites/delete-log.md +14 -0
  418. package/docs/examples/sites/delete-variable.md +14 -0
  419. package/docs/examples/sites/delete.md +13 -0
  420. package/docs/examples/sites/get-deployment-download.md +15 -0
  421. package/docs/examples/sites/get-deployment.md +14 -0
  422. package/docs/examples/sites/get-log.md +14 -0
  423. package/docs/examples/sites/get-template.md +13 -0
  424. package/docs/examples/sites/get-usage.md +14 -0
  425. package/docs/examples/sites/get-variable.md +14 -0
  426. package/docs/examples/sites/get.md +13 -0
  427. package/docs/examples/sites/list-deployments.md +15 -0
  428. package/docs/examples/sites/list-frameworks.md +11 -0
  429. package/docs/examples/sites/list-logs.md +14 -0
  430. package/docs/examples/sites/list-specifications.md +11 -0
  431. package/docs/examples/sites/list-templates.md +16 -0
  432. package/docs/examples/sites/list-usage.md +13 -0
  433. package/docs/examples/sites/list-variables.md +13 -0
  434. package/docs/examples/sites/list.md +14 -0
  435. package/docs/examples/sites/update-deployment-status.md +14 -0
  436. package/docs/examples/sites/update-site-deployment.md +14 -0
  437. package/docs/examples/sites/update-variable.md +17 -0
  438. package/docs/examples/sites/update.md +30 -0
  439. package/docs/examples/storage/create-bucket.md +1 -1
  440. package/docs/examples/storage/create-file.md +1 -1
  441. package/docs/examples/storage/delete-bucket.md +1 -1
  442. package/docs/examples/storage/delete-file.md +1 -1
  443. package/docs/examples/storage/get-bucket-usage.md +1 -1
  444. package/docs/examples/storage/get-bucket.md +1 -1
  445. package/docs/examples/storage/get-file-download.md +3 -2
  446. package/docs/examples/storage/get-file-preview.md +4 -3
  447. package/docs/examples/storage/get-file-view.md +3 -2
  448. package/docs/examples/storage/get-file.md +1 -1
  449. package/docs/examples/storage/get-usage.md +1 -1
  450. package/docs/examples/storage/list-buckets.md +1 -1
  451. package/docs/examples/storage/list-files.md +1 -1
  452. package/docs/examples/storage/update-bucket.md +1 -1
  453. package/docs/examples/storage/update-file.md +1 -1
  454. package/docs/examples/teams/create-membership.md +1 -1
  455. package/docs/examples/teams/create.md +1 -1
  456. package/docs/examples/teams/delete-membership.md +1 -1
  457. package/docs/examples/teams/delete.md +1 -1
  458. package/docs/examples/teams/get-membership.md +1 -1
  459. package/docs/examples/teams/get-prefs.md +1 -1
  460. package/docs/examples/teams/get.md +1 -1
  461. package/docs/examples/teams/list-logs.md +1 -1
  462. package/docs/examples/teams/list-memberships.md +1 -1
  463. package/docs/examples/teams/list.md +1 -1
  464. package/docs/examples/teams/update-membership-status.md +1 -1
  465. package/docs/examples/teams/update-membership.md +1 -1
  466. package/docs/examples/teams/update-name.md +1 -1
  467. package/docs/examples/teams/update-prefs.md +1 -1
  468. package/docs/examples/tokens/create-file-token.md +15 -0
  469. package/docs/examples/tokens/delete.md +13 -0
  470. package/docs/examples/tokens/get.md +13 -0
  471. package/docs/examples/tokens/list.md +15 -0
  472. package/docs/examples/tokens/update.md +14 -0
  473. package/docs/examples/users/create-argon2user.md +1 -1
  474. package/docs/examples/users/create-bcrypt-user.md +1 -1
  475. package/docs/examples/users/create-j-w-t.md +1 -1
  476. package/docs/examples/users/create-m-d5user.md +1 -1
  477. package/docs/examples/users/create-mfa-recovery-codes.md +1 -1
  478. package/docs/examples/users/create-p-h-pass-user.md +1 -1
  479. package/docs/examples/users/create-s-h-a-user.md +1 -1
  480. package/docs/examples/users/create-scrypt-modified-user.md +1 -1
  481. package/docs/examples/users/create-scrypt-user.md +1 -1
  482. package/docs/examples/users/create-session.md +1 -1
  483. package/docs/examples/users/create-target.md +1 -1
  484. package/docs/examples/users/create-token.md +1 -1
  485. package/docs/examples/users/create.md +1 -1
  486. package/docs/examples/users/delete-identity.md +1 -1
  487. package/docs/examples/users/delete-mfa-authenticator.md +1 -1
  488. package/docs/examples/users/delete-session.md +1 -1
  489. package/docs/examples/users/delete-sessions.md +1 -1
  490. package/docs/examples/users/delete-target.md +1 -1
  491. package/docs/examples/users/delete.md +1 -1
  492. package/docs/examples/users/get-mfa-recovery-codes.md +1 -1
  493. package/docs/examples/users/get-prefs.md +1 -1
  494. package/docs/examples/users/get-target.md +1 -1
  495. package/docs/examples/users/get-usage.md +1 -1
  496. package/docs/examples/users/get.md +1 -1
  497. package/docs/examples/users/list-identities.md +1 -1
  498. package/docs/examples/users/list-logs.md +1 -1
  499. package/docs/examples/users/list-memberships.md +4 -2
  500. package/docs/examples/users/list-mfa-factors.md +1 -1
  501. package/docs/examples/users/list-sessions.md +1 -1
  502. package/docs/examples/users/list-targets.md +1 -1
  503. package/docs/examples/users/list.md +1 -1
  504. package/docs/examples/users/update-email-verification.md +1 -1
  505. package/docs/examples/users/update-email.md +1 -1
  506. package/docs/examples/users/update-labels.md +1 -1
  507. package/docs/examples/users/update-mfa-recovery-codes.md +1 -1
  508. package/docs/examples/users/update-mfa.md +1 -1
  509. package/docs/examples/users/update-name.md +1 -1
  510. package/docs/examples/users/update-password.md +1 -1
  511. package/docs/examples/users/update-phone-verification.md +1 -1
  512. package/docs/examples/users/update-phone.md +1 -1
  513. package/docs/examples/users/update-prefs.md +1 -1
  514. package/docs/examples/users/update-status.md +1 -1
  515. package/docs/examples/users/update-target.md +1 -1
  516. package/docs/examples/vcs/create-repository-detection.md +3 -2
  517. package/docs/examples/vcs/create-repository.md +1 -1
  518. package/docs/examples/vcs/delete-installation.md +1 -1
  519. package/docs/examples/vcs/get-installation.md +1 -1
  520. package/docs/examples/vcs/get-repository-contents.md +1 -1
  521. package/docs/examples/vcs/get-repository.md +1 -1
  522. package/docs/examples/vcs/list-installations.md +1 -1
  523. package/docs/examples/vcs/list-repositories.md +3 -2
  524. package/docs/examples/vcs/list-repository-branches.md +1 -1
  525. package/docs/examples/vcs/update-external-deployments.md +1 -1
  526. package/package.json +1 -1
  527. package/src/client.ts +12 -2
  528. package/src/enums/adapter.ts +4 -0
  529. package/src/enums/api-service.ts +1 -0
  530. package/src/enums/build-runtime.ts +62 -0
  531. package/src/enums/console-resource-type.ts +3 -0
  532. package/src/enums/deployment-download-type.ts +4 -0
  533. package/src/enums/framework.ts +16 -0
  534. package/src/enums/image-format.ts +0 -1
  535. package/src/enums/name.ts +0 -1
  536. package/src/enums/region.ts +2 -1
  537. package/src/enums/runtime.ts +4 -3
  538. package/src/enums/site-usage-range.ts +5 -0
  539. package/src/enums/status-code.ts +6 -0
  540. package/src/enums/v-c-s-deployment-type.ts +5 -0
  541. package/src/enums/v-c-s-detection-type.ts +4 -0
  542. package/src/index.ts +13 -2
  543. package/src/models.ts +1092 -221
  544. package/src/services/account.ts +0 -16
  545. package/src/services/avatars.ts +0 -7
  546. package/src/services/backups.ts +0 -6
  547. package/src/services/console.ts +36 -5
  548. package/src/services/databases.ts +149 -18
  549. package/src/services/domains.ts +1821 -0
  550. package/src/services/functions.ts +174 -69
  551. package/src/services/health.ts +9 -34
  552. package/src/services/locale.ts +0 -8
  553. package/src/services/messaging.ts +0 -13
  554. package/src/services/migrations.ts +43 -6
  555. package/src/services/organizations.ts +0 -47
  556. package/src/services/project.ts +10 -5
  557. package/src/services/projects.ts +172 -10
  558. package/src/services/proxy.ts +124 -14
  559. package/src/services/sites.ts +1104 -0
  560. package/src/services/storage.ts +15 -12
  561. package/src/services/teams.ts +0 -6
  562. package/src/services/tokens.ts +160 -0
  563. package/src/services/users.ts +9 -13
  564. package/src/services/vcs.ts +54 -42
  565. package/types/enums/adapter.d.ts +4 -0
  566. package/types/enums/api-service.d.ts +1 -0
  567. package/types/enums/build-runtime.d.ts +62 -0
  568. package/types/enums/console-resource-type.d.ts +3 -0
  569. package/types/enums/deployment-download-type.d.ts +4 -0
  570. package/types/enums/framework.d.ts +16 -0
  571. package/types/enums/image-format.d.ts +0 -1
  572. package/types/enums/name.d.ts +0 -1
  573. package/types/enums/region.d.ts +3 -2
  574. package/types/enums/runtime.d.ts +5 -4
  575. package/types/enums/site-usage-range.d.ts +5 -0
  576. package/types/enums/status-code.d.ts +6 -0
  577. package/types/enums/v-c-s-deployment-type.d.ts +5 -0
  578. package/types/enums/v-c-s-detection-type.d.ts +4 -0
  579. package/types/index.d.ts +13 -2
  580. package/types/models.d.ts +1092 -221
  581. package/types/services/console.d.ts +10 -0
  582. package/types/services/databases.d.ts +44 -2
  583. package/types/services/domains.d.ts +524 -0
  584. package/types/services/functions.d.ts +60 -30
  585. package/types/services/health.d.ts +6 -6
  586. package/types/services/migrations.d.ts +10 -0
  587. package/types/services/organizations.d.ts +0 -10
  588. package/types/services/project.d.ts +4 -2
  589. package/types/services/projects.d.ts +48 -0
  590. package/types/services/proxy.d.ts +33 -5
  591. package/types/services/sites.d.ts +319 -0
  592. package/types/services/storage.d.ts +6 -3
  593. package/types/services/tokens.d.ts +51 -0
  594. package/types/services/users.d.ts +3 -1
  595. package/types/services/vcs.d.ts +15 -12
@@ -0,0 +1,1104 @@
1
+ import { Service } from '../service';
2
+ import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
3
+ import type { Models } from '../models';
4
+ import { Framework } from '../enums/framework';
5
+ import { BuildRuntime } from '../enums/build-runtime';
6
+ import { Adapter } from '../enums/adapter';
7
+ import { SiteUsageRange } from '../enums/site-usage-range';
8
+ import { VCSDeploymentType } from '../enums/v-c-s-deployment-type';
9
+ import { DeploymentDownloadType } from '../enums/deployment-download-type';
10
+
11
+ export class Sites {
12
+ client: Client;
13
+
14
+ constructor(client: Client) {
15
+ this.client = client;
16
+ }
17
+
18
+ /**
19
+ * Get a list of all the project's sites. You can use the query params to filter your results.
20
+ *
21
+ * @param {string[]} queries
22
+ * @param {string} search
23
+ * @throws {AppwriteException}
24
+ * @returns {Promise<Models.SiteList>}
25
+ */
26
+ list(queries?: string[], search?: string): Promise<Models.SiteList> {
27
+ const apiPath = '/sites';
28
+ const payload: Payload = {};
29
+ if (typeof queries !== 'undefined') {
30
+ payload['queries'] = queries;
31
+ }
32
+ if (typeof search !== 'undefined') {
33
+ payload['search'] = search;
34
+ }
35
+ const uri = new URL(this.client.config.endpoint + apiPath);
36
+
37
+ const apiHeaders: { [header: string]: string } = {
38
+ }
39
+
40
+ return this.client.call(
41
+ 'get',
42
+ uri,
43
+ apiHeaders,
44
+ payload
45
+ );
46
+ }
47
+ /**
48
+ * Create a new site.
49
+ *
50
+ * @param {string} siteId
51
+ * @param {string} name
52
+ * @param {Framework} framework
53
+ * @param {BuildRuntime} buildRuntime
54
+ * @param {boolean} enabled
55
+ * @param {boolean} logging
56
+ * @param {number} timeout
57
+ * @param {string} installCommand
58
+ * @param {string} buildCommand
59
+ * @param {string} outputDirectory
60
+ * @param {Adapter} adapter
61
+ * @param {string} installationId
62
+ * @param {string} fallbackFile
63
+ * @param {string} providerRepositoryId
64
+ * @param {string} providerBranch
65
+ * @param {boolean} providerSilentMode
66
+ * @param {string} providerRootDirectory
67
+ * @param {string} specification
68
+ * @throws {AppwriteException}
69
+ * @returns {Promise<Models.Site>}
70
+ */
71
+ create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Site> {
72
+ if (typeof siteId === 'undefined') {
73
+ throw new AppwriteException('Missing required parameter: "siteId"');
74
+ }
75
+ if (typeof name === 'undefined') {
76
+ throw new AppwriteException('Missing required parameter: "name"');
77
+ }
78
+ if (typeof framework === 'undefined') {
79
+ throw new AppwriteException('Missing required parameter: "framework"');
80
+ }
81
+ if (typeof buildRuntime === 'undefined') {
82
+ throw new AppwriteException('Missing required parameter: "buildRuntime"');
83
+ }
84
+ const apiPath = '/sites';
85
+ const payload: Payload = {};
86
+ if (typeof siteId !== 'undefined') {
87
+ payload['siteId'] = siteId;
88
+ }
89
+ if (typeof name !== 'undefined') {
90
+ payload['name'] = name;
91
+ }
92
+ if (typeof framework !== 'undefined') {
93
+ payload['framework'] = framework;
94
+ }
95
+ if (typeof enabled !== 'undefined') {
96
+ payload['enabled'] = enabled;
97
+ }
98
+ if (typeof logging !== 'undefined') {
99
+ payload['logging'] = logging;
100
+ }
101
+ if (typeof timeout !== 'undefined') {
102
+ payload['timeout'] = timeout;
103
+ }
104
+ if (typeof installCommand !== 'undefined') {
105
+ payload['installCommand'] = installCommand;
106
+ }
107
+ if (typeof buildCommand !== 'undefined') {
108
+ payload['buildCommand'] = buildCommand;
109
+ }
110
+ if (typeof outputDirectory !== 'undefined') {
111
+ payload['outputDirectory'] = outputDirectory;
112
+ }
113
+ if (typeof buildRuntime !== 'undefined') {
114
+ payload['buildRuntime'] = buildRuntime;
115
+ }
116
+ if (typeof adapter !== 'undefined') {
117
+ payload['adapter'] = adapter;
118
+ }
119
+ if (typeof installationId !== 'undefined') {
120
+ payload['installationId'] = installationId;
121
+ }
122
+ if (typeof fallbackFile !== 'undefined') {
123
+ payload['fallbackFile'] = fallbackFile;
124
+ }
125
+ if (typeof providerRepositoryId !== 'undefined') {
126
+ payload['providerRepositoryId'] = providerRepositoryId;
127
+ }
128
+ if (typeof providerBranch !== 'undefined') {
129
+ payload['providerBranch'] = providerBranch;
130
+ }
131
+ if (typeof providerSilentMode !== 'undefined') {
132
+ payload['providerSilentMode'] = providerSilentMode;
133
+ }
134
+ if (typeof providerRootDirectory !== 'undefined') {
135
+ payload['providerRootDirectory'] = providerRootDirectory;
136
+ }
137
+ if (typeof specification !== 'undefined') {
138
+ payload['specification'] = specification;
139
+ }
140
+ const uri = new URL(this.client.config.endpoint + apiPath);
141
+
142
+ const apiHeaders: { [header: string]: string } = {
143
+ 'content-type': 'application/json',
144
+ }
145
+
146
+ return this.client.call(
147
+ 'post',
148
+ uri,
149
+ apiHeaders,
150
+ payload
151
+ );
152
+ }
153
+ /**
154
+ * Get a list of all frameworks that are currently available on the server instance.
155
+ *
156
+ * @throws {AppwriteException}
157
+ * @returns {Promise<Models.FrameworkList>}
158
+ */
159
+ listFrameworks(): Promise<Models.FrameworkList> {
160
+ const apiPath = '/sites/frameworks';
161
+ const payload: Payload = {};
162
+ const uri = new URL(this.client.config.endpoint + apiPath);
163
+
164
+ const apiHeaders: { [header: string]: string } = {
165
+ }
166
+
167
+ return this.client.call(
168
+ 'get',
169
+ uri,
170
+ apiHeaders,
171
+ payload
172
+ );
173
+ }
174
+ /**
175
+ * List allowed site specifications for this instance.
176
+ *
177
+ * @throws {AppwriteException}
178
+ * @returns {Promise<Models.SpecificationList>}
179
+ */
180
+ listSpecifications(): Promise<Models.SpecificationList> {
181
+ const apiPath = '/sites/specifications';
182
+ const payload: Payload = {};
183
+ const uri = new URL(this.client.config.endpoint + apiPath);
184
+
185
+ const apiHeaders: { [header: string]: string } = {
186
+ }
187
+
188
+ return this.client.call(
189
+ 'get',
190
+ uri,
191
+ apiHeaders,
192
+ payload
193
+ );
194
+ }
195
+ /**
196
+ * List available site templates. You can use template details in [createSite](/docs/references/cloud/server-nodejs/sites#create) method.
197
+ *
198
+ * @param {string[]} frameworks
199
+ * @param {string[]} useCases
200
+ * @param {number} limit
201
+ * @param {number} offset
202
+ * @throws {AppwriteException}
203
+ * @returns {Promise<Models.TemplateSiteList>}
204
+ */
205
+ listTemplates(frameworks?: string[], useCases?: string[], limit?: number, offset?: number): Promise<Models.TemplateSiteList> {
206
+ const apiPath = '/sites/templates';
207
+ const payload: Payload = {};
208
+ if (typeof frameworks !== 'undefined') {
209
+ payload['frameworks'] = frameworks;
210
+ }
211
+ if (typeof useCases !== 'undefined') {
212
+ payload['useCases'] = useCases;
213
+ }
214
+ if (typeof limit !== 'undefined') {
215
+ payload['limit'] = limit;
216
+ }
217
+ if (typeof offset !== 'undefined') {
218
+ payload['offset'] = offset;
219
+ }
220
+ const uri = new URL(this.client.config.endpoint + apiPath);
221
+
222
+ const apiHeaders: { [header: string]: string } = {
223
+ }
224
+
225
+ return this.client.call(
226
+ 'get',
227
+ uri,
228
+ apiHeaders,
229
+ payload
230
+ );
231
+ }
232
+ /**
233
+ * Get a site template using ID. You can use template details in [createSite](/docs/references/cloud/server-nodejs/sites#create) method.
234
+ *
235
+ * @param {string} templateId
236
+ * @throws {AppwriteException}
237
+ * @returns {Promise<Models.TemplateSite>}
238
+ */
239
+ getTemplate(templateId: string): Promise<Models.TemplateSite> {
240
+ if (typeof templateId === 'undefined') {
241
+ throw new AppwriteException('Missing required parameter: "templateId"');
242
+ }
243
+ const apiPath = '/sites/templates/{templateId}'.replace('{templateId}', templateId);
244
+ const payload: Payload = {};
245
+ const uri = new URL(this.client.config.endpoint + apiPath);
246
+
247
+ const apiHeaders: { [header: string]: string } = {
248
+ }
249
+
250
+ return this.client.call(
251
+ 'get',
252
+ uri,
253
+ apiHeaders,
254
+ payload
255
+ );
256
+ }
257
+ /**
258
+ * Get usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.
259
+ *
260
+ * @param {SiteUsageRange} range
261
+ * @throws {AppwriteException}
262
+ * @returns {Promise<Models.UsageSites>}
263
+ */
264
+ listUsage(range?: SiteUsageRange): Promise<Models.UsageSites> {
265
+ const apiPath = '/sites/usage';
266
+ const payload: Payload = {};
267
+ if (typeof range !== 'undefined') {
268
+ payload['range'] = range;
269
+ }
270
+ const uri = new URL(this.client.config.endpoint + apiPath);
271
+
272
+ const apiHeaders: { [header: string]: string } = {
273
+ }
274
+
275
+ return this.client.call(
276
+ 'get',
277
+ uri,
278
+ apiHeaders,
279
+ payload
280
+ );
281
+ }
282
+ /**
283
+ * Get a site by its unique ID.
284
+ *
285
+ * @param {string} siteId
286
+ * @throws {AppwriteException}
287
+ * @returns {Promise<Models.Site>}
288
+ */
289
+ get(siteId: string): Promise<Models.Site> {
290
+ if (typeof siteId === 'undefined') {
291
+ throw new AppwriteException('Missing required parameter: "siteId"');
292
+ }
293
+ const apiPath = '/sites/{siteId}'.replace('{siteId}', siteId);
294
+ const payload: Payload = {};
295
+ const uri = new URL(this.client.config.endpoint + apiPath);
296
+
297
+ const apiHeaders: { [header: string]: string } = {
298
+ }
299
+
300
+ return this.client.call(
301
+ 'get',
302
+ uri,
303
+ apiHeaders,
304
+ payload
305
+ );
306
+ }
307
+ /**
308
+ * Update site by its unique ID.
309
+ *
310
+ * @param {string} siteId
311
+ * @param {string} name
312
+ * @param {Framework} framework
313
+ * @param {boolean} enabled
314
+ * @param {boolean} logging
315
+ * @param {number} timeout
316
+ * @param {string} installCommand
317
+ * @param {string} buildCommand
318
+ * @param {string} outputDirectory
319
+ * @param {BuildRuntime} buildRuntime
320
+ * @param {Adapter} adapter
321
+ * @param {string} fallbackFile
322
+ * @param {string} installationId
323
+ * @param {string} providerRepositoryId
324
+ * @param {string} providerBranch
325
+ * @param {boolean} providerSilentMode
326
+ * @param {string} providerRootDirectory
327
+ * @param {string} specification
328
+ * @throws {AppwriteException}
329
+ * @returns {Promise<Models.Site>}
330
+ */
331
+ update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Site> {
332
+ if (typeof siteId === 'undefined') {
333
+ throw new AppwriteException('Missing required parameter: "siteId"');
334
+ }
335
+ if (typeof name === 'undefined') {
336
+ throw new AppwriteException('Missing required parameter: "name"');
337
+ }
338
+ if (typeof framework === 'undefined') {
339
+ throw new AppwriteException('Missing required parameter: "framework"');
340
+ }
341
+ const apiPath = '/sites/{siteId}'.replace('{siteId}', siteId);
342
+ const payload: Payload = {};
343
+ if (typeof name !== 'undefined') {
344
+ payload['name'] = name;
345
+ }
346
+ if (typeof framework !== 'undefined') {
347
+ payload['framework'] = framework;
348
+ }
349
+ if (typeof enabled !== 'undefined') {
350
+ payload['enabled'] = enabled;
351
+ }
352
+ if (typeof logging !== 'undefined') {
353
+ payload['logging'] = logging;
354
+ }
355
+ if (typeof timeout !== 'undefined') {
356
+ payload['timeout'] = timeout;
357
+ }
358
+ if (typeof installCommand !== 'undefined') {
359
+ payload['installCommand'] = installCommand;
360
+ }
361
+ if (typeof buildCommand !== 'undefined') {
362
+ payload['buildCommand'] = buildCommand;
363
+ }
364
+ if (typeof outputDirectory !== 'undefined') {
365
+ payload['outputDirectory'] = outputDirectory;
366
+ }
367
+ if (typeof buildRuntime !== 'undefined') {
368
+ payload['buildRuntime'] = buildRuntime;
369
+ }
370
+ if (typeof adapter !== 'undefined') {
371
+ payload['adapter'] = adapter;
372
+ }
373
+ if (typeof fallbackFile !== 'undefined') {
374
+ payload['fallbackFile'] = fallbackFile;
375
+ }
376
+ if (typeof installationId !== 'undefined') {
377
+ payload['installationId'] = installationId;
378
+ }
379
+ if (typeof providerRepositoryId !== 'undefined') {
380
+ payload['providerRepositoryId'] = providerRepositoryId;
381
+ }
382
+ if (typeof providerBranch !== 'undefined') {
383
+ payload['providerBranch'] = providerBranch;
384
+ }
385
+ if (typeof providerSilentMode !== 'undefined') {
386
+ payload['providerSilentMode'] = providerSilentMode;
387
+ }
388
+ if (typeof providerRootDirectory !== 'undefined') {
389
+ payload['providerRootDirectory'] = providerRootDirectory;
390
+ }
391
+ if (typeof specification !== 'undefined') {
392
+ payload['specification'] = specification;
393
+ }
394
+ const uri = new URL(this.client.config.endpoint + apiPath);
395
+
396
+ const apiHeaders: { [header: string]: string } = {
397
+ 'content-type': 'application/json',
398
+ }
399
+
400
+ return this.client.call(
401
+ 'put',
402
+ uri,
403
+ apiHeaders,
404
+ payload
405
+ );
406
+ }
407
+ /**
408
+ * Delete a site by its unique ID.
409
+ *
410
+ * @param {string} siteId
411
+ * @throws {AppwriteException}
412
+ * @returns {Promise<{}>}
413
+ */
414
+ delete(siteId: string): Promise<{}> {
415
+ if (typeof siteId === 'undefined') {
416
+ throw new AppwriteException('Missing required parameter: "siteId"');
417
+ }
418
+ const apiPath = '/sites/{siteId}'.replace('{siteId}', siteId);
419
+ const payload: Payload = {};
420
+ const uri = new URL(this.client.config.endpoint + apiPath);
421
+
422
+ const apiHeaders: { [header: string]: string } = {
423
+ 'content-type': 'application/json',
424
+ }
425
+
426
+ return this.client.call(
427
+ 'delete',
428
+ uri,
429
+ apiHeaders,
430
+ payload
431
+ );
432
+ }
433
+ /**
434
+ * Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.
435
+ *
436
+ * @param {string} siteId
437
+ * @param {string} deploymentId
438
+ * @throws {AppwriteException}
439
+ * @returns {Promise<Models.Site>}
440
+ */
441
+ updateSiteDeployment(siteId: string, deploymentId: string): Promise<Models.Site> {
442
+ if (typeof siteId === 'undefined') {
443
+ throw new AppwriteException('Missing required parameter: "siteId"');
444
+ }
445
+ if (typeof deploymentId === 'undefined') {
446
+ throw new AppwriteException('Missing required parameter: "deploymentId"');
447
+ }
448
+ const apiPath = '/sites/{siteId}/deployment'.replace('{siteId}', siteId);
449
+ const payload: Payload = {};
450
+ if (typeof deploymentId !== 'undefined') {
451
+ payload['deploymentId'] = deploymentId;
452
+ }
453
+ const uri = new URL(this.client.config.endpoint + apiPath);
454
+
455
+ const apiHeaders: { [header: string]: string } = {
456
+ 'content-type': 'application/json',
457
+ }
458
+
459
+ return this.client.call(
460
+ 'patch',
461
+ uri,
462
+ apiHeaders,
463
+ payload
464
+ );
465
+ }
466
+ /**
467
+ * Get a list of all the site&#039;s code deployments. You can use the query params to filter your results.
468
+ *
469
+ * @param {string} siteId
470
+ * @param {string[]} queries
471
+ * @param {string} search
472
+ * @throws {AppwriteException}
473
+ * @returns {Promise<Models.DeploymentList>}
474
+ */
475
+ listDeployments(siteId: string, queries?: string[], search?: string): Promise<Models.DeploymentList> {
476
+ if (typeof siteId === 'undefined') {
477
+ throw new AppwriteException('Missing required parameter: "siteId"');
478
+ }
479
+ const apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId);
480
+ const payload: Payload = {};
481
+ if (typeof queries !== 'undefined') {
482
+ payload['queries'] = queries;
483
+ }
484
+ if (typeof search !== 'undefined') {
485
+ payload['search'] = search;
486
+ }
487
+ const uri = new URL(this.client.config.endpoint + apiPath);
488
+
489
+ const apiHeaders: { [header: string]: string } = {
490
+ }
491
+
492
+ return this.client.call(
493
+ 'get',
494
+ uri,
495
+ apiHeaders,
496
+ payload
497
+ );
498
+ }
499
+ /**
500
+ * 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&#039;ll need to update the function&#039;s deployment to use your new deployment ID.
501
+ *
502
+ * @param {string} siteId
503
+ * @param {File} code
504
+ * @param {boolean} activate
505
+ * @param {string} installCommand
506
+ * @param {string} buildCommand
507
+ * @param {string} outputDirectory
508
+ * @throws {AppwriteException}
509
+ * @returns {Promise<Models.Deployment>}
510
+ */
511
+ createDeployment(siteId: string, code: File, activate: boolean, installCommand?: string, buildCommand?: string, outputDirectory?: string, onProgress = (progress: UploadProgress) => {}): Promise<Models.Deployment> {
512
+ if (typeof siteId === 'undefined') {
513
+ throw new AppwriteException('Missing required parameter: "siteId"');
514
+ }
515
+ if (typeof code === 'undefined') {
516
+ throw new AppwriteException('Missing required parameter: "code"');
517
+ }
518
+ if (typeof activate === 'undefined') {
519
+ throw new AppwriteException('Missing required parameter: "activate"');
520
+ }
521
+ const apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId);
522
+ const payload: Payload = {};
523
+ if (typeof installCommand !== 'undefined') {
524
+ payload['installCommand'] = installCommand;
525
+ }
526
+ if (typeof buildCommand !== 'undefined') {
527
+ payload['buildCommand'] = buildCommand;
528
+ }
529
+ if (typeof outputDirectory !== 'undefined') {
530
+ payload['outputDirectory'] = outputDirectory;
531
+ }
532
+ if (typeof code !== 'undefined') {
533
+ payload['code'] = code;
534
+ }
535
+ if (typeof activate !== 'undefined') {
536
+ payload['activate'] = activate;
537
+ }
538
+ const uri = new URL(this.client.config.endpoint + apiPath);
539
+
540
+ const apiHeaders: { [header: string]: string } = {
541
+ 'content-type': 'multipart/form-data',
542
+ }
543
+
544
+ return this.client.chunkedUpload(
545
+ 'post',
546
+ uri,
547
+ apiHeaders,
548
+ payload,
549
+ onProgress
550
+ );
551
+ }
552
+ /**
553
+ * Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment&#039;s code will be preserved and used for the new build.
554
+ *
555
+ * @param {string} siteId
556
+ * @param {string} deploymentId
557
+ * @throws {AppwriteException}
558
+ * @returns {Promise<Models.Deployment>}
559
+ */
560
+ createDuplicateDeployment(siteId: string, deploymentId: string): Promise<Models.Deployment> {
561
+ if (typeof siteId === 'undefined') {
562
+ throw new AppwriteException('Missing required parameter: "siteId"');
563
+ }
564
+ if (typeof deploymentId === 'undefined') {
565
+ throw new AppwriteException('Missing required parameter: "deploymentId"');
566
+ }
567
+ const apiPath = '/sites/{siteId}/deployments/duplicate'.replace('{siteId}', siteId);
568
+ const payload: Payload = {};
569
+ if (typeof deploymentId !== 'undefined') {
570
+ payload['deploymentId'] = deploymentId;
571
+ }
572
+ const uri = new URL(this.client.config.endpoint + apiPath);
573
+
574
+ const apiHeaders: { [header: string]: string } = {
575
+ 'content-type': 'application/json',
576
+ }
577
+
578
+ return this.client.call(
579
+ 'post',
580
+ uri,
581
+ apiHeaders,
582
+ payload
583
+ );
584
+ }
585
+ /**
586
+ * Create a deployment based on a template.
587
+
588
+ Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details.
589
+ *
590
+ * @param {string} siteId
591
+ * @param {string} repository
592
+ * @param {string} owner
593
+ * @param {string} rootDirectory
594
+ * @param {string} version
595
+ * @param {boolean} activate
596
+ * @throws {AppwriteException}
597
+ * @returns {Promise<Models.Deployment>}
598
+ */
599
+ createTemplateDeployment(siteId: string, repository: string, owner: string, rootDirectory: string, version: string, activate?: boolean): Promise<Models.Deployment> {
600
+ if (typeof siteId === 'undefined') {
601
+ throw new AppwriteException('Missing required parameter: "siteId"');
602
+ }
603
+ if (typeof repository === 'undefined') {
604
+ throw new AppwriteException('Missing required parameter: "repository"');
605
+ }
606
+ if (typeof owner === 'undefined') {
607
+ throw new AppwriteException('Missing required parameter: "owner"');
608
+ }
609
+ if (typeof rootDirectory === 'undefined') {
610
+ throw new AppwriteException('Missing required parameter: "rootDirectory"');
611
+ }
612
+ if (typeof version === 'undefined') {
613
+ throw new AppwriteException('Missing required parameter: "version"');
614
+ }
615
+ const apiPath = '/sites/{siteId}/deployments/template'.replace('{siteId}', siteId);
616
+ const payload: Payload = {};
617
+ if (typeof repository !== 'undefined') {
618
+ payload['repository'] = repository;
619
+ }
620
+ if (typeof owner !== 'undefined') {
621
+ payload['owner'] = owner;
622
+ }
623
+ if (typeof rootDirectory !== 'undefined') {
624
+ payload['rootDirectory'] = rootDirectory;
625
+ }
626
+ if (typeof version !== 'undefined') {
627
+ payload['version'] = version;
628
+ }
629
+ if (typeof activate !== 'undefined') {
630
+ payload['activate'] = activate;
631
+ }
632
+ const uri = new URL(this.client.config.endpoint + apiPath);
633
+
634
+ const apiHeaders: { [header: string]: string } = {
635
+ 'content-type': 'application/json',
636
+ }
637
+
638
+ return this.client.call(
639
+ 'post',
640
+ uri,
641
+ apiHeaders,
642
+ payload
643
+ );
644
+ }
645
+ /**
646
+ * Create a deployment when a site is connected to VCS.
647
+
648
+ This endpoint lets you create deployment from a branch, commit, or a tag.
649
+ *
650
+ * @param {string} siteId
651
+ * @param {VCSDeploymentType} type
652
+ * @param {string} reference
653
+ * @param {boolean} activate
654
+ * @throws {AppwriteException}
655
+ * @returns {Promise<Models.Deployment>}
656
+ */
657
+ createVcsDeployment(siteId: string, type: VCSDeploymentType, reference: string, activate?: boolean): Promise<Models.Deployment> {
658
+ if (typeof siteId === 'undefined') {
659
+ throw new AppwriteException('Missing required parameter: "siteId"');
660
+ }
661
+ if (typeof type === 'undefined') {
662
+ throw new AppwriteException('Missing required parameter: "type"');
663
+ }
664
+ if (typeof reference === 'undefined') {
665
+ throw new AppwriteException('Missing required parameter: "reference"');
666
+ }
667
+ const apiPath = '/sites/{siteId}/deployments/vcs'.replace('{siteId}', siteId);
668
+ const payload: Payload = {};
669
+ if (typeof type !== 'undefined') {
670
+ payload['type'] = type;
671
+ }
672
+ if (typeof reference !== 'undefined') {
673
+ payload['reference'] = reference;
674
+ }
675
+ if (typeof activate !== 'undefined') {
676
+ payload['activate'] = activate;
677
+ }
678
+ const uri = new URL(this.client.config.endpoint + apiPath);
679
+
680
+ const apiHeaders: { [header: string]: string } = {
681
+ 'content-type': 'application/json',
682
+ }
683
+
684
+ return this.client.call(
685
+ 'post',
686
+ uri,
687
+ apiHeaders,
688
+ payload
689
+ );
690
+ }
691
+ /**
692
+ * Get a site deployment by its unique ID.
693
+ *
694
+ * @param {string} siteId
695
+ * @param {string} deploymentId
696
+ * @throws {AppwriteException}
697
+ * @returns {Promise<Models.Deployment>}
698
+ */
699
+ getDeployment(siteId: string, deploymentId: string): Promise<Models.Deployment> {
700
+ if (typeof siteId === 'undefined') {
701
+ throw new AppwriteException('Missing required parameter: "siteId"');
702
+ }
703
+ if (typeof deploymentId === 'undefined') {
704
+ throw new AppwriteException('Missing required parameter: "deploymentId"');
705
+ }
706
+ const apiPath = '/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
707
+ const payload: Payload = {};
708
+ const uri = new URL(this.client.config.endpoint + apiPath);
709
+
710
+ const apiHeaders: { [header: string]: string } = {
711
+ }
712
+
713
+ return this.client.call(
714
+ 'get',
715
+ uri,
716
+ apiHeaders,
717
+ payload
718
+ );
719
+ }
720
+ /**
721
+ * Delete a site deployment by its unique ID.
722
+ *
723
+ * @param {string} siteId
724
+ * @param {string} deploymentId
725
+ * @throws {AppwriteException}
726
+ * @returns {Promise<{}>}
727
+ */
728
+ deleteDeployment(siteId: string, deploymentId: string): Promise<{}> {
729
+ if (typeof siteId === 'undefined') {
730
+ throw new AppwriteException('Missing required parameter: "siteId"');
731
+ }
732
+ if (typeof deploymentId === 'undefined') {
733
+ throw new AppwriteException('Missing required parameter: "deploymentId"');
734
+ }
735
+ const apiPath = '/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
736
+ const payload: Payload = {};
737
+ const uri = new URL(this.client.config.endpoint + apiPath);
738
+
739
+ const apiHeaders: { [header: string]: string } = {
740
+ 'content-type': 'application/json',
741
+ }
742
+
743
+ return this.client.call(
744
+ 'delete',
745
+ uri,
746
+ apiHeaders,
747
+ payload
748
+ );
749
+ }
750
+ /**
751
+ * Get a site deployment content by its unique ID. The endpoint response return with a &#039;Content-Disposition: attachment&#039; header that tells the browser to start downloading the file to user downloads directory.
752
+ *
753
+ * @param {string} siteId
754
+ * @param {string} deploymentId
755
+ * @param {DeploymentDownloadType} type
756
+ * @throws {AppwriteException}
757
+ * @returns {string}
758
+ */
759
+ getDeploymentDownload(siteId: string, deploymentId: string, type?: DeploymentDownloadType): string {
760
+ if (typeof siteId === 'undefined') {
761
+ throw new AppwriteException('Missing required parameter: "siteId"');
762
+ }
763
+ if (typeof deploymentId === 'undefined') {
764
+ throw new AppwriteException('Missing required parameter: "deploymentId"');
765
+ }
766
+ const apiPath = '/sites/{siteId}/deployments/{deploymentId}/download'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
767
+ const payload: Payload = {};
768
+ if (typeof type !== 'undefined') {
769
+ payload['type'] = type;
770
+ }
771
+ const uri = new URL(this.client.config.endpoint + apiPath);
772
+
773
+ const apiHeaders: { [header: string]: string } = {
774
+ }
775
+
776
+ payload['project'] = this.client.config.project;
777
+
778
+ for (const [key, value] of Object.entries(Service.flatten(payload))) {
779
+ uri.searchParams.append(key, value);
780
+ }
781
+
782
+ return uri.toString();
783
+ }
784
+ /**
785
+ * Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn&#039;t started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status &#039;ready&#039;) or failed. The response includes the final build status and details.
786
+ *
787
+ * @param {string} siteId
788
+ * @param {string} deploymentId
789
+ * @throws {AppwriteException}
790
+ * @returns {Promise<Models.Deployment>}
791
+ */
792
+ updateDeploymentStatus(siteId: string, deploymentId: string): Promise<Models.Deployment> {
793
+ if (typeof siteId === 'undefined') {
794
+ throw new AppwriteException('Missing required parameter: "siteId"');
795
+ }
796
+ if (typeof deploymentId === 'undefined') {
797
+ throw new AppwriteException('Missing required parameter: "deploymentId"');
798
+ }
799
+ const apiPath = '/sites/{siteId}/deployments/{deploymentId}/status'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
800
+ const payload: Payload = {};
801
+ const uri = new URL(this.client.config.endpoint + apiPath);
802
+
803
+ const apiHeaders: { [header: string]: string } = {
804
+ 'content-type': 'application/json',
805
+ }
806
+
807
+ return this.client.call(
808
+ 'patch',
809
+ uri,
810
+ apiHeaders,
811
+ payload
812
+ );
813
+ }
814
+ /**
815
+ * Get a list of all site logs. You can use the query params to filter your results.
816
+ *
817
+ * @param {string} siteId
818
+ * @param {string[]} queries
819
+ * @throws {AppwriteException}
820
+ * @returns {Promise<Models.ExecutionList>}
821
+ */
822
+ listLogs(siteId: string, queries?: string[]): Promise<Models.ExecutionList> {
823
+ if (typeof siteId === 'undefined') {
824
+ throw new AppwriteException('Missing required parameter: "siteId"');
825
+ }
826
+ const apiPath = '/sites/{siteId}/logs'.replace('{siteId}', siteId);
827
+ const payload: Payload = {};
828
+ if (typeof queries !== 'undefined') {
829
+ payload['queries'] = queries;
830
+ }
831
+ const uri = new URL(this.client.config.endpoint + apiPath);
832
+
833
+ const apiHeaders: { [header: string]: string } = {
834
+ }
835
+
836
+ return this.client.call(
837
+ 'get',
838
+ uri,
839
+ apiHeaders,
840
+ payload
841
+ );
842
+ }
843
+ /**
844
+ * Get a site request log by its unique ID.
845
+ *
846
+ * @param {string} siteId
847
+ * @param {string} logId
848
+ * @throws {AppwriteException}
849
+ * @returns {Promise<Models.Execution>}
850
+ */
851
+ getLog(siteId: string, logId: string): Promise<Models.Execution> {
852
+ if (typeof siteId === 'undefined') {
853
+ throw new AppwriteException('Missing required parameter: "siteId"');
854
+ }
855
+ if (typeof logId === 'undefined') {
856
+ throw new AppwriteException('Missing required parameter: "logId"');
857
+ }
858
+ const apiPath = '/sites/{siteId}/logs/{logId}'.replace('{siteId}', siteId).replace('{logId}', logId);
859
+ const payload: Payload = {};
860
+ const uri = new URL(this.client.config.endpoint + apiPath);
861
+
862
+ const apiHeaders: { [header: string]: string } = {
863
+ }
864
+
865
+ return this.client.call(
866
+ 'get',
867
+ uri,
868
+ apiHeaders,
869
+ payload
870
+ );
871
+ }
872
+ /**
873
+ * Delete a site log by its unique ID.
874
+ *
875
+ * @param {string} siteId
876
+ * @param {string} logId
877
+ * @throws {AppwriteException}
878
+ * @returns {Promise<{}>}
879
+ */
880
+ deleteLog(siteId: string, logId: string): Promise<{}> {
881
+ if (typeof siteId === 'undefined') {
882
+ throw new AppwriteException('Missing required parameter: "siteId"');
883
+ }
884
+ if (typeof logId === 'undefined') {
885
+ throw new AppwriteException('Missing required parameter: "logId"');
886
+ }
887
+ const apiPath = '/sites/{siteId}/logs/{logId}'.replace('{siteId}', siteId).replace('{logId}', logId);
888
+ const payload: Payload = {};
889
+ const uri = new URL(this.client.config.endpoint + apiPath);
890
+
891
+ const apiHeaders: { [header: string]: string } = {
892
+ 'content-type': 'application/json',
893
+ }
894
+
895
+ return this.client.call(
896
+ 'delete',
897
+ uri,
898
+ apiHeaders,
899
+ payload
900
+ );
901
+ }
902
+ /**
903
+ * Get usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.
904
+ *
905
+ * @param {string} siteId
906
+ * @param {SiteUsageRange} range
907
+ * @throws {AppwriteException}
908
+ * @returns {Promise<Models.UsageSite>}
909
+ */
910
+ getUsage(siteId: string, range?: SiteUsageRange): Promise<Models.UsageSite> {
911
+ if (typeof siteId === 'undefined') {
912
+ throw new AppwriteException('Missing required parameter: "siteId"');
913
+ }
914
+ const apiPath = '/sites/{siteId}/usage'.replace('{siteId}', siteId);
915
+ const payload: Payload = {};
916
+ if (typeof range !== 'undefined') {
917
+ payload['range'] = range;
918
+ }
919
+ const uri = new URL(this.client.config.endpoint + apiPath);
920
+
921
+ const apiHeaders: { [header: string]: string } = {
922
+ }
923
+
924
+ return this.client.call(
925
+ 'get',
926
+ uri,
927
+ apiHeaders,
928
+ payload
929
+ );
930
+ }
931
+ /**
932
+ * Get a list of all variables of a specific site.
933
+ *
934
+ * @param {string} siteId
935
+ * @throws {AppwriteException}
936
+ * @returns {Promise<Models.VariableList>}
937
+ */
938
+ listVariables(siteId: string): Promise<Models.VariableList> {
939
+ if (typeof siteId === 'undefined') {
940
+ throw new AppwriteException('Missing required parameter: "siteId"');
941
+ }
942
+ const apiPath = '/sites/{siteId}/variables'.replace('{siteId}', siteId);
943
+ const payload: Payload = {};
944
+ const uri = new URL(this.client.config.endpoint + apiPath);
945
+
946
+ const apiHeaders: { [header: string]: string } = {
947
+ }
948
+
949
+ return this.client.call(
950
+ 'get',
951
+ uri,
952
+ apiHeaders,
953
+ payload
954
+ );
955
+ }
956
+ /**
957
+ * Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.
958
+ *
959
+ * @param {string} siteId
960
+ * @param {string} key
961
+ * @param {string} value
962
+ * @param {boolean} secret
963
+ * @throws {AppwriteException}
964
+ * @returns {Promise<Models.Variable>}
965
+ */
966
+ createVariable(siteId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable> {
967
+ if (typeof siteId === 'undefined') {
968
+ throw new AppwriteException('Missing required parameter: "siteId"');
969
+ }
970
+ if (typeof key === 'undefined') {
971
+ throw new AppwriteException('Missing required parameter: "key"');
972
+ }
973
+ if (typeof value === 'undefined') {
974
+ throw new AppwriteException('Missing required parameter: "value"');
975
+ }
976
+ const apiPath = '/sites/{siteId}/variables'.replace('{siteId}', siteId);
977
+ const payload: Payload = {};
978
+ if (typeof key !== 'undefined') {
979
+ payload['key'] = key;
980
+ }
981
+ if (typeof value !== 'undefined') {
982
+ payload['value'] = value;
983
+ }
984
+ if (typeof secret !== 'undefined') {
985
+ payload['secret'] = secret;
986
+ }
987
+ const uri = new URL(this.client.config.endpoint + apiPath);
988
+
989
+ const apiHeaders: { [header: string]: string } = {
990
+ 'content-type': 'application/json',
991
+ }
992
+
993
+ return this.client.call(
994
+ 'post',
995
+ uri,
996
+ apiHeaders,
997
+ payload
998
+ );
999
+ }
1000
+ /**
1001
+ * Get a variable by its unique ID.
1002
+ *
1003
+ * @param {string} siteId
1004
+ * @param {string} variableId
1005
+ * @throws {AppwriteException}
1006
+ * @returns {Promise<Models.Variable>}
1007
+ */
1008
+ getVariable(siteId: string, variableId: string): Promise<Models.Variable> {
1009
+ if (typeof siteId === 'undefined') {
1010
+ throw new AppwriteException('Missing required parameter: "siteId"');
1011
+ }
1012
+ if (typeof variableId === 'undefined') {
1013
+ throw new AppwriteException('Missing required parameter: "variableId"');
1014
+ }
1015
+ const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId);
1016
+ const payload: Payload = {};
1017
+ const uri = new URL(this.client.config.endpoint + apiPath);
1018
+
1019
+ const apiHeaders: { [header: string]: string } = {
1020
+ }
1021
+
1022
+ return this.client.call(
1023
+ 'get',
1024
+ uri,
1025
+ apiHeaders,
1026
+ payload
1027
+ );
1028
+ }
1029
+ /**
1030
+ * Update variable by its unique ID.
1031
+ *
1032
+ * @param {string} siteId
1033
+ * @param {string} variableId
1034
+ * @param {string} key
1035
+ * @param {string} value
1036
+ * @param {boolean} secret
1037
+ * @throws {AppwriteException}
1038
+ * @returns {Promise<Models.Variable>}
1039
+ */
1040
+ updateVariable(siteId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise<Models.Variable> {
1041
+ if (typeof siteId === 'undefined') {
1042
+ throw new AppwriteException('Missing required parameter: "siteId"');
1043
+ }
1044
+ if (typeof variableId === 'undefined') {
1045
+ throw new AppwriteException('Missing required parameter: "variableId"');
1046
+ }
1047
+ if (typeof key === 'undefined') {
1048
+ throw new AppwriteException('Missing required parameter: "key"');
1049
+ }
1050
+ const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId);
1051
+ const payload: Payload = {};
1052
+ if (typeof key !== 'undefined') {
1053
+ payload['key'] = key;
1054
+ }
1055
+ if (typeof value !== 'undefined') {
1056
+ payload['value'] = value;
1057
+ }
1058
+ if (typeof secret !== 'undefined') {
1059
+ payload['secret'] = secret;
1060
+ }
1061
+ const uri = new URL(this.client.config.endpoint + apiPath);
1062
+
1063
+ const apiHeaders: { [header: string]: string } = {
1064
+ 'content-type': 'application/json',
1065
+ }
1066
+
1067
+ return this.client.call(
1068
+ 'put',
1069
+ uri,
1070
+ apiHeaders,
1071
+ payload
1072
+ );
1073
+ }
1074
+ /**
1075
+ * Delete a variable by its unique ID.
1076
+ *
1077
+ * @param {string} siteId
1078
+ * @param {string} variableId
1079
+ * @throws {AppwriteException}
1080
+ * @returns {Promise<{}>}
1081
+ */
1082
+ deleteVariable(siteId: string, variableId: string): Promise<{}> {
1083
+ if (typeof siteId === 'undefined') {
1084
+ throw new AppwriteException('Missing required parameter: "siteId"');
1085
+ }
1086
+ if (typeof variableId === 'undefined') {
1087
+ throw new AppwriteException('Missing required parameter: "variableId"');
1088
+ }
1089
+ const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId);
1090
+ const payload: Payload = {};
1091
+ const uri = new URL(this.client.config.endpoint + apiPath);
1092
+
1093
+ const apiHeaders: { [header: string]: string } = {
1094
+ 'content-type': 'application/json',
1095
+ }
1096
+
1097
+ return this.client.call(
1098
+ 'delete',
1099
+ uri,
1100
+ apiHeaders,
1101
+ payload
1102
+ );
1103
+ }
1104
+ }