react-native-appwrite 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/sdk.js CHANGED
@@ -78,7 +78,7 @@ class Client {
78
78
  'x-sdk-name': 'React Native',
79
79
  'x-sdk-platform': 'client',
80
80
  'x-sdk-language': 'reactnative',
81
- 'x-sdk-version': '0.14.0',
81
+ 'x-sdk-version': '0.16.0',
82
82
  'X-Appwrite-Response-Format': '1.8.0',
83
83
  };
84
84
  this.realtime = {
@@ -1716,6 +1716,30 @@ class Account extends Service {
1716
1716
  'content-type': 'application/json',
1717
1717
  }, payload);
1718
1718
  }
1719
+ createEmailVerification(paramsOrFirst) {
1720
+ let params;
1721
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1722
+ params = (paramsOrFirst || {});
1723
+ }
1724
+ else {
1725
+ params = {
1726
+ url: paramsOrFirst
1727
+ };
1728
+ }
1729
+ const url = params.url;
1730
+ if (typeof url === 'undefined') {
1731
+ throw new AppwriteException('Missing required parameter: "url"');
1732
+ }
1733
+ const apiPath = '/account/verifications/email';
1734
+ const payload = {};
1735
+ if (typeof url !== 'undefined') {
1736
+ payload['url'] = url;
1737
+ }
1738
+ const uri = new URL(this.client.config.endpoint + apiPath);
1739
+ return this.client.call('post', uri, {
1740
+ 'content-type': 'application/json',
1741
+ }, payload);
1742
+ }
1719
1743
  createVerification(paramsOrFirst) {
1720
1744
  let params;
1721
1745
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -1730,7 +1754,7 @@ class Account extends Service {
1730
1754
  if (typeof url === 'undefined') {
1731
1755
  throw new AppwriteException('Missing required parameter: "url"');
1732
1756
  }
1733
- const apiPath = '/account/verification';
1757
+ const apiPath = '/account/verifications/email';
1734
1758
  const payload = {};
1735
1759
  if (typeof url !== 'undefined') {
1736
1760
  payload['url'] = url;
@@ -1740,6 +1764,38 @@ class Account extends Service {
1740
1764
  'content-type': 'application/json',
1741
1765
  }, payload);
1742
1766
  }
1767
+ updateEmailVerification(paramsOrFirst, ...rest) {
1768
+ let params;
1769
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1770
+ params = (paramsOrFirst || {});
1771
+ }
1772
+ else {
1773
+ params = {
1774
+ userId: paramsOrFirst,
1775
+ secret: rest[0]
1776
+ };
1777
+ }
1778
+ const userId = params.userId;
1779
+ const secret = params.secret;
1780
+ if (typeof userId === 'undefined') {
1781
+ throw new AppwriteException('Missing required parameter: "userId"');
1782
+ }
1783
+ if (typeof secret === 'undefined') {
1784
+ throw new AppwriteException('Missing required parameter: "secret"');
1785
+ }
1786
+ const apiPath = '/account/verifications/email';
1787
+ const payload = {};
1788
+ if (typeof userId !== 'undefined') {
1789
+ payload['userId'] = userId;
1790
+ }
1791
+ if (typeof secret !== 'undefined') {
1792
+ payload['secret'] = secret;
1793
+ }
1794
+ const uri = new URL(this.client.config.endpoint + apiPath);
1795
+ return this.client.call('put', uri, {
1796
+ 'content-type': 'application/json',
1797
+ }, payload);
1798
+ }
1743
1799
  updateVerification(paramsOrFirst, ...rest) {
1744
1800
  let params;
1745
1801
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -1759,7 +1815,7 @@ class Account extends Service {
1759
1815
  if (typeof secret === 'undefined') {
1760
1816
  throw new AppwriteException('Missing required parameter: "secret"');
1761
1817
  }
1762
- const apiPath = '/account/verification';
1818
+ const apiPath = '/account/verifications/email';
1763
1819
  const payload = {};
1764
1820
  if (typeof userId !== 'undefined') {
1765
1821
  payload['userId'] = userId;
@@ -1779,7 +1835,7 @@ class Account extends Service {
1779
1835
  * @returns {Promise}
1780
1836
  */
1781
1837
  createPhoneVerification() {
1782
- const apiPath = '/account/verification/phone';
1838
+ const apiPath = '/account/verifications/phone';
1783
1839
  const payload = {};
1784
1840
  const uri = new URL(this.client.config.endpoint + apiPath);
1785
1841
  return this.client.call('post', uri, {
@@ -1805,7 +1861,7 @@ class Account extends Service {
1805
1861
  if (typeof secret === 'undefined') {
1806
1862
  throw new AppwriteException('Missing required parameter: "secret"');
1807
1863
  }
1808
- const apiPath = '/account/verification/phone';
1864
+ const apiPath = '/account/verifications/phone';
1809
1865
  const payload = {};
1810
1866
  if (typeof userId !== 'undefined') {
1811
1867
  payload['userId'] = userId;