node-appwrite 22.1.2 → 23.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.
- package/README.md +2 -2
- package/dist/client.d.mts +33 -0
- package/dist/client.d.ts +33 -0
- package/dist/client.js +52 -4
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +52 -4
- package/dist/client.mjs.map +1 -1
- package/dist/enums/backup-services.d.mts +3 -0
- package/dist/enums/backup-services.d.ts +3 -0
- package/dist/enums/backup-services.js +3 -0
- package/dist/enums/backup-services.js.map +1 -1
- package/dist/enums/backup-services.mjs +3 -0
- package/dist/enums/backup-services.mjs.map +1 -1
- package/dist/enums/database-type.d.mts +3 -1
- package/dist/enums/database-type.d.ts +3 -1
- package/dist/enums/database-type.js +2 -0
- package/dist/enums/database-type.js.map +1 -1
- package/dist/enums/database-type.mjs +2 -0
- package/dist/enums/database-type.mjs.map +1 -1
- package/dist/enums/databases-index-type.d.mts +8 -0
- package/dist/enums/databases-index-type.d.ts +8 -0
- package/dist/enums/databases-index-type.js +13 -0
- package/dist/enums/databases-index-type.js.map +1 -0
- package/dist/enums/databases-index-type.mjs +12 -0
- package/dist/enums/databases-index-type.mjs.map +1 -0
- package/dist/enums/scopes.d.mts +4 -0
- package/dist/enums/scopes.d.ts +4 -0
- package/dist/enums/scopes.js +4 -0
- package/dist/enums/scopes.js.map +1 -1
- package/dist/enums/scopes.mjs +4 -0
- package/dist/enums/scopes.mjs.map +1 -1
- package/dist/enums/{index-type.d.mts → tables-db-index-type.d.mts} +2 -2
- package/dist/enums/{index-type.d.ts → tables-db-index-type.d.ts} +2 -2
- package/dist/enums/tables-db-index-type.js +13 -0
- package/dist/enums/tables-db-index-type.js.map +1 -0
- package/dist/enums/tables-db-index-type.mjs +12 -0
- package/dist/enums/tables-db-index-type.mjs.map +1 -0
- package/dist/enums/template-reference-type.d.mts +1 -1
- package/dist/enums/template-reference-type.d.ts +1 -1
- package/dist/enums/template-reference-type.js +1 -1
- package/dist/enums/template-reference-type.js.map +1 -1
- package/dist/enums/template-reference-type.mjs +1 -1
- package/dist/enums/template-reference-type.mjs.map +1 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/dist/models.d.mts +109 -11
- package/dist/models.d.ts +109 -11
- package/dist/services/databases.d.mts +45 -42
- package/dist/services/databases.d.ts +45 -42
- package/dist/services/databases.js +52 -47
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +52 -47
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +20 -8
- package/dist/services/functions.d.ts +20 -8
- package/dist/services/functions.js +28 -8
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +28 -8
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/health.d.mts +23 -94
- package/dist/services/health.d.ts +23 -94
- package/dist/services/health.js +28 -119
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +28 -119
- package/dist/services/health.mjs.map +1 -1
- package/dist/services/messaging.d.mts +2 -2
- package/dist/services/messaging.d.ts +2 -2
- package/dist/services/messaging.js.map +1 -1
- package/dist/services/messaging.mjs.map +1 -1
- package/dist/services/project.d.mts +136 -0
- package/dist/services/project.d.ts +136 -0
- package/dist/services/project.js +183 -0
- package/dist/services/project.js.map +1 -0
- package/dist/services/project.mjs +182 -0
- package/dist/services/project.mjs.map +1 -0
- package/dist/services/sites.d.mts +30 -12
- package/dist/services/sites.d.ts +30 -12
- package/dist/services/sites.js +60 -33
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs +60 -33
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +9 -6
- package/dist/services/tables-db.d.ts +9 -6
- package/dist/services/tables-db.js +6 -1
- package/dist/services/tables-db.js.map +1 -1
- package/dist/services/tables-db.mjs +6 -1
- package/dist/services/tables-db.mjs.map +1 -1
- package/dist/services/teams.d.mts +4 -4
- package/dist/services/teams.d.ts +4 -4
- package/dist/services/teams.js.map +1 -1
- package/dist/services/teams.mjs.map +1 -1
- package/dist/services/users.d.mts +26 -2
- package/dist/services/users.d.ts +26 -2
- package/dist/services/users.js +34 -0
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +34 -0
- package/dist/services/users.mjs.map +1 -1
- package/dist/services/webhooks.d.mts +179 -0
- package/dist/services/webhooks.d.ts +179 -0
- package/dist/services/webhooks.js +261 -0
- package/dist/services/webhooks.js.map +1 -0
- package/dist/services/webhooks.mjs +260 -0
- package/dist/services/webhooks.mjs.map +1 -0
- package/package.json +5 -3
- package/dist/enums/index-type.js +0 -13
- package/dist/enums/index-type.js.map +0 -1
- package/dist/enums/index-type.mjs +0 -12
- package/dist/enums/index-type.mjs.map +0 -1
|
@@ -2,7 +2,7 @@ import { Client } from '../client.js';
|
|
|
2
2
|
import { Models } from '../models.js';
|
|
3
3
|
import { RelationshipType } from '../enums/relationship-type.js';
|
|
4
4
|
import { RelationMutate } from '../enums/relation-mutate.js';
|
|
5
|
-
import {
|
|
5
|
+
import { DatabasesIndexType } from '../enums/databases-index-type.js';
|
|
6
6
|
import { OrderBy } from '../enums/order-by.js';
|
|
7
7
|
import '../query.js';
|
|
8
8
|
import '../enums/database-type.js';
|
|
@@ -447,7 +447,7 @@ declare class Databases {
|
|
|
447
447
|
*
|
|
448
448
|
*
|
|
449
449
|
* @param {string} params.databaseId - Database ID.
|
|
450
|
-
* @param {string} params.collectionId - Collection ID. You can create a new
|
|
450
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
451
451
|
* @param {string} params.key - Attribute Key.
|
|
452
452
|
* @param {boolean} params.required - Is attribute required?
|
|
453
453
|
* @param {boolean} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
@@ -469,7 +469,7 @@ declare class Databases {
|
|
|
469
469
|
*
|
|
470
470
|
*
|
|
471
471
|
* @param {string} databaseId - Database ID.
|
|
472
|
-
* @param {string} collectionId - Collection ID. You can create a new
|
|
472
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
473
473
|
* @param {string} key - Attribute Key.
|
|
474
474
|
* @param {boolean} required - Is attribute required?
|
|
475
475
|
* @param {boolean} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
@@ -1378,6 +1378,40 @@ declare class Databases {
|
|
|
1378
1378
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1379
1379
|
*/
|
|
1380
1380
|
createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise<Models.AttributeRelationship>;
|
|
1381
|
+
/**
|
|
1382
|
+
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1383
|
+
*
|
|
1384
|
+
*
|
|
1385
|
+
* @param {string} params.databaseId - Database ID.
|
|
1386
|
+
* @param {string} params.collectionId - Collection ID.
|
|
1387
|
+
* @param {string} params.key - Attribute Key.
|
|
1388
|
+
* @param {RelationMutate} params.onDelete - Constraints option
|
|
1389
|
+
* @param {string} params.newKey - New Attribute Key.
|
|
1390
|
+
* @throws {AppwriteException}
|
|
1391
|
+
* @returns {Promise<Models.AttributeRelationship>}
|
|
1392
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.
|
|
1393
|
+
*/
|
|
1394
|
+
updateRelationshipAttribute(params: {
|
|
1395
|
+
databaseId: string;
|
|
1396
|
+
collectionId: string;
|
|
1397
|
+
key: string;
|
|
1398
|
+
onDelete?: RelationMutate;
|
|
1399
|
+
newKey?: string;
|
|
1400
|
+
}): Promise<Models.AttributeRelationship>;
|
|
1401
|
+
/**
|
|
1402
|
+
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1403
|
+
*
|
|
1404
|
+
*
|
|
1405
|
+
* @param {string} databaseId - Database ID.
|
|
1406
|
+
* @param {string} collectionId - Collection ID.
|
|
1407
|
+
* @param {string} key - Attribute Key.
|
|
1408
|
+
* @param {RelationMutate} onDelete - Constraints option
|
|
1409
|
+
* @param {string} newKey - New Attribute Key.
|
|
1410
|
+
* @throws {AppwriteException}
|
|
1411
|
+
* @returns {Promise<Models.AttributeRelationship>}
|
|
1412
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1413
|
+
*/
|
|
1414
|
+
updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise<Models.AttributeRelationship>;
|
|
1381
1415
|
/**
|
|
1382
1416
|
* Create a string attribute.
|
|
1383
1417
|
*
|
|
@@ -1743,40 +1777,6 @@ declare class Databases {
|
|
|
1743
1777
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1744
1778
|
*/
|
|
1745
1779
|
deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<{}>;
|
|
1746
|
-
/**
|
|
1747
|
-
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1748
|
-
*
|
|
1749
|
-
*
|
|
1750
|
-
* @param {string} params.databaseId - Database ID.
|
|
1751
|
-
* @param {string} params.collectionId - Collection ID.
|
|
1752
|
-
* @param {string} params.key - Attribute Key.
|
|
1753
|
-
* @param {RelationMutate} params.onDelete - Constraints option
|
|
1754
|
-
* @param {string} params.newKey - New Attribute Key.
|
|
1755
|
-
* @throws {AppwriteException}
|
|
1756
|
-
* @returns {Promise<Models.AttributeRelationship>}
|
|
1757
|
-
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.
|
|
1758
|
-
*/
|
|
1759
|
-
updateRelationshipAttribute(params: {
|
|
1760
|
-
databaseId: string;
|
|
1761
|
-
collectionId: string;
|
|
1762
|
-
key: string;
|
|
1763
|
-
onDelete?: RelationMutate;
|
|
1764
|
-
newKey?: string;
|
|
1765
|
-
}): Promise<Models.AttributeRelationship>;
|
|
1766
|
-
/**
|
|
1767
|
-
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1768
|
-
*
|
|
1769
|
-
*
|
|
1770
|
-
* @param {string} databaseId - Database ID.
|
|
1771
|
-
* @param {string} collectionId - Collection ID.
|
|
1772
|
-
* @param {string} key - Attribute Key.
|
|
1773
|
-
* @param {RelationMutate} onDelete - Constraints option
|
|
1774
|
-
* @param {string} newKey - New Attribute Key.
|
|
1775
|
-
* @throws {AppwriteException}
|
|
1776
|
-
* @returns {Promise<Models.AttributeRelationship>}
|
|
1777
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1778
|
-
*/
|
|
1779
|
-
updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise<Models.AttributeRelationship>;
|
|
1780
1780
|
/**
|
|
1781
1781
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
1782
1782
|
*
|
|
@@ -1785,6 +1785,7 @@ declare class Databases {
|
|
|
1785
1785
|
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
1786
1786
|
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
1787
1787
|
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1788
|
+
* @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
1788
1789
|
* @throws {AppwriteException}
|
|
1789
1790
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1790
1791
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.
|
|
@@ -1795,6 +1796,7 @@ declare class Databases {
|
|
|
1795
1796
|
queries?: string[];
|
|
1796
1797
|
transactionId?: string;
|
|
1797
1798
|
total?: boolean;
|
|
1799
|
+
ttl?: number;
|
|
1798
1800
|
}): Promise<Models.DocumentList<Document>>;
|
|
1799
1801
|
/**
|
|
1800
1802
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
@@ -1804,11 +1806,12 @@ declare class Databases {
|
|
|
1804
1806
|
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
1805
1807
|
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
1806
1808
|
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1809
|
+
* @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
1807
1810
|
* @throws {AppwriteException}
|
|
1808
1811
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1809
1812
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1810
1813
|
*/
|
|
1811
|
-
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean): Promise<Models.DocumentList<Document>>;
|
|
1814
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise<Models.DocumentList<Document>>;
|
|
1812
1815
|
/**
|
|
1813
1816
|
* Create a new 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.
|
|
1814
1817
|
*
|
|
@@ -2208,7 +2211,7 @@ declare class Databases {
|
|
|
2208
2211
|
* @param {string} params.databaseId - Database ID.
|
|
2209
2212
|
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
2210
2213
|
* @param {string} params.key - Index Key.
|
|
2211
|
-
* @param {
|
|
2214
|
+
* @param {DatabasesIndexType} params.type - Index type.
|
|
2212
2215
|
* @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
|
|
2213
2216
|
* @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed.
|
|
2214
2217
|
* @param {number[]} params.lengths - Length of index. Maximum of 100
|
|
@@ -2220,7 +2223,7 @@ declare class Databases {
|
|
|
2220
2223
|
databaseId: string;
|
|
2221
2224
|
collectionId: string;
|
|
2222
2225
|
key: string;
|
|
2223
|
-
type:
|
|
2226
|
+
type: DatabasesIndexType;
|
|
2224
2227
|
attributes: string[];
|
|
2225
2228
|
orders?: OrderBy[];
|
|
2226
2229
|
lengths?: number[];
|
|
@@ -2232,7 +2235,7 @@ declare class Databases {
|
|
|
2232
2235
|
* @param {string} databaseId - Database ID.
|
|
2233
2236
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
2234
2237
|
* @param {string} key - Index Key.
|
|
2235
|
-
* @param {
|
|
2238
|
+
* @param {DatabasesIndexType} type - Index type.
|
|
2236
2239
|
* @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
|
|
2237
2240
|
* @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed.
|
|
2238
2241
|
* @param {number[]} lengths - Length of index. Maximum of 100
|
|
@@ -2240,7 +2243,7 @@ declare class Databases {
|
|
|
2240
2243
|
* @returns {Promise<Models.Index>}
|
|
2241
2244
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2242
2245
|
*/
|
|
2243
|
-
createIndex(databaseId: string, collectionId: string, key: string, type:
|
|
2246
|
+
createIndex(databaseId: string, collectionId: string, key: string, type: DatabasesIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise<Models.Index>;
|
|
2244
2247
|
/**
|
|
2245
2248
|
* Get an index by its unique ID.
|
|
2246
2249
|
*
|
|
@@ -2068,6 +2068,52 @@ class Databases {
|
|
|
2068
2068
|
payload
|
|
2069
2069
|
);
|
|
2070
2070
|
}
|
|
2071
|
+
updateRelationshipAttribute(paramsOrFirst, ...rest) {
|
|
2072
|
+
let params;
|
|
2073
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2074
|
+
params = paramsOrFirst || {};
|
|
2075
|
+
} else {
|
|
2076
|
+
params = {
|
|
2077
|
+
databaseId: paramsOrFirst,
|
|
2078
|
+
collectionId: rest[0],
|
|
2079
|
+
key: rest[1],
|
|
2080
|
+
onDelete: rest[2],
|
|
2081
|
+
newKey: rest[3]
|
|
2082
|
+
};
|
|
2083
|
+
}
|
|
2084
|
+
const databaseId = params.databaseId;
|
|
2085
|
+
const collectionId = params.collectionId;
|
|
2086
|
+
const key = params.key;
|
|
2087
|
+
const onDelete = params.onDelete;
|
|
2088
|
+
const newKey = params.newKey;
|
|
2089
|
+
if (typeof databaseId === "undefined") {
|
|
2090
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2091
|
+
}
|
|
2092
|
+
if (typeof collectionId === "undefined") {
|
|
2093
|
+
throw new client.AppwriteException('Missing required parameter: "collectionId"');
|
|
2094
|
+
}
|
|
2095
|
+
if (typeof key === "undefined") {
|
|
2096
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
2097
|
+
}
|
|
2098
|
+
const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
|
|
2099
|
+
const payload = {};
|
|
2100
|
+
if (typeof onDelete !== "undefined") {
|
|
2101
|
+
payload["onDelete"] = onDelete;
|
|
2102
|
+
}
|
|
2103
|
+
if (typeof newKey !== "undefined") {
|
|
2104
|
+
payload["newKey"] = newKey;
|
|
2105
|
+
}
|
|
2106
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2107
|
+
const apiHeaders = {
|
|
2108
|
+
"content-type": "application/json"
|
|
2109
|
+
};
|
|
2110
|
+
return this.client.call(
|
|
2111
|
+
"patch",
|
|
2112
|
+
uri,
|
|
2113
|
+
apiHeaders,
|
|
2114
|
+
payload
|
|
2115
|
+
);
|
|
2116
|
+
}
|
|
2071
2117
|
createStringAttribute(paramsOrFirst, ...rest) {
|
|
2072
2118
|
let params;
|
|
2073
2119
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
@@ -2635,52 +2681,6 @@ class Databases {
|
|
|
2635
2681
|
payload
|
|
2636
2682
|
);
|
|
2637
2683
|
}
|
|
2638
|
-
updateRelationshipAttribute(paramsOrFirst, ...rest) {
|
|
2639
|
-
let params;
|
|
2640
|
-
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2641
|
-
params = paramsOrFirst || {};
|
|
2642
|
-
} else {
|
|
2643
|
-
params = {
|
|
2644
|
-
databaseId: paramsOrFirst,
|
|
2645
|
-
collectionId: rest[0],
|
|
2646
|
-
key: rest[1],
|
|
2647
|
-
onDelete: rest[2],
|
|
2648
|
-
newKey: rest[3]
|
|
2649
|
-
};
|
|
2650
|
-
}
|
|
2651
|
-
const databaseId = params.databaseId;
|
|
2652
|
-
const collectionId = params.collectionId;
|
|
2653
|
-
const key = params.key;
|
|
2654
|
-
const onDelete = params.onDelete;
|
|
2655
|
-
const newKey = params.newKey;
|
|
2656
|
-
if (typeof databaseId === "undefined") {
|
|
2657
|
-
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2658
|
-
}
|
|
2659
|
-
if (typeof collectionId === "undefined") {
|
|
2660
|
-
throw new client.AppwriteException('Missing required parameter: "collectionId"');
|
|
2661
|
-
}
|
|
2662
|
-
if (typeof key === "undefined") {
|
|
2663
|
-
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
2664
|
-
}
|
|
2665
|
-
const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
|
|
2666
|
-
const payload = {};
|
|
2667
|
-
if (typeof onDelete !== "undefined") {
|
|
2668
|
-
payload["onDelete"] = onDelete;
|
|
2669
|
-
}
|
|
2670
|
-
if (typeof newKey !== "undefined") {
|
|
2671
|
-
payload["newKey"] = newKey;
|
|
2672
|
-
}
|
|
2673
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2674
|
-
const apiHeaders = {
|
|
2675
|
-
"content-type": "application/json"
|
|
2676
|
-
};
|
|
2677
|
-
return this.client.call(
|
|
2678
|
-
"patch",
|
|
2679
|
-
uri,
|
|
2680
|
-
apiHeaders,
|
|
2681
|
-
payload
|
|
2682
|
-
);
|
|
2683
|
-
}
|
|
2684
2684
|
listDocuments(paramsOrFirst, ...rest) {
|
|
2685
2685
|
let params;
|
|
2686
2686
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
@@ -2691,7 +2691,8 @@ class Databases {
|
|
|
2691
2691
|
collectionId: rest[0],
|
|
2692
2692
|
queries: rest[1],
|
|
2693
2693
|
transactionId: rest[2],
|
|
2694
|
-
total: rest[3]
|
|
2694
|
+
total: rest[3],
|
|
2695
|
+
ttl: rest[4]
|
|
2695
2696
|
};
|
|
2696
2697
|
}
|
|
2697
2698
|
const databaseId = params.databaseId;
|
|
@@ -2699,6 +2700,7 @@ class Databases {
|
|
|
2699
2700
|
const queries = params.queries;
|
|
2700
2701
|
const transactionId = params.transactionId;
|
|
2701
2702
|
const total = params.total;
|
|
2703
|
+
const ttl = params.ttl;
|
|
2702
2704
|
if (typeof databaseId === "undefined") {
|
|
2703
2705
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2704
2706
|
}
|
|
@@ -2716,6 +2718,9 @@ class Databases {
|
|
|
2716
2718
|
if (typeof total !== "undefined") {
|
|
2717
2719
|
payload["total"] = total;
|
|
2718
2720
|
}
|
|
2721
|
+
if (typeof ttl !== "undefined") {
|
|
2722
|
+
payload["ttl"] = ttl;
|
|
2723
|
+
}
|
|
2719
2724
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2720
2725
|
const apiHeaders = {};
|
|
2721
2726
|
return this.client.call(
|