node-appwrite 17.2.0 → 19.0.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 (126) hide show
  1. package/README.md +67 -2
  2. package/dist/client.js +3 -3
  3. package/dist/client.js.map +1 -1
  4. package/dist/client.mjs +3 -3
  5. package/dist/client.mjs.map +1 -1
  6. package/dist/enums/credit-card.d.mts +1 -1
  7. package/dist/enums/credit-card.d.ts +1 -1
  8. package/dist/enums/credit-card.js +1 -1
  9. package/dist/enums/credit-card.js.map +1 -1
  10. package/dist/enums/credit-card.mjs +1 -1
  11. package/dist/enums/credit-card.mjs.map +1 -1
  12. package/dist/enums/execution-method.d.mts +2 -1
  13. package/dist/enums/execution-method.d.ts +2 -1
  14. package/dist/enums/execution-method.js +1 -0
  15. package/dist/enums/execution-method.js.map +1 -1
  16. package/dist/enums/execution-method.mjs +1 -0
  17. package/dist/enums/execution-method.mjs.map +1 -1
  18. package/dist/enums/index-type.d.mts +2 -1
  19. package/dist/enums/index-type.d.ts +2 -1
  20. package/dist/enums/index-type.js +1 -0
  21. package/dist/enums/index-type.js.map +1 -1
  22. package/dist/enums/index-type.mjs +1 -0
  23. package/dist/enums/index-type.mjs.map +1 -1
  24. package/dist/enums/{v-c-s-deployment-type.js → vcs-deployment-type.js} +1 -1
  25. package/dist/enums/vcs-deployment-type.js.map +1 -0
  26. package/dist/enums/{v-c-s-deployment-type.mjs → vcs-deployment-type.mjs} +2 -2
  27. package/dist/enums/vcs-deployment-type.mjs.map +1 -0
  28. package/dist/index.d.mts +2 -1
  29. package/dist/index.d.ts +2 -1
  30. package/dist/index.js +7 -2
  31. package/dist/index.js.map +1 -1
  32. package/dist/index.mjs +2 -1
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/models.d.mts +1058 -153
  35. package/dist/models.d.ts +1058 -153
  36. package/dist/query.d.mts +196 -6
  37. package/dist/query.d.ts +196 -6
  38. package/dist/query.js +192 -2
  39. package/dist/query.js.map +1 -1
  40. package/dist/query.mjs +192 -2
  41. package/dist/query.mjs.map +1 -1
  42. package/dist/services/account.d.mts +625 -70
  43. package/dist/services/account.d.ts +625 -70
  44. package/dist/services/account.js +592 -292
  45. package/dist/services/account.js.map +1 -1
  46. package/dist/services/account.mjs +592 -292
  47. package/dist/services/account.mjs.map +1 -1
  48. package/dist/services/avatars.d.mts +157 -26
  49. package/dist/services/avatars.d.ts +157 -26
  50. package/dist/services/avatars.js +104 -93
  51. package/dist/services/avatars.js.map +1 -1
  52. package/dist/services/avatars.mjs +104 -93
  53. package/dist/services/avatars.mjs.map +1 -1
  54. package/dist/services/databases.d.mts +1425 -248
  55. package/dist/services/databases.d.ts +1425 -248
  56. package/dist/services/databases.js +1186 -611
  57. package/dist/services/databases.js.map +1 -1
  58. package/dist/services/databases.mjs +1186 -611
  59. package/dist/services/databases.mjs.map +1 -1
  60. package/dist/services/functions.d.mts +530 -107
  61. package/dist/services/functions.d.ts +530 -107
  62. package/dist/services/functions.js +393 -276
  63. package/dist/services/functions.js.map +1 -1
  64. package/dist/services/functions.mjs +393 -276
  65. package/dist/services/functions.mjs.map +1 -1
  66. package/dist/services/graphql.d.mts +24 -2
  67. package/dist/services/graphql.d.ts +24 -2
  68. package/dist/services/graphql.js +20 -16
  69. package/dist/services/graphql.js.map +1 -1
  70. package/dist/services/graphql.mjs +20 -16
  71. package/dist/services/graphql.mjs.map +1 -1
  72. package/dist/services/health.d.mts +175 -16
  73. package/dist/services/health.d.ts +175 -16
  74. package/dist/services/health.js +144 -115
  75. package/dist/services/health.js.map +1 -1
  76. package/dist/services/health.mjs +144 -115
  77. package/dist/services/health.mjs.map +1 -1
  78. package/dist/services/locale.js.map +1 -1
  79. package/dist/services/locale.mjs.map +1 -1
  80. package/dist/services/messaging.d.mts +1544 -262
  81. package/dist/services/messaging.d.ts +1544 -262
  82. package/dist/services/messaging.js +1417 -592
  83. package/dist/services/messaging.js.map +1 -1
  84. package/dist/services/messaging.mjs +1417 -592
  85. package/dist/services/messaging.mjs.map +1 -1
  86. package/dist/services/sites.d.mts +495 -99
  87. package/dist/services/sites.d.ts +495 -99
  88. package/dist/services/sites.js +371 -258
  89. package/dist/services/sites.js.map +1 -1
  90. package/dist/services/sites.mjs +371 -258
  91. package/dist/services/sites.mjs.map +1 -1
  92. package/dist/services/storage.d.mts +306 -63
  93. package/dist/services/storage.d.ts +306 -63
  94. package/dist/services/storage.js +225 -158
  95. package/dist/services/storage.js.map +1 -1
  96. package/dist/services/storage.mjs +225 -158
  97. package/dist/services/storage.mjs.map +1 -1
  98. package/dist/services/tables-db.d.mts +1744 -0
  99. package/dist/services/tables-db.d.ts +1744 -0
  100. package/dist/services/tables-db.js +2692 -0
  101. package/dist/services/tables-db.js.map +1 -0
  102. package/dist/services/tables-db.mjs +2691 -0
  103. package/dist/services/tables-db.mjs.map +1 -0
  104. package/dist/services/teams.d.mts +233 -39
  105. package/dist/services/teams.d.ts +233 -39
  106. package/dist/services/teams.js +170 -135
  107. package/dist/services/teams.js.map +1 -1
  108. package/dist/services/teams.mjs +170 -135
  109. package/dist/services/teams.mjs.map +1 -1
  110. package/dist/services/tokens.d.mts +76 -11
  111. package/dist/services/tokens.d.ts +76 -11
  112. package/dist/services/tokens.js +60 -45
  113. package/dist/services/tokens.js.map +1 -1
  114. package/dist/services/tokens.mjs +60 -45
  115. package/dist/services/tokens.mjs.map +1 -1
  116. package/dist/services/users.d.mts +842 -115
  117. package/dist/services/users.d.ts +842 -115
  118. package/dist/services/users.js +719 -408
  119. package/dist/services/users.js.map +1 -1
  120. package/dist/services/users.mjs +719 -408
  121. package/dist/services/users.mjs.map +1 -1
  122. package/package.json +1 -1
  123. package/dist/enums/v-c-s-deployment-type.js.map +0 -1
  124. package/dist/enums/v-c-s-deployment-type.mjs.map +0 -1
  125. /package/dist/enums/{v-c-s-deployment-type.d.mts → vcs-deployment-type.d.mts} +0 -0
  126. /package/dist/enums/{v-c-s-deployment-type.d.ts → vcs-deployment-type.d.ts} +0 -0
