node-appwrite 21.0.0 → 22.0.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.
Files changed (119) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +2 -2
  3. package/dist/client.js +37 -5
  4. package/dist/client.js.map +1 -1
  5. package/dist/client.mjs +1505 -5
  6. package/dist/client.mjs.map +1 -1
  7. package/dist/enums/browser-permission.d.mts +24 -0
  8. package/dist/enums/browser-permission.d.ts +24 -0
  9. package/dist/enums/browser-permission.js +29 -0
  10. package/dist/enums/browser-permission.js.map +1 -0
  11. package/dist/enums/browser-permission.mjs +28 -0
  12. package/dist/enums/browser-permission.mjs.map +1 -0
  13. package/dist/enums/deployment-status.d.mts +1 -0
  14. package/dist/enums/deployment-status.d.ts +1 -0
  15. package/dist/enums/deployment-status.js +1 -0
  16. package/dist/enums/deployment-status.js.map +1 -1
  17. package/dist/enums/deployment-status.mjs +1 -0
  18. package/dist/enums/deployment-status.mjs.map +1 -1
  19. package/dist/enums/name.d.mts +1 -0
  20. package/dist/enums/name.d.ts +1 -0
  21. package/dist/enums/name.js +1 -0
  22. package/dist/enums/name.js.map +1 -1
  23. package/dist/enums/name.mjs +1 -0
  24. package/dist/enums/name.mjs.map +1 -1
  25. package/dist/enums/o-auth-provider.d.mts +1 -2
  26. package/dist/enums/o-auth-provider.d.ts +1 -2
  27. package/dist/enums/o-auth-provider.js +0 -1
  28. package/dist/enums/o-auth-provider.js.map +1 -1
  29. package/dist/enums/o-auth-provider.mjs +0 -1
  30. package/dist/enums/o-auth-provider.mjs.map +1 -1
  31. package/dist/enums/order-by.d.mts +6 -0
  32. package/dist/enums/order-by.d.ts +6 -0
  33. package/dist/enums/order-by.js +11 -0
  34. package/dist/enums/order-by.js.map +1 -0
  35. package/dist/enums/order-by.mjs +10 -0
  36. package/dist/enums/order-by.mjs.map +1 -0
  37. package/dist/enums/roles.d.mts +7 -0
  38. package/dist/enums/roles.d.ts +7 -0
  39. package/dist/enums/roles.js +12 -0
  40. package/dist/enums/roles.js.map +1 -0
  41. package/dist/enums/roles.mjs +11 -0
  42. package/dist/enums/roles.mjs.map +1 -0
  43. package/dist/enums/scopes.d.mts +59 -0
  44. package/dist/enums/scopes.d.ts +59 -0
  45. package/dist/enums/scopes.js +64 -0
  46. package/dist/enums/scopes.js.map +1 -0
  47. package/dist/enums/scopes.mjs +63 -0
  48. package/dist/enums/scopes.mjs.map +1 -0
  49. package/dist/index.d.mts +5 -2
  50. package/dist/index.d.ts +5 -2
  51. package/dist/index.js +21 -6
  52. package/dist/index.js.map +1 -1
  53. package/dist/index.mjs +5 -2
  54. package/dist/index.mjs.map +1 -1
  55. package/dist/models.d.mts +367 -6
  56. package/dist/models.d.ts +367 -6
  57. package/dist/query.d.mts +38 -8
  58. package/dist/query.d.ts +38 -8
  59. package/dist/query.js +48 -7
  60. package/dist/query.js.map +1 -1
  61. package/dist/query.mjs +44 -7
  62. package/dist/query.mjs.map +1 -1
  63. package/dist/services/account.d.mts +13 -1
  64. package/dist/services/account.d.ts +13 -1
  65. package/dist/services/account.js +13 -7
  66. package/dist/services/account.js.map +1 -1
  67. package/dist/services/account.mjs +13 -7
  68. package/dist/services/account.mjs.map +1 -1
  69. package/dist/services/avatars.d.mts +9 -8
  70. package/dist/services/avatars.d.ts +9 -8
  71. package/dist/services/avatars.js.map +1 -1
  72. package/dist/services/avatars.mjs.map +1 -1
  73. package/dist/services/databases.d.mts +336 -35
  74. package/dist/services/databases.d.ts +336 -35
  75. package/dist/services/databases.js +480 -10
  76. package/dist/services/databases.js.map +1 -1
  77. package/dist/services/databases.mjs +480 -10
  78. package/dist/services/databases.mjs.map +1 -1
  79. package/dist/services/functions.d.mts +9 -8
  80. package/dist/services/functions.d.ts +9 -8
  81. package/dist/services/functions.js.map +1 -1
  82. package/dist/services/functions.mjs.map +1 -1
  83. package/dist/services/graphql.js.map +1 -1
  84. package/dist/services/graphql.mjs.map +1 -1
  85. package/dist/services/health.d.mts +25 -6
  86. package/dist/services/health.d.ts +25 -6
  87. package/dist/services/health.js +27 -3
  88. package/dist/services/health.js.map +1 -1
  89. package/dist/services/health.mjs +27 -3
  90. package/dist/services/health.mjs.map +1 -1
  91. package/dist/services/messaging.js.map +1 -1
  92. package/dist/services/messaging.mjs.map +1 -1
  93. package/dist/services/sites.js.map +1 -1
  94. package/dist/services/sites.mjs.map +1 -1
  95. package/dist/services/storage.d.mts +12 -12
  96. package/dist/services/storage.d.ts +12 -12
  97. package/dist/services/storage.js.map +1 -1
  98. package/dist/services/storage.mjs.map +1 -1
  99. package/dist/services/tables-db.d.mts +336 -33
  100. package/dist/services/tables-db.d.ts +336 -33
  101. package/dist/services/tables-db.js +480 -7
  102. package/dist/services/tables-db.js.map +1 -1
  103. package/dist/services/tables-db.mjs +480 -7
  104. package/dist/services/tables-db.mjs.map +1 -1
  105. package/dist/services/teams.d.mts +9 -8
  106. package/dist/services/teams.d.ts +9 -8
  107. package/dist/services/teams.js.map +1 -1
  108. package/dist/services/teams.mjs.map +1 -1
  109. package/dist/services/tokens.js.map +1 -1
  110. package/dist/services/tokens.mjs.map +1 -1
  111. package/dist/services/users.js.map +1 -1
  112. package/dist/services/users.mjs.map +1 -1
  113. package/package.json +4 -2
  114. package/dist/enums/output.d.mts +0 -11
  115. package/dist/enums/output.d.ts +0 -11
  116. package/dist/enums/output.js +0 -16
  117. package/dist/enums/output.js.map +0 -1
  118. package/dist/enums/output.mjs +0 -15
  119. package/dist/enums/output.mjs.map +0 -1
