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.
Files changed (112) hide show
  1. package/README.md +2 -2
  2. package/dist/client.d.mts +33 -0
  3. package/dist/client.d.ts +33 -0
  4. package/dist/client.js +52 -4
  5. package/dist/client.js.map +1 -1
  6. package/dist/client.mjs +52 -4
  7. package/dist/client.mjs.map +1 -1
  8. package/dist/enums/backup-services.d.mts +3 -0
  9. package/dist/enums/backup-services.d.ts +3 -0
  10. package/dist/enums/backup-services.js +3 -0
  11. package/dist/enums/backup-services.js.map +1 -1
  12. package/dist/enums/backup-services.mjs +3 -0
  13. package/dist/enums/backup-services.mjs.map +1 -1
  14. package/dist/enums/database-type.d.mts +3 -1
  15. package/dist/enums/database-type.d.ts +3 -1
  16. package/dist/enums/database-type.js +2 -0
  17. package/dist/enums/database-type.js.map +1 -1
  18. package/dist/enums/database-type.mjs +2 -0
  19. package/dist/enums/database-type.mjs.map +1 -1
  20. package/dist/enums/databases-index-type.d.mts +8 -0
  21. package/dist/enums/databases-index-type.d.ts +8 -0
  22. package/dist/enums/databases-index-type.js +13 -0
  23. package/dist/enums/databases-index-type.js.map +1 -0
  24. package/dist/enums/databases-index-type.mjs +12 -0
  25. package/dist/enums/databases-index-type.mjs.map +1 -0
  26. package/dist/enums/scopes.d.mts +4 -0
  27. package/dist/enums/scopes.d.ts +4 -0
  28. package/dist/enums/scopes.js +4 -0
  29. package/dist/enums/scopes.js.map +1 -1
  30. package/dist/enums/scopes.mjs +4 -0
  31. package/dist/enums/scopes.mjs.map +1 -1
  32. package/dist/enums/{index-type.d.mts → tables-db-index-type.d.mts} +2 -2
  33. package/dist/enums/{index-type.d.ts → tables-db-index-type.d.ts} +2 -2
  34. package/dist/enums/tables-db-index-type.js +13 -0
  35. package/dist/enums/tables-db-index-type.js.map +1 -0
  36. package/dist/enums/tables-db-index-type.mjs +12 -0
  37. package/dist/enums/tables-db-index-type.mjs.map +1 -0
  38. package/dist/enums/template-reference-type.d.mts +1 -1
  39. package/dist/enums/template-reference-type.d.ts +1 -1
  40. package/dist/enums/template-reference-type.js +1 -1
  41. package/dist/enums/template-reference-type.js.map +1 -1
  42. package/dist/enums/template-reference-type.mjs +1 -1
  43. package/dist/enums/template-reference-type.mjs.map +1 -1
  44. package/dist/index.d.mts +4 -1
  45. package/dist/index.d.ts +4 -1
  46. package/dist/index.js +18 -3
  47. package/dist/index.js.map +1 -1
  48. package/dist/index.mjs +4 -1
  49. package/dist/index.mjs.map +1 -1
  50. package/dist/models.d.mts +109 -11
  51. package/dist/models.d.ts +109 -11
  52. package/dist/services/databases.d.mts +45 -42
  53. package/dist/services/databases.d.ts +45 -42
  54. package/dist/services/databases.js +52 -47
  55. package/dist/services/databases.js.map +1 -1
  56. package/dist/services/databases.mjs +52 -47
  57. package/dist/services/databases.mjs.map +1 -1
  58. package/dist/services/functions.d.mts +20 -8
  59. package/dist/services/functions.d.ts +20 -8
  60. package/dist/services/functions.js +28 -8
  61. package/dist/services/functions.js.map +1 -1
  62. package/dist/services/functions.mjs +28 -8
  63. package/dist/services/functions.mjs.map +1 -1
  64. package/dist/services/health.d.mts +23 -94
  65. package/dist/services/health.d.ts +23 -94
  66. package/dist/services/health.js +28 -119
  67. package/dist/services/health.js.map +1 -1
  68. package/dist/services/health.mjs +28 -119
  69. package/dist/services/health.mjs.map +1 -1
  70. package/dist/services/messaging.d.mts +2 -2
  71. package/dist/services/messaging.d.ts +2 -2
  72. package/dist/services/messaging.js.map +1 -1
  73. package/dist/services/messaging.mjs.map +1 -1
  74. package/dist/services/project.d.mts +136 -0
  75. package/dist/services/project.d.ts +136 -0
  76. package/dist/services/project.js +183 -0
  77. package/dist/services/project.js.map +1 -0
  78. package/dist/services/project.mjs +182 -0
  79. package/dist/services/project.mjs.map +1 -0
  80. package/dist/services/sites.d.mts +30 -12
  81. package/dist/services/sites.d.ts +30 -12
  82. package/dist/services/sites.js +60 -33
  83. package/dist/services/sites.js.map +1 -1
  84. package/dist/services/sites.mjs +60 -33
  85. package/dist/services/sites.mjs.map +1 -1
  86. package/dist/services/tables-db.d.mts +9 -6
  87. package/dist/services/tables-db.d.ts +9 -6
  88. package/dist/services/tables-db.js +6 -1
  89. package/dist/services/tables-db.js.map +1 -1
  90. package/dist/services/tables-db.mjs +6 -1
  91. package/dist/services/tables-db.mjs.map +1 -1
  92. package/dist/services/teams.d.mts +4 -4
  93. package/dist/services/teams.d.ts +4 -4
  94. package/dist/services/teams.js.map +1 -1
  95. package/dist/services/teams.mjs.map +1 -1
  96. package/dist/services/users.d.mts +26 -2
  97. package/dist/services/users.d.ts +26 -2
  98. package/dist/services/users.js +34 -0
  99. package/dist/services/users.js.map +1 -1
  100. package/dist/services/users.mjs +34 -0
  101. package/dist/services/users.mjs.map +1 -1
  102. package/dist/services/webhooks.d.mts +179 -0
  103. package/dist/services/webhooks.d.ts +179 -0
  104. package/dist/services/webhooks.js +261 -0
  105. package/dist/services/webhooks.js.map +1 -0
  106. package/dist/services/webhooks.mjs +260 -0
  107. package/dist/services/webhooks.mjs.map +1 -0
  108. package/package.json +5 -3
  109. package/dist/enums/index-type.js +0 -13
  110. package/dist/enums/index-type.js.map +0 -1
  111. package/dist/enums/index-type.mjs +0 -12
  112. package/dist/enums/index-type.mjs.map +0 -1
