@appwrite.io/console 0.2.0 → 0.4.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 (322) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/sdk.js +3353 -1497
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +3350 -1498
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +3353 -1497
  7. package/docs/examples/account/create-anonymous-session.md +1 -1
  8. package/docs/examples/account/create-email-session.md +1 -1
  9. package/docs/examples/account/create-j-w-t.md +1 -1
  10. package/docs/examples/account/create-magic-u-r-l-session.md +1 -1
  11. package/docs/examples/account/create-o-auth2session.md +1 -1
  12. package/docs/examples/account/create-phone-session.md +1 -1
  13. package/docs/examples/account/create-phone-verification.md +1 -1
  14. package/docs/examples/account/create-recovery.md +1 -1
  15. package/docs/examples/account/create-verification.md +1 -1
  16. package/docs/examples/account/create.md +1 -1
  17. package/docs/examples/account/{create-with-invite-code.md → delete-identity.md} +2 -2
  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 +2 -2
  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 +1 -1
  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-builds.md +18 -0
  125. package/docs/examples/health/get-queue-certificates.md +1 -1
  126. package/docs/examples/health/get-queue-databases.md +18 -0
  127. package/docs/examples/health/get-queue-deletes.md +18 -0
  128. package/docs/examples/health/get-queue-functions.md +1 -1
  129. package/docs/examples/health/get-queue-logs.md +1 -1
  130. package/docs/examples/health/get-queue-mails.md +18 -0
  131. package/docs/examples/health/get-queue-messaging.md +18 -0
  132. package/docs/examples/health/get-queue-migrations.md +18 -0
  133. package/docs/examples/health/get-queue-webhooks.md +1 -1
  134. package/docs/examples/health/get-queue.md +1 -1
  135. package/docs/examples/health/get-storage-local.md +1 -1
  136. package/docs/examples/health/get-time.md +1 -1
  137. package/docs/examples/health/get.md +1 -1
  138. package/docs/examples/locale/get.md +1 -1
  139. package/docs/examples/locale/list-codes.md +18 -0
  140. package/docs/examples/locale/list-continents.md +1 -1
  141. package/docs/examples/locale/list-countries-e-u.md +1 -1
  142. package/docs/examples/locale/list-countries-phones.md +1 -1
  143. package/docs/examples/locale/list-countries.md +1 -1
  144. package/docs/examples/locale/list-currencies.md +1 -1
  145. package/docs/examples/locale/list-languages.md +1 -1
  146. package/docs/examples/migrations/create-appwrite-migration.md +18 -0
  147. package/docs/examples/migrations/create-firebase-migration.md +18 -0
  148. package/docs/examples/migrations/create-firebase-o-auth-migration.md +18 -0
  149. package/docs/examples/migrations/create-n-host-migration.md +18 -0
  150. package/docs/examples/migrations/create-supabase-migration.md +18 -0
  151. package/docs/examples/migrations/delete-firebase-auth.md +18 -0
  152. package/docs/examples/migrations/delete.md +18 -0
  153. package/docs/examples/migrations/get-appwrite-report.md +18 -0
  154. package/docs/examples/migrations/get-firebase-report-o-auth.md +18 -0
  155. package/docs/examples/migrations/get-firebase-report.md +18 -0
  156. package/docs/examples/migrations/get-n-host-report.md +18 -0
  157. package/docs/examples/migrations/get-supabase-report.md +18 -0
  158. package/docs/examples/migrations/get.md +18 -0
  159. package/docs/examples/migrations/list-firebase-projects.md +18 -0
  160. package/docs/examples/migrations/list.md +18 -0
  161. package/docs/examples/migrations/retry.md +18 -0
  162. package/docs/examples/project/create-variable.md +18 -0
  163. package/docs/examples/project/delete-variable.md +18 -0
  164. package/docs/examples/project/get-usage.md +2 -2
  165. package/docs/examples/project/get-variable.md +18 -0
  166. package/docs/examples/project/list-variables.md +18 -0
  167. package/docs/examples/project/update-variable.md +18 -0
  168. package/docs/examples/projects/create-key.md +1 -1
  169. package/docs/examples/projects/create-platform.md +1 -1
  170. package/docs/examples/projects/create-webhook.md +1 -1
  171. package/docs/examples/projects/create.md +2 -2
  172. package/docs/examples/projects/delete-email-template.md +18 -0
  173. package/docs/examples/projects/delete-key.md +1 -1
  174. package/docs/examples/projects/delete-platform.md +1 -1
  175. package/docs/examples/projects/delete-sms-template.md +18 -0
  176. package/docs/examples/projects/delete-webhook.md +1 -1
  177. package/docs/examples/projects/delete.md +2 -2
  178. package/docs/examples/projects/get-email-template.md +18 -0
  179. package/docs/examples/projects/get-key.md +1 -1
  180. package/docs/examples/projects/get-platform.md +1 -1
  181. package/docs/examples/projects/get-sms-template.md +18 -0
  182. package/docs/examples/projects/get-webhook.md +1 -1
  183. package/docs/examples/projects/get.md +1 -1
  184. package/docs/examples/projects/list-keys.md +1 -1
  185. package/docs/examples/projects/list-platforms.md +1 -1
  186. package/docs/examples/projects/list-webhooks.md +1 -1
  187. package/docs/examples/projects/list.md +1 -1
  188. package/docs/examples/projects/update-auth-duration.md +1 -1
  189. package/docs/examples/projects/update-auth-limit.md +1 -1
  190. package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
  191. package/docs/examples/projects/update-auth-password-history.md +1 -1
  192. package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
  193. package/docs/examples/projects/update-auth-status.md +1 -1
  194. package/docs/examples/projects/update-email-template.md +18 -0
  195. package/docs/examples/projects/update-key.md +1 -1
  196. package/docs/examples/projects/update-o-auth2.md +1 -1
  197. package/docs/examples/projects/{delete-domain.md → update-personal-data-check.md} +2 -2
  198. package/docs/examples/projects/update-platform.md +1 -1
  199. package/docs/examples/projects/{create-domain.md → update-service-status-all.md} +2 -2
  200. package/docs/examples/projects/update-service-status.md +1 -1
  201. package/docs/examples/projects/update-sms-template.md +18 -0
  202. package/docs/examples/projects/{get-domain.md → update-smtp-configuration.md} +2 -2
  203. package/docs/examples/projects/{list-domains.md → update-team.md} +2 -2
  204. package/docs/examples/projects/update-webhook-signature.md +1 -1
  205. package/docs/examples/projects/update-webhook.md +1 -1
  206. package/docs/examples/projects/update.md +1 -1
  207. package/docs/examples/proxy/create-rule.md +18 -0
  208. package/docs/examples/proxy/delete-rule.md +18 -0
  209. package/docs/examples/proxy/get-rule.md +18 -0
  210. package/docs/examples/proxy/list-rules.md +18 -0
  211. package/docs/examples/proxy/update-rule-verification.md +18 -0
  212. package/docs/examples/storage/create-bucket.md +1 -1
  213. package/docs/examples/storage/create-file.md +1 -1
  214. package/docs/examples/storage/delete-bucket.md +1 -1
  215. package/docs/examples/storage/delete-file.md +1 -1
  216. package/docs/examples/storage/get-bucket-usage.md +1 -1
  217. package/docs/examples/storage/get-bucket.md +1 -1
  218. package/docs/examples/storage/get-file-download.md +1 -1
  219. package/docs/examples/storage/get-file-preview.md +1 -1
  220. package/docs/examples/storage/get-file-view.md +1 -1
  221. package/docs/examples/storage/get-file.md +1 -1
  222. package/docs/examples/storage/get-usage.md +1 -1
  223. package/docs/examples/storage/list-buckets.md +1 -1
  224. package/docs/examples/storage/list-files.md +1 -1
  225. package/docs/examples/storage/update-bucket.md +1 -1
  226. package/docs/examples/storage/update-file.md +1 -1
  227. package/docs/examples/teams/create-membership.md +2 -2
  228. package/docs/examples/teams/create.md +1 -1
  229. package/docs/examples/teams/delete-membership.md +1 -1
  230. package/docs/examples/teams/delete.md +1 -1
  231. package/docs/examples/teams/get-membership.md +1 -1
  232. package/docs/examples/teams/get-prefs.md +1 -1
  233. package/docs/examples/teams/get.md +1 -1
  234. package/docs/examples/teams/list-logs.md +1 -1
  235. package/docs/examples/teams/list-memberships.md +1 -1
  236. package/docs/examples/teams/list.md +1 -1
  237. package/docs/examples/teams/update-membership-status.md +1 -1
  238. package/docs/examples/teams/{update-membership-roles.md → update-membership.md} +2 -2
  239. package/docs/examples/teams/update-name.md +1 -1
  240. package/docs/examples/teams/update-prefs.md +1 -1
  241. package/docs/examples/users/create-argon2user.md +1 -1
  242. package/docs/examples/users/create-bcrypt-user.md +1 -1
  243. package/docs/examples/users/create-m-d5user.md +1 -1
  244. package/docs/examples/users/create-p-h-pass-user.md +1 -1
  245. package/docs/examples/users/create-s-h-a-user.md +1 -1
  246. package/docs/examples/users/create-scrypt-modified-user.md +1 -1
  247. package/docs/examples/users/create-scrypt-user.md +1 -1
  248. package/docs/examples/users/create.md +1 -1
  249. package/docs/examples/users/delete-identity.md +18 -0
  250. package/docs/examples/users/delete-session.md +1 -1
  251. package/docs/examples/users/delete-sessions.md +1 -1
  252. package/docs/examples/users/delete.md +1 -1
  253. package/docs/examples/users/get-prefs.md +1 -1
  254. package/docs/examples/users/get-usage.md +1 -1
  255. package/docs/examples/users/get.md +1 -1
  256. package/docs/examples/users/list-identities.md +18 -0
  257. package/docs/examples/users/list-logs.md +1 -1
  258. package/docs/examples/users/list-memberships.md +1 -1
  259. package/docs/examples/users/list-sessions.md +1 -1
  260. package/docs/examples/users/list.md +1 -1
  261. package/docs/examples/users/update-email-verification.md +1 -1
  262. package/docs/examples/users/update-email.md +1 -1
  263. package/docs/examples/users/update-labels.md +18 -0
  264. package/docs/examples/users/update-name.md +1 -1
  265. package/docs/examples/users/update-password.md +1 -1
  266. package/docs/examples/users/update-phone-verification.md +1 -1
  267. package/docs/examples/users/update-phone.md +1 -1
  268. package/docs/examples/users/update-prefs.md +1 -1
  269. package/docs/examples/users/update-status.md +1 -1
  270. package/docs/examples/vcs/create-repository-detection.md +18 -0
  271. package/docs/examples/vcs/create-repository.md +18 -0
  272. package/docs/examples/vcs/delete-installation.md +18 -0
  273. package/docs/examples/vcs/get-installation.md +18 -0
  274. package/docs/examples/vcs/get-repository.md +18 -0
  275. package/docs/examples/vcs/list-installations.md +18 -0
  276. package/docs/examples/vcs/list-repositories.md +18 -0
  277. package/docs/examples/vcs/list-repository-branches.md +18 -0
  278. package/docs/examples/vcs/update-external-deployments.md +18 -0
  279. package/package.json +3 -2
  280. package/src/client.ts +2 -2
  281. package/src/index.ts +4 -0
  282. package/src/models.ts +863 -233
  283. package/src/query.ts +1 -1
  284. package/src/role.ts +72 -6
  285. package/src/services/account.ts +1052 -1055
  286. package/src/services/assistant.ts +38 -0
  287. package/src/services/avatars.ts +338 -337
  288. package/src/services/console.ts +16 -16
  289. package/src/services/databases.ts +2170 -2140
  290. package/src/services/functions.ts +804 -657
  291. package/src/services/graphql.ts +47 -47
  292. package/src/services/health.ts +373 -204
  293. package/src/services/locale.ts +156 -137
  294. package/src/services/migrations.ts +707 -0
  295. package/src/services/project.ts +178 -20
  296. package/src/services/projects.ts +1511 -1256
  297. package/src/services/proxy.ts +150 -0
  298. package/src/services/storage.ts +572 -577
  299. package/src/services/teams.ts +498 -501
  300. package/src/services/users.ts +1091 -1001
  301. package/src/services/vcs.ts +272 -0
  302. package/types/index.d.ts +4 -0
  303. package/types/models.d.ts +863 -233
  304. package/types/role.d.ts +62 -0
  305. package/types/services/account.d.ts +116 -104
  306. package/types/services/assistant.d.ts +14 -0
  307. package/types/services/avatars.d.ts +18 -17
  308. package/types/services/console.d.ts +2 -2
  309. package/types/services/databases.d.ts +111 -105
  310. package/types/services/functions.d.ts +95 -55
  311. package/types/services/graphql.d.ts +4 -4
  312. package/types/services/health.d.ts +97 -26
  313. package/types/services/locale.d.ts +24 -14
  314. package/types/services/migrations.d.ts +185 -0
  315. package/types/services/project.d.ts +60 -3
  316. package/types/services/projects.d.ts +174 -104
  317. package/types/services/proxy.d.ts +59 -0
  318. package/types/services/storage.d.ts +29 -28
  319. package/types/services/teams.d.ts +36 -35
  320. package/types/services/users.d.ts +105 -66
  321. package/types/services/vcs.d.ts +97 -0
  322. package/docs/examples/projects/update-domain-verification.md +0 -18
