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
@@ -66,7 +66,9 @@ declare class Functions {
66
66
  * @param {string} params.providerBranch - Production branch for the repo linked to the function.
67
67
  * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
68
68
  * @param {string} params.providerRootDirectory - Path to function code in the linked repo.
69
- * @param {string} params.specification - Runtime specification for the function and builds.
69
+ * @param {string} params.buildSpecification - Build specification for the function deployments.
70
+ * @param {string} params.runtimeSpecification - Runtime specification for the function executions.
71
+ * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
70
72
  * @throws {AppwriteException}
71
73
  * @returns {Promise<Models.Function>}
72
74
  */
@@ -88,7 +90,9 @@ declare class Functions {
88
90
  providerBranch?: string;
89
91
  providerSilentMode?: boolean;
90
92
  providerRootDirectory?: string;
91
- specification?: string;
93
+ buildSpecification?: string;
94
+ runtimeSpecification?: string;
95
+ deploymentRetention?: number;
92
96
  }): Promise<Models.Function>;
93
97
  /**
94
98
  * Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
@@ -110,12 +114,14 @@ declare class Functions {
110
114
  * @param {string} providerBranch - Production branch for the repo linked to the function.
111
115
  * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
112
116
  * @param {string} providerRootDirectory - Path to function code in the linked repo.
113
- * @param {string} specification - Runtime specification for the function and builds.
117
+ * @param {string} buildSpecification - Build specification for the function deployments.
118
+ * @param {string} runtimeSpecification - Runtime specification for the function executions.
119
+ * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
114
120
  * @throws {AppwriteException}
115
121
  * @returns {Promise<Models.Function>}
116
122
  * @deprecated Use the object parameter style method for a better developer experience.
117
123
  */
118
- create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
124
+ create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise<Models.Function>;
119
125
  /**
120
126
  * Get a list of all runtimes that are currently active on your instance.
121
127
  *
@@ -169,7 +175,9 @@ declare class Functions {
169
175
  * @param {string} params.providerBranch - Production branch for the repo linked to the function
170
176
  * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
171
177
  * @param {string} params.providerRootDirectory - Path to function code in the linked repo.
172
- * @param {string} params.specification - Runtime specification for the function and builds.
178
+ * @param {string} params.buildSpecification - Build specification for the function deployments.
179
+ * @param {string} params.runtimeSpecification - Runtime specification for the function executions.
180
+ * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
173
181
  * @throws {AppwriteException}
174
182
  * @returns {Promise<Models.Function>}
175
183
  */
@@ -191,7 +199,9 @@ declare class Functions {
191
199
  providerBranch?: string;
192
200
  providerSilentMode?: boolean;
193
201
  providerRootDirectory?: string;
194
- specification?: string;
202
+ buildSpecification?: string;
203
+ runtimeSpecification?: string;
204
+ deploymentRetention?: number;
195
205
  }): Promise<Models.Function>;
196
206
  /**
197
207
  * Update function by its unique ID.
@@ -213,12 +223,14 @@ declare class Functions {
213
223
  * @param {string} providerBranch - Production branch for the repo linked to the function
214
224
  * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
215
225
  * @param {string} providerRootDirectory - Path to function code in the linked repo.
216
- * @param {string} specification - Runtime specification for the function and builds.
226
+ * @param {string} buildSpecification - Build specification for the function deployments.
227
+ * @param {string} runtimeSpecification - Runtime specification for the function executions.
228
+ * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
217
229
  * @throws {AppwriteException}
218
230
  * @returns {Promise<Models.Function>}
219
231
  * @deprecated Use the object parameter style method for a better developer experience.
220
232
  */
221
- update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
233
+ update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise<Models.Function>;
222
234
  /**
223
235
  * Delete a function by its unique ID.
224
236
  *
@@ -66,7 +66,9 @@ declare class Functions {
66
66
  * @param {string} params.providerBranch - Production branch for the repo linked to the function.
67
67
  * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
68
68
  * @param {string} params.providerRootDirectory - Path to function code in the linked repo.
69
- * @param {string} params.specification - Runtime specification for the function and builds.
69
+ * @param {string} params.buildSpecification - Build specification for the function deployments.
70
+ * @param {string} params.runtimeSpecification - Runtime specification for the function executions.
71
+ * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
70
72
  * @throws {AppwriteException}
71
73
  * @returns {Promise<Models.Function>}
72
74
  */
@@ -88,7 +90,9 @@ declare class Functions {
88
90
  providerBranch?: string;
89
91
  providerSilentMode?: boolean;
90
92
  providerRootDirectory?: string;
91
- specification?: string;
93
+ buildSpecification?: string;
94
+ runtimeSpecification?: string;
95
+ deploymentRetention?: number;
92
96
  }): Promise<Models.Function>;
93
97
  /**
94
98
  * Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
@@ -110,12 +114,14 @@ declare class Functions {
110
114
  * @param {string} providerBranch - Production branch for the repo linked to the function.
111
115
  * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
112
116
  * @param {string} providerRootDirectory - Path to function code in the linked repo.
113
- * @param {string} specification - Runtime specification for the function and builds.
117
+ * @param {string} buildSpecification - Build specification for the function deployments.
118
+ * @param {string} runtimeSpecification - Runtime specification for the function executions.
119
+ * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
114
120
  * @throws {AppwriteException}
115
121
  * @returns {Promise<Models.Function>}
116
122
  * @deprecated Use the object parameter style method for a better developer experience.
117
123
  */