@@ -13,13 +13,32 @@ declare class Avatars {
13
13
  *
14
14
  * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
15
15
  *
16
- * @param {Browser} code
17
- * @param {number} width
18
- * @param {number} height
19
- * @param {number} quality
16
+ * @param {Browser} params.code - Browser Code.
17
+ * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
18
+ * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
19
+ * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
20
20
  * @throws {AppwriteException}
21
21
  * @returns {Promise<ArrayBuffer>}
22
22
  */
23
+ getBrowser(params: {
24
+ code: Browser;
25
+ width?: number;
26
+ height?: number;
27
+ quality?: number;
28
+ }): Promise<ArrayBuffer>;
29
+ /**
30
+ * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
31
+ *
32
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
33
+ *
34
+ * @param {Browser} code - Browser Code.
35
+ * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
36
+ * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
37
+ * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
38
+ * @throws {AppwriteException}
39
+ * @returns {Promise<ArrayBuffer>}
40
+ * @deprecated Use the object parameter style method for a better developer experience.
41
+ */
23
42
  getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
24
43
  /**
25
44
  * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
@@ -27,12 +46,32 @@ declare class Avatars {
27
46
  * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
28
47
  *
29
48
  *
30
- * @param {CreditCard} code
31
- * @param {number} width
32
- * @param {number} height
33
- * @param {number} quality
49
+ * @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
50
+ * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
51
+ * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
52
+ * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
53
+ * @throws {AppwriteException}
54
+ * @returns {Promise<ArrayBuffer>}
55
+ */
56
+ getCreditCard(params: {
57
+ code: CreditCard;
58
+ width?: number;
59
+ height?: number;
60
+ quality?: number;
61
+ }): Promise<ArrayBuffer>;
62
+ /**
63
+ * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
64
+ *
65
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
66
+ *
67
+ *
68
+ * @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
69
+ * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
70
+ * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
71
+ * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
34
72
  * @throws {AppwriteException}
35
73
  * @returns {Promise<ArrayBuffer>}
74
+ * @deprecated Use the object parameter style method for a better developer experience.
36
75
  */
37
76
  getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
38
77
  /**
@@ -40,10 +79,23 @@ declare class Avatars {
40
79
  *
41
80
  * This endpoint does not follow HTTP redirects.
42
81
  *
43
- * @param {string} url
82
+ * @param {string} params.url - Website URL which you want to fetch the favicon from.
44
83
  * @throws {AppwriteException}
45
84
  * @returns {Promise<ArrayBuffer>}
46
85
  */
86
+ getFavicon(params: {
87
+ url: string;
88
+ }): Promise<ArrayBuffer>;
89
+ /**
90
+ * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
91
+ *
92
+ * This endpoint does not follow HTTP redirects.
93
+ *
94
+ * @param {string} url - Website URL which you want to fetch the favicon from.
95
+ * @throws {AppwriteException}
96
+ * @returns {Promise<ArrayBuffer>}
97
+ * @deprecated Use the object parameter style method for a better developer experience.
98
+ */
47
99
  getFavicon(url: string): Promise<ArrayBuffer>;
48
100
  /**
49
101
  * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
@@ -51,12 +103,32 @@ declare class Avatars {
51
103
  * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
52
104
  *
53
105
  *
54
- * @param {Flag} code
55
- * @param {number} width
56
- * @param {number} height
57
- * @param {number} quality
106
+ * @param {Flag} params.code - Country Code. ISO Alpha-2 country code format.
107
+ * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
108
+ * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
109
+ * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
110
+ * @throws {AppwriteException}
111
+ * @returns {Promise<ArrayBuffer>}
112
+ */
113
+ getFlag(params: {
114
+ code: Flag;
115
+ width?: number;
116
+ height?: number;
117
+ quality?: number;
118
+ }): Promise<ArrayBuffer>;
119
+ /**
120
+ * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
121
+ *
122
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
123
+ *
124
+ *
125
+ * @param {Flag} code - Country Code. ISO Alpha-2 country code format.
126
+ * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
127
+ * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
128
+ * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
58
129
  * @throws {AppwriteException}
59
130
  * @returns {Promise<ArrayBuffer>}
131
+ * @deprecated Use the object parameter style method for a better developer experience.
60
132
  */
61
133
  getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
62
134
  /**
@@ -66,39 +138,98 @@ declare class Avatars {
66
138
  *
67
139
  * This endpoint does not follow HTTP redirects.
68
140
  *
69
- * @param {string} url
70
- * @param {number} width
71
- * @param {number} height
141
+ * @param {string} params.url - Image URL which you want to crop.
142
+ * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
143
+ * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.
72
144
  * @throws {AppwriteException}
73
145
  * @returns {Promise<ArrayBuffer>}
74
146
  */
147
+ getImage(params: {
148
+ url: string;
149
+ width?: number;
150
+ height?: number;
151
+ }): Promise<ArrayBuffer>;
152
+ /**
153
+ * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
154
+ *
155
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
156
+ *
157
+ * This endpoint does not follow HTTP redirects.
158
+ *
159
+ * @param {string} url - Image URL which you want to crop.
160
+ * @param {number} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
161
+ * @param {number} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.
162
+ * @throws {AppwriteException}
163
+ * @returns {Promise<ArrayBuffer>}
164
+ * @deprecated Use the object parameter style method for a better developer experience.
165
+ */
75
166
  getImage(url: string, width?: number, height?: number): Promise<ArrayBuffer>;
76
167
  /**
77
- * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the &#039;name&#039; parameter. If no name is given and no user is logged, an empty avatar will be returned.
168
+ * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
169
+ *
170
+ * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
171
+ *
172
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
173
+ *
174
+ *
175
+ * @param {string} params.name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.
176
+ * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
177
+ * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
178
+ * @param {string} params.background - Changes background color. By default a random color will be picked and stay will persistent to the given name.
179
+ * @throws {AppwriteException}
180
+ * @returns {Promise<ArrayBuffer>}
181
+ */
182
+ getInitials(params?: {
183
+ name?: string;
184
+ width?: number;
185
+ height?: number;
186
+ background?: string;
187
+ }): Promise<ArrayBuffer>;
188
+ /**
189
+ * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
78
190
  *
79
- * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user&#039;s initials when reloading the same theme will always return for the same initials.
191
+ * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
80
192
  *
81
193
  * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
82
194
  *
83
195
  *
84
- * @param {string} name
85
- * @param {number} width
86
- * @param {number} height
87
- * @param {string} background
196
+ * @param {string} name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.
197
+ * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
198
+ * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
199
+ * @param {string} background - Changes background color. By default a random color will be picked and stay will persistent to the given name.
88
200
  * @throws {AppwriteException}
89
201
  * @returns {Promise<ArrayBuffer>}
202
+ * @deprecated Use the object parameter style method for a better developer experience.
90
203
  */
91
204
  getInitials(name?: string, width?: number, height?: number, background?: string): Promise<ArrayBuffer>;
92
205
  /**
93
206
  * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
94
207
  *
95
208
  *
96
- * @param {string} text
97
- * @param {number} size
98
- * @param {number} margin
99
- * @param {boolean} download
209
+ * @param {string} params.text - Plain text to be converted to QR code image.
210
+ * @param {number} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.
211
+ * @param {number} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
212
+ * @param {boolean} params.download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.
213
+ * @throws {AppwriteException}
214
+ * @returns {Promise<ArrayBuffer>}
215
+ */
216
+ getQR(params: {
217
+ text: string;
218
+ size?: number;
219
+ margin?: number;
220
+ download?: boolean;
221
+ }): Promise<ArrayBuffer>;
222
+ /**
223
+ * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
224
+ *
225
+ *
226
+ * @param {string} text - Plain text to be converted to QR code image.
227
+ * @param {number} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.
228
+ * @param {number} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
229
+ * @param {boolean} download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.
100
230
  * @throws {AppwriteException}
101
231
  * @returns {Promise<ArrayBuffer>}
232
+ * @deprecated Use the object parameter style method for a better developer experience.
102
233
  */
103
234
  getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<ArrayBuffer>;
104
235
  }
