@appwrite.io/console 0.0.1 → 0.0.2-preview-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.
@@ -0,0 +1,280 @@
1
+ import { Service } from '../service';
2
+ import { Client } from '../client';
3
+ import type { Models } from '../models';
4
+ import type { UploadProgress } from '../client';
5
+ export declare class Functions extends Service {
6
+ constructor(client: Client);
7
+ /**
8
+ * List Functions
9
+ *
10
+ * Get a list of all the project's functions. You can use the query params to
11
+ * filter your results.
12
+ *
13
+ * @param {string[]} queries
14
+ * @param {string} search
15
+ * @throws {AppwriteException}
16
+ * @returns {Promise}
17
+ */
18
+ list(queries?: string[], search?: string): Promise<Models.FunctionList>;
19
+ /**
20
+ * Create Function
21
+ *
22
+ * Create a new function. You can pass a list of
23
+ * [permissions](/docs/permissions) to allow different project users or team
24
+ * with access to execute the function using the client API.
25
+ *
26
+ * @param {string} functionId
27
+ * @param {string} name
28
+ * @param {string[]} execute
29
+ * @param {string} runtime
30
+ * @param {string[]} events
31
+ * @param {string} schedule
32
+ * @param {number} timeout
33
+ * @param {boolean} enabled
34
+ * @throws {AppwriteException}
35
+ * @returns {Promise}
36
+ */
37
+ create(functionId: string, name: string, execute: string[], runtime: string, events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function>;
38
+ /**
39
+ * List runtimes
40
+ *
41
+ * Get a list of all runtimes that are currently active on your instance.
42
+ *
43
+ * @throws {AppwriteException}
44
+ * @returns {Promise}
45
+ */
46
+ listRuntimes(): Promise<Models.RuntimeList>;
47
+ /**
48
+ * Get Functions Usage
49
+ *
50
+ *
51
+ * @param {string} range
52
+ * @throws {AppwriteException}
53
+ * @returns {Promise}
54
+ */
55
+ getUsage(range?: string): Promise<Models.UsageFunctions>;
56
+ /**
57
+ * Get Function
58
+ *
59
+ * Get a function by its unique ID.
60
+ *
61
+ * @param {string} functionId
62
+ * @throws {AppwriteException}
63
+ * @returns {Promise}
64
+ */
65
+ get(functionId: string): Promise<Models.Function>;
66
+ /**
67
+ * Update Function
68
+ *
69
+ * Update function by its unique ID.
70
+ *
71
+ * @param {string} functionId
72
+ * @param {string} name
73
+ * @param {string[]} execute
74
+ * @param {string[]} events
75
+ * @param {string} schedule
76
+ * @param {number} timeout
77
+ * @param {boolean} enabled
78
+ * @throws {AppwriteException}
79
+ * @returns {Promise}
80
+ */
81
+ update(functionId: string, name: string, execute: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function>;
82
+ /**
83
+ * Delete Function
84
+ *
85
+ * Delete a function by its unique ID.
86
+ *
87
+ * @param {string} functionId
88
+ * @throws {AppwriteException}
89
+ * @returns {Promise}
90
+ */
91
+ delete(functionId: string): Promise<{}>;
92
+ /**
93
+ * List Deployments
94
+ *
95
+ * Get a list of all the project's code deployments. You can use the query
96
+ * params to filter your results.
97
+ *
98
+ * @param {string} functionId
99
+ * @param {string[]} queries
100
+ * @param {string} search
101
+ * @throws {AppwriteException}
102
+ * @returns {Promise}
103
+ */
104
+ listDeployments(functionId: string, queries?: string[], search?: string): Promise<Models.DeploymentList>;
105
+ /**
106
+ * Create Deployment
107
+ *
108
+ * Create a new function code deployment. Use this endpoint to upload a new
109
+ * version of your code function. To execute your newly uploaded code, you'll
110
+ * need to update the function's deployment to use your new deployment UID.
111
+ *
112
+ * This endpoint accepts a tar.gz file compressed with your code. Make sure to
113
+ * include any dependencies your code has within the compressed file. You can
114
+ * learn more about code packaging in the [Appwrite Cloud Functions
115
+ * tutorial](/docs/functions).
116
+ *
117
+ * Use the "command" param to set the entry point used to execute your code.
118
+ *
119
+ * @param {string} functionId
120
+ * @param {string} entrypoint
121
+ * @param {File} code
122
+ * @param {boolean} activate
123
+ * @throws {AppwriteException}
124
+ * @returns {Promise}
125
+ */
126
+ createDeployment(functionId: string, entrypoint: string, code: File, activate: boolean, onProgress?: (progress: UploadProgress) => void): Promise<Models.Deployment>;
127
+ /**
128
+ * Get Deployment
129
+ *
130
+ * Get a code deployment by its unique ID.
131
+ *
132
+ * @param {string} functionId
133
+ * @param {string} deploymentId
134
+ * @throws {AppwriteException}
135
+ * @returns {Promise}
136
+ */
137
+ getDeployment(functionId: string, deploymentId: string): Promise<Models.Deployment>;
138
+ /**
139
+ * Update Function Deployment
140
+ *
141
+ * Update the function code deployment ID using the unique function ID. Use
142
+ * this endpoint to switch the code deployment that should be executed by the
143
+ * execution endpoint.
144
+ *
145
+ * @param {string} functionId
146
+ * @param {string} deploymentId
147
+ * @throws {AppwriteException}
148
+ * @returns {Promise}
149
+ */
150
+ updateDeployment(functionId: string, deploymentId: string): Promise<Models.Function>;
151
+ /**
152
+ * Delete Deployment
153
+ *
154
+ * Delete a code deployment by its unique ID.
155
+ *
156
+ * @param {string} functionId
157
+ * @param {string} deploymentId
158
+ * @throws {AppwriteException}
159
+ * @returns {Promise}
160
+ */
161
+ deleteDeployment(functionId: string, deploymentId: string): Promise<{}>;
162
+ /**
163
+ * Create Build
164
+ *
165
+ *
166
+ * @param {string} functionId
167
+ * @param {string} deploymentId
168
+ * @param {string} buildId
169
+ * @throws {AppwriteException}
170
+ * @returns {Promise}
171
+ */
172
+ createBuild(functionId: string, deploymentId: string, buildId: string): Promise<{}>;
173
+ /**
174
+ * List Executions
175
+ *
176
+ * Get a list of all the current user function execution logs. You can use the
177
+ * query params to filter your results.
178
+ *
179
+ * @param {string} functionId
180
+ * @param {string[]} queries
181
+ * @param {string} search
182
+ * @throws {AppwriteException}
183
+ * @returns {Promise}
184
+ */
185
+ listExecutions(functionId: string, queries?: string[], search?: string): Promise<Models.ExecutionList>;
186
+ /**
187
+ * Create Execution
188
+ *
189
+ * Trigger a function execution. The returned object will return you the
190
+ * current execution status. You can ping the `Get Execution` endpoint to get
191
+ * updates on the current execution status. Once this endpoint is called, your
192
+ * function execution process will start asynchronously.
193
+ *
194
+ * @param {string} functionId
195
+ * @param {string} data
196
+ * @param {boolean} async
197
+ * @throws {AppwriteException}
198
+ * @returns {Promise}
199
+ */
200
+ createExecution(functionId: string, data?: string, async?: boolean): Promise<Models.Execution>;
201
+ /**
202
+ * Get Execution
203
+ *
204
+ * Get a function execution log by its unique ID.
205
+ *
206
+ * @param {string} functionId
207
+ * @param {string} executionId
208
+ * @throws {AppwriteException}
209
+ * @returns {Promise}
210
+ */
211
+ getExecution(functionId: string, executionId: string): Promise<Models.Execution>;
212
+ /**
213
+ * Get Function Usage
214
+ *
215
+ *
216
+ * @param {string} functionId
217
+ * @param {string} range
218
+ * @throws {AppwriteException}
219
+ * @returns {Promise}
220
+ */
221
+ getFunctionUsage(functionId: string, range?: string): Promise<Models.UsageFunctions>;
222
+ /**
223
+ * List Variables
224
+ *
225
+ * Get a list of all variables of a specific function.
226
+ *
227
+ * @param {string} functionId
228
+ * @throws {AppwriteException}
229
+ * @returns {Promise}
230
+ */
231
+ listVariables(functionId: string): Promise<Models.VariableList>;
232
+ /**
233
+ * Create Variable
234
+ *
235
+ * Create a new function variable. These variables can be accessed within
236
+ * function in the `env` object under the request variable.
237
+ *
238
+ * @param {string} functionId
239
+ * @param {string} key
240
+ * @param {string} value
241
+ * @throws {AppwriteException}
242
+ * @returns {Promise}
243
+ */
244
+ createVariable(functionId: string, key: string, value: string): Promise<Models.Variable>;
245
+ /**
246
+ * Get Variable
247
+ *
248
+ * Get a variable by its unique ID.
249
+ *
250
+ * @param {string} functionId
251
+ * @param {string} variableId
252
+ * @throws {AppwriteException}
253
+ * @returns {Promise}
254
+ */
255
+ getVariable(functionId: string, variableId: string): Promise<Models.Variable>;
256
+ /**
257
+ * Update Variable
258
+ *
259
+ * Update variable by its unique ID.
260
+ *
261
+ * @param {string} functionId
262
+ * @param {string} variableId
263
+ * @param {string} key
264
+ * @param {string} value
265
+ * @throws {AppwriteException}
266
+ * @returns {Promise}
267
+ */
268
+ updateVariable(functionId: string, variableId: string, key: string, value?: string): Promise<Models.Variable>;
269
+ /**
270
+ * Delete Variable
271
+ *
272
+ * Delete a variable by its unique ID.
273
+ *
274
+ * @param {string} functionId
275
+ * @param {string} variableId
276
+ * @throws {AppwriteException}
277
+ * @returns {Promise}
278
+ */
279
+ deleteVariable(functionId: string, variableId: string): Promise<{}>;
280
+ }
@@ -0,0 +1,25 @@
1
+ import { Service } from '../service';
2
+ import { Client } from '../client';
3
+ export declare class Graphql extends Service {
4
+ constructor(client: Client);
5
+ /**
6
+ * GraphQL Endpoint
7
+ *
8
+ * Execute a GraphQL mutation.
9
+ *
10
+ * @param {object} query
11
+ * @throws {AppwriteException}
12
+ * @returns {Promise}
13
+ */
14
+ query(query: object): Promise<{}>;
15
+ /**
16
+ * GraphQL Endpoint
17
+ *
18
+ * Execute a GraphQL mutation.
19
+ *
20
+ * @param {object} query
21
+ * @throws {AppwriteException}
22
+ * @returns {Promise}
23
+ */
24
+ mutation(query: object): Promise<{}>;
25
+ }
@@ -0,0 +1,106 @@
1
+ import { Service } from '../service';
2
+ import { Client } from '../client';
3
+ import type { Models } from '../models';
4
+ export declare class Health extends Service {
5
+ constructor(client: Client);
6
+ /**
7
+ * Get HTTP
8
+ *
9
+ * Check the Appwrite HTTP server is up and responsive.
10
+ *
11
+ * @throws {AppwriteException}
12
+ * @returns {Promise}
13
+ */
14
+ get(): Promise<Models.HealthStatus>;
15
+ /**
16
+ * Get Antivirus
17
+ *
18
+ * Check the Appwrite Antivirus server is up and connection is successful.
19
+ *
20
+ * @throws {AppwriteException}
21
+ * @returns {Promise}
22
+ */
23
+ getAntivirus(): Promise<Models.HealthAntivirus>;
24
+ /**
25
+ * Get Cache
26
+ *
27
+ * Check the Appwrite in-memory cache server is up and connection is
28
+ * successful.
29
+ *
30
+ * @throws {AppwriteException}
31
+ * @returns {Promise}
32
+ */
33
+ getCache(): Promise<Models.HealthStatus>;
34
+ /**
35
+ * Get DB
36
+ *
37
+ * Check the Appwrite database server is up and connection is successful.
38
+ *
39
+ * @throws {AppwriteException}
40
+ * @returns {Promise}
41
+ */
42
+ getDB(): Promise<Models.HealthStatus>;
43
+ /**
44
+ * Get Certificates Queue
45
+ *
46
+ * Get the number of certificates that are waiting to be issued against
47
+ * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
48
+ * server.
49
+ *
50
+ * @throws {AppwriteException}
51
+ * @returns {Promise}
52
+ */
53
+ getQueueCertificates(): Promise<Models.HealthQueue>;
54
+ /**
55
+ * Get Functions Queue
56
+ *
57
+ *
58
+ * @throws {AppwriteException}
59
+ * @returns {Promise}
60
+ */
61
+ getQueueFunctions(): Promise<Models.HealthQueue>;
62
+ /**
63
+ * Get Logs Queue
64
+ *
65
+ * Get the number of logs that are waiting to be processed in the Appwrite
66
+ * internal queue server.
67
+ *
68
+ * @throws {AppwriteException}
69
+ * @returns {Promise}
70
+ */
71
+ getQueueLogs(): Promise<Models.HealthQueue>;
72
+ /**
73
+ * Get Webhooks Queue
74
+ *
75
+ * Get the number of webhooks that are waiting to be processed in the Appwrite
76
+ * internal queue server.
77
+ *
78
+ * @throws {AppwriteException}
79
+ * @returns {Promise}
80
+ */
81
+ getQueueWebhooks(): Promise<Models.HealthQueue>;
82
+ /**
83
+ * Get Local Storage
84
+ *
85
+ * Check the Appwrite local storage device is up and connection is successful.
86
+ *
87
+ * @throws {AppwriteException}
88
+ * @returns {Promise}
89
+ */
90
+ getStorageLocal(): Promise<Models.HealthStatus>;
91
+ /**
92
+ * Get Time
93
+ *
94
+ * Check the Appwrite server time is synced with Google remote NTP server. We
95
+ * use this technology to smoothly handle leap seconds with no disruptive
96
+ * events. The [Network Time
97
+ * Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is
98
+ * used by hundreds of millions of computers and devices to synchronize their
99
+ * clocks over the Internet. If your computer sets its own clock, it likely
100
+ * uses NTP.
101
+ *
102
+ * @throws {AppwriteException}
103
+ * @returns {Promise}
104
+ */
105
+ getTime(): Promise<Models.HealthTime>;
106
+ }
@@ -0,0 +1,81 @@
1
+ import { Service } from '../service';
2
+ import { Client } from '../client';
3
+ import type { Models } from '../models';
4
+ export declare class Locale extends Service {
5
+ constructor(client: Client);
6
+ /**
7
+ * Get User Locale
8
+ *
9
+ * Get the current user location based on IP. Returns an object with user
10
+ * country code, country name, continent name, continent code, ip address and
11
+ * suggested currency. You can use the locale header to get the data in a
12
+ * supported language.
13
+ *
14
+ * ([IP Geolocation by DB-IP](https://db-ip.com))
15
+ *
16
+ * @throws {AppwriteException}
17
+ * @returns {Promise}
18
+ */
19
+ get(): Promise<Models.Locale>;
20
+ /**
21
+ * List Continents
22
+ *
23
+ * List of all continents. You can use the locale header to get the data in a
24
+ * supported language.
25
+ *
26
+ * @throws {AppwriteException}
27
+ * @returns {Promise}
28
+ */
29
+ listContinents(): Promise<Models.ContinentList>;
30
+ /**
31
+ * List Countries
32
+ *
33
+ * List of all countries. You can use the locale header to get the data in a
34
+ * supported language.
35
+ *
36
+ * @throws {AppwriteException}
37
+ * @returns {Promise}
38
+ */
39
+ listCountries(): Promise<Models.CountryList>;
40
+ /**
41
+ * List EU Countries
42
+ *
43
+ * List of all countries that are currently members of the EU. You can use the
44
+ * locale header to get the data in a supported language.
45
+ *
46
+ * @throws {AppwriteException}
47
+ * @returns {Promise}
48
+ */
49
+ listCountriesEU(): Promise<Models.CountryList>;
50
+ /**
51
+ * List Countries Phone Codes
52
+ *
53
+ * List of all countries phone codes. You can use the locale header to get the
54
+ * data in a supported language.
55
+ *
56
+ * @throws {AppwriteException}
57
+ * @returns {Promise}
58
+ */
59
+ listCountriesPhones(): Promise<Models.PhoneList>;
60
+ /**
61
+ * List Currencies
62
+ *
63
+ * List of all currencies, including currency symbol, name, plural, and
64
+ * decimal digits for all major and minor currencies. You can use the locale
65
+ * header to get the data in a supported language.
66
+ *
67
+ * @throws {AppwriteException}
68
+ * @returns {Promise}
69
+ */
70
+ listCurrencies(): Promise<Models.CurrencyList>;
71
+ /**
72
+ * List Languages
73
+ *
74
+ * List of all languages classified by ISO 639-1 including 2-letter code, name
75
+ * in English, and name in the respective language.
76
+ *
77
+ * @throws {AppwriteException}
78
+ * @returns {Promise}
79
+ */
80
+ listLanguages(): Promise<Models.LanguageList>;
81
+ }