node-appwrite 20.0.0 → 20.2.1

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.
@@ -1389,6 +1389,35 @@ var Account = class {
1389
1389
  payload
1390
1390
  );
1391
1391
  }
1392
+ createEmailVerification(paramsOrFirst) {
1393
+ let params;
1394
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1395
+ params = paramsOrFirst || {};
1396
+ } else {
1397
+ params = {
1398
+ url: paramsOrFirst
1399
+ };
1400
+ }
1401
+ const url = params.url;
1402
+ if (typeof url === "undefined") {
1403
+ throw new AppwriteException('Missing required parameter: "url"');
1404
+ }
1405
+ const apiPath = "/account/verifications/email";
1406
+ const payload = {};
1407
+ if (typeof url !== "undefined") {
1408
+ payload["url"] = url;
1409
+ }
1410
+ const uri = new URL(this.client.config.endpoint + apiPath);
1411
+ const apiHeaders = {
1412
+ "content-type": "application/json"
1413
+ };
1414
+ return this.client.call(
1415
+ "post",
1416
+ uri,
1417
+ apiHeaders,
1418
+ payload
1419
+ );
1420
+ }
1392
1421
  createVerification(paramsOrFirst) {
1393
1422
  let params;
1394
1423
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -1402,7 +1431,7 @@ var Account = class {
1402
1431
  if (typeof url === "undefined") {
1403
1432
  throw new AppwriteException('Missing required parameter: "url"');
1404
1433
  }
1405
- const apiPath = "/account/verification";
1434
+ const apiPath = "/account/verifications/email";
1406
1435
  const payload = {};
1407
1436
  if (typeof url !== "undefined") {
1408
1437
  payload["url"] = url;
@@ -1418,6 +1447,43 @@ var Account = class {
1418
1447
  payload
1419
1448
  );
1420
1449
  }
1450
+ updateEmailVerification(paramsOrFirst, ...rest) {
1451
+ let params;
1452
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1453
+ params = paramsOrFirst || {};
1454
+ } else {
1455
+ params = {
1456
+ userId: paramsOrFirst,
1457
+ secret: rest[0]
1458
+ };
1459
+ }
1460
+ const userId = params.userId;
1461
+ const secret = params.secret;
1462
+ if (typeof userId === "undefined") {
1463
+ throw new AppwriteException('Missing required parameter: "userId"');
1464
+ }
1465
+ if (typeof secret === "undefined") {
1466
+ throw new AppwriteException('Missing required parameter: "secret"');
1467
+ }
1468
+ const apiPath = "/account/verifications/email";
1469
+ const payload = {};
1470
+ if (typeof userId !== "undefined") {
1471
+ payload["userId"] = userId;
1472
+ }
1473
+ if (typeof secret !== "undefined") {
1474
+ payload["secret"] = secret;
1475
+ }
1476
+ const uri = new URL(this.client.config.endpoint + apiPath);
1477
+ const apiHeaders = {
1478
+ "content-type": "application/json"
1479
+ };
1480
+ return this.client.call(
1481
+ "put",
1482
+ uri,
1483
+ apiHeaders,
1484
+ payload
1485
+ );
1486
+ }
1421
1487
  updateVerification(paramsOrFirst, ...rest) {
1422
1488
  let params;
1423
1489
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -1436,7 +1502,7 @@ var Account = class {
1436
1502
  if (typeof secret === "undefined") {
1437
1503
  throw new AppwriteException('Missing required parameter: "secret"');
1438
1504
  }
1439
- const apiPath = "/account/verification";
1505
+ const apiPath = "/account/verifications/email";
1440
1506
  const payload = {};
1441
1507
  if (typeof userId !== "undefined") {
1442
1508
  payload["userId"] = userId;
@@ -1462,7 +1528,7 @@ var Account = class {
1462
1528
  * @returns {Promise<Models.Token>}
1463
1529
  */
1464
1530
  createPhoneVerification() {
1465
- const apiPath = "/account/verification/phone";
1531
+ const apiPath = "/account/verifications/phone";
1466
1532
  const payload = {};
1467
1533
  const uri = new URL(this.client.config.endpoint + apiPath);
1468
1534
  const apiHeaders = {
@@ -1493,7 +1559,7 @@ var Account = class {
1493
1559
  if (typeof secret === "undefined") {
1494
1560
  throw new AppwriteException('Missing required parameter: "secret"');
1495
1561
  }
1496
- const apiPath = "/account/verification/phone";
1562
+ const apiPath = "/account/verifications/phone";
1497
1563
  const payload = {};
1498
1564
  if (typeof userId !== "undefined") {
1499
1565
  payload["userId"] = userId;