node-appwrite 22.1.1 → 22.1.3
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/dist/client.js +8 -3
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +8 -3
- package/dist/client.mjs.map +1 -1
- package/dist/models.d.mts +2 -2
- package/dist/models.d.ts +2 -2
- package/dist/services/databases.d.mts +40 -37
- package/dist/services/databases.d.ts +40 -37
- 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/health.d.mts +24 -0
- package/dist/services/health.d.ts +24 -0
- package/dist/services/health.js +29 -0
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +29 -0
- 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/sites.d.mts +4 -4
- package/dist/services/sites.d.ts +4 -4
- package/dist/services/sites.js +5 -8
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs +5 -8
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +4 -1
- package/dist/services/tables-db.d.ts +4 -1
- 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/package.json +1 -1
|
@@ -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(
|