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.
- package/README.md +67 -2
- package/dist/client.js +3 -3
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +3 -3
- package/dist/client.mjs.map +1 -1
- package/dist/enums/credit-card.d.mts +1 -1
- package/dist/enums/credit-card.d.ts +1 -1
- package/dist/enums/credit-card.js +1 -1
- package/dist/enums/credit-card.js.map +1 -1
- package/dist/enums/credit-card.mjs +1 -1
- package/dist/enums/credit-card.mjs.map +1 -1
- package/dist/enums/execution-method.d.mts +2 -1
- package/dist/enums/execution-method.d.ts +2 -1
- package/dist/enums/execution-method.js +1 -0
- package/dist/enums/execution-method.js.map +1 -1
- package/dist/enums/execution-method.mjs +1 -0
- package/dist/enums/execution-method.mjs.map +1 -1
- package/dist/enums/index-type.d.mts +2 -1
- package/dist/enums/index-type.d.ts +2 -1
- package/dist/enums/index-type.js +1 -0
- package/dist/enums/index-type.js.map +1 -1
- package/dist/enums/index-type.mjs +1 -0
- package/dist/enums/index-type.mjs.map +1 -1
- package/dist/enums/{v-c-s-deployment-type.js → vcs-deployment-type.js} +1 -1
- package/dist/enums/vcs-deployment-type.js.map +1 -0
- package/dist/enums/{v-c-s-deployment-type.mjs → vcs-deployment-type.mjs} +2 -2
- package/dist/enums/vcs-deployment-type.mjs.map +1 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/models.d.mts +1058 -153
- package/dist/models.d.ts +1058 -153
- package/dist/query.d.mts +196 -6
- package/dist/query.d.ts +196 -6
- package/dist/query.js +192 -2
- package/dist/query.js.map +1 -1
- package/dist/query.mjs +192 -2
- package/dist/query.mjs.map +1 -1
- package/dist/services/account.d.mts +625 -70
- package/dist/services/account.d.ts +625 -70
- package/dist/services/account.js +592 -292
- package/dist/services/account.js.map +1 -1
- package/dist/services/account.mjs +592 -292
- package/dist/services/account.mjs.map +1 -1
- package/dist/services/avatars.d.mts +157 -26
- package/dist/services/avatars.d.ts +157 -26
- package/dist/services/avatars.js +104 -93
- package/dist/services/avatars.js.map +1 -1
- package/dist/services/avatars.mjs +104 -93
- package/dist/services/avatars.mjs.map +1 -1
- package/dist/services/databases.d.mts +1425 -248
- package/dist/services/databases.d.ts +1425 -248
- package/dist/services/databases.js +1186 -611
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +1186 -611
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +530 -107
- package/dist/services/functions.d.ts +530 -107
- package/dist/services/functions.js +393 -276
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +393 -276
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/graphql.d.mts +24 -2
- package/dist/services/graphql.d.ts +24 -2
- package/dist/services/graphql.js +20 -16
- package/dist/services/graphql.js.map +1 -1
- package/dist/services/graphql.mjs +20 -16
- package/dist/services/graphql.mjs.map +1 -1
- package/dist/services/health.d.mts +175 -16
- package/dist/services/health.d.ts +175 -16
- package/dist/services/health.js +144 -115
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +144 -115
- package/dist/services/health.mjs.map +1 -1
- package/dist/services/locale.js.map +1 -1
- package/dist/services/locale.mjs.map +1 -1
- package/dist/services/messaging.d.mts +1544 -262
- package/dist/services/messaging.d.ts +1544 -262
- package/dist/services/messaging.js +1417 -592
- package/dist/services/messaging.js.map +1 -1
- package/dist/services/messaging.mjs +1417 -592
- package/dist/services/messaging.mjs.map +1 -1
- package/dist/services/sites.d.mts +495 -99
- package/dist/services/sites.d.ts +495 -99
- package/dist/services/sites.js +371 -258
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs +371 -258
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/storage.d.mts +306 -63
- package/dist/services/storage.d.ts +306 -63
- package/dist/services/storage.js +225 -158
- package/dist/services/storage.js.map +1 -1
- package/dist/services/storage.mjs +225 -158
- package/dist/services/storage.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +1744 -0
- package/dist/services/tables-db.d.ts +1744 -0
- package/dist/services/tables-db.js +2692 -0
- package/dist/services/tables-db.js.map +1 -0
- package/dist/services/tables-db.mjs +2691 -0
- package/dist/services/tables-db.mjs.map +1 -0
- package/dist/services/teams.d.mts +233 -39
- package/dist/services/teams.d.ts +233 -39
- package/dist/services/teams.js +170 -135
- package/dist/services/teams.js.map +1 -1
- package/dist/services/teams.mjs +170 -135
- package/dist/services/teams.mjs.map +1 -1
- package/dist/services/tokens.d.mts +76 -11
- package/dist/services/tokens.d.ts +76 -11
- package/dist/services/tokens.js +60 -45
- package/dist/services/tokens.js.map +1 -1
- package/dist/services/tokens.mjs +60 -45
- package/dist/services/tokens.mjs.map +1 -1
- package/dist/services/users.d.mts +842 -115
- package/dist/services/users.d.ts +842 -115
- package/dist/services/users.js +719 -408
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +719 -408
- package/dist/services/users.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/enums/v-c-s-deployment-type.js.map +0 -1
- package/dist/enums/v-c-s-deployment-type.mjs.map +0 -1
- /package/dist/enums/{v-c-s-deployment-type.d.mts → vcs-deployment-type.d.mts} +0 -0
- /package/dist/enums/{v-c-s-deployment-type.d.ts → vcs-deployment-type.d.ts} +0 -0
package/dist/services/users.d.ts
CHANGED
|
@@ -9,294 +9,850 @@ declare class Users {
|
|
|
9
9
|
client: Client;
|
|
10
10
|
constructor(client: Client);
|
|
11
11
|
/**
|
|
12
|
-
* Get a list of all the project
|
|
12
|
+
* Get a list of all the project's users. You can use the query params to filter your results.
|
|
13
13
|
*
|
|
14
|
-
* @param {string[]} queries
|
|
15
|
-
* @param {string} search
|
|
14
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels
|
|
15
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
16
16
|
* @throws {AppwriteException}
|
|
17
17
|
* @returns {Promise<Models.UserList<Preferences>>}
|
|
18
18
|
*/
|
|
19
|
+
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(params?: {
|
|
20
|
+
queries?: string[];
|
|
21
|
+
search?: string;
|
|
22
|
+
}): Promise<Models.UserList<Preferences>>;
|
|
23
|
+
/**
|
|
24
|
+
* Get a list of all the project's users. You can use the query params to filter your results.
|
|
25
|
+
*
|
|
26
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels
|
|
27
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
28
|
+
* @throws {AppwriteException}
|
|
29
|
+
* @returns {Promise<Models.UserList<Preferences>>}
|
|
30
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
31
|
+
*/
|
|
19
32
|
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string): Promise<Models.UserList<Preferences>>;
|
|
20
33
|
/**
|
|
21
34
|
* Create a new user.
|
|
22
35
|
*
|
|
23
|
-
* @param {string} userId
|
|
24
|
-
* @param {string} email
|
|
25
|
-
* @param {string} phone
|
|
26
|
-
* @param {string} password
|
|
27
|
-
* @param {string} name
|
|
36
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
37
|
+
* @param {string} params.email - User email.
|
|
38
|
+
* @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
39
|
+
* @param {string} params.password - Plain text user password. Must be at least 8 chars.
|
|
40
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
41
|
+
* @throws {AppwriteException}
|
|
42
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
43
|
+
*/
|
|
44
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
45
|
+
userId: string;
|
|
46
|
+
email?: string;
|
|
47
|
+
phone?: string;
|
|
48
|
+
password?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
}): Promise<Models.User<Preferences>>;
|
|
51
|
+
/**
|
|
52
|
+
* Create a new user.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
55
|
+
* @param {string} email - User email.
|
|
56
|
+
* @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
57
|
+
* @param {string} password - Plain text user password. Must be at least 8 chars.
|
|
58
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
28
59
|
* @throws {AppwriteException}
|
|
29
60
|
* @returns {Promise<Models.User<Preferences>>}
|
|
61
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
30
62
|
*/
|
|
31
63
|
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences>>;
|
|
32
64
|
/**
|
|
33
65
|
* Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
34
66
|
*
|
|
35
|
-
* @param {string} userId
|
|
36
|
-
* @param {string} email
|
|
37
|
-
* @param {string} password
|
|
38
|
-
* @param {string} name
|
|
67
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
68
|
+
* @param {string} params.email - User email.
|
|
69
|
+
* @param {string} params.password - User password hashed using Argon2.
|
|
70
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
39
71
|
* @throws {AppwriteException}
|
|
40
72
|
* @returns {Promise<Models.User<Preferences>>}
|
|
41
73
|
*/
|
|
74
|
+
createArgon2User<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
75
|
+
userId: string;
|
|
76
|
+
email: string;
|
|
77
|
+
password: string;
|
|
78
|
+
name?: string;
|
|
79
|
+
}): Promise<Models.User<Preferences>>;
|
|
80
|
+
/**
|
|
81
|
+
* Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
82
|
+
*
|
|
83
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
84
|
+
* @param {string} email - User email.
|
|
85
|
+
* @param {string} password - User password hashed using Argon2.
|
|
86
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
87
|
+
* @throws {AppwriteException}
|
|
88
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
89
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
90
|
+
*/
|
|
42
91
|
createArgon2User<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
43
92
|
/**
|
|
44
93
|
* Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
45
94
|
*
|
|
46
|
-
* @param {string} userId
|
|
47
|
-
* @param {string} email
|
|
48
|
-
* @param {string} password
|
|
49
|
-
* @param {string} name
|
|
95
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
96
|
+
* @param {string} params.email - User email.
|
|
97
|
+
* @param {string} params.password - User password hashed using Bcrypt.
|
|
98
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
50
99
|
* @throws {AppwriteException}
|
|
51
100
|
* @returns {Promise<Models.User<Preferences>>}
|
|
52
101
|
*/
|
|
102
|
+
createBcryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
103
|
+
userId: string;
|
|
104
|
+
email: string;
|
|
105
|
+
password: string;
|
|
106
|
+
name?: string;
|
|
107
|
+
}): Promise<Models.User<Preferences>>;
|
|
108
|
+
/**
|
|
109
|
+
* Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
110
|
+
*
|
|
111
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
112
|
+
* @param {string} email - User email.
|
|
113
|
+
* @param {string} password - User password hashed using Bcrypt.
|
|
114
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
115
|
+
* @throws {AppwriteException}
|
|
116
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
117
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
118
|
+
*/
|
|
53
119
|
createBcryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
54
120
|
/**
|
|
55
121
|
* Get identities for all users.
|
|
56
122
|
*
|
|
57
|
-
* @param {string[]} queries
|
|
58
|
-
* @param {string} search
|
|
123
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry
|
|
124
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
125
|
+
* @throws {AppwriteException}
|
|
126
|
+
* @returns {Promise<Models.IdentityList>}
|
|
127
|
+
*/
|
|
128
|
+
listIdentities(params?: {
|
|
129
|
+
queries?: string[];
|
|
130
|
+
search?: string;
|
|
131
|
+
}): Promise<Models.IdentityList>;
|
|
132
|
+
/**
|
|
133
|
+
* Get identities for all users.
|
|
134
|
+
*
|
|
135
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry
|
|
136
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
59
137
|
* @throws {AppwriteException}
|
|
60
138
|
* @returns {Promise<Models.IdentityList>}
|
|
139
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
61
140
|
*/
|
|
62
141
|
listIdentities(queries?: string[], search?: string): Promise<Models.IdentityList>;
|
|
63
142
|
/**
|
|
64
143
|
* Delete an identity by its unique ID.
|
|
65
144
|
*
|
|
66
|
-
* @param {string} identityId
|
|
145
|
+
* @param {string} params.identityId - Identity ID.
|
|
146
|
+
* @throws {AppwriteException}
|
|
147
|
+
* @returns {Promise<{}>}
|
|
148
|
+
*/
|
|
149
|
+
deleteIdentity(params: {
|
|
150
|
+
identityId: string;
|
|
151
|
+
}): Promise<{}>;
|
|
152
|
+
/**
|
|
153
|
+
* Delete an identity by its unique ID.
|
|
154
|
+
*
|
|
155
|
+
* @param {string} identityId - Identity ID.
|
|
67
156
|
* @throws {AppwriteException}
|
|
68
157
|
* @returns {Promise<{}>}
|
|
158
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
69
159
|
*/
|
|
70
160
|
deleteIdentity(identityId: string): Promise<{}>;
|
|
71
161
|
/**
|
|
72
162
|
* Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
73
163
|
*
|
|
74
|
-
* @param {string} userId
|
|
75
|
-
* @param {string} email
|
|
76
|
-
* @param {string} password
|
|
77
|
-
* @param {string} name
|
|
164
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
165
|
+
* @param {string} params.email - User email.
|
|
166
|
+
* @param {string} params.password - User password hashed using MD5.
|
|
167
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
168
|
+
* @throws {AppwriteException}
|
|
169
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
170
|
+
*/
|
|
171
|
+
createMD5User<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
172
|
+
userId: string;
|
|
173
|
+
email: string;
|
|
174
|
+
password: string;
|
|
175
|
+
name?: string;
|
|
176
|
+
}): Promise<Models.User<Preferences>>;
|
|
177
|
+
/**
|
|
178
|
+
* Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
179
|
+
*
|
|
180
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
181
|
+
* @param {string} email - User email.
|
|
182
|
+
* @param {string} password - User password hashed using MD5.
|
|
183
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
78
184
|
* @throws {AppwriteException}
|
|
79
185
|
* @returns {Promise<Models.User<Preferences>>}
|
|
186
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
80
187
|
*/
|
|
81
188
|
createMD5User<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
82
189
|
/**
|
|
83
190
|
* Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
84
191
|
*
|
|
85
|
-
* @param {string} userId
|
|
86
|
-
* @param {string} email
|
|
87
|
-
* @param {string} password
|
|
88
|
-
* @param {string} name
|
|
192
|
+
* @param {string} params.userId - User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
193
|
+
* @param {string} params.email - User email.
|
|
194
|
+
* @param {string} params.password - User password hashed using PHPass.
|
|
195
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
89
196
|
* @throws {AppwriteException}
|
|
90
197
|
* @returns {Promise<Models.User<Preferences>>}
|
|
91
198
|
*/
|
|
199
|
+
createPHPassUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
200
|
+
userId: string;
|
|
201
|
+
email: string;
|
|
202
|
+
password: string;
|
|
203
|
+
name?: string;
|
|
204
|
+
}): Promise<Models.User<Preferences>>;
|
|
205
|
+
/**
|
|
206
|
+
* Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
207
|
+
*
|
|
208
|
+
* @param {string} userId - User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
209
|
+
* @param {string} email - User email.
|
|
210
|
+
* @param {string} password - User password hashed using PHPass.
|
|
211
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
212
|
+
* @throws {AppwriteException}
|
|
213
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
214
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
215
|
+
*/
|
|
92
216
|
createPHPassUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
93
217
|
/**
|
|
94
218
|
* Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
95
219
|
*
|
|
96
|
-
* @param {string} userId
|
|
97
|
-
* @param {string} email
|
|
98
|
-
* @param {string} password
|
|
99
|
-
* @param {string} passwordSalt
|
|
100
|
-
* @param {number} passwordCpu
|
|
101
|
-
* @param {number} passwordMemory
|
|
102
|
-
* @param {number} passwordParallel
|
|
103
|
-
* @param {number} passwordLength
|
|
104
|
-
* @param {string} name
|
|
220
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
221
|
+
* @param {string} params.email - User email.
|
|
222
|
+
* @param {string} params.password - User password hashed using Scrypt.
|
|
223
|
+
* @param {string} params.passwordSalt - Optional salt used to hash password.
|
|
224
|
+
* @param {number} params.passwordCpu - Optional CPU cost used to hash password.
|
|
225
|
+
* @param {number} params.passwordMemory - Optional memory cost used to hash password.
|
|
226
|
+
* @param {number} params.passwordParallel - Optional parallelization cost used to hash password.
|
|
227
|
+
* @param {number} params.passwordLength - Optional hash length used to hash password.
|
|
228
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
229
|
+
* @throws {AppwriteException}
|
|
230
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
231
|
+
*/
|
|
232
|
+
createScryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
233
|
+
userId: string;
|
|
234
|
+
email: string;
|
|
235
|
+
password: string;
|
|
236
|
+
passwordSalt: string;
|
|
237
|
+
passwordCpu: number;
|
|
238
|
+
passwordMemory: number;
|
|
239
|
+
passwordParallel: number;
|
|
240
|
+
passwordLength: number;
|
|
241
|
+
name?: string;
|
|
242
|
+
}): Promise<Models.User<Preferences>>;
|
|
243
|
+
/**
|
|
244
|
+
* Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
245
|
+
*
|
|
246
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
247
|
+
* @param {string} email - User email.
|
|
248
|
+
* @param {string} password - User password hashed using Scrypt.
|
|
249
|
+
* @param {string} passwordSalt - Optional salt used to hash password.
|
|
250
|
+
* @param {number} passwordCpu - Optional CPU cost used to hash password.
|
|
251
|
+
* @param {number} passwordMemory - Optional memory cost used to hash password.
|
|
252
|
+
* @param {number} passwordParallel - Optional parallelization cost used to hash password.
|
|
253
|
+
* @param {number} passwordLength - Optional hash length used to hash password.
|
|
254
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
105
255
|
* @throws {AppwriteException}
|
|
106
256
|
* @returns {Promise<Models.User<Preferences>>}
|
|
257
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
107
258
|
*/
|
|
108
259
|
createScryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise<Models.User<Preferences>>;
|
|
109
260
|
/**
|
|
110
261
|
* Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
111
262
|
*
|
|
112
|
-
* @param {string} userId
|
|
113
|
-
* @param {string} email
|
|
114
|
-
* @param {string} password
|
|
115
|
-
* @param {string} passwordSalt
|
|
116
|
-
* @param {string} passwordSaltSeparator
|
|
117
|
-
* @param {string} passwordSignerKey
|
|
118
|
-
* @param {string} name
|
|
263
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
264
|
+
* @param {string} params.email - User email.
|
|
265
|
+
* @param {string} params.password - User password hashed using Scrypt Modified.
|
|
266
|
+
* @param {string} params.passwordSalt - Salt used to hash password.
|
|
267
|
+
* @param {string} params.passwordSaltSeparator - Salt separator used to hash password.
|
|
268
|
+
* @param {string} params.passwordSignerKey - Signer key used to hash password.
|
|
269
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
270
|
+
* @throws {AppwriteException}
|
|
271
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
272
|
+
*/
|
|
273
|
+
createScryptModifiedUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
274
|
+
userId: string;
|
|
275
|
+
email: string;
|
|
276
|
+
password: string;
|
|
277
|
+
passwordSalt: string;
|
|
278
|
+
passwordSaltSeparator: string;
|
|
279
|
+
passwordSignerKey: string;
|
|
280
|
+
name?: string;
|
|
281
|
+
}): Promise<Models.User<Preferences>>;
|
|
282
|
+
/**
|
|
283
|
+
* Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
284
|
+
*
|
|
285
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
286
|
+
* @param {string} email - User email.
|
|
287
|
+
* @param {string} password - User password hashed using Scrypt Modified.
|
|
288
|
+
* @param {string} passwordSalt - Salt used to hash password.
|
|
289
|
+
* @param {string} passwordSaltSeparator - Salt separator used to hash password.
|
|
290
|
+
* @param {string} passwordSignerKey - Signer key used to hash password.
|
|
291
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
119
292
|
* @throws {AppwriteException}
|
|
120
293
|
* @returns {Promise<Models.User<Preferences>>}
|
|
294
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
121
295
|
*/
|
|
122
296
|
createScryptModifiedUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise<Models.User<Preferences>>;
|
|
123
297
|
/**
|
|
124
298
|
* Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
125
299
|
*
|
|
126
|
-
* @param {string} userId
|
|
127
|
-
* @param {string} email
|
|
128
|
-
* @param {string} password
|
|
129
|
-
* @param {PasswordHash} passwordVersion
|
|
130
|
-
* @param {string} name
|
|
300
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
301
|
+
* @param {string} params.email - User email.
|
|
302
|
+
* @param {string} params.password - User password hashed using SHA.
|
|
303
|
+
* @param {PasswordHash} params.passwordVersion - Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'
|
|
304
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
305
|
+
* @throws {AppwriteException}
|
|
306
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
307
|
+
*/
|
|
308
|
+
createSHAUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
309
|
+
userId: string;
|
|
310
|
+
email: string;
|
|
311
|
+
password: string;
|
|
312
|
+
passwordVersion?: PasswordHash;
|
|
313
|
+
name?: string;
|
|
314
|
+
}): Promise<Models.User<Preferences>>;
|
|
315
|
+
/**
|
|
316
|
+
* Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
317
|
+
*
|
|
318
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
319
|
+
* @param {string} email - User email.
|
|
320
|
+
* @param {string} password - User password hashed using SHA.
|
|
321
|
+
* @param {PasswordHash} passwordVersion - Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'
|
|
322
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
131
323
|
* @throws {AppwriteException}
|
|
132
324
|
* @returns {Promise<Models.User<Preferences>>}
|
|
325
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
133
326
|
*/
|
|
134
327
|
createSHAUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string): Promise<Models.User<Preferences>>;
|
|
135
328
|
/**
|
|
136
329
|
* Get a user by its unique ID.
|
|
137
330
|
*
|
|
138
|
-
* @param {string} userId
|
|
331
|
+
* @param {string} params.userId - User ID.
|
|
332
|
+
* @throws {AppwriteException}
|
|
333
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
334
|
+
*/
|
|
335
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
336
|
+
userId: string;
|
|
337
|
+
}): Promise<Models.User<Preferences>>;
|
|
338
|
+
/**
|
|
339
|
+
* Get a user by its unique ID.
|
|
340
|
+
*
|
|
341
|
+
* @param {string} userId - User ID.
|
|
139
342
|
* @throws {AppwriteException}
|
|
140
343
|
* @returns {Promise<Models.User<Preferences>>}
|
|
344
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
141
345
|
*/
|
|
142
346
|
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string): Promise<Models.User<Preferences>>;
|
|
143
347
|
/**
|
|
144
|
-
* Delete a user by its unique ID, thereby releasing it
|
|
348
|
+
* Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead.
|
|
145
349
|
*
|
|
146
|
-
* @param {string} userId
|
|
350
|
+
* @param {string} params.userId - User ID.
|
|
147
351
|
* @throws {AppwriteException}
|
|
148
352
|
* @returns {Promise<{}>}
|
|
149
353
|
*/
|
|
354
|
+
delete(params: {
|
|
355
|
+
userId: string;
|
|
356
|
+
}): Promise<{}>;
|
|
357
|
+
/**
|
|
358
|
+
* Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead.
|
|
359
|
+
*
|
|
360
|
+
* @param {string} userId - User ID.
|
|
361
|
+
* @throws {AppwriteException}
|
|
362
|
+
* @returns {Promise<{}>}
|
|
363
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
364
|
+
*/
|
|
150
365
|
delete(userId: string): Promise<{}>;
|
|
151
366
|
/**
|
|
152
367
|
* Update the user email by its unique ID.
|
|
153
368
|
*
|
|
154
|
-
* @param {string} userId
|
|
155
|
-
* @param {string} email
|
|
369
|
+
* @param {string} params.userId - User ID.
|
|
370
|
+
* @param {string} params.email - User email.
|
|
371
|
+
* @throws {AppwriteException}
|
|
372
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
373
|
+
*/
|
|
374
|
+
updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
375
|
+
userId: string;
|
|
376
|
+
email: string;
|
|
377
|
+
}): Promise<Models.User<Preferences>>;
|
|
378
|
+
/**
|
|
379
|
+
* Update the user email by its unique ID.
|
|
380
|
+
*
|
|
381
|
+
* @param {string} userId - User ID.
|
|
382
|
+
* @param {string} email - User email.
|
|
156
383
|
* @throws {AppwriteException}
|
|
157
384
|
* @returns {Promise<Models.User<Preferences>>}
|
|
385
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
158
386
|
*/
|
|
159
387
|
updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string): Promise<Models.User<Preferences>>;
|
|
160
388
|
/**
|
|
161
389
|
* Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
|
|
162
390
|
*
|
|
163
|
-
* @param {string} userId
|
|
164
|
-
* @param {string} sessionId
|
|
165
|
-
* @param {number} duration
|
|
391
|
+
* @param {string} params.userId - User ID.
|
|
392
|
+
* @param {string} params.sessionId - Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.
|
|
393
|
+
* @param {number} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
|
|
166
394
|
* @throws {AppwriteException}
|
|
167
395
|
* @returns {Promise<Models.Jwt>}
|
|
168
396
|
*/
|
|
397
|
+
createJWT(params: {
|
|
398
|
+
userId: string;
|
|
399
|
+
sessionId?: string;
|
|
400
|
+
duration?: number;
|
|
401
|
+
}): Promise<Models.Jwt>;
|
|
402
|
+
/**
|
|
403
|
+
* Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
|
|
404
|
+
*
|
|
405
|
+
* @param {string} userId - User ID.
|
|
406
|
+
* @param {string} sessionId - Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.
|
|
407
|
+
* @param {number} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
|
|
408
|
+
* @throws {AppwriteException}
|
|
409
|
+
* @returns {Promise<Models.Jwt>}
|
|
410
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
411
|
+
*/
|
|
169
412
|
createJWT(userId: string, sessionId?: string, duration?: number): Promise<Models.Jwt>;
|
|
170
413
|
/**
|
|
171
414
|
* Update the user labels by its unique ID.
|
|
172
415
|
*
|
|
173
|
-
* Labels can be used to grant access to resources. While teams are a way for user
|
|
416
|
+
* Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.
|
|
174
417
|
*
|
|
175
|
-
* @param {string} userId
|
|
176
|
-
* @param {string[]} labels
|
|
418
|
+
* @param {string} params.userId - User ID.
|
|
419
|
+
* @param {string[]} params.labels - Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
|
|
177
420
|
* @throws {AppwriteException}
|
|
178
421
|
* @returns {Promise<Models.User<Preferences>>}
|
|
179
422
|
*/
|
|
423
|
+
updateLabels<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
424
|
+
userId: string;
|
|
425
|
+
labels: string[];
|
|
426
|
+
}): Promise<Models.User<Preferences>>;
|
|
427
|
+
/**
|
|
428
|
+
* Update the user labels by its unique ID.
|
|
429
|
+
*
|
|
430
|
+
* Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.
|
|
431
|
+
*
|
|
432
|
+
* @param {string} userId - User ID.
|
|
433
|
+
* @param {string[]} labels - Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
|
|
434
|
+
* @throws {AppwriteException}
|
|
435
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
436
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
437
|
+
*/
|
|
180
438
|
updateLabels<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, labels: string[]): Promise<Models.User<Preferences>>;
|
|
181
439
|
/**
|
|
182
440
|
* Get the user activity logs list by its unique ID.
|
|
183
441
|
*
|
|
184
|
-
* @param {string} userId
|
|
185
|
-
* @param {string[]} queries
|
|
442
|
+
* @param {string} params.userId - User ID.
|
|
443
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
444
|
+
* @throws {AppwriteException}
|
|
445
|
+
* @returns {Promise<Models.LogList>}
|
|
446
|
+
*/
|
|
447
|
+
listLogs(params: {
|
|
448
|
+
userId: string;
|
|
449
|
+
queries?: string[];
|
|
450
|
+
}): Promise<Models.LogList>;
|
|
451
|
+
/**
|
|
452
|
+
* Get the user activity logs list by its unique ID.
|
|
453
|
+
*
|
|
454
|
+
* @param {string} userId - User ID.
|
|
455
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
186
456
|
* @throws {AppwriteException}
|
|
187
457
|
* @returns {Promise<Models.LogList>}
|
|
458
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
188
459
|
*/
|
|
189
460
|
listLogs(userId: string, queries?: string[]): Promise<Models.LogList>;
|
|
190
461
|
/**
|
|
191
462
|
* Get the user membership list by its unique ID.
|
|
192
463
|
*
|
|
193
|
-
* @param {string} userId
|
|
194
|
-
* @param {string[]} queries
|
|
195
|
-
* @param {string} search
|
|
464
|
+
* @param {string} params.userId - User ID.
|
|
465
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
|
|
466
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
196
467
|
* @throws {AppwriteException}
|
|
197
468
|
* @returns {Promise<Models.MembershipList>}
|
|
198
469
|
*/
|
|
470
|
+
listMemberships(params: {
|
|
471
|
+
userId: string;
|
|
472
|
+
queries?: string[];
|
|
473
|
+
search?: string;
|
|
474
|
+
}): Promise<Models.MembershipList>;
|
|
475
|
+
/**
|
|
476
|
+
* Get the user membership list by its unique ID.
|
|
477
|
+
*
|
|
478
|
+
* @param {string} userId - User ID.
|
|
479
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
|
|
480
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
481
|
+
* @throws {AppwriteException}
|
|
482
|
+
* @returns {Promise<Models.MembershipList>}
|
|
483
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
484
|
+
*/
|
|
199
485
|
listMemberships(userId: string, queries?: string[], search?: string): Promise<Models.MembershipList>;
|
|
200
486
|
/**
|
|
201
487
|
* Enable or disable MFA on a user account.
|
|
202
488
|
*
|
|
203
|
-
* @param {string} userId
|
|
204
|
-
* @param {boolean} mfa
|
|
489
|
+
* @param {string} params.userId - User ID.
|
|
490
|
+
* @param {boolean} params.mfa - Enable or disable MFA.
|
|
491
|
+
* @throws {AppwriteException}
|
|
492
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
493
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.updateMFA` instead.
|
|
494
|
+
*/
|
|
495
|
+
updateMfa<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
496
|
+
userId: string;
|
|
497
|
+
mfa: boolean;
|
|
498
|
+
}): Promise<Models.User<Preferences>>;
|
|
499
|
+
/**
|
|
500
|
+
* Enable or disable MFA on a user account.
|
|
501
|
+
*
|
|
502
|
+
* @param {string} userId - User ID.
|
|
503
|
+
* @param {boolean} mfa - Enable or disable MFA.
|
|
205
504
|
* @throws {AppwriteException}
|
|
206
505
|
* @returns {Promise<Models.User<Preferences>>}
|
|
506
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
207
507
|
*/
|
|
208
508
|
updateMfa<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>>;
|
|
509
|
+
/**
|
|
510
|
+
* Enable or disable MFA on a user account.
|
|
511
|
+
*
|
|
512
|
+
* @param {string} params.userId - User ID.
|
|
513
|
+
* @param {boolean} params.mfa - Enable or disable MFA.
|
|
514
|
+
* @throws {AppwriteException}
|
|
515
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
516
|
+
*/
|
|
517
|
+
updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
518
|
+
userId: string;
|
|
519
|
+
mfa: boolean;
|
|
520
|
+
}): Promise<Models.User<Preferences>>;
|
|
521
|
+
/**
|
|
522
|
+
* Enable or disable MFA on a user account.
|
|
523
|
+
*
|
|
524
|
+
* @param {string} userId - User ID.
|
|
525
|
+
* @param {boolean} mfa - Enable or disable MFA.
|
|
526
|
+
* @throws {AppwriteException}
|
|
527
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
528
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
529
|
+
*/
|
|
530
|
+
updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>>;
|
|
531
|
+
/**
|
|
532
|
+
* Delete an authenticator app.
|
|
533
|
+
*
|
|
534
|
+
* @param {string} params.userId - User ID.
|
|
535
|
+
* @param {AuthenticatorType} params.type - Type of authenticator.
|
|
536
|
+
* @throws {AppwriteException}
|
|
537
|
+
* @returns {Promise<{}>}
|
|
538
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.deleteMFAAuthenticator` instead.
|
|
539
|
+
*/
|
|
540
|
+
deleteMfaAuthenticator(params: {
|
|
541
|
+
userId: string;
|
|
542
|
+
type: AuthenticatorType;
|
|
543
|
+
}): Promise<{}>;
|
|
209
544
|
/**
|
|
210
545
|
* Delete an authenticator app.
|
|
211
546
|
*
|
|
212
|
-
* @param {string} userId
|
|
213
|
-
* @param {AuthenticatorType} type
|
|
547
|
+
* @param {string} userId - User ID.
|
|
548
|
+
* @param {AuthenticatorType} type - Type of authenticator.
|
|
214
549
|
* @throws {AppwriteException}
|
|
215
550
|
* @returns {Promise<{}>}
|
|
551
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
216
552
|
*/
|
|
217
553
|
deleteMfaAuthenticator(userId: string, type: AuthenticatorType): Promise<{}>;
|
|
554
|
+
/**
|
|
555
|
+
* Delete an authenticator app.
|
|
556
|
+
*
|
|
557
|
+
* @param {string} params.userId - User ID.
|
|
558
|
+
* @param {AuthenticatorType} params.type - Type of authenticator.
|
|
559
|
+
* @throws {AppwriteException}
|
|
560
|
+
* @returns {Promise<{}>}
|
|
561
|
+
*/
|
|
562
|
+
deleteMFAAuthenticator(params: {
|
|
563
|
+
userId: string;
|
|
564
|
+
type: AuthenticatorType;
|
|
565
|
+
}): Promise<{}>;
|
|
566
|
+
/**
|
|
567
|
+
* Delete an authenticator app.
|
|
568
|
+
*
|
|
569
|
+
* @param {string} userId - User ID.
|
|
570
|
+
* @param {AuthenticatorType} type - Type of authenticator.
|
|
571
|
+
* @throws {AppwriteException}
|
|
572
|
+
* @returns {Promise<{}>}
|
|
573
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
574
|
+
*/
|
|
575
|
+
deleteMFAAuthenticator(userId: string, type: AuthenticatorType): Promise<{}>;
|
|
576
|
+
/**
|
|
577
|
+
* List the factors available on the account to be used as a MFA challange.
|
|
578
|
+
*
|
|
579
|
+
* @param {string} params.userId - User ID.
|
|
580
|
+
* @throws {AppwriteException}
|
|
581
|
+
* @returns {Promise<Models.MfaFactors>}
|
|
582
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.listMFAFactors` instead.
|
|
583
|
+
*/
|
|
584
|
+
listMfaFactors(params: {
|
|
585
|
+
userId: string;
|
|
586
|
+
}): Promise<Models.MfaFactors>;
|
|
218
587
|
/**
|
|
219
588
|
* List the factors available on the account to be used as a MFA challange.
|
|
220
589
|
*
|
|
221
|
-
* @param {string} userId
|
|
590
|
+
* @param {string} userId - User ID.
|
|
222
591
|
* @throws {AppwriteException}
|
|
223
592
|
* @returns {Promise<Models.MfaFactors>}
|
|
593
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
224
594
|
*/
|
|
225
595
|
listMfaFactors(userId: string): Promise<Models.MfaFactors>;
|
|
596
|
+
/**
|
|
597
|
+
* List the factors available on the account to be used as a MFA challange.
|
|
598
|
+
*
|
|
599
|
+
* @param {string} params.userId - User ID.
|
|
600
|
+
* @throws {AppwriteException}
|
|
601
|
+
* @returns {Promise<Models.MfaFactors>}
|
|
602
|
+
*/
|
|
603
|
+
listMFAFactors(params: {
|
|
604
|
+
userId: string;
|
|
605
|
+
}): Promise<Models.MfaFactors>;
|
|
606
|
+
/**
|
|
607
|
+
* List the factors available on the account to be used as a MFA challange.
|
|
608
|
+
*
|
|
609
|
+
* @param {string} userId - User ID.
|
|
610
|
+
* @throws {AppwriteException}
|
|
611
|
+
* @returns {Promise<Models.MfaFactors>}
|
|
612
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
613
|
+
*/
|
|
614
|
+
listMFAFactors(userId: string): Promise<Models.MfaFactors>;
|
|
226
615
|
/**
|
|
227
616
|
* Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
228
617
|
*
|
|
229
|
-
* @param {string} userId
|
|
618
|
+
* @param {string} params.userId - User ID.
|
|
230
619
|
* @throws {AppwriteException}
|
|
231
620
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
621
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.getMFARecoveryCodes` instead.
|
|
622
|
+
*/
|
|
623
|
+
getMfaRecoveryCodes(params: {
|
|
624
|
+
userId: string;
|
|
625
|
+
}): Promise<Models.MfaRecoveryCodes>;
|
|
626
|
+
/**
|
|
627
|
+
* Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
628
|
+
*
|
|
629
|
+
* @param {string} userId - User ID.
|
|
630
|
+
* @throws {AppwriteException}
|
|
631
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
632
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
232
633
|
*/
|
|
233
634
|
getMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
|
|
635
|
+
/**
|
|
636
|
+
* Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
637
|
+
*
|
|
638
|
+
* @param {string} params.userId - User ID.
|
|
639
|
+
* @throws {AppwriteException}
|
|
640
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
641
|
+
*/
|
|
642
|
+
getMFARecoveryCodes(params: {
|
|
643
|
+
userId: string;
|
|
644
|
+
}): Promise<Models.MfaRecoveryCodes>;
|
|
645
|
+
/**
|
|
646
|
+
* Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
647
|
+
*
|
|
648
|
+
* @param {string} userId - User ID.
|
|
649
|
+
* @throws {AppwriteException}
|
|
650
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
651
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
652
|
+
*/
|
|
653
|
+
getMFARecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
|
|
234
654
|
/**
|
|
235
655
|
* Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
236
656
|
*
|
|
237
|
-
* @param {string} userId
|
|
657
|
+
* @param {string} params.userId - User ID.
|
|
238
658
|
* @throws {AppwriteException}
|
|
239
659
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
660
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.updateMFARecoveryCodes` instead.
|
|
661
|
+
*/
|
|
662
|
+
updateMfaRecoveryCodes(params: {
|
|
663
|
+
userId: string;
|
|
664
|
+
}): Promise<Models.MfaRecoveryCodes>;
|
|
665
|
+
/**
|
|
666
|
+
* Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
667
|
+
*
|
|
668
|
+
* @param {string} userId - User ID.
|
|
669
|
+
* @throws {AppwriteException}
|
|
670
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
671
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
240
672
|
*/
|
|
241
673
|
updateMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
|
|
674
|
+
/**
|
|
675
|
+
* Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
676
|
+
*
|
|
677
|
+
* @param {string} params.userId - User ID.
|
|
678
|
+
* @throws {AppwriteException}
|
|
679
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
680
|
+
*/
|
|
681
|
+
updateMFARecoveryCodes(params: {
|
|
682
|
+
userId: string;
|
|
683
|
+
}): Promise<Models.MfaRecoveryCodes>;
|
|
684
|
+
/**
|
|
685
|
+
* Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
686
|
+
*
|
|
687
|
+
* @param {string} userId - User ID.
|
|
688
|
+
* @throws {AppwriteException}
|
|
689
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
690
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
691
|
+
*/
|
|
692
|
+
updateMFARecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
|
|
693
|
+
/**
|
|
694
|
+
* Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.
|
|
695
|
+
*
|
|
696
|
+
* @param {string} params.userId - User ID.
|
|
697
|
+
* @throws {AppwriteException}
|
|
698
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
699
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.createMFARecoveryCodes` instead.
|
|
700
|
+
*/
|
|
701
|
+
createMfaRecoveryCodes(params: {
|
|
702
|
+
userId: string;
|
|
703
|
+
}): Promise<Models.MfaRecoveryCodes>;
|
|
242
704
|
/**
|
|
243
705
|
* Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.
|
|
244
706
|
*
|
|
245
|
-
* @param {string} userId
|
|
707
|
+
* @param {string} userId - User ID.
|
|
246
708
|
* @throws {AppwriteException}
|
|
247
709
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
710
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
248
711
|
*/
|
|
249
712
|
createMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
|
|
713
|
+
/**
|
|
714
|
+
* Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.
|
|
715
|
+
*
|
|
716
|
+
* @param {string} params.userId - User ID.
|
|
717
|
+
* @throws {AppwriteException}
|
|
718
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
719
|
+
*/
|
|
720
|
+
createMFARecoveryCodes(params: {
|
|
721
|
+
userId: string;
|
|
722
|
+
}): Promise<Models.MfaRecoveryCodes>;
|
|
723
|
+
/**
|
|
724
|
+
* Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.
|
|
725
|
+
*
|
|
726
|
+
* @param {string} userId - User ID.
|
|
727
|
+
* @throws {AppwriteException}
|
|
728
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
729
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
730
|
+
*/
|
|
731
|
+
createMFARecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
|
|
732
|
+
/**
|
|
733
|
+
* Update the user name by its unique ID.
|
|
734
|
+
*
|
|
735
|
+
* @param {string} params.userId - User ID.
|
|
736
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
737
|
+
* @throws {AppwriteException}
|
|
738
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
739
|
+
*/
|
|
740
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
741
|
+
userId: string;
|
|
742
|
+
name: string;
|
|
743
|
+
}): Promise<Models.User<Preferences>>;
|
|
250
744
|
/**
|
|
251
745
|
* Update the user name by its unique ID.
|
|
252
746
|
*
|
|
253
|
-
* @param {string} userId
|
|
254
|
-
* @param {string} name
|
|
747
|
+
* @param {string} userId - User ID.
|
|
748
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
255
749
|
* @throws {AppwriteException}
|
|
256
750
|
* @returns {Promise<Models.User<Preferences>>}
|
|
751
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
257
752
|
*/
|
|
258
753
|
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, name: string): Promise<Models.User<Preferences>>;
|
|
259
754
|
/**
|
|
260
755
|
* Update the user password by its unique ID.
|
|
261
756
|
*
|
|
262
|
-
* @param {string} userId
|
|
263
|
-
* @param {string} password
|
|
757
|
+
* @param {string} params.userId - User ID.
|
|
758
|
+
* @param {string} params.password - New user password. Must be at least 8 chars.
|
|
759
|
+
* @throws {AppwriteException}
|
|
760
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
761
|
+
*/
|
|
762
|
+
updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
763
|
+
userId: string;
|
|
764
|
+
password: string;
|
|
765
|
+
}): Promise<Models.User<Preferences>>;
|
|
766
|
+
/**
|
|
767
|
+
* Update the user password by its unique ID.
|
|
768
|
+
*
|
|
769
|
+
* @param {string} userId - User ID.
|
|
770
|
+
* @param {string} password - New user password. Must be at least 8 chars.
|
|
264
771
|
* @throws {AppwriteException}
|
|
265
772
|
* @returns {Promise<Models.User<Preferences>>}
|
|
773
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
266
774
|
*/
|
|
267
775
|
updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, password: string): Promise<Models.User<Preferences>>;
|
|
268
776
|
/**
|
|
269
777
|
* Update the user phone by its unique ID.
|
|
270
778
|
*
|
|
271
|
-
* @param {string} userId
|
|
272
|
-
* @param {string} number
|
|
779
|
+
* @param {string} params.userId - User ID.
|
|
780
|
+
* @param {string} params.number - User phone number.
|
|
781
|
+
* @throws {AppwriteException}
|
|
782
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
783
|
+
*/
|
|
784
|
+
updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
785
|
+
userId: string;
|
|
786
|
+
number: string;
|
|
787
|
+
}): Promise<Models.User<Preferences>>;
|
|
788
|
+
/**
|
|
789
|
+
* Update the user phone by its unique ID.
|
|
790
|
+
*
|
|
791
|
+
* @param {string} userId - User ID.
|
|
792
|
+
* @param {string} number - User phone number.
|
|
273
793
|
* @throws {AppwriteException}
|
|
274
794
|
* @returns {Promise<Models.User<Preferences>>}
|
|
795
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
275
796
|
*/
|
|
276
797
|
updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, number: string): Promise<Models.User<Preferences>>;
|
|
277
798
|
/**
|
|
278
799
|
* Get the user preferences by its unique ID.
|
|
279
800
|
*
|
|
280
|
-
* @param {string} userId
|
|
801
|
+
* @param {string} params.userId - User ID.
|
|
281
802
|
* @throws {AppwriteException}
|
|
282
803
|
* @returns {Promise<Preferences>}
|
|
283
804
|
*/
|
|
805
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
806
|
+
userId: string;
|
|
807
|
+
}): Promise<Preferences>;
|
|
808
|
+
/**
|
|
809
|
+
* Get the user preferences by its unique ID.
|
|
810
|
+
*
|
|
811
|
+
* @param {string} userId - User ID.
|
|
812
|
+
* @throws {AppwriteException}
|
|
813
|
+
* @returns {Promise<Preferences>}
|
|
814
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
815
|
+
*/
|
|
284
816
|
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string): Promise<Preferences>;
|
|
285
817
|
/**
|
|
286
818
|
* Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
|
|
287
819
|
*
|
|
288
|
-
* @param {string} userId
|
|
289
|
-
* @param {object} prefs
|
|
820
|
+
* @param {string} params.userId - User ID.
|
|
821
|
+
* @param {object} params.prefs - Prefs key-value JSON object.
|
|
290
822
|
* @throws {AppwriteException}
|
|
291
823
|
* @returns {Promise<Preferences>}
|
|
292
824
|
*/
|
|
825
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
826
|
+
userId: string;
|
|
827
|
+
prefs: object;
|
|
828
|
+
}): Promise<Preferences>;
|
|
829
|
+
/**
|
|
830
|
+
* Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
|
|
831
|
+
*
|
|
832
|
+
* @param {string} userId - User ID.
|
|
833
|
+
* @param {object} prefs - Prefs key-value JSON object.
|
|
834
|
+
* @throws {AppwriteException}
|
|
835
|
+
* @returns {Promise<Preferences>}
|
|
836
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
837
|
+
*/
|
|
293
838
|
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, prefs: object): Promise<Preferences>;
|
|
294
839
|
/**
|
|
295
840
|
* Get the user sessions list by its unique ID.
|
|
296
841
|
*
|
|
297
|
-
* @param {string} userId
|
|
842
|
+
* @param {string} params.userId - User ID.
|
|
843
|
+
* @throws {AppwriteException}
|
|
844
|
+
* @returns {Promise<Models.SessionList>}
|
|
845
|
+
*/
|
|
846
|
+
listSessions(params: {
|
|
847
|
+
userId: string;
|
|
848
|
+
}): Promise<Models.SessionList>;
|
|
849
|
+
/**
|
|
850
|
+
* Get the user sessions list by its unique ID.
|
|
851
|
+
*
|
|
852
|
+
* @param {string} userId - User ID.
|
|
298
853
|
* @throws {AppwriteException}
|
|
299
854
|
* @returns {Promise<Models.SessionList>}
|
|
855
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
300
856
|
*/
|
|
301
857
|
listSessions(userId: string): Promise<Models.SessionList>;
|
|
302
858
|
/**
|
|
@@ -304,116 +860,287 @@ declare class Users {
|
|
|
304
860
|
*
|
|
305
861
|
* If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.
|
|
306
862
|
*
|
|
307
|
-
* @param {string} userId
|
|
863
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
864
|
+
* @throws {AppwriteException}
|
|
865
|
+
* @returns {Promise<Models.Session>}
|
|
866
|
+
*/
|
|
867
|
+
createSession(params: {
|
|
868
|
+
userId: string;
|
|
869
|
+
}): Promise<Models.Session>;
|
|
870
|
+
/**
|
|
871
|
+
* Creates a session for a user. Returns an immediately usable session object.
|
|
872
|
+
*
|
|
873
|
+
* If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.
|
|
874
|
+
*
|
|
875
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
308
876
|
* @throws {AppwriteException}
|
|
309
877
|
* @returns {Promise<Models.Session>}
|
|
878
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
310
879
|
*/
|
|
311
880
|
createSession(userId: string): Promise<Models.Session>;
|
|
312
881
|
/**
|
|
313
|
-
* Delete all user
|
|
882
|
+
* Delete all user's sessions by using the user's unique ID.
|
|
883
|
+
*
|
|
884
|
+
* @param {string} params.userId - User ID.
|
|
885
|
+
* @throws {AppwriteException}
|
|
886
|
+
* @returns {Promise<{}>}
|
|
887
|
+
*/
|
|
888
|
+
deleteSessions(params: {
|
|
889
|
+
userId: string;
|
|
890
|
+
}): Promise<{}>;
|
|
891
|
+
/**
|
|
892
|
+
* Delete all user's sessions by using the user's unique ID.
|
|
314
893
|
*
|
|
315
|
-
* @param {string} userId
|
|
894
|
+
* @param {string} userId - User ID.
|
|
316
895
|
* @throws {AppwriteException}
|
|
317
896
|
* @returns {Promise<{}>}
|
|
897
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
318
898
|
*/
|
|
319
899
|
deleteSessions(userId: string): Promise<{}>;
|
|
320
900
|
/**
|
|
321
901
|
* Delete a user sessions by its unique ID.
|
|
322
902
|
*
|
|
323
|
-
* @param {string} userId
|
|
324
|
-
* @param {string} sessionId
|
|
903
|
+
* @param {string} params.userId - User ID.
|
|
904
|
+
* @param {string} params.sessionId - Session ID.
|
|
905
|
+
* @throws {AppwriteException}
|
|
906
|
+
* @returns {Promise<{}>}
|
|
907
|
+
*/
|
|
908
|
+
deleteSession(params: {
|
|
909
|
+
userId: string;
|
|
910
|
+
sessionId: string;
|
|
911
|
+
}): Promise<{}>;
|
|
912
|
+
/**
|
|
913
|
+
* Delete a user sessions by its unique ID.
|
|
914
|
+
*
|
|
915
|
+
* @param {string} userId - User ID.
|
|
916
|
+
* @param {string} sessionId - Session ID.
|
|
325
917
|
* @throws {AppwriteException}
|
|
326
918
|
* @returns {Promise<{}>}
|
|
919
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
327
920
|
*/
|
|
328
921
|
deleteSession(userId: string, sessionId: string): Promise<{}>;
|
|
329
922
|
/**
|
|
330
|
-
* Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user
|
|
923
|
+
* Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.
|
|
924
|
+
*
|
|
925
|
+
* @param {string} params.userId - User ID.
|
|
926
|
+
* @param {boolean} params.status - User Status. To activate the user pass `true` and to block the user pass `false`.
|
|
927
|
+
* @throws {AppwriteException}
|
|
928
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
929
|
+
*/
|
|
930
|
+
updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
931
|
+
userId: string;
|
|
932
|
+
status: boolean;
|
|
933
|
+
}): Promise<Models.User<Preferences>>;
|
|
934
|
+
/**
|
|
935
|
+
* Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.
|
|
331
936
|
*
|
|
332
|
-
* @param {string} userId
|
|
333
|
-
* @param {boolean} status
|
|
937
|
+
* @param {string} userId - User ID.
|
|
938
|
+
* @param {boolean} status - User Status. To activate the user pass `true` and to block the user pass `false`.
|
|
334
939
|
* @throws {AppwriteException}
|
|
335
940
|
* @returns {Promise<Models.User<Preferences>>}
|
|
941
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
336
942
|
*/
|
|
337
943
|
updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, status: boolean): Promise<Models.User<Preferences>>;
|
|
338
944
|
/**
|
|
339
945
|
* List the messaging targets that are associated with a user.
|
|
340
946
|
*
|
|
341
|
-
* @param {string} userId
|
|
342
|
-
* @param {string[]} queries
|
|
947
|
+
* @param {string} params.userId - User ID.
|
|
948
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType
|
|
949
|
+
* @throws {AppwriteException}
|
|
950
|
+
* @returns {Promise<Models.TargetList>}
|
|
951
|
+
*/
|
|
952
|
+
listTargets(params: {
|
|
953
|
+
userId: string;
|
|
954
|
+
queries?: string[];
|
|
955
|
+
}): Promise<Models.TargetList>;
|
|
956
|
+
/**
|
|
957
|
+
* List the messaging targets that are associated with a user.
|
|
958
|
+
*
|
|
959
|
+
* @param {string} userId - User ID.
|
|
960
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType
|
|
343
961
|
* @throws {AppwriteException}
|
|
344
962
|
* @returns {Promise<Models.TargetList>}
|
|
963
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
345
964
|
*/
|
|
346
965
|
listTargets(userId: string, queries?: string[]): Promise<Models.TargetList>;
|
|
347
966
|
/**
|
|
348
967
|
* Create a messaging target.
|
|
349
968
|
*
|
|
350
|
-
* @param {string} userId
|
|
351
|
-
* @param {string} targetId
|
|
352
|
-
* @param {MessagingProviderType} providerType
|
|
353
|
-
* @param {string} identifier
|
|
354
|
-
* @param {string} providerId
|
|
355
|
-
* @param {string} name
|
|
969
|
+
* @param {string} params.userId - User ID.
|
|
970
|
+
* @param {string} params.targetId - Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
971
|
+
* @param {MessagingProviderType} params.providerType - The target provider type. Can be one of the following: `email`, `sms` or `push`.
|
|
972
|
+
* @param {string} params.identifier - The target identifier (token, email, phone etc.)
|
|
973
|
+
* @param {string} params.providerId - Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
|
|
974
|
+
* @param {string} params.name - Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
|
|
975
|
+
* @throws {AppwriteException}
|
|
976
|
+
* @returns {Promise<Models.Target>}
|
|
977
|
+
*/
|
|
978
|
+
createTarget(params: {
|
|
979
|
+
userId: string;
|
|
980
|
+
targetId: string;
|
|
981
|
+
providerType: MessagingProviderType;
|
|
982
|
+
identifier: string;
|
|
983
|
+
providerId?: string;
|
|
984
|
+
name?: string;
|
|
985
|
+
}): Promise<Models.Target>;
|
|
986
|
+
/**
|
|
987
|
+
* Create a messaging target.
|
|
988
|
+
*
|
|
989
|
+
* @param {string} userId - User ID.
|
|
990
|
+
* @param {string} targetId - Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
991
|
+
* @param {MessagingProviderType} providerType - The target provider type. Can be one of the following: `email`, `sms` or `push`.
|
|
992
|
+
* @param {string} identifier - The target identifier (token, email, phone etc.)
|
|
993
|
+
* @param {string} providerId - Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
|
|
994
|
+
* @param {string} name - Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
|
|
356
995
|
* @throws {AppwriteException}
|
|
357
996
|
* @returns {Promise<Models.Target>}
|
|
997
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
358
998
|
*/
|
|
359
999
|
createTarget(userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string): Promise<Models.Target>;
|
|
360
1000
|
/**
|
|
361
|
-
* Get a user
|
|
1001
|
+
* Get a user's push notification target by ID.
|
|
1002
|
+
*
|
|
1003
|
+
* @param {string} params.userId - User ID.
|
|
1004
|
+
* @param {string} params.targetId - Target ID.
|
|
1005
|
+
* @throws {AppwriteException}
|
|
1006
|
+
* @returns {Promise<Models.Target>}
|
|
1007
|
+
*/
|
|
1008
|
+
getTarget(params: {
|
|
1009
|
+
userId: string;
|
|
1010
|
+
targetId: string;
|
|
1011
|
+
}): Promise<Models.Target>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Get a user's push notification target by ID.
|
|
362
1014
|
*
|
|
363
|
-
* @param {string} userId
|
|
364
|
-
* @param {string} targetId
|
|
1015
|
+
* @param {string} userId - User ID.
|
|
1016
|
+
* @param {string} targetId - Target ID.
|
|
365
1017
|
* @throws {AppwriteException}
|
|
366
1018
|
* @returns {Promise<Models.Target>}
|
|
1019
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
367
1020
|
*/
|
|
368
1021
|
getTarget(userId: string, targetId: string): Promise<Models.Target>;
|
|
369
1022
|
/**
|
|
370
1023
|
* Update a messaging target.
|
|
371
1024
|
*
|
|
372
|
-
* @param {string} userId
|
|
373
|
-
* @param {string} targetId
|
|
374
|
-
* @param {string} identifier
|
|
375
|
-
* @param {string} providerId
|
|
376
|
-
* @param {string} name
|
|
1025
|
+
* @param {string} params.userId - User ID.
|
|
1026
|
+
* @param {string} params.targetId - Target ID.
|
|
1027
|
+
* @param {string} params.identifier - The target identifier (token, email, phone etc.)
|
|
1028
|
+
* @param {string} params.providerId - Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
|
|
1029
|
+
* @param {string} params.name - Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
|
|
1030
|
+
* @throws {AppwriteException}
|
|
1031
|
+
* @returns {Promise<Models.Target>}
|
|
1032
|
+
*/
|
|
1033
|
+
updateTarget(params: {
|
|
1034
|
+
userId: string;
|
|
1035
|
+
targetId: string;
|
|
1036
|
+
identifier?: string;
|
|
1037
|
+
providerId?: string;
|
|
1038
|
+
name?: string;
|
|
1039
|
+
}): Promise<Models.Target>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Update a messaging target.
|
|
1042
|
+
*
|
|
1043
|
+
* @param {string} userId - User ID.
|
|
1044
|
+
* @param {string} targetId - Target ID.
|
|
1045
|
+
* @param {string} identifier - The target identifier (token, email, phone etc.)
|
|
1046
|
+
* @param {string} providerId - Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
|
|
1047
|
+
* @param {string} name - Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
|
|
377
1048
|
* @throws {AppwriteException}
|
|
378
1049
|
* @returns {Promise<Models.Target>}
|
|
1050
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
379
1051
|
*/
|
|
380
1052
|
updateTarget(userId: string, targetId: string, identifier?: string, providerId?: string, name?: string): Promise<Models.Target>;
|
|
381
1053
|
/**
|
|
382
1054
|
* Delete a messaging target.
|
|
383
1055
|
*
|
|
384
|
-
* @param {string} userId
|
|
385
|
-
* @param {string} targetId
|
|
1056
|
+
* @param {string} params.userId - User ID.
|
|
1057
|
+
* @param {string} params.targetId - Target ID.
|
|
1058
|
+
* @throws {AppwriteException}
|
|
1059
|
+
* @returns {Promise<{}>}
|
|
1060
|
+
*/
|
|
1061
|
+
deleteTarget(params: {
|
|
1062
|
+
userId: string;
|
|
1063
|
+
targetId: string;
|
|
1064
|
+
}): Promise<{}>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Delete a messaging target.
|
|
1067
|
+
*
|
|
1068
|
+
* @param {string} userId - User ID.
|
|
1069
|
+
* @param {string} targetId - Target ID.
|
|
386
1070
|
* @throws {AppwriteException}
|
|
387
1071
|
* @returns {Promise<{}>}
|
|
1072
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
388
1073
|
*/
|
|
389
1074
|
deleteTarget(userId: string, targetId: string): Promise<{}>;
|
|
390
1075
|
/**
|
|
391
1076
|
* Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process.
|
|
392
1077
|
*
|
|
393
1078
|
*
|
|
394
|
-
* @param {string} userId
|
|
395
|
-
* @param {number} length
|
|
396
|
-
* @param {number} expire
|
|
1079
|
+
* @param {string} params.userId - User ID.
|
|
1080
|
+
* @param {number} params.length - Token length in characters. The default length is 6 characters
|
|
1081
|
+
* @param {number} params.expire - Token expiration period in seconds. The default expiration is 15 minutes.
|
|
1082
|
+
* @throws {AppwriteException}
|
|
1083
|
+
* @returns {Promise<Models.Token>}
|
|
1084
|
+
*/
|
|
1085
|
+
createToken(params: {
|
|
1086
|
+
userId: string;
|
|
1087
|
+
length?: number;
|
|
1088
|
+
expire?: number;
|
|
1089
|
+
}): Promise<Models.Token>;
|
|
1090
|
+
/**
|
|
1091
|
+
* Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process.
|
|
1092
|
+
*
|
|
1093
|
+
*
|
|
1094
|
+
* @param {string} userId - User ID.
|
|
1095
|
+
* @param {number} length - Token length in characters. The default length is 6 characters
|
|
1096
|
+
* @param {number} expire - Token expiration period in seconds. The default expiration is 15 minutes.
|
|
397
1097
|
* @throws {AppwriteException}
|
|
398
1098
|
* @returns {Promise<Models.Token>}
|
|
1099
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
399
1100
|
*/
|
|
400
1101
|
createToken(userId: string, length?: number, expire?: number): Promise<Models.Token>;
|
|
401
1102
|
/**
|
|
402
1103
|
* Update the user email verification status by its unique ID.
|
|
403
1104
|
*
|
|
404
|
-
* @param {string} userId
|
|
405
|
-
* @param {boolean} emailVerification
|
|
1105
|
+
* @param {string} params.userId - User ID.
|
|
1106
|
+
* @param {boolean} params.emailVerification - User email verification status.
|
|
1107
|
+
* @throws {AppwriteException}
|
|
1108
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1109
|
+
*/
|
|
1110
|
+
updateEmailVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
1111
|
+
userId: string;
|
|
1112
|
+
emailVerification: boolean;
|
|
1113
|
+
}): Promise<Models.User<Preferences>>;
|
|
1114
|
+
/**
|
|
1115
|
+
* Update the user email verification status by its unique ID.
|
|
1116
|
+
*
|
|
1117
|
+
* @param {string} userId - User ID.
|
|
1118
|
+
* @param {boolean} emailVerification - User email verification status.
|
|
406
1119
|
* @throws {AppwriteException}
|
|
407
1120
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1121
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
408
1122
|
*/
|
|
409
1123
|
updateEmailVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>>;
|
|
410
1124
|
/**
|
|
411
1125
|
* Update the user phone verification status by its unique ID.
|
|
412
1126
|
*
|
|
413
|
-
* @param {string} userId
|
|
414
|
-
* @param {boolean} phoneVerification
|
|
1127
|
+
* @param {string} params.userId - User ID.
|
|
1128
|
+
* @param {boolean} params.phoneVerification - User phone verification status.
|
|
1129
|
+
* @throws {AppwriteException}
|
|
1130
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1131
|
+
*/
|
|
1132
|
+
updatePhoneVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
1133
|
+
userId: string;
|
|
1134
|
+
phoneVerification: boolean;
|
|
1135
|
+
}): Promise<Models.User<Preferences>>;
|
|
1136
|
+
/**
|
|
1137
|
+
* Update the user phone verification status by its unique ID.
|
|
1138
|
+
*
|
|
1139
|
+
* @param {string} userId - User ID.
|
|
1140
|
+
* @param {boolean} phoneVerification - User phone verification status.
|
|
415
1141
|
* @throws {AppwriteException}
|
|
416
1142
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1143
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
417
1144
|
*/
|
|
418
1145
|
updatePhoneVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences>>;
|
|
419
1146
|
}
|