118
- create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
124
+ create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise<Models.Function>;
119
125
  /**
120
126
  * Get a list of all runtimes that are currently active on your instance.
121
127
  *
@@ -169,7 +175,9 @@ declare class Functions {
169
175
  * @param {string} params.providerBranch - Production branch for the repo linked to the function
170
176
  * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
171
177
  * @param {string} params.providerRootDirectory - Path to function code in the linked repo.
172
- * @param {string} params.specification - Runtime specification for the function and builds.
178
+ * @param {string} params.buildSpecification - Build specification for the function deployments.
179
+ * @param {string} params.runtimeSpecification - Runtime specification for the function executions.
180
+ * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
173
181
  * @throws {AppwriteException}
174
182
  * @returns {Promise<Models.Function>}
175
183
  */
@@ -191,7 +199,9 @@ declare class Functions {
191
199
  providerBranch?: string;
192
200
  providerSilentMode?: boolean;
193
201
  providerRootDirectory?: string;
194
- specification?: string;
202
+ buildSpecification?: string;
203
+ runtimeSpecification?: string;
204
+ deploymentRetention?: number;
195
205
  }): Promise<Models.Function>;
196
206
  /**
197
207
  * Update function by its unique ID.
@@ -213,12 +223,14 @@ declare class Functions {
213
223
  * @param {string} providerBranch - Production branch for the repo linked to the function
214
224
  * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
215
225
  * @param {string} providerRootDirectory - Path to function code in the linked repo.
216
- * @param {string} specification - Runtime specification for the function and builds.
226
+ * @param {string} buildSpecification - Build specification for the function deployments.
227
+ * @param {string} runtimeSpecification - Runtime specification for the function executions.
228
+ * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
217
229
  * @throws {AppwriteException}
218
230
  * @returns {Promise<Models.Function>}
219
231
  * @deprecated Use the object parameter style method for a better developer experience.
220
232
  */
221
- update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
233
+ update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise<Models.Function>;
222
234
  /**
223
235
  * Delete a function by its unique ID.
224
236
  *
@@ -63,7 +63,9 @@ class Functions {
63
63
  providerBranch: rest[13],
64
64
  providerSilentMode: rest[14],
65
65
  providerRootDirectory: rest[15],
66
- specification: rest[16]
66
+ buildSpecification: rest[16],
67
+ runtimeSpecification: rest[17],
68
+ deploymentRetention: rest[18]
67
69
  };
68
70
  }
69
71
  const functionId = params.functionId;
@@ -83,7 +85,9 @@ class Functions {
83
85
  const providerBranch = params.providerBranch;
84
86
  const providerSilentMode = params.providerSilentMode;
85
87
  const providerRootDirectory = params.providerRootDirectory;
86
- const specification = params.specification;
88
+ const buildSpecification = params.buildSpecification;
89
+ const runtimeSpecification = params.runtimeSpecification;
90
+ const deploymentRetention = params.deploymentRetention;
87
91
  if (typeof functionId === "undefined") {
88
92
  throw new client.AppwriteException('Missing required parameter: "functionId"');
89
93
  }
@@ -146,8 +150,14 @@ class Functions {
146
150
  if (typeof providerRootDirectory !== "undefined") {
147
151
  payload["providerRootDirectory"] = providerRootDirectory;
148
152
  }
149
- if (typeof specification !== "undefined") {
150
- payload["specification"] = specification;
153
+ if (typeof buildSpecification !== "undefined") {
154
+ payload["buildSpecification"] = buildSpecification;
155
+ }
156
+ if (typeof runtimeSpecification !== "undefined") {
157
+ payload["runtimeSpecification"] = runtimeSpecification;
158
+ }
159
+ if (typeof deploymentRetention !== "undefined") {
160
+ payload["deploymentRetention"] = deploymentRetention;
151
161
  }
152
162
  const uri = new URL(this.client.config.endpoint + apiPath);
153
163
  const apiHeaders = {
@@ -243,7 +253,9 @@ class Functions {
243
253
  providerBranch: rest[13],
244
254
  providerSilentMode: rest[14],
245
255
  providerRootDirectory: rest[15],
246
- specification: rest[16]
256
+ buildSpecification: rest[16],
257
+ runtimeSpecification: rest[17],
258
+ deploymentRetention: rest[18]
247
259
  };
248
260
  }
249
261
  const functionId = params.functionId;
@@ -263,7 +275,9 @@ class Functions {
263
275
  const providerBranch = params.providerBranch;
264
276
  const providerSilentMode = params.providerSilentMode;
265
277
  const providerRootDirectory = params.providerRootDirectory;
266
- const specification = params.specification;
278
+ const buildSpecification = params.buildSpecification;
279
+ const runtimeSpecification = params.runtimeSpecification;
280
+ const deploymentRetention = params.deploymentRetention;
267
281
  if (typeof functionId === "undefined") {
268
282
  throw new client.AppwriteException('Missing required parameter: "functionId"');
269
283
  }
@@ -320,8 +334,14 @@ class Functions {
320
334
  if (typeof providerRootDirectory !== "undefined") {
321
335
  payload["providerRootDirectory"] = providerRootDirectory;
322
336
  }
323
- if (typeof specification !== "undefined") {
324
- payload["specification"] = specification;
337
+ if (typeof buildSpecification !== "undefined") {
338
+ payload["buildSpecification"] = buildSpecification;
339
+ }
340
+ if (typeof runtimeSpecification !== "undefined") {
341
+ payload["runtimeSpecification"] = runtimeSpecification;
342
+ }
343
+ if (typeof deploymentRetention !== "undefined") {
344
+ payload["deploymentRetention"] = deploymentRetention;
325
345
  }
326
346
  const uri = new URL(this.client.config.endpoint + apiPath);
327
347
  const apiHeaders = {