@@ -10,342 +10,343 @@ export class Avatars extends Service {
10
10
  super(client);
11
11
  }
12
12
 
13
- /**
14
- * Get Browser Icon
15
- *
16
- * You can use this endpoint to show different browser icons to your users.
17
- * The code argument receives the browser code as it appears in your user [GET
18
- * /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use
19
- * width, height and quality arguments to change the output settings.
20
- *
21
- * When one dimension is specified and the other is 0, the image is scaled
22
- * with preserved aspect ratio. If both dimensions are 0, the API provides an
23
- * image at source quality. If dimensions are not specified, the default size
24
- * of image returned is 100x100px.
25
- *
26
- * @param {string} code
27
- * @param {number} width
28
- * @param {number} height
29
- * @param {number} quality
30
- * @throws {AppwriteException}
31
- * @returns {URL}
32
- */
33
- getBrowser(code: string, width?: number, height?: number, quality?: number): URL {
34
- if (typeof code === 'undefined') {
35
- throw new AppwriteException('Missing required parameter: "code"');
36
- }
37
-
38
- let path = '/avatars/browsers/{code}'.replace('{code}', code);
39
- let payload: Payload = {};
40
-
41
- if (typeof width !== 'undefined') {
42
- payload['width'] = width;
43
- }
44
-
45
- if (typeof height !== 'undefined') {
46
- payload['height'] = height;
47
- }
48
-
49
- if (typeof quality !== 'undefined') {
50
- payload['quality'] = quality;
51
- }
52
-
53
- const uri = new URL(this.client.config.endpoint + path);
54
- payload['project'] = this.client.config.project;
55
-
56
-
57
- for (const [key, value] of Object.entries(Service.flatten(payload))) {
58
- uri.searchParams.append(key, value);
59
- }
60
- return uri;
61
- }
62
-
63
- /**
64
- * Get Credit Card Icon
65
- *
66
- * The credit card endpoint will return you the icon of the credit card
67
- * provider you need. Use width, height and quality arguments to change the
68
- * output settings.
69
- *
70
- * When one dimension is specified and the other is 0, the image is scaled
71
- * with preserved aspect ratio. If both dimensions are 0, the API provides an
72
- * image at source quality. If dimensions are not specified, the default size
73
- * of image returned is 100x100px.
74
- *
75
- *
76
- * @param {string} code
77
- * @param {number} width
78
- * @param {number} height
79
- * @param {number} quality
80
- * @throws {AppwriteException}
81
- * @returns {URL}
82
- */
83
- getCreditCard(code: string, width?: number, height?: number, quality?: number): URL {
84
- if (typeof code === 'undefined') {
85
- throw new AppwriteException('Missing required parameter: "code"');
86
- }
87
-
88
- let path = '/avatars/credit-cards/{code}'.replace('{code}', code);
89
- let payload: Payload = {};
90
-
91
- if (typeof width !== 'undefined') {
92
- payload['width'] = width;
93
- }
94
-
95
- if (typeof height !== 'undefined') {
96
- payload['height'] = height;
97
- }
98
-
99
- if (typeof quality !== 'undefined') {
100
- payload['quality'] = quality;
101
- }
102
-
103
- const uri = new URL(this.client.config.endpoint + path);
104
- payload['project'] = this.client.config.project;
105
-
106
-
107
- for (const [key, value] of Object.entries(Service.flatten(payload))) {
108
- uri.searchParams.append(key, value);
109
- }
110
- return uri;
111
- }
112
-
113
- /**
114
- * Get Favicon
115
- *
116
- * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
117
- * website URL.
118
- *
119
- *
120
- * @param {string} url
121
- * @throws {AppwriteException}
122
- * @returns {URL}
123
- */
124
- getFavicon(url: string): URL {
125
- if (typeof url === 'undefined') {
126
- throw new AppwriteException('Missing required parameter: "url"');
127
- }
128
-
129
- let path = '/avatars/favicon';
130
- let payload: Payload = {};
131
-
132
- if (typeof url !== 'undefined') {
133
- payload['url'] = url;
134
- }
135
-
136
- const uri = new URL(this.client.config.endpoint + path);
137
- payload['project'] = this.client.config.project;
138
-
139
-
140
- for (const [key, value] of Object.entries(Service.flatten(payload))) {
141
- uri.searchParams.append(key, value);
142
- }
143
- return uri;
144
- }
145
-
146
- /**
147
- * Get Country Flag
148
- *
149
- * You can use this endpoint to show different country flags icons to your
150
- * users. The code argument receives the 2 letter country code. Use width,
151
- * height and quality arguments to change the output settings. Country codes
152
- * follow the [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) standard.
153
- *
154
- * When one dimension is specified and the other is 0, the image is scaled
155
- * with preserved aspect ratio. If both dimensions are 0, the API provides an
156
- * image at source quality. If dimensions are not specified, the default size
157
- * of image returned is 100x100px.
158
- *
159
- *
160
- * @param {string} code
161
- * @param {number} width
162
- * @param {number} height
163
- * @param {number} quality
164
- * @throws {AppwriteException}
165
- * @returns {URL}
166
- */
167
- getFlag(code: string, width?: number, height?: number, quality?: number): URL {
168
- if (typeof code === 'undefined') {
169
- throw new AppwriteException('Missing required parameter: "code"');
170
- }
171
-
172
- let path = '/avatars/flags/{code}'.replace('{code}', code);
173
- let payload: Payload = {};
174
-
175
- if (typeof width !== 'undefined') {
176
- payload['width'] = width;
177
- }
178
-
179
- if (typeof height !== 'undefined') {
180
- payload['height'] = height;
181
- }
182
-
183
- if (typeof quality !== 'undefined') {
184
- payload['quality'] = quality;
185
- }
186
-
187
- const uri = new URL(this.client.config.endpoint + path);
188
- payload['project'] = this.client.config.project;
189
-
190
-
191
- for (const [key, value] of Object.entries(Service.flatten(payload))) {
192
- uri.searchParams.append(key, value);
193
- }
194
- return uri;
195
- }
196
-
197
- /**
198
- * Get Image from URL
199
- *
200
- * Use this endpoint to fetch a remote image URL and crop it to any image size
201
- * you want. This endpoint is very useful if you need to crop and display
202
- * remote images in your app or in case you want to make sure a 3rd party
203
- * image is properly served using a TLS protocol.
204
- *
205
- * When one dimension is specified and the other is 0, the image is scaled
206
- * with preserved aspect ratio. If both dimensions are 0, the API provides an
207
- * image at source quality. If dimensions are not specified, the default size
208
- * of image returned is 400x400px.
209
- *
210
- *
211
- * @param {string} url
212
- * @param {number} width
213
- * @param {number} height
214
- * @throws {AppwriteException}
215
- * @returns {URL}
216
- */
217
- getImage(url: string, width?: number, height?: number): URL {
218
- if (typeof url === 'undefined') {
219
- throw new AppwriteException('Missing required parameter: "url"');
220
- }
221
-
222
- let path = '/avatars/image';
223
- let payload: Payload = {};
224
-
225
- if (typeof url !== 'undefined') {
226
- payload['url'] = url;
227
- }
228
-
229
- if (typeof width !== 'undefined') {
230
- payload['width'] = width;
231
- }
232
-
233
- if (typeof height !== 'undefined') {
234
- payload['height'] = height;
235
- }
236
-
237
- const uri = new URL(this.client.config.endpoint + path);
238
- payload['project'] = this.client.config.project;
239
-
240
-
241
- for (const [key, value] of Object.entries(Service.flatten(payload))) {
242
- uri.searchParams.append(key, value);
243
- }
244
- return uri;
245
- }
246
-
247
- /**
248
- * Get User Initials
249
- *
250
- * Use this endpoint to show your user initials avatar icon on your website or
251
- * app. By default, this route will try to print your logged-in user name or
252
- * email initials. You can also overwrite the user name if you pass the 'name'
253
- * parameter. If no name is given and no user is logged, an empty avatar will
254
- * be returned.
255
- *
256
- * You can use the color and background params to change the avatar colors. By
257
- * default, a random theme will be selected. The random theme will persist for
258
- * the user's initials when reloading the same theme will always return for
259
- * the same initials.
260
- *
261
- * When one dimension is specified and the other is 0, the image is scaled
262
- * with preserved aspect ratio. If both dimensions are 0, the API provides an
263
- * image at source quality. If dimensions are not specified, the default size
264
- * of image returned is 100x100px.
265
- *
266
- *
267
- * @param {string} name
268
- * @param {number} width
269
- * @param {number} height
270
- * @param {string} background
271
- * @throws {AppwriteException}
272
- * @returns {URL}
273
- */
274
- getInitials(name?: string, width?: number, height?: number, background?: string): URL {
275
- let path = '/avatars/initials';
276
- let payload: Payload = {};
277
-
278
- if (typeof name !== 'undefined') {
279
- payload['name'] = name;
280
- }
281
-
282
- if (typeof width !== 'undefined') {
283
- payload['width'] = width;
284
- }
285
-
286
- if (typeof height !== 'undefined') {
287
- payload['height'] = height;
288
- }
289
-
290
- if (typeof background !== 'undefined') {
291
- payload['background'] = background;
292
- }
293
-
294
- const uri = new URL(this.client.config.endpoint + path);
295
- payload['project'] = this.client.config.project;
296
-
297
-
298
- for (const [key, value] of Object.entries(Service.flatten(payload))) {
299
- uri.searchParams.append(key, value);
300
- }
301
- return uri;
302
- }
303
-
304
- /**
305
- * Get QR Code
306
- *
307
- * Converts a given plain text to a QR code image. You can use the query
308
- * parameters to change the size and style of the resulting image.
309
- *
310
- *
311
- * @param {string} text
312
- * @param {number} size
313
- * @param {number} margin
314
- * @param {boolean} download
315
- * @throws {AppwriteException}
316
- * @returns {URL}
317
- */
318
- getQR(text: string, size?: number, margin?: number, download?: boolean): URL {
319
- if (typeof text === 'undefined') {
320
- throw new AppwriteException('Missing required parameter: "text"');
321
- }
322
-
323
- let path = '/avatars/qr';
324
- let payload: Payload = {};
325
-
326
- if (typeof text !== 'undefined') {
327
- payload['text'] = text;
328
- }
329
-
330
- if (typeof size !== 'undefined') {
331
- payload['size'] = size;
332
- }
333
-
334
- if (typeof margin !== 'undefined') {
335
- payload['margin'] = margin;
336
- }
337
-
338
- if (typeof download !== 'undefined') {
339
- payload['download'] = download;
340
- }
341
-
342
- const uri = new URL(this.client.config.endpoint + path);
343
- payload['project'] = this.client.config.project;
344
-
345
-
346
- for (const [key, value] of Object.entries(Service.flatten(payload))) {
347
- uri.searchParams.append(key, value);
348
- }
349
- return uri;
13
+ /**
14
+ * Get browser icon
15
+ *
16
+ * You can use this endpoint to show different browser icons to your users.
17
+ * The code argument receives the browser code as it appears in your user [GET
18
+ * /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions)
19
+ * endpoint. Use width, height and quality arguments to change the output
20
+ * settings.
21
+ *
22
+ * When one dimension is specified and the other is 0, the image is scaled
23
+ * with preserved aspect ratio. If both dimensions are 0, the API provides an
24
+ * image at source quality. If dimensions are not specified, the default size
25
+ * of image returned is 100x100px.
26
+ *
27
+ * @param {string} code
28
+ * @param {number} width
29
+ * @param {number} height
30
+ * @param {number} quality
31
+ * @throws {AppwriteException}
32
+ * @returns {URL}
33
+ */
34
+ getBrowser(code: string, width?: number, height?: number, quality?: number): URL {
35
+ if (typeof code === 'undefined') {
36
+ throw new AppwriteException('Missing required parameter: "code"');
350
37
  }
38
+
39
+ const apiPath = '/avatars/browsers/{code}'.replace('{code}', code);
40
+ const payload: Payload = {};
41
+
42
+ if (typeof width !== 'undefined') {
43
+ payload['width'] = width;
44
+ }
45
+
46
+ if (typeof height !== 'undefined') {
47
+ payload['height'] = height;
48
+ }
49
+
50
+ if (typeof quality !== 'undefined') {
51
+ payload['quality'] = quality;
52
+ }
53
+
54
+ const uri = new URL(this.client.config.endpoint + apiPath);
55
+ payload['project'] = this.client.config.project;
56
+
57
+
58
+ for (const [key, value] of Object.entries(Service.flatten(payload))) {
59
+ uri.searchParams.append(key, value);
60
+ }
61
+ return uri;
62
+ }
63
+
64
+ /**
65
+ * Get credit card icon
66
+ *
67
+ * The credit card endpoint will return you the icon of the credit card
68
+ * provider you need. Use width, height and quality arguments to change the
69
+ * output settings.
70
+ *
71
+ * When one dimension is specified and the other is 0, the image is scaled
72
+ * with preserved aspect ratio. If both dimensions are 0, the API provides an
73
+ * image at source quality. If dimensions are not specified, the default size
74
+ * of image returned is 100x100px.
75
+ *
76
+ *
77
+ * @param {string} code
78
+ * @param {number} width
79
+ * @param {number} height
80
+ * @param {number} quality
81
+ * @throws {AppwriteException}
82
+ * @returns {URL}
83
+ */
84
+ getCreditCard(code: string, width?: number, height?: number, quality?: number): URL {
85
+ if (typeof code === 'undefined') {
86
+ throw new AppwriteException('Missing required parameter: "code"');
87
+ }
88
+
89
+ const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code);
90
+ const payload: Payload = {};
91
+
92
+ if (typeof width !== 'undefined') {
93
+ payload['width'] = width;
94
+ }
95
+
96
+ if (typeof height !== 'undefined') {
97
+ payload['height'] = height;
98
+ }
99
+
100
+ if (typeof quality !== 'undefined') {
101
+ payload['quality'] = quality;
102
+ }
103
+
104
+ const uri = new URL(this.client.config.endpoint + apiPath);
105
+ payload['project'] = this.client.config.project;
106
+
107
+
108
+ for (const [key, value] of Object.entries(Service.flatten(payload))) {
109
+ uri.searchParams.append(key, value);
110
+ }
111
+ return uri;
112
+ }
113
+
114
+ /**
115
+ * Get favicon
116
+ *
117
+ * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
118
+ * website URL.
119
+ *
120
+ *
121
+ * @param {string} url
122
+ * @throws {AppwriteException}
123
+ * @returns {URL}
124
+ */
125
+ getFavicon(url: string): URL {
126
+ if (typeof url === 'undefined') {
127
+ throw new AppwriteException('Missing required parameter: "url"');
128
+ }
129
+
130
+ const apiPath = '/avatars/favicon';
131
+ const payload: Payload = {};
132
+
133
+ if (typeof url !== 'undefined') {
134
+ payload['url'] = url;
135
+ }
136
+
137
+ const uri = new URL(this.client.config.endpoint + apiPath);
138
+ payload['project'] = this.client.config.project;
139
+
140
+
141
+ for (const [key, value] of Object.entries(Service.flatten(payload))) {
142
+ uri.searchParams.append(key, value);
143
+ }
144
+ return uri;
145
+ }
146
+
147
+ /**
148
+ * Get country flag
149
+ *
150
+ * You can use this endpoint to show different country flags icons to your
151
+ * users. The code argument receives the 2 letter country code. Use width,
152
+ * height and quality arguments to change the output settings. Country codes
153
+ * follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
154
+ *
155
+ * When one dimension is specified and the other is 0, the image is scaled
156
+ * with preserved aspect ratio. If both dimensions are 0, the API provides an
157
+ * image at source quality. If dimensions are not specified, the default size
158
+ * of image returned is 100x100px.
159
+ *
160
+ *
161
+ * @param {string} code
162
+ * @param {number} width
163
+ * @param {number} height
164
+ * @param {number} quality
165
+ * @throws {AppwriteException}
166
+ * @returns {URL}
167
+ */
168
+ getFlag(code: string, width?: number, height?: number, quality?: number): URL {
169
+ if (typeof code === 'undefined') {
170
+ throw new AppwriteException('Missing required parameter: "code"');
171
+ }
172
+
173
+ const apiPath = '/avatars/flags/{code}'.replace('{code}', code);
174
+ const payload: Payload = {};
175
+
176
+ if (typeof width !== 'undefined') {
177
+ payload['width'] = width;
178
+ }
179
+
180
+ if (typeof height !== 'undefined') {
181
+ payload['height'] = height;
182
+ }
183
+
184
+ if (typeof quality !== 'undefined') {
185
+ payload['quality'] = quality;
186
+ }
187
+
188
+ const uri = new URL(this.client.config.endpoint + apiPath);
189
+ payload['project'] = this.client.config.project;
190
+
191
+
192
+ for (const [key, value] of Object.entries(Service.flatten(payload))) {
193
+ uri.searchParams.append(key, value);
194
+ }
195
+ return uri;
196
+ }
197
+
198
+ /**
199
+ * Get image from URL
200
+ *
201
+ * Use this endpoint to fetch a remote image URL and crop it to any image size
202
+ * you want. This endpoint is very useful if you need to crop and display
203
+ * remote images in your app or in case you want to make sure a 3rd party
204
+ * image is properly served using a TLS protocol.
205
+ *
206
+ * When one dimension is specified and the other is 0, the image is scaled
207
+ * with preserved aspect ratio. If both dimensions are 0, the API provides an
208
+ * image at source quality. If dimensions are not specified, the default size
209
+ * of image returned is 400x400px.
210
+ *
211
+ *
212
+ * @param {string} url
213
+ * @param {number} width
214
+ * @param {number} height
215
+ * @throws {AppwriteException}
216
+ * @returns {URL}
217
+ */
218
+ getImage(url: string, width?: number, height?: number): URL {
219
+ if (typeof url === 'undefined') {
220
+ throw new AppwriteException('Missing required parameter: "url"');
221
+ }
222
+
223
+ const apiPath = '/avatars/image';
224
+ const payload: Payload = {};
225
+
226
+ if (typeof url !== 'undefined') {
227
+ payload['url'] = url;
228
+ }
229
+
230
+ if (typeof width !== 'undefined') {
231
+ payload['width'] = width;
232
+ }
233
+
234
+ if (typeof height !== 'undefined') {
235
+ payload['height'] = height;
236
+ }
237
+
238
+ const uri = new URL(this.client.config.endpoint + apiPath);
239
+ payload['project'] = this.client.config.project;
240
+
241
+
242
+ for (const [key, value] of Object.entries(Service.flatten(payload))) {
243
+ uri.searchParams.append(key, value);
244
+ }
245
+ return uri;
246
+ }
247
+
248
+ /**
249
+ * Get user initials
250
+ *
251
+ * Use this endpoint to show your user initials avatar icon on your website or
252
+ * app. By default, this route will try to print your logged-in user name or
253
+ * email initials. You can also overwrite the user name if you pass the 'name'
254
+ * parameter. If no name is given and no user is logged, an empty avatar will
255
+ * be returned.
256
+ *
257
+ * You can use the color and background params to change the avatar colors. By
258
+ * default, a random theme will be selected. The random theme will persist for
259
+ * the user's initials when reloading the same theme will always return for
260
+ * the same initials.
261
+ *
262
+ * When one dimension is specified and the other is 0, the image is scaled
263
+ * with preserved aspect ratio. If both dimensions are 0, the API provides an
264
+ * image at source quality. If dimensions are not specified, the default size
265
+ * of image returned is 100x100px.
266
+ *
267
+ *
268
+ * @param {string} name
269
+ * @param {number} width
270
+ * @param {number} height
271
+ * @param {string} background
272
+ * @throws {AppwriteException}
273
+ * @returns {URL}
274
+ */
275
+ getInitials(name?: string, width?: number, height?: number, background?: string): URL {
276
+ const apiPath = '/avatars/initials';
277
+ const payload: Payload = {};
278
+
279
+ if (typeof name !== 'undefined') {
280
+ payload['name'] = name;
281
+ }
282
+
283
+ if (typeof width !== 'undefined') {
284
+ payload['width'] = width;
285
+ }
286
+
287
+ if (typeof height !== 'undefined') {
288
+ payload['height'] = height;
289
+ }
290
+
291
+ if (typeof background !== 'undefined') {
292
+ payload['background'] = background;
293
+ }
294
+
295
+ const uri = new URL(this.client.config.endpoint + apiPath);
296
+ payload['project'] = this.client.config.project;
297
+
298
+
299
+ for (const [key, value] of Object.entries(Service.flatten(payload))) {
300
+ uri.searchParams.append(key, value);
301
+ }
302
+ return uri;
303
+ }
304
+
305
+ /**
306
+ * Get QR code
307
+ *
308
+ * Converts a given plain text to a QR code image. You can use the query
309
+ * parameters to change the size and style of the resulting image.
310
+ *
311
+ *
312
+ * @param {string} text
313
+ * @param {number} size
314
+ * @param {number} margin
315
+ * @param {boolean} download
316
+ * @throws {AppwriteException}
317
+ * @returns {URL}
318
+ */
319
+ getQR(text: string, size?: number, margin?: number, download?: boolean): URL {
320
+ if (typeof text === 'undefined') {
321
+ throw new AppwriteException('Missing required parameter: "text"');
322
+ }
323
+
324
+ const apiPath = '/avatars/qr';
325
+ const payload: Payload = {};
326
+
327
+ if (typeof text !== 'undefined') {
328
+ payload['text'] = text;
329
+ }
330
+
331
+ if (typeof size !== 'undefined') {
332
+ payload['size'] = size;
333
+ }
334
+
335
+ if (typeof margin !== 'undefined') {
336
+ payload['margin'] = margin;
337
+ }
338
+
339
+ if (typeof download !== 'undefined') {
340
+ payload['download'] = download;
341
+ }
342
+
343
+ const uri = new URL(this.client.config.endpoint + apiPath);
344
+ payload['project'] = this.client.config.project;
345
+
346
+
347
+ for (const [key, value] of Object.entries(Service.flatten(payload))) {
348
+ uri.searchParams.append(key, value);
349
+ }
350
+ return uri;
351
+ }
351
352
  };