node-appwrite 16.1.0-rc.1 → 17.1.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 (92) hide show
  1. package/README.md +2 -2
  2. package/dist/client.js +7 -6
  3. package/dist/client.js.map +1 -1
  4. package/dist/client.mjs +7 -6
  5. package/dist/client.mjs.map +1 -1
  6. package/dist/enums/adapter.d.mts +6 -0
  7. package/dist/enums/adapter.d.ts +6 -0
  8. package/dist/enums/adapter.js +11 -0
  9. package/dist/enums/adapter.js.map +1 -0
  10. package/dist/enums/adapter.mjs +10 -0
  11. package/dist/enums/adapter.mjs.map +1 -0
  12. package/dist/enums/build-runtime.d.mts +69 -0
  13. package/dist/enums/build-runtime.d.ts +69 -0
  14. package/dist/enums/build-runtime.js +74 -0
  15. package/dist/enums/build-runtime.js.map +1 -0
  16. package/dist/enums/build-runtime.mjs +73 -0
  17. package/dist/enums/build-runtime.mjs.map +1 -0
  18. package/dist/enums/deployment-download-type.d.mts +6 -0
  19. package/dist/enums/deployment-download-type.d.ts +6 -0
  20. package/dist/enums/deployment-download-type.js +11 -0
  21. package/dist/enums/deployment-download-type.js.map +1 -0
  22. package/dist/enums/deployment-download-type.mjs +10 -0
  23. package/dist/enums/deployment-download-type.mjs.map +1 -0
  24. package/dist/enums/framework.d.mts +18 -0
  25. package/dist/enums/framework.d.ts +18 -0
  26. package/dist/enums/framework.js +23 -0
  27. package/dist/enums/framework.js.map +1 -0
  28. package/dist/enums/framework.mjs +22 -0
  29. package/dist/enums/framework.mjs.map +1 -0
  30. package/dist/enums/image-format.d.mts +2 -2
  31. package/dist/enums/image-format.d.ts +2 -2
  32. package/dist/enums/image-format.js +1 -1
  33. package/dist/enums/image-format.js.map +1 -1
  34. package/dist/enums/image-format.mjs +1 -1
  35. package/dist/enums/image-format.mjs.map +1 -1
  36. package/dist/enums/runtime.d.mts +7 -1
  37. package/dist/enums/runtime.d.ts +7 -1
  38. package/dist/enums/runtime.js +6 -0
  39. package/dist/enums/runtime.js.map +1 -1
  40. package/dist/enums/runtime.mjs +6 -0
  41. package/dist/enums/runtime.mjs.map +1 -1
  42. package/dist/enums/v-c-s-deployment-type.d.mts +7 -0
  43. package/dist/enums/v-c-s-deployment-type.d.ts +7 -0
  44. package/dist/enums/v-c-s-deployment-type.js +12 -0
  45. package/dist/enums/v-c-s-deployment-type.js.map +1 -0
  46. package/dist/enums/v-c-s-deployment-type.mjs +11 -0
  47. package/dist/enums/v-c-s-deployment-type.mjs.map +1 -0
  48. package/dist/index.d.mts +7 -0
  49. package/dist/index.d.ts +7 -0
  50. package/dist/index.js +35 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/index.mjs +7 -0
  53. package/dist/index.mjs.map +1 -1
  54. package/dist/models.d.mts +286 -48
  55. package/dist/models.d.ts +286 -48
  56. package/dist/services/databases.d.mts +27 -6
  57. package/dist/services/databases.d.ts +27 -6
  58. package/dist/services/databases.js +78 -20
  59. package/dist/services/databases.js.map +1 -1
  60. package/dist/services/databases.mjs +78 -20
  61. package/dist/services/databases.mjs.map +1 -1
  62. package/dist/services/functions.d.mts +56 -30
  63. package/dist/services/functions.d.ts +56 -30
  64. package/dist/services/functions.js +185 -87
  65. package/dist/services/functions.js.map +1 -1
  66. package/dist/services/functions.mjs +185 -87
  67. package/dist/services/functions.mjs.map +1 -1
  68. package/dist/services/sites.d.mts +286 -0
  69. package/dist/services/sites.d.ts +286 -0
  70. package/dist/services/sites.js +923 -0
  71. package/dist/services/sites.js.map +1 -0
  72. package/dist/services/sites.mjs +922 -0
  73. package/dist/services/sites.mjs.map +1 -0
  74. package/dist/services/storage.d.mts +6 -3
  75. package/dist/services/storage.d.ts +6 -3
  76. package/dist/services/storage.js +15 -3
  77. package/dist/services/storage.js.map +1 -1
  78. package/dist/services/storage.mjs +15 -3
  79. package/dist/services/storage.mjs.map +1 -1
  80. package/dist/services/tokens.d.mts +55 -0
  81. package/dist/services/tokens.d.ts +55 -0
  82. package/dist/services/tokens.js +149 -0
  83. package/dist/services/tokens.js.map +1 -0
  84. package/dist/services/tokens.mjs +148 -0
  85. package/dist/services/tokens.mjs.map +1 -0
  86. package/dist/services/users.d.mts +3 -1
  87. package/dist/services/users.d.ts +3 -1
  88. package/dist/services/users.js +9 -1
  89. package/dist/services/users.js.map +1 -1
  90. package/dist/services/users.mjs +9 -1
  91. package/dist/services/users.mjs.map +1 -1
  92. package/package.json +1 -1