@@ -2,7 +2,7 @@ import { Client } from '../client.mjs';
2
2
  import { Models } from '../models.mjs';
3
3
  import { RelationshipType } from '../enums/relationship-type.mjs';
4
4
  import { RelationMutate } from '../enums/relation-mutate.mjs';
5
- import { IndexType } from '../enums/index-type.mjs';
5
+ import { TablesDBIndexType } from '../enums/tables-db-index-type.mjs';
6
6
  import { OrderBy } from '../enums/order-by.mjs';
7
7
  import '../query.mjs';
8
8
  import '../enums/database-type.mjs';
@@ -1773,7 +1773,7 @@ declare class TablesDB {
1773
1773
  * @param {string} params.databaseId - Database ID.
1774
1774
  * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
1775
1775
  * @param {string} params.key - Index Key.
1776
- * @param {IndexType} params.type - Index type.
1776
+ * @param {TablesDBIndexType} params.type - Index type.
1777
1777
  * @param {string[]} params.columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.
1778
1778
  * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed.
1779
1779
  * @param {number[]} params.lengths - Length of index. Maximum of 100
@@ -1784,7 +1784,7 @@ declare class TablesDB {
1784
1784
  databaseId: string;
1785
1785
  tableId: string;
1786
1786
  key: string;
1787
- type: IndexType;
1787
+ type: TablesDBIndexType;
1788
1788
  columns: string[];
1789
1789
  orders?: OrderBy[];
1790
1790
  lengths?: number[];
@@ -1796,7 +1796,7 @@ declare class TablesDB {
1796
1796
  * @param {string} databaseId - Database ID.
1797
1797
  * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
1798
1798
  * @param {string} key - Index Key.
1799
- * @param {IndexType} type - Index type.
1799
+ * @param {TablesDBIndexType} type - Index type.
1800
1800
  * @param {string[]} columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.
1801
1801
  * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed.
1802
1802
  * @param {number[]} lengths - Length of index. Maximum of 100
@@ -1804,7 +1804,7 @@ declare class TablesDB {
1804
1804
  * @returns {Promise<Models.ColumnIndex>}
1805
1805
  * @deprecated Use the object parameter style method for a better developer experience.
1806
1806
  */
1807
- createIndex(databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: OrderBy[], lengths?: number[]): Promise<Models.ColumnIndex>;
1807
+ createIndex(databaseId: string, tableId: string, key: string, type: TablesDBIndexType, columns: string[], orders?: OrderBy[], lengths?: number[]): Promise<Models.ColumnIndex>;
1808
1808
  /**
1809
1809
  * Get index by ID.
1810
1810
  *
@@ -1863,6 +1863,7 @@ declare class TablesDB {
1863
1863
  * @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.
1864
1864
  * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
1865
1865
  * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
1866
+ * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
1866
1867
  * @throws {AppwriteException}
1867
1868
  * @returns {Promise<Models.RowList<Row>>}
1868
1869
  */
@@ -1872,6 +1873,7 @@ declare class TablesDB {
1872
1873
  queries?: string[];
1873
1874
  transactionId?: string;
1874
1875
  total?: boolean;
1876
+ ttl?: number;
1875
1877
  }): Promise<Models.RowList<Row>>;
1876
1878
  /**
1877
1879
  * Get a list of all the user's rows in a given table. You can use the query params to filter your results.
@@ -1881,11 +1883,12 @@ declare class TablesDB {
1881
1883
  * @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.
1882
1884
  * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
1883
1885
  * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
1886
+ * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
1884
1887
  * @throws {AppwriteException}
1885
1888
  * @returns {Promise<Models.RowList<Row>>}
1886
1889
  * @deprecated Use the object parameter style method for a better developer experience.
1887
1890
  */
1888
- listRows<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean): Promise<Models.RowList<Row>>;
1891
+ listRows<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise<Models.RowList<Row>>;
1889
1892
  /**
1890
1893
  * Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.
1891
1894
  *
@@ -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 { IndexType } from '../enums/index-type.js';
5
+ import { TablesDBIndexType } from '../enums/tables-db-index-type.js';
6
6
  import { OrderBy } from '../enums/order-by.js';
7
7
  import '../query.js';
8
8
  import '../enums/database-type.js';
@@ -1773,7 +1773,7 @@ declare class TablesDB {
1773
1773
  * @param {string} params.databaseId - Database ID.
1774
1774
  * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
1775
1775
  * @param {string} params.key - Index Key.
1776
- * @param {IndexType} params.type - Index type.
1776
+ * @param {TablesDBIndexType} params.type - Index type.
1777
1777
  * @param {string[]} params.columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.
1778
1778
  * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed.
1779
1779
  * @param {number[]} params.lengths - Length of index. Maximum of 100
@@ -1784,7 +1784,7 @@ declare class TablesDB {
1784
1784
  databaseId: string;
1785
1785
  tableId: string;
1786
1786
  key: string;
1787
- type: IndexType;
1787
+ type: TablesDBIndexType;
1788
1788
  columns: string[];
1789
1789
  orders?: OrderBy[];
1790
1790
  lengths?: number[];
@@ -1796,7 +1796,7 @@ declare class TablesDB {
1796
1796
  * @param {string} databaseId - Database ID.
1797
1797
  * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
1798
1798
  * @param {string} key - Index Key.
1799
- * @param {IndexType} type - Index type.
1799
+ * @param {TablesDBIndexType} type - Index type.
1800
1800
  * @param {string[]} columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.
1801
1801
  * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed.
1802
1802
  * @param {number[]} lengths - Length of index. Maximum of 100
@@ -1804,7 +1804,7 @@ declare class TablesDB {
1804
1804
  * @returns {Promise<Models.ColumnIndex>}
1805
1805
  * @deprecated Use the object parameter style method for a better developer experience.
1806
1806
  */
1807
- createIndex(databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: OrderBy[], lengths?: number[]): Promise<Models.ColumnIndex>;
1807
+ createIndex(databaseId: string, tableId: string, key: string, type: TablesDBIndexType, columns: string[], orders?: OrderBy[], lengths?: number[]): Promise<Models.ColumnIndex>;
1808
1808
  /**
1809
1809
  * Get index by ID.
1810
1810
  *
@@ -1863,6 +1863,7 @@ declare class TablesDB {
1863
1863
  * @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.
1864
1864
  * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
1865
1865
  * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
1866
+ * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
1866
1867
  * @throws {AppwriteException}
1867
1868
  * @returns {Promise<Models.RowList<Row>>}
1868
1869
  */
@@ -1872,6 +1873,7 @@ declare class TablesDB {
1872
1873
  queries?: string[];
1873
1874
  transactionId?: string;
1874
1875
  total?: boolean;
1876
+ ttl?: number;
1875
1877
  }): Promise<Models.RowList<Row>>;
1876
1878
  /**
1877
1879
  * Get a list of all the user's rows in a given table. You can use the query params to filter your results.
@@ -1881,11 +1883,12 @@ declare class TablesDB {
1881
1883
  * @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.
1882
1884
  * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
1883
1885
  * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
1886
+ * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
1884
1887
  * @throws {AppwriteException}
1885
1888
  * @returns {Promise<Models.RowList<Row>>}
1886
1889
  * @deprecated Use the object parameter style method for a better developer experience.
1887
1890
  */
1888
- listRows<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean): Promise<Models.RowList<Row>>;
1891
+ listRows<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise<Models.RowList<Row>>;
1889
1892
  /**
1890
1893
  * Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.
1891
1894
  *
@@ -2865,7 +2865,8 @@ class TablesDB {
2865
2865
  tableId: rest[0],
2866
2866
  queries: rest[1],
2867
2867
  transactionId: rest[2],
2868
- total: rest[3]
2868
+ total: rest[3],
2869
+ ttl: rest[4]
2869
2870
  };
2870
2871
  }
2871
2872
  const databaseId = params.databaseId;
@@ -2873,6 +2874,7 @@ class TablesDB {
2873
2874
  const queries = params.queries;
2874
2875
  const transactionId = params.transactionId;
2875
2876
  const total = params.total;
2877
+ const ttl = params.ttl;
2876
2878
  if (typeof databaseId === "undefined") {
2877
2879
  throw new client.AppwriteException('Missing required parameter: "databaseId"');
2878
2880
  }
@@ -2890,6 +2892,9 @@ class TablesDB {
2890
2892
  if (typeof total !== "undefined") {
2891
2893
  payload["total"] = total;
2892
2894
  }
2895
+ if (typeof ttl !== "undefined") {
2896
+ payload["ttl"] = ttl;
2897
+ }
2893
2898
  const uri = new URL(this.client.config.endpoint + apiPath);
2894
2899
  const apiHeaders = {};
2895
2900
  return this.client.call(