@appwrite.io/console 0.2.0 → 0.3.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 (314) hide show
  1. package/dist/cjs/sdk.js +2332 -633
  2. package/dist/cjs/sdk.js.map +1 -1
  3. package/dist/esm/sdk.js +2329 -634
  4. package/dist/esm/sdk.js.map +1 -1
  5. package/dist/iife/sdk.js +2332 -633
  6. package/docs/examples/account/create-anonymous-session.md +1 -1
  7. package/docs/examples/account/create-email-session.md +1 -1
  8. package/docs/examples/account/create-j-w-t.md +1 -1
  9. package/docs/examples/account/create-magic-u-r-l-session.md +1 -1
  10. package/docs/examples/account/create-o-auth2session.md +1 -1
  11. package/docs/examples/account/create-phone-session.md +1 -1
  12. package/docs/examples/account/create-phone-verification.md +1 -1
  13. package/docs/examples/account/create-recovery.md +1 -1
  14. package/docs/examples/account/create-verification.md +1 -1
  15. package/docs/examples/account/create-with-invite-code.md +1 -1
  16. package/docs/examples/account/create.md +1 -1
  17. package/docs/examples/account/delete-identity.md +18 -0
  18. package/docs/examples/account/delete-session.md +1 -1
  19. package/docs/examples/account/delete-sessions.md +1 -1
  20. package/docs/examples/account/get-prefs.md +1 -1
  21. package/docs/examples/account/get-session.md +1 -1
  22. package/docs/examples/account/get.md +1 -1
  23. package/docs/examples/account/list-identities.md +18 -0
  24. package/docs/examples/account/list-logs.md +1 -1
  25. package/docs/examples/account/list-sessions.md +1 -1
  26. package/docs/examples/account/update-email.md +1 -1
  27. package/docs/examples/account/update-magic-u-r-l-session.md +1 -1
  28. package/docs/examples/account/update-name.md +1 -1
  29. package/docs/examples/account/update-password.md +1 -1
  30. package/docs/examples/account/update-phone-session.md +1 -1
  31. package/docs/examples/account/update-phone-verification.md +1 -1
  32. package/docs/examples/account/update-phone.md +1 -1
  33. package/docs/examples/account/update-prefs.md +1 -1
  34. package/docs/examples/account/update-recovery.md +1 -1
  35. package/docs/examples/account/update-session.md +1 -1
  36. package/docs/examples/account/update-status.md +1 -1
  37. package/docs/examples/account/update-verification.md +1 -1
  38. package/docs/examples/assistant/chat.md +18 -0
  39. package/docs/examples/avatars/get-browser.md +1 -1
  40. package/docs/examples/avatars/get-credit-card.md +1 -1
  41. package/docs/examples/avatars/get-favicon.md +1 -1
  42. package/docs/examples/avatars/get-flag.md +1 -1
  43. package/docs/examples/avatars/get-image.md +1 -1
  44. package/docs/examples/avatars/get-initials.md +1 -1
  45. package/docs/examples/avatars/get-q-r.md +1 -1
  46. package/docs/examples/console/variables.md +1 -1
  47. package/docs/examples/databases/create-boolean-attribute.md +1 -1
  48. package/docs/examples/databases/create-collection.md +1 -1
  49. package/docs/examples/databases/create-datetime-attribute.md +1 -1
  50. package/docs/examples/databases/create-document.md +1 -1
  51. package/docs/examples/databases/create-email-attribute.md +1 -1
  52. package/docs/examples/databases/create-enum-attribute.md +1 -1
  53. package/docs/examples/databases/create-float-attribute.md +1 -1
  54. package/docs/examples/databases/create-index.md +1 -1
  55. package/docs/examples/databases/create-integer-attribute.md +1 -1
  56. package/docs/examples/databases/create-ip-attribute.md +1 -1
  57. package/docs/examples/databases/create-relationship-attribute.md +1 -1
  58. package/docs/examples/databases/create-string-attribute.md +1 -1
  59. package/docs/examples/databases/create-url-attribute.md +1 -1
  60. package/docs/examples/databases/create.md +1 -1
  61. package/docs/examples/databases/delete-attribute.md +1 -1
  62. package/docs/examples/databases/delete-collection.md +1 -1
  63. package/docs/examples/databases/delete-document.md +1 -1
  64. package/docs/examples/databases/delete-index.md +1 -1
  65. package/docs/examples/databases/delete.md +1 -1
  66. package/docs/examples/databases/get-attribute.md +1 -1
  67. package/docs/examples/databases/get-collection-usage.md +1 -1
  68. package/docs/examples/databases/get-collection.md +1 -1
  69. package/docs/examples/databases/get-database-usage.md +1 -1
  70. package/docs/examples/databases/get-document.md +1 -1
  71. package/docs/examples/databases/get-index.md +1 -1
  72. package/docs/examples/databases/get-usage.md +1 -1
  73. package/docs/examples/databases/get.md +1 -1
  74. package/docs/examples/databases/list-attributes.md +1 -1
  75. package/docs/examples/databases/list-collection-logs.md +1 -1
  76. package/docs/examples/databases/list-collections.md +1 -1
  77. package/docs/examples/databases/list-document-logs.md +1 -1
  78. package/docs/examples/databases/list-documents.md +1 -1
  79. package/docs/examples/databases/list-indexes.md +1 -1
  80. package/docs/examples/databases/list-logs.md +1 -1
  81. package/docs/examples/databases/list.md +1 -1
  82. package/docs/examples/databases/update-boolean-attribute.md +1 -1
  83. package/docs/examples/databases/update-collection.md +1 -1
  84. package/docs/examples/databases/update-datetime-attribute.md +1 -1
  85. package/docs/examples/databases/update-document.md +1 -1
  86. package/docs/examples/databases/update-email-attribute.md +1 -1
  87. package/docs/examples/databases/update-enum-attribute.md +1 -1
  88. package/docs/examples/databases/update-float-attribute.md +1 -1
  89. package/docs/examples/databases/update-integer-attribute.md +1 -1
  90. package/docs/examples/databases/update-ip-attribute.md +1 -1
  91. package/docs/examples/databases/update-relationship-attribute.md +1 -1
  92. package/docs/examples/databases/update-string-attribute.md +1 -1
  93. package/docs/examples/databases/update-url-attribute.md +1 -1
  94. package/docs/examples/databases/update.md +1 -1
  95. package/docs/examples/functions/create-build.md +1 -1
  96. package/docs/examples/functions/create-deployment.md +2 -2
  97. package/docs/examples/functions/create-execution.md +1 -1
  98. package/docs/examples/functions/create-variable.md +1 -1
  99. package/docs/examples/functions/create.md +1 -1
  100. package/docs/examples/functions/delete-deployment.md +1 -1
  101. package/docs/examples/functions/delete-variable.md +1 -1
  102. package/docs/examples/functions/delete.md +1 -1
  103. package/docs/examples/functions/download-deployment.md +14 -0
  104. package/docs/examples/functions/get-deployment.md +1 -1
  105. package/docs/examples/functions/get-execution.md +1 -1
  106. package/docs/examples/functions/get-function-usage.md +1 -1
  107. package/docs/examples/functions/get-usage.md +1 -1
  108. package/docs/examples/functions/get-variable.md +1 -1
  109. package/docs/examples/functions/get.md +1 -1
  110. package/docs/examples/functions/list-deployments.md +1 -1
  111. package/docs/examples/functions/list-executions.md +1 -1
  112. package/docs/examples/functions/list-runtimes.md +1 -1
  113. package/docs/examples/functions/list-variables.md +1 -1
  114. package/docs/examples/functions/list.md +1 -1
  115. package/docs/examples/functions/update-deployment.md +1 -1
  116. package/docs/examples/functions/update-variable.md +1 -1
  117. package/docs/examples/functions/update.md +2 -2
  118. package/docs/examples/graphql/mutation.md +1 -1
  119. package/docs/examples/graphql/query.md +1 -1
  120. package/docs/examples/health/get-antivirus.md +1 -1
  121. package/docs/examples/health/get-cache.md +1 -1
  122. package/docs/examples/health/get-d-b.md +1 -1
  123. package/docs/examples/health/get-pub-sub.md +1 -1
  124. package/docs/examples/health/get-queue-certificates.md +1 -1
  125. package/docs/examples/health/get-queue-functions.md +1 -1
  126. package/docs/examples/health/get-queue-logs.md +1 -1
  127. package/docs/examples/health/get-queue-webhooks.md +1 -1
  128. package/docs/examples/health/get-queue.md +1 -1
  129. package/docs/examples/health/get-storage-local.md +1 -1
  130. package/docs/examples/health/get-time.md +1 -1
  131. package/docs/examples/health/get.md +1 -1
  132. package/docs/examples/locale/get.md +1 -1
  133. package/docs/examples/locale/list-codes.md +18 -0
  134. package/docs/examples/locale/list-continents.md +1 -1
  135. package/docs/examples/locale/list-countries-e-u.md +1 -1
  136. package/docs/examples/locale/list-countries-phones.md +1 -1
  137. package/docs/examples/locale/list-countries.md +1 -1
  138. package/docs/examples/locale/list-currencies.md +1 -1
  139. package/docs/examples/locale/list-languages.md +1 -1
  140. package/docs/examples/migrations/create-appwrite-migration.md +18 -0
  141. package/docs/examples/migrations/create-firebase-migration.md +18 -0
  142. package/docs/examples/migrations/create-firebase-o-auth-migration.md +18 -0
  143. package/docs/examples/migrations/create-n-host-migration.md +18 -0
  144. package/docs/examples/migrations/create-supabase-migration.md +18 -0
  145. package/docs/examples/migrations/delete-firebase-auth.md +18 -0
  146. package/docs/examples/migrations/delete.md +18 -0
  147. package/docs/examples/migrations/get-appwrite-report.md +18 -0
  148. package/docs/examples/migrations/get-firebase-report-o-auth.md +18 -0
  149. package/docs/examples/migrations/get-firebase-report.md +18 -0
  150. package/docs/examples/migrations/get-n-host-report.md +18 -0
  151. package/docs/examples/migrations/get-supabase-report.md +18 -0
  152. package/docs/examples/migrations/get.md +18 -0
  153. package/docs/examples/migrations/list-firebase-projects.md +18 -0
  154. package/docs/examples/migrations/list.md +18 -0
  155. package/docs/examples/migrations/retry.md +18 -0
  156. package/docs/examples/project/create-variable.md +18 -0
  157. package/docs/examples/project/delete-variable.md +18 -0
  158. package/docs/examples/project/get-usage.md +1 -1
  159. package/docs/examples/project/get-variable.md +18 -0
  160. package/docs/examples/project/list-variables.md +18 -0
  161. package/docs/examples/project/update-variable.md +18 -0
  162. package/docs/examples/projects/create-key.md +1 -1
  163. package/docs/examples/projects/create-platform.md +1 -1
  164. package/docs/examples/projects/create-webhook.md +1 -1
  165. package/docs/examples/projects/create.md +2 -2
  166. package/docs/examples/projects/delete-email-template.md +18 -0
  167. package/docs/examples/projects/delete-key.md +1 -1
  168. package/docs/examples/projects/delete-platform.md +1 -1
  169. package/docs/examples/projects/delete-sms-template.md +18 -0
  170. package/docs/examples/projects/delete-webhook.md +1 -1
  171. package/docs/examples/projects/delete.md +2 -2
  172. package/docs/examples/projects/get-email-template.md +18 -0
  173. package/docs/examples/projects/get-key.md +1 -1
  174. package/docs/examples/projects/get-platform.md +1 -1
  175. package/docs/examples/projects/get-sms-template.md +18 -0
  176. package/docs/examples/projects/{list-domains.md → get-usage.md} +2 -2
  177. package/docs/examples/projects/get-webhook.md +1 -1
  178. package/docs/examples/projects/get.md +1 -1
  179. package/docs/examples/projects/list-keys.md +1 -1
  180. package/docs/examples/projects/list-platforms.md +1 -1
  181. package/docs/examples/projects/list-webhooks.md +1 -1
  182. package/docs/examples/projects/list.md +1 -1
  183. package/docs/examples/projects/update-auth-duration.md +1 -1
  184. package/docs/examples/projects/update-auth-limit.md +1 -1
  185. package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
  186. package/docs/examples/projects/update-auth-password-history.md +1 -1
  187. package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
  188. package/docs/examples/projects/update-auth-status.md +1 -1
  189. package/docs/examples/projects/update-email-template.md +18 -0
  190. package/docs/examples/projects/update-key.md +1 -1
  191. package/docs/examples/projects/update-o-auth2.md +1 -1
  192. package/docs/examples/projects/{get-domain.md → update-personal-data-check.md} +2 -2
  193. package/docs/examples/projects/update-platform.md +1 -1
  194. package/docs/examples/projects/{delete-domain.md → update-service-status-all.md} +2 -2
  195. package/docs/examples/projects/update-service-status.md +1 -1
  196. package/docs/examples/projects/update-sms-template.md +18 -0
  197. package/docs/examples/projects/update-smtp-configuration.md +18 -0
  198. package/docs/examples/projects/{create-domain.md → update-team.md} +2 -2
  199. package/docs/examples/projects/update-webhook-signature.md +1 -1
  200. package/docs/examples/projects/update-webhook.md +1 -1
  201. package/docs/examples/projects/update.md +1 -1
  202. package/docs/examples/proxy/create-rule.md +18 -0
  203. package/docs/examples/proxy/delete-rule.md +18 -0
  204. package/docs/examples/proxy/get-rule.md +18 -0
  205. package/docs/examples/proxy/list-rules.md +18 -0
  206. package/docs/examples/proxy/update-rule-verification.md +18 -0
  207. package/docs/examples/storage/create-bucket.md +1 -1
  208. package/docs/examples/storage/create-file.md +1 -1
  209. package/docs/examples/storage/delete-bucket.md +1 -1
  210. package/docs/examples/storage/delete-file.md +1 -1
  211. package/docs/examples/storage/get-bucket-usage.md +1 -1
  212. package/docs/examples/storage/get-bucket.md +1 -1
  213. package/docs/examples/storage/get-file-download.md +1 -1
  214. package/docs/examples/storage/get-file-preview.md +1 -1
  215. package/docs/examples/storage/get-file-view.md +1 -1
  216. package/docs/examples/storage/get-file.md +1 -1
  217. package/docs/examples/storage/get-usage.md +1 -1
  218. package/docs/examples/storage/list-buckets.md +1 -1
  219. package/docs/examples/storage/list-files.md +1 -1
  220. package/docs/examples/storage/update-bucket.md +1 -1
  221. package/docs/examples/storage/update-file.md +1 -1
  222. package/docs/examples/teams/create-membership.md +1 -1
  223. package/docs/examples/teams/create.md +1 -1
  224. package/docs/examples/teams/delete-membership.md +1 -1
  225. package/docs/examples/teams/delete.md +1 -1
  226. package/docs/examples/teams/get-membership.md +1 -1
  227. package/docs/examples/teams/get-prefs.md +1 -1
  228. package/docs/examples/teams/get.md +1 -1
  229. package/docs/examples/teams/list-logs.md +1 -1
  230. package/docs/examples/teams/list-memberships.md +1 -1
  231. package/docs/examples/teams/list.md +1 -1
  232. package/docs/examples/teams/update-membership-status.md +1 -1
  233. package/docs/examples/teams/{update-membership-roles.md → update-membership.md} +2 -2
  234. package/docs/examples/teams/update-name.md +1 -1
  235. package/docs/examples/teams/update-prefs.md +1 -1
  236. package/docs/examples/users/create-argon2user.md +1 -1
  237. package/docs/examples/users/create-bcrypt-user.md +1 -1
  238. package/docs/examples/users/create-m-d5user.md +1 -1
  239. package/docs/examples/users/create-p-h-pass-user.md +1 -1
  240. package/docs/examples/users/create-s-h-a-user.md +1 -1
  241. package/docs/examples/users/create-scrypt-modified-user.md +1 -1
  242. package/docs/examples/users/create-scrypt-user.md +1 -1
  243. package/docs/examples/users/create.md +1 -1
  244. package/docs/examples/users/delete-identity.md +18 -0
  245. package/docs/examples/users/delete-session.md +1 -1
  246. package/docs/examples/users/delete-sessions.md +1 -1
  247. package/docs/examples/users/delete.md +1 -1
  248. package/docs/examples/users/get-prefs.md +1 -1
  249. package/docs/examples/users/get-usage.md +1 -1
  250. package/docs/examples/users/get.md +1 -1
  251. package/docs/examples/users/list-identities.md +18 -0
  252. package/docs/examples/users/list-logs.md +1 -1
  253. package/docs/examples/users/list-memberships.md +1 -1
  254. package/docs/examples/users/list-sessions.md +1 -1
  255. package/docs/examples/users/list.md +1 -1
  256. package/docs/examples/users/update-email-verification.md +1 -1
  257. package/docs/examples/users/update-email.md +1 -1
  258. package/docs/examples/users/update-labels.md +18 -0
  259. package/docs/examples/users/update-name.md +1 -1
  260. package/docs/examples/users/update-password.md +1 -1
  261. package/docs/examples/users/update-phone-verification.md +1 -1
  262. package/docs/examples/users/update-phone.md +1 -1
  263. package/docs/examples/users/update-prefs.md +1 -1
  264. package/docs/examples/users/update-status.md +1 -1
  265. package/docs/examples/vcs/create-repository-detection.md +18 -0
  266. package/docs/examples/vcs/create-repository.md +18 -0
  267. package/docs/examples/vcs/delete-installation.md +18 -0
  268. package/docs/examples/vcs/get-installation.md +18 -0
  269. package/docs/examples/vcs/get-repository.md +18 -0
  270. package/docs/examples/vcs/list-installations.md +18 -0
  271. package/docs/examples/vcs/list-repositories.md +18 -0
  272. package/docs/examples/vcs/list-repository-branches.md +18 -0
  273. package/docs/examples/vcs/update-external-deployments.md +18 -0
  274. package/package.json +1 -1
  275. package/src/client.ts +2 -2
  276. package/src/index.ts +4 -0
  277. package/src/models.ts +905 -114
  278. package/src/services/account.ts +1102 -1055
  279. package/src/services/assistant.ts +38 -0
  280. package/src/services/avatars.ts +337 -337
  281. package/src/services/console.ts +16 -16
  282. package/src/services/databases.ts +2170 -2140
  283. package/src/services/functions.ts +808 -652
  284. package/src/services/graphql.ts +47 -47
  285. package/src/services/health.ts +226 -226
  286. package/src/services/locale.ts +156 -137
  287. package/src/services/migrations.ts +707 -0
  288. package/src/services/project.ts +160 -20
  289. package/src/services/projects.ts +1538 -1256
  290. package/src/services/proxy.ts +150 -0
  291. package/src/services/storage.ts +576 -571
  292. package/src/services/teams.ts +502 -501
  293. package/src/services/users.ts +1094 -1001
  294. package/src/services/vcs.ts +272 -0
  295. package/types/index.d.ts +4 -0
  296. package/types/models.d.ts +905 -114
  297. package/types/services/account.d.ts +62 -41
  298. package/types/services/assistant.d.ts +14 -0
  299. package/types/services/avatars.d.ts +7 -7
  300. package/types/services/console.d.ts +1 -1
  301. package/types/services/databases.d.ts +60 -54
  302. package/types/services/functions.d.ts +66 -31
  303. package/types/services/graphql.d.ts +2 -2
  304. package/types/services/health.d.ts +12 -12
  305. package/types/services/locale.d.ts +17 -7
  306. package/types/services/migrations.d.ts +185 -0
  307. package/types/services/project.d.ts +56 -1
  308. package/types/services/projects.d.ts +159 -79
  309. package/types/services/proxy.d.ts +59 -0
  310. package/types/services/storage.d.ts +18 -17
  311. package/types/services/teams.d.ts +17 -16
  312. package/types/services/users.d.ts +65 -27
  313. package/types/services/vcs.d.ts +97 -0
  314. package/docs/examples/projects/update-domain-verification.md +0 -18
