node-appwrite 17.0.0 → 17.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +1 -1
  2. package/dist/client.js +6 -5
  3. package/dist/client.js.map +1 -1
  4. package/dist/client.mjs +6 -5
  5. package/dist/client.mjs.map +1 -1
  6. package/dist/enums/build-runtime.d.mts +3 -1
  7. package/dist/enums/build-runtime.d.ts +3 -1
  8. package/dist/enums/build-runtime.js +2 -0
  9. package/dist/enums/build-runtime.js.map +1 -1
  10. package/dist/enums/build-runtime.mjs +2 -0
  11. package/dist/enums/build-runtime.mjs.map +1 -1
  12. package/dist/enums/image-format.d.mts +2 -1
  13. package/dist/enums/image-format.d.ts +2 -1
  14. package/dist/enums/image-format.js +1 -0
  15. package/dist/enums/image-format.js.map +1 -1
  16. package/dist/enums/image-format.mjs +1 -0
  17. package/dist/enums/image-format.mjs.map +1 -1
  18. package/dist/enums/runtime.d.mts +3 -1
  19. package/dist/enums/runtime.d.ts +3 -1
  20. package/dist/enums/runtime.js +2 -0
  21. package/dist/enums/runtime.js.map +1 -1
  22. package/dist/enums/runtime.mjs +2 -0
  23. package/dist/enums/runtime.mjs.map +1 -1
  24. package/dist/models.d.mts +122 -97
  25. package/dist/models.d.ts +122 -97
  26. package/dist/services/account.d.mts +31 -31
  27. package/dist/services/account.d.ts +31 -31
  28. package/dist/services/account.js +81 -81
  29. package/dist/services/account.js.map +1 -1
  30. package/dist/services/account.mjs +81 -81
  31. package/dist/services/account.mjs.map +1 -1
  32. package/dist/services/avatars.d.mts +20 -20
  33. package/dist/services/avatars.d.ts +20 -20
  34. package/dist/services/avatars.js +79 -79
  35. package/dist/services/avatars.js.map +1 -1
  36. package/dist/services/avatars.mjs +79 -79
  37. package/dist/services/avatars.mjs.map +1 -1
  38. package/dist/services/databases.d.mts +78 -30
  39. package/dist/services/databases.d.ts +78 -30
  40. package/dist/services/databases.js +395 -251
  41. package/dist/services/databases.js.map +1 -1
  42. package/dist/services/databases.mjs +395 -251
  43. package/dist/services/databases.mjs.map +1 -1
  44. package/dist/services/functions.d.mts +8 -8
  45. package/dist/services/functions.d.ts +8 -8
  46. package/dist/services/functions.js +38 -38
  47. package/dist/services/functions.js.map +1 -1
  48. package/dist/services/functions.mjs +38 -38
  49. package/dist/services/functions.mjs.map +1 -1
  50. package/dist/services/graphql.js.map +1 -1
  51. package/dist/services/graphql.mjs.map +1 -1
  52. package/dist/services/health.d.mts +1 -1
  53. package/dist/services/health.d.ts +1 -1
  54. package/dist/services/health.js +8 -8
  55. package/dist/services/health.js.map +1 -1
  56. package/dist/services/health.mjs +8 -8
  57. package/dist/services/health.mjs.map +1 -1
  58. package/dist/services/locale.d.mts +2 -2
  59. package/dist/services/locale.d.ts +2 -2
  60. package/dist/services/locale.js +7 -7
  61. package/dist/services/locale.js.map +1 -1
  62. package/dist/services/locale.mjs +7 -7
  63. package/dist/services/locale.mjs.map +1 -1
  64. package/dist/services/messaging.d.mts +8 -8
  65. package/dist/services/messaging.d.ts +8 -8
  66. package/dist/services/messaging.js +94 -94
  67. package/dist/services/messaging.js.map +1 -1
  68. package/dist/services/messaging.mjs +94 -94
  69. package/dist/services/messaging.mjs.map +1 -1
  70. package/dist/services/sites.d.mts +4 -4
  71. package/dist/services/sites.d.ts +4 -4
  72. package/dist/services/sites.js +24 -24
  73. package/dist/services/sites.js.map +1 -1
  74. package/dist/services/sites.mjs +24 -24
  75. package/dist/services/sites.mjs.map +1 -1
  76. package/dist/services/storage.d.mts +7 -7
  77. package/dist/services/storage.d.ts +7 -7
  78. package/dist/services/storage.js +16 -16
  79. package/dist/services/storage.js.map +1 -1
  80. package/dist/services/storage.mjs +16 -16
  81. package/dist/services/storage.mjs.map +1 -1
  82. package/dist/services/teams.d.mts +17 -17
  83. package/dist/services/teams.d.ts +17 -17
  84. package/dist/services/teams.js +40 -40
  85. package/dist/services/teams.js.map +1 -1
  86. package/dist/services/teams.mjs +40 -40
  87. package/dist/services/teams.mjs.map +1 -1
  88. package/dist/services/tokens.d.mts +1 -1
  89. package/dist/services/tokens.d.ts +1 -1
  90. package/dist/services/tokens.js +1 -1
  91. package/dist/services/tokens.js.map +1 -1
  92. package/dist/services/tokens.mjs +1 -1
  93. package/dist/services/tokens.mjs.map +1 -1
  94. package/dist/services/users.d.mts +26 -26
  95. package/dist/services/users.d.ts +26 -26
  96. package/dist/services/users.js +26 -26
  97. package/dist/services/users.js.map +1 -1
  98. package/dist/services/users.mjs +26 -26
  99. package/dist/services/users.mjs.map +1 -1
  100. package/package.json +1 -1
