@appwrite.io/console 0.3.0 → 0.4.1
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.
- package/.github/workflows/publish.yml +2 -2
- package/README.md +3 -3
- package/dist/cjs/sdk.js +1354 -1197
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1354 -1197
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +1354 -1197
- package/docs/examples/functions/create.md +1 -1
- package/docs/examples/functions/update.md +1 -1
- package/docs/examples/{projects/get-usage.md → health/get-queue-builds.md} +3 -3
- package/docs/examples/{account/create-with-invite-code.md → health/get-queue-databases.md} +3 -3
- package/docs/examples/health/get-queue-deletes.md +18 -0
- package/docs/examples/health/get-queue-mails.md +18 -0
- package/docs/examples/health/get-queue-messaging.md +18 -0
- package/docs/examples/health/get-queue-migrations.md +18 -0
- package/docs/examples/project/get-usage.md +1 -1
- package/docs/examples/teams/create-membership.md +1 -1
- package/package.json +3 -2
- package/src/client.ts +1 -1
- package/src/models.ts +147 -279
- package/src/query.ts +1 -1
- package/src/role.ts +72 -6
- package/src/services/account.ts +154 -204
- package/src/services/assistant.ts +3 -3
- package/src/services/avatars.ts +32 -31
- package/src/services/console.ts +4 -4
- package/src/services/databases.ts +195 -195
- package/src/services/functions.ts +117 -126
- package/src/services/graphql.ts +8 -8
- package/src/services/health.ts +219 -50
- package/src/services/locale.ts +31 -31
- package/src/services/migrations.ts +48 -48
- package/src/services/project.ts +40 -22
- package/src/services/projects.ts +143 -170
- package/src/services/proxy.ts +15 -15
- package/src/services/storage.ts +74 -84
- package/src/services/teams.ts +62 -66
- package/src/services/users.ts +132 -135
- package/src/services/vcs.ts +27 -27
- package/types/models.d.ts +147 -279
- package/types/role.d.ts +62 -0
- package/types/services/account.d.ts +61 -70
- package/types/services/avatars.d.ts +11 -10
- package/types/services/console.d.ts +1 -1
- package/types/services/databases.d.ts +51 -51
- package/types/services/functions.d.ts +32 -27
- package/types/services/graphql.d.ts +2 -2
- package/types/services/health.d.ts +85 -14
- package/types/services/locale.d.ts +7 -7
- package/types/services/project.d.ts +4 -2
- package/types/services/projects.d.ts +26 -36
- package/types/services/storage.d.ts +13 -13
- package/types/services/teams.d.ts +20 -20
- package/types/services/users.d.ts +45 -44
package/src/services/graphql.ts
CHANGED
|
@@ -11,7 +11,7 @@ export class Graphql extends Service {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* GraphQL
|
|
14
|
+
* GraphQL endpoint
|
|
15
15
|
*
|
|
16
16
|
* Execute a GraphQL mutation.
|
|
17
17
|
*
|
|
@@ -24,14 +24,14 @@ export class Graphql extends Service {
|
|
|
24
24
|
throw new AppwriteException('Missing required parameter: "query"');
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const apiPath = '/graphql';
|
|
28
|
+
const payload: Payload = {};
|
|
29
29
|
|
|
30
30
|
if (typeof query !== 'undefined') {
|
|
31
31
|
payload['query'] = query;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const uri = new URL(this.client.config.endpoint +
|
|
34
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
35
35
|
return await this.client.call('post', uri, {
|
|
36
36
|
'x-sdk-graphql': 'true',
|
|
37
37
|
'content-type': 'application/json',
|
|
@@ -39,7 +39,7 @@ export class Graphql extends Service {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* GraphQL
|
|
42
|
+
* GraphQL endpoint
|
|
43
43
|
*
|
|
44
44
|
* Execute a GraphQL mutation.
|
|
45
45
|
*
|
|
@@ -52,14 +52,14 @@ export class Graphql extends Service {
|
|
|
52
52
|
throw new AppwriteException('Missing required parameter: "query"');
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
const apiPath = '/graphql/mutation';
|
|
56
|
+
const payload: Payload = {};
|
|
57
57
|
|
|
58
58
|
if (typeof query !== 'undefined') {
|
|
59
59
|
payload['query'] = query;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const uri = new URL(this.client.config.endpoint +
|
|
62
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
63
63
|
return await this.client.call('post', uri, {
|
|
64
64
|
'x-sdk-graphql': 'true',
|
|
65
65
|
'content-type': 'application/json',
|
package/src/services/health.ts
CHANGED
|
@@ -19,17 +19,17 @@ export class Health extends Service {
|
|
|
19
19
|
* @returns {Promise}
|
|
20
20
|
*/
|
|
21
21
|
async get(): Promise<Models.HealthStatus> {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const apiPath = '/health';
|
|
23
|
+
const payload: Payload = {};
|
|
24
24
|
|
|
25
|
-
const uri = new URL(this.client.config.endpoint +
|
|
25
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
26
26
|
return await this.client.call('get', uri, {
|
|
27
27
|
'content-type': 'application/json',
|
|
28
28
|
}, payload);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Get
|
|
32
|
+
* Get antivirus
|
|
33
33
|
*
|
|
34
34
|
* Check the Appwrite Antivirus server is up and connection is successful.
|
|
35
35
|
*
|
|
@@ -37,17 +37,17 @@ export class Health extends Service {
|
|
|
37
37
|
* @returns {Promise}
|
|
38
38
|
*/
|
|
39
39
|
async getAntivirus(): Promise<Models.HealthAntivirus> {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
const apiPath = '/health/anti-virus';
|
|
41
|
+
const payload: Payload = {};
|
|
42
42
|
|
|
43
|
-
const uri = new URL(this.client.config.endpoint +
|
|
43
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44
44
|
return await this.client.call('get', uri, {
|
|
45
45
|
'content-type': 'application/json',
|
|
46
46
|
}, payload);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
* Get
|
|
50
|
+
* Get cache
|
|
51
51
|
*
|
|
52
52
|
* Check the Appwrite in-memory cache servers are up and connection is
|
|
53
53
|
* successful.
|
|
@@ -56,10 +56,10 @@ export class Health extends Service {
|
|
|
56
56
|
* @returns {Promise}
|
|
57
57
|
*/
|
|
58
58
|
async getCache(): Promise<Models.HealthStatus> {
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const apiPath = '/health/cache';
|
|
60
|
+
const payload: Payload = {};
|
|
61
61
|
|
|
62
|
-
const uri = new URL(this.client.config.endpoint +
|
|
62
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
63
63
|
return await this.client.call('get', uri, {
|
|
64
64
|
'content-type': 'application/json',
|
|
65
65
|
}, payload);
|
|
@@ -74,17 +74,17 @@ export class Health extends Service {
|
|
|
74
74
|
* @returns {Promise}
|
|
75
75
|
*/
|
|
76
76
|
async getDB(): Promise<Models.HealthStatus> {
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
const apiPath = '/health/db';
|
|
78
|
+
const payload: Payload = {};
|
|
79
79
|
|
|
80
|
-
const uri = new URL(this.client.config.endpoint +
|
|
80
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
81
81
|
return await this.client.call('get', uri, {
|
|
82
82
|
'content-type': 'application/json',
|
|
83
83
|
}, payload);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
|
-
* Get
|
|
87
|
+
* Get pubsub
|
|
88
88
|
*
|
|
89
89
|
* Check the Appwrite pub-sub servers are up and connection is successful.
|
|
90
90
|
*
|
|
@@ -92,17 +92,17 @@ export class Health extends Service {
|
|
|
92
92
|
* @returns {Promise}
|
|
93
93
|
*/
|
|
94
94
|
async getPubSub(): Promise<Models.HealthStatus> {
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
const apiPath = '/health/pubsub';
|
|
96
|
+
const payload: Payload = {};
|
|
97
97
|
|
|
98
|
-
const uri = new URL(this.client.config.endpoint +
|
|
98
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
99
99
|
return await this.client.call('get', uri, {
|
|
100
100
|
'content-type': 'application/json',
|
|
101
101
|
}, payload);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
|
-
* Get
|
|
105
|
+
* Get queue
|
|
106
106
|
*
|
|
107
107
|
* Check the Appwrite queue messaging servers are up and connection is
|
|
108
108
|
* successful.
|
|
@@ -111,92 +111,261 @@ export class Health extends Service {
|
|
|
111
111
|
* @returns {Promise}
|
|
112
112
|
*/
|
|
113
113
|
async getQueue(): Promise<Models.HealthStatus> {
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
const apiPath = '/health/queue';
|
|
115
|
+
const payload: Payload = {};
|
|
116
116
|
|
|
117
|
-
const uri = new URL(this.client.config.endpoint +
|
|
117
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
118
118
|
return await this.client.call('get', uri, {
|
|
119
119
|
'content-type': 'application/json',
|
|
120
120
|
}, payload);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
* Get
|
|
124
|
+
* Get builds queue
|
|
125
|
+
*
|
|
126
|
+
* Get the number of builds that are waiting to be processed in the Appwrite
|
|
127
|
+
* internal queue server.
|
|
128
|
+
*
|
|
129
|
+
* @param {number} threshold
|
|
130
|
+
* @throws {AppwriteException}
|
|
131
|
+
* @returns {Promise}
|
|
132
|
+
*/
|
|
133
|
+
async getQueueBuilds(threshold?: number): Promise<Models.HealthQueue> {
|
|
134
|
+
const apiPath = '/health/queue/builds';
|
|
135
|
+
const payload: Payload = {};
|
|
136
|
+
|
|
137
|
+
if (typeof threshold !== 'undefined') {
|
|
138
|
+
payload['threshold'] = threshold;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
142
|
+
return await this.client.call('get', uri, {
|
|
143
|
+
'content-type': 'application/json',
|
|
144
|
+
}, payload);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Get certificates queue
|
|
125
149
|
*
|
|
126
150
|
* Get the number of certificates that are waiting to be issued against
|
|
127
151
|
* [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
|
|
128
152
|
* server.
|
|
129
153
|
*
|
|
154
|
+
* @param {number} threshold
|
|
130
155
|
* @throws {AppwriteException}
|
|
131
156
|
* @returns {Promise}
|
|
132
157
|
*/
|
|
133
|
-
async getQueueCertificates(): Promise<Models.HealthQueue> {
|
|
134
|
-
|
|
135
|
-
|
|
158
|
+
async getQueueCertificates(threshold?: number): Promise<Models.HealthQueue> {
|
|
159
|
+
const apiPath = '/health/queue/certificates';
|
|
160
|
+
const payload: Payload = {};
|
|
136
161
|
|
|
137
|
-
|
|
162
|
+
if (typeof threshold !== 'undefined') {
|
|
163
|
+
payload['threshold'] = threshold;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
138
167
|
return await this.client.call('get', uri, {
|
|
139
168
|
'content-type': 'application/json',
|
|
140
169
|
}, payload);
|
|
141
170
|
}
|
|
142
171
|
|
|
143
172
|
/**
|
|
144
|
-
* Get
|
|
173
|
+
* Get databases queue
|
|
145
174
|
*
|
|
175
|
+
* Get the number of database changes that are waiting to be processed in the
|
|
176
|
+
* Appwrite internal queue server.
|
|
146
177
|
*
|
|
178
|
+
* @param {string} name
|
|
179
|
+
* @param {number} threshold
|
|
147
180
|
* @throws {AppwriteException}
|
|
148
181
|
* @returns {Promise}
|
|
149
182
|
*/
|
|
150
|
-
async
|
|
151
|
-
|
|
152
|
-
|
|
183
|
+
async getQueueDatabases(name?: string, threshold?: number): Promise<Models.HealthQueue> {
|
|
184
|
+
const apiPath = '/health/queue/databases';
|
|
185
|
+
const payload: Payload = {};
|
|
186
|
+
|
|
187
|
+
if (typeof name !== 'undefined') {
|
|
188
|
+
payload['name'] = name;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (typeof threshold !== 'undefined') {
|
|
192
|
+
payload['threshold'] = threshold;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
196
|
+
return await this.client.call('get', uri, {
|
|
197
|
+
'content-type': 'application/json',
|
|
198
|
+
}, payload);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Get deletes queue
|
|
203
|
+
*
|
|
204
|
+
* Get the number of background destructive changes that are waiting to be
|
|
205
|
+
* processed in the Appwrite internal queue server.
|
|
206
|
+
*
|
|
207
|
+
* @param {number} threshold
|
|
208
|
+
* @throws {AppwriteException}
|
|
209
|
+
* @returns {Promise}
|
|
210
|
+
*/
|
|
211
|
+
async getQueueDeletes(threshold?: number): Promise<Models.HealthQueue> {
|
|
212
|
+
const apiPath = '/health/queue/deletes';
|
|
213
|
+
const payload: Payload = {};
|
|
214
|
+
|
|
215
|
+
if (typeof threshold !== 'undefined') {
|
|
216
|
+
payload['threshold'] = threshold;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
220
|
+
return await this.client.call('get', uri, {
|
|
221
|
+
'content-type': 'application/json',
|
|
222
|
+
}, payload);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Get functions queue
|
|
227
|
+
*
|
|
228
|
+
*
|
|
229
|
+
* @param {number} threshold
|
|
230
|
+
* @throws {AppwriteException}
|
|
231
|
+
* @returns {Promise}
|
|
232
|
+
*/
|
|
233
|
+
async getQueueFunctions(threshold?: number): Promise<Models.HealthQueue> {
|
|
234
|
+
const apiPath = '/health/queue/functions';
|
|
235
|
+
const payload: Payload = {};
|
|
236
|
+
|
|
237
|
+
if (typeof threshold !== 'undefined') {
|
|
238
|
+
payload['threshold'] = threshold;
|
|
239
|
+
}
|
|
153
240
|
|
|
154
|
-
const uri = new URL(this.client.config.endpoint +
|
|
241
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
155
242
|
return await this.client.call('get', uri, {
|
|
156
243
|
'content-type': 'application/json',
|
|
157
244
|
}, payload);
|
|
158
245
|
}
|
|
159
246
|
|
|
160
247
|
/**
|
|
161
|
-
* Get
|
|
248
|
+
* Get logs queue
|
|
162
249
|
*
|
|
163
250
|
* Get the number of logs that are waiting to be processed in the Appwrite
|
|
164
251
|
* internal queue server.
|
|
165
252
|
*
|
|
253
|
+
* @param {number} threshold
|
|
166
254
|
* @throws {AppwriteException}
|
|
167
255
|
* @returns {Promise}
|
|
168
256
|
*/
|
|
169
|
-
async getQueueLogs(): Promise<Models.HealthQueue> {
|
|
170
|
-
|
|
171
|
-
|
|
257
|
+
async getQueueLogs(threshold?: number): Promise<Models.HealthQueue> {
|
|
258
|
+
const apiPath = '/health/queue/logs';
|
|
259
|
+
const payload: Payload = {};
|
|
172
260
|
|
|
173
|
-
|
|
261
|
+
if (typeof threshold !== 'undefined') {
|
|
262
|
+
payload['threshold'] = threshold;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
266
|
+
return await this.client.call('get', uri, {
|
|
267
|
+
'content-type': 'application/json',
|
|
268
|
+
}, payload);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Get mails queue
|
|
273
|
+
*
|
|
274
|
+
* Get the number of mails that are waiting to be processed in the Appwrite
|
|
275
|
+
* internal queue server.
|
|
276
|
+
*
|
|
277
|
+
* @param {number} threshold
|
|
278
|
+
* @throws {AppwriteException}
|
|
279
|
+
* @returns {Promise}
|
|
280
|
+
*/
|
|
281
|
+
async getQueueMails(threshold?: number): Promise<Models.HealthQueue> {
|
|
282
|
+
const apiPath = '/health/queue/mails';
|
|
283
|
+
const payload: Payload = {};
|
|
284
|
+
|
|
285
|
+
if (typeof threshold !== 'undefined') {
|
|
286
|
+
payload['threshold'] = threshold;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
174
290
|
return await this.client.call('get', uri, {
|
|
175
291
|
'content-type': 'application/json',
|
|
176
292
|
}, payload);
|
|
177
293
|
}
|
|
178
294
|
|
|
179
295
|
/**
|
|
180
|
-
* Get
|
|
296
|
+
* Get messaging queue
|
|
297
|
+
*
|
|
298
|
+
* Get the number of messages that are waiting to be processed in the Appwrite
|
|
299
|
+
* internal queue server.
|
|
300
|
+
*
|
|
301
|
+
* @param {number} threshold
|
|
302
|
+
* @throws {AppwriteException}
|
|
303
|
+
* @returns {Promise}
|
|
304
|
+
*/
|
|
305
|
+
async getQueueMessaging(threshold?: number): Promise<Models.HealthQueue> {
|
|
306
|
+
const apiPath = '/health/queue/messaging';
|
|
307
|
+
const payload: Payload = {};
|
|
308
|
+
|
|
309
|
+
if (typeof threshold !== 'undefined') {
|
|
310
|
+
payload['threshold'] = threshold;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
314
|
+
return await this.client.call('get', uri, {
|
|
315
|
+
'content-type': 'application/json',
|
|
316
|
+
}, payload);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Get migrations queue
|
|
321
|
+
*
|
|
322
|
+
* Get the number of migrations that are waiting to be processed in the
|
|
323
|
+
* Appwrite internal queue server.
|
|
324
|
+
*
|
|
325
|
+
* @param {number} threshold
|
|
326
|
+
* @throws {AppwriteException}
|
|
327
|
+
* @returns {Promise}
|
|
328
|
+
*/
|
|
329
|
+
async getQueueMigrations(threshold?: number): Promise<Models.HealthQueue> {
|
|
330
|
+
const apiPath = '/health/queue/migrations';
|
|
331
|
+
const payload: Payload = {};
|
|
332
|
+
|
|
333
|
+
if (typeof threshold !== 'undefined') {
|
|
334
|
+
payload['threshold'] = threshold;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
338
|
+
return await this.client.call('get', uri, {
|
|
339
|
+
'content-type': 'application/json',
|
|
340
|
+
}, payload);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Get webhooks queue
|
|
181
345
|
*
|
|
182
346
|
* Get the number of webhooks that are waiting to be processed in the Appwrite
|
|
183
347
|
* internal queue server.
|
|
184
348
|
*
|
|
349
|
+
* @param {number} threshold
|
|
185
350
|
* @throws {AppwriteException}
|
|
186
351
|
* @returns {Promise}
|
|
187
352
|
*/
|
|
188
|
-
async getQueueWebhooks(): Promise<Models.HealthQueue> {
|
|
189
|
-
|
|
190
|
-
|
|
353
|
+
async getQueueWebhooks(threshold?: number): Promise<Models.HealthQueue> {
|
|
354
|
+
const apiPath = '/health/queue/webhooks';
|
|
355
|
+
const payload: Payload = {};
|
|
356
|
+
|
|
357
|
+
if (typeof threshold !== 'undefined') {
|
|
358
|
+
payload['threshold'] = threshold;
|
|
359
|
+
}
|
|
191
360
|
|
|
192
|
-
const uri = new URL(this.client.config.endpoint +
|
|
361
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
193
362
|
return await this.client.call('get', uri, {
|
|
194
363
|
'content-type': 'application/json',
|
|
195
364
|
}, payload);
|
|
196
365
|
}
|
|
197
366
|
|
|
198
367
|
/**
|
|
199
|
-
* Get
|
|
368
|
+
* Get local storage
|
|
200
369
|
*
|
|
201
370
|
* Check the Appwrite local storage device is up and connection is successful.
|
|
202
371
|
*
|
|
@@ -204,17 +373,17 @@ export class Health extends Service {
|
|
|
204
373
|
* @returns {Promise}
|
|
205
374
|
*/
|
|
206
375
|
async getStorageLocal(): Promise<Models.HealthStatus> {
|
|
207
|
-
|
|
208
|
-
|
|
376
|
+
const apiPath = '/health/storage/local';
|
|
377
|
+
const payload: Payload = {};
|
|
209
378
|
|
|
210
|
-
const uri = new URL(this.client.config.endpoint +
|
|
379
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
211
380
|
return await this.client.call('get', uri, {
|
|
212
381
|
'content-type': 'application/json',
|
|
213
382
|
}, payload);
|
|
214
383
|
}
|
|
215
384
|
|
|
216
385
|
/**
|
|
217
|
-
* Get
|
|
386
|
+
* Get time
|
|
218
387
|
*
|
|
219
388
|
* Check the Appwrite server time is synced with Google remote NTP server. We
|
|
220
389
|
* use this technology to smoothly handle leap seconds with no disruptive
|
|
@@ -228,10 +397,10 @@ export class Health extends Service {
|
|
|
228
397
|
* @returns {Promise}
|
|
229
398
|
*/
|
|
230
399
|
async getTime(): Promise<Models.HealthTime> {
|
|
231
|
-
|
|
232
|
-
|
|
400
|
+
const apiPath = '/health/time';
|
|
401
|
+
const payload: Payload = {};
|
|
233
402
|
|
|
234
|
-
const uri = new URL(this.client.config.endpoint +
|
|
403
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
235
404
|
return await this.client.call('get', uri, {
|
|
236
405
|
'content-type': 'application/json',
|
|
237
406
|
}, payload);
|
package/src/services/locale.ts
CHANGED
|
@@ -11,7 +11,7 @@ export class Locale extends Service {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Get
|
|
14
|
+
* Get user locale
|
|
15
15
|
*
|
|
16
16
|
* Get the current user location based on IP. Returns an object with user
|
|
17
17
|
* country code, country name, continent name, continent code, ip address and
|
|
@@ -24,10 +24,10 @@ export class Locale extends Service {
|
|
|
24
24
|
* @returns {Promise}
|
|
25
25
|
*/
|
|
26
26
|
async get(): Promise<Models.Locale> {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const apiPath = '/locale';
|
|
28
|
+
const payload: Payload = {};
|
|
29
29
|
|
|
30
|
-
const uri = new URL(this.client.config.endpoint +
|
|
30
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
31
31
|
return await this.client.call('get', uri, {
|
|
32
32
|
'content-type': 'application/json',
|
|
33
33
|
}, payload);
|
|
@@ -43,17 +43,17 @@ export class Locale extends Service {
|
|
|
43
43
|
* @returns {Promise}
|
|
44
44
|
*/
|
|
45
45
|
async listCodes(): Promise<Models.LocaleCodeList> {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const apiPath = '/locale/codes';
|
|
47
|
+
const payload: Payload = {};
|
|
48
48
|
|
|
49
|
-
const uri = new URL(this.client.config.endpoint +
|
|
49
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50
50
|
return await this.client.call('get', uri, {
|
|
51
51
|
'content-type': 'application/json',
|
|
52
52
|
}, payload);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* List
|
|
56
|
+
* List continents
|
|
57
57
|
*
|
|
58
58
|
* List of all continents. You can use the locale header to get the data in a
|
|
59
59
|
* supported language.
|
|
@@ -62,17 +62,17 @@ export class Locale extends Service {
|
|
|
62
62
|
* @returns {Promise}
|
|
63
63
|
*/
|
|
64
64
|
async listContinents(): Promise<Models.ContinentList> {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
const apiPath = '/locale/continents';
|
|
66
|
+
const payload: Payload = {};
|
|
67
67
|
|
|
68
|
-
const uri = new URL(this.client.config.endpoint +
|
|
68
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
69
69
|
return await this.client.call('get', uri, {
|
|
70
70
|
'content-type': 'application/json',
|
|
71
71
|
}, payload);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
|
-
* List
|
|
75
|
+
* List countries
|
|
76
76
|
*
|
|
77
77
|
* List of all countries. You can use the locale header to get the data in a
|
|
78
78
|
* supported language.
|
|
@@ -81,17 +81,17 @@ export class Locale extends Service {
|
|
|
81
81
|
* @returns {Promise}
|
|
82
82
|
*/
|
|
83
83
|
async listCountries(): Promise<Models.CountryList> {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
const apiPath = '/locale/countries';
|
|
85
|
+
const payload: Payload = {};
|
|
86
86
|
|
|
87
|
-
const uri = new URL(this.client.config.endpoint +
|
|
87
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
88
88
|
return await this.client.call('get', uri, {
|
|
89
89
|
'content-type': 'application/json',
|
|
90
90
|
}, payload);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
* List EU
|
|
94
|
+
* List EU countries
|
|
95
95
|
*
|
|
96
96
|
* List of all countries that are currently members of the EU. You can use the
|
|
97
97
|
* locale header to get the data in a supported language.
|
|
@@ -100,17 +100,17 @@ export class Locale extends Service {
|
|
|
100
100
|
* @returns {Promise}
|
|
101
101
|
*/
|
|
102
102
|
async listCountriesEU(): Promise<Models.CountryList> {
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
const apiPath = '/locale/countries/eu';
|
|
104
|
+
const payload: Payload = {};
|
|
105
105
|
|
|
106
|
-
const uri = new URL(this.client.config.endpoint +
|
|
106
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
107
107
|
return await this.client.call('get', uri, {
|
|
108
108
|
'content-type': 'application/json',
|
|
109
109
|
}, payload);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
/**
|
|
113
|
-
* List
|
|
113
|
+
* List countries phone codes
|
|
114
114
|
*
|
|
115
115
|
* List of all countries phone codes. You can use the locale header to get the
|
|
116
116
|
* data in a supported language.
|
|
@@ -119,17 +119,17 @@ export class Locale extends Service {
|
|
|
119
119
|
* @returns {Promise}
|
|
120
120
|
*/
|
|
121
121
|
async listCountriesPhones(): Promise<Models.PhoneList> {
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
const apiPath = '/locale/countries/phones';
|
|
123
|
+
const payload: Payload = {};
|
|
124
124
|
|
|
125
|
-
const uri = new URL(this.client.config.endpoint +
|
|
125
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
126
126
|
return await this.client.call('get', uri, {
|
|
127
127
|
'content-type': 'application/json',
|
|
128
128
|
}, payload);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
|
-
* List
|
|
132
|
+
* List currencies
|
|
133
133
|
*
|
|
134
134
|
* List of all currencies, including currency symbol, name, plural, and
|
|
135
135
|
* decimal digits for all major and minor currencies. You can use the locale
|
|
@@ -139,17 +139,17 @@ export class Locale extends Service {
|
|
|
139
139
|
* @returns {Promise}
|
|
140
140
|
*/
|
|
141
141
|
async listCurrencies(): Promise<Models.CurrencyList> {
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
const apiPath = '/locale/currencies';
|
|
143
|
+
const payload: Payload = {};
|
|
144
144
|
|
|
145
|
-
const uri = new URL(this.client.config.endpoint +
|
|
145
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
146
146
|
return await this.client.call('get', uri, {
|
|
147
147
|
'content-type': 'application/json',
|
|
148
148
|
}, payload);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
/**
|
|
152
|
-
* List
|
|
152
|
+
* List languages
|
|
153
153
|
*
|
|
154
154
|
* List of all languages classified by ISO 639-1 including 2-letter code, name
|
|
155
155
|
* in English, and name in the respective language.
|
|
@@ -158,10 +158,10 @@ export class Locale extends Service {
|
|
|
158
158
|
* @returns {Promise}
|
|
159
159
|
*/
|
|
160
160
|
async listLanguages(): Promise<Models.LanguageList> {
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
const apiPath = '/locale/languages';
|
|
162
|
+
const payload: Payload = {};
|
|
163
163
|
|
|
164
|
-
const uri = new URL(this.client.config.endpoint +
|
|
164
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
165
165
|
return await this.client.call('get', uri, {
|
|
166
166
|
'content-type': 'application/json',
|
|
167
167
|
}, payload);
|