@appwrite.io/console 0.6.0-rc.4 → 0.6.0-rc.5
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 +1 -1
- package/dist/cjs/sdk.js +310 -174
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +310 -174
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +310 -174
- package/docs/examples/account/{create-magic-u-r-l-session.md → create-email-password-session.md} +1 -1
- package/docs/examples/account/{create-email-session.md → create-magic-u-r-l-token.md} +1 -1
- package/docs/examples/account/{create-phone-session.md → create-phone-token.md} +1 -1
- package/docs/examples/account/{update-phone-session.md → create-session.md} +1 -1
- package/docs/examples/account/update-push-target.md +17 -0
- package/docs/examples/account/update-recovery.md +1 -1
- package/docs/examples/users/create-session.md +18 -0
- package/docs/examples/users/create-token.md +18 -0
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/models.ts +8 -0
- package/src/services/account.ts +158 -136
- package/src/services/messaging.ts +122 -52
- package/src/services/users.ts +66 -1
- package/types/models.d.ts +8 -0
- package/types/services/account.d.ts +73 -72
- package/types/services/messaging.d.ts +36 -22
- package/types/services/users.d.ts +32 -1
package/dist/esm/sdk.js
CHANGED
|
@@ -102,7 +102,7 @@ class Client {
|
|
|
102
102
|
'x-sdk-name': 'Console',
|
|
103
103
|
'x-sdk-platform': 'console',
|
|
104
104
|
'x-sdk-language': 'web',
|
|
105
|
-
'x-sdk-version': '0.6.0-rc.
|
|
105
|
+
'x-sdk-version': '0.6.0-rc.5',
|
|
106
106
|
'X-Appwrite-Response-Format': '1.4.0',
|
|
107
107
|
};
|
|
108
108
|
this.realtime = {
|
|
@@ -568,7 +568,7 @@ class Account extends Service {
|
|
|
568
568
|
});
|
|
569
569
|
}
|
|
570
570
|
/**
|
|
571
|
-
* Delete
|
|
571
|
+
* Delete identity
|
|
572
572
|
*
|
|
573
573
|
* Delete an identity by its unique ID.
|
|
574
574
|
*
|
|
@@ -1001,11 +1001,10 @@ class Account extends Service {
|
|
|
1001
1001
|
* @param {string} userId
|
|
1002
1002
|
* @param {string} secret
|
|
1003
1003
|
* @param {string} password
|
|
1004
|
-
* @param {string} passwordAgain
|
|
1005
1004
|
* @throws {AppwriteException}
|
|
1006
1005
|
* @returns {Promise}
|
|
1007
1006
|
*/
|
|
1008
|
-
updateRecovery(userId, secret, password
|
|
1007
|
+
updateRecovery(userId, secret, password) {
|
|
1009
1008
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1010
1009
|
if (typeof userId === 'undefined') {
|
|
1011
1010
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1016,9 +1015,6 @@ class Account extends Service {
|
|
|
1016
1015
|
if (typeof password === 'undefined') {
|
|
1017
1016
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
1018
1017
|
}
|
|
1019
|
-
if (typeof passwordAgain === 'undefined') {
|
|
1020
|
-
throw new AppwriteException('Missing required parameter: "passwordAgain"');
|
|
1021
|
-
}
|
|
1022
1018
|
const apiPath = '/account/recovery';
|
|
1023
1019
|
const payload = {};
|
|
1024
1020
|
if (typeof userId !== 'undefined') {
|
|
@@ -1030,9 +1026,6 @@ class Account extends Service {
|
|
|
1030
1026
|
if (typeof password !== 'undefined') {
|
|
1031
1027
|
payload['password'] = password;
|
|
1032
1028
|
}
|
|
1033
|
-
if (typeof passwordAgain !== 'undefined') {
|
|
1034
|
-
payload['passwordAgain'] = passwordAgain;
|
|
1035
|
-
}
|
|
1036
1029
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1037
1030
|
return yield this.client.call('put', uri, {
|
|
1038
1031
|
'content-type': 'application/json',
|
|
@@ -1102,7 +1095,7 @@ class Account extends Service {
|
|
|
1102
1095
|
});
|
|
1103
1096
|
}
|
|
1104
1097
|
/**
|
|
1105
|
-
* Create email session
|
|
1098
|
+
* Create email password session
|
|
1106
1099
|
*
|
|
1107
1100
|
* Allow the user to login into their account by providing a valid email and
|
|
1108
1101
|
* password combination. This route will create a new session for the user.
|
|
@@ -1116,7 +1109,7 @@ class Account extends Service {
|
|
|
1116
1109
|
* @throws {AppwriteException}
|
|
1117
1110
|
* @returns {Promise}
|
|
1118
1111
|
*/
|
|
1119
|
-
|
|
1112
|
+
createEmailPasswordSession(email, password) {
|
|
1120
1113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1121
1114
|
if (typeof email === 'undefined') {
|
|
1122
1115
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
@@ -1139,70 +1132,11 @@ class Account extends Service {
|
|
|
1139
1132
|
});
|
|
1140
1133
|
}
|
|
1141
1134
|
/**
|
|
1142
|
-
* Create
|
|
1143
|
-
*
|
|
1144
|
-
* Sends the user an email with a secret key for creating a session. If the
|
|
1145
|
-
* provided user ID has not been registered, a new user will be created. When
|
|
1146
|
-
* the user clicks the link in the email, the user is redirected back to the
|
|
1147
|
-
* URL you provided with the secret key and userId values attached to the URL
|
|
1148
|
-
* query string. Use the query string parameters to submit a request to the
|
|
1149
|
-
* [PUT
|
|
1150
|
-
* /account/sessions/magic-url](https://appwrite.io/docs/references/cloud/client-web/account#updateMagicURLSession)
|
|
1151
|
-
* endpoint to complete the login process. The link sent to the user's email
|
|
1152
|
-
* address is valid for 1 hour. If you are on a mobile device you can leave
|
|
1153
|
-
* the URL parameter empty, so that the login completion will be handled by
|
|
1154
|
-
* your Appwrite instance by default.
|
|
1155
|
-
*
|
|
1156
|
-
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1157
|
-
* about session
|
|
1158
|
-
* limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1159
|
-
*
|
|
1160
|
-
*
|
|
1161
|
-
* @param {string} userId
|
|
1162
|
-
* @param {string} email
|
|
1163
|
-
* @param {string} url
|
|
1164
|
-
* @throws {AppwriteException}
|
|
1165
|
-
* @returns {Promise}
|
|
1166
|
-
*/
|
|
1167
|
-
createMagicURLSession(userId, email, url) {
|
|
1168
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1169
|
-
if (typeof userId === 'undefined') {
|
|
1170
|
-
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1171
|
-
}
|
|
1172
|
-
if (typeof email === 'undefined') {
|
|
1173
|
-
throw new AppwriteException('Missing required parameter: "email"');
|
|
1174
|
-
}
|
|
1175
|
-
const apiPath = '/account/sessions/magic-url';
|
|
1176
|
-
const payload = {};
|
|
1177
|
-
if (typeof userId !== 'undefined') {
|
|
1178
|
-
payload['userId'] = userId;
|
|
1179
|
-
}
|
|
1180
|
-
if (typeof email !== 'undefined') {
|
|
1181
|
-
payload['email'] = email;
|
|
1182
|
-
}
|
|
1183
|
-
if (typeof url !== 'undefined') {
|
|
1184
|
-
payload['url'] = url;
|
|
1185
|
-
}
|
|
1186
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1187
|
-
return yield this.client.call('post', uri, {
|
|
1188
|
-
'content-type': 'application/json',
|
|
1189
|
-
}, payload);
|
|
1190
|
-
});
|
|
1191
|
-
}
|
|
1192
|
-
/**
|
|
1193
|
-
* Create magic URL session (confirmation)
|
|
1194
|
-
*
|
|
1195
|
-
* Use this endpoint to complete creating the session with the Magic URL. Both
|
|
1196
|
-
* the **userId** and **secret** arguments will be passed as query parameters
|
|
1197
|
-
* to the redirect URL you have provided when sending your request to the
|
|
1198
|
-
* [POST
|
|
1199
|
-
* /account/sessions/magic-url](https://appwrite.io/docs/references/cloud/client-web/account#createMagicURLSession)
|
|
1200
|
-
* endpoint.
|
|
1135
|
+
* Create session (deprecated)
|
|
1201
1136
|
*
|
|
1202
|
-
*
|
|
1203
|
-
*
|
|
1204
|
-
*
|
|
1205
|
-
* adding your platforms in the console interface.
|
|
1137
|
+
* Use this endpoint to create a session from token. Provide the **userId**
|
|
1138
|
+
* and **secret** parameters from the successful response of authentication
|
|
1139
|
+
* flows initiated by token creation. For example, magic URL and phone login.
|
|
1206
1140
|
*
|
|
1207
1141
|
* @param {string} userId
|
|
1208
1142
|
* @param {string} secret
|
|
@@ -1254,11 +1188,12 @@ class Account extends Service {
|
|
|
1254
1188
|
* @param {string} provider
|
|
1255
1189
|
* @param {string} success
|
|
1256
1190
|
* @param {string} failure
|
|
1191
|
+
* @param {boolean} token
|
|
1257
1192
|
* @param {string[]} scopes
|
|
1258
1193
|
* @throws {AppwriteException}
|
|
1259
1194
|
* @returns {void|string}
|
|
1260
1195
|
*/
|
|
1261
|
-
createOAuth2Session(provider, success, failure, scopes) {
|
|
1196
|
+
createOAuth2Session(provider, success, failure, token, scopes) {
|
|
1262
1197
|
if (typeof provider === 'undefined') {
|
|
1263
1198
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
1264
1199
|
}
|
|
@@ -1270,6 +1205,9 @@ class Account extends Service {
|
|
|
1270
1205
|
if (typeof failure !== 'undefined') {
|
|
1271
1206
|
payload['failure'] = failure;
|
|
1272
1207
|
}
|
|
1208
|
+
if (typeof token !== 'undefined') {
|
|
1209
|
+
payload['token'] = token;
|
|
1210
|
+
}
|
|
1273
1211
|
if (typeof scopes !== 'undefined') {
|
|
1274
1212
|
payload['scopes'] = scopes;
|
|
1275
1213
|
}
|
|
@@ -1286,61 +1224,18 @@ class Account extends Service {
|
|
|
1286
1224
|
}
|
|
1287
1225
|
}
|
|
1288
1226
|
/**
|
|
1289
|
-
* Create
|
|
1290
|
-
*
|
|
1291
|
-
* Sends the user an SMS with a secret key for creating a session. If the
|
|
1292
|
-
* provided user ID has not be registered, a new user will be created. Use the
|
|
1293
|
-
* returned user ID and secret and submit a request to the [PUT
|
|
1294
|
-
* /account/sessions/phone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneSession)
|
|
1295
|
-
* endpoint to complete the login process. The secret sent to the user's phone
|
|
1296
|
-
* is valid for 15 minutes.
|
|
1297
|
-
*
|
|
1298
|
-
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1299
|
-
* about session
|
|
1300
|
-
* limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1301
|
-
*
|
|
1302
|
-
* @param {string} userId
|
|
1303
|
-
* @param {string} phone
|
|
1304
|
-
* @throws {AppwriteException}
|
|
1305
|
-
* @returns {Promise}
|
|
1306
|
-
*/
|
|
1307
|
-
createPhoneSession(userId, phone) {
|
|
1308
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1309
|
-
if (typeof userId === 'undefined') {
|
|
1310
|
-
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1311
|
-
}
|
|
1312
|
-
if (typeof phone === 'undefined') {
|
|
1313
|
-
throw new AppwriteException('Missing required parameter: "phone"');
|
|
1314
|
-
}
|
|
1315
|
-
const apiPath = '/account/sessions/phone';
|
|
1316
|
-
const payload = {};
|
|
1317
|
-
if (typeof userId !== 'undefined') {
|
|
1318
|
-
payload['userId'] = userId;
|
|
1319
|
-
}
|
|
1320
|
-
if (typeof phone !== 'undefined') {
|
|
1321
|
-
payload['phone'] = phone;
|
|
1322
|
-
}
|
|
1323
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1324
|
-
return yield this.client.call('post', uri, {
|
|
1325
|
-
'content-type': 'application/json',
|
|
1326
|
-
}, payload);
|
|
1327
|
-
});
|
|
1328
|
-
}
|
|
1329
|
-
/**
|
|
1330
|
-
* Create phone session (confirmation)
|
|
1227
|
+
* Create session
|
|
1331
1228
|
*
|
|
1332
|
-
* Use this endpoint to
|
|
1333
|
-
* **
|
|
1334
|
-
*
|
|
1335
|
-
* endpoint and the **secret** received via SMS to successfully update and
|
|
1336
|
-
* confirm the phone session.
|
|
1229
|
+
* Use this endpoint to create a session from token. Provide the **userId**
|
|
1230
|
+
* and **secret** parameters from the successful response of authentication
|
|
1231
|
+
* flows initiated by token creation. For example, magic URL and phone login.
|
|
1337
1232
|
*
|
|
1338
1233
|
* @param {string} userId
|
|
1339
1234
|
* @param {string} secret
|
|
1340
1235
|
* @throws {AppwriteException}
|
|
1341
1236
|
* @returns {Promise}
|
|
1342
1237
|
*/
|
|
1343
|
-
|
|
1238
|
+
createSession(userId, secret) {
|
|
1344
1239
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1345
1240
|
if (typeof userId === 'undefined') {
|
|
1346
1241
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1348,7 +1243,7 @@ class Account extends Service {
|
|
|
1348
1243
|
if (typeof secret === 'undefined') {
|
|
1349
1244
|
throw new AppwriteException('Missing required parameter: "secret"');
|
|
1350
1245
|
}
|
|
1351
|
-
const apiPath = '/account/sessions/
|
|
1246
|
+
const apiPath = '/account/sessions/token';
|
|
1352
1247
|
const payload = {};
|
|
1353
1248
|
if (typeof userId !== 'undefined') {
|
|
1354
1249
|
payload['userId'] = userId;
|
|
@@ -1357,7 +1252,7 @@ class Account extends Service {
|
|
|
1357
1252
|
payload['secret'] = secret;
|
|
1358
1253
|
}
|
|
1359
1254
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1360
|
-
return yield this.client.call('
|
|
1255
|
+
return yield this.client.call('post', uri, {
|
|
1361
1256
|
'content-type': 'application/json',
|
|
1362
1257
|
}, payload);
|
|
1363
1258
|
});
|
|
@@ -1455,6 +1350,130 @@ class Account extends Service {
|
|
|
1455
1350
|
}, payload);
|
|
1456
1351
|
});
|
|
1457
1352
|
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Update Account's push target
|
|
1355
|
+
*
|
|
1356
|
+
*
|
|
1357
|
+
* @param {string} targetId
|
|
1358
|
+
* @param {string} identifier
|
|
1359
|
+
* @throws {AppwriteException}
|
|
1360
|
+
* @returns {Promise}
|
|
1361
|
+
*/
|
|
1362
|
+
updatePushTarget(targetId, identifier) {
|
|
1363
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1364
|
+
if (typeof targetId === 'undefined') {
|
|
1365
|
+
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1366
|
+
}
|
|
1367
|
+
if (typeof identifier === 'undefined') {
|
|
1368
|
+
throw new AppwriteException('Missing required parameter: "identifier"');
|
|
1369
|
+
}
|
|
1370
|
+
const apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', targetId);
|
|
1371
|
+
const payload = {};
|
|
1372
|
+
if (typeof identifier !== 'undefined') {
|
|
1373
|
+
payload['identifier'] = identifier;
|
|
1374
|
+
}
|
|
1375
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1376
|
+
return yield this.client.call('put', uri, {
|
|
1377
|
+
'content-type': 'application/json',
|
|
1378
|
+
}, payload);
|
|
1379
|
+
});
|
|
1380
|
+
}
|
|
1381
|
+
/**
|
|
1382
|
+
* Create magic URL token
|
|
1383
|
+
*
|
|
1384
|
+
* Sends the user an email with a secret key for creating a session. If the
|
|
1385
|
+
* provided user ID has not been registered, a new user will be created. When
|
|
1386
|
+
* the user clicks the link in the email, the user is redirected back to the
|
|
1387
|
+
* URL you provided with the secret key and userId values attached to the URL
|
|
1388
|
+
* query string. Use the query string parameters to submit a request to the
|
|
1389
|
+
* [PUT
|
|
1390
|
+
* /account/sessions/magic-url](https://appwrite.io/docs/references/cloud/client-web/account#updateMagicURLSession)
|
|
1391
|
+
* endpoint to complete the login process. The link sent to the user's email
|
|
1392
|
+
* address is valid for 1 hour. If you are on a mobile device you can leave
|
|
1393
|
+
* the URL parameter empty, so that the login completion will be handled by
|
|
1394
|
+
* your Appwrite instance by default.
|
|
1395
|
+
*
|
|
1396
|
+
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1397
|
+
* about session
|
|
1398
|
+
* limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1399
|
+
*
|
|
1400
|
+
*
|
|
1401
|
+
* @param {string} userId
|
|
1402
|
+
* @param {string} email
|
|
1403
|
+
* @param {string} url
|
|
1404
|
+
* @param {boolean} securityPhrase
|
|
1405
|
+
* @throws {AppwriteException}
|
|
1406
|
+
* @returns {Promise}
|
|
1407
|
+
*/
|
|
1408
|
+
createMagicURLToken(userId, email, url, securityPhrase) {
|
|
1409
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1410
|
+
if (typeof userId === 'undefined') {
|
|
1411
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1412
|
+
}
|
|
1413
|
+
if (typeof email === 'undefined') {
|
|
1414
|
+
throw new AppwriteException('Missing required parameter: "email"');
|
|
1415
|
+
}
|
|
1416
|
+
const apiPath = '/account/tokens/magic-url';
|
|
1417
|
+
const payload = {};
|
|
1418
|
+
if (typeof userId !== 'undefined') {
|
|
1419
|
+
payload['userId'] = userId;
|
|
1420
|
+
}
|
|
1421
|
+
if (typeof email !== 'undefined') {
|
|
1422
|
+
payload['email'] = email;
|
|
1423
|
+
}
|
|
1424
|
+
if (typeof url !== 'undefined') {
|
|
1425
|
+
payload['url'] = url;
|
|
1426
|
+
}
|
|
1427
|
+
if (typeof securityPhrase !== 'undefined') {
|
|
1428
|
+
payload['securityPhrase'] = securityPhrase;
|
|
1429
|
+
}
|
|
1430
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1431
|
+
return yield this.client.call('post', uri, {
|
|
1432
|
+
'content-type': 'application/json',
|
|
1433
|
+
}, payload);
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
/**
|
|
1437
|
+
* Create phone token
|
|
1438
|
+
*
|
|
1439
|
+
* Sends the user an SMS with a secret key for creating a session. If the
|
|
1440
|
+
* provided user ID has not be registered, a new user will be created. Use the
|
|
1441
|
+
* returned user ID and secret and submit a request to the [PUT
|
|
1442
|
+
* /account/sessions/phone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneSession)
|
|
1443
|
+
* endpoint to complete the login process. The secret sent to the user's phone
|
|
1444
|
+
* is valid for 15 minutes.
|
|
1445
|
+
*
|
|
1446
|
+
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1447
|
+
* about session
|
|
1448
|
+
* limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1449
|
+
*
|
|
1450
|
+
* @param {string} userId
|
|
1451
|
+
* @param {string} phone
|
|
1452
|
+
* @throws {AppwriteException}
|
|
1453
|
+
* @returns {Promise}
|
|
1454
|
+
*/
|
|
1455
|
+
createPhoneToken(userId, phone) {
|
|
1456
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1457
|
+
if (typeof userId === 'undefined') {
|
|
1458
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1459
|
+
}
|
|
1460
|
+
if (typeof phone === 'undefined') {
|
|
1461
|
+
throw new AppwriteException('Missing required parameter: "phone"');
|
|
1462
|
+
}
|
|
1463
|
+
const apiPath = '/account/tokens/phone';
|
|
1464
|
+
const payload = {};
|
|
1465
|
+
if (typeof userId !== 'undefined') {
|
|
1466
|
+
payload['userId'] = userId;
|
|
1467
|
+
}
|
|
1468
|
+
if (typeof phone !== 'undefined') {
|
|
1469
|
+
payload['phone'] = phone;
|
|
1470
|
+
}
|
|
1471
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1472
|
+
return yield this.client.call('post', uri, {
|
|
1473
|
+
'content-type': 'application/json',
|
|
1474
|
+
}, payload);
|
|
1475
|
+
});
|
|
1476
|
+
}
|
|
1458
1477
|
/**
|
|
1459
1478
|
* Create email verification
|
|
1460
1479
|
*
|
|
@@ -5338,6 +5357,8 @@ class Messaging extends Service {
|
|
|
5338
5357
|
* @param {string[]} topics
|
|
5339
5358
|
* @param {string[]} users
|
|
5340
5359
|
* @param {string[]} targets
|
|
5360
|
+
* @param {string[]} cc
|
|
5361
|
+
* @param {string[]} bcc
|
|
5341
5362
|
* @param {string} description
|
|
5342
5363
|
* @param {string} status
|
|
5343
5364
|
* @param {boolean} html
|
|
@@ -5345,7 +5366,7 @@ class Messaging extends Service {
|
|
|
5345
5366
|
* @throws {AppwriteException}
|
|
5346
5367
|
* @returns {Promise}
|
|
5347
5368
|
*/
|
|
5348
|
-
createEmailMessage(messageId, subject, content, topics, users, targets, description, status, html, scheduledAt) {
|
|
5369
|
+
createEmailMessage(messageId, subject, content, topics, users, targets, cc, bcc, description, status, html, scheduledAt) {
|
|
5349
5370
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5350
5371
|
if (typeof messageId === 'undefined') {
|
|
5351
5372
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
@@ -5376,6 +5397,12 @@ class Messaging extends Service {
|
|
|
5376
5397
|
if (typeof targets !== 'undefined') {
|
|
5377
5398
|
payload['targets'] = targets;
|
|
5378
5399
|
}
|
|
5400
|
+
if (typeof cc !== 'undefined') {
|
|
5401
|
+
payload['cc'] = cc;
|
|
5402
|
+
}
|
|
5403
|
+
if (typeof bcc !== 'undefined') {
|
|
5404
|
+
payload['bcc'] = bcc;
|
|
5405
|
+
}
|
|
5379
5406
|
if (typeof description !== 'undefined') {
|
|
5380
5407
|
payload['description'] = description;
|
|
5381
5408
|
}
|
|
@@ -5407,11 +5434,13 @@ class Messaging extends Service {
|
|
|
5407
5434
|
* @param {string} content
|
|
5408
5435
|
* @param {string} status
|
|
5409
5436
|
* @param {boolean} html
|
|
5437
|
+
* @param {string[]} cc
|
|
5438
|
+
* @param {string[]} bcc
|
|
5410
5439
|
* @param {string} scheduledAt
|
|
5411
5440
|
* @throws {AppwriteException}
|
|
5412
5441
|
* @returns {Promise}
|
|
5413
5442
|
*/
|
|
5414
|
-
updateEmail(messageId, topics, users, targets, subject, description, content, status, html, scheduledAt) {
|
|
5443
|
+
updateEmail(messageId, topics, users, targets, subject, description, content, status, html, cc, bcc, scheduledAt) {
|
|
5415
5444
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5416
5445
|
if (typeof messageId === 'undefined') {
|
|
5417
5446
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
@@ -5442,6 +5471,12 @@ class Messaging extends Service {
|
|
|
5442
5471
|
if (typeof html !== 'undefined') {
|
|
5443
5472
|
payload['html'] = html;
|
|
5444
5473
|
}
|
|
5474
|
+
if (typeof cc !== 'undefined') {
|
|
5475
|
+
payload['cc'] = cc;
|
|
5476
|
+
}
|
|
5477
|
+
if (typeof bcc !== 'undefined') {
|
|
5478
|
+
payload['bcc'] = bcc;
|
|
5479
|
+
}
|
|
5445
5480
|
if (typeof scheduledAt !== 'undefined') {
|
|
5446
5481
|
payload['scheduledAt'] = scheduledAt;
|
|
5447
5482
|
}
|
|
@@ -5558,7 +5593,7 @@ class Messaging extends Service {
|
|
|
5558
5593
|
* @param {string} sound
|
|
5559
5594
|
* @param {string} color
|
|
5560
5595
|
* @param {string} tag
|
|
5561
|
-
* @param {
|
|
5596
|
+
* @param {number} badge
|
|
5562
5597
|
* @param {string} status
|
|
5563
5598
|
* @param {string} scheduledAt
|
|
5564
5599
|
* @throws {AppwriteException}
|
|
@@ -5807,12 +5842,11 @@ class Messaging extends Service {
|
|
|
5807
5842
|
* @param {string} authKeyId
|
|
5808
5843
|
* @param {string} teamId
|
|
5809
5844
|
* @param {string} bundleId
|
|
5810
|
-
* @param {string} endpoint
|
|
5811
5845
|
* @param {boolean} enabled
|
|
5812
5846
|
* @throws {AppwriteException}
|
|
5813
5847
|
* @returns {Promise}
|
|
5814
5848
|
*/
|
|
5815
|
-
createApnsProvider(providerId, name, authKey, authKeyId, teamId, bundleId,
|
|
5849
|
+
createApnsProvider(providerId, name, authKey, authKeyId, teamId, bundleId, enabled) {
|
|
5816
5850
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5817
5851
|
if (typeof providerId === 'undefined') {
|
|
5818
5852
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -5840,9 +5874,6 @@ class Messaging extends Service {
|
|
|
5840
5874
|
if (typeof bundleId !== 'undefined') {
|
|
5841
5875
|
payload['bundleId'] = bundleId;
|
|
5842
5876
|
}
|
|
5843
|
-
if (typeof endpoint !== 'undefined') {
|
|
5844
|
-
payload['endpoint'] = endpoint;
|
|
5845
|
-
}
|
|
5846
5877
|
if (typeof enabled !== 'undefined') {
|
|
5847
5878
|
payload['enabled'] = enabled;
|
|
5848
5879
|
}
|
|
@@ -5863,11 +5894,10 @@ class Messaging extends Service {
|
|
|
5863
5894
|
* @param {string} authKeyId
|
|
5864
5895
|
* @param {string} teamId
|
|
5865
5896
|
* @param {string} bundleId
|
|
5866
|
-
* @param {string} endpoint
|
|
5867
5897
|
* @throws {AppwriteException}
|
|
5868
5898
|
* @returns {Promise}
|
|
5869
5899
|
*/
|
|
5870
|
-
updateApnsProvider(providerId, name, enabled, authKey, authKeyId, teamId, bundleId
|
|
5900
|
+
updateApnsProvider(providerId, name, enabled, authKey, authKeyId, teamId, bundleId) {
|
|
5871
5901
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5872
5902
|
if (typeof providerId === 'undefined') {
|
|
5873
5903
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -5892,9 +5922,6 @@ class Messaging extends Service {
|
|
|
5892
5922
|
if (typeof bundleId !== 'undefined') {
|
|
5893
5923
|
payload['bundleId'] = bundleId;
|
|
5894
5924
|
}
|
|
5895
|
-
if (typeof endpoint !== 'undefined') {
|
|
5896
|
-
payload['endpoint'] = endpoint;
|
|
5897
|
-
}
|
|
5898
5925
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5899
5926
|
return yield this.client.call('patch', uri, {
|
|
5900
5927
|
'content-type': 'application/json',
|
|
@@ -5907,12 +5934,12 @@ class Messaging extends Service {
|
|
|
5907
5934
|
*
|
|
5908
5935
|
* @param {string} providerId
|
|
5909
5936
|
* @param {string} name
|
|
5910
|
-
* @param {
|
|
5937
|
+
* @param {object} serviceAccountJSON
|
|
5911
5938
|
* @param {boolean} enabled
|
|
5912
5939
|
* @throws {AppwriteException}
|
|
5913
5940
|
* @returns {Promise}
|
|
5914
5941
|
*/
|
|
5915
|
-
createFcmProvider(providerId, name,
|
|
5942
|
+
createFcmProvider(providerId, name, serviceAccountJSON, enabled) {
|
|
5916
5943
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5917
5944
|
if (typeof providerId === 'undefined') {
|
|
5918
5945
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -5928,8 +5955,8 @@ class Messaging extends Service {
|
|
|
5928
5955
|
if (typeof name !== 'undefined') {
|
|
5929
5956
|
payload['name'] = name;
|
|
5930
5957
|
}
|
|
5931
|
-
if (typeof
|
|
5932
|
-
payload['
|
|
5958
|
+
if (typeof serviceAccountJSON !== 'undefined') {
|
|
5959
|
+
payload['serviceAccountJSON'] = serviceAccountJSON;
|
|
5933
5960
|
}
|
|
5934
5961
|
if (typeof enabled !== 'undefined') {
|
|
5935
5962
|
payload['enabled'] = enabled;
|
|
@@ -5947,11 +5974,11 @@ class Messaging extends Service {
|
|
|
5947
5974
|
* @param {string} providerId
|
|
5948
5975
|
* @param {string} name
|
|
5949
5976
|
* @param {boolean} enabled
|
|
5950
|
-
* @param {
|
|
5977
|
+
* @param {object} serviceAccountJSON
|
|
5951
5978
|
* @throws {AppwriteException}
|
|
5952
5979
|
* @returns {Promise}
|
|
5953
5980
|
*/
|
|
5954
|
-
updateFcmProvider(providerId, name, enabled,
|
|
5981
|
+
updateFcmProvider(providerId, name, enabled, serviceAccountJSON) {
|
|
5955
5982
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5956
5983
|
if (typeof providerId === 'undefined') {
|
|
5957
5984
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -5964,8 +5991,8 @@ class Messaging extends Service {
|
|
|
5964
5991
|
if (typeof enabled !== 'undefined') {
|
|
5965
5992
|
payload['enabled'] = enabled;
|
|
5966
5993
|
}
|
|
5967
|
-
if (typeof
|
|
5968
|
-
payload['
|
|
5994
|
+
if (typeof serviceAccountJSON !== 'undefined') {
|
|
5995
|
+
payload['serviceAccountJSON'] = serviceAccountJSON;
|
|
5969
5996
|
}
|
|
5970
5997
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5971
5998
|
return yield this.client.call('patch', uri, {
|
|
@@ -5979,15 +6006,18 @@ class Messaging extends Service {
|
|
|
5979
6006
|
*
|
|
5980
6007
|
* @param {string} providerId
|
|
5981
6008
|
* @param {string} name
|
|
5982
|
-
* @param {string} from
|
|
5983
6009
|
* @param {string} apiKey
|
|
5984
6010
|
* @param {string} domain
|
|
5985
6011
|
* @param {boolean} isEuRegion
|
|
5986
6012
|
* @param {boolean} enabled
|
|
6013
|
+
* @param {string} fromName
|
|
6014
|
+
* @param {string} fromEmail
|
|
6015
|
+
* @param {string} replyToName
|
|
6016
|
+
* @param {string} replyToEmail
|
|
5987
6017
|
* @throws {AppwriteException}
|
|
5988
6018
|
* @returns {Promise}
|
|
5989
6019
|
*/
|
|
5990
|
-
createMailgunProvider(providerId, name,
|
|
6020
|
+
createMailgunProvider(providerId, name, apiKey, domain, isEuRegion, enabled, fromName, fromEmail, replyToName, replyToEmail) {
|
|
5991
6021
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5992
6022
|
if (typeof providerId === 'undefined') {
|
|
5993
6023
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -6003,9 +6033,6 @@ class Messaging extends Service {
|
|
|
6003
6033
|
if (typeof name !== 'undefined') {
|
|
6004
6034
|
payload['name'] = name;
|
|
6005
6035
|
}
|
|
6006
|
-
if (typeof from !== 'undefined') {
|
|
6007
|
-
payload['from'] = from;
|
|
6008
|
-
}
|
|
6009
6036
|
if (typeof apiKey !== 'undefined') {
|
|
6010
6037
|
payload['apiKey'] = apiKey;
|
|
6011
6038
|
}
|
|
@@ -6018,6 +6045,18 @@ class Messaging extends Service {
|
|
|
6018
6045
|
if (typeof enabled !== 'undefined') {
|
|
6019
6046
|
payload['enabled'] = enabled;
|
|
6020
6047
|
}
|
|
6048
|
+
if (typeof fromName !== 'undefined') {
|
|
6049
|
+
payload['fromName'] = fromName;
|
|
6050
|
+
}
|
|
6051
|
+
if (typeof fromEmail !== 'undefined') {
|
|
6052
|
+
payload['fromEmail'] = fromEmail;
|
|
6053
|
+
}
|
|
6054
|
+
if (typeof replyToName !== 'undefined') {
|
|
6055
|
+
payload['replyToName'] = replyToName;
|
|
6056
|
+
}
|
|
6057
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
6058
|
+
payload['replyToEmail'] = replyToEmail;
|
|
6059
|
+
}
|
|
6021
6060
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6022
6061
|
return yield this.client.call('post', uri, {
|
|
6023
6062
|
'content-type': 'application/json',
|
|
@@ -6030,15 +6069,18 @@ class Messaging extends Service {
|
|
|
6030
6069
|
*
|
|
6031
6070
|
* @param {string} providerId
|
|
6032
6071
|
* @param {string} name
|
|
6033
|
-
* @param {boolean} enabled
|
|
6034
|
-
* @param {boolean} isEuRegion
|
|
6035
|
-
* @param {string} from
|
|
6036
6072
|
* @param {string} apiKey
|
|
6037
6073
|
* @param {string} domain
|
|
6074
|
+
* @param {boolean} isEuRegion
|
|
6075
|
+
* @param {boolean} enabled
|
|
6076
|
+
* @param {string} fromName
|
|
6077
|
+
* @param {string} fromEmail
|
|
6078
|
+
* @param {string} replyToName
|
|
6079
|
+
* @param {string} replyToEmail
|
|
6038
6080
|
* @throws {AppwriteException}
|
|
6039
6081
|
* @returns {Promise}
|
|
6040
6082
|
*/
|
|
6041
|
-
updateMailgunProvider(providerId, name,
|
|
6083
|
+
updateMailgunProvider(providerId, name, apiKey, domain, isEuRegion, enabled, fromName, fromEmail, replyToName, replyToEmail) {
|
|
6042
6084
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6043
6085
|
if (typeof providerId === 'undefined') {
|
|
6044
6086
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -6048,20 +6090,29 @@ class Messaging extends Service {
|
|
|
6048
6090
|
if (typeof name !== 'undefined') {
|
|
6049
6091
|
payload['name'] = name;
|
|
6050
6092
|
}
|
|
6051
|
-
if (typeof
|
|
6052
|
-
payload['
|
|
6093
|
+
if (typeof apiKey !== 'undefined') {
|
|
6094
|
+
payload['apiKey'] = apiKey;
|
|
6095
|
+
}
|
|
6096
|
+
if (typeof domain !== 'undefined') {
|
|
6097
|
+
payload['domain'] = domain;
|
|
6053
6098
|
}
|
|
6054
6099
|
if (typeof isEuRegion !== 'undefined') {
|
|
6055
6100
|
payload['isEuRegion'] = isEuRegion;
|
|
6056
6101
|
}
|
|
6057
|
-
if (typeof
|
|
6058
|
-
payload['
|
|
6102
|
+
if (typeof enabled !== 'undefined') {
|
|
6103
|
+
payload['enabled'] = enabled;
|
|
6059
6104
|
}
|
|
6060
|
-
if (typeof
|
|
6061
|
-
payload['
|
|
6105
|
+
if (typeof fromName !== 'undefined') {
|
|
6106
|
+
payload['fromName'] = fromName;
|
|
6062
6107
|
}
|
|
6063
|
-
if (typeof
|
|
6064
|
-
payload['
|
|
6108
|
+
if (typeof fromEmail !== 'undefined') {
|
|
6109
|
+
payload['fromEmail'] = fromEmail;
|
|
6110
|
+
}
|
|
6111
|
+
if (typeof replyToName !== 'undefined') {
|
|
6112
|
+
payload['replyToName'] = replyToName;
|
|
6113
|
+
}
|
|
6114
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
6115
|
+
payload['replyToEmail'] = replyToEmail;
|
|
6065
6116
|
}
|
|
6066
6117
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6067
6118
|
return yield this.client.call('patch', uri, {
|
|
@@ -6163,13 +6214,16 @@ class Messaging extends Service {
|
|
|
6163
6214
|
*
|
|
6164
6215
|
* @param {string} providerId
|
|
6165
6216
|
* @param {string} name
|
|
6166
|
-
* @param {string} from
|
|
6167
6217
|
* @param {string} apiKey
|
|
6168
6218
|
* @param {boolean} enabled
|
|
6219
|
+
* @param {string} fromName
|
|
6220
|
+
* @param {string} fromEmail
|
|
6221
|
+
* @param {string} replyToName
|
|
6222
|
+
* @param {string} replyToEmail
|
|
6169
6223
|
* @throws {AppwriteException}
|
|
6170
6224
|
* @returns {Promise}
|
|
6171
6225
|
*/
|
|
6172
|
-
createSendgridProvider(providerId, name,
|
|
6226
|
+
createSendgridProvider(providerId, name, apiKey, enabled, fromName, fromEmail, replyToName, replyToEmail) {
|
|
6173
6227
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6174
6228
|
if (typeof providerId === 'undefined') {
|
|
6175
6229
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -6185,15 +6239,24 @@ class Messaging extends Service {
|
|
|
6185
6239
|
if (typeof name !== 'undefined') {
|
|
6186
6240
|
payload['name'] = name;
|
|
6187
6241
|
}
|
|
6188
|
-
if (typeof from !== 'undefined') {
|
|
6189
|
-
payload['from'] = from;
|
|
6190
|
-
}
|
|
6191
6242
|
if (typeof apiKey !== 'undefined') {
|
|
6192
6243
|
payload['apiKey'] = apiKey;
|
|
6193
6244
|
}
|
|
6194
6245
|
if (typeof enabled !== 'undefined') {
|
|
6195
6246
|
payload['enabled'] = enabled;
|
|
6196
6247
|
}
|
|
6248
|
+
if (typeof fromName !== 'undefined') {
|
|
6249
|
+
payload['fromName'] = fromName;
|
|
6250
|
+
}
|
|
6251
|
+
if (typeof fromEmail !== 'undefined') {
|
|
6252
|
+
payload['fromEmail'] = fromEmail;
|
|
6253
|
+
}
|
|
6254
|
+
if (typeof replyToName !== 'undefined') {
|
|
6255
|
+
payload['replyToName'] = replyToName;
|
|
6256
|
+
}
|
|
6257
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
6258
|
+
payload['replyToEmail'] = replyToEmail;
|
|
6259
|
+
}
|
|
6197
6260
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6198
6261
|
return yield this.client.call('post', uri, {
|
|
6199
6262
|
'content-type': 'application/json',
|
|
@@ -6208,11 +6271,14 @@ class Messaging extends Service {
|
|
|
6208
6271
|
* @param {string} name
|
|
6209
6272
|
* @param {boolean} enabled
|
|
6210
6273
|
* @param {string} apiKey
|
|
6211
|
-
* @param {string}
|
|
6274
|
+
* @param {string} fromName
|
|
6275
|
+
* @param {string} fromEmail
|
|
6276
|
+
* @param {string} replyToName
|
|
6277
|
+
* @param {string} replyToEmail
|
|
6212
6278
|
* @throws {AppwriteException}
|
|
6213
6279
|
* @returns {Promise}
|
|
6214
6280
|
*/
|
|
6215
|
-
updateSendgridProvider(providerId, name, enabled, apiKey,
|
|
6281
|
+
updateSendgridProvider(providerId, name, enabled, apiKey, fromName, fromEmail, replyToName, replyToEmail) {
|
|
6216
6282
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6217
6283
|
if (typeof providerId === 'undefined') {
|
|
6218
6284
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -6228,8 +6294,17 @@ class Messaging extends Service {
|
|
|
6228
6294
|
if (typeof apiKey !== 'undefined') {
|
|
6229
6295
|
payload['apiKey'] = apiKey;
|
|
6230
6296
|
}
|
|
6231
|
-
if (typeof
|
|
6232
|
-
payload['
|
|
6297
|
+
if (typeof fromName !== 'undefined') {
|
|
6298
|
+
payload['fromName'] = fromName;
|
|
6299
|
+
}
|
|
6300
|
+
if (typeof fromEmail !== 'undefined') {
|
|
6301
|
+
payload['fromEmail'] = fromEmail;
|
|
6302
|
+
}
|
|
6303
|
+
if (typeof replyToName !== 'undefined') {
|
|
6304
|
+
payload['replyToName'] = replyToName;
|
|
6305
|
+
}
|
|
6306
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
6307
|
+
payload['replyToEmail'] = replyToEmail;
|
|
6233
6308
|
}
|
|
6234
6309
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6235
6310
|
return yield this.client.call('patch', uri, {
|
|
@@ -10497,7 +10572,7 @@ class Users extends Service {
|
|
|
10497
10572
|
});
|
|
10498
10573
|
}
|
|
10499
10574
|
/**
|
|
10500
|
-
* Delete
|
|
10575
|
+
* Delete identity
|
|
10501
10576
|
*
|
|
10502
10577
|
* Delete an identity by its unique ID.
|
|
10503
10578
|
*
|
|
@@ -11156,6 +11231,33 @@ class Users extends Service {
|
|
|
11156
11231
|
}, payload);
|
|
11157
11232
|
});
|
|
11158
11233
|
}
|
|
11234
|
+
/**
|
|
11235
|
+
* Create session
|
|
11236
|
+
*
|
|
11237
|
+
* Creates a session for a user. Returns an immediately usable session object.
|
|
11238
|
+
*
|
|
11239
|
+
* If you want to generate a token for a custom authentication flow, use the
|
|
11240
|
+
* [POST
|
|
11241
|
+
* /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken)
|
|
11242
|
+
* endpoint.
|
|
11243
|
+
*
|
|
11244
|
+
* @param {string} userId
|
|
11245
|
+
* @throws {AppwriteException}
|
|
11246
|
+
* @returns {Promise}
|
|
11247
|
+
*/
|
|
11248
|
+
createSession(userId) {
|
|
11249
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11250
|
+
if (typeof userId === 'undefined') {
|
|
11251
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
11252
|
+
}
|
|
11253
|
+
const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
11254
|
+
const payload = {};
|
|
11255
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11256
|
+
return yield this.client.call('post', uri, {
|
|
11257
|
+
'content-type': 'application/json',
|
|
11258
|
+
}, payload);
|
|
11259
|
+
});
|
|
11260
|
+
}
|
|
11159
11261
|
/**
|
|
11160
11262
|
* Delete user sessions
|
|
11161
11263
|
*
|
|
@@ -11396,6 +11498,40 @@ class Users extends Service {
|
|
|
11396
11498
|
}, payload);
|
|
11397
11499
|
});
|
|
11398
11500
|
}
|
|
11501
|
+
/**
|
|
11502
|
+
* Create token
|
|
11503
|
+
*
|
|
11504
|
+
* Returns a token with a secret key for creating a session. If the provided
|
|
11505
|
+
* user ID has not be registered, a new user will be created. Use the returned
|
|
11506
|
+
* user ID and secret and submit a request to the [PUT
|
|
11507
|
+
* /account/sessions/custom](https://appwrite.io/docs/references/cloud/client-web/account#updateCustomSession)
|
|
11508
|
+
* endpoint to complete the login process.
|
|
11509
|
+
*
|
|
11510
|
+
* @param {string} userId
|
|
11511
|
+
* @param {number} length
|
|
11512
|
+
* @param {number} expire
|
|
11513
|
+
* @throws {AppwriteException}
|
|
11514
|
+
* @returns {Promise}
|
|
11515
|
+
*/
|
|
11516
|
+
createToken(userId, length, expire) {
|
|
11517
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11518
|
+
if (typeof userId === 'undefined') {
|
|
11519
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
11520
|
+
}
|
|
11521
|
+
const apiPath = '/users/{userId}/tokens'.replace('{userId}', userId);
|
|
11522
|
+
const payload = {};
|
|
11523
|
+
if (typeof length !== 'undefined') {
|
|
11524
|
+
payload['length'] = length;
|
|
11525
|
+
}
|
|
11526
|
+
if (typeof expire !== 'undefined') {
|
|
11527
|
+
payload['expire'] = expire;
|
|
11528
|
+
}
|
|
11529
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11530
|
+
return yield this.client.call('post', uri, {
|
|
11531
|
+
'content-type': 'application/json',
|
|
11532
|
+
}, payload);
|
|
11533
|
+
});
|
|
11534
|
+
}
|
|
11399
11535
|
/**
|
|
11400
11536
|
* Update email verification
|
|
11401
11537
|
*
|