@@ -16,7 +16,7 @@ declare class Users {
16
16
  * @throws {AppwriteException}
17
17
  * @returns {Promise<Models.UserList<Preferences>>}
18
18
  */
19
- list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.UserList<Preferences>>;
19
+ list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string): Promise<Models.UserList<Preferences>>;
20
20
  /**
21
21
  * Create a new user.
22
22
  *
@@ -28,7 +28,7 @@ declare class Users {
28
28
  * @throws {AppwriteException}
29
29
  * @returns {Promise<Models.User<Preferences>>}
30
30
  */
31
- create<Preferences extends Models.Preferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences>>;
31
+ create<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences>>;
32
32
  /**
33
33
  * 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
34
  *
@@ -39,7 +39,7 @@ declare class Users {
39
39
  * @throws {AppwriteException}
40
40
  * @returns {Promise<Models.User<Preferences>>}
41
41
  */
42
- createArgon2User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
42
+ createArgon2User<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
43
43
  /**
44
44
  * 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
45
  *
@@ -50,7 +50,7 @@ declare class Users {
50
50
  * @throws {AppwriteException}
51
51
  * @returns {Promise<Models.User<Preferences>>}
52
52
  */
53
- createBcryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
53
+ createBcryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
54
54
  /**
55
55
  * Get identities for all users.
56
56
  *
@@ -78,7 +78,7 @@ declare class Users {
78
78
  * @throws {AppwriteException}
79
79
  * @returns {Promise<Models.User<Preferences>>}
80
80
  */
81
- createMD5User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
81
+ createMD5User<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
82
82
  /**
83
83
  * 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
84
  *
@@ -89,7 +89,7 @@ declare class Users {
89
89
  * @throws {AppwriteException}
90
90
  * @returns {Promise<Models.User<Preferences>>}
91
91
  */
92
- createPHPassUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
92
+ createPHPassUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
93
93
  /**
94
94
  * 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
95
  *
@@ -105,7 +105,7 @@ declare class Users {
105
105
  * @throws {AppwriteException}
106
106
  * @returns {Promise<Models.User<Preferences>>}
107
107
  */
108
- createScryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise<Models.User<Preferences>>;
108
+ 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
109
  /**
110
110
  * 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
111
  *
@@ -119,7 +119,7 @@ declare class Users {
119
119
  * @throws {AppwriteException}
120
120
  * @returns {Promise<Models.User<Preferences>>}
121
121
  */
122
- createScryptModifiedUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise<Models.User<Preferences>>;
122
+ 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
123
  /**
124
124
  * 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
125
  *
@@ -131,7 +131,7 @@ declare class Users {
131
131
  * @throws {AppwriteException}
132
132
  * @returns {Promise<Models.User<Preferences>>}
133
133
  */
134
- createSHAUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string): Promise<Models.User<Preferences>>;
134
+ createSHAUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string): Promise<Models.User<Preferences>>;
135
135
  /**
136
136
  * Get a user by its unique ID.
137
137
  *
@@ -139,7 +139,7 @@ declare class Users {
139
139
  * @throws {AppwriteException}
140
140
  * @returns {Promise<Models.User<Preferences>>}
141
141
  */