@@ -1577,8 +1577,9 @@ var Databases = class {
1577
1577
  );
1578
1578
  }
1579
1579
  /**
1580
- * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
1580
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
1581
1581
 
1582
+ Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
1582
1583
  *
1583
1584
  * @param {string} databaseId
1584
1585
  * @param {string} collectionId
@@ -1613,8 +1614,9 @@ var Databases = class {
1613
1614
  );
1614
1615
  }
1615
1616
  /**
1616
- * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
1617
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
1617
1618
 
1619
+ Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
1618
1620
  *
1619
1621
  * @param {string} databaseId
1620
1622
  * @param {string} collectionId
@@ -1629,6 +1631,9 @@ var Databases = class {
1629
1631
  if (typeof collectionId === "undefined") {
1630
1632
  throw new AppwriteException('Missing required parameter: "collectionId"');
1631
1633
  }
1634
+ if (typeof documents === "undefined") {
1635
+ throw new AppwriteException('Missing required parameter: "documents"');
1636
+ }
1632
1637
  const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1633
1638
  const payload = {};
1634
1639
  if (typeof documents !== "undefined") {
@@ -1646,15 +1651,17 @@ var Databases = class {
1646
1651
  );
1647
1652
  }
1648
1653
  /**
1649
- * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.
1650
- *
1651
- * @param {string} databaseId
1652
- * @param {string} collectionId
1653
- * @param {object} data
1654
- * @param {string[]} queries
1655
- * @throws {AppwriteException}
1656
- * @returns {Promise<Models.DocumentList<Document>>}
1657
- */
1654
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
1655
+
1656
+ Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.
1657
+ *
1658
+ * @param {string} databaseId
1659
+ * @param {string} collectionId
1660
+ * @param {object} data
1661
+ * @param {string[]} queries
1662
+ * @throws {AppwriteException}
1663
+ * @returns {Promise<Models.DocumentList<Document>>}
1664
+ */
1658
1665
  updateDocuments(databaseId, collectionId, data, queries) {
1659
1666
  if (typeof databaseId === "undefined") {
1660
1667
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -1682,14 +1689,16 @@ var Databases = class {
1682
1689
  );
1683
1690
  }
1684
1691
  /**
1685
- * Bulk delete documents using queries, if no queries are passed then all documents are deleted.
1686
- *
1687
- * @param {string} databaseId
1688
- * @param {string} collectionId
1689
- * @param {string[]} queries
1690
- * @throws {AppwriteException}
1691
- * @returns {Promise<Models.DocumentList<Document>>}
1692
- */
1692
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
1693
+
1694
+ Bulk delete documents using queries, if no queries are passed then all documents are deleted.
1695
+ *
1696
+ * @param {string} databaseId
1697
+ * @param {string} collectionId
1698
+ * @param {string[]} queries
1699
+ * @throws {AppwriteException}
1700
+ * @returns {Promise<Models.DocumentList<Document>>}
1701
+ */
1693
1702
  deleteDocuments(databaseId, collectionId, queries) {
1694
1703
  if (typeof databaseId === "undefined") {
1695
1704
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -1747,6 +1756,51 @@ var Databases = class {
1747
1756
  payload
1748
1757
  );
1749
1758
  }
1759
+ /**
1760
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
1761
+
1762
+ Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
1763
+ *
1764
+ * @param {string} databaseId
1765
+ * @param {string} collectionId
1766
+ * @param {string} documentId
1767
+ * @param {object} data
1768
+ * @param {string[]} permissions
1769
+ * @throws {AppwriteException}
1770
+ * @returns {Promise<Document>}
1771
+ */
1772
+ upsertDocument(databaseId, collectionId, documentId, data, permissions) {
1773
+ if (typeof databaseId === "undefined") {
1774
+ throw new AppwriteException('Missing required parameter: "databaseId"');
1775
+ }
1776
+ if (typeof collectionId === "undefined") {
1777
+ throw new AppwriteException('Missing required parameter: "collectionId"');
1778
+ }
1779
+ if (typeof documentId === "undefined") {
1780
+ throw new AppwriteException('Missing required parameter: "documentId"');
1781
+ }
1782
+ if (typeof data === "undefined") {
1783
+ throw new AppwriteException('Missing required parameter: "data"');
1784
+ }
1785
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId);
1786
+ const payload = {};
1787
+ if (typeof data !== "undefined") {
1788
+ payload["data"] = data;
1789
+ }
1790
+ if (typeof permissions !== "undefined") {
1791
+ payload["permissions"] = permissions;
1792
+ }
1793
+ const uri = new URL(this.client.config.endpoint + apiPath);
1794
+ const apiHeaders = {
1795
+ "content-type": "application/json"
1796
+ };
1797
+ return this.client.call(
1798
+ "put",
1799
+ uri,
1800
+ apiHeaders,
1801
+ payload
1802
+ );
1803
+ }
1750
1804
  /**
1751
1805
  * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
1752
1806
  *
@@ -1859,10 +1913,11 @@ var Databases = class {
1859
1913
  * @param {IndexType} type
1860
1914
  * @param {string[]} attributes
1861
1915
  * @param {string[]} orders
1916
+ * @param {number[]} lengths
1862
1917
  * @throws {AppwriteException}
1863
1918
  * @returns {Promise<Models.Index>}
1864
1919
  */
1865
- createIndex(databaseId, collectionId, key, type, attributes, orders) {
1920
+ createIndex(databaseId, collectionId, key, type, attributes, orders, lengths) {
1866
1921
  if (typeof databaseId === "undefined") {
1867
1922
  throw new AppwriteException('Missing required parameter: "databaseId"');
1868
1923
  }
@@ -1892,6 +1947,9 @@ var Databases = class {
1892
1947
  if (typeof orders !== "undefined") {
1893
1948
  payload["orders"] = orders;
1894
1949
  }
1950
+ if (typeof lengths !== "undefined") {
1951
+ payload["lengths"] = lengths;
1952
+ }
1895
1953
  const uri = new URL(this.client.config.endpoint + apiPath);
1896
1954
  const apiHeaders = {
1897
1955
  "content-type": "application/json"