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