@@ -13,13 +13,32 @@ declare class Avatars {
13
13
  *
14
14
  * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
15
15
  *
16
- * @param {Browser} code
17
- * @param {number} width
18
- * @param {number} height
19
- * @param {number} quality
16
+ * @param {Browser} params.code - Browser Code.
17
+ * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
18
+ * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
19
+ * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
20
20
  * @throws {AppwriteException}
21
21
  * @returns {Promise<ArrayBuffer>}
22
22
  */
23
+ getBrowser(params: {
24
+ code: Browser;
25
+ width?: number;
26
+ height?: number;
27
+ quality?: number;
28
+ }): Promise<ArrayBuffer>;
29
+ /**
30
+ * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
31
+ *
32
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
33
+ *
34
+ * @param {Browser} code - Browser Code.
35
+ * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
36
+ * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
37
+ * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
38
+ * @throws {AppwriteException}
39
+ * @returns {Promise<ArrayBuffer>}
40
+ * @deprecated Use the object parameter style method for a better developer experience.
41
+ */
23
42
  getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
24
43
  /**
25
44
  * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
@@ -27,12 +46,32 @@ declare class Avatars {
27
46
  * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
28
47
  *
29
48
  *
30
- * @param {CreditCard} code
31
- * @param {number} width
32
- * @param {number} height
33
- * @param {number} quality
49
+ * @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
50
+ * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
51
+ * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
52
+ * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
53
+ * @throws {AppwriteException}
54
+ * @returns {Promise<ArrayBuffer>}
55
+ */
56
+ getCreditCard(params: {
57
+ code: CreditCard;
58
+ width?: number;
59
+ height?: number;
60
+ quality?: number;
61
+ }): Promise<ArrayBuffer>;
62
+ /**
63
+ * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
64
+ *
65
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
66
+ *
67
+ *
68
+ * @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
69
+ * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
70
+ * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
71
+ * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
34
72
  * @throws {AppwriteException}
35
73
  * @returns {Promise<ArrayBuffer>}
74
+ * @deprecated Use the object parameter style method for a better developer experience.
36
75
  */
37
76
  getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
38
77
  /**
@@ -40,10 +79,23 @@ declare class Avatars {
40
79
  *
41
80
  * This endpoint does not follow HTTP redirects.
42
81
  *
43
- * @param {string} url
82
+ * @param {string} params.url - Website URL which you want to fetch the favicon from.
44
83
  * @throws {AppwriteException}
45
84
  * @returns {Promise<ArrayBuffer>}
46
85
  */
86
+ getFavicon(params: {
87
+ url: string;
88
+ }): Promise<ArrayBuffer>;
89
+ /**
90
+ * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
91
+ *
92
+ * This endpoint does not follow HTTP redirects.
93
+ *
94
+ * @param {string} url - Website URL which you want to fetch the favicon from.
95
+ * @throws {AppwriteException}
96
+ * @returns {Promise<ArrayBuffer>}
97
+ * @deprecated Use the object parameter style method for a better developer experience.
98
+ */
47
99
  getFavicon(url: string): Promise<ArrayBuffer>;
48
100
  /**
49
101
  * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
@@ -51,12 +103,32 @@ declare class Avatars {
51
103
  * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
52
104
  *
53
105
  *
54
- * @param {Flag} code
55
- * @param {number} width
56
- * @param {number} height
57
- * @param {number} quality
106
+ * @param {Flag} params.code - Country Code. ISO Alpha-2 country code format.
107
+ * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
108
+ * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
109
+ * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
110
+ * @throws {AppwriteException}
111
+ * @returns {Promise<ArrayBuffer>}
112
+ */
113
+ getFlag(params: {
114
+ code: Flag;
115
+ width?: number;
116
+ height?: number;
117
+ quality?: number;
118
+ }): Promise<ArrayBuffer>;
119
+ /**
120
+ * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
121
+ *
122
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
123
+ *
124
+ *
125
+ * @param {Flag} code - Country Code. ISO Alpha-2 country code format.
126
+ * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
127
+ * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
128
+ * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
58
129
  * @throws {AppwriteException}
59
130
  * @returns {Promise<ArrayBuffer>}
131
+ * @deprecated Use the object parameter style method for a better developer experience.
60
132
  */
61
133
  getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
62
134
  /**
@@ -66,39 +138,98 @@ declare class Avatars {
66
138
  *
67
139
  * This endpoint does not follow HTTP redirects.
68
140
  *
69
- * @param {string} url
70
- * @param {number} width
71
- * @param {number} height
141
+ * @param {string} params.url - Image URL which you want to crop.
142
+ * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
143
+ * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.
72
144
  * @throws {AppwriteException}
73
145
  * @returns {Promise<ArrayBuffer>}
74
146
  */
147
+ getImage(params: {
148
+ url: string;
149
+ width?: number;
150
+ height?: number;
151
+ }): Promise<ArrayBuffer>;
152
+ /**
153
+ * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
154
+ *
155
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
156
+ *
157
+ * This endpoint does not follow HTTP redirects.
158
+ *
159
+ * @param {string} url - Image URL which you want to crop.
160
+ * @param {number} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
161
+ * @param {number} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.
162
+ * @throws {AppwriteException}
163
+ * @returns {Promise<ArrayBuffer>}
164
+ * @deprecated Use the object parameter style method for a better developer experience.
165
+ */
75
166
  getImage(url: string, width?: number, height?: number): Promise<ArrayBuffer>;
76
167
  /**
77
- * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the &#039;name&#039; parameter. If no name is given and no user is logged, an empty avatar will be returned.
168
+ * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
169
+ *
170
+ * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
171
+ *
172
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
173
+ *
174
+ *
175
+ * @param {string} params.name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.
176
+ * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
177
+ * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
178
+ * @param {string} params.background - Changes background color. By default a random color will be picked and stay will persistent to the given name.
179
+ * @throws {AppwriteException}
180
+ * @returns {Promise<ArrayBuffer>}
181
+ */
182
+ getInitials(params?: {
183
+ name?: string;
184
+ width?: number;
185
+ height?: number;
186
+ background?: string;
187
+ }): Promise<ArrayBuffer>;
188
+ /**
189
+ * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
78
190
  *
79
- * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user&#039;s initials when reloading the same theme will always return for the same initials.
191
+ * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
80
192
  *
81
193
  * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
82
194
  *
83
195
  *
84
- * @param {string} name
85
- * @param {number} width
86
- * @param {number} height
87
- * @param {string} background
196
+ * @param {string} name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.
197
+ * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
198
+ * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
199
+ * @param {string} background - Changes background color. By default a random color will be picked and stay will persistent to the given name.
88
200
  * @throws {AppwriteException}
89
201
  * @returns {Promise<ArrayBuffer>}
202
+ * @deprecated Use the object parameter style method for a better developer experience.
90
203
  */
91
204
  getInitials(name?: string, width?: number, height?: number, background?: string): Promise<ArrayBuffer>;
92
205
  /**
93
206
  * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
94
207
  *
95
208
  *
96
- * @param {string} text
97
- * @param {number} size
98
- * @param {number} margin
99
- * @param {boolean} download
209
+ * @param {string} params.text - Plain text to be converted to QR code image.
210
+ * @param {number} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.
211
+ * @param {number} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
212
+ * @param {boolean} params.download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.
213
+ * @throws {AppwriteException}
214
+ * @returns {Promise<ArrayBuffer>}
215
+ */
216
+ getQR(params: {
217
+ text: string;
218
+ size?: number;
219
+ margin?: number;
220
+ download?: boolean;
221
+ }): Promise<ArrayBuffer>;
222
+ /**
223
+ * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
224
+ *
225
+ *
226
+ * @param {string} text - Plain text to be converted to QR code image.
227
+ * @param {number} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.
228
+ * @param {number} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
229
+ * @param {boolean} download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.
100
230
  * @throws {AppwriteException}
101
231
  * @returns {Promise<ArrayBuffer>}
232
+ * @deprecated Use the object parameter style method for a better developer experience.
102
233
  */
103
234
  getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<ArrayBuffer>;
104
235
  }