@@ -290,9 +290,6 @@ class TablesDB {
290
290
  if (typeof databaseId === "undefined") {
291
291
  throw new client.AppwriteException('Missing required parameter: "databaseId"');
292
292
  }
293
- if (typeof name === "undefined") {
294
- throw new client.AppwriteException('Missing required parameter: "name"');
295
- }
296
293
  const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
297
294
  const payload = {};
298
295
  if (typeof name !== "undefined") {
@@ -388,7 +385,9 @@ class TablesDB {
388
385
  name: rest[1],
389
386
  permissions: rest[2],
390
387
  rowSecurity: rest[3],
391
- enabled: rest[4]
388
+ enabled: rest[4],
389
+ columns: rest[5],
390
+ indexes: rest[6]
392
391
  };
393
392
  }
394
393
  const databaseId = params.databaseId;
@@ -397,6 +396,8 @@ class TablesDB {
397
396
  const permissions = params.permissions;
398
397
  const rowSecurity = params.rowSecurity;
399
398
  const enabled = params.enabled;
399
+ const columns = params.columns;
400
+ const indexes = params.indexes;
400
401
  if (typeof databaseId === "undefined") {
401
402
  throw new client.AppwriteException('Missing required parameter: "databaseId"');
402
403
  }
@@ -423,6 +424,12 @@ class TablesDB {
423
424
  if (typeof enabled !== "undefined") {
424
425
  payload["enabled"] = enabled;
425
426
  }
427
+ if (typeof columns !== "undefined") {
428
+ payload["columns"] = columns;
429
+ }
430
+ if (typeof indexes !== "undefined") {
431
+ payload["indexes"] = indexes;
432
+ }
426
433
  const uri = new URL(this.client.config.endpoint + apiPath);
427
434
  const apiHeaders = {
428
435
  "content-type": "application/json"
@@ -489,9 +496,6 @@ class TablesDB {
489
496
  if (typeof tableId === "undefined") {
490
497
  throw new client.AppwriteException('Missing required parameter: "tableId"');
491
498
  }
492
- if (typeof name === "undefined") {
493
- throw new client.AppwriteException('Missing required parameter: "name"');
494
- }
495
499
  const apiPath = "/tablesdb/{databaseId}/tables/{tableId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
496
500
  const payload = {};
497
501
  if (typeof name !== "undefined") {
@@ -1547,6 +1551,234 @@ class TablesDB {
1547
1551
  payload
1548
1552
  );
1549
1553
  }
1554
+ createLongtextColumn(paramsOrFirst, ...rest) {
1555
+ let params;
1556
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1557
+ params = paramsOrFirst || {};
1558
+ } else {
1559
+ params = {
1560
+ databaseId: paramsOrFirst,
1561
+ tableId: rest[0],
1562
+ key: rest[1],
1563
+ required: rest[2],
1564
+ xdefault: rest[3],
1565
+ array: rest[4]
1566
+ };
1567
+ }
1568
+ const databaseId = params.databaseId;
1569
+ const tableId = params.tableId;
1570
+ const key = params.key;
1571
+ const required = params.required;
1572
+ const xdefault = params.xdefault;
1573
+ const array = params.array;
1574
+ if (typeof databaseId === "undefined") {
1575
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1576
+ }
1577
+ if (typeof tableId === "undefined") {
1578
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
1579
+ }
1580
+ if (typeof key === "undefined") {
1581
+ throw new client.AppwriteException('Missing required parameter: "key"');
1582
+ }
1583
+ if (typeof required === "undefined") {
1584
+ throw new client.AppwriteException('Missing required parameter: "required"');
1585
+ }
1586
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/longtext".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
1587
+ const payload = {};
1588
+ if (typeof key !== "undefined") {
1589
+ payload["key"] = key;
1590
+ }
1591
+ if (typeof required !== "undefined") {
1592
+ payload["required"] = required;
1593
+ }
1594
+ if (typeof xdefault !== "undefined") {
1595
+ payload["default"] = xdefault;
1596
+ }
1597
+ if (typeof array !== "undefined") {
1598
+ payload["array"] = array;
1599
+ }
1600
+ const uri = new URL(this.client.config.endpoint + apiPath);
1601
+ const apiHeaders = {
1602
+ "content-type": "application/json"
1603
+ };
1604
+ return this.client.call(
1605
+ "post",
1606
+ uri,
1607
+ apiHeaders,
1608
+ payload
1609
+ );
1610
+ }
1611
+ updateLongtextColumn(paramsOrFirst, ...rest) {
1612
+ let params;
1613
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1614
+ params = paramsOrFirst || {};
1615
+ } else {
1616
+ params = {
1617
+ databaseId: paramsOrFirst,
1618
+ tableId: rest[0],
1619
+ key: rest[1],
1620
+ required: rest[2],
1621
+ xdefault: rest[3],
1622
+ newKey: rest[4]
1623
+ };
1624
+ }
1625
+ const databaseId = params.databaseId;
1626
+ const tableId = params.tableId;
1627
+ const key = params.key;
1628
+ const required = params.required;
1629
+ const xdefault = params.xdefault;
1630
+ const newKey = params.newKey;
1631
+ if (typeof databaseId === "undefined") {
1632
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1633
+ }
1634
+ if (typeof tableId === "undefined") {
1635
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
1636
+ }
1637
+ if (typeof key === "undefined") {
1638
+ throw new client.AppwriteException('Missing required parameter: "key"');
1639
+ }
1640
+ if (typeof required === "undefined") {
1641
+ throw new client.AppwriteException('Missing required parameter: "required"');
1642
+ }
1643
+ if (typeof xdefault === "undefined") {
1644
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
1645
+ }
1646
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/longtext/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
1647
+ const payload = {};
1648
+ if (typeof required !== "undefined") {
1649
+ payload["required"] = required;
1650
+ }
1651
+ if (typeof xdefault !== "undefined") {
1652
+ payload["default"] = xdefault;
1653
+ }
1654
+ if (typeof newKey !== "undefined") {
1655
+ payload["newKey"] = newKey;
1656
+ }
1657
+ const uri = new URL(this.client.config.endpoint + apiPath);
1658
+ const apiHeaders = {
1659
+ "content-type": "application/json"
1660
+ };
1661
+ return this.client.call(
1662
+ "patch",
1663
+ uri,
1664
+ apiHeaders,
1665
+ payload
1666
+ );
1667
+ }
1668
+ createMediumtextColumn(paramsOrFirst, ...rest) {
1669
+ let params;
1670
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1671
+ params = paramsOrFirst || {};
1672
+ } else {
1673
+ params = {
1674
+ databaseId: paramsOrFirst,
1675
+ tableId: rest[0],
1676
+ key: rest[1],
1677
+ required: rest[2],
1678
+ xdefault: rest[3],
1679
+ array: rest[4]
1680
+ };
1681
+ }
1682
+ const databaseId = params.databaseId;
1683
+ const tableId = params.tableId;
1684
+ const key = params.key;
1685
+ const required = params.required;
1686
+ const xdefault = params.xdefault;
1687
+ const array = params.array;
1688
+ if (typeof databaseId === "undefined") {
1689
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1690
+ }
1691
+ if (typeof tableId === "undefined") {
1692
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
1693
+ }
1694
+ if (typeof key === "undefined") {
1695
+ throw new client.AppwriteException('Missing required parameter: "key"');
1696
+ }
1697
+ if (typeof required === "undefined") {
1698
+ throw new client.AppwriteException('Missing required parameter: "required"');
1699
+ }
1700
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
1701
+ const payload = {};
1702
+ if (typeof key !== "undefined") {
1703
+ payload["key"] = key;
1704
+ }
1705
+ if (typeof required !== "undefined") {
1706
+ payload["required"] = required;
1707
+ }
1708
+ if (typeof xdefault !== "undefined") {
1709
+ payload["default"] = xdefault;
1710
+ }
1711
+ if (typeof array !== "undefined") {
1712
+ payload["array"] = array;
1713
+ }
1714
+ const uri = new URL(this.client.config.endpoint + apiPath);
1715
+ const apiHeaders = {
1716
+ "content-type": "application/json"
1717
+ };
1718
+ return this.client.call(
1719
+ "post",
1720
+ uri,
1721
+ apiHeaders,
1722
+ payload
1723
+ );
1724
+ }
1725
+ updateMediumtextColumn(paramsOrFirst, ...rest) {
1726
+ let params;
1727
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1728
+ params = paramsOrFirst || {};
1729
+ } else {
1730
+ params = {
1731
+ databaseId: paramsOrFirst,
1732
+ tableId: rest[0],
1733
+ key: rest[1],
1734
+ required: rest[2],
1735
+ xdefault: rest[3],
1736
+ newKey: rest[4]
1737
+ };
1738
+ }
1739
+ const databaseId = params.databaseId;
1740
+ const tableId = params.tableId;
1741
+ const key = params.key;
1742
+ const required = params.required;
1743
+ const xdefault = params.xdefault;
1744
+ const newKey = params.newKey;
1745
+ if (typeof databaseId === "undefined") {
1746
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1747
+ }
1748
+ if (typeof tableId === "undefined") {
1749
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
1750
+ }
1751
+ if (typeof key === "undefined") {
1752
+ throw new client.AppwriteException('Missing required parameter: "key"');
1753
+ }
1754
+ if (typeof required === "undefined") {
1755
+ throw new client.AppwriteException('Missing required parameter: "required"');
1756
+ }
1757
+ if (typeof xdefault === "undefined") {
1758
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
1759
+ }
1760
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
1761
+ const payload = {};
1762
+ if (typeof required !== "undefined") {
1763
+ payload["required"] = required;
1764
+ }
1765
+ if (typeof xdefault !== "undefined") {
1766
+ payload["default"] = xdefault;
1767
+ }
1768
+ if (typeof newKey !== "undefined") {
1769
+ payload["newKey"] = newKey;
1770
+ }
1771
+ const uri = new URL(this.client.config.endpoint + apiPath);
1772
+ const apiHeaders = {
1773
+ "content-type": "application/json"
1774
+ };
1775
+ return this.client.call(
1776
+ "patch",
1777
+ uri,
1778
+ apiHeaders,
1779
+ payload
1780
+ );
1781
+ }
1550
1782
  createPointColumn(paramsOrFirst, ...rest) {
1551
1783
  let params;
1552
1784
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -1958,6 +2190,120 @@ class TablesDB {
1958
2190
  payload
1959
2191
  );
1960
2192
  }
2193
+ createTextColumn(paramsOrFirst, ...rest) {
2194
+ let params;
2195
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2196
+ params = paramsOrFirst || {};
2197
+ } else {
2198
+ params = {
2199
+ databaseId: paramsOrFirst,
2200
+ tableId: rest[0],
2201
+ key: rest[1],
2202
+ required: rest[2],
2203
+ xdefault: rest[3],
2204
+ array: rest[4]
2205
+ };
2206
+ }
2207
+ const databaseId = params.databaseId;
2208
+ const tableId = params.tableId;
2209
+ const key = params.key;
2210
+ const required = params.required;
2211
+ const xdefault = params.xdefault;
2212
+ const array = params.array;
2213
+ if (typeof databaseId === "undefined") {
2214
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2215
+ }
2216
+ if (typeof tableId === "undefined") {
2217
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
2218
+ }
2219
+ if (typeof key === "undefined") {
2220
+ throw new client.AppwriteException('Missing required parameter: "key"');
2221
+ }
2222
+ if (typeof required === "undefined") {
2223
+ throw new client.AppwriteException('Missing required parameter: "required"');
2224
+ }
2225
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/text".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
2226
+ const payload = {};
2227
+ if (typeof key !== "undefined") {
2228
+ payload["key"] = key;
2229
+ }
2230
+ if (typeof required !== "undefined") {
2231
+ payload["required"] = required;
2232
+ }
2233
+ if (typeof xdefault !== "undefined") {
2234
+ payload["default"] = xdefault;
2235
+ }
2236
+ if (typeof array !== "undefined") {
2237
+ payload["array"] = array;
2238
+ }
2239
+ const uri = new URL(this.client.config.endpoint + apiPath);
2240
+ const apiHeaders = {
2241
+ "content-type": "application/json"
2242
+ };
2243
+ return this.client.call(
2244
+ "post",
2245
+ uri,
2246
+ apiHeaders,
2247
+ payload
2248
+ );
2249
+ }
2250
+ updateTextColumn(paramsOrFirst, ...rest) {
2251
+ let params;
2252
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2253
+ params = paramsOrFirst || {};
2254
+ } else {
2255
+ params = {
2256
+ databaseId: paramsOrFirst,
2257
+ tableId: rest[0],
2258
+ key: rest[1],
2259
+ required: rest[2],
2260
+ xdefault: rest[3],
2261
+ newKey: rest[4]
2262
+ };
2263
+ }
2264
+ const databaseId = params.databaseId;
2265
+ const tableId = params.tableId;
2266
+ const key = params.key;
2267
+ const required = params.required;
2268
+ const xdefault = params.xdefault;
2269
+ const newKey = params.newKey;
2270
+ if (typeof databaseId === "undefined") {
2271
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2272
+ }
2273
+ if (typeof tableId === "undefined") {
2274
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
2275
+ }
2276
+ if (typeof key === "undefined") {
2277
+ throw new client.AppwriteException('Missing required parameter: "key"');
2278
+ }
2279
+ if (typeof required === "undefined") {
2280
+ throw new client.AppwriteException('Missing required parameter: "required"');
2281
+ }
2282
+ if (typeof xdefault === "undefined") {
2283
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
2284
+ }
2285
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/text/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
2286
+ const payload = {};
2287
+ if (typeof required !== "undefined") {
2288
+ payload["required"] = required;
2289
+ }
2290
+ if (typeof xdefault !== "undefined") {
2291
+ payload["default"] = xdefault;
2292
+ }
2293
+ if (typeof newKey !== "undefined") {
2294
+ payload["newKey"] = newKey;
2295
+ }
2296
+ const uri = new URL(this.client.config.endpoint + apiPath);
2297
+ const apiHeaders = {
2298
+ "content-type": "application/json"
2299
+ };
2300
+ return this.client.call(
2301
+ "patch",
2302
+ uri,
2303
+ apiHeaders,
2304
+ payload
2305
+ );
2306
+ }
1961
2307
  createUrlColumn(paramsOrFirst, ...rest) {
1962
2308
  let params;
1963
2309
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -2072,6 +2418,133 @@ class TablesDB {
2072
2418
  payload
2073
2419
  );
2074
2420
  }