@@ -10,1261 +10,1543 @@ export class Projects extends Service {
10
10
  super(client);
11
11
  }
12
12
 
13
- /**
14
- * List Projects
15
- *
16
- *
17
- * @param {string[]} queries
18
- * @param {string} search
19
- * @throws {AppwriteException}
20
- * @returns {Promise}
21
- */
22
- async list(queries?: string[], search?: string): Promise<Models.ProjectList> {
23
- let path = '/projects';
24
- let payload: Payload = {};
25
-
26
- if (typeof queries !== 'undefined') {
27
- payload['queries'] = queries;
28
- }
29
-
30
- if (typeof search !== 'undefined') {
31
- payload['search'] = search;
32
- }
33
-
34
- const uri = new URL(this.client.config.endpoint + path);
35
- return await this.client.call('get', uri, {
36
- 'content-type': 'application/json',
37
- }, payload);
38
- }
39
-
40
- /**
41
- * Create Project
42
- *
43
- *
44
- * @param {string} projectId
45
- * @param {string} name
46
- * @param {string} teamId
47
- * @param {string} region
48
- * @param {string} description
49
- * @param {string} logo
50
- * @param {string} url
51
- * @param {string} legalName
52
- * @param {string} legalCountry
53
- * @param {string} legalState
54
- * @param {string} legalCity
55
- * @param {string} legalAddress
56
- * @param {string} legalTaxId
57
- * @throws {AppwriteException}
58
- * @returns {Promise}
59
- */
60
- async create(projectId: string, name: string, teamId: string, region?: string, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise<Models.Project> {
61
- if (typeof projectId === 'undefined') {
62
- throw new AppwriteException('Missing required parameter: "projectId"');
63
- }
64
-
65
- if (typeof name === 'undefined') {
66
- throw new AppwriteException('Missing required parameter: "name"');
67
- }
68
-
69
- if (typeof teamId === 'undefined') {
70
- throw new AppwriteException('Missing required parameter: "teamId"');
71
- }
72
-
73
- let path = '/projects';
74
- let payload: Payload = {};
75
-
76
- if (typeof projectId !== 'undefined') {
77
- payload['projectId'] = projectId;
78
- }
79
-
80
- if (typeof name !== 'undefined') {
81
- payload['name'] = name;
82
- }
83
-
84
- if (typeof teamId !== 'undefined') {
85
- payload['teamId'] = teamId;
86
- }
87
-
88
- if (typeof region !== 'undefined') {
89
- payload['region'] = region;
90
- }
91
-
92
- if (typeof description !== 'undefined') {
93
- payload['description'] = description;
94
- }
95
-
96
- if (typeof logo !== 'undefined') {
97
- payload['logo'] = logo;
98
- }
99
-
100
- if (typeof url !== 'undefined') {
101
- payload['url'] = url;
102
- }
103
-
104
- if (typeof legalName !== 'undefined') {
105
- payload['legalName'] = legalName;
106
- }
107
-
108
- if (typeof legalCountry !== 'undefined') {
109
- payload['legalCountry'] = legalCountry;
110
- }
111
-
112
- if (typeof legalState !== 'undefined') {
113
- payload['legalState'] = legalState;
114
- }
115
-
116
- if (typeof legalCity !== 'undefined') {
117
- payload['legalCity'] = legalCity;
118
- }
119
-
120
- if (typeof legalAddress !== 'undefined') {
121
- payload['legalAddress'] = legalAddress;
122
- }
123
-
124
- if (typeof legalTaxId !== 'undefined') {
125
- payload['legalTaxId'] = legalTaxId;
126
- }
127
-
128
- const uri = new URL(this.client.config.endpoint + path);
129
- return await this.client.call('post', uri, {
130
- 'content-type': 'application/json',
131
- }, payload);
132
- }
133
-
134
- /**
135
- * Get Project
136
- *
137
- *
138
- * @param {string} projectId
139
- * @throws {AppwriteException}
140
- * @returns {Promise}
141
- */
142
- async get(projectId: string): Promise<Models.Project> {
143
- if (typeof projectId === 'undefined') {
144
- throw new AppwriteException('Missing required parameter: "projectId"');
145
- }
146
-
147
- let path = '/projects/{projectId}'.replace('{projectId}', projectId);
148
- let payload: Payload = {};
149
-
150
- const uri = new URL(this.client.config.endpoint + path);
151
- return await this.client.call('get', uri, {
152
- 'content-type': 'application/json',
153
- }, payload);
154
- }
155
-
156
- /**
157
- * Update Project
158
- *
159
- *
160
- * @param {string} projectId
161
- * @param {string} name
162
- * @param {string} description
163
- * @param {string} logo
164
- * @param {string} url
165
- * @param {string} legalName
166
- * @param {string} legalCountry
167
- * @param {string} legalState
168
- * @param {string} legalCity
169
- * @param {string} legalAddress
170
- * @param {string} legalTaxId
171
- * @throws {AppwriteException}
172
- * @returns {Promise}
173
- */
174
- async update(projectId: string, name: string, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise<Models.Project> {
175
- if (typeof projectId === 'undefined') {
176
- throw new AppwriteException('Missing required parameter: "projectId"');
177
- }
178
-
179
- if (typeof name === 'undefined') {
180
- throw new AppwriteException('Missing required parameter: "name"');
181
- }
182
-
183
- let path = '/projects/{projectId}'.replace('{projectId}', projectId);
184
- let payload: Payload = {};
185
-
186
- if (typeof name !== 'undefined') {
187
- payload['name'] = name;
188
- }
189
-
190
- if (typeof description !== 'undefined') {
191
- payload['description'] = description;
192
- }
193
-
194
- if (typeof logo !== 'undefined') {
195
- payload['logo'] = logo;
196
- }
197
-
198
- if (typeof url !== 'undefined') {
199
- payload['url'] = url;
200
- }
201
-
202
- if (typeof legalName !== 'undefined') {
203
- payload['legalName'] = legalName;
204
- }
205
-
206
- if (typeof legalCountry !== 'undefined') {
207
- payload['legalCountry'] = legalCountry;
208
- }
209
-
210
- if (typeof legalState !== 'undefined') {
211
- payload['legalState'] = legalState;
212
- }
213
-
214
- if (typeof legalCity !== 'undefined') {
215
- payload['legalCity'] = legalCity;
216
- }
217
-
218
- if (typeof legalAddress !== 'undefined') {
219
- payload['legalAddress'] = legalAddress;
220
- }
221
-
222
- if (typeof legalTaxId !== 'undefined') {
223
- payload['legalTaxId'] = legalTaxId;
224
- }
225
-
226
- const uri = new URL(this.client.config.endpoint + path);
227
- return await this.client.call('patch', uri, {
228
- 'content-type': 'application/json',
229
- }, payload);
230
- }
231
-
232
- /**
233
- * Delete Project
234
- *
235
- *
236
- * @param {string} projectId
237
- * @param {string} password
238
- * @throws {AppwriteException}
239
- * @returns {Promise}
240
- */
241
- async delete(projectId: string, password: string): Promise<{}> {
242
- if (typeof projectId === 'undefined') {
243
- throw new AppwriteException('Missing required parameter: "projectId"');
244
- }
245
-
246
- if (typeof password === 'undefined') {
247
- throw new AppwriteException('Missing required parameter: "password"');
248
- }
249
-
250
- let path = '/projects/{projectId}'.replace('{projectId}', projectId);
251
- let payload: Payload = {};
252
-
253
- if (typeof password !== 'undefined') {
254
- payload['password'] = password;
255
- }
256
-
257
- const uri = new URL(this.client.config.endpoint + path);
258
- return await this.client.call('delete', uri, {
259
- 'content-type': 'application/json',
260
- }, payload);
261
- }
262
-
263
- /**
264
- * Update Project Authentication Duration
265
- *
266
- *
267
- * @param {string} projectId
268
- * @param {number} duration
269
- * @throws {AppwriteException}
270
- * @returns {Promise}
271
- */
272
- async updateAuthDuration(projectId: string, duration: number): Promise<Models.Project> {
273
- if (typeof projectId === 'undefined') {
274
- throw new AppwriteException('Missing required parameter: "projectId"');
275
- }
276
-
277
- if (typeof duration === 'undefined') {
278
- throw new AppwriteException('Missing required parameter: "duration"');
279
- }
280
-
281
- let path = '/projects/{projectId}/auth/duration'.replace('{projectId}', projectId);
282
- let payload: Payload = {};
283
-
284
- if (typeof duration !== 'undefined') {
285
- payload['duration'] = duration;
286
- }
287
-
288
- const uri = new URL(this.client.config.endpoint + path);
289
- return await this.client.call('patch', uri, {
290
- 'content-type': 'application/json',
291
- }, payload);
292
- }
293
-
294
- /**
295
- * Update Project users limit
296
- *
297
- *
298
- * @param {string} projectId
299
- * @param {number} limit
300
- * @throws {AppwriteException}
301
- * @returns {Promise}
302
- */
303
- async updateAuthLimit(projectId: string, limit: number): Promise<Models.Project> {
304
- if (typeof projectId === 'undefined') {
305
- throw new AppwriteException('Missing required parameter: "projectId"');
306
- }
307
-
308
- if (typeof limit === 'undefined') {
309
- throw new AppwriteException('Missing required parameter: "limit"');
310
- }
311
-
312
- let path = '/projects/{projectId}/auth/limit'.replace('{projectId}', projectId);
313
- let payload: Payload = {};
314
-
315
- if (typeof limit !== 'undefined') {
316
- payload['limit'] = limit;
317
- }
318
-
319
- const uri = new URL(this.client.config.endpoint + path);
320
- return await this.client.call('patch', uri, {
321
- 'content-type': 'application/json',
322
- }, payload);
323
- }
324
-
325
- /**
326
- * Update Project user sessions limit
327
- *
328
- *
329
- * @param {string} projectId
330
- * @param {number} limit
331
- * @throws {AppwriteException}
332
- * @returns {Promise}
333
- */
334
- async updateAuthSessionsLimit(projectId: string, limit: number): Promise<Models.Project> {
335
- if (typeof projectId === 'undefined') {
336
- throw new AppwriteException('Missing required parameter: "projectId"');
337
- }
338
-
339
- if (typeof limit === 'undefined') {
340
- throw new AppwriteException('Missing required parameter: "limit"');
341
- }
342
-
343
- let path = '/projects/{projectId}/auth/max-sessions'.replace('{projectId}', projectId);
344
- let payload: Payload = {};
345
-
346
- if (typeof limit !== 'undefined') {
347
- payload['limit'] = limit;
348
- }
349
-
350
- const uri = new URL(this.client.config.endpoint + path);
351
- return await this.client.call('patch', uri, {
352
- 'content-type': 'application/json',
353
- }, payload);
354
- }
355
-
356
- /**
357
- * Update authentication password disctionary status. Use this endpoint to enable or disable the dicitonary check for user password
358
- *
359
- *
360
- * @param {string} projectId
361
- * @param {boolean} enabled
362
- * @throws {AppwriteException}
363
- * @returns {Promise}
364
- */
365
- async updateAuthPasswordDictionary(projectId: string, enabled: boolean): Promise<Models.Project> {
366
- if (typeof projectId === 'undefined') {
367
- throw new AppwriteException('Missing required parameter: "projectId"');
368
- }
369
-
370
- if (typeof enabled === 'undefined') {
371
- throw new AppwriteException('Missing required parameter: "enabled"');
372
- }
373
-
374
- let path = '/projects/{projectId}/auth/password-dictionary'.replace('{projectId}', projectId);
375
- let payload: Payload = {};
376
-
377
- if (typeof enabled !== 'undefined') {
378
- payload['enabled'] = enabled;
379
- }
380
-
381
- const uri = new URL(this.client.config.endpoint + path);
382
- return await this.client.call('patch', uri, {
383
- 'content-type': 'application/json',
384
- }, payload);
385
- }
386
-
387
- /**
388
- * Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.
389
- *
390
- *
391
- * @param {string} projectId
392
- * @param {number} limit
393
- * @throws {AppwriteException}
394
- * @returns {Promise}
395
- */
396
- async updateAuthPasswordHistory(projectId: string, limit: number): Promise<Models.Project> {
397
- if (typeof projectId === 'undefined') {
398
- throw new AppwriteException('Missing required parameter: "projectId"');
399
- }
400
-
401
- if (typeof limit === 'undefined') {
402
- throw new AppwriteException('Missing required parameter: "limit"');
403
- }
404
-
405
- let path = '/projects/{projectId}/auth/password-history'.replace('{projectId}', projectId);
406
- let payload: Payload = {};
407
-
408
- if (typeof limit !== 'undefined') {
409
- payload['limit'] = limit;
410
- }
411
-
412
- const uri = new URL(this.client.config.endpoint + path);
413
- return await this.client.call('patch', uri, {
414
- 'content-type': 'application/json',
415
- }, payload);
416
- }
417
-
418
- /**
419
- * Update Project auth method status. Use this endpoint to enable or disable a given auth method for this project.
420
- *
421
- *
422
- * @param {string} projectId
423
- * @param {string} method
424
- * @param {boolean} status
425
- * @throws {AppwriteException}
426
- * @returns {Promise}
427
- */
428
- async updateAuthStatus(projectId: string, method: string, status: boolean): Promise<Models.Project> {
429
- if (typeof projectId === 'undefined') {
430
- throw new AppwriteException('Missing required parameter: "projectId"');
431
- }
432
-
433
- if (typeof method === 'undefined') {
434
- throw new AppwriteException('Missing required parameter: "method"');
435
- }
436
-
437
- if (typeof status === 'undefined') {
438
- throw new AppwriteException('Missing required parameter: "status"');
439
- }
440
-
441
- let path = '/projects/{projectId}/auth/{method}'.replace('{projectId}', projectId).replace('{method}', method);
442
- let payload: Payload = {};
443
-
444
- if (typeof status !== 'undefined') {
445
- payload['status'] = status;
446
- }
447
-
448
- const uri = new URL(this.client.config.endpoint + path);
449
- return await this.client.call('patch', uri, {
450
- 'content-type': 'application/json',
451
- }, payload);
452
- }
453
-
454
- /**
455
- * List Domains
456
- *
457
- *
458
- * @param {string} projectId
459
- * @throws {AppwriteException}
460
- * @returns {Promise}
461
- */
462
- async listDomains(projectId: string): Promise<Models.DomainList> {
463
- if (typeof projectId === 'undefined') {
464
- throw new AppwriteException('Missing required parameter: "projectId"');
465
- }
466
-
467
- let path = '/projects/{projectId}/domains'.replace('{projectId}', projectId);
468
- let payload: Payload = {};
469
-
470
- const uri = new URL(this.client.config.endpoint + path);
471
- return await this.client.call('get', uri, {
472
- 'content-type': 'application/json',
473
- }, payload);
474
- }
475
-
476
- /**
477
- * Create Domain
478
- *
479
- *
480
- * @param {string} projectId
481
- * @param {string} domain
482
- * @throws {AppwriteException}
483
- * @returns {Promise}
484
- */
485
- async createDomain(projectId: string, domain: string): Promise<Models.Domain> {
486
- if (typeof projectId === 'undefined') {
487
- throw new AppwriteException('Missing required parameter: "projectId"');
488
- }
489
-
490
- if (typeof domain === 'undefined') {
491
- throw new AppwriteException('Missing required parameter: "domain"');
492
- }
493
-
494
- let path = '/projects/{projectId}/domains'.replace('{projectId}', projectId);
495
- let payload: Payload = {};
496
-
497
- if (typeof domain !== 'undefined') {
498
- payload['domain'] = domain;
499
- }
500
-
501
- const uri = new URL(this.client.config.endpoint + path);
502
- return await this.client.call('post', uri, {
503
- 'content-type': 'application/json',
504
- }, payload);
505
- }
506
-
507
- /**
508
- * Get Domain
509
- *
510
- *
511
- * @param {string} projectId
512
- * @param {string} domainId
513
- * @throws {AppwriteException}
514
- * @returns {Promise}
515
- */
516
- async getDomain(projectId: string, domainId: string): Promise<Models.Domain> {
517
- if (typeof projectId === 'undefined') {
518
- throw new AppwriteException('Missing required parameter: "projectId"');
519
- }
520
-
521
- if (typeof domainId === 'undefined') {
522
- throw new AppwriteException('Missing required parameter: "domainId"');
523
- }
524
-
525
- let path = '/projects/{projectId}/domains/{domainId}'.replace('{projectId}', projectId).replace('{domainId}', domainId);
526
- let payload: Payload = {};
527
-
528
- const uri = new URL(this.client.config.endpoint + path);
529
- return await this.client.call('get', uri, {
530
- 'content-type': 'application/json',
531
- }, payload);
532
- }
533
-
534
- /**
535
- * Delete Domain
536
- *
537
- *
538
- * @param {string} projectId
539
- * @param {string} domainId
540
- * @throws {AppwriteException}
541
- * @returns {Promise}
542
- */
543
- async deleteDomain(projectId: string, domainId: string): Promise<{}> {
544
- if (typeof projectId === 'undefined') {
545
- throw new AppwriteException('Missing required parameter: "projectId"');
546
- }
547
-
548
- if (typeof domainId === 'undefined') {
549
- throw new AppwriteException('Missing required parameter: "domainId"');
550
- }
551
-
552
- let path = '/projects/{projectId}/domains/{domainId}'.replace('{projectId}', projectId).replace('{domainId}', domainId);
553
- let payload: Payload = {};
554
-
555
- const uri = new URL(this.client.config.endpoint + path);
556
- return await this.client.call('delete', uri, {
557
- 'content-type': 'application/json',
558
- }, payload);
559
- }
560
-
561
- /**
562
- * Update Domain Verification Status
563
- *
564
- *
565
- * @param {string} projectId
566
- * @param {string} domainId
567
- * @throws {AppwriteException}
568
- * @returns {Promise}
569
- */
570
- async updateDomainVerification(projectId: string, domainId: string): Promise<Models.Domain> {
571
- if (typeof projectId === 'undefined') {
572
- throw new AppwriteException('Missing required parameter: "projectId"');
573
- }
574
-
575
- if (typeof domainId === 'undefined') {
576
- throw new AppwriteException('Missing required parameter: "domainId"');
577
- }
578
-
579
- let path = '/projects/{projectId}/domains/{domainId}/verification'.replace('{projectId}', projectId).replace('{domainId}', domainId);
580
- let payload: Payload = {};
581
-
582
- const uri = new URL(this.client.config.endpoint + path);
583
- return await this.client.call('patch', uri, {
584
- 'content-type': 'application/json',
585
- }, payload);
586
- }
587
-
588
- /**
589
- * List Keys
590
- *
591
- *
592
- * @param {string} projectId
593
- * @throws {AppwriteException}
594
- * @returns {Promise}
595
- */
596
- async listKeys(projectId: string): Promise<Models.KeyList> {
597
- if (typeof projectId === 'undefined') {
598
- throw new AppwriteException('Missing required parameter: "projectId"');
599
- }
600
-
601
- let path = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
602
- let payload: Payload = {};
603
-
604
- const uri = new URL(this.client.config.endpoint + path);
605
- return await this.client.call('get', uri, {
606
- 'content-type': 'application/json',
607
- }, payload);
608
- }
609
-
610
- /**
611
- * Create Key
612
- *
613
- *
614
- * @param {string} projectId
615
- * @param {string} name
616
- * @param {string[]} scopes
617
- * @param {string} expire
618
- * @throws {AppwriteException}
619
- * @returns {Promise}
620
- */
621
- async createKey(projectId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key> {
622
- if (typeof projectId === 'undefined') {
623
- throw new AppwriteException('Missing required parameter: "projectId"');
624
- }
625
-
626
- if (typeof name === 'undefined') {
627
- throw new AppwriteException('Missing required parameter: "name"');
628
- }
629
-
630
- if (typeof scopes === 'undefined') {
631
- throw new AppwriteException('Missing required parameter: "scopes"');
632
- }
633
-
634
- let path = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
635
- let payload: Payload = {};
636
-
637
- if (typeof name !== 'undefined') {
638
- payload['name'] = name;
639
- }
640
-
641
- if (typeof scopes !== 'undefined') {
642
- payload['scopes'] = scopes;
643
- }
644
-
645
- if (typeof expire !== 'undefined') {
646
- payload['expire'] = expire;
647
- }
648
-
649
- const uri = new URL(this.client.config.endpoint + path);
650
- return await this.client.call('post', uri, {
651
- 'content-type': 'application/json',
652
- }, payload);
653
- }
654
-
655
- /**
656
- * Get Key
657
- *
658
- *
659
- * @param {string} projectId
660
- * @param {string} keyId
661
- * @throws {AppwriteException}
662
- * @returns {Promise}
663
- */
664
- async getKey(projectId: string, keyId: string): Promise<Models.Key> {
665
- if (typeof projectId === 'undefined') {
666
- throw new AppwriteException('Missing required parameter: "projectId"');
667
- }
668
-
669
- if (typeof keyId === 'undefined') {
670
- throw new AppwriteException('Missing required parameter: "keyId"');
671
- }
672
-
673
- let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
674
- let payload: Payload = {};
675
-
676
- const uri = new URL(this.client.config.endpoint + path);
677
- return await this.client.call('get', uri, {
678
- 'content-type': 'application/json',
679
- }, payload);
680
- }
681
-
682
- /**
683
- * Update Key
684
- *
685
- *
686
- * @param {string} projectId
687
- * @param {string} keyId
688
- * @param {string} name
689
- * @param {string[]} scopes
690
- * @param {string} expire
691
- * @throws {AppwriteException}
692
- * @returns {Promise}
693
- */
694
- async updateKey(projectId: string, keyId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key> {
695
- if (typeof projectId === 'undefined') {
696
- throw new AppwriteException('Missing required parameter: "projectId"');
697
- }
698
-
699
- if (typeof keyId === 'undefined') {
700
- throw new AppwriteException('Missing required parameter: "keyId"');
701
- }
702
-
703
- if (typeof name === 'undefined') {
704
- throw new AppwriteException('Missing required parameter: "name"');
705
- }
706
-
707
- if (typeof scopes === 'undefined') {
708
- throw new AppwriteException('Missing required parameter: "scopes"');
709
- }
710
-
711
- let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
712
- let payload: Payload = {};
713
-
714
- if (typeof name !== 'undefined') {
715
- payload['name'] = name;
716
- }
717
-
718
- if (typeof scopes !== 'undefined') {
719
- payload['scopes'] = scopes;
720
- }
721
-
722
- if (typeof expire !== 'undefined') {
723
- payload['expire'] = expire;
724
- }
725
-
726
- const uri = new URL(this.client.config.endpoint + path);
727
- return await this.client.call('put', uri, {
728
- 'content-type': 'application/json',
729
- }, payload);
730
- }
731
-
732
- /**
733
- * Delete Key
734
- *
735
- *
736
- * @param {string} projectId
737
- * @param {string} keyId
738
- * @throws {AppwriteException}
739
- * @returns {Promise}
740
- */
741
- async deleteKey(projectId: string, keyId: string): Promise<{}> {
742
- if (typeof projectId === 'undefined') {
743
- throw new AppwriteException('Missing required parameter: "projectId"');
744
- }
745
-
746
- if (typeof keyId === 'undefined') {
747
- throw new AppwriteException('Missing required parameter: "keyId"');
748
- }
749
-
750
- let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
751
- let payload: Payload = {};
752
-
753
- const uri = new URL(this.client.config.endpoint + path);
754
- return await this.client.call('delete', uri, {
755
- 'content-type': 'application/json',
756
- }, payload);
757
- }
758
-
759
- /**
760
- * Update Project OAuth2
761
- *
762
- *
763
- * @param {string} projectId
764
- * @param {string} provider
765
- * @param {string} appId
766
- * @param {string} secret
767
- * @param {boolean} enabled
768
- * @throws {AppwriteException}
769
- * @returns {Promise}
770
- */
771
- async updateOAuth2(projectId: string, provider: string, appId?: string, secret?: string, enabled?: boolean): Promise<Models.Project> {
772
- if (typeof projectId === 'undefined') {
773
- throw new AppwriteException('Missing required parameter: "projectId"');
774
- }
775
-
776
- if (typeof provider === 'undefined') {
777
- throw new AppwriteException('Missing required parameter: "provider"');
778
- }
779
-
780
- let path = '/projects/{projectId}/oauth2'.replace('{projectId}', projectId);
781
- let payload: Payload = {};
782
-
783
- if (typeof provider !== 'undefined') {
784
- payload['provider'] = provider;
785
- }
786
-
787
- if (typeof appId !== 'undefined') {
788
- payload['appId'] = appId;
789
- }
790
-
791
- if (typeof secret !== 'undefined') {
792
- payload['secret'] = secret;
793
- }
794
-
795
- if (typeof enabled !== 'undefined') {
796
- payload['enabled'] = enabled;
797
- }
798
-
799
- const uri = new URL(this.client.config.endpoint + path);
800
- return await this.client.call('patch', uri, {
801
- 'content-type': 'application/json',
802
- }, payload);
803
- }
804
-
805
- /**
806
- * List Platforms
807
- *
808
- *
809
- * @param {string} projectId
810
- * @throws {AppwriteException}
811
- * @returns {Promise}
812
- */
813
- async listPlatforms(projectId: string): Promise<Models.PlatformList> {
814
- if (typeof projectId === 'undefined') {
815
- throw new AppwriteException('Missing required parameter: "projectId"');
816
- }
817
-
818
- let path = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
819
- let payload: Payload = {};
820
-
821
- const uri = new URL(this.client.config.endpoint + path);
822
- return await this.client.call('get', uri, {
823
- 'content-type': 'application/json',
824
- }, payload);
825
- }
826
-
827
- /**
828
- * Create Platform
829
- *
830
- *
831
- * @param {string} projectId
832
- * @param {string} type
833
- * @param {string} name
834
- * @param {string} key
835
- * @param {string} store
836
- * @param {string} hostname
837
- * @throws {AppwriteException}
838
- * @returns {Promise}
839
- */
840
- async createPlatform(projectId: string, type: string, name: string, key?: string, store?: string, hostname?: string): Promise<Models.Platform> {
841
- if (typeof projectId === 'undefined') {
842
- throw new AppwriteException('Missing required parameter: "projectId"');
843
- }
844
-
845
- if (typeof type === 'undefined') {
846
- throw new AppwriteException('Missing required parameter: "type"');
847
- }
848
-
849
- if (typeof name === 'undefined') {
850
- throw new AppwriteException('Missing required parameter: "name"');
851
- }
852
-
853
- let path = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
854
- let payload: Payload = {};
855
-
856
- if (typeof type !== 'undefined') {
857
- payload['type'] = type;
858
- }
859
-
860
- if (typeof name !== 'undefined') {
861
- payload['name'] = name;
862
- }
863
-
864
- if (typeof key !== 'undefined') {
865
- payload['key'] = key;
866
- }
867
-
868
- if (typeof store !== 'undefined') {
869
- payload['store'] = store;
870
- }
871
-
872
- if (typeof hostname !== 'undefined') {
873
- payload['hostname'] = hostname;
874
- }
875
-
876
- const uri = new URL(this.client.config.endpoint + path);
877
- return await this.client.call('post', uri, {
878
- 'content-type': 'application/json',
879
- }, payload);
880
- }
881
-
882
- /**
883
- * Get Platform
884
- *
885
- *
886
- * @param {string} projectId
887
- * @param {string} platformId
888
- * @throws {AppwriteException}
889
- * @returns {Promise}
890
- */
891
- async getPlatform(projectId: string, platformId: string): Promise<Models.Platform> {
892
- if (typeof projectId === 'undefined') {
893
- throw new AppwriteException('Missing required parameter: "projectId"');
894
- }
895
-
896
- if (typeof platformId === 'undefined') {
897
- throw new AppwriteException('Missing required parameter: "platformId"');
898
- }
899
-
900
- let path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
901
- let payload: Payload = {};
902
-
903
- const uri = new URL(this.client.config.endpoint + path);
904
- return await this.client.call('get', uri, {
905
- 'content-type': 'application/json',
906
- }, payload);
907
- }
908
-
909
- /**
910
- * Update Platform
911
- *
912
- *
913
- * @param {string} projectId
914
- * @param {string} platformId
915
- * @param {string} name
916
- * @param {string} key
917
- * @param {string} store
918
- * @param {string} hostname
919
- * @throws {AppwriteException}
920
- * @returns {Promise}
921
- */
922
- async updatePlatform(projectId: string, platformId: string, name: string, key?: string, store?: string, hostname?: string): Promise<Models.Platform> {
923
- if (typeof projectId === 'undefined') {
924
- throw new AppwriteException('Missing required parameter: "projectId"');
925
- }
926
-
927
- if (typeof platformId === 'undefined') {
928
- throw new AppwriteException('Missing required parameter: "platformId"');
929
- }
930
-
931
- if (typeof name === 'undefined') {
932
- throw new AppwriteException('Missing required parameter: "name"');
933
- }
934
-
935
- let path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
936
- let payload: Payload = {};
937
-
938
- if (typeof name !== 'undefined') {
939
- payload['name'] = name;
940
- }
941
-
942
- if (typeof key !== 'undefined') {
943
- payload['key'] = key;
944
- }
945
-
946
- if (typeof store !== 'undefined') {
947
- payload['store'] = store;
948
- }
949
-
950
- if (typeof hostname !== 'undefined') {
951
- payload['hostname'] = hostname;
952
- }
953
-
954
- const uri = new URL(this.client.config.endpoint + path);
955
- return await this.client.call('put', uri, {
956
- 'content-type': 'application/json',
957
- }, payload);
958
- }
959
-
960
- /**
961
- * Delete Platform
962
- *
963
- *
964
- * @param {string} projectId
965
- * @param {string} platformId
966
- * @throws {AppwriteException}
967
- * @returns {Promise}
968
- */
969
- async deletePlatform(projectId: string, platformId: string): Promise<{}> {
970
- if (typeof projectId === 'undefined') {
971
- throw new AppwriteException('Missing required parameter: "projectId"');
972
- }
973
-
974
- if (typeof platformId === 'undefined') {
975
- throw new AppwriteException('Missing required parameter: "platformId"');
976
- }
977
-
978
- let path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
979
- let payload: Payload = {};
980
-
981
- const uri = new URL(this.client.config.endpoint + path);
982
- return await this.client.call('delete', uri, {
983
- 'content-type': 'application/json',
984
- }, payload);
985
- }
986
-
987
- /**
988
- * Update service status
989
- *
990
- *
991
- * @param {string} projectId
992
- * @param {string} service
993
- * @param {boolean} status
994
- * @throws {AppwriteException}
995
- * @returns {Promise}
996
- */
997
- async updateServiceStatus(projectId: string, service: string, status: boolean): Promise<Models.Project> {
998
- if (typeof projectId === 'undefined') {
999
- throw new AppwriteException('Missing required parameter: "projectId"');
1000
- }
1001
-
1002
- if (typeof service === 'undefined') {
1003
- throw new AppwriteException('Missing required parameter: "service"');
1004
- }
1005
-
1006
- if (typeof status === 'undefined') {
1007
- throw new AppwriteException('Missing required parameter: "status"');
1008
- }
1009
-
1010
- let path = '/projects/{projectId}/service'.replace('{projectId}', projectId);
1011
- let payload: Payload = {};
1012
-
1013
- if (typeof service !== 'undefined') {
1014
- payload['service'] = service;
1015
- }
1016
-
1017
- if (typeof status !== 'undefined') {
1018
- payload['status'] = status;
1019
- }
1020
-
1021
- const uri = new URL(this.client.config.endpoint + path);
1022
- return await this.client.call('patch', uri, {
1023
- 'content-type': 'application/json',
1024
- }, payload);
1025
- }
1026
-
1027
- /**
1028
- * List Webhooks
1029
- *
1030
- *
1031
- * @param {string} projectId
1032
- * @throws {AppwriteException}
1033
- * @returns {Promise}
1034
- */
1035
- async listWebhooks(projectId: string): Promise<Models.WebhookList> {
1036
- if (typeof projectId === 'undefined') {
1037
- throw new AppwriteException('Missing required parameter: "projectId"');
1038
- }
1039
-
1040
- let path = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
1041
- let payload: Payload = {};
1042
-
1043
- const uri = new URL(this.client.config.endpoint + path);
1044
- return await this.client.call('get', uri, {
1045
- 'content-type': 'application/json',
1046
- }, payload);
1047
- }
1048
-
1049
- /**
1050
- * Create Webhook
1051
- *
1052
- *
1053
- * @param {string} projectId
1054
- * @param {string} name
1055
- * @param {string[]} events
1056
- * @param {string} url
1057
- * @param {boolean} security
1058
- * @param {string} httpUser
1059
- * @param {string} httpPass
1060
- * @throws {AppwriteException}
1061
- * @returns {Promise}
1062
- */
1063
- async createWebhook(projectId: string, name: string, events: string[], url: string, security: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook> {
1064
- if (typeof projectId === 'undefined') {
1065
- throw new AppwriteException('Missing required parameter: "projectId"');
1066
- }
1067
-
1068
- if (typeof name === 'undefined') {
1069
- throw new AppwriteException('Missing required parameter: "name"');
1070
- }
1071
-
1072
- if (typeof events === 'undefined') {
1073
- throw new AppwriteException('Missing required parameter: "events"');
1074
- }
1075
-
1076
- if (typeof url === 'undefined') {
1077
- throw new AppwriteException('Missing required parameter: "url"');
1078
- }
1079
-
1080
- if (typeof security === 'undefined') {
1081
- throw new AppwriteException('Missing required parameter: "security"');
1082
- }
1083
-
1084
- let path = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
1085
- let payload: Payload = {};
1086
-
1087
- if (typeof name !== 'undefined') {
1088
- payload['name'] = name;
1089
- }
1090
-
1091
- if (typeof events !== 'undefined') {
1092
- payload['events'] = events;
1093
- }
1094
-
1095
- if (typeof url !== 'undefined') {
1096
- payload['url'] = url;
1097
- }
1098
-
1099
- if (typeof security !== 'undefined') {
1100
- payload['security'] = security;
1101
- }
1102
-
1103
- if (typeof httpUser !== 'undefined') {
1104
- payload['httpUser'] = httpUser;
1105
- }
1106
-
1107
- if (typeof httpPass !== 'undefined') {
1108
- payload['httpPass'] = httpPass;
1109
- }
1110
-
1111
- const uri = new URL(this.client.config.endpoint + path);
1112
- return await this.client.call('post', uri, {
1113
- 'content-type': 'application/json',
1114
- }, payload);
1115
- }
1116
-
1117
- /**
1118
- * Get Webhook
1119
- *
1120
- *
1121
- * @param {string} projectId
1122
- * @param {string} webhookId
1123
- * @throws {AppwriteException}
1124
- * @returns {Promise}
1125
- */
1126
- async getWebhook(projectId: string, webhookId: string): Promise<Models.Webhook> {
1127
- if (typeof projectId === 'undefined') {
1128
- throw new AppwriteException('Missing required parameter: "projectId"');
1129
- }
1130
-
1131
- if (typeof webhookId === 'undefined') {
1132
- throw new AppwriteException('Missing required parameter: "webhookId"');
1133
- }
1134
-
1135
- let path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1136
- let payload: Payload = {};
1137
-
1138
- const uri = new URL(this.client.config.endpoint + path);
1139
- return await this.client.call('get', uri, {
1140
- 'content-type': 'application/json',
1141
- }, payload);
1142
- }
1143
-
1144
- /**
1145
- * Update Webhook
1146
- *
1147
- *
1148
- * @param {string} projectId
1149
- * @param {string} webhookId
1150
- * @param {string} name
1151
- * @param {string[]} events
1152
- * @param {string} url
1153
- * @param {boolean} security
1154
- * @param {string} httpUser
1155
- * @param {string} httpPass
1156
- * @throws {AppwriteException}
1157
- * @returns {Promise}
1158
- */
1159
- async updateWebhook(projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook> {
1160
- if (typeof projectId === 'undefined') {
1161
- throw new AppwriteException('Missing required parameter: "projectId"');
1162
- }
1163
-
1164
- if (typeof webhookId === 'undefined') {
1165
- throw new AppwriteException('Missing required parameter: "webhookId"');
1166
- }
1167
-
1168
- if (typeof name === 'undefined') {
1169
- throw new AppwriteException('Missing required parameter: "name"');
1170
- }
1171
-
1172
- if (typeof events === 'undefined') {
1173
- throw new AppwriteException('Missing required parameter: "events"');
1174
- }
1175
-
1176
- if (typeof url === 'undefined') {
1177
- throw new AppwriteException('Missing required parameter: "url"');
1178
- }
1179
-
1180
- if (typeof security === 'undefined') {
1181
- throw new AppwriteException('Missing required parameter: "security"');
1182
- }
1183
-
1184
- let path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1185
- let payload: Payload = {};
1186
-
1187
- if (typeof name !== 'undefined') {
1188
- payload['name'] = name;
1189
- }
1190
-
1191
- if (typeof events !== 'undefined') {
1192
- payload['events'] = events;
1193
- }
1194
-
1195
- if (typeof url !== 'undefined') {
1196
- payload['url'] = url;
1197
- }
1198
-
1199
- if (typeof security !== 'undefined') {
1200
- payload['security'] = security;
1201
- }
1202
-
1203
- if (typeof httpUser !== 'undefined') {
1204
- payload['httpUser'] = httpUser;
1205
- }
1206
-
1207
- if (typeof httpPass !== 'undefined') {
1208
- payload['httpPass'] = httpPass;
1209
- }
1210
-
1211
- const uri = new URL(this.client.config.endpoint + path);
1212
- return await this.client.call('put', uri, {
1213
- 'content-type': 'application/json',
1214
- }, payload);
1215
- }
1216
-
1217
- /**
1218
- * Delete Webhook
1219
- *
1220
- *
1221
- * @param {string} projectId
1222
- * @param {string} webhookId
1223
- * @throws {AppwriteException}
1224
- * @returns {Promise}
1225
- */
1226
- async deleteWebhook(projectId: string, webhookId: string): Promise<{}> {
1227
- if (typeof projectId === 'undefined') {
1228
- throw new AppwriteException('Missing required parameter: "projectId"');
1229
- }
1230
-
1231
- if (typeof webhookId === 'undefined') {
1232
- throw new AppwriteException('Missing required parameter: "webhookId"');
1233
- }
1234
-
1235
- let path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1236
- let payload: Payload = {};
1237
-
1238
- const uri = new URL(this.client.config.endpoint + path);
1239
- return await this.client.call('delete', uri, {
1240
- 'content-type': 'application/json',
1241
- }, payload);
1242
- }
1243
-
1244
- /**
1245
- * Update Webhook Signature Key
1246
- *
1247
- *
1248
- * @param {string} projectId
1249
- * @param {string} webhookId
1250
- * @throws {AppwriteException}
1251
- * @returns {Promise}
1252
- */
1253
- async updateWebhookSignature(projectId: string, webhookId: string): Promise<Models.Webhook> {
1254
- if (typeof projectId === 'undefined') {
1255
- throw new AppwriteException('Missing required parameter: "projectId"');
1256
- }
1257
-
1258
- if (typeof webhookId === 'undefined') {
1259
- throw new AppwriteException('Missing required parameter: "webhookId"');
1260
- }
1261
-
1262
- let path = '/projects/{projectId}/webhooks/{webhookId}/signature'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1263
- let payload: Payload = {};
1264
-
1265
- const uri = new URL(this.client.config.endpoint + path);
1266
- return await this.client.call('patch', uri, {
1267
- 'content-type': 'application/json',
1268
- }, payload);
13
+ /**
14
+ * List Projects
15
+ *
16
+ *
17
+ * @param {string[]} queries
18
+ * @param {string} search
19
+ * @throws {AppwriteException}
20
+ * @returns {Promise}
21
+ */
22
+ async list(queries?: string[], search?: string): Promise<Models.ProjectList> {
23
+ let path = '/projects';
24
+ let payload: Payload = {};
25
+
26
+ if (typeof queries !== 'undefined') {
27
+ payload['queries'] = queries;
1269
28
  }
29
+
30
+ if (typeof search !== 'undefined') {
31
+ payload['search'] = search;
32
+ }
33
+
34
+ const uri = new URL(this.client.config.endpoint + path);
35
+ return await this.client.call('get', uri, {
36
+ 'content-type': 'application/json',
37
+ }, payload);
38
+ }
39
+
40
+ /**
41
+ * Create Project
42
+ *
43
+ *
44
+ * @param {string} projectId
45
+ * @param {string} name
46
+ * @param {string} teamId
47
+ * @param {string} region
48
+ * @param {string} description
49
+ * @param {string} logo
50
+ * @param {string} url
51
+ * @param {string} legalName
52
+ * @param {string} legalCountry
53
+ * @param {string} legalState
54
+ * @param {string} legalCity
55
+ * @param {string} legalAddress
56
+ * @param {string} legalTaxId
57
+ * @throws {AppwriteException}
58
+ * @returns {Promise}
59
+ */
60
+ async create(projectId: string, name: string, teamId: string, region?: string, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise<Models.Project> {
61
+ if (typeof projectId === 'undefined') {
62
+ throw new AppwriteException('Missing required parameter: "projectId"');
63
+ }
64
+
65
+ if (typeof name === 'undefined') {
66
+ throw new AppwriteException('Missing required parameter: "name"');
67
+ }
68
+
69
+ if (typeof teamId === 'undefined') {
70
+ throw new AppwriteException('Missing required parameter: "teamId"');
71
+ }
72
+
73
+ let path = '/projects';
74
+ let payload: Payload = {};
75
+
76
+ if (typeof projectId !== 'undefined') {
77
+ payload['projectId'] = projectId;
78
+ }
79
+
80
+ if (typeof name !== 'undefined') {
81
+ payload['name'] = name;
82
+ }
83
+
84
+ if (typeof teamId !== 'undefined') {
85
+ payload['teamId'] = teamId;
86
+ }
87
+
88
+ if (typeof region !== 'undefined') {
89
+ payload['region'] = region;
90
+ }
91
+
92
+ if (typeof description !== 'undefined') {
93
+ payload['description'] = description;
94
+ }
95
+
96
+ if (typeof logo !== 'undefined') {
97
+ payload['logo'] = logo;
98
+ }
99
+
100
+ if (typeof url !== 'undefined') {
101
+ payload['url'] = url;
102
+ }
103
+
104
+ if (typeof legalName !== 'undefined') {
105
+ payload['legalName'] = legalName;
106
+ }
107
+
108
+ if (typeof legalCountry !== 'undefined') {
109
+ payload['legalCountry'] = legalCountry;
110
+ }
111
+
112
+ if (typeof legalState !== 'undefined') {
113
+ payload['legalState'] = legalState;
114
+ }
115
+
116
+ if (typeof legalCity !== 'undefined') {
117
+ payload['legalCity'] = legalCity;
118
+ }
119
+
120
+ if (typeof legalAddress !== 'undefined') {
121
+ payload['legalAddress'] = legalAddress;
122
+ }
123
+
124
+ if (typeof legalTaxId !== 'undefined') {
125
+ payload['legalTaxId'] = legalTaxId;
126
+ }
127
+
128
+ const uri = new URL(this.client.config.endpoint + path);
129
+ return await this.client.call('post', uri, {
130
+ 'content-type': 'application/json',
131
+ }, payload);
132
+ }
133
+
134
+ /**
135
+ * Get Project
136
+ *
137
+ *
138
+ * @param {string} projectId
139
+ * @throws {AppwriteException}
140
+ * @returns {Promise}
141
+ */
142
+ async get(projectId: string): Promise<Models.Project> {
143
+ if (typeof projectId === 'undefined') {
144
+ throw new AppwriteException('Missing required parameter: "projectId"');
145
+ }
146
+
147
+ let path = '/projects/{projectId}'.replace('{projectId}', projectId);
148
+ let payload: Payload = {};
149
+
150
+ const uri = new URL(this.client.config.endpoint + path);
151
+ return await this.client.call('get', uri, {
152
+ 'content-type': 'application/json',
153
+ }, payload);
154
+ }
155
+
156
+ /**
157
+ * Update Project
158
+ *
159
+ *
160
+ * @param {string} projectId
161
+ * @param {string} name
162
+ * @param {string} description
163
+ * @param {string} logo
164
+ * @param {string} url
165
+ * @param {string} legalName
166
+ * @param {string} legalCountry
167
+ * @param {string} legalState
168
+ * @param {string} legalCity
169
+ * @param {string} legalAddress
170
+ * @param {string} legalTaxId
171
+ * @throws {AppwriteException}
172
+ * @returns {Promise}
173
+ */
174
+ async update(projectId: string, name: string, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise<Models.Project> {
175
+ if (typeof projectId === 'undefined') {
176
+ throw new AppwriteException('Missing required parameter: "projectId"');
177
+ }
178
+
179
+ if (typeof name === 'undefined') {
180
+ throw new AppwriteException('Missing required parameter: "name"');
181
+ }
182
+
183
+ let path = '/projects/{projectId}'.replace('{projectId}', projectId);
184
+ let payload: Payload = {};
185
+
186
+ if (typeof name !== 'undefined') {
187
+ payload['name'] = name;
188
+ }
189
+
190
+ if (typeof description !== 'undefined') {
191
+ payload['description'] = description;
192
+ }
193
+
194
+ if (typeof logo !== 'undefined') {
195
+ payload['logo'] = logo;
196
+ }
197
+
198
+ if (typeof url !== 'undefined') {
199
+ payload['url'] = url;
200
+ }
201
+
202
+ if (typeof legalName !== 'undefined') {
203
+ payload['legalName'] = legalName;
204
+ }
205
+
206
+ if (typeof legalCountry !== 'undefined') {
207
+ payload['legalCountry'] = legalCountry;
208
+ }
209
+
210
+ if (typeof legalState !== 'undefined') {
211
+ payload['legalState'] = legalState;
212
+ }
213
+
214
+ if (typeof legalCity !== 'undefined') {
215
+ payload['legalCity'] = legalCity;
216
+ }
217
+
218
+ if (typeof legalAddress !== 'undefined') {
219
+ payload['legalAddress'] = legalAddress;
220
+ }
221
+
222
+ if (typeof legalTaxId !== 'undefined') {
223
+ payload['legalTaxId'] = legalTaxId;
224
+ }
225
+
226
+ const uri = new URL(this.client.config.endpoint + path);
227
+ return await this.client.call('patch', uri, {
228
+ 'content-type': 'application/json',
229
+ }, payload);
230
+ }
231
+
232
+ /**
233
+ * Delete Project
234
+ *
235
+ *
236
+ * @param {string} projectId
237
+ * @throws {AppwriteException}
238
+ * @returns {Promise}
239
+ */
240
+ async delete(projectId: string): Promise<{}> {
241
+ if (typeof projectId === 'undefined') {
242
+ throw new AppwriteException('Missing required parameter: "projectId"');
243
+ }
244
+
245
+ let path = '/projects/{projectId}'.replace('{projectId}', projectId);
246
+ let payload: Payload = {};
247
+
248
+ const uri = new URL(this.client.config.endpoint + path);
249
+ return await this.client.call('delete', uri, {
250
+ 'content-type': 'application/json',
251
+ }, payload);
252
+ }
253
+
254
+ /**
255
+ * Update Project Authentication Duration
256
+ *
257
+ *
258
+ * @param {string} projectId
259
+ * @param {number} duration
260
+ * @throws {AppwriteException}
261
+ * @returns {Promise}
262
+ */
263
+ async updateAuthDuration(projectId: string, duration: number): Promise<Models.Project> {
264
+ if (typeof projectId === 'undefined') {
265
+ throw new AppwriteException('Missing required parameter: "projectId"');
266
+ }
267
+
268
+ if (typeof duration === 'undefined') {
269
+ throw new AppwriteException('Missing required parameter: "duration"');
270
+ }
271
+
272
+ let path = '/projects/{projectId}/auth/duration'.replace('{projectId}', projectId);
273
+ let payload: Payload = {};
274
+
275
+ if (typeof duration !== 'undefined') {
276
+ payload['duration'] = duration;
277
+ }
278
+
279
+ const uri = new URL(this.client.config.endpoint + path);
280
+ return await this.client.call('patch', uri, {
281
+ 'content-type': 'application/json',
282
+ }, payload);
283
+ }
284
+
285
+ /**
286
+ * Update Project users limit
287
+ *
288
+ *
289
+ * @param {string} projectId
290
+ * @param {number} limit
291
+ * @throws {AppwriteException}
292
+ * @returns {Promise}
293
+ */
294
+ async updateAuthLimit(projectId: string, limit: number): Promise<Models.Project> {
295
+ if (typeof projectId === 'undefined') {
296
+ throw new AppwriteException('Missing required parameter: "projectId"');
297
+ }
298
+
299
+ if (typeof limit === 'undefined') {
300
+ throw new AppwriteException('Missing required parameter: "limit"');
301
+ }
302
+
303
+ let path = '/projects/{projectId}/auth/limit'.replace('{projectId}', projectId);
304
+ let payload: Payload = {};
305
+
306
+ if (typeof limit !== 'undefined') {
307
+ payload['limit'] = limit;
308
+ }
309
+
310
+ const uri = new URL(this.client.config.endpoint + path);
311
+ return await this.client.call('patch', uri, {
312
+ 'content-type': 'application/json',
313
+ }, payload);
314
+ }
315
+
316
+ /**
317
+ * Update Project user sessions limit
318
+ *
319
+ *
320
+ * @param {string} projectId
321
+ * @param {number} limit
322
+ * @throws {AppwriteException}
323
+ * @returns {Promise}
324
+ */
325
+ async updateAuthSessionsLimit(projectId: string, limit: number): Promise<Models.Project> {
326
+ if (typeof projectId === 'undefined') {
327
+ throw new AppwriteException('Missing required parameter: "projectId"');
328
+ }
329
+
330
+ if (typeof limit === 'undefined') {
331
+ throw new AppwriteException('Missing required parameter: "limit"');
332
+ }
333
+
334
+ let path = '/projects/{projectId}/auth/max-sessions'.replace('{projectId}', projectId);
335
+ let payload: Payload = {};
336
+
337
+ if (typeof limit !== 'undefined') {
338
+ payload['limit'] = limit;
339
+ }
340
+
341
+ const uri = new URL(this.client.config.endpoint + path);
342
+ return await this.client.call('patch', uri, {
343
+ 'content-type': 'application/json',
344
+ }, payload);
345
+ }
346
+
347
+ /**
348
+ * Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password
349
+ *
350
+ *
351
+ * @param {string} projectId
352
+ * @param {boolean} enabled
353
+ * @throws {AppwriteException}
354
+ * @returns {Promise}
355
+ */
356
+ async updateAuthPasswordDictionary(projectId: string, enabled: boolean): Promise<Models.Project> {
357
+ if (typeof projectId === 'undefined') {
358
+ throw new AppwriteException('Missing required parameter: "projectId"');
359
+ }
360
+
361
+ if (typeof enabled === 'undefined') {
362
+ throw new AppwriteException('Missing required parameter: "enabled"');
363
+ }
364
+
365
+ let path = '/projects/{projectId}/auth/password-dictionary'.replace('{projectId}', projectId);
366
+ let payload: Payload = {};
367
+
368
+ if (typeof enabled !== 'undefined') {
369
+ payload['enabled'] = enabled;
370
+ }
371
+
372
+ const uri = new URL(this.client.config.endpoint + path);
373
+ return await this.client.call('patch', uri, {
374
+ 'content-type': 'application/json',
375
+ }, payload);
376
+ }
377
+
378
+ /**
379
+ * Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.
380
+ *
381
+ *
382
+ * @param {string} projectId
383
+ * @param {number} limit
384
+ * @throws {AppwriteException}
385
+ * @returns {Promise}
386
+ */
387
+ async updateAuthPasswordHistory(projectId: string, limit: number): Promise<Models.Project> {
388
+ if (typeof projectId === 'undefined') {
389
+ throw new AppwriteException('Missing required parameter: "projectId"');
390
+ }
391
+
392
+ if (typeof limit === 'undefined') {
393
+ throw new AppwriteException('Missing required parameter: "limit"');
394
+ }
395
+
396
+ let path = '/projects/{projectId}/auth/password-history'.replace('{projectId}', projectId);
397
+ let payload: Payload = {};
398
+
399
+ if (typeof limit !== 'undefined') {
400
+ payload['limit'] = limit;
401
+ }
402
+
403
+ const uri = new URL(this.client.config.endpoint + path);
404
+ return await this.client.call('patch', uri, {
405
+ 'content-type': 'application/json',
406
+ }, payload);
407
+ }
408
+
409
+ /**
410
+ * Enable or disable checking user passwords for similarity with their personal data.
411
+ *
412
+ *
413
+ * @param {string} projectId
414
+ * @param {boolean} enabled
415
+ * @throws {AppwriteException}
416
+ * @returns {Promise}
417
+ */
418
+ async updatePersonalDataCheck(projectId: string, enabled: boolean): Promise<Models.Project> {
419
+ if (typeof projectId === 'undefined') {
420
+ throw new AppwriteException('Missing required parameter: "projectId"');
421
+ }
422
+
423
+ if (typeof enabled === 'undefined') {
424
+ throw new AppwriteException('Missing required parameter: "enabled"');
425
+ }
426
+
427
+ let path = '/projects/{projectId}/auth/personal-data'.replace('{projectId}', projectId);
428
+ let payload: Payload = {};
429
+
430
+ if (typeof enabled !== 'undefined') {
431
+ payload['enabled'] = enabled;
432
+ }
433
+
434
+ const uri = new URL(this.client.config.endpoint + path);
435
+ return await this.client.call('patch', uri, {
436
+ 'content-type': 'application/json',
437
+ }, payload);
438
+ }
439
+
440
+ /**
441
+ * Update Project auth method status. Use this endpoint to enable or disable a given auth method for this project.
442
+ *
443
+ *
444
+ * @param {string} projectId
445
+ * @param {string} method
446
+ * @param {boolean} status
447
+ * @throws {AppwriteException}
448
+ * @returns {Promise}
449
+ */
450
+ async updateAuthStatus(projectId: string, method: string, status: boolean): Promise<Models.Project> {
451
+ if (typeof projectId === 'undefined') {
452
+ throw new AppwriteException('Missing required parameter: "projectId"');
453
+ }
454
+
455
+ if (typeof method === 'undefined') {
456
+ throw new AppwriteException('Missing required parameter: "method"');
457
+ }
458
+
459
+ if (typeof status === 'undefined') {
460
+ throw new AppwriteException('Missing required parameter: "status"');
461
+ }
462
+
463
+ let path = '/projects/{projectId}/auth/{method}'.replace('{projectId}', projectId).replace('{method}', method);
464
+ let payload: Payload = {};
465
+
466
+ if (typeof status !== 'undefined') {
467
+ payload['status'] = status;
468
+ }
469
+
470
+ const uri = new URL(this.client.config.endpoint + path);
471
+ return await this.client.call('patch', uri, {
472
+ 'content-type': 'application/json',
473
+ }, payload);
474
+ }
475
+
476
+ /**
477
+ * List Keys
478
+ *
479
+ *
480
+ * @param {string} projectId
481
+ * @throws {AppwriteException}
482
+ * @returns {Promise}
483
+ */
484
+ async listKeys(projectId: string): Promise<Models.KeyList> {
485
+ if (typeof projectId === 'undefined') {
486
+ throw new AppwriteException('Missing required parameter: "projectId"');
487
+ }
488
+
489
+ let path = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
490
+ let payload: Payload = {};
491
+
492
+ const uri = new URL(this.client.config.endpoint + path);
493
+ return await this.client.call('get', uri, {
494
+ 'content-type': 'application/json',
495
+ }, payload);
496
+ }
497
+
498
+ /**
499
+ * Create Key
500
+ *
501
+ *
502
+ * @param {string} projectId
503
+ * @param {string} name
504
+ * @param {string[]} scopes
505
+ * @param {string} expire
506
+ * @throws {AppwriteException}
507
+ * @returns {Promise}
508
+ */
509
+ async createKey(projectId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key> {
510
+ if (typeof projectId === 'undefined') {
511
+ throw new AppwriteException('Missing required parameter: "projectId"');
512
+ }
513
+
514
+ if (typeof name === 'undefined') {
515
+ throw new AppwriteException('Missing required parameter: "name"');
516
+ }
517
+
518
+ if (typeof scopes === 'undefined') {
519
+ throw new AppwriteException('Missing required parameter: "scopes"');
520
+ }
521
+
522
+ let path = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
523
+ let payload: Payload = {};
524
+
525
+ if (typeof name !== 'undefined') {
526
+ payload['name'] = name;
527
+ }
528
+
529
+ if (typeof scopes !== 'undefined') {
530
+ payload['scopes'] = scopes;
531
+ }
532
+
533
+ if (typeof expire !== 'undefined') {
534
+ payload['expire'] = expire;
535
+ }
536
+
537
+ const uri = new URL(this.client.config.endpoint + path);
538
+ return await this.client.call('post', uri, {
539
+ 'content-type': 'application/json',
540
+ }, payload);
541
+ }
542
+
543
+ /**
544
+ * Get Key
545
+ *
546
+ *
547
+ * @param {string} projectId
548
+ * @param {string} keyId
549
+ * @throws {AppwriteException}
550
+ * @returns {Promise}
551
+ */
552
+ async getKey(projectId: string, keyId: string): Promise<Models.Key> {
553
+ if (typeof projectId === 'undefined') {
554
+ throw new AppwriteException('Missing required parameter: "projectId"');
555
+ }
556
+
557
+ if (typeof keyId === 'undefined') {
558
+ throw new AppwriteException('Missing required parameter: "keyId"');
559
+ }
560
+
561
+ let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
562
+ let payload: Payload = {};
563
+
564
+ const uri = new URL(this.client.config.endpoint + path);
565
+ return await this.client.call('get', uri, {
566
+ 'content-type': 'application/json',
567
+ }, payload);
568
+ }
569
+
570
+ /**
571
+ * Update Key
572
+ *
573
+ *
574
+ * @param {string} projectId
575
+ * @param {string} keyId
576
+ * @param {string} name
577
+ * @param {string[]} scopes
578
+ * @param {string} expire
579
+ * @throws {AppwriteException}
580
+ * @returns {Promise}
581
+ */
582
+ async updateKey(projectId: string, keyId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key> {
583
+ if (typeof projectId === 'undefined') {
584
+ throw new AppwriteException('Missing required parameter: "projectId"');
585
+ }
586
+
587
+ if (typeof keyId === 'undefined') {
588
+ throw new AppwriteException('Missing required parameter: "keyId"');
589
+ }
590
+
591
+ if (typeof name === 'undefined') {
592
+ throw new AppwriteException('Missing required parameter: "name"');
593
+ }
594
+
595
+ if (typeof scopes === 'undefined') {
596
+ throw new AppwriteException('Missing required parameter: "scopes"');
597
+ }
598
+
599
+ let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
600
+ let payload: Payload = {};
601
+
602
+ if (typeof name !== 'undefined') {
603
+ payload['name'] = name;
604
+ }
605
+
606
+ if (typeof scopes !== 'undefined') {
607
+ payload['scopes'] = scopes;
608
+ }
609
+
610
+ if (typeof expire !== 'undefined') {
611
+ payload['expire'] = expire;
612
+ }
613
+
614
+ const uri = new URL(this.client.config.endpoint + path);
615
+ return await this.client.call('put', uri, {
616
+ 'content-type': 'application/json',
617
+ }, payload);
618
+ }
619
+
620
+ /**
621
+ * Delete Key
622
+ *
623
+ *
624
+ * @param {string} projectId
625
+ * @param {string} keyId
626
+ * @throws {AppwriteException}
627
+ * @returns {Promise}
628
+ */
629
+ async deleteKey(projectId: string, keyId: string): Promise<{}> {
630
+ if (typeof projectId === 'undefined') {
631
+ throw new AppwriteException('Missing required parameter: "projectId"');
632
+ }
633
+
634
+ if (typeof keyId === 'undefined') {
635
+ throw new AppwriteException('Missing required parameter: "keyId"');
636
+ }
637
+
638
+ let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
639
+ let payload: Payload = {};
640
+
641
+ const uri = new URL(this.client.config.endpoint + path);
642
+ return await this.client.call('delete', uri, {
643
+ 'content-type': 'application/json',
644
+ }, payload);
645
+ }
646
+
647
+ /**
648
+ * Update Project OAuth2
649
+ *
650
+ *
651
+ * @param {string} projectId
652
+ * @param {string} provider
653
+ * @param {string} appId
654
+ * @param {string} secret
655
+ * @param {boolean} enabled
656
+ * @throws {AppwriteException}
657
+ * @returns {Promise}
658
+ */
659
+ async updateOAuth2(projectId: string, provider: string, appId?: string, secret?: string, enabled?: boolean): Promise<Models.Project> {
660
+ if (typeof projectId === 'undefined') {
661
+ throw new AppwriteException('Missing required parameter: "projectId"');
662
+ }
663
+
664
+ if (typeof provider === 'undefined') {
665
+ throw new AppwriteException('Missing required parameter: "provider"');
666
+ }
667
+
668
+ let path = '/projects/{projectId}/oauth2'.replace('{projectId}', projectId);
669
+ let payload: Payload = {};
670
+
671
+ if (typeof provider !== 'undefined') {
672
+ payload['provider'] = provider;
673
+ }
674
+
675
+ if (typeof appId !== 'undefined') {
676
+ payload['appId'] = appId;
677
+ }
678
+
679
+ if (typeof secret !== 'undefined') {
680
+ payload['secret'] = secret;
681
+ }
682
+
683
+ if (typeof enabled !== 'undefined') {
684
+ payload['enabled'] = enabled;
685
+ }
686
+
687
+ const uri = new URL(this.client.config.endpoint + path);
688
+ return await this.client.call('patch', uri, {
689
+ 'content-type': 'application/json',
690
+ }, payload);
691
+ }
692
+
693
+ /**
694
+ * List Platforms
695
+ *
696
+ *
697
+ * @param {string} projectId
698
+ * @throws {AppwriteException}
699
+ * @returns {Promise}
700
+ */
701
+ async listPlatforms(projectId: string): Promise<Models.PlatformList> {
702
+ if (typeof projectId === 'undefined') {
703
+ throw new AppwriteException('Missing required parameter: "projectId"');
704
+ }
705
+
706
+ let path = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
707
+ let payload: Payload = {};
708
+
709
+ const uri = new URL(this.client.config.endpoint + path);
710
+ return await this.client.call('get', uri, {
711
+ 'content-type': 'application/json',
712
+ }, payload);
713
+ }
714
+
715
+ /**
716
+ * Create Platform
717
+ *
718
+ *
719
+ * @param {string} projectId
720
+ * @param {string} type
721
+ * @param {string} name
722
+ * @param {string} key
723
+ * @param {string} store
724
+ * @param {string} hostname
725
+ * @throws {AppwriteException}
726
+ * @returns {Promise}
727
+ */
728
+ async createPlatform(projectId: string, type: string, name: string, key?: string, store?: string, hostname?: string): Promise<Models.Platform> {
729
+ if (typeof projectId === 'undefined') {
730
+ throw new AppwriteException('Missing required parameter: "projectId"');
731
+ }
732
+
733
+ if (typeof type === 'undefined') {
734
+ throw new AppwriteException('Missing required parameter: "type"');
735
+ }
736
+
737
+ if (typeof name === 'undefined') {
738
+ throw new AppwriteException('Missing required parameter: "name"');
739
+ }
740
+
741
+ let path = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
742
+ let payload: Payload = {};
743
+
744
+ if (typeof type !== 'undefined') {
745
+ payload['type'] = type;
746
+ }
747
+
748
+ if (typeof name !== 'undefined') {
749
+ payload['name'] = name;
750
+ }
751
+
752
+ if (typeof key !== 'undefined') {
753
+ payload['key'] = key;
754
+ }
755
+
756
+ if (typeof store !== 'undefined') {
757
+ payload['store'] = store;
758
+ }
759
+
760
+ if (typeof hostname !== 'undefined') {
761
+ payload['hostname'] = hostname;
762
+ }
763
+
764
+ const uri = new URL(this.client.config.endpoint + path);
765
+ return await this.client.call('post', uri, {
766
+ 'content-type': 'application/json',
767
+ }, payload);
768
+ }
769
+
770
+ /**
771
+ * Get Platform
772
+ *
773
+ *
774
+ * @param {string} projectId
775
+ * @param {string} platformId
776
+ * @throws {AppwriteException}
777
+ * @returns {Promise}
778
+ */
779
+ async getPlatform(projectId: string, platformId: string): Promise<Models.Platform> {
780
+ if (typeof projectId === 'undefined') {
781
+ throw new AppwriteException('Missing required parameter: "projectId"');
782
+ }
783
+
784
+ if (typeof platformId === 'undefined') {
785
+ throw new AppwriteException('Missing required parameter: "platformId"');
786
+ }
787
+
788
+ let path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
789
+ let payload: Payload = {};
790
+
791
+ const uri = new URL(this.client.config.endpoint + path);
792
+ return await this.client.call('get', uri, {
793
+ 'content-type': 'application/json',
794
+ }, payload);
795
+ }
796
+
797
+ /**
798
+ * Update Platform
799
+ *
800
+ *
801
+ * @param {string} projectId
802
+ * @param {string} platformId
803
+ * @param {string} name
804
+ * @param {string} key
805
+ * @param {string} store
806
+ * @param {string} hostname
807
+ * @throws {AppwriteException}
808
+ * @returns {Promise}
809
+ */
810
+ async updatePlatform(projectId: string, platformId: string, name: string, key?: string, store?: string, hostname?: string): Promise<Models.Platform> {
811
+ if (typeof projectId === 'undefined') {
812
+ throw new AppwriteException('Missing required parameter: "projectId"');
813
+ }
814
+
815
+ if (typeof platformId === 'undefined') {
816
+ throw new AppwriteException('Missing required parameter: "platformId"');
817
+ }
818
+
819
+ if (typeof name === 'undefined') {
820
+ throw new AppwriteException('Missing required parameter: "name"');
821
+ }
822
+
823
+ let path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
824
+ let payload: Payload = {};
825
+
826
+ if (typeof name !== 'undefined') {
827
+ payload['name'] = name;
828
+ }
829
+
830
+ if (typeof key !== 'undefined') {
831
+ payload['key'] = key;
832
+ }
833
+
834
+ if (typeof store !== 'undefined') {
835
+ payload['store'] = store;
836
+ }
837
+
838
+ if (typeof hostname !== 'undefined') {
839
+ payload['hostname'] = hostname;
840
+ }
841
+
842
+ const uri = new URL(this.client.config.endpoint + path);
843
+ return await this.client.call('put', uri, {
844
+ 'content-type': 'application/json',
845
+ }, payload);
846
+ }
847
+
848
+ /**
849
+ * Delete Platform
850
+ *
851
+ *
852
+ * @param {string} projectId
853
+ * @param {string} platformId
854
+ * @throws {AppwriteException}
855
+ * @returns {Promise}
856
+ */
857
+ async deletePlatform(projectId: string, platformId: string): Promise<{}> {
858
+ if (typeof projectId === 'undefined') {
859
+ throw new AppwriteException('Missing required parameter: "projectId"');
860
+ }
861
+
862
+ if (typeof platformId === 'undefined') {
863
+ throw new AppwriteException('Missing required parameter: "platformId"');
864
+ }
865
+
866
+ let path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
867
+ let payload: Payload = {};
868
+
869
+ const uri = new URL(this.client.config.endpoint + path);
870
+ return await this.client.call('delete', uri, {
871
+ 'content-type': 'application/json',
872
+ }, payload);
873
+ }
874
+
875
+ /**
876
+ * Update service status
877
+ *
878
+ *
879
+ * @param {string} projectId
880
+ * @param {string} service
881
+ * @param {boolean} status
882
+ * @throws {AppwriteException}
883
+ * @returns {Promise}
884
+ */
885
+ async updateServiceStatus(projectId: string, service: string, status: boolean): Promise<Models.Project> {
886
+ if (typeof projectId === 'undefined') {
887
+ throw new AppwriteException('Missing required parameter: "projectId"');
888
+ }
889
+
890
+ if (typeof service === 'undefined') {
891
+ throw new AppwriteException('Missing required parameter: "service"');
892
+ }
893
+
894
+ if (typeof status === 'undefined') {
895
+ throw new AppwriteException('Missing required parameter: "status"');
896
+ }
897
+
898
+ let path = '/projects/{projectId}/service'.replace('{projectId}', projectId);
899
+ let payload: Payload = {};
900
+
901
+ if (typeof service !== 'undefined') {
902
+ payload['service'] = service;
903
+ }
904
+
905
+ if (typeof status !== 'undefined') {
906
+ payload['status'] = status;
907
+ }
908
+
909
+ const uri = new URL(this.client.config.endpoint + path);
910
+ return await this.client.call('patch', uri, {
911
+ 'content-type': 'application/json',
912
+ }, payload);
913
+ }
914
+
915
+ /**
916
+ * Update all service status
917
+ *
918
+ *
919
+ * @param {string} projectId
920
+ * @param {boolean} status
921
+ * @throws {AppwriteException}
922
+ * @returns {Promise}
923
+ */
924
+ async updateServiceStatusAll(projectId: string, status: boolean): Promise<Models.Project> {
925
+ if (typeof projectId === 'undefined') {
926
+ throw new AppwriteException('Missing required parameter: "projectId"');
927
+ }
928
+
929
+ if (typeof status === 'undefined') {
930
+ throw new AppwriteException('Missing required parameter: "status"');
931
+ }
932
+
933
+ let path = '/projects/{projectId}/service/all'.replace('{projectId}', projectId);
934
+ let payload: Payload = {};
935
+
936
+ if (typeof status !== 'undefined') {
937
+ payload['status'] = status;
938
+ }
939
+
940
+ const uri = new URL(this.client.config.endpoint + path);
941
+ return await this.client.call('patch', uri, {
942
+ 'content-type': 'application/json',
943
+ }, payload);
944
+ }
945
+
946
+ /**
947
+ * Update SMTP configuration
948
+ *
949
+ *
950
+ * @param {string} projectId
951
+ * @param {boolean} enabled
952
+ * @param {string} senderName
953
+ * @param {string} senderEmail
954
+ * @param {string} replyTo
955
+ * @param {string} host
956
+ * @param {number} port
957
+ * @param {string} username
958
+ * @param {string} password
959
+ * @param {string} secure
960
+ * @throws {AppwriteException}
961
+ * @returns {Promise}
962
+ */
963
+ async updateSmtpConfiguration(projectId: string, enabled: boolean, senderName?: string, senderEmail?: string, replyTo?: string, host?: string, port?: number, username?: string, password?: string, secure?: string): Promise<Models.Project> {
964
+ if (typeof projectId === 'undefined') {
965
+ throw new AppwriteException('Missing required parameter: "projectId"');
966
+ }
967
+
968
+ if (typeof enabled === 'undefined') {
969
+ throw new AppwriteException('Missing required parameter: "enabled"');
970
+ }
971
+
972
+ let path = '/projects/{projectId}/smtp'.replace('{projectId}', projectId);
973
+ let payload: Payload = {};
974
+
975
+ if (typeof enabled !== 'undefined') {
976
+ payload['enabled'] = enabled;
977
+ }
978
+
979
+ if (typeof senderName !== 'undefined') {
980
+ payload['senderName'] = senderName;
981
+ }
982
+
983
+ if (typeof senderEmail !== 'undefined') {
984
+ payload['senderEmail'] = senderEmail;
985
+ }
986
+
987
+ if (typeof replyTo !== 'undefined') {
988
+ payload['replyTo'] = replyTo;
989
+ }
990
+
991
+ if (typeof host !== 'undefined') {
992
+ payload['host'] = host;
993
+ }
994
+
995
+ if (typeof port !== 'undefined') {
996
+ payload['port'] = port;
997
+ }
998
+
999
+ if (typeof username !== 'undefined') {
1000
+ payload['username'] = username;
1001
+ }
1002
+
1003
+ if (typeof password !== 'undefined') {
1004
+ payload['password'] = password;
1005
+ }
1006
+
1007
+ if (typeof secure !== 'undefined') {
1008
+ payload['secure'] = secure;
1009
+ }
1010
+
1011
+ const uri = new URL(this.client.config.endpoint + path);
1012
+ return await this.client.call('patch', uri, {
1013
+ 'content-type': 'application/json',
1014
+ }, payload);
1015
+ }
1016
+
1017
+ /**
1018
+ * Update Project Team
1019
+ *
1020
+ *
1021
+ * @param {string} projectId
1022
+ * @param {string} teamId
1023
+ * @throws {AppwriteException}
1024
+ * @returns {Promise}
1025
+ */
1026
+ async updateTeam(projectId: string, teamId: string): Promise<Models.Project> {
1027
+ if (typeof projectId === 'undefined') {
1028
+ throw new AppwriteException('Missing required parameter: "projectId"');
1029
+ }
1030
+
1031
+ if (typeof teamId === 'undefined') {
1032
+ throw new AppwriteException('Missing required parameter: "teamId"');
1033
+ }
1034
+
1035
+ let path = '/projects/{projectId}/team'.replace('{projectId}', projectId);
1036
+ let payload: Payload = {};
1037
+
1038
+ if (typeof teamId !== 'undefined') {
1039
+ payload['teamId'] = teamId;
1040
+ }
1041
+
1042
+ const uri = new URL(this.client.config.endpoint + path);
1043
+ return await this.client.call('patch', uri, {
1044
+ 'content-type': 'application/json',
1045
+ }, payload);
1046
+ }
1047
+
1048
+ /**
1049
+ * Get custom email template
1050
+ *
1051
+ *
1052
+ * @param {string} projectId
1053
+ * @param {string} type
1054
+ * @param {string} locale
1055
+ * @throws {AppwriteException}
1056
+ * @returns {Promise}
1057
+ */
1058
+ async getEmailTemplate(projectId: string, type: string, locale: string): Promise<Models.EmailTemplate> {
1059
+ if (typeof projectId === 'undefined') {
1060
+ throw new AppwriteException('Missing required parameter: "projectId"');
1061
+ }
1062
+
1063
+ if (typeof type === 'undefined') {
1064
+ throw new AppwriteException('Missing required parameter: "type"');
1065
+ }
1066
+
1067
+ if (typeof locale === 'undefined') {
1068
+ throw new AppwriteException('Missing required parameter: "locale"');
1069
+ }
1070
+
1071
+ let path = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1072
+ let payload: Payload = {};
1073
+
1074
+ const uri = new URL(this.client.config.endpoint + path);
1075
+ return await this.client.call('get', uri, {
1076
+ 'content-type': 'application/json',
1077
+ }, payload);
1078
+ }
1079
+
1080
+ /**
1081
+ * Update custom email templates
1082
+ *
1083
+ *
1084
+ * @param {string} projectId
1085
+ * @param {string} type
1086
+ * @param {string} locale
1087
+ * @param {string} subject
1088
+ * @param {string} message
1089
+ * @param {string} senderName
1090
+ * @param {string} senderEmail
1091
+ * @param {string} replyTo
1092
+ * @throws {AppwriteException}
1093
+ * @returns {Promise}
1094
+ */
1095
+ async updateEmailTemplate(projectId: string, type: string, locale: string, subject: string, message: string, senderName?: string, senderEmail?: string, replyTo?: string): Promise<Models.Project> {
1096
+ if (typeof projectId === 'undefined') {
1097
+ throw new AppwriteException('Missing required parameter: "projectId"');
1098
+ }
1099
+
1100
+ if (typeof type === 'undefined') {
1101
+ throw new AppwriteException('Missing required parameter: "type"');
1102
+ }
1103
+
1104
+ if (typeof locale === 'undefined') {
1105
+ throw new AppwriteException('Missing required parameter: "locale"');
1106
+ }
1107
+
1108
+ if (typeof subject === 'undefined') {
1109
+ throw new AppwriteException('Missing required parameter: "subject"');
1110
+ }
1111
+
1112
+ if (typeof message === 'undefined') {
1113
+ throw new AppwriteException('Missing required parameter: "message"');
1114
+ }
1115
+
1116
+ let path = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1117
+ let payload: Payload = {};
1118
+
1119
+ if (typeof subject !== 'undefined') {
1120
+ payload['subject'] = subject;
1121
+ }
1122
+
1123
+ if (typeof message !== 'undefined') {
1124
+ payload['message'] = message;
1125
+ }
1126
+
1127
+ if (typeof senderName !== 'undefined') {
1128
+ payload['senderName'] = senderName;
1129
+ }
1130
+
1131
+ if (typeof senderEmail !== 'undefined') {
1132
+ payload['senderEmail'] = senderEmail;
1133
+ }
1134
+
1135
+ if (typeof replyTo !== 'undefined') {
1136
+ payload['replyTo'] = replyTo;
1137
+ }
1138
+
1139
+ const uri = new URL(this.client.config.endpoint + path);
1140
+ return await this.client.call('patch', uri, {
1141
+ 'content-type': 'application/json',
1142
+ }, payload);
1143
+ }
1144
+
1145
+ /**
1146
+ * Reset custom email template
1147
+ *
1148
+ *
1149
+ * @param {string} projectId
1150
+ * @param {string} type
1151
+ * @param {string} locale
1152
+ * @throws {AppwriteException}
1153
+ * @returns {Promise}
1154
+ */
1155
+ async deleteEmailTemplate(projectId: string, type: string, locale: string): Promise<Models.EmailTemplate> {
1156
+ if (typeof projectId === 'undefined') {
1157
+ throw new AppwriteException('Missing required parameter: "projectId"');
1158
+ }
1159
+
1160
+ if (typeof type === 'undefined') {
1161
+ throw new AppwriteException('Missing required parameter: "type"');
1162
+ }
1163
+
1164
+ if (typeof locale === 'undefined') {
1165
+ throw new AppwriteException('Missing required parameter: "locale"');
1166
+ }
1167
+
1168
+ let path = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1169
+ let payload: Payload = {};
1170
+
1171
+ const uri = new URL(this.client.config.endpoint + path);
1172
+ return await this.client.call('delete', uri, {
1173
+ 'content-type': 'application/json',
1174
+ }, payload);
1175
+ }
1176
+
1177
+ /**
1178
+ * Get custom SMS template
1179
+ *
1180
+ *
1181
+ * @param {string} projectId
1182
+ * @param {string} type
1183
+ * @param {string} locale
1184
+ * @throws {AppwriteException}
1185
+ * @returns {Promise}
1186
+ */
1187
+ async getSmsTemplate(projectId: string, type: string, locale: string): Promise<Models.SmsTemplate> {
1188
+ if (typeof projectId === 'undefined') {
1189
+ throw new AppwriteException('Missing required parameter: "projectId"');
1190
+ }
1191
+
1192
+ if (typeof type === 'undefined') {
1193
+ throw new AppwriteException('Missing required parameter: "type"');
1194
+ }
1195
+
1196
+ if (typeof locale === 'undefined') {
1197
+ throw new AppwriteException('Missing required parameter: "locale"');
1198
+ }
1199
+
1200
+ let path = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1201
+ let payload: Payload = {};
1202
+
1203
+ const uri = new URL(this.client.config.endpoint + path);
1204
+ return await this.client.call('get', uri, {
1205
+ 'content-type': 'application/json',
1206
+ }, payload);
1207
+ }
1208
+
1209
+ /**
1210
+ * Update custom SMS template
1211
+ *
1212
+ *
1213
+ * @param {string} projectId
1214
+ * @param {string} type
1215
+ * @param {string} locale
1216
+ * @param {string} message
1217
+ * @throws {AppwriteException}
1218
+ * @returns {Promise}
1219
+ */
1220
+ async updateSmsTemplate(projectId: string, type: string, locale: string, message: string): Promise<Models.SmsTemplate> {
1221
+ if (typeof projectId === 'undefined') {
1222
+ throw new AppwriteException('Missing required parameter: "projectId"');
1223
+ }
1224
+
1225
+ if (typeof type === 'undefined') {
1226
+ throw new AppwriteException('Missing required parameter: "type"');
1227
+ }
1228
+
1229
+ if (typeof locale === 'undefined') {
1230
+ throw new AppwriteException('Missing required parameter: "locale"');
1231
+ }
1232
+
1233
+ if (typeof message === 'undefined') {
1234
+ throw new AppwriteException('Missing required parameter: "message"');
1235
+ }
1236
+
1237
+ let path = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1238
+ let payload: Payload = {};
1239
+
1240
+ if (typeof message !== 'undefined') {
1241
+ payload['message'] = message;
1242
+ }
1243
+
1244
+ const uri = new URL(this.client.config.endpoint + path);
1245
+ return await this.client.call('patch', uri, {
1246
+ 'content-type': 'application/json',
1247
+ }, payload);
1248
+ }
1249
+
1250
+ /**
1251
+ * Reset custom SMS template
1252
+ *
1253
+ *
1254
+ * @param {string} projectId
1255
+ * @param {string} type
1256
+ * @param {string} locale
1257
+ * @throws {AppwriteException}
1258
+ * @returns {Promise}
1259
+ */
1260
+ async deleteSmsTemplate(projectId: string, type: string, locale: string): Promise<Models.SmsTemplate> {
1261
+ if (typeof projectId === 'undefined') {
1262
+ throw new AppwriteException('Missing required parameter: "projectId"');
1263
+ }
1264
+
1265
+ if (typeof type === 'undefined') {
1266
+ throw new AppwriteException('Missing required parameter: "type"');
1267
+ }
1268
+
1269
+ if (typeof locale === 'undefined') {
1270
+ throw new AppwriteException('Missing required parameter: "locale"');
1271
+ }
1272
+
1273
+ let path = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1274
+ let payload: Payload = {};
1275
+
1276
+ const uri = new URL(this.client.config.endpoint + path);
1277
+ return await this.client.call('delete', uri, {
1278
+ 'content-type': 'application/json',
1279
+ }, payload);
1280
+ }
1281
+
1282
+ /**
1283
+ * Get usage stats for a project
1284
+ *
1285
+ *
1286
+ * @param {string} projectId
1287
+ * @param {string} range
1288
+ * @throws {AppwriteException}
1289
+ * @returns {Promise}
1290
+ */
1291
+ async getUsage(projectId: string, range?: string): Promise<Models.UsageProject> {
1292
+ if (typeof projectId === 'undefined') {
1293
+ throw new AppwriteException('Missing required parameter: "projectId"');
1294
+ }
1295
+
1296
+ let path = '/projects/{projectId}/usage'.replace('{projectId}', projectId);
1297
+ let payload: Payload = {};
1298
+
1299
+ if (typeof range !== 'undefined') {
1300
+ payload['range'] = range;
1301
+ }
1302
+
1303
+ const uri = new URL(this.client.config.endpoint + path);
1304
+ return await this.client.call('get', uri, {
1305
+ 'content-type': 'application/json',
1306
+ }, payload);
1307
+ }
1308
+
1309
+ /**
1310
+ * List Webhooks
1311
+ *
1312
+ *
1313
+ * @param {string} projectId
1314
+ * @throws {AppwriteException}
1315
+ * @returns {Promise}
1316
+ */
1317
+ async listWebhooks(projectId: string): Promise<Models.WebhookList> {
1318
+ if (typeof projectId === 'undefined') {
1319
+ throw new AppwriteException('Missing required parameter: "projectId"');
1320
+ }
1321
+
1322
+ let path = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
1323
+ let payload: Payload = {};
1324
+
1325
+ const uri = new URL(this.client.config.endpoint + path);
1326
+ return await this.client.call('get', uri, {
1327
+ 'content-type': 'application/json',
1328
+ }, payload);
1329
+ }
1330
+
1331
+ /**
1332
+ * Create Webhook
1333
+ *
1334
+ *
1335
+ * @param {string} projectId
1336
+ * @param {string} name
1337
+ * @param {string[]} events
1338
+ * @param {string} url
1339
+ * @param {boolean} security
1340
+ * @param {string} httpUser
1341
+ * @param {string} httpPass
1342
+ * @throws {AppwriteException}
1343
+ * @returns {Promise}
1344
+ */
1345
+ async createWebhook(projectId: string, name: string, events: string[], url: string, security: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook> {
1346
+ if (typeof projectId === 'undefined') {
1347
+ throw new AppwriteException('Missing required parameter: "projectId"');
1348
+ }
1349
+
1350
+ if (typeof name === 'undefined') {
1351
+ throw new AppwriteException('Missing required parameter: "name"');
1352
+ }
1353
+
1354
+ if (typeof events === 'undefined') {
1355
+ throw new AppwriteException('Missing required parameter: "events"');
1356
+ }
1357
+
1358
+ if (typeof url === 'undefined') {
1359
+ throw new AppwriteException('Missing required parameter: "url"');
1360
+ }
1361
+
1362
+ if (typeof security === 'undefined') {
1363
+ throw new AppwriteException('Missing required parameter: "security"');
1364
+ }
1365
+
1366
+ let path = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
1367
+ let payload: Payload = {};
1368
+
1369
+ if (typeof name !== 'undefined') {
1370
+ payload['name'] = name;
1371
+ }
1372
+
1373
+ if (typeof events !== 'undefined') {
1374
+ payload['events'] = events;
1375
+ }
1376
+
1377
+ if (typeof url !== 'undefined') {
1378
+ payload['url'] = url;
1379
+ }
1380
+
1381
+ if (typeof security !== 'undefined') {
1382
+ payload['security'] = security;
1383
+ }
1384
+
1385
+ if (typeof httpUser !== 'undefined') {
1386
+ payload['httpUser'] = httpUser;
1387
+ }
1388
+
1389
+ if (typeof httpPass !== 'undefined') {
1390
+ payload['httpPass'] = httpPass;
1391
+ }
1392
+
1393
+ const uri = new URL(this.client.config.endpoint + path);
1394
+ return await this.client.call('post', uri, {
1395
+ 'content-type': 'application/json',
1396
+ }, payload);
1397
+ }
1398
+
1399
+ /**
1400
+ * Get Webhook
1401
+ *
1402
+ *
1403
+ * @param {string} projectId
1404
+ * @param {string} webhookId
1405
+ * @throws {AppwriteException}
1406
+ * @returns {Promise}
1407
+ */
1408
+ async getWebhook(projectId: string, webhookId: string): Promise<Models.Webhook> {
1409
+ if (typeof projectId === 'undefined') {
1410
+ throw new AppwriteException('Missing required parameter: "projectId"');
1411
+ }
1412
+
1413
+ if (typeof webhookId === 'undefined') {
1414
+ throw new AppwriteException('Missing required parameter: "webhookId"');
1415
+ }
1416
+
1417
+ let path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1418
+ let payload: Payload = {};
1419
+
1420
+ const uri = new URL(this.client.config.endpoint + path);
1421
+ return await this.client.call('get', uri, {
1422
+ 'content-type': 'application/json',
1423
+ }, payload);
1424
+ }
1425
+
1426
+ /**
1427
+ * Update Webhook
1428
+ *
1429
+ *
1430
+ * @param {string} projectId
1431
+ * @param {string} webhookId
1432
+ * @param {string} name
1433
+ * @param {string[]} events
1434
+ * @param {string} url
1435
+ * @param {boolean} security
1436
+ * @param {string} httpUser
1437
+ * @param {string} httpPass
1438
+ * @throws {AppwriteException}
1439
+ * @returns {Promise}
1440
+ */
1441
+ async updateWebhook(projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook> {
1442
+ if (typeof projectId === 'undefined') {
1443
+ throw new AppwriteException('Missing required parameter: "projectId"');
1444
+ }
1445
+
1446
+ if (typeof webhookId === 'undefined') {
1447
+ throw new AppwriteException('Missing required parameter: "webhookId"');
1448
+ }
1449
+
1450
+ if (typeof name === 'undefined') {
1451
+ throw new AppwriteException('Missing required parameter: "name"');
1452
+ }
1453
+
1454
+ if (typeof events === 'undefined') {
1455
+ throw new AppwriteException('Missing required parameter: "events"');
1456
+ }
1457
+
1458
+ if (typeof url === 'undefined') {
1459
+ throw new AppwriteException('Missing required parameter: "url"');
1460
+ }
1461
+
1462
+ if (typeof security === 'undefined') {
1463
+ throw new AppwriteException('Missing required parameter: "security"');
1464
+ }
1465
+
1466
+ let path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1467
+ let payload: Payload = {};
1468
+
1469
+ if (typeof name !== 'undefined') {
1470
+ payload['name'] = name;
1471
+ }
1472
+
1473
+ if (typeof events !== 'undefined') {
1474
+ payload['events'] = events;
1475
+ }
1476
+
1477
+ if (typeof url !== 'undefined') {
1478
+ payload['url'] = url;
1479
+ }
1480
+
1481
+ if (typeof security !== 'undefined') {
1482
+ payload['security'] = security;
1483
+ }
1484
+
1485
+ if (typeof httpUser !== 'undefined') {
1486
+ payload['httpUser'] = httpUser;
1487
+ }
1488
+
1489
+ if (typeof httpPass !== 'undefined') {
1490
+ payload['httpPass'] = httpPass;
1491
+ }
1492
+
1493
+ const uri = new URL(this.client.config.endpoint + path);
1494
+ return await this.client.call('put', uri, {
1495
+ 'content-type': 'application/json',
1496
+ }, payload);
1497
+ }
1498
+
1499
+ /**
1500
+ * Delete Webhook
1501
+ *
1502
+ *
1503
+ * @param {string} projectId
1504
+ * @param {string} webhookId
1505
+ * @throws {AppwriteException}
1506
+ * @returns {Promise}
1507
+ */
1508
+ async deleteWebhook(projectId: string, webhookId: string): Promise<{}> {
1509
+ if (typeof projectId === 'undefined') {
1510
+ throw new AppwriteException('Missing required parameter: "projectId"');
1511
+ }
1512
+
1513
+ if (typeof webhookId === 'undefined') {
1514
+ throw new AppwriteException('Missing required parameter: "webhookId"');
1515
+ }
1516
+
1517
+ let path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1518
+ let payload: Payload = {};
1519
+
1520
+ const uri = new URL(this.client.config.endpoint + path);
1521
+ return await this.client.call('delete', uri, {
1522
+ 'content-type': 'application/json',
1523
+ }, payload);
1524
+ }
1525
+
1526
+ /**
1527
+ * Update Webhook Signature Key
1528
+ *
1529
+ *
1530
+ * @param {string} projectId
1531
+ * @param {string} webhookId
1532
+ * @throws {AppwriteException}
1533
+ * @returns {Promise}
1534
+ */
1535
+ async updateWebhookSignature(projectId: string, webhookId: string): Promise<Models.Webhook> {
1536
+ if (typeof projectId === 'undefined') {
1537
+ throw new AppwriteException('Missing required parameter: "projectId"');
1538
+ }
1539
+
1540
+ if (typeof webhookId === 'undefined') {
1541
+ throw new AppwriteException('Missing required parameter: "webhookId"');
1542
+ }
1543
+
1544
+ let path = '/projects/{projectId}/webhooks/{webhookId}/signature'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1545
+ let payload: Payload = {};
1546
+
1547
+ const uri = new URL(this.client.config.endpoint + path);
1548
+ return await this.client.call('patch', uri, {
1549
+ 'content-type': 'application/json',
1550
+ }, payload);
1551
+ }
1270
1552
  };