node-appwrite 22.1.3 → 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 (100) 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 +107 -9
  51. package/dist/models.d.ts +107 -9
  52. package/dist/services/databases.d.mts +5 -5
  53. package/dist/services/databases.d.ts +5 -5
  54. package/dist/services/databases.js.map +1 -1
  55. package/dist/services/databases.mjs.map +1 -1
  56. package/dist/services/functions.d.mts +20 -8
  57. package/dist/services/functions.d.ts +20 -8
  58. package/dist/services/functions.js +28 -8
  59. package/dist/services/functions.js.map +1 -1
  60. package/dist/services/functions.mjs +28 -8
  61. package/dist/services/functions.mjs.map +1 -1
  62. package/dist/services/health.d.mts +0 -95
  63. package/dist/services/health.d.ts +0 -95
  64. package/dist/services/health.js +0 -120
  65. package/dist/services/health.js.map +1 -1
  66. package/dist/services/health.mjs +0 -120
  67. package/dist/services/health.mjs.map +1 -1
  68. package/dist/services/project.d.mts +136 -0
  69. package/dist/services/project.d.ts +136 -0
  70. package/dist/services/project.js +183 -0
  71. package/dist/services/project.js.map +1 -0
  72. package/dist/services/project.mjs +182 -0
  73. package/dist/services/project.mjs.map +1 -0
  74. package/dist/services/sites.d.mts +26 -8
  75. package/dist/services/sites.d.ts +26 -8
  76. package/dist/services/sites.js +55 -25
  77. package/dist/services/sites.js.map +1 -1
  78. package/dist/services/sites.mjs +55 -25
  79. package/dist/services/sites.mjs.map +1 -1
  80. package/dist/services/tables-db.d.mts +5 -5
  81. package/dist/services/tables-db.d.ts +5 -5
  82. package/dist/services/tables-db.js.map +1 -1
  83. package/dist/services/tables-db.mjs.map +1 -1
  84. package/dist/services/users.d.mts +26 -2
  85. package/dist/services/users.d.ts +26 -2
  86. package/dist/services/users.js +34 -0
  87. package/dist/services/users.js.map +1 -1
  88. package/dist/services/users.mjs +34 -0
  89. package/dist/services/users.mjs.map +1 -1
  90. package/dist/services/webhooks.d.mts +179 -0
  91. package/dist/services/webhooks.d.ts +179 -0
  92. package/dist/services/webhooks.js +261 -0
  93. package/dist/services/webhooks.js.map +1 -0
  94. package/dist/services/webhooks.mjs +260 -0
  95. package/dist/services/webhooks.mjs.map +1 -0
  96. package/package.json +5 -3
  97. package/dist/enums/index-type.js +0 -13
  98. package/dist/enums/index-type.js.map +0 -1
  99. package/dist/enums/index-type.mjs +0 -12
  100. package/dist/enums/index-type.mjs.map +0 -1