2421
+ createVarcharColumn(paramsOrFirst, ...rest) {
2422
+ let params;
2423
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2424
+ params = paramsOrFirst || {};
2425
+ } else {
2426
+ params = {
2427
+ databaseId: paramsOrFirst,
2428
+ tableId: rest[0],
2429
+ key: rest[1],
2430
+ size: rest[2],
2431
+ required: rest[3],
2432
+ xdefault: rest[4],
2433
+ array: rest[5]
2434
+ };
2435
+ }
2436
+ const databaseId = params.databaseId;
2437
+ const tableId = params.tableId;
2438
+ const key = params.key;
2439
+ const size = params.size;
2440
+ const required = params.required;
2441
+ const xdefault = params.xdefault;
2442
+ const array = params.array;
2443
+ if (typeof databaseId === "undefined") {
2444
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2445
+ }
2446
+ if (typeof tableId === "undefined") {
2447
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
2448
+ }
2449
+ if (typeof key === "undefined") {
2450
+ throw new client.AppwriteException('Missing required parameter: "key"');
2451
+ }
2452
+ if (typeof size === "undefined") {
2453
+ throw new client.AppwriteException('Missing required parameter: "size"');
2454
+ }
2455
+ if (typeof required === "undefined") {
2456
+ throw new client.AppwriteException('Missing required parameter: "required"');
2457
+ }
2458
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/varchar".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
2459
+ const payload = {};
2460
+ if (typeof key !== "undefined") {
2461
+ payload["key"] = key;
2462
+ }
2463
+ if (typeof size !== "undefined") {
2464
+ payload["size"] = size;
2465
+ }
2466
+ if (typeof required !== "undefined") {
2467
+ payload["required"] = required;
2468
+ }
2469
+ if (typeof xdefault !== "undefined") {
2470
+ payload["default"] = xdefault;
2471
+ }
2472
+ if (typeof array !== "undefined") {
2473
+ payload["array"] = array;
2474
+ }
2475
+ const uri = new URL(this.client.config.endpoint + apiPath);
2476
+ const apiHeaders = {
2477
+ "content-type": "application/json"
2478
+ };
2479
+ return this.client.call(
2480
+ "post",
2481
+ uri,
2482
+ apiHeaders,
2483
+ payload
2484
+ );
2485
+ }
2486
+ updateVarcharColumn(paramsOrFirst, ...rest) {
2487
+ let params;
2488
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2489
+ params = paramsOrFirst || {};
2490
+ } else {
2491
+ params = {
2492
+ databaseId: paramsOrFirst,
2493
+ tableId: rest[0],
2494
+ key: rest[1],
2495
+ required: rest[2],
2496
+ xdefault: rest[3],
2497
+ size: rest[4],
2498
+ newKey: rest[5]
2499
+ };
2500
+ }
2501
+ const databaseId = params.databaseId;
2502
+ const tableId = params.tableId;
2503
+ const key = params.key;
2504
+ const required = params.required;
2505
+ const xdefault = params.xdefault;
2506
+ const size = params.size;
2507
+ const newKey = params.newKey;
2508
+ if (typeof databaseId === "undefined") {
2509
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2510
+ }
2511
+ if (typeof tableId === "undefined") {
2512
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
2513
+ }
2514
+ if (typeof key === "undefined") {
2515
+ throw new client.AppwriteException('Missing required parameter: "key"');
2516
+ }
2517
+ if (typeof required === "undefined") {
2518
+ throw new client.AppwriteException('Missing required parameter: "required"');
2519
+ }
2520
+ if (typeof xdefault === "undefined") {
2521
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
2522
+ }
2523
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/varchar/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
2524
+ const payload = {};
2525
+ if (typeof required !== "undefined") {
2526
+ payload["required"] = required;
2527
+ }
2528
+ if (typeof xdefault !== "undefined") {
2529
+ payload["default"] = xdefault;
2530
+ }
2531
+ if (typeof size !== "undefined") {
2532
+ payload["size"] = size;
2533
+ }
2534
+ if (typeof newKey !== "undefined") {
2535
+ payload["newKey"] = newKey;
2536
+ }
2537
+ const uri = new URL(this.client.config.endpoint + apiPath);
2538
+ const apiHeaders = {
2539
+ "content-type": "application/json"
2540
+ };
2541
+ return this.client.call(
2542
+ "patch",
2543
+ uri,
2544
+ apiHeaders,
2545
+ payload
2546
+ );
2547
+ }
2075
2548
  getColumn(paramsOrFirst, ...rest) {
2076
2549
  let params;
2077
2550
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {