@appwrite.io/console 0.0.1 → 0.0.2-preview-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.
- package/README.md +2 -2
- package/dist/cjs/sdk.js +7252 -0
- package/dist/cjs/sdk.js.map +1 -0
- package/dist/esm/sdk.js +7234 -0
- package/dist/esm/sdk.js.map +1 -0
- package/dist/iife/sdk.js +7253 -0
- package/docs/examples/account/create.md +1 -1
- package/docs/examples/account/update-password.md +1 -1
- package/docs/examples/projects/update-auth-password-dictionary.md +18 -0
- package/docs/examples/projects/update-auth-password-history.md +18 -0
- package/docs/examples/teams/create-membership.md +1 -1
- package/docs/examples/users/update-password.md +1 -1
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/models.ts +8 -0
- package/src/services/projects.ts +62 -0
- package/src/services/teams.ts +27 -15
- package/types/client.d.ts +135 -0
- package/types/id.d.ts +4 -0
- package/types/index.d.ts +17 -0
- package/types/models.d.ts +2548 -0
- package/types/permission.d.ts +7 -0
- package/types/query.d.ts +21 -0
- package/types/role.d.ts +8 -0
- package/types/service.d.ts +8 -0
- package/types/services/account.d.ts +442 -0
- package/types/services/avatars.d.ts +145 -0
- package/types/services/databases.d.ts +494 -0
- package/types/services/functions.d.ts +280 -0
- package/types/services/graphql.d.ts +25 -0
- package/types/services/health.d.ts +106 -0
- package/types/services/locale.d.ts +81 -0
- package/types/services/projects.d.ts +400 -0
- package/types/services/storage.d.ts +229 -0
- package/types/services/teams.d.ts +183 -0
- package/types/services/users.d.ts +340 -0
package/types/query.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare type QueryTypesSingle = string | number | boolean;
|
|
2
|
+
export declare type QueryTypesList = string[] | number[] | boolean[];
|
|
3
|
+
export declare type QueryTypes = QueryTypesSingle | QueryTypesList;
|
|
4
|
+
export declare class Query {
|
|
5
|
+
static equal: (attribute: string, value: QueryTypes) => string;
|
|
6
|
+
static notEqual: (attribute: string, value: QueryTypes) => string;
|
|
7
|
+
static lessThan: (attribute: string, value: QueryTypes) => string;
|
|
8
|
+
static lessThanEqual: (attribute: string, value: QueryTypes) => string;
|
|
9
|
+
static greaterThan: (attribute: string, value: QueryTypes) => string;
|
|
10
|
+
static greaterThanEqual: (attribute: string, value: QueryTypes) => string;
|
|
11
|
+
static search: (attribute: string, value: string) => string;
|
|
12
|
+
static orderDesc: (attribute: string) => string;
|
|
13
|
+
static orderAsc: (attribute: string) => string;
|
|
14
|
+
static cursorAfter: (documentId: string) => string;
|
|
15
|
+
static cursorBefore: (documentId: string) => string;
|
|
16
|
+
static limit: (limit: number) => string;
|
|
17
|
+
static offset: (offset: number) => string;
|
|
18
|
+
private static addQuery;
|
|
19
|
+
private static parseValues;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
package/types/role.d.ts
ADDED
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
2
|
+
import { Client } from '../client';
|
|
3
|
+
import type { Models } from '../models';
|
|
4
|
+
export declare class Account extends Service {
|
|
5
|
+
constructor(client: Client);
|
|
6
|
+
/**
|
|
7
|
+
* Get Account
|
|
8
|
+
*
|
|
9
|
+
* Get currently logged in user data as JSON object.
|
|
10
|
+
*
|
|
11
|
+
* @throws {AppwriteException}
|
|
12
|
+
* @returns {Promise}
|
|
13
|
+
*/
|
|
14
|
+
get<Preferences extends Models.Preferences>(): Promise<Models.Account<Preferences>>;
|
|
15
|
+
/**
|
|
16
|
+
* Create Account
|
|
17
|
+
*
|
|
18
|
+
* Use this endpoint to allow a new user to register a new account in your
|
|
19
|
+
* project. After the user registration completes successfully, you can use
|
|
20
|
+
* the [/account/verfication](/docs/client/account#accountCreateVerification)
|
|
21
|
+
* route to start verifying the user email address. To allow the new user to
|
|
22
|
+
* login to their new account, you need to create a new [account
|
|
23
|
+
* session](/docs/client/account#accountCreateSession).
|
|
24
|
+
*
|
|
25
|
+
* @param {string} userId
|
|
26
|
+
* @param {string} email
|
|
27
|
+
* @param {string} password
|
|
28
|
+
* @param {string} name
|
|
29
|
+
* @throws {AppwriteException}
|
|
30
|
+
* @returns {Promise}
|
|
31
|
+
*/
|
|
32
|
+
create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.Account<Preferences>>;
|
|
33
|
+
/**
|
|
34
|
+
* Update Email
|
|
35
|
+
*
|
|
36
|
+
* Update currently logged in user account email address. After changing user
|
|
37
|
+
* address, the user confirmation status will get reset. A new confirmation
|
|
38
|
+
* email is not sent automatically however you can use the send confirmation
|
|
39
|
+
* email endpoint again to send the confirmation email. For security measures,
|
|
40
|
+
* user password is required to complete this request.
|
|
41
|
+
* This endpoint can also be used to convert an anonymous account to a normal
|
|
42
|
+
* one, by passing an email address and a new password.
|
|
43
|
+
*
|
|
44
|
+
*
|
|
45
|
+
* @param {string} email
|
|
46
|
+
* @param {string} password
|
|
47
|
+
* @throws {AppwriteException}
|
|
48
|
+
* @returns {Promise}
|
|
49
|
+
*/
|
|
50
|
+
updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.Account<Preferences>>;
|
|
51
|
+
/**
|
|
52
|
+
* Create JWT
|
|
53
|
+
*
|
|
54
|
+
* Use this endpoint to create a JSON Web Token. You can use the resulting JWT
|
|
55
|
+
* to authenticate on behalf of the current user when working with the
|
|
56
|
+
* Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes
|
|
57
|
+
* from its creation and will be invalid if the user will logout in that time
|
|
58
|
+
* frame.
|
|
59
|
+
*
|
|
60
|
+
* @throws {AppwriteException}
|
|
61
|
+
* @returns {Promise}
|
|
62
|
+
*/
|
|
63
|
+
createJWT(): Promise<Models.Jwt>;
|
|
64
|
+
/**
|
|
65
|
+
* List Logs
|
|
66
|
+
*
|
|
67
|
+
* Get currently logged in user list of latest security activity logs. Each
|
|
68
|
+
* log returns user IP address, location and date and time of log.
|
|
69
|
+
*
|
|
70
|
+
* @param {string[]} queries
|
|
71
|
+
* @throws {AppwriteException}
|
|
72
|
+
* @returns {Promise}
|
|
73
|
+
*/
|
|
74
|
+
listLogs(queries?: string[]): Promise<Models.LogList>;
|
|
75
|
+
/**
|
|
76
|
+
* Update Name
|
|
77
|
+
*
|
|
78
|
+
* Update currently logged in user account name.
|
|
79
|
+
*
|
|
80
|
+
* @param {string} name
|
|
81
|
+
* @throws {AppwriteException}
|
|
82
|
+
* @returns {Promise}
|
|
83
|
+
*/
|
|
84
|
+
updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.Account<Preferences>>;
|
|
85
|
+
/**
|
|
86
|
+
* Update Password
|
|
87
|
+
*
|
|
88
|
+
* Update currently logged in user password. For validation, user is required
|
|
89
|
+
* to pass in the new password, and the old password. For users created with
|
|
90
|
+
* OAuth, Team Invites and Magic URL, oldPassword is optional.
|
|
91
|
+
*
|
|
92
|
+
* @param {string} password
|
|
93
|
+
* @param {string} oldPassword
|
|
94
|
+
* @throws {AppwriteException}
|
|
95
|
+
* @returns {Promise}
|
|
96
|
+
*/
|
|
97
|
+
updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.Account<Preferences>>;
|
|
98
|
+
/**
|
|
99
|
+
* Update Phone
|
|
100
|
+
*
|
|
101
|
+
* Update the currently logged in user's phone number. After updating the
|
|
102
|
+
* phone number, the phone verification status will be reset. A confirmation
|
|
103
|
+
* SMS is not sent automatically, however you can use the [POST
|
|
104
|
+
* /account/verification/phone](/docs/client/account#accountCreatePhoneVerification)
|
|
105
|
+
* endpoint to send a confirmation SMS.
|
|
106
|
+
*
|
|
107
|
+
* @param {string} phone
|
|
108
|
+
* @param {string} password
|
|
109
|
+
* @throws {AppwriteException}
|
|
110
|
+
* @returns {Promise}
|
|
111
|
+
*/
|
|
112
|
+
updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.Account<Preferences>>;
|
|
113
|
+
/**
|
|
114
|
+
* Get Account Preferences
|
|
115
|
+
*
|
|
116
|
+
* Get currently logged in user preferences as a key-value object.
|
|
117
|
+
*
|
|
118
|
+
* @throws {AppwriteException}
|
|
119
|
+
* @returns {Promise}
|
|
120
|
+
*/
|
|
121
|
+
getPrefs<Preferences extends Models.Preferences>(): Promise<Preferences>;
|
|
122
|
+
/**
|
|
123
|
+
* Update Preferences
|
|
124
|
+
*
|
|
125
|
+
* Update currently logged in user account preferences. The object you pass is
|
|
126
|
+
* stored as is, and replaces any previous value. The maximum allowed prefs
|
|
127
|
+
* size is 64kB and throws error if exceeded.
|
|
128
|
+
*
|
|
129
|
+
* @param {object} prefs
|
|
130
|
+
* @throws {AppwriteException}
|
|
131
|
+
* @returns {Promise}
|
|
132
|
+
*/
|
|
133
|
+
updatePrefs<Preferences extends Models.Preferences>(prefs: object): Promise<Models.Account<Preferences>>;
|
|
134
|
+
/**
|
|
135
|
+
* Create Password Recovery
|
|
136
|
+
*
|
|
137
|
+
* Sends the user an email with a temporary secret key for password reset.
|
|
138
|
+
* When the user clicks the confirmation link he is redirected back to your
|
|
139
|
+
* app password reset URL with the secret key and email address values
|
|
140
|
+
* attached to the URL query string. Use the query string params to submit a
|
|
141
|
+
* request to the [PUT
|
|
142
|
+
* /account/recovery](/docs/client/account#accountUpdateRecovery) endpoint to
|
|
143
|
+
* complete the process. The verification link sent to the user's email
|
|
144
|
+
* address is valid for 1 hour.
|
|
145
|
+
*
|
|
146
|
+
* @param {string} email
|
|
147
|
+
* @param {string} url
|
|
148
|
+
* @throws {AppwriteException}
|
|
149
|
+
* @returns {Promise}
|
|
150
|
+
*/
|
|
151
|
+
createRecovery(email: string, url: string): Promise<Models.Token>;
|
|
152
|
+
/**
|
|
153
|
+
* Create Password Recovery (confirmation)
|
|
154
|
+
*
|
|
155
|
+
* Use this endpoint to complete the user account password reset. Both the
|
|
156
|
+
* **userId** and **secret** arguments will be passed as query parameters to
|
|
157
|
+
* the redirect URL you have provided when sending your request to the [POST
|
|
158
|
+
* /account/recovery](/docs/client/account#accountCreateRecovery) endpoint.
|
|
159
|
+
*
|
|
160
|
+
* Please note that in order to avoid a [Redirect
|
|
161
|
+
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
|
162
|
+
* the only valid redirect URLs are the ones from domains you have set when
|
|
163
|
+
* adding your platforms in the console interface.
|
|
164
|
+
*
|
|
165
|
+
* @param {string} userId
|
|
166
|
+
* @param {string} secret
|
|
167
|
+
* @param {string} password
|
|
168
|
+
* @param {string} passwordAgain
|
|
169
|
+
* @throws {AppwriteException}
|
|
170
|
+
* @returns {Promise}
|
|
171
|
+
*/
|
|
172
|
+
updateRecovery(userId: string, secret: string, password: string, passwordAgain: string): Promise<Models.Token>;
|
|
173
|
+
/**
|
|
174
|
+
* List Sessions
|
|
175
|
+
*
|
|
176
|
+
* Get currently logged in user list of active sessions across different
|
|
177
|
+
* devices.
|
|
178
|
+
*
|
|
179
|
+
* @throws {AppwriteException}
|
|
180
|
+
* @returns {Promise}
|
|
181
|
+
*/
|
|
182
|
+
listSessions(): Promise<Models.SessionList>;
|
|
183
|
+
/**
|
|
184
|
+
* Delete Sessions
|
|
185
|
+
*
|
|
186
|
+
* Delete all sessions from the user account and remove any sessions cookies
|
|
187
|
+
* from the end client.
|
|
188
|
+
*
|
|
189
|
+
* @throws {AppwriteException}
|
|
190
|
+
* @returns {Promise}
|
|
191
|
+
*/
|
|
192
|
+
deleteSessions(): Promise<{}>;
|
|
193
|
+
/**
|
|
194
|
+
* Create Anonymous Session
|
|
195
|
+
*
|
|
196
|
+
* Use this endpoint to allow a new user to register an anonymous account in
|
|
197
|
+
* your project. This route will also create a new session for the user. To
|
|
198
|
+
* allow the new user to convert an anonymous account to a normal account, you
|
|
199
|
+
* need to update its [email and
|
|
200
|
+
* password](/docs/client/account#accountUpdateEmail) or create an [OAuth2
|
|
201
|
+
* session](/docs/client/account#accountCreateOAuth2Session).
|
|
202
|
+
*
|
|
203
|
+
* @throws {AppwriteException}
|
|
204
|
+
* @returns {Promise}
|
|
205
|
+
*/
|
|
206
|
+
createAnonymousSession(): Promise<Models.Session>;
|
|
207
|
+
/**
|
|
208
|
+
* Create Email Session
|
|
209
|
+
*
|
|
210
|
+
* Allow the user to login into their account by providing a valid email and
|
|
211
|
+
* password combination. This route will create a new session for the user.
|
|
212
|
+
*
|
|
213
|
+
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
214
|
+
* about session limits](/docs/authentication#limits).
|
|
215
|
+
*
|
|
216
|
+
* @param {string} email
|
|
217
|
+
* @param {string} password
|
|
218
|
+
* @throws {AppwriteException}
|
|
219
|
+
* @returns {Promise}
|
|
220
|
+
*/
|
|
221
|
+
createEmailSession(email: string, password: string): Promise<Models.Session>;
|
|
222
|
+
/**
|
|
223
|
+
* Create Magic URL session
|
|
224
|
+
*
|
|
225
|
+
* Sends the user an email with a secret key for creating a session. If the
|
|
226
|
+
* provided user ID has not be registered, a new user will be created. When
|
|
227
|
+
* the user clicks the link in the email, the user is redirected back to the
|
|
228
|
+
* URL you provided with the secret key and userId values attached to the URL
|
|
229
|
+
* query string. Use the query string parameters to submit a request to the
|
|
230
|
+
* [PUT
|
|
231
|
+
* /account/sessions/magic-url](/docs/client/account#accountUpdateMagicURLSession)
|
|
232
|
+
* endpoint to complete the login process. The link sent to the user's email
|
|
233
|
+
* address is valid for 1 hour. If you are on a mobile device you can leave
|
|
234
|
+
* the URL parameter empty, so that the login completion will be handled by
|
|
235
|
+
* your Appwrite instance by default.
|
|
236
|
+
*
|
|
237
|
+
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
238
|
+
* about session limits](/docs/authentication#limits).
|
|
239
|
+
*
|
|
240
|
+
* @param {string} userId
|
|
241
|
+
* @param {string} email
|
|
242
|
+
* @param {string} url
|
|
243
|
+
* @throws {AppwriteException}
|
|
244
|
+
* @returns {Promise}
|
|
245
|
+
*/
|
|
246
|
+
createMagicURLSession(userId: string, email: string, url?: string): Promise<Models.Token>;
|
|
247
|
+
/**
|
|
248
|
+
* Create Magic URL session (confirmation)
|
|
249
|
+
*
|
|
250
|
+
* Use this endpoint to complete creating the session with the Magic URL. Both
|
|
251
|
+
* the **userId** and **secret** arguments will be passed as query parameters
|
|
252
|
+
* to the redirect URL you have provided when sending your request to the
|
|
253
|
+
* [POST
|
|
254
|
+
* /account/sessions/magic-url](/docs/client/account#accountCreateMagicURLSession)
|
|
255
|
+
* endpoint.
|
|
256
|
+
*
|
|
257
|
+
* Please note that in order to avoid a [Redirect
|
|
258
|
+
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
|
259
|
+
* the only valid redirect URLs are the ones from domains you have set when
|
|
260
|
+
* adding your platforms in the console interface.
|
|
261
|
+
*
|
|
262
|
+
* @param {string} userId
|
|
263
|
+
* @param {string} secret
|
|
264
|
+
* @throws {AppwriteException}
|
|
265
|
+
* @returns {Promise}
|
|
266
|
+
*/
|
|
267
|
+
updateMagicURLSession(userId: string, secret: string): Promise<Models.Session>;
|
|
268
|
+
/**
|
|
269
|
+
* Create OAuth2 Session
|
|
270
|
+
*
|
|
271
|
+
* Allow the user to login to their account using the OAuth2 provider of their
|
|
272
|
+
* choice. Each OAuth2 provider should be enabled from the Appwrite console
|
|
273
|
+
* first. Use the success and failure arguments to provide a redirect URL's
|
|
274
|
+
* back to your app when login is completed.
|
|
275
|
+
*
|
|
276
|
+
* If there is already an active session, the new session will be attached to
|
|
277
|
+
* the logged-in account. If there are no active sessions, the server will
|
|
278
|
+
* attempt to look for a user with the same email address as the email
|
|
279
|
+
* received from the OAuth2 provider and attach the new session to the
|
|
280
|
+
* existing user. If no matching user is found - the server will create a new
|
|
281
|
+
* user.
|
|
282
|
+
*
|
|
283
|
+
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
284
|
+
* about session limits](/docs/authentication#limits).
|
|
285
|
+
*
|
|
286
|
+
*
|
|
287
|
+
* @param {string} provider
|
|
288
|
+
* @param {string} success
|
|
289
|
+
* @param {string} failure
|
|
290
|
+
* @param {string[]} scopes
|
|
291
|
+
* @throws {AppwriteException}
|
|
292
|
+
* @returns {void|string}
|
|
293
|
+
*/
|
|
294
|
+
createOAuth2Session(provider: string, success?: string, failure?: string, scopes?: string[]): void | URL;
|
|
295
|
+
/**
|
|
296
|
+
* Create Phone session
|
|
297
|
+
*
|
|
298
|
+
* Sends the user an SMS with a secret key for creating a session. If the
|
|
299
|
+
* provided user ID has not be registered, a new user will be created. Use the
|
|
300
|
+
* returned user ID and secret and submit a request to the [PUT
|
|
301
|
+
* /account/sessions/phone](/docs/client/account#accountUpdatePhoneSession)
|
|
302
|
+
* endpoint to complete the login process. The secret sent to the user's phone
|
|
303
|
+
* is valid for 15 minutes.
|
|
304
|
+
*
|
|
305
|
+
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
306
|
+
* about session limits](/docs/authentication#limits).
|
|
307
|
+
*
|
|
308
|
+
* @param {string} userId
|
|
309
|
+
* @param {string} phone
|
|
310
|
+
* @throws {AppwriteException}
|
|
311
|
+
* @returns {Promise}
|
|
312
|
+
*/
|
|
313
|
+
createPhoneSession(userId: string, phone: string): Promise<Models.Token>;
|
|
314
|
+
/**
|
|
315
|
+
* Create Phone Session (confirmation)
|
|
316
|
+
*
|
|
317
|
+
* Use this endpoint to complete creating a session with SMS. Use the
|
|
318
|
+
* **userId** from the
|
|
319
|
+
* [createPhoneSession](/docs/client/account#accountCreatePhoneSession)
|
|
320
|
+
* endpoint and the **secret** received via SMS to successfully update and
|
|
321
|
+
* confirm the phone session.
|
|
322
|
+
*
|
|
323
|
+
* @param {string} userId
|
|
324
|
+
* @param {string} secret
|
|
325
|
+
* @throws {AppwriteException}
|
|
326
|
+
* @returns {Promise}
|
|
327
|
+
*/
|
|
328
|
+
updatePhoneSession(userId: string, secret: string): Promise<Models.Session>;
|
|
329
|
+
/**
|
|
330
|
+
* Get Session
|
|
331
|
+
*
|
|
332
|
+
* Use this endpoint to get a logged in user's session using a Session ID.
|
|
333
|
+
* Inputting 'current' will return the current session being used.
|
|
334
|
+
*
|
|
335
|
+
* @param {string} sessionId
|
|
336
|
+
* @throws {AppwriteException}
|
|
337
|
+
* @returns {Promise}
|
|
338
|
+
*/
|
|
339
|
+
getSession(sessionId: string): Promise<Models.Session>;
|
|
340
|
+
/**
|
|
341
|
+
* Update OAuth Session (Refresh Tokens)
|
|
342
|
+
*
|
|
343
|
+
* Access tokens have limited lifespan and expire to mitigate security risks.
|
|
344
|
+
* If session was created using an OAuth provider, this route can be used to
|
|
345
|
+
* "refresh" the access token.
|
|
346
|
+
*
|
|
347
|
+
* @param {string} sessionId
|
|
348
|
+
* @throws {AppwriteException}
|
|
349
|
+
* @returns {Promise}
|
|
350
|
+
*/
|
|
351
|
+
updateSession(sessionId: string): Promise<Models.Session>;
|
|
352
|
+
/**
|
|
353
|
+
* Delete Session
|
|
354
|
+
*
|
|
355
|
+
* Use this endpoint to log out the currently logged in user from all their
|
|
356
|
+
* account sessions across all of their different devices. When using the
|
|
357
|
+
* Session ID argument, only the unique session ID provided is deleted.
|
|
358
|
+
*
|
|
359
|
+
*
|
|
360
|
+
* @param {string} sessionId
|
|
361
|
+
* @throws {AppwriteException}
|
|
362
|
+
* @returns {Promise}
|
|
363
|
+
*/
|
|
364
|
+
deleteSession(sessionId: string): Promise<{}>;
|
|
365
|
+
/**
|
|
366
|
+
* Update Status
|
|
367
|
+
*
|
|
368
|
+
* Block the currently logged in user account. Behind the scene, the user
|
|
369
|
+
* record is not deleted but permanently blocked from any access. To
|
|
370
|
+
* completely delete a user, use the Users API instead.
|
|
371
|
+
*
|
|
372
|
+
* @throws {AppwriteException}
|
|
373
|
+
* @returns {Promise}
|
|
374
|
+
*/
|
|
375
|
+
updateStatus<Preferences extends Models.Preferences>(): Promise<Models.Account<Preferences>>;
|
|
376
|
+
/**
|
|
377
|
+
* Create Email Verification
|
|
378
|
+
*
|
|
379
|
+
* Use this endpoint to send a verification message to your user email address
|
|
380
|
+
* to confirm they are the valid owners of that address. Both the **userId**
|
|
381
|
+
* and **secret** arguments will be passed as query parameters to the URL you
|
|
382
|
+
* have provided to be attached to the verification email. The provided URL
|
|
383
|
+
* should redirect the user back to your app and allow you to complete the
|
|
384
|
+
* verification process by verifying both the **userId** and **secret**
|
|
385
|
+
* parameters. Learn more about how to [complete the verification
|
|
386
|
+
* process](/docs/client/account#accountUpdateEmailVerification). The
|
|
387
|
+
* verification link sent to the user's email address is valid for 7 days.
|
|
388
|
+
*
|
|
389
|
+
* Please note that in order to avoid a [Redirect
|
|
390
|
+
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
|
|
391
|
+
* the only valid redirect URLs are the ones from domains you have set when
|
|
392
|
+
* adding your platforms in the console interface.
|
|
393
|
+
*
|
|
394
|
+
*
|
|
395
|
+
* @param {string} url
|
|
396
|
+
* @throws {AppwriteException}
|
|
397
|
+
* @returns {Promise}
|
|
398
|
+
*/
|
|
399
|
+
createVerification(url: string): Promise<Models.Token>;
|
|
400
|
+
/**
|
|
401
|
+
* Create Email Verification (confirmation)
|
|
402
|
+
*
|
|
403
|
+
* Use this endpoint to complete the user email verification process. Use both
|
|
404
|
+
* the **userId** and **secret** parameters that were attached to your app URL
|
|
405
|
+
* to verify the user email ownership. If confirmed this route will return a
|
|
406
|
+
* 200 status code.
|
|
407
|
+
*
|
|
408
|
+
* @param {string} userId
|
|
409
|
+
* @param {string} secret
|
|
410
|
+
* @throws {AppwriteException}
|
|
411
|
+
* @returns {Promise}
|
|
412
|
+
*/
|
|
413
|
+
updateVerification(userId: string, secret: string): Promise<Models.Token>;
|
|
414
|
+
/**
|
|
415
|
+
* Create Phone Verification
|
|
416
|
+
*
|
|
417
|
+
* Use this endpoint to send a verification SMS to the currently logged in
|
|
418
|
+
* user. This endpoint is meant for use after updating a user's phone number
|
|
419
|
+
* using the [accountUpdatePhone](/docs/client/account#accountUpdatePhone)
|
|
420
|
+
* endpoint. Learn more about how to [complete the verification
|
|
421
|
+
* process](/docs/client/account#accountUpdatePhoneVerification). The
|
|
422
|
+
* verification code sent to the user's phone number is valid for 15 minutes.
|
|
423
|
+
*
|
|
424
|
+
* @throws {AppwriteException}
|
|
425
|
+
* @returns {Promise}
|
|
426
|
+
*/
|
|
427
|
+
createPhoneVerification(): Promise<Models.Token>;
|
|
428
|
+
/**
|
|
429
|
+
* Create Phone Verification (confirmation)
|
|
430
|
+
*
|
|
431
|
+
* Use this endpoint to complete the user phone verification process. Use the
|
|
432
|
+
* **userId** and **secret** that were sent to your user's phone number to
|
|
433
|
+
* verify the user email ownership. If confirmed this route will return a 200
|
|
434
|
+
* status code.
|
|
435
|
+
*
|
|
436
|
+
* @param {string} userId
|
|
437
|
+
* @param {string} secret
|
|
438
|
+
* @throws {AppwriteException}
|
|
439
|
+
* @returns {Promise}
|
|
440
|
+
*/
|
|
441
|
+
updatePhoneVerification(userId: string, secret: string): Promise<Models.Token>;
|
|
442
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
2
|
+
import { Client } from '../client';
|
|
3
|
+
export declare class Avatars extends Service {
|
|
4
|
+
constructor(client: Client);
|
|
5
|
+
/**
|
|
6
|
+
* Get Browser Icon
|
|
7
|
+
*
|
|
8
|
+
* You can use this endpoint to show different browser icons to your users.
|
|
9
|
+
* The code argument receives the browser code as it appears in your user [GET
|
|
10
|
+
* /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use
|
|
11
|
+
* width, height and quality arguments to change the output settings.
|
|
12
|
+
*
|
|
13
|
+
* When one dimension is specified and the other is 0, the image is scaled
|
|
14
|
+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
15
|
+
* image at source quality. If dimensions are not specified, the default size
|
|
16
|
+
* of image returned is 100x100px.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} code
|
|
19
|
+
* @param {number} width
|
|
20
|
+
* @param {number} height
|
|
21
|
+
* @param {number} quality
|
|
22
|
+
* @throws {AppwriteException}
|
|
23
|
+
* @returns {URL}
|
|
24
|
+
*/
|
|
25
|
+
getBrowser(code: string, width?: number, height?: number, quality?: number): URL;
|
|
26
|
+
/**
|
|
27
|
+
* Get Credit Card Icon
|
|
28
|
+
*
|
|
29
|
+
* The credit card endpoint will return you the icon of the credit card
|
|
30
|
+
* provider you need. Use width, height and quality arguments to change the
|
|
31
|
+
* output settings.
|
|
32
|
+
*
|
|
33
|
+
* When one dimension is specified and the other is 0, the image is scaled
|
|
34
|
+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
35
|
+
* image at source quality. If dimensions are not specified, the default size
|
|
36
|
+
* of image returned is 100x100px.
|
|
37
|
+
*
|
|
38
|
+
*
|
|
39
|
+
* @param {string} code
|
|
40
|
+
* @param {number} width
|
|
41
|
+
* @param {number} height
|
|
42
|
+
* @param {number} quality
|
|
43
|
+
* @throws {AppwriteException}
|
|
44
|
+
* @returns {URL}
|
|
45
|
+
*/
|
|
46
|
+
getCreditCard(code: string, width?: number, height?: number, quality?: number): URL;
|
|
47
|
+
/**
|
|
48
|
+
* Get Favicon
|
|
49
|
+
*
|
|
50
|
+
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
|
|
51
|
+
* website URL.
|
|
52
|
+
*
|
|
53
|
+
*
|
|
54
|
+
* @param {string} url
|
|
55
|
+
* @throws {AppwriteException}
|
|
56
|
+
* @returns {URL}
|
|
57
|
+
*/
|
|
58
|
+
getFavicon(url: string): URL;
|
|
59
|
+
/**
|
|
60
|
+
* Get Country Flag
|
|
61
|
+
*
|
|
62
|
+
* You can use this endpoint to show different country flags icons to your
|
|
63
|
+
* users. The code argument receives the 2 letter country code. Use width,
|
|
64
|
+
* height and quality arguments to change the output settings. Country codes
|
|
65
|
+
* follow the [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
|
66
|
+
*
|
|
67
|
+
* When one dimension is specified and the other is 0, the image is scaled
|
|
68
|
+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
69
|
+
* image at source quality. If dimensions are not specified, the default size
|
|
70
|
+
* of image returned is 100x100px.
|
|
71
|
+
*
|
|
72
|
+
*
|
|
73
|
+
* @param {string} code
|
|
74
|
+
* @param {number} width
|
|
75
|
+
* @param {number} height
|
|
76
|
+
* @param {number} quality
|
|
77
|
+
* @throws {AppwriteException}
|
|
78
|
+
* @returns {URL}
|
|
79
|
+
*/
|
|
80
|
+
getFlag(code: string, width?: number, height?: number, quality?: number): URL;
|
|
81
|
+
/**
|
|
82
|
+
* Get Image from URL
|
|
83
|
+
*
|
|
84
|
+
* Use this endpoint to fetch a remote image URL and crop it to any image size
|
|
85
|
+
* you want. This endpoint is very useful if you need to crop and display
|
|
86
|
+
* remote images in your app or in case you want to make sure a 3rd party
|
|
87
|
+
* image is properly served using a TLS protocol.
|
|
88
|
+
*
|
|
89
|
+
* When one dimension is specified and the other is 0, the image is scaled
|
|
90
|
+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
91
|
+
* image at source quality. If dimensions are not specified, the default size
|
|
92
|
+
* of image returned is 400x400px.
|
|
93
|
+
*
|
|
94
|
+
*
|
|
95
|
+
* @param {string} url
|
|
96
|
+
* @param {number} width
|
|
97
|
+
* @param {number} height
|
|
98
|
+
* @throws {AppwriteException}
|
|
99
|
+
* @returns {URL}
|
|
100
|
+
*/
|
|
101
|
+
getImage(url: string, width?: number, height?: number): URL;
|
|
102
|
+
/**
|
|
103
|
+
* Get User Initials
|
|
104
|
+
*
|
|
105
|
+
* Use this endpoint to show your user initials avatar icon on your website or
|
|
106
|
+
* app. By default, this route will try to print your logged-in user name or
|
|
107
|
+
* email initials. You can also overwrite the user name if you pass the 'name'
|
|
108
|
+
* parameter. If no name is given and no user is logged, an empty avatar will
|
|
109
|
+
* be returned.
|
|
110
|
+
*
|
|
111
|
+
* You can use the color and background params to change the avatar colors. By
|
|
112
|
+
* default, a random theme will be selected. The random theme will persist for
|
|
113
|
+
* the user's initials when reloading the same theme will always return for
|
|
114
|
+
* the same initials.
|
|
115
|
+
*
|
|
116
|
+
* When one dimension is specified and the other is 0, the image is scaled
|
|
117
|
+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
118
|
+
* image at source quality. If dimensions are not specified, the default size
|
|
119
|
+
* of image returned is 100x100px.
|
|
120
|
+
*
|
|
121
|
+
*
|
|
122
|
+
* @param {string} name
|
|
123
|
+
* @param {number} width
|
|
124
|
+
* @param {number} height
|
|
125
|
+
* @param {string} background
|
|
126
|
+
* @throws {AppwriteException}
|
|
127
|
+
* @returns {URL}
|
|
128
|
+
*/
|
|
129
|
+
getInitials(name?: string, width?: number, height?: number, background?: string): URL;
|
|
130
|
+
/**
|
|
131
|
+
* Get QR Code
|
|
132
|
+
*
|
|
133
|
+
* Converts a given plain text to a QR code image. You can use the query
|
|
134
|
+
* parameters to change the size and style of the resulting image.
|
|
135
|
+
*
|
|
136
|
+
*
|
|
137
|
+
* @param {string} text
|
|
138
|
+
* @param {number} size
|
|
139
|
+
* @param {number} margin
|
|
140
|
+
* @param {boolean} download
|
|
141
|
+
* @throws {AppwriteException}
|
|
142
|
+
* @returns {URL}
|
|
143
|
+
*/
|
|
144
|
+
getQR(text: string, size?: number, margin?: number, download?: boolean): URL;
|
|
145
|
+
}
|