@@ -58,6 +58,7 @@ declare class Sites {
58
58
  * @param {number} params.timeout - Maximum request time in seconds.
59
59
  * @param {string} params.installCommand - Install Command.
60
60
  * @param {string} params.buildCommand - Build Command.
61
+ * @param {string} params.startCommand - Custom start command. Leave empty to use default.
61
62
  * @param {string} params.outputDirectory - Output Directory for site.
62
63
  * @param {Adapter} params.adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
63
64
  * @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
@@ -66,7 +67,9 @@ declare class Sites {
66
67
  * @param {string} params.providerBranch - Production branch for the repo linked to the site.
67
68
  * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
68
69
  * @param {string} params.providerRootDirectory - Path to site code in the linked repo.
69
- * @param {string} params.specification - Framework specification for the site and builds.
70
+ * @param {string} params.buildSpecification - Build specification for the site deployments.
71
+ * @param {string} params.runtimeSpecification - Runtime specification for the SSR executions.
72
+ * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
70
73
  * @throws {AppwriteException}
71
74
  * @returns {Promise<Models.Site>}
72
75
  */
@@ -80,6 +83,7 @@ declare class Sites {
80
83
  timeout?: number;
81
84
  installCommand?: string;
82
85
  buildCommand?: string;
86
+ startCommand?: string;
83
87
  outputDirectory?: string;
84
88
  adapter?: Adapter;
85
89
  installationId?: string;
@@ -88,7 +92,9 @@ declare class Sites {
88
92
  providerBranch?: string;
89
93
  providerSilentMode?: boolean;
90
94
  providerRootDirectory?: string;
91
- specification?: string;
95
+ buildSpecification?: string;
96
+ runtimeSpecification?: string;
97
+ deploymentRetention?: number;
92
98
  }): Promise<Models.Site>;
93
99
  /**
94
100
  * Create a new site.
@@ -102,6 +108,7 @@ declare class Sites {
102
108
  * @param {number} timeout - Maximum request time in seconds.
103
109
  * @param {string} installCommand - Install Command.
104
110
  * @param {string} buildCommand - Build Command.
111
+ * @param {string} startCommand - Custom start command. Leave empty to use default.
105
112
  * @param {string} outputDirectory - Output Directory for site.
106
113
  * @param {Adapter} adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
107
114
  * @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
@@ -110,12 +117,14 @@ declare class Sites {
110
117
  * @param {string} providerBranch - Production branch for the repo linked to the site.
111
118
  * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
112
119
  * @param {string} providerRootDirectory - Path to site code in the linked repo.
113
- * @param {string} specification - Framework specification for the site and builds.
120
+ * @param {string} buildSpecification - Build specification for the site deployments.
121
+ * @param {string} runtimeSpecification - Runtime specification for the SSR executions.
122
+ * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
114
123
  * @throws {AppwriteException}
115
124
  * @returns {Promise<Models.Site>}
116
125
  * @deprecated Use the object parameter style method for a better developer experience.
117
126
  */
118
- create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Site>;
127
+ create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise<Models.Site>;
119
128
  /**
120
129
  * Get a list of all frameworks that are currently available on the server instance.
121
130
  *
@@ -160,6 +169,7 @@ declare class Sites {
160
169
  * @param {number} params.timeout - Maximum request time in seconds.
161
170
  * @param {string} params.installCommand - Install Command.
162
171
  * @param {string} params.buildCommand - Build Command.
172
+ * @param {string} params.startCommand - Custom start command. Leave empty to use default.
163
173
  * @param {string} params.outputDirectory - Output Directory for site.
164
174
  * @param {BuildRuntime} params.buildRuntime - Runtime to use during build step.
165
175
  * @param {Adapter} params.adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
@@ -169,7 +179,9 @@ declare class Sites {
169
179
  * @param {string} params.providerBranch - Production branch for the repo linked to the site.
170
180
  * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
171
181
  * @param {string} params.providerRootDirectory - Path to site code in the linked repo.
172
- * @param {string} params.specification - Framework specification for the site and builds.
182
+ * @param {string} params.buildSpecification - Build specification for the site deployments.
183
+ * @param {string} params.runtimeSpecification - Runtime specification for the SSR executions.
184
+ * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
173
185
  * @throws {AppwriteException}
174
186
  * @returns {Promise<Models.Site>}
175
187
  */
@@ -182,6 +194,7 @@ declare class Sites {
182
194
  timeout?: number;
183
195
  installCommand?: string;
184
196
  buildCommand?: string;
197
+ startCommand?: string;
185
198
  outputDirectory?: string;
186
199
  buildRuntime?: BuildRuntime;
187
200
  adapter?: Adapter;
@@ -191,7 +204,9 @@ declare class Sites {
191
204
  providerBranch?: string;
192
205
  providerSilentMode?: boolean;
193
206
  providerRootDirectory?: string;
194
- specification?: string;
207
+ buildSpecification?: string;
208
+ runtimeSpecification?: string;
209
+ deploymentRetention?: number;
195
210
  }): Promise<Models.Site>;
196
211
  /**
197
212
  * Update site by its unique ID.
@@ -204,6 +219,7 @@ declare class Sites {
204
219
  * @param {number} timeout - Maximum request time in seconds.
205
220
  * @param {string} installCommand - Install Command.
206
221
  * @param {string} buildCommand - Build Command.
222
+ * @param {string} startCommand - Custom start command. Leave empty to use default.
207
223
  * @param {string} outputDirectory - Output Directory for site.
208
224
  * @param {BuildRuntime} buildRuntime - Runtime to use during build step.
209
225
  * @param {Adapter} adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
@@ -213,12 +229,14 @@ declare class Sites {
213
229
  * @param {string} providerBranch - Production branch for the repo linked to the site.
214
230
  * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
215
231
  * @param {string} providerRootDirectory - Path to site code in the linked repo.
216
- * @param {string} specification - Framework specification for the site and builds.
232
+ * @param {string} buildSpecification - Build specification for the site deployments.
233
+ * @param {string} runtimeSpecification - Runtime specification for the SSR executions.
234
+ * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
217
235
  * @throws {AppwriteException}
218
236
  * @returns {Promise<Models.Site>}
219
237
  * @deprecated Use the object parameter style method for a better developer experience.
220
238
  */
221
- update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Site>;
239
+ update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise<Models.Site>;
222
240
  /**
223
241
  * Delete a site by its unique ID.
224
242
  *
@@ -55,15 +55,18 @@ class Sites {
55
55
  timeout: rest[5],
56
56
  installCommand: rest[6],
57
57
  buildCommand: rest[7],
58
- outputDirectory: rest[8],
59
- adapter: rest[9],
60
- installationId: rest[10],
61
- fallbackFile: rest[11],
62
- providerRepositoryId: rest[12],
63
- providerBranch: rest[13],
64
- providerSilentMode: rest[14],
65
- providerRootDirectory: rest[15],
66
- specification: rest[16]
58
+ startCommand: rest[8],
59
+ outputDirectory: rest[9],
60
+ adapter: rest[10],
61
+ installationId: rest[11],
62
+ fallbackFile: rest[12],
63
+ providerRepositoryId: rest[13],
64
+ providerBranch: rest[14],
65
+ providerSilentMode: rest[15],
66
+ providerRootDirectory: rest[16],
67
+ buildSpecification: rest[17],
68
+ runtimeSpecification: rest[18],
69
+ deploymentRetention: rest[19]
67
70
  };
68
71
  }
69
72
  const siteId = params.siteId;
@@ -75,6 +78,7 @@ class Sites {
75
78
  const timeout = params.timeout;
76
79
  const installCommand = params.installCommand;
77
80
  const buildCommand = params.buildCommand;
81
+ const startCommand = params.startCommand;
78
82
  const outputDirectory = params.outputDirectory;
79
83
  const adapter = params.adapter;
80
84
  const installationId = params.installationId;
@@ -83,7 +87,9 @@ class Sites {
83
87
  const providerBranch = params.providerBranch;
84
88
  const providerSilentMode = params.providerSilentMode;
85
89
  const providerRootDirectory = params.providerRootDirectory;
86
- const specification = params.specification;
90
+ const buildSpecification = params.buildSpecification;
91
+ const runtimeSpecification = params.runtimeSpecification;
92
+ const deploymentRetention = params.deploymentRetention;
87
93
  if (typeof siteId === "undefined") {
88
94
  throw new client.AppwriteException('Missing required parameter: "siteId"');
89
95
  }
@@ -122,6 +128,9 @@ class Sites {
122
128
  if (typeof buildCommand !== "undefined") {
123
129
  payload["buildCommand"] = buildCommand;
124
130
  }
131
+ if (typeof startCommand !== "undefined") {
132
+ payload["startCommand"] = startCommand;
133
+ }
125
134
  if (typeof outputDirectory !== "undefined") {
126
135
  payload["outputDirectory"] = outputDirectory;
127
136
  }
@@ -149,8 +158,14 @@ class Sites {
149
158
  if (typeof providerRootDirectory !== "undefined") {
150
159
  payload["providerRootDirectory"] = providerRootDirectory;
151
160
  }
152
- if (typeof specification !== "undefined") {
153
- payload["specification"] = specification;
161
+ if (typeof buildSpecification !== "undefined") {
162
+ payload["buildSpecification"] = buildSpecification;
163
+ }
164
+ if (typeof runtimeSpecification !== "undefined") {
165
+ payload["runtimeSpecification"] = runtimeSpecification;
166
+ }
167
+ if (typeof deploymentRetention !== "undefined") {
168
+ payload["deploymentRetention"] = deploymentRetention;
154
169
  }
155
170
  const uri = new URL(this.client.config.endpoint + apiPath);
156
171
  const apiHeaders = {
@@ -237,16 +252,19 @@ class Sites {
237
252
  timeout: rest[4],
238
253
  installCommand: rest[5],
239
254
  buildCommand: rest[6],
240
- outputDirectory: rest[7],
241
- buildRuntime: rest[8],
242
- adapter: rest[9],
243
- fallbackFile: rest[10],
244
- installationId: rest[11],
245
- providerRepositoryId: rest[12],
246
- providerBranch: rest[13],
247
- providerSilentMode: rest[14],
248
- providerRootDirectory: rest[15],
249
- specification: rest[16]
255
+ startCommand: rest[7],
256
+ outputDirectory: rest[8],
257
+ buildRuntime: rest[9],
258
+ adapter: rest[10],
259
+ fallbackFile: rest[11],
260
+ installationId: rest[12],
261
+ providerRepositoryId: rest[13],
262
+ providerBranch: rest[14],
263
+ providerSilentMode: rest[15],
264
+ providerRootDirectory: rest[16],
265
+ buildSpecification: rest[17],
266
+ runtimeSpecification: rest[18],
267
+ deploymentRetention: rest[19]
250
268
  };
251
269
  }
252
270
  const siteId = params.siteId;
@@ -257,6 +275,7 @@ class Sites {
257
275
  const timeout = params.timeout;
258
276
  const installCommand = params.installCommand;
259
277
  const buildCommand = params.buildCommand;
278
+ const startCommand = params.startCommand;
260
279
  const outputDirectory = params.outputDirectory;
261
280
  const buildRuntime = params.buildRuntime;
262
281
  const adapter = params.adapter;
@@ -266,7 +285,9 @@ class Sites {
266
285
  const providerBranch = params.providerBranch;
267
286
  const providerSilentMode = params.providerSilentMode;
268
287
  const providerRootDirectory = params.providerRootDirectory;
269
- const specification = params.specification;
288
+ const buildSpecification = params.buildSpecification;
289
+ const runtimeSpecification = params.runtimeSpecification;
290
+ const deploymentRetention = params.deploymentRetention;
270
291
  if (typeof siteId === "undefined") {
271
292
  throw new client.AppwriteException('Missing required parameter: "siteId"');
272
293
  }
@@ -299,6 +320,9 @@ class Sites {
299
320
  if (typeof buildCommand !== "undefined") {
300
321
  payload["buildCommand"] = buildCommand;
301
322
  }
323
+ if (typeof startCommand !== "undefined") {
324
+ payload["startCommand"] = startCommand;
325
+ }
302
326
  if (typeof outputDirectory !== "undefined") {
303
327
  payload["outputDirectory"] = outputDirectory;
304
328
  }
@@ -326,8 +350,14 @@ class Sites {
326
350
  if (typeof providerRootDirectory !== "undefined") {
327
351
  payload["providerRootDirectory"] = providerRootDirectory;
328
352
  }
329
- if (typeof specification !== "undefined") {
330
- payload["specification"] = specification;
353
+ if (typeof buildSpecification !== "undefined") {
354
+ payload["buildSpecification"] = buildSpecification;
355
+ }
356
+ if (typeof runtimeSpecification !== "undefined") {
357
+ payload["runtimeSpecification"] = runtimeSpecification;
358
+ }
359
+ if (typeof deploymentRetention !== "undefined") {
360
+ payload["deploymentRetention"] = deploymentRetention;
331
361
  }
332
362
  const uri = new URL(this.client.config.endpoint + apiPath);
333
363
  const apiHeaders = {