node-appwrite 16.0.0 → 17.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 (92) hide show
  1. package/README.md +2 -2
  2. package/dist/client.js +3 -3
  3. package/dist/client.js.map +1 -1
  4. package/dist/client.mjs +3 -3
  5. package/dist/client.mjs.map +1 -1
  6. package/dist/enums/adapter.d.mts +6 -0
  7. package/dist/enums/adapter.d.ts +6 -0
  8. package/dist/enums/adapter.js +11 -0
  9. package/dist/enums/adapter.js.map +1 -0
  10. package/dist/enums/adapter.mjs +10 -0
  11. package/dist/enums/adapter.mjs.map +1 -0
  12. package/dist/enums/build-runtime.d.mts +67 -0
  13. package/dist/enums/build-runtime.d.ts +67 -0
  14. package/dist/enums/build-runtime.js +72 -0
  15. package/dist/enums/build-runtime.js.map +1 -0
  16. package/dist/enums/build-runtime.mjs +71 -0
  17. package/dist/enums/build-runtime.mjs.map +1 -0
  18. package/dist/enums/deployment-download-type.d.mts +6 -0
  19. package/dist/enums/deployment-download-type.d.ts +6 -0
  20. package/dist/enums/deployment-download-type.js +11 -0
  21. package/dist/enums/deployment-download-type.js.map +1 -0
  22. package/dist/enums/deployment-download-type.mjs +10 -0
  23. package/dist/enums/deployment-download-type.mjs.map +1 -0
  24. package/dist/enums/framework.d.mts +18 -0
  25. package/dist/enums/framework.d.ts +18 -0
  26. package/dist/enums/framework.js +23 -0
  27. package/dist/enums/framework.js.map +1 -0
  28. package/dist/enums/framework.mjs +22 -0
  29. package/dist/enums/framework.mjs.map +1 -0
  30. package/dist/enums/image-format.d.mts +0 -1
  31. package/dist/enums/image-format.d.ts +0 -1
  32. package/dist/enums/image-format.js +0 -1
  33. package/dist/enums/image-format.js.map +1 -1
  34. package/dist/enums/image-format.mjs +0 -1
  35. package/dist/enums/image-format.mjs.map +1 -1
  36. package/dist/enums/runtime.d.mts +5 -1
  37. package/dist/enums/runtime.d.ts +5 -1
  38. package/dist/enums/runtime.js +4 -0
  39. package/dist/enums/runtime.js.map +1 -1
  40. package/dist/enums/runtime.mjs +4 -0
  41. package/dist/enums/runtime.mjs.map +1 -1
  42. package/dist/enums/v-c-s-deployment-type.d.mts +7 -0
  43. package/dist/enums/v-c-s-deployment-type.d.ts +7 -0
  44. package/dist/enums/v-c-s-deployment-type.js +12 -0
  45. package/dist/enums/v-c-s-deployment-type.js.map +1 -0
  46. package/dist/enums/v-c-s-deployment-type.mjs +11 -0
  47. package/dist/enums/v-c-s-deployment-type.mjs.map +1 -0
  48. package/dist/index.d.mts +7 -0
  49. package/dist/index.d.ts +7 -0
  50. package/dist/index.js +35 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/index.mjs +7 -0
  53. package/dist/index.mjs.map +1 -1
  54. package/dist/models.d.mts +286 -48
  55. package/dist/models.d.ts +286 -48
  56. package/dist/services/databases.d.mts +44 -2
  57. package/dist/services/databases.d.ts +44 -2
  58. package/dist/services/databases.js +151 -12
  59. package/dist/services/databases.js.map +1 -1
  60. package/dist/services/databases.mjs +151 -12
  61. package/dist/services/databases.mjs.map +1 -1
  62. package/dist/services/functions.d.mts +56 -30
  63. package/dist/services/functions.d.ts +56 -30
  64. package/dist/services/functions.js +185 -87
  65. package/dist/services/functions.js.map +1 -1
  66. package/dist/services/functions.mjs +185 -87
  67. package/dist/services/functions.mjs.map +1 -1
  68. package/dist/services/sites.d.mts +286 -0
  69. package/dist/services/sites.d.ts +286 -0
  70. package/dist/services/sites.js +923 -0
  71. package/dist/services/sites.js.map +1 -0
  72. package/dist/services/sites.mjs +922 -0
  73. package/dist/services/sites.mjs.map +1 -0
  74. package/dist/services/storage.d.mts +6 -3
  75. package/dist/services/storage.d.ts +6 -3
  76. package/dist/services/storage.js +15 -3
  77. package/dist/services/storage.js.map +1 -1
  78. package/dist/services/storage.mjs +15 -3
  79. package/dist/services/storage.mjs.map +1 -1
  80. package/dist/services/tokens.d.mts +55 -0
  81. package/dist/services/tokens.d.ts +55 -0
  82. package/dist/services/tokens.js +149 -0
  83. package/dist/services/tokens.js.map +1 -0
  84. package/dist/services/tokens.mjs +148 -0
  85. package/dist/services/tokens.mjs.map +1 -0
  86. package/dist/services/users.d.mts +3 -1
  87. package/dist/services/users.d.ts +3 -1
  88. package/dist/services/users.js +9 -1
  89. package/dist/services/users.js.map +1 -1
  90. package/dist/services/users.mjs +9 -1
  91. package/dist/services/users.mjs.map +1 -1
  92. package/package.json +1 -1
