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.
Files changed (39) hide show
  1. package/dist/client.js +8 -3
  2. package/dist/client.js.map +1 -1
  3. package/dist/client.mjs +8 -3
  4. package/dist/client.mjs.map +1 -1
  5. package/dist/models.d.mts +2 -2
  6. package/dist/models.d.ts +2 -2
  7. package/dist/services/databases.d.mts +40 -37
  8. package/dist/services/databases.d.ts +40 -37
  9. package/dist/services/databases.js +52 -47
  10. package/dist/services/databases.js.map +1 -1
  11. package/dist/services/databases.mjs +52 -47
  12. package/dist/services/databases.mjs.map +1 -1
  13. package/dist/services/health.d.mts +24 -0
  14. package/dist/services/health.d.ts +24 -0
  15. package/dist/services/health.js +29 -0
  16. package/dist/services/health.js.map +1 -1
  17. package/dist/services/health.mjs +29 -0
  18. package/dist/services/health.mjs.map +1 -1
  19. package/dist/services/messaging.d.mts +2 -2
  20. package/dist/services/messaging.d.ts +2 -2
  21. package/dist/services/messaging.js.map +1 -1
  22. package/dist/services/messaging.mjs.map +1 -1
  23. package/dist/services/sites.d.mts +4 -4
  24. package/dist/services/sites.d.ts +4 -4
  25. package/dist/services/sites.js +5 -8
  26. package/dist/services/sites.js.map +1 -1
  27. package/dist/services/sites.mjs +5 -8
  28. package/dist/services/sites.mjs.map +1 -1
  29. package/dist/services/tables-db.d.mts +4 -1
  30. package/dist/services/tables-db.d.ts +4 -1
  31. package/dist/services/tables-db.js +6 -1
  32. package/dist/services/tables-db.js.map +1 -1
  33. package/dist/services/tables-db.mjs +6 -1
  34. package/dist/services/tables-db.mjs.map +1 -1
  35. package/dist/services/teams.d.mts +4 -4
  36. package/dist/services/teams.d.ts +4 -4
  37. package/dist/services/teams.js.map +1 -1
  38. package/dist/services/teams.mjs.map +1 -1
  39. package/package.json +1 -1
@@ -2067,6 +2067,52 @@ var Databases = class {
2067
2067
  payload
2068
2068
  );
2069
2069
  }
2070
+ updateRelationshipAttribute(paramsOrFirst, ...rest) {
2071
+ let params;
2072
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2073
+ params = paramsOrFirst || {};
2074
+ } else {
2075
+ params = {
2076
+ databaseId: paramsOrFirst,
2077
+ collectionId: rest[0],
2078
+ key: rest[1],
2079
+ onDelete: rest[2],
2080
+ newKey: rest[3]
2081
+ };
2082
+ }
2083
+ const databaseId = params.databaseId;
2084
+ const collectionId = params.collectionId;
2085
+ const key = params.key;
2086
+ const onDelete = params.onDelete;
2087
+ const newKey = params.newKey;
2088
+ if (typeof databaseId === "undefined") {
2089
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2090
+ }
2091
+ if (typeof collectionId === "undefined") {
2092
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2093
+ }
2094
+ if (typeof key === "undefined") {
2095
+ throw new AppwriteException('Missing required parameter: "key"');
2096
+ }
2097
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
2098
+ const payload = {};
2099
+ if (typeof onDelete !== "undefined") {
2100
+ payload["onDelete"] = onDelete;
2101
+ }
2102
+ if (typeof newKey !== "undefined") {
2103
+ payload["newKey"] = newKey;
2104
+ }
2105
+ const uri = new URL(this.client.config.endpoint + apiPath);
2106
+ const apiHeaders = {
2107
+ "content-type": "application/json"
2108
+ };
2109
+ return this.client.call(
2110
+ "patch",
2111
+ uri,
2112
+ apiHeaders,
2113
+ payload
2114
+ );
2115
+ }
2070
2116
  createStringAttribute(paramsOrFirst, ...rest) {
2071
2117
  let params;
2072
2118
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -2634,52 +2680,6 @@ var Databases = class {
2634
2680
  payload
2635
2681
  );
2636
2682
  }
2637
- updateRelationshipAttribute(paramsOrFirst, ...rest) {
2638
- let params;
2639
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2640
- params = paramsOrFirst || {};
2641
- } else {
2642
- params = {
2643
- databaseId: paramsOrFirst,
2644
- collectionId: rest[0],
2645
- key: rest[1],
2646
- onDelete: rest[2],
2647
- newKey: rest[3]
2648
- };
2649
- }
2650
- const databaseId = params.databaseId;
2651
- const collectionId = params.collectionId;
2652
- const key = params.key;
2653
- const onDelete = params.onDelete;
2654
- const newKey = params.newKey;
2655
- if (typeof databaseId === "undefined") {
2656
- throw new AppwriteException('Missing required parameter: "databaseId"');
2657
- }
2658
- if (typeof collectionId === "undefined") {
2659
- throw new AppwriteException('Missing required parameter: "collectionId"');
2660
- }
2661
- if (typeof key === "undefined") {
2662
- throw new AppwriteException('Missing required parameter: "key"');
2663
- }
2664
- const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
2665
- const payload = {};
2666
- if (typeof onDelete !== "undefined") {
2667
- payload["onDelete"] = onDelete;
2668
- }
2669
- if (typeof newKey !== "undefined") {
2670
- payload["newKey"] = newKey;
2671
- }
2672
- const uri = new URL(this.client.config.endpoint + apiPath);
2673
- const apiHeaders = {
2674
- "content-type": "application/json"
2675
- };
2676
- return this.client.call(
2677
- "patch",
2678
- uri,
2679
- apiHeaders,
2680
- payload
2681
- );
2682
- }
2683
2683
  listDocuments(paramsOrFirst, ...rest) {
2684
2684
  let params;
2685
2685
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -2690,7 +2690,8 @@ var Databases = class {
2690
2690
  collectionId: rest[0],
2691
2691
  queries: rest[1],
2692
2692
  transactionId: rest[2],
2693
- total: rest[3]
2693
+ total: rest[3],
2694
+ ttl: rest[4]
2694
2695
  };
2695
2696
  }
2696
2697
  const databaseId = params.databaseId;
@@ -2698,6 +2699,7 @@ var Databases = class {
2698
2699
  const queries = params.queries;
2699
2700
  const transactionId = params.transactionId;
2700
2701
  const total = params.total;
2702
+ const ttl = params.ttl;
2701
2703
  if (typeof databaseId === "undefined") {
2702
2704
  throw new AppwriteException('Missing required parameter: "databaseId"');
2703
2705
  }
@@ -2715,6 +2717,9 @@ var Databases = class {
2715
2717
  if (typeof total !== "undefined") {
2716
2718
  payload["total"] = total;
2717
2719
  }
2720
+ if (typeof ttl !== "undefined") {
2721
+ payload["ttl"] = ttl;
2722
+ }
2718
2723
  const uri = new URL(this.client.config.endpoint + apiPath);
2719
2724
  const apiHeaders = {};
2720
2725
  return this.client.call(