react-native-appwrite 0.15.0 → 0.17.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/sdk.js +431 -21
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +431 -21
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/docs/examples/account/create-email-verification.md +13 -0
  7. package/docs/examples/account/update-email-verification.md +14 -0
  8. package/docs/examples/databases/create-document.md +2 -1
  9. package/docs/examples/databases/create-operations.md +24 -0
  10. package/docs/examples/databases/create-transaction.md +13 -0
  11. package/docs/examples/databases/decrement-document-attribute.md +2 -1
  12. package/docs/examples/databases/delete-document.md +2 -1
  13. package/docs/examples/databases/delete-transaction.md +13 -0
  14. package/docs/examples/databases/get-document.md +2 -1
  15. package/docs/examples/databases/get-transaction.md +13 -0
  16. package/docs/examples/databases/increment-document-attribute.md +2 -1
  17. package/docs/examples/databases/list-documents.md +2 -1
  18. package/docs/examples/databases/list-transactions.md +13 -0
  19. package/docs/examples/databases/update-document.md +2 -1
  20. package/docs/examples/databases/update-transaction.md +15 -0
  21. package/docs/examples/databases/upsert-document.md +2 -1
  22. package/docs/examples/tablesdb/create-operations.md +24 -0
  23. package/docs/examples/tablesdb/create-row.md +2 -1
  24. package/docs/examples/tablesdb/create-transaction.md +13 -0
  25. package/docs/examples/tablesdb/decrement-row-column.md +2 -1
  26. package/docs/examples/tablesdb/delete-row.md +2 -1
  27. package/docs/examples/tablesdb/delete-transaction.md +13 -0
  28. package/docs/examples/tablesdb/get-row.md +2 -1
  29. package/docs/examples/tablesdb/get-transaction.md +13 -0
  30. package/docs/examples/tablesdb/increment-row-column.md +2 -1
  31. package/docs/examples/tablesdb/list-rows.md +2 -1
  32. package/docs/examples/tablesdb/list-transactions.md +13 -0
  33. package/docs/examples/tablesdb/update-row.md +2 -1
  34. package/docs/examples/tablesdb/update-transaction.md +15 -0
  35. package/docs/examples/tablesdb/upsert-row.md +2 -1
  36. package/package.json +1 -1
  37. package/src/client.ts +1 -1
  38. package/src/models.ts +44 -0
  39. package/src/services/account.ts +123 -4
  40. package/src/services/databases.ts +414 -56
  41. package/src/services/tables-db.ts +426 -68
  42. package/types/models.d.ts +42 -0
  43. package/types/services/account.d.ts +49 -0
  44. package/types/services/databases.d.ts +155 -8
  45. package/types/services/tables-db.d.ts +167 -20
package/dist/cjs/sdk.js CHANGED
@@ -100,7 +100,7 @@ class Client {
100
100
  'x-sdk-name': 'React Native',
101
101
  'x-sdk-platform': 'client',
102
102
  'x-sdk-language': 'reactnative',
103
- 'x-sdk-version': '0.15.0',
103
+ 'x-sdk-version': '0.17.1',
104
104
  'X-Appwrite-Response-Format': '1.8.0',
105
105
  };
106
106
  this.realtime = {
@@ -1738,6 +1738,30 @@ class Account extends Service {
1738
1738
  'content-type': 'application/json',
1739
1739
  }, payload);
1740
1740
  }
