node-appwrite 17.0.0 → 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.
- package/README.md +1 -1
- package/dist/client.js +6 -5
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +6 -5
- package/dist/client.mjs.map +1 -1
- package/dist/enums/build-runtime.d.mts +3 -1
- package/dist/enums/build-runtime.d.ts +3 -1
- package/dist/enums/build-runtime.js +2 -0
- package/dist/enums/build-runtime.js.map +1 -1
- package/dist/enums/build-runtime.mjs +2 -0
- package/dist/enums/build-runtime.mjs.map +1 -1
- package/dist/enums/image-format.d.mts +2 -1
- package/dist/enums/image-format.d.ts +2 -1
- package/dist/enums/image-format.js +1 -0
- package/dist/enums/image-format.js.map +1 -1
- package/dist/enums/image-format.mjs +1 -0
- package/dist/enums/image-format.mjs.map +1 -1
- package/dist/enums/runtime.d.mts +3 -1
- package/dist/enums/runtime.d.ts +3 -1
- package/dist/enums/runtime.js +2 -0
- package/dist/enums/runtime.js.map +1 -1
- package/dist/enums/runtime.mjs +2 -0
- package/dist/enums/runtime.mjs.map +1 -1
- package/dist/services/databases.d.mts +26 -5
- package/dist/services/databases.d.ts +26 -5
- package/dist/services/databases.js +81 -26
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +81 -26
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/tokens.d.mts +1 -1
- package/dist/services/tokens.d.ts +1 -1
- package/dist/services/tokens.js +1 -1
- package/dist/services/tokens.js.map +1 -1
- package/dist/services/tokens.mjs +1 -1
- package/dist/services/tokens.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1577,14 +1577,16 @@ var Databases = class {
|
|
|
1577
1577
|
);
|
|
1578
1578
|
}
|
|
1579
1579
|
/**
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
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
|
+
|
|
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.
|
|
1583
|
+
*
|
|
1584
|
+
* @param {string} databaseId
|
|
1585
|
+
* @param {string} collectionId
|
|
1586
|
+
* @param {object[]} documents
|
|
1587
|
+
* @throws {AppwriteException}
|
|
1588
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1589
|
+
*/
|
|
1588
1590
|
createDocuments(databaseId, collectionId, documents) {
|
|
1589
1591
|
if (typeof databaseId === "undefined") {
|
|
1590
1592
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1612,8 +1614,9 @@ var Databases = class {
|
|
|
1612
1614
|
);
|
|
1613
1615
|
}
|
|
1614
1616
|
/**
|
|
1615
|
-
*
|
|
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.
|
|
1616
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.
|
|
1617
1620
|
*
|
|
1618
1621
|
* @param {string} databaseId
|
|
1619
1622
|
* @param {string} collectionId
|
|
@@ -1628,6 +1631,9 @@ var Databases = class {
|
|
|
1628
1631
|
if (typeof collectionId === "undefined") {
|
|
1629
1632
|
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
1630
1633
|
}
|
|
1634
|
+
if (typeof documents === "undefined") {
|
|
1635
|
+
throw new AppwriteException('Missing required parameter: "documents"');
|
|
1636
|
+
}
|
|
1631
1637
|
const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
|
|
1632
1638
|
const payload = {};
|
|
1633
1639
|
if (typeof documents !== "undefined") {
|
|
@@ -1645,15 +1651,17 @@ var Databases = class {
|
|
|
1645
1651
|
);
|
|
1646
1652
|
}
|
|
1647
1653
|
/**
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
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
|
+
*/
|
|
1657
1665
|
updateDocuments(databaseId, collectionId, data, queries) {
|
|
1658
1666
|
if (typeof databaseId === "undefined") {
|
|
1659
1667
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1681,14 +1689,16 @@ var Databases = class {
|
|
|
1681
1689
|
);
|
|
1682
1690
|
}
|
|
1683
1691
|
/**
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
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
|
+
*/
|
|
1692
1702
|
deleteDocuments(databaseId, collectionId, queries) {
|
|
1693
1703
|
if (typeof databaseId === "undefined") {
|
|
1694
1704
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1746,6 +1756,51 @@ var Databases = class {
|
|
|
1746
1756
|
payload
|
|
1747
1757
|
);
|
|
1748
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
|
+
}
|
|
1749
1804
|
/**
|
|
1750
1805
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
1751
1806
|
*
|