142
- get<Preferences extends Models.Preferences>(userId: string): Promise<Models.User<Preferences>>;
142
+ get<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string): Promise<Models.User<Preferences>>;
143
143
  /**
144
144
  * Delete a user by its unique ID, thereby releasing it&#039;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
145
  *
@@ -156,7 +156,7 @@ declare class Users {
156
156
  * @throws {AppwriteException}
157
157
  * @returns {Promise<Models.User<Preferences>>}
158
158
  */
159
- updateEmail<Preferences extends Models.Preferences>(userId: string, email: string): Promise<Models.User<Preferences>>;
159
+ updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string): Promise<Models.User<Preferences>>;
160
160
  /**
161
161
  * 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
162
  *
@@ -169,15 +169,15 @@ declare class Users {
169
169
  createJWT(userId: string, sessionId?: string, duration?: number): Promise<Models.Jwt>;
170
170
  /**
171
171
  * Update the user labels by its unique ID.
172
-
173
- Labels can be used to grant access to resources. While teams are a way for user&#039;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.
172
+ *
173
+ * Labels can be used to grant access to resources. While teams are a way for user&#039;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
174
  *
175
175
  * @param {string} userId
176
176
  * @param {string[]} labels
177
177
  * @throws {AppwriteException}
178
178
  * @returns {Promise<Models.User<Preferences>>}
179
179
  */
180
- updateLabels<Preferences extends Models.Preferences>(userId: string, labels: string[]): Promise<Models.User<Preferences>>;
180
+ updateLabels<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, labels: string[]): Promise<Models.User<Preferences>>;
181
181
  /**
182
182
  * Get the user activity logs list by its unique ID.
183
183
  *
@@ -205,7 +205,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
205
205
  * @throws {AppwriteException}
206
206
  * @returns {Promise<Models.User<Preferences>>}
207
207
  */
208
- updateMfa<Preferences extends Models.Preferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>>;
208
+ updateMfa<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>>;
209
209
  /**
210
210
  * Delete an authenticator app.
211
211
  *
@@ -255,7 +255,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
255
255
  * @throws {AppwriteException}
256
256
  * @returns {Promise<Models.User<Preferences>>}
257
257
  */
258
- updateName<Preferences extends Models.Preferences>(userId: string, name: string): Promise<Models.User<Preferences>>;
258
+ updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, name: string): Promise<Models.User<Preferences>>;
259
259
  /**
260
260
  * Update the user password by its unique ID.
261
261
  *
@@ -264,7 +264,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
264
264
  * @throws {AppwriteException}
265
265
  * @returns {Promise<Models.User<Preferences>>}
266
266
  */
267
- updatePassword<Preferences extends Models.Preferences>(userId: string, password: string): Promise<Models.User<Preferences>>;
267
+ updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, password: string): Promise<Models.User<Preferences>>;
268
268
  /**
269
269
  * Update the user phone by its unique ID.
270
270
  *
@@ -273,7 +273,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
273
273
  * @throws {AppwriteException}
274
274
  * @returns {Promise<Models.User<Preferences>>}
275
275
  */
276
- updatePhone<Preferences extends Models.Preferences>(userId: string, number: string): Promise<Models.User<Preferences>>;
276
+ updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, number: string): Promise<Models.User<Preferences>>;
277
277
  /**
278
278
  * Get the user preferences by its unique ID.
279
279
  *
@@ -281,7 +281,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
281
281
  * @throws {AppwriteException}
282
282
  * @returns {Promise<Preferences>}
283
283
  */
284
- getPrefs<Preferences extends Models.Preferences>(userId: string): Promise<Preferences>;
284
+ getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string): Promise<Preferences>;
285
285
  /**
286
286
  * 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
287
  *
@@ -290,7 +290,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
290
290
  * @throws {AppwriteException}
291
291
  * @returns {Promise<Preferences>}
292
292
  */
293
- updatePrefs<Preferences extends Models.Preferences>(userId: string, prefs: object): Promise<Preferences>;
293
+ updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, prefs: object): Promise<Preferences>;
294
294
  /**
295
295
  * Get the user sessions list by its unique ID.
296
296
  *
@@ -301,8 +301,8 @@ Labels can be used to grant access to resources. While teams are a way for user&
301
301
  listSessions(userId: string): Promise<Models.SessionList>;
302
302
  /**
303
303
  * Creates a session for a user. Returns an immediately usable session object.
304
-
305
- 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.
304
+ *
305
+ * 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
306
  *
307
307
  * @param {string} userId
308
308
  * @throws {AppwriteException}
@@ -334,7 +334,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
334
334
  * @throws {AppwriteException}
335
335
  * @returns {Promise<Models.User<Preferences>>}
336
336
  */