@@ -0,0 +1,286 @@
1
+ import { Client, UploadProgress } from '../client.js';
2
+ import { Models } from '../models.js';
3
+ import { Framework } from '../enums/framework.js';
4
+ import { BuildRuntime } from '../enums/build-runtime.js';
5
+ import { Adapter } from '../enums/adapter.js';
6
+ import { VCSDeploymentType } from '../enums/v-c-s-deployment-type.js';
7
+ import { DeploymentDownloadType } from '../enums/deployment-download-type.js';
8
+ import '../query.js';
9
+
10
+ declare class Sites {
11
+ client: Client;
12
+ constructor(client: Client);
13
+ /**
14
+ * Get a list of all the project's sites. You can use the query params to filter your results.
15
+ *
16
+ * @param {string[]} queries
17
+ * @param {string} search
18
+ * @throws {AppwriteException}
19
+ * @returns {Promise<Models.SiteList>}
20
+ */
21
+ list(queries?: string[], search?: string): Promise<Models.SiteList>;
22
+ /**
23
+ * Create a new site.
24
+ *
25
+ * @param {string} siteId
26
+ * @param {string} name
27
+ * @param {Framework} framework
28
+ * @param {BuildRuntime} buildRuntime
29
+ * @param {boolean} enabled
30
+ * @param {boolean} logging
31
+ * @param {number} timeout
32
+ * @param {string} installCommand
33
+ * @param {string} buildCommand
34
+ * @param {string} outputDirectory
35
+ * @param {Adapter} adapter
36
+ * @param {string} installationId
37
+ * @param {string} fallbackFile
38
+ * @param {string} providerRepositoryId
39
+ * @param {string} providerBranch
40
+ * @param {boolean} providerSilentMode
41
+ * @param {string} providerRootDirectory
42
+ * @param {string} specification
43
+ * @throws {AppwriteException}
44
+ * @returns {Promise<Models.Site>}
45
+ */
46
+ 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>;
47
+ /**
48
+ * Get a list of all frameworks that are currently available on the server instance.
49
+ *
50
+ * @throws {AppwriteException}
51
+ * @returns {Promise<Models.FrameworkList>}
52
+ */
53
+ listFrameworks(): Promise<Models.FrameworkList>;
54
+ /**
55
+ * List allowed site specifications for this instance.
56
+ *
57
+ * @throws {AppwriteException}
58
+ * @returns {Promise<Models.SpecificationList>}
59
+ */
60
+ listSpecifications(): Promise<Models.SpecificationList>;
61
+ /**
62
+ * Get a site by its unique ID.
63
+ *
64
+ * @param {string} siteId
65
+ * @throws {AppwriteException}
66
+ * @returns {Promise<Models.Site>}
67
+ */
68
+ get(siteId: string): Promise<Models.Site>;
69
+ /**
70
+ * Update site by its unique ID.
71
+ *
72
+ * @param {string} siteId
73
+ * @param {string} name
74
+ * @param {Framework} framework
75
+ * @param {boolean} enabled
76
+ * @param {boolean} logging
77
+ * @param {number} timeout
78
+ * @param {string} installCommand
79
+ * @param {string} buildCommand
80
+ * @param {string} outputDirectory
81
+ * @param {BuildRuntime} buildRuntime
82
+ * @param {Adapter} adapter
83
+ * @param {string} fallbackFile
84
+ * @param {string} installationId
85
+ * @param {string} providerRepositoryId
86
+ * @param {string} providerBranch
87
+ * @param {boolean} providerSilentMode
88
+ * @param {string} providerRootDirectory
89
+ * @param {string} specification
90
+ * @throws {AppwriteException}
91
+ * @returns {Promise<Models.Site>}
92
+ */
93
+ 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>;
94
+ /**
95
+ * Delete a site by its unique ID.
96
+ *
97
+ * @param {string} siteId
98
+ * @throws {AppwriteException}
99
+ * @returns {Promise<{}>}
100
+ */
101
+ delete(siteId: string): Promise<{}>;
102
+ /**
103
+ * Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.
104
+ *
105
+ * @param {string} siteId
106
+ * @param {string} deploymentId
107
+ * @throws {AppwriteException}
108
+ * @returns {Promise<Models.Site>}
109
+ */
110
+ updateSiteDeployment(siteId: string, deploymentId: string): Promise<Models.Site>;
111
+ /**
112
+ * Get a list of all the site&#039;s code deployments. You can use the query params to filter your results.
113
+ *
114
+ * @param {string} siteId
115
+ * @param {string[]} queries
116
+ * @param {string} search
117
+ * @throws {AppwriteException}
118
+ * @returns {Promise<Models.DeploymentList>}
119
+ */
120
+ listDeployments(siteId: string, queries?: string[], search?: string): Promise<Models.DeploymentList>;
121
+ /**
122
+ * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you&#039;ll need to update the function&#039;s deployment to use your new deployment ID.
123
+ *
124
+ * @param {string} siteId
125
+ * @param {File} code
126
+ * @param {boolean} activate
127
+ * @param {string} installCommand
128
+ * @param {string} buildCommand
129
+ * @param {string} outputDirectory
130
+ * @throws {AppwriteException}
131
+ * @returns {Promise<Models.Deployment>}
132
+ */
133
+ createDeployment(siteId: string, code: File, activate: boolean, installCommand?: string, buildCommand?: string, outputDirectory?: string, onProgress?: (progress: UploadProgress) => void): Promise<Models.Deployment>;
134
+ /**
135
+ * Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment&#039;s code will be preserved and used for the new build.
136
+ *
137
+ * @param {string} siteId
138
+ * @param {string} deploymentId
139
+ * @throws {AppwriteException}
140
+ * @returns {Promise<Models.Deployment>}
141
+ */
142
+ createDuplicateDeployment(siteId: string, deploymentId: string): Promise<Models.Deployment>;
143
+ /**
144
+ * Create a deployment based on a template.
145
+
146
+ Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details.
147
+ *
148
+ * @param {string} siteId
149
+ * @param {string} repository
150
+ * @param {string} owner
151
+ * @param {string} rootDirectory
152
+ * @param {string} version
153
+ * @param {boolean} activate
154
+ * @throws {AppwriteException}
155
+ * @returns {Promise<Models.Deployment>}
156
+ */
157
+ createTemplateDeployment(siteId: string, repository: string, owner: string, rootDirectory: string, version: string, activate?: boolean): Promise<Models.Deployment>;
158
+ /**
159
+ * Create a deployment when a site is connected to VCS.
160
+
161
+ This endpoint lets you create deployment from a branch, commit, or a tag.
162
+ *
163
+ * @param {string} siteId
164
+ * @param {VCSDeploymentType} type
165
+ * @param {string} reference
166
+ * @param {boolean} activate
167
+ * @throws {AppwriteException}
168
+ * @returns {Promise<Models.Deployment>}
169
+ */
170
+ createVcsDeployment(siteId: string, type: VCSDeploymentType, reference: string, activate?: boolean): Promise<Models.Deployment>;
171
+ /**
172
+ * Get a site deployment by its unique ID.
173
+ *
174
+ * @param {string} siteId
175
+ * @param {string} deploymentId
176
+ * @throws {AppwriteException}
177
+ * @returns {Promise<Models.Deployment>}
178
+ */
179
+ getDeployment(siteId: string, deploymentId: string): Promise<Models.Deployment>;
180
+ /**
181
+ * Delete a site deployment by its unique ID.
182
+ *
183
+ * @param {string} siteId
184
+ * @param {string} deploymentId
185
+ * @throws {AppwriteException}
186
+ * @returns {Promise<{}>}
187
+ */
188
+ deleteDeployment(siteId: string, deploymentId: string): Promise<{}>;
189
+ /**
190
+ * Get a site deployment content by its unique ID. The endpoint response return with a &#039;Content-Disposition: attachment&#039; header that tells the browser to start downloading the file to user downloads directory.
191
+ *
192
+ * @param {string} siteId
193
+ * @param {string} deploymentId
194
+ * @param {DeploymentDownloadType} type
195
+ * @throws {AppwriteException}
196
+ * @returns {Promise<ArrayBuffer>}
197
+ */
198
+ getDeploymentDownload(siteId: string, deploymentId: string, type?: DeploymentDownloadType): Promise<ArrayBuffer>;
199
+ /**
200
+ * Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn&#039;t started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status &#039;ready&#039;) or failed. The response includes the final build status and details.
201
+ *
202
+ * @param {string} siteId
203
+ * @param {string} deploymentId
204
+ * @throws {AppwriteException}
205
+ * @returns {Promise<Models.Deployment>}
206
+ */
207
+ updateDeploymentStatus(siteId: string, deploymentId: string): Promise<Models.Deployment>;
208
+ /**
209
+ * Get a list of all site logs. You can use the query params to filter your results.
210
+ *
211
+ * @param {string} siteId
212
+ * @param {string[]} queries
213
+ * @throws {AppwriteException}
214
+ * @returns {Promise<Models.ExecutionList>}
215
+ */
216
+ listLogs(siteId: string, queries?: string[]): Promise<Models.ExecutionList>;
217
+ /**
218
+ * Get a site request log by its unique ID.
219
+ *
220
+ * @param {string} siteId
221
+ * @param {string} logId
222
+ * @throws {AppwriteException}
223
+ * @returns {Promise<Models.Execution>}
224
+ */
225
+ getLog(siteId: string, logId: string): Promise<Models.Execution>;
226
+ /**
227
+ * Delete a site log by its unique ID.
228
+ *
229
+ * @param {string} siteId
230
+ * @param {string} logId
231
+ * @throws {AppwriteException}
232
+ * @returns {Promise<{}>}
233
+ */
234
+ deleteLog(siteId: string, logId: string): Promise<{}>;
235
+ /**
236
+ * Get a list of all variables of a specific site.
237
+ *
238
+ * @param {string} siteId
239
+ * @throws {AppwriteException}
240
+ * @returns {Promise<Models.VariableList>}
241
+ */
242
+ listVariables(siteId: string): Promise<Models.VariableList>;
243
+ /**
244
+ * Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.
245
+ *
246
+ * @param {string} siteId
247
+ * @param {string} key
248
+ * @param {string} value
249
+ * @param {boolean} secret
250
+ * @throws {AppwriteException}
251
+ * @returns {Promise<Models.Variable>}
252
+ */
253
+ createVariable(siteId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;
254
+ /**
255
+ * Get a variable by its unique ID.
256
+ *
257
+ * @param {string} siteId
258
+ * @param {string} variableId
259
+ * @throws {AppwriteException}
260
+ * @returns {Promise<Models.Variable>}
261
+ */
262
+ getVariable(siteId: string, variableId: string): Promise<Models.Variable>;
263
+ /**
264
+ * Update variable by its unique ID.
265
+ *
266
+ * @param {string} siteId
267
+ * @param {string} variableId
268
+ * @param {string} key
269
+ * @param {string} value
270
+ * @param {boolean} secret
271
+ * @throws {AppwriteException}
272
+ * @returns {Promise<Models.Variable>}
273
+ */
274
+ updateVariable(siteId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise<Models.Variable>;
275
+ /**
276
+ * Delete a variable by its unique ID.
277
+ *
278
+ * @param {string} siteId
279
+ * @param {string} variableId
280
+ * @throws {AppwriteException}
281
+ * @returns {Promise<{}>}
282
+ */
283
+ deleteVariable(siteId: string, variableId: string): Promise<{}>;
284
+ }
285
+
286
+ export { Sites };