1741
+ createEmailVerification(paramsOrFirst) {
1742
+ let params;
1743
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1744
+ params = (paramsOrFirst || {});
1745
+ }
1746
+ else {
1747
+ params = {
1748
+ url: paramsOrFirst
1749
+ };
1750
+ }
1751
+ const url = params.url;
1752
+ if (typeof url === 'undefined') {
1753
+ throw new AppwriteException('Missing required parameter: "url"');
1754
+ }
1755
+ const apiPath = '/account/verifications/email';
1756
+ const payload = {};
1757
+ if (typeof url !== 'undefined') {
1758
+ payload['url'] = url;
1759
+ }
1760
+ const uri = new URL(this.client.config.endpoint + apiPath);
1761
+ return this.client.call('post', uri, {
1762
+ 'content-type': 'application/json',
1763
+ }, payload);
1764
+ }
1741
1765
  createVerification(paramsOrFirst) {
1742
1766
  let params;
1743
1767
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -1752,7 +1776,7 @@ class Account extends Service {
1752
1776
  if (typeof url === 'undefined') {
1753
1777
  throw new AppwriteException('Missing required parameter: "url"');
1754
1778
  }
1755
- const apiPath = '/account/verification';
1779
+ const apiPath = '/account/verifications/email';
1756
1780
  const payload = {};
1757
1781
  if (typeof url !== 'undefined') {
1758
1782
  payload['url'] = url;
@@ -1762,6 +1786,38 @@ class Account extends Service {
1762
1786
  'content-type': 'application/json',
1763
1787
  }, payload);
1764
1788
  }
1789
+ updateEmailVerification(paramsOrFirst, ...rest) {
1790
+ let params;
1791
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1792
+ params = (paramsOrFirst || {});
1793
+ }
1794
+ else {
1795
+ params = {
1796
+ userId: paramsOrFirst,
1797
+ secret: rest[0]
1798
+ };
1799
+ }
1800
+ const userId = params.userId;
1801
+ const secret = params.secret;
1802
+ if (typeof userId === 'undefined') {
1803
+ throw new AppwriteException('Missing required parameter: "userId"');
1804
+ }
1805
+ if (typeof secret === 'undefined') {
1806
+ throw new AppwriteException('Missing required parameter: "secret"');
1807
+ }
1808
+ const apiPath = '/account/verifications/email';
1809
+ const payload = {};
1810
+ if (typeof userId !== 'undefined') {
1811
+ payload['userId'] = userId;
1812
+ }
1813
+ if (typeof secret !== 'undefined') {
1814
+ payload['secret'] = secret;
1815
+ }
1816
+ const uri = new URL(this.client.config.endpoint + apiPath);
1817
+ return this.client.call('put', uri, {
1818
+ 'content-type': 'application/json',
1819
+ }, payload);
1820
+ }
1765
1821
  updateVerification(paramsOrFirst, ...rest) {
1766
1822
  let params;
1767
1823
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -1781,7 +1837,7 @@ class Account extends Service {
1781
1837
  if (typeof secret === 'undefined') {
1782
1838
  throw new AppwriteException('Missing required parameter: "secret"');
1783
1839
  }
1784
- const apiPath = '/account/verification';
1840
+ const apiPath = '/account/verifications/email';
1785
1841
  const payload = {};
1786
1842
  if (typeof userId !== 'undefined') {
1787
1843
  payload['userId'] = userId;
@@ -1801,7 +1857,7 @@ class Account extends Service {
1801
1857
  * @returns {Promise}
1802
1858
  */
1803
1859
  createPhoneVerification() {
1804
- const apiPath = '/account/verification/phone';
1860
+ const apiPath = '/account/verifications/phone';
1805
1861
  const payload = {};
1806
1862
  const uri = new URL(this.client.config.endpoint + apiPath);
1807
1863
  return this.client.call('post', uri, {
@@ -1827,7 +1883,7 @@ class Account extends Service {
1827
1883
  if (typeof secret === 'undefined') {
1828
1884
  throw new AppwriteException('Missing required parameter: "secret"');
1829
1885
  }
1830
- const apiPath = '/account/verification/phone';
1886
+ const apiPath = '/account/verifications/phone';
1831
1887
  const payload = {};
1832
1888
  if (typeof userId !== 'undefined') {
1833
1889
  payload['userId'] = userId;
@@ -2362,6 +2418,143 @@ class Databases extends Service {
2362
2418
  constructor(client) {
2363
2419
  super(client);
2364
2420
  }
2421
+ listTransactions(paramsOrFirst) {
2422
+ let params;
2423
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2424
+ params = (paramsOrFirst || {});
2425
+ }
2426
+ else {
2427
+ params = {
2428
+ queries: paramsOrFirst
2429
+ };
2430
+ }
2431
+ const queries = params.queries;
2432
+ const apiPath = '/databases/transactions';
2433
+ const payload = {};
2434
+ if (typeof queries !== 'undefined') {
2435
+ payload['queries'] = queries;
2436
+ }
2437
+ const uri = new URL(this.client.config.endpoint + apiPath);
2438
+ return this.client.call('get', uri, {}, payload);
2439
+ }
2440
+ createTransaction(paramsOrFirst) {
2441
+ let params;
2442
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2443
+ params = (paramsOrFirst || {});
2444
+ }
2445
+ else {
2446
+ params = {
2447
+ ttl: paramsOrFirst
2448
+ };
2449
+ }
2450
+ const ttl = params.ttl;
2451
+ const apiPath = '/databases/transactions';
2452
+ const payload = {};
2453
+ if (typeof ttl !== 'undefined') {
2454
+ payload['ttl'] = ttl;
2455
+ }
2456
+ const uri = new URL(this.client.config.endpoint + apiPath);
2457
+ return this.client.call('post', uri, {
2458
+ 'content-type': 'application/json',
2459
+ }, payload);
2460
+ }
2461
+ getTransaction(paramsOrFirst) {
2462
+ let params;
2463
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2464
+ params = (paramsOrFirst || {});
2465
+ }
2466
+ else {
2467
+ params = {
2468
+ transactionId: paramsOrFirst
2469
+ };
2470
+ }
2471
+ const transactionId = params.transactionId;
2472
+ if (typeof transactionId === 'undefined') {
2473
+ throw new AppwriteException('Missing required parameter: "transactionId"');
2474
+ }
2475
+ const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', transactionId);
2476
+ const payload = {};
2477
+ const uri = new URL(this.client.config.endpoint + apiPath);
2478
+ return this.client.call('get', uri, {}, payload);
2479
+ }
2480
+ updateTransaction(paramsOrFirst, ...rest) {
2481
+ let params;
2482
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2483
+ params = (paramsOrFirst || {});
2484
+ }
2485
+ else {
2486
+ params = {
2487
+ transactionId: paramsOrFirst,
2488
+ commit: rest[0],
2489
+ rollback: rest[1]
2490
+ };
2491
+ }
2492
+ const transactionId = params.transactionId;
2493
+ const commit = params.commit;
2494
+ const rollback = params.rollback;
2495
+ if (typeof transactionId === 'undefined') {
2496
+ throw new AppwriteException('Missing required parameter: "transactionId"');
2497
+ }
2498
+ const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', transactionId);
2499
+ const payload = {};
2500
+ if (typeof commit !== 'undefined') {
2501
+ payload['commit'] = commit;
2502
+ }
2503
+ if (typeof rollback !== 'undefined') {
2504
+ payload['rollback'] = rollback;
2505
+ }
2506
+ const uri = new URL(this.client.config.endpoint + apiPath);
2507
+ return this.client.call('patch', uri, {
2508
+ 'content-type': 'application/json',
2509
+ }, payload);
2510
+ }
2511
+ deleteTransaction(paramsOrFirst) {
2512
+ let params;
2513
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2514
+ params = (paramsOrFirst || {});
2515
+ }
2516
+ else {
2517
+ params = {
2518
+ transactionId: paramsOrFirst
2519
+ };
2520
+ }
2521
+ const transactionId = params.transactionId;
2522
+ if (typeof transactionId === 'undefined') {
2523
+ throw new AppwriteException('Missing required parameter: "transactionId"');
2524
+ }
2525
+ const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', transactionId);
2526
+ const payload = {};
2527
+ const uri = new URL(this.client.config.endpoint + apiPath);
2528
+ return this.client.call('delete', uri, {
2529
+ 'content-type': 'application/json',
2530
+ }, payload);
2531
+ }
2532
+ createOperations(paramsOrFirst, ...rest) {
2533
+ let params;
2534
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2535
+ params = (paramsOrFirst || {});
2536
+ }
2537
+ else {
2538
+ params = {
2539
+ transactionId: paramsOrFirst,
2540
+ operations: rest[0]
2541
+ };
2542
+ }
2543
+ const transactionId = params.transactionId;
2544
+ const operations = params.operations;
2545
+ if (typeof transactionId === 'undefined') {
2546
+ throw new AppwriteException('Missing required parameter: "transactionId"');
2547
+ }
2548
+ const apiPath = '/databases/transactions/{transactionId}/operations'.replace('{transactionId}', transactionId);
2549
+ const payload = {};
2550
+ if (typeof operations !== 'undefined') {
2551
+ payload['operations'] = operations;
2552
+ }
2553
+ const uri = new URL(this.client.config.endpoint + apiPath);
2554
+ return this.client.call('post', uri, {
2555
+ 'content-type': 'application/json',
2556
+ }, payload);
2557
+ }
2365
2558
  listDocuments(paramsOrFirst, ...rest) {
2366
2559
  let params;
2367
2560
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -2371,12 +2564,14 @@ class Databases extends Service {
2371
2564
  params = {
2372
2565
  databaseId: paramsOrFirst,
2373
2566
  collectionId: rest[0],
2374
- queries: rest[1]
2567
+ queries: rest[1],
2568
+ transactionId: rest[2]
2375
2569
  };
2376
2570
  }
2377
2571
  const databaseId = params.databaseId;
2378
2572
  const collectionId = params.collectionId;
2379
2573
  const queries = params.queries;
2574
+ const transactionId = params.transactionId;
2380
2575
  if (typeof databaseId === 'undefined') {
2381
2576
  throw new AppwriteException('Missing required parameter: "databaseId"');
2382
2577
  }
@@ -2388,6 +2583,9 @@ class Databases extends Service {
2388
2583
  if (typeof queries !== 'undefined') {
2389
2584
  payload['queries'] = queries;
2390
2585
  }
2586
+ if (typeof transactionId !== 'undefined') {
2587
+ payload['transactionId'] = transactionId;
2588
+ }
2391
2589
  const uri = new URL(this.client.config.endpoint + apiPath);
2392
2590
  return this.client.call('get', uri, {}, payload);
2393
2591
  }
@@ -2402,7 +2600,8 @@ class Databases extends Service {
2402
2600
  collectionId: rest[0],
2403
2601
  documentId: rest[1],
2404
2602
  data: rest[2],
2405
- permissions: rest[3]
2603
+ permissions: rest[3],
2604
+ transactionId: rest[4]
2406
2605
  };
2407
2606
  }
2408
2607
  const databaseId = params.databaseId;
@@ -2410,6 +2609,7 @@ class Databases extends Service {
2410
2609
  const documentId = params.documentId;
2411
2610
  const data = params.data;
2412
2611
  const permissions = params.permissions;
2612
+ const transactionId = params.transactionId;
2413
2613
  if (typeof databaseId === 'undefined') {
2414
2614
  throw new AppwriteException('Missing required parameter: "databaseId"');
2415
2615
  }
@@ -2433,6 +2633,9 @@ class Databases extends Service {
2433
2633
  if (typeof permissions !== 'undefined') {
2434
2634
  payload['permissions'] = permissions;
2435
2635
  }
2636
+ if (typeof transactionId !== 'undefined') {
2637
+ payload['transactionId'] = transactionId;
2638
+ }
2436
2639
  const uri = new URL(this.client.config.endpoint + apiPath);
2437
2640
  return this.client.call('post', uri, {
2438
2641
  'content-type': 'application/json',
@@ -2448,13 +2651,15 @@ class Databases extends Service {
2448
2651
  databaseId: paramsOrFirst,
2449
2652
  collectionId: rest[0],
2450
2653
  documentId: rest[1],
2451
- queries: rest[2]
2654
+ queries: rest[2],
2655
+ transactionId: rest[3]
2452
2656
  };
2453
2657
  }
2454
2658
  const databaseId = params.databaseId;
2455
2659
  const collectionId = params.collectionId;
2456
2660
  const documentId = params.documentId;
2457
2661
  const queries = params.queries;
2662
+ const transactionId = params.transactionId;
2458
2663
  if (typeof databaseId === 'undefined') {
2459
2664
  throw new AppwriteException('Missing required parameter: "databaseId"');
2460
2665
  }
@@ -2469,6 +2674,9 @@ class Databases extends Service {
2469
2674
  if (typeof queries !== 'undefined') {
2470
2675
  payload['queries'] = queries;
2471
2676
  }
2677
+ if (typeof transactionId !== 'undefined') {
2678
+ payload['transactionId'] = transactionId;
2679
+ }
2472
2680
  const uri = new URL(this.client.config.endpoint + apiPath);
2473
2681
  return this.client.call('get', uri, {}, payload);
2474
2682
  }
@@ -2483,7 +2691,8 @@ class Databases extends Service {
2483
2691
  collectionId: rest[0],
2484
2692
  documentId: rest[1],
2485
2693
  data: rest[2],
2486
- permissions: rest[3]
2694
+ permissions: rest[3],
2695
+ transactionId: rest[4]
2487
2696
  };
2488
2697
  }
2489
2698
  const databaseId = params.databaseId;
@@ -2491,6 +2700,7 @@ class Databases extends Service {
2491
2700
  const documentId = params.documentId;
2492
2701
  const data = params.data;
2493
2702
  const permissions = params.permissions;
2703
+ const transactionId = params.transactionId;
2494
2704
  if (typeof databaseId === 'undefined') {
2495
2705
  throw new AppwriteException('Missing required parameter: "databaseId"');
2496
2706
  }
@@ -2511,6 +2721,9 @@ class Databases extends Service {
2511
2721
  if (typeof permissions !== 'undefined') {
2512
2722
  payload['permissions'] = permissions;
2513
2723
  }
2724
+ if (typeof transactionId !== 'undefined') {
2725
+ payload['transactionId'] = transactionId;
2726
+ }
2514
2727
  const uri = new URL(this.client.config.endpoint + apiPath);
2515
2728
  return this.client.call('put', uri, {
2516
2729
  'content-type': 'application/json',
@@ -2527,7 +2740,8 @@ class Databases extends Service {
2527
2740
  collectionId: rest[0],
2528
2741
  documentId: rest[1],
2529
2742
  data: rest[2],
2530
- permissions: rest[3]
2743
+ permissions: rest[3],
2744
+ transactionId: rest[4]
2531
2745
  };
2532
2746
  }
2533
2747
  const databaseId = params.databaseId;
@@ -2535,6 +2749,7 @@ class Databases extends Service {
2535
2749
  const documentId = params.documentId;
2536
2750
  const data = params.data;
2537
2751
  const permissions = params.permissions;
2752
+ const transactionId = params.transactionId;
2538
2753
  if (typeof databaseId === 'undefined') {
2539
2754
  throw new AppwriteException('Missing required parameter: "databaseId"');
2540
2755
  }
@@ -2552,6 +2767,9 @@ class Databases extends Service {
2552
2767
  if (typeof permissions !== 'undefined') {
2553
2768
  payload['permissions'] = permissions;
2554
2769
  }
2770
+ if (typeof transactionId !== 'undefined') {
2771
+ payload['transactionId'] = transactionId;
2772
+ }
2555
2773
  const uri = new URL(this.client.config.endpoint + apiPath);
2556
2774
  return this.client.call('patch', uri, {
2557
2775
  'content-type': 'application/json',
@@ -2566,12 +2784,14 @@ class Databases extends Service {
2566
2784
  params = {
2567
2785
  databaseId: paramsOrFirst,
2568
2786
  collectionId: rest[0],
2569
- documentId: rest[1]
2787
+ documentId: rest[1],
2788
+ transactionId: rest[2]
2570
2789
  };
2571
2790
  }
2572
2791
  const databaseId = params.databaseId;
2573
2792
  const collectionId = params.collectionId;
2574
2793
  const documentId = params.documentId;
2794
+ const transactionId = params.transactionId;
2575
2795
  if (typeof databaseId === 'undefined') {
2576
2796
  throw new AppwriteException('Missing required parameter: "databaseId"');
2577
2797
  }
@@ -2583,6 +2803,9 @@ class Databases extends Service {
2583
2803
  }
2584
2804
  const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2585
2805
  const payload = {};
2806
+ if (typeof transactionId !== 'undefined') {
2807
+ payload['transactionId'] = transactionId;
2808
+ }
2586
2809
  const uri = new URL(this.client.config.endpoint + apiPath);
2587
2810
  return this.client.call('delete', uri, {
2588
2811
  'content-type': 'application/json',
@@ -2600,7 +2823,8 @@ class Databases extends Service {
2600
2823
  documentId: rest[1],
2601
2824
  attribute: rest[2],
2602
2825
  value: rest[3],
2603
- min: rest[4]
2826
+ min: rest[4],
2827
+ transactionId: rest[5]
2604
2828
  };
2605
2829
  }
2606
2830
  const databaseId = params.databaseId;
@@ -2609,6 +2833,7 @@ class Databases extends Service {
2609
2833
  const attribute = params.attribute;
2610
2834
  const value = params.value;
2611
2835
  const min = params.min;
2836
+ const transactionId = params.transactionId;
2612
2837
  if (typeof databaseId === 'undefined') {
2613
2838
  throw new AppwriteException('Missing required parameter: "databaseId"');
2614
2839
  }
@@ -2629,6 +2854,9 @@ class Databases extends Service {
2629
2854
  if (typeof min !== 'undefined') {
2630
2855
  payload['min'] = min;
2631
2856
  }
2857
+ if (typeof transactionId !== 'undefined') {
2858
+ payload['transactionId'] = transactionId;
2859
+ }
2632
2860
  const uri = new URL(this.client.config.endpoint + apiPath);
2633
2861
  return this.client.call('patch', uri, {
2634
2862
  'content-type': 'application/json',
@@ -2646,7 +2874,8 @@ class Databases extends Service {
2646
2874
  documentId: rest[1],
2647
2875
  attribute: rest[2],
2648
2876
  value: rest[3],
2649
- max: rest[4]
2877
+ max: rest[4],
2878
+ transactionId: rest[5]
2650
2879
  };
2651
2880
  }
2652
2881
  const databaseId = params.databaseId;
@@ -2655,6 +2884,7 @@ class Databases extends Service {
2655
2884
  const attribute = params.attribute;
2656
2885
  const value = params.value;
2657
2886
  const max = params.max;
2887
+ const transactionId = params.transactionId;
2658
2888
  if (typeof databaseId === 'undefined') {
2659
2889
  throw new AppwriteException('Missing required parameter: "databaseId"');
2660
2890
  }
@@ -2675,6 +2905,9 @@ class Databases extends Service {
2675
2905
  if (typeof max !== 'undefined') {
2676
2906
  payload['max'] = max;
2677
2907
  }
2908
+ if (typeof transactionId !== 'undefined') {
2909
+ payload['transactionId'] = transactionId;
2910
+ }
2678
2911
  const uri = new URL(this.client.config.endpoint + apiPath);
2679
2912
  return this.client.call('patch', uri, {
2680
2913
  'content-type': 'application/json',
@@ -3505,6 +3738,143 @@ class TablesDB extends Service {
3505
3738
  constructor(client) {
3506
3739
  super(client);
3507
3740
  }
3741
+ listTransactions(paramsOrFirst) {
3742
+ let params;
3743
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3744
+ params = (paramsOrFirst || {});
3745
+ }
3746
+ else {
3747
+ params = {
3748
+ queries: paramsOrFirst
3749
+ };
3750
+ }
3751
+ const queries = params.queries;
3752
+ const apiPath = '/tablesdb/transactions';
3753
+ const payload = {};
3754
+ if (typeof queries !== 'undefined') {
3755
+ payload['queries'] = queries;
3756
+ }
3757
+ const uri = new URL(this.client.config.endpoint + apiPath);
3758
+ return this.client.call('get', uri, {}, payload);
3759
+ }
3760
+ createTransaction(paramsOrFirst) {
3761
+ let params;
3762
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3763
+ params = (paramsOrFirst || {});
3764
+ }
3765
+ else {
3766
+ params = {
3767
+ ttl: paramsOrFirst
3768
+ };
3769
+ }
3770
+ const ttl = params.ttl;
3771
+ const apiPath = '/tablesdb/transactions';
3772
+ const payload = {};
3773
+ if (typeof ttl !== 'undefined') {
3774
+ payload['ttl'] = ttl;
3775
+ }
3776
+ const uri = new URL(this.client.config.endpoint + apiPath);
3777
+ return this.client.call('post', uri, {
3778
+ 'content-type': 'application/json',
3779
+ }, payload);
3780
+ }
3781
+ getTransaction(paramsOrFirst) {
3782
+ let params;
3783
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3784
+ params = (paramsOrFirst || {});
3785
+ }
3786
+ else {
3787
+ params = {
3788
+ transactionId: paramsOrFirst
3789
+ };
3790
+ }
3791
+ const transactionId = params.transactionId;
3792
+ if (typeof transactionId === 'undefined') {
3793
+ throw new AppwriteException('Missing required parameter: "transactionId"');
3794
+ }
3795
+ const apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', transactionId);
3796
+ const payload = {};
3797
+ const uri = new URL(this.client.config.endpoint + apiPath);
3798
+ return this.client.call('get', uri, {}, payload);
3799
+ }
3800
+ updateTransaction(paramsOrFirst, ...rest) {
3801
+ let params;
3802
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3803
+ params = (paramsOrFirst || {});
3804
+ }
3805
+ else {
3806
+ params = {
3807
+ transactionId: paramsOrFirst,
3808
+ commit: rest[0],
3809
+ rollback: rest[1]
3810
+ };
3811
+ }
3812
+ const transactionId = params.transactionId;
3813
+ const commit = params.commit;
3814
+ const rollback = params.rollback;
3815
+ if (typeof transactionId === 'undefined') {
3816
+ throw new AppwriteException('Missing required parameter: "transactionId"');
3817
+ }
3818
+ const apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', transactionId);
3819
+ const payload = {};
3820
+ if (typeof commit !== 'undefined') {
3821
+ payload['commit'] = commit;
3822
+ }
3823
+ if (typeof rollback !== 'undefined') {
3824
+ payload['rollback'] = rollback;
3825
+ }
3826
+ const uri = new URL(this.client.config.endpoint + apiPath);
3827
+ return this.client.call('patch', uri, {
3828
+ 'content-type': 'application/json',
3829
+ }, payload);
3830
+ }
3831
+ deleteTransaction(paramsOrFirst) {
3832
+ let params;
3833
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3834
+ params = (paramsOrFirst || {});
3835
+ }
3836
+ else {
3837
+ params = {
3838
+ transactionId: paramsOrFirst
3839
+ };
3840
+ }
3841
+ const transactionId = params.transactionId;
3842
+ if (typeof transactionId === 'undefined') {
3843
+ throw new AppwriteException('Missing required parameter: "transactionId"');
3844
+ }
3845
+ const apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', transactionId);
3846
+ const payload = {};
3847
+ const uri = new URL(this.client.config.endpoint + apiPath);
3848
+ return this.client.call('delete', uri, {
3849
+ 'content-type': 'application/json',
3850
+ }, payload);
3851
+ }
3852
+ createOperations(paramsOrFirst, ...rest) {
3853
+ let params;
3854
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3855
+ params = (paramsOrFirst || {});
3856
+ }
3857
+ else {
3858
+ params = {
3859
+ transactionId: paramsOrFirst,
3860
+ operations: rest[0]
3861
+ };
3862
+ }
3863
+ const transactionId = params.transactionId;
3864
+ const operations = params.operations;
3865
+ if (typeof transactionId === 'undefined') {
3866
+ throw new AppwriteException('Missing required parameter: "transactionId"');
3867
+ }
3868
+ const apiPath = '/tablesdb/transactions/{transactionId}/operations'.replace('{transactionId}', transactionId);
3869
+ const payload = {};
3870
+ if (typeof operations !== 'undefined') {
3871
+ payload['operations'] = operations;
3872
+ }
3873
+ const uri = new URL(this.client.config.endpoint + apiPath);
3874
+ return this.client.call('post', uri, {
3875
+ 'content-type': 'application/json',
3876
+ }, payload);
3877
+ }
3508
3878
  listRows(paramsOrFirst, ...rest) {
3509
3879
  let params;
3510
3880
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -3514,12 +3884,14 @@ class TablesDB extends Service {
3514
3884
  params = {
3515
3885
  databaseId: paramsOrFirst,
3516
3886
  tableId: rest[0],
3517
- queries: rest[1]
3887
+ queries: rest[1],
3888
+ transactionId: rest[2]
3518
3889
  };
3519
3890
  }
3520
3891
  const databaseId = params.databaseId;
3521
3892
  const tableId = params.tableId;
3522
3893
  const queries = params.queries;
3894
+ const transactionId = params.transactionId;
3523
3895
  if (typeof databaseId === 'undefined') {
3524
3896
  throw new AppwriteException('Missing required parameter: "databaseId"');
3525
3897
  }
@@ -3531,6 +3903,9 @@ class TablesDB extends Service {
3531
3903
  if (typeof queries !== 'undefined') {
3532
3904
  payload['queries'] = queries;
3533
3905
  }
3906
+ if (typeof transactionId !== 'undefined') {
3907
+ payload['transactionId'] = transactionId;
3908
+ }
3534
3909
  const uri = new URL(this.client.config.endpoint + apiPath);
3535
3910
  return this.client.call('get', uri, {}, payload);
3536
3911
  }
@@ -3545,7 +3920,8 @@ class TablesDB extends Service {
3545
3920
  tableId: rest[0],
3546
3921
  rowId: rest[1],
3547
3922
  data: rest[2],
3548
- permissions: rest[3]
3923
+ permissions: rest[3],
3924
+ transactionId: rest[4]
3549
3925
  };
3550
3926
  }
3551
3927
  const databaseId = params.databaseId;
@@ -3553,6 +3929,7 @@ class TablesDB extends Service {
3553
3929
  const rowId = params.rowId;
3554
3930
  const data = params.data;
3555
3931
  const permissions = params.permissions;
3932
+ const transactionId = params.transactionId;
3556
3933
  if (typeof databaseId === 'undefined') {
3557
3934
  throw new AppwriteException('Missing required parameter: "databaseId"');
3558
3935
  }
@@ -3576,6 +3953,9 @@ class TablesDB extends Service {
3576
3953
  if (typeof permissions !== 'undefined') {
3577
3954
  payload['permissions'] = permissions;
3578
3955
  }
3956
+ if (typeof transactionId !== 'undefined') {
3957
+ payload['transactionId'] = transactionId;
3958
+ }
3579
3959
  const uri = new URL(this.client.config.endpoint + apiPath);
3580
3960
  return this.client.call('post', uri, {
3581
3961
  'content-type': 'application/json',
@@ -3591,13 +3971,15 @@ class TablesDB extends Service {
3591
3971
  databaseId: paramsOrFirst,
3592
3972
  tableId: rest[0],
3593
3973
  rowId: rest[1],
3594
- queries: rest[2]
3974
+ queries: rest[2],
3975
+ transactionId: rest[3]
3595
3976
  };
3596
3977
  }
3597
3978
  const databaseId = params.databaseId;
3598
3979
  const tableId = params.tableId;
3599
3980
  const rowId = params.rowId;
3600
3981
  const queries = params.queries;
3982
+ const transactionId = params.transactionId;
3601
3983
  if (typeof databaseId === 'undefined') {
3602
3984
  throw new AppwriteException('Missing required parameter: "databaseId"');
3603
3985
  }
@@ -3612,6 +3994,9 @@ class TablesDB extends Service {
3612
3994
  if (typeof queries !== 'undefined') {
3613
3995
  payload['queries'] = queries;
3614
3996
  }
3997
+ if (typeof transactionId !== 'undefined') {
3998
+ payload['transactionId'] = transactionId;
3999
+ }
3615
4000
  const uri = new URL(this.client.config.endpoint + apiPath);
3616
4001
  return this.client.call('get', uri, {}, payload);
3617
4002
  }
@@ -3626,7 +4011,8 @@ class TablesDB extends Service {
3626
4011
  tableId: rest[0],
3627
4012
  rowId: rest[1],
3628
4013
  data: rest[2],
3629
- permissions: rest[3]
4014
+ permissions: rest[3],
4015
+ transactionId: rest[4]
3630
4016
  };
3631
4017
  }
3632
4018
  const databaseId = params.databaseId;
@@ -3634,6 +4020,7 @@ class TablesDB extends Service {
3634
4020
  const rowId = params.rowId;
3635
4021
  const data = params.data;
3636
4022
  const permissions = params.permissions;
4023
+ const transactionId = params.transactionId;
3637
4024
  if (typeof databaseId === 'undefined') {
3638
4025
  throw new AppwriteException('Missing required parameter: "databaseId"');
3639
4026
  }
@@ -3651,6 +4038,9 @@ class TablesDB extends Service {
3651
4038
  if (typeof permissions !== 'undefined') {
3652
4039
  payload['permissions'] = permissions;
3653
4040
  }
4041
+ if (typeof transactionId !== 'undefined') {
4042
+ payload['transactionId'] = transactionId;
4043
+ }
3654
4044
  const uri = new URL(this.client.config.endpoint + apiPath);
3655
4045
  return this.client.call('put', uri, {
3656
4046
  'content-type': 'application/json',
@@ -3667,7 +4057,8 @@ class TablesDB extends Service {
3667
4057
  tableId: rest[0],
3668
4058
  rowId: rest[1],
3669
4059
  data: rest[2],
3670
- permissions: rest[3]
4060
+ permissions: rest[3],
4061
+ transactionId: rest[4]
3671
4062
  };
3672
4063
  }
3673
4064
  const databaseId = params.databaseId;
@@ -3675,6 +4066,7 @@ class TablesDB extends Service {
3675
4066
  const rowId = params.rowId;
3676
4067
  const data = params.data;
3677
4068
  const permissions = params.permissions;
4069
+ const transactionId = params.transactionId;
3678
4070
  if (typeof databaseId === 'undefined') {
3679
4071
  throw new AppwriteException('Missing required parameter: "databaseId"');
3680
4072
  }
@@ -3692,6 +4084,9 @@ class TablesDB extends Service {
3692
4084
  if (typeof permissions !== 'undefined') {
3693
4085
  payload['permissions'] = permissions;
3694
4086
  }
4087
+ if (typeof transactionId !== 'undefined') {
4088
+ payload['transactionId'] = transactionId;
4089
+ }
3695
4090
  const uri = new URL(this.client.config.endpoint + apiPath);
3696
4091
  return this.client.call('patch', uri, {
3697
4092
  'content-type': 'application/json',
@@ -3706,12 +4101,14 @@ class TablesDB extends Service {
3706
4101
  params = {
3707
4102
  databaseId: paramsOrFirst,
3708
4103
  tableId: rest[0],
3709
- rowId: rest[1]
4104
+ rowId: rest[1],
4105
+ transactionId: rest[2]
3710
4106
  };
3711
4107
  }
3712
4108
  const databaseId = params.databaseId;
3713
4109
  const tableId = params.tableId;
3714
4110
  const rowId = params.rowId;
4111
+ const transactionId = params.transactionId;
3715
4112
  if (typeof databaseId === 'undefined') {
3716
4113
  throw new AppwriteException('Missing required parameter: "databaseId"');
3717
4114
  }
@@ -3723,6 +4120,9 @@ class TablesDB extends Service {
3723
4120
  }
3724
4121
  const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
3725
4122
  const payload = {};
4123
+ if (typeof transactionId !== 'undefined') {
4124
+ payload['transactionId'] = transactionId;
4125
+ }
3726
4126
  const uri = new URL(this.client.config.endpoint + apiPath);
3727
4127
  return this.client.call('delete', uri, {
3728
4128
  'content-type': 'application/json',
@@ -3740,7 +4140,8 @@ class TablesDB extends Service {
3740
4140
  rowId: rest[1],
3741
4141
  column: rest[2],
3742
4142
  value: rest[3],
3743
- min: rest[4]
4143
+ min: rest[4],
4144
+ transactionId: rest[5]
3744
4145
  };
3745
4146
  }
3746
4147
  const databaseId = params.databaseId;
@@ -3749,6 +4150,7 @@ class TablesDB extends Service {
3749
4150
  const column = params.column;
3750
4151
  const value = params.value;
3751
4152
  const min = params.min;
4153
+ const transactionId = params.transactionId;
3752
4154
  if (typeof databaseId === 'undefined') {
3753
4155
  throw new AppwriteException('Missing required parameter: "databaseId"');
3754
4156
  }
@@ -3769,6 +4171,9 @@ class TablesDB extends Service {
3769
4171
  if (typeof min !== 'undefined') {
3770
4172
  payload['min'] = min;
3771
4173
  }
4174
+ if (typeof transactionId !== 'undefined') {
4175
+ payload['transactionId'] = transactionId;
4176
+ }
3772
4177
  const uri = new URL(this.client.config.endpoint + apiPath);
3773
4178
  return this.client.call('patch', uri, {
3774
4179
  'content-type': 'application/json',
@@ -3786,7 +4191,8 @@ class TablesDB extends Service {
3786
4191
  rowId: rest[1],
3787
4192
  column: rest[2],
3788
4193
  value: rest[3],
3789
- max: rest[4]
4194
+ max: rest[4],
4195
+ transactionId: rest[5]
3790
4196
  };
3791
4197
  }
3792
4198
  const databaseId = params.databaseId;
@@ -3795,6 +4201,7 @@ class TablesDB extends Service {
3795
4201
  const column = params.column;
3796
4202
  const value = params.value;
3797
4203
  const max = params.max;
4204
+ const transactionId = params.transactionId;
3798
4205
  if (typeof databaseId === 'undefined') {
3799
4206
  throw new AppwriteException('Missing required parameter: "databaseId"');
3800
4207
  }
@@ -3815,6 +4222,9 @@ class TablesDB extends Service {
3815
4222
  if (typeof max !== 'undefined') {
3816
4223
  payload['max'] = max;
3817
4224
  }
4225
+ if (typeof transactionId !== 'undefined') {
4226
+ payload['transactionId'] = transactionId;
4227
+ }
3818
4228
  const uri = new URL(this.client.config.endpoint + apiPath);
3819
4229
  return this.client.call('patch', uri, {
3820
4230
  'content-type': 'application/json',