337
- updateStatus<Preferences extends Models.Preferences>(userId: string, status: boolean): Promise<Models.User<Preferences>>;
337
+ updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, status: boolean): Promise<Models.User<Preferences>>;
338
338
  /**
339
339
  * List the messaging targets that are associated with a user.
340
340
  *
@@ -389,7 +389,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
389
389
  deleteTarget(userId: string, targetId: string): Promise<{}>;
390
390
  /**
391
391
  * 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
-
392
+ *
393
393
  *
394
394
  * @param {string} userId
395
395
  * @param {number} length
@@ -406,7 +406,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
406
406
  * @throws {AppwriteException}
407
407
  * @returns {Promise<Models.User<Preferences>>}
408
408
  */
409
- updateEmailVerification<Preferences extends Models.Preferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>>;
409
+ updateEmailVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>>;
410
410
  /**
411
411
  * Update the user phone verification status by its unique ID.
412
412
  *
@@ -415,7 +415,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
415
415
  * @throws {AppwriteException}
416
416
  * @returns {Promise<Models.User<Preferences>>}
417
417
  */
418
- updatePhoneVerification<Preferences extends Models.Preferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences>>;
418
+ updatePhoneVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences>>;
419
419
  }
420
420
 
421
421
  export { Users };
@@ -610,15 +610,15 @@ class Users {
610
610
  );
611
611
  }
612
612
  /**
613
- * Update the user labels by its unique ID.
614
-
615
- Labels can be used to grant access to resources. While teams are a way for user&#039;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.
616
- *
617
- * @param {string} userId
618
- * @param {string[]} labels
619
- * @throws {AppwriteException}
620
- * @returns {Promise<Models.User<Preferences>>}
621
- */
613
+ * Update the user labels by its unique ID.
614
+ *
615
+ * Labels can be used to grant access to resources. While teams are a way for user&#039;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.
616
+ *
617
+ * @param {string} userId
618
+ * @param {string[]} labels
619
+ * @throws {AppwriteException}
620
+ * @returns {Promise<Models.User<Preferences>>}
621
+ */
622
622
  updateLabels(userId, labels) {
623
623
  if (typeof userId === "undefined") {
624
624
  throw new client.AppwriteException('Missing required parameter: "userId"');
@@ -1018,14 +1018,14 @@ class Users {
1018
1018
  );
1019
1019
  }
1020
1020
  /**
1021
- * Creates a session for a user. Returns an immediately usable session object.
1022
-
1023
- 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.
1024
- *
1025
- * @param {string} userId
1026
- * @throws {AppwriteException}
1027
- * @returns {Promise<Models.Session>}
1028
- */
1021
+ * Creates a session for a user. Returns an immediately usable session object.
1022
+ *
1023
+ * 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.
1024
+ *
1025
+ * @param {string} userId
1026
+ * @throws {AppwriteException}
1027
+ * @returns {Promise<Models.Session>}
1028
+ */
1029
1029
  createSession(userId) {
1030
1030
  if (typeof userId === "undefined") {
1031
1031
  throw new client.AppwriteException('Missing required parameter: "userId"');
@@ -1300,15 +1300,15 @@ class Users {
1300
1300
  );
1301
1301
  }
1302
1302
  /**
1303
- * 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.
1304
-
1305
- *
1306
- * @param {string} userId
1307
- * @param {number} length
1308
- * @param {number} expire
1309
- * @throws {AppwriteException}
1310
- * @returns {Promise<Models.Token>}
1311
- */
1303
+ * 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.
1304
+ *
1305
+ *
1306
+ * @param {string} userId
1307
+ * @param {number} length
1308
+ * @param {number} expire
1309
+ * @throws {AppwriteException}
1310
+ * @returns {Promise<Models.Token>}
1311
+ */
1312
1312
  createToken(userId, length, expire) {
1313
1313
  if (typeof userId === "undefined") {
1314
1314
  throw new client.AppwriteException('Missing required parameter: "userId"');