node-appwrite 12.0.1 → 12.1.0-rc.4
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/.travis.yml +18 -8
- package/README.md +1 -1
- package/dist/client.d.mts +131 -0
- package/dist/client.d.ts +131 -0
- package/dist/client.js +302 -0
- package/dist/client.js.map +1 -0
- package/dist/client.mjs +295 -0
- package/dist/client.mjs.map +1 -0
- package/dist/enums/authentication-factor.d.mts +8 -0
- package/dist/enums/authentication-factor.d.ts +8 -0
- package/dist/enums/authentication-factor.js +13 -0
- package/dist/enums/authentication-factor.js.map +1 -0
- package/dist/enums/authentication-factor.mjs +11 -0
- package/dist/enums/authentication-factor.mjs.map +1 -0
- package/dist/enums/authenticator-type.d.mts +5 -0
- package/dist/enums/authenticator-type.d.ts +5 -0
- package/dist/enums/authenticator-type.js +10 -0
- package/dist/enums/authenticator-type.js.map +1 -0
- package/dist/enums/authenticator-type.mjs +8 -0
- package/dist/enums/authenticator-type.mjs.map +1 -0
- package/dist/enums/browser.d.mts +18 -0
- package/dist/enums/browser.d.ts +18 -0
- package/dist/enums/browser.js +23 -0
- package/dist/enums/browser.js.map +1 -0
- package/dist/enums/browser.mjs +21 -0
- package/dist/enums/browser.mjs.map +1 -0
- package/dist/enums/compression.d.mts +7 -0
- package/dist/enums/compression.d.ts +7 -0
- package/dist/enums/compression.js +12 -0
- package/dist/enums/compression.js.map +1 -0
- package/dist/enums/compression.mjs +10 -0
- package/dist/enums/compression.mjs.map +1 -0
- package/dist/enums/credit-card.d.mts +20 -0
- package/dist/enums/credit-card.d.ts +20 -0
- package/dist/enums/credit-card.js +25 -0
- package/dist/enums/credit-card.js.map +1 -0
- package/dist/enums/credit-card.mjs +23 -0
- package/dist/enums/credit-card.mjs.map +1 -0
- package/dist/enums/execution-method.d.mts +10 -0
- package/dist/enums/execution-method.d.ts +10 -0
- package/dist/enums/execution-method.js +15 -0
- package/dist/enums/execution-method.js.map +1 -0
- package/dist/enums/execution-method.mjs +13 -0
- package/dist/enums/execution-method.mjs.map +1 -0
- package/dist/enums/flag.d.mts +198 -0
- package/dist/enums/flag.d.ts +198 -0
- package/dist/enums/flag.js +203 -0
- package/dist/enums/flag.js.map +1 -0
- package/dist/enums/flag.mjs +201 -0
- package/dist/enums/flag.mjs.map +1 -0
- package/dist/enums/image-format.d.mts +9 -0
- package/dist/enums/image-format.d.ts +9 -0
- package/dist/enums/image-format.js +14 -0
- package/dist/enums/image-format.js.map +1 -0
- package/dist/enums/image-format.mjs +12 -0
- package/dist/enums/image-format.mjs.map +1 -0
- package/dist/enums/image-gravity.d.mts +13 -0
- package/dist/enums/image-gravity.d.ts +13 -0
- package/dist/enums/image-gravity.js +18 -0
- package/dist/enums/image-gravity.js.map +1 -0
- package/dist/enums/image-gravity.mjs +16 -0
- package/dist/enums/image-gravity.mjs.map +1 -0
- package/dist/enums/index-type.d.mts +7 -0
- package/dist/enums/index-type.d.ts +7 -0
- package/dist/enums/index-type.js +12 -0
- package/dist/enums/index-type.js.map +1 -0
- package/dist/enums/index-type.mjs +10 -0
- package/dist/enums/index-type.mjs.map +1 -0
- package/dist/enums/messaging-provider-type.d.mts +7 -0
- package/dist/enums/messaging-provider-type.d.ts +7 -0
- package/dist/enums/messaging-provider-type.js +12 -0
- package/dist/enums/messaging-provider-type.js.map +1 -0
- package/dist/enums/messaging-provider-type.mjs +10 -0
- package/dist/enums/messaging-provider-type.mjs.map +1 -0
- package/dist/enums/name.d.mts +17 -0
- package/dist/enums/name.d.ts +17 -0
- package/dist/enums/name.js +22 -0
- package/dist/enums/name.js.map +1 -0
- package/dist/enums/name.mjs +20 -0
- package/dist/enums/name.mjs.map +1 -0
- package/dist/enums/o-auth-provider.d.mts +43 -0
- package/dist/enums/o-auth-provider.d.ts +43 -0
- package/dist/enums/o-auth-provider.js +48 -0
- package/dist/enums/o-auth-provider.js.map +1 -0
- package/dist/enums/o-auth-provider.mjs +46 -0
- package/dist/enums/o-auth-provider.mjs.map +1 -0
- package/dist/enums/password-hash.d.mts +15 -0
- package/dist/enums/password-hash.d.ts +15 -0
- package/dist/enums/password-hash.js +20 -0
- package/dist/enums/password-hash.js.map +1 -0
- package/dist/enums/password-hash.mjs +18 -0
- package/dist/enums/password-hash.mjs.map +1 -0
- package/dist/enums/relation-mutate.d.mts +7 -0
- package/dist/enums/relation-mutate.d.ts +7 -0
- package/dist/enums/relation-mutate.js +12 -0
- package/dist/enums/relation-mutate.js.map +1 -0
- package/dist/enums/relation-mutate.mjs +10 -0
- package/dist/enums/relation-mutate.mjs.map +1 -0
- package/dist/enums/relationship-type.d.mts +8 -0
- package/dist/enums/relationship-type.d.ts +8 -0
- package/dist/enums/relationship-type.js +13 -0
- package/dist/enums/relationship-type.js.map +1 -0
- package/dist/enums/relationship-type.mjs +11 -0
- package/dist/enums/relationship-type.mjs.map +1 -0
- package/dist/enums/runtime.d.mts +48 -0
- package/dist/enums/runtime.d.ts +48 -0
- package/dist/enums/runtime.js +53 -0
- package/dist/enums/runtime.js.map +1 -0
- package/dist/enums/runtime.mjs +51 -0
- package/dist/enums/runtime.mjs.map +1 -0
- package/dist/enums/smtp-encryption.d.mts +7 -0
- package/dist/enums/smtp-encryption.d.ts +7 -0
- package/dist/enums/smtp-encryption.js +12 -0
- package/dist/enums/smtp-encryption.js.map +1 -0
- package/dist/enums/smtp-encryption.mjs +10 -0
- package/dist/enums/smtp-encryption.mjs.map +1 -0
- package/dist/id.d.mts +7 -0
- package/dist/id.d.ts +7 -0
- package/dist/id.js +29 -0
- package/dist/id.js.map +1 -0
- package/dist/id.mjs +27 -0
- package/dist/id.mjs.map +1 -0
- package/dist/index.d.mts +35 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +180 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +35 -0
- package/dist/index.mjs.map +1 -0
- package/dist/inputFile.d.mts +9 -0
- package/dist/inputFile.d.ts +9 -0
- package/dist/inputFile.js +23 -0
- package/dist/inputFile.js.map +1 -0
- package/dist/inputFile.mjs +21 -0
- package/dist/inputFile.mjs.map +1 -0
- package/dist/models.d.mts +2406 -0
- package/dist/models.d.ts +2406 -0
- package/dist/models.js +4 -0
- package/dist/models.js.map +1 -0
- package/dist/models.mjs +3 -0
- package/dist/models.mjs.map +1 -0
- package/dist/permission.d.mts +9 -0
- package/dist/permission.d.ts +9 -0
- package/dist/permission.js +23 -0
- package/dist/permission.js.map +1 -0
- package/dist/permission.mjs +21 -0
- package/dist/permission.mjs.map +1 -0
- package/dist/query.d.mts +35 -0
- package/dist/query.d.ts +35 -0
- package/dist/query.js +49 -0
- package/dist/query.js.map +1 -0
- package/dist/query.mjs +47 -0
- package/dist/query.mjs.map +1 -0
- package/dist/role.d.mts +72 -0
- package/dist/role.d.ts +72 -0
- package/dist/role.js +96 -0
- package/dist/role.js.map +1 -0
- package/dist/role.mjs +94 -0
- package/dist/role.mjs.map +1 -0
- package/dist/services/account.d.mts +478 -0
- package/dist/services/account.d.ts +478 -0
- package/dist/services/account.js +1331 -0
- package/dist/services/account.js.map +1 -0
- package/dist/services/account.mjs +1329 -0
- package/dist/services/account.mjs.map +1 -0
- package/dist/services/avatars.d.mts +118 -0
- package/dist/services/avatars.d.ts +118 -0
- package/dist/services/avatars.js +297 -0
- package/dist/services/avatars.js.map +1 -0
- package/dist/services/avatars.mjs +295 -0
- package/dist/services/avatars.mjs.map +1 -0
- package/dist/services/databases.d.mts +606 -0
- package/dist/services/databases.d.ts +606 -0
- package/dist/services/databases.js +1908 -0
- package/dist/services/databases.js.map +1 -0
- package/dist/services/databases.mjs +1906 -0
- package/dist/services/databases.mjs.map +1 -0
- package/dist/services/functions.d.mts +287 -0
- package/dist/services/functions.d.ts +287 -0
- package/dist/services/functions.js +837 -0
- package/dist/services/functions.js.map +1 -0
- package/dist/services/functions.mjs +835 -0
- package/dist/services/functions.mjs.map +1 -0
- package/dist/services/graphql.d.mts +30 -0
- package/dist/services/graphql.d.ts +30 -0
- package/dist/services/graphql.js +73 -0
- package/dist/services/graphql.js.map +1 -0
- package/dist/services/graphql.mjs +71 -0
- package/dist/services/graphql.mjs.map +1 -0
- package/dist/services/health.d.mts +235 -0
- package/dist/services/health.d.ts +235 -0
- package/dist/services/health.js +584 -0
- package/dist/services/health.js.map +1 -0
- package/dist/services/health.mjs +582 -0
- package/dist/services/health.mjs.map +1 -0
- package/dist/services/locale.d.mts +84 -0
- package/dist/services/locale.d.ts +84 -0
- package/dist/services/locale.js +189 -0
- package/dist/services/locale.js.map +1 -0
- package/dist/services/locale.mjs +187 -0
- package/dist/services/locale.mjs.map +1 -0
- package/dist/services/messaging.d.mts +688 -0
- package/dist/services/messaging.d.ts +688 -0
- package/dist/services/messaging.js +2152 -0
- package/dist/services/messaging.js.map +1 -0
- package/dist/services/messaging.mjs +2150 -0
- package/dist/services/messaging.mjs.map +1 -0
- package/dist/services/storage.d.mts +193 -0
- package/dist/services/storage.d.ts +193 -0
- package/dist/services/storage.js +550 -0
- package/dist/services/storage.js.map +1 -0
- package/dist/services/storage.mjs +548 -0
- package/dist/services/storage.mjs.map +1 -0
- package/dist/services/teams.d.mts +171 -0
- package/dist/services/teams.d.ts +171 -0
- package/dist/services/teams.js +466 -0
- package/dist/services/teams.js.map +1 -0
- package/dist/services/teams.mjs +464 -0
- package/dist/services/teams.mjs.map +1 -0
- package/dist/services/users.d.mts +490 -0
- package/dist/services/users.d.ts +490 -0
- package/dist/services/users.js +1464 -0
- package/dist/services/users.js.map +1 -0
- package/dist/services/users.mjs +1462 -0
- package/dist/services/users.mjs.map +1 -0
- package/docs/examples/functions/create-deployment.md +1 -1
- package/docs/examples/messaging/create-msg91provider.md +1 -1
- package/docs/examples/messaging/update-msg91provider.md +2 -2
- package/docs/examples/storage/create-file.md +1 -1
- package/package.json +35 -5
- package/src/client.ts +366 -0
- package/src/enums/authentication-factor.ts +6 -0
- package/src/enums/authenticator-type.ts +3 -0
- package/src/enums/browser.ts +16 -0
- package/src/enums/compression.ts +5 -0
- package/src/enums/credit-card.ts +18 -0
- package/src/enums/execution-method.ts +8 -0
- package/src/enums/flag.ts +196 -0
- package/src/enums/image-format.ts +7 -0
- package/src/enums/image-gravity.ts +11 -0
- package/src/enums/index-type.ts +5 -0
- package/src/enums/messaging-provider-type.ts +5 -0
- package/src/enums/name.ts +15 -0
- package/src/enums/o-auth-provider.ts +41 -0
- package/src/enums/password-hash.ts +13 -0
- package/src/enums/relation-mutate.ts +5 -0
- package/src/enums/relationship-type.ts +6 -0
- package/src/enums/runtime.ts +46 -0
- package/src/enums/smtp-encryption.ts +5 -0
- package/{lib/id.js → src/id.ts} +8 -12
- package/src/index.ts +35 -0
- package/src/inputFile.ts +23 -0
- package/src/models.ts +2404 -0
- package/src/permission.ts +22 -0
- package/src/query.ts +101 -0
- package/{lib/role.js → src/role.ts} +23 -25
- package/src/services/account.ts +1418 -0
- package/src/services/avatars.ts +312 -0
- package/{lib/services/databases.js → src/services/databases.ts} +644 -638
- package/{lib/services/functions.js → src/services/functions.ts} +317 -369
- package/{lib/services/graphql.js → src/services/graphql.ts} +35 -34
- package/src/services/health.ts +629 -0
- package/src/services/locale.ts +205 -0
- package/{lib/services/messaging.js → src/services/messaging.ts} +666 -641
- package/{lib/services/storage.js → src/services/storage.ts} +211 -298
- package/{lib/services/teams.js → src/services/teams.ts} +211 -200
- package/{lib/services/users.js → src/services/users.ts} +603 -519
- package/tsconfig.json +18 -0
- package/tsup.config.js +19 -0
- package/index.d.ts +0 -6656
- package/index.js +0 -75
- package/lib/client.js +0 -245
- package/lib/enums/authentication-factor.js +0 -8
- package/lib/enums/authenticator-type.js +0 -5
- package/lib/enums/browser.js +0 -18
- package/lib/enums/compression.js +0 -7
- package/lib/enums/credit-card.js +0 -20
- package/lib/enums/execution-method.js +0 -10
- package/lib/enums/flag.js +0 -198
- package/lib/enums/image-format.js +0 -9
- package/lib/enums/image-gravity.js +0 -13
- package/lib/enums/index-type.js +0 -7
- package/lib/enums/messaging-provider-type.js +0 -7
- package/lib/enums/name.js +0 -17
- package/lib/enums/o-auth-provider.js +0 -43
- package/lib/enums/password-hash.js +0 -15
- package/lib/enums/relation-mutate.js +0 -7
- package/lib/enums/relationship-type.js +0 -8
- package/lib/enums/runtime.js +0 -48
- package/lib/enums/smtp-encryption.js +0 -7
- package/lib/exception.js +0 -10
- package/lib/inputFile.js +0 -117
- package/lib/permission.js +0 -24
- package/lib/query.js +0 -90
- package/lib/service.js +0 -10
- package/lib/services/account.js +0 -1365
- package/lib/services/avatars.js +0 -325
- package/lib/services/health.js +0 -513
- package/lib/services/locale.js +0 -169
package/lib/services/health.js
DELETED
|
@@ -1,513 +0,0 @@
|
|
|
1
|
-
const Service = require('../service.js');
|
|
2
|
-
const AppwriteException = require('../exception.js');
|
|
3
|
-
const InputFile = require('../inputFile.js');
|
|
4
|
-
const client = require('../client.js');
|
|
5
|
-
const Stream = require('stream');
|
|
6
|
-
const { promisify } = require('util');
|
|
7
|
-
const fs = require('fs');
|
|
8
|
-
const { File } = require('undici');
|
|
9
|
-
const Query = require('../query.js');
|
|
10
|
-
|
|
11
|
-
class Health extends Service {
|
|
12
|
-
|
|
13
|
-
constructor(client)
|
|
14
|
-
{
|
|
15
|
-
super(client);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Get HTTP
|
|
21
|
-
*
|
|
22
|
-
* Check the Appwrite HTTP server is up and responsive.
|
|
23
|
-
*
|
|
24
|
-
* @throws {AppwriteException}
|
|
25
|
-
* @returns {Promise}
|
|
26
|
-
*/
|
|
27
|
-
async get() {
|
|
28
|
-
const apiPath = '/health';
|
|
29
|
-
let payload = {};
|
|
30
|
-
|
|
31
|
-
return await this.client.call('get', apiPath, {
|
|
32
|
-
'content-type': 'application/json',
|
|
33
|
-
}, payload);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Get antivirus
|
|
38
|
-
*
|
|
39
|
-
* Check the Appwrite Antivirus server is up and connection is successful.
|
|
40
|
-
*
|
|
41
|
-
* @throws {AppwriteException}
|
|
42
|
-
* @returns {Promise}
|
|
43
|
-
*/
|
|
44
|
-
async getAntivirus() {
|
|
45
|
-
const apiPath = '/health/anti-virus';
|
|
46
|
-
let payload = {};
|
|
47
|
-
|
|
48
|
-
return await this.client.call('get', apiPath, {
|
|
49
|
-
'content-type': 'application/json',
|
|
50
|
-
}, payload);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Get cache
|
|
55
|
-
*
|
|
56
|
-
* Check the Appwrite in-memory cache servers are up and connection is
|
|
57
|
-
* successful.
|
|
58
|
-
*
|
|
59
|
-
* @throws {AppwriteException}
|
|
60
|
-
* @returns {Promise}
|
|
61
|
-
*/
|
|
62
|
-
async getCache() {
|
|
63
|
-
const apiPath = '/health/cache';
|
|
64
|
-
let payload = {};
|
|
65
|
-
|
|
66
|
-
return await this.client.call('get', apiPath, {
|
|
67
|
-
'content-type': 'application/json',
|
|
68
|
-
}, payload);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Get the SSL certificate for a domain
|
|
73
|
-
*
|
|
74
|
-
* Get the SSL certificate for a domain
|
|
75
|
-
*
|
|
76
|
-
* @param {string} domain
|
|
77
|
-
* @throws {AppwriteException}
|
|
78
|
-
* @returns {Promise}
|
|
79
|
-
*/
|
|
80
|
-
async getCertificate(domain) {
|
|
81
|
-
const apiPath = '/health/certificate';
|
|
82
|
-
let payload = {};
|
|
83
|
-
|
|
84
|
-
if (typeof domain !== 'undefined') {
|
|
85
|
-
payload['domain'] = domain;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return await this.client.call('get', apiPath, {
|
|
89
|
-
'content-type': 'application/json',
|
|
90
|
-
}, payload);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Get DB
|
|
95
|
-
*
|
|
96
|
-
* Check the Appwrite database servers are up and connection is successful.
|
|
97
|
-
*
|
|
98
|
-
* @throws {AppwriteException}
|
|
99
|
-
* @returns {Promise}
|
|
100
|
-
*/
|
|
101
|
-
async getDB() {
|
|
102
|
-
const apiPath = '/health/db';
|
|
103
|
-
let payload = {};
|
|
104
|
-
|
|
105
|
-
return await this.client.call('get', apiPath, {
|
|
106
|
-
'content-type': 'application/json',
|
|
107
|
-
}, payload);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Get pubsub
|
|
112
|
-
*
|
|
113
|
-
* Check the Appwrite pub-sub servers are up and connection is successful.
|
|
114
|
-
*
|
|
115
|
-
* @throws {AppwriteException}
|
|
116
|
-
* @returns {Promise}
|
|
117
|
-
*/
|
|
118
|
-
async getPubSub() {
|
|
119
|
-
const apiPath = '/health/pubsub';
|
|
120
|
-
let payload = {};
|
|
121
|
-
|
|
122
|
-
return await this.client.call('get', apiPath, {
|
|
123
|
-
'content-type': 'application/json',
|
|
124
|
-
}, payload);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Get queue
|
|
129
|
-
*
|
|
130
|
-
* Check the Appwrite queue messaging servers are up and connection is
|
|
131
|
-
* successful.
|
|
132
|
-
*
|
|
133
|
-
* @throws {AppwriteException}
|
|
134
|
-
* @returns {Promise}
|
|
135
|
-
*/
|
|
136
|
-
async getQueue() {
|
|
137
|
-
const apiPath = '/health/queue';
|
|
138
|
-
let payload = {};
|
|
139
|
-
|
|
140
|
-
return await this.client.call('get', apiPath, {
|
|
141
|
-
'content-type': 'application/json',
|
|
142
|
-
}, payload);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Get builds queue
|
|
147
|
-
*
|
|
148
|
-
* Get the number of builds that are waiting to be processed in the Appwrite
|
|
149
|
-
* internal queue server.
|
|
150
|
-
*
|
|
151
|
-
* @param {number} threshold
|
|
152
|
-
* @throws {AppwriteException}
|
|
153
|
-
* @returns {Promise}
|
|
154
|
-
*/
|
|
155
|
-
async getQueueBuilds(threshold) {
|
|
156
|
-
const apiPath = '/health/queue/builds';
|
|
157
|
-
let payload = {};
|
|
158
|
-
|
|
159
|
-
if (typeof threshold !== 'undefined') {
|
|
160
|
-
payload['threshold'] = threshold;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return await this.client.call('get', apiPath, {
|
|
164
|
-
'content-type': 'application/json',
|
|
165
|
-
}, payload);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Get certificates queue
|
|
170
|
-
*
|
|
171
|
-
* Get the number of certificates that are waiting to be issued against
|
|
172
|
-
* [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
|
|
173
|
-
* server.
|
|
174
|
-
*
|
|
175
|
-
* @param {number} threshold
|
|
176
|
-
* @throws {AppwriteException}
|
|
177
|
-
* @returns {Promise}
|
|
178
|
-
*/
|
|
179
|
-
async getQueueCertificates(threshold) {
|
|
180
|
-
const apiPath = '/health/queue/certificates';
|
|
181
|
-
let payload = {};
|
|
182
|
-
|
|
183
|
-
if (typeof threshold !== 'undefined') {
|
|
184
|
-
payload['threshold'] = threshold;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return await this.client.call('get', apiPath, {
|
|
188
|
-
'content-type': 'application/json',
|
|
189
|
-
}, payload);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Get databases queue
|
|
194
|
-
*
|
|
195
|
-
* Get the number of database changes that are waiting to be processed in the
|
|
196
|
-
* Appwrite internal queue server.
|
|
197
|
-
*
|
|
198
|
-
* @param {string} name
|
|
199
|
-
* @param {number} threshold
|
|
200
|
-
* @throws {AppwriteException}
|
|
201
|
-
* @returns {Promise}
|
|
202
|
-
*/
|
|
203
|
-
async getQueueDatabases(name, threshold) {
|
|
204
|
-
const apiPath = '/health/queue/databases';
|
|
205
|
-
let payload = {};
|
|
206
|
-
|
|
207
|
-
if (typeof name !== 'undefined') {
|
|
208
|
-
payload['name'] = name;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
if (typeof threshold !== 'undefined') {
|
|
212
|
-
payload['threshold'] = threshold;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
return await this.client.call('get', apiPath, {
|
|
216
|
-
'content-type': 'application/json',
|
|
217
|
-
}, payload);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Get deletes queue
|
|
222
|
-
*
|
|
223
|
-
* Get the number of background destructive changes that are waiting to be
|
|
224
|
-
* processed in the Appwrite internal queue server.
|
|
225
|
-
*
|
|
226
|
-
* @param {number} threshold
|
|
227
|
-
* @throws {AppwriteException}
|
|
228
|
-
* @returns {Promise}
|
|
229
|
-
*/
|
|
230
|
-
async getQueueDeletes(threshold) {
|
|
231
|
-
const apiPath = '/health/queue/deletes';
|
|
232
|
-
let payload = {};
|
|
233
|
-
|
|
234
|
-
if (typeof threshold !== 'undefined') {
|
|
235
|
-
payload['threshold'] = threshold;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
return await this.client.call('get', apiPath, {
|
|
239
|
-
'content-type': 'application/json',
|
|
240
|
-
}, payload);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Get number of failed queue jobs
|
|
245
|
-
*
|
|
246
|
-
* Returns the amount of failed jobs in a given queue.
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* @param {Name} name
|
|
250
|
-
* @param {number} threshold
|
|
251
|
-
* @throws {AppwriteException}
|
|
252
|
-
* @returns {Promise}
|
|
253
|
-
*/
|
|
254
|
-
async getFailedJobs(name, threshold) {
|
|
255
|
-
const apiPath = '/health/queue/failed/{name}'.replace('{name}', name);
|
|
256
|
-
let payload = {};
|
|
257
|
-
if (typeof name === 'undefined') {
|
|
258
|
-
throw new AppwriteException('Missing required parameter: "name"');
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
if (typeof threshold !== 'undefined') {
|
|
263
|
-
payload['threshold'] = threshold;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
return await this.client.call('get', apiPath, {
|
|
267
|
-
'content-type': 'application/json',
|
|
268
|
-
}, payload);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Get functions queue
|
|
273
|
-
*
|
|
274
|
-
* Get the number of function executions that are waiting to be processed in
|
|
275
|
-
* the Appwrite internal queue server.
|
|
276
|
-
*
|
|
277
|
-
* @param {number} threshold
|
|
278
|
-
* @throws {AppwriteException}
|
|
279
|
-
* @returns {Promise}
|
|
280
|
-
*/
|
|
281
|
-
async getQueueFunctions(threshold) {
|
|
282
|
-
const apiPath = '/health/queue/functions';
|
|
283
|
-
let payload = {};
|
|
284
|
-
|
|
285
|
-
if (typeof threshold !== 'undefined') {
|
|
286
|
-
payload['threshold'] = threshold;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
return await this.client.call('get', apiPath, {
|
|
290
|
-
'content-type': 'application/json',
|
|
291
|
-
}, payload);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Get logs queue
|
|
296
|
-
*
|
|
297
|
-
* Get the number of logs that are waiting to be processed in the Appwrite
|
|
298
|
-
* internal queue server.
|
|
299
|
-
*
|
|
300
|
-
* @param {number} threshold
|
|
301
|
-
* @throws {AppwriteException}
|
|
302
|
-
* @returns {Promise}
|
|
303
|
-
*/
|
|
304
|
-
async getQueueLogs(threshold) {
|
|
305
|
-
const apiPath = '/health/queue/logs';
|
|
306
|
-
let payload = {};
|
|
307
|
-
|
|
308
|
-
if (typeof threshold !== 'undefined') {
|
|
309
|
-
payload['threshold'] = threshold;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
return await this.client.call('get', apiPath, {
|
|
313
|
-
'content-type': 'application/json',
|
|
314
|
-
}, payload);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Get mails queue
|
|
319
|
-
*
|
|
320
|
-
* Get the number of mails that are waiting to be processed in the Appwrite
|
|
321
|
-
* internal queue server.
|
|
322
|
-
*
|
|
323
|
-
* @param {number} threshold
|
|
324
|
-
* @throws {AppwriteException}
|
|
325
|
-
* @returns {Promise}
|
|
326
|
-
*/
|
|
327
|
-
async getQueueMails(threshold) {
|
|
328
|
-
const apiPath = '/health/queue/mails';
|
|
329
|
-
let payload = {};
|
|
330
|
-
|
|
331
|
-
if (typeof threshold !== 'undefined') {
|
|
332
|
-
payload['threshold'] = threshold;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
return await this.client.call('get', apiPath, {
|
|
336
|
-
'content-type': 'application/json',
|
|
337
|
-
}, payload);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Get messaging queue
|
|
342
|
-
*
|
|
343
|
-
* Get the number of messages that are waiting to be processed in the Appwrite
|
|
344
|
-
* internal queue server.
|
|
345
|
-
*
|
|
346
|
-
* @param {number} threshold
|
|
347
|
-
* @throws {AppwriteException}
|
|
348
|
-
* @returns {Promise}
|
|
349
|
-
*/
|
|
350
|
-
async getQueueMessaging(threshold) {
|
|
351
|
-
const apiPath = '/health/queue/messaging';
|
|
352
|
-
let payload = {};
|
|
353
|
-
|
|
354
|
-
if (typeof threshold !== 'undefined') {
|
|
355
|
-
payload['threshold'] = threshold;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
return await this.client.call('get', apiPath, {
|
|
359
|
-
'content-type': 'application/json',
|
|
360
|
-
}, payload);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Get migrations queue
|
|
365
|
-
*
|
|
366
|
-
* Get the number of migrations that are waiting to be processed in the
|
|
367
|
-
* Appwrite internal queue server.
|
|
368
|
-
*
|
|
369
|
-
* @param {number} threshold
|
|
370
|
-
* @throws {AppwriteException}
|
|
371
|
-
* @returns {Promise}
|
|
372
|
-
*/
|
|
373
|
-
async getQueueMigrations(threshold) {
|
|
374
|
-
const apiPath = '/health/queue/migrations';
|
|
375
|
-
let payload = {};
|
|
376
|
-
|
|
377
|
-
if (typeof threshold !== 'undefined') {
|
|
378
|
-
payload['threshold'] = threshold;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
return await this.client.call('get', apiPath, {
|
|
382
|
-
'content-type': 'application/json',
|
|
383
|
-
}, payload);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Get usage queue
|
|
388
|
-
*
|
|
389
|
-
* Get the number of metrics that are waiting to be processed in the Appwrite
|
|
390
|
-
* internal queue server.
|
|
391
|
-
*
|
|
392
|
-
* @param {number} threshold
|
|
393
|
-
* @throws {AppwriteException}
|
|
394
|
-
* @returns {Promise}
|
|
395
|
-
*/
|
|
396
|
-
async getQueueUsage(threshold) {
|
|
397
|
-
const apiPath = '/health/queue/usage';
|
|
398
|
-
let payload = {};
|
|
399
|
-
|
|
400
|
-
if (typeof threshold !== 'undefined') {
|
|
401
|
-
payload['threshold'] = threshold;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
return await this.client.call('get', apiPath, {
|
|
405
|
-
'content-type': 'application/json',
|
|
406
|
-
}, payload);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* Get usage dump queue
|
|
411
|
-
*
|
|
412
|
-
* Get the number of projects containing metrics that are waiting to be
|
|
413
|
-
* processed in the Appwrite internal queue server.
|
|
414
|
-
*
|
|
415
|
-
* @param {number} threshold
|
|
416
|
-
* @throws {AppwriteException}
|
|
417
|
-
* @returns {Promise}
|
|
418
|
-
*/
|
|
419
|
-
async getQueueUsageDump(threshold) {
|
|
420
|
-
const apiPath = '/health/queue/usage-dump';
|
|
421
|
-
let payload = {};
|
|
422
|
-
|
|
423
|
-
if (typeof threshold !== 'undefined') {
|
|
424
|
-
payload['threshold'] = threshold;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
return await this.client.call('get', apiPath, {
|
|
428
|
-
'content-type': 'application/json',
|
|
429
|
-
}, payload);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
/**
|
|
433
|
-
* Get webhooks queue
|
|
434
|
-
*
|
|
435
|
-
* Get the number of webhooks that are waiting to be processed in the Appwrite
|
|
436
|
-
* internal queue server.
|
|
437
|
-
*
|
|
438
|
-
* @param {number} threshold
|
|
439
|
-
* @throws {AppwriteException}
|
|
440
|
-
* @returns {Promise}
|
|
441
|
-
*/
|
|
442
|
-
async getQueueWebhooks(threshold) {
|
|
443
|
-
const apiPath = '/health/queue/webhooks';
|
|
444
|
-
let payload = {};
|
|
445
|
-
|
|
446
|
-
if (typeof threshold !== 'undefined') {
|
|
447
|
-
payload['threshold'] = threshold;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
return await this.client.call('get', apiPath, {
|
|
451
|
-
'content-type': 'application/json',
|
|
452
|
-
}, payload);
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* Get storage
|
|
457
|
-
*
|
|
458
|
-
* Check the Appwrite storage device is up and connection is successful.
|
|
459
|
-
*
|
|
460
|
-
* @throws {AppwriteException}
|
|
461
|
-
* @returns {Promise}
|
|
462
|
-
*/
|
|
463
|
-
async getStorage() {
|
|
464
|
-
const apiPath = '/health/storage';
|
|
465
|
-
let payload = {};
|
|
466
|
-
|
|
467
|
-
return await this.client.call('get', apiPath, {
|
|
468
|
-
'content-type': 'application/json',
|
|
469
|
-
}, payload);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Get local storage
|
|
474
|
-
*
|
|
475
|
-
* Check the Appwrite local storage device is up and connection is successful.
|
|
476
|
-
*
|
|
477
|
-
* @throws {AppwriteException}
|
|
478
|
-
* @returns {Promise}
|
|
479
|
-
*/
|
|
480
|
-
async getStorageLocal() {
|
|
481
|
-
const apiPath = '/health/storage/local';
|
|
482
|
-
let payload = {};
|
|
483
|
-
|
|
484
|
-
return await this.client.call('get', apiPath, {
|
|
485
|
-
'content-type': 'application/json',
|
|
486
|
-
}, payload);
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* Get time
|
|
491
|
-
*
|
|
492
|
-
* Check the Appwrite server time is synced with Google remote NTP server. We
|
|
493
|
-
* use this technology to smoothly handle leap seconds with no disruptive
|
|
494
|
-
* events. The [Network Time
|
|
495
|
-
* Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is
|
|
496
|
-
* used by hundreds of millions of computers and devices to synchronize their
|
|
497
|
-
* clocks over the Internet. If your computer sets its own clock, it likely
|
|
498
|
-
* uses NTP.
|
|
499
|
-
*
|
|
500
|
-
* @throws {AppwriteException}
|
|
501
|
-
* @returns {Promise}
|
|
502
|
-
*/
|
|
503
|
-
async getTime() {
|
|
504
|
-
const apiPath = '/health/time';
|
|
505
|
-
let payload = {};
|
|
506
|
-
|
|
507
|
-
return await this.client.call('get', apiPath, {
|
|
508
|
-
'content-type': 'application/json',
|
|
509
|
-
}, payload);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
module.exports = Health;
|
package/lib/services/locale.js
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
const Service = require('../service.js');
|
|
2
|
-
const AppwriteException = require('../exception.js');
|
|
3
|
-
const InputFile = require('../inputFile.js');
|
|
4
|
-
const client = require('../client.js');
|
|
5
|
-
const Stream = require('stream');
|
|
6
|
-
const { promisify } = require('util');
|
|
7
|
-
const fs = require('fs');
|
|
8
|
-
const { File } = require('undici');
|
|
9
|
-
const Query = require('../query.js');
|
|
10
|
-
|
|
11
|
-
class Locale extends Service {
|
|
12
|
-
|
|
13
|
-
constructor(client)
|
|
14
|
-
{
|
|
15
|
-
super(client);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Get user locale
|
|
21
|
-
*
|
|
22
|
-
* Get the current user location based on IP. Returns an object with user
|
|
23
|
-
* country code, country name, continent name, continent code, ip address and
|
|
24
|
-
* suggested currency. You can use the locale header to get the data in a
|
|
25
|
-
* supported language.
|
|
26
|
-
*
|
|
27
|
-
* ([IP Geolocation by DB-IP](https://db-ip.com))
|
|
28
|
-
*
|
|
29
|
-
* @throws {AppwriteException}
|
|
30
|
-
* @returns {Promise}
|
|
31
|
-
*/
|
|
32
|
-
async get() {
|
|
33
|
-
const apiPath = '/locale';
|
|
34
|
-
let payload = {};
|
|
35
|
-
|
|
36
|
-
return await this.client.call('get', apiPath, {
|
|
37
|
-
'content-type': 'application/json',
|
|
38
|
-
}, payload);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* List Locale Codes
|
|
43
|
-
*
|
|
44
|
-
* List of all locale codes in [ISO
|
|
45
|
-
* 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
46
|
-
*
|
|
47
|
-
* @throws {AppwriteException}
|
|
48
|
-
* @returns {Promise}
|
|
49
|
-
*/
|
|
50
|
-
async listCodes() {
|
|
51
|
-
const apiPath = '/locale/codes';
|
|
52
|
-
let payload = {};
|
|
53
|
-
|
|
54
|
-
return await this.client.call('get', apiPath, {
|
|
55
|
-
'content-type': 'application/json',
|
|
56
|
-
}, payload);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* List continents
|
|
61
|
-
*
|
|
62
|
-
* List of all continents. You can use the locale header to get the data in a
|
|
63
|
-
* supported language.
|
|
64
|
-
*
|
|
65
|
-
* @throws {AppwriteException}
|
|
66
|
-
* @returns {Promise}
|
|
67
|
-
*/
|
|
68
|
-
async listContinents() {
|
|
69
|
-
const apiPath = '/locale/continents';
|
|
70
|
-
let payload = {};
|
|
71
|
-
|
|
72
|
-
return await this.client.call('get', apiPath, {
|
|
73
|
-
'content-type': 'application/json',
|
|
74
|
-
}, payload);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* List countries
|
|
79
|
-
*
|
|
80
|
-
* List of all countries. You can use the locale header to get the data in a
|
|
81
|
-
* supported language.
|
|
82
|
-
*
|
|
83
|
-
* @throws {AppwriteException}
|
|
84
|
-
* @returns {Promise}
|
|
85
|
-
*/
|
|
86
|
-
async listCountries() {
|
|
87
|
-
const apiPath = '/locale/countries';
|
|
88
|
-
let payload = {};
|
|
89
|
-
|
|
90
|
-
return await this.client.call('get', apiPath, {
|
|
91
|
-
'content-type': 'application/json',
|
|
92
|
-
}, payload);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* List EU countries
|
|
97
|
-
*
|
|
98
|
-
* List of all countries that are currently members of the EU. You can use the
|
|
99
|
-
* locale header to get the data in a supported language.
|
|
100
|
-
*
|
|
101
|
-
* @throws {AppwriteException}
|
|
102
|
-
* @returns {Promise}
|
|
103
|
-
*/
|
|
104
|
-
async listCountriesEU() {
|
|
105
|
-
const apiPath = '/locale/countries/eu';
|
|
106
|
-
let payload = {};
|
|
107
|
-
|
|
108
|
-
return await this.client.call('get', apiPath, {
|
|
109
|
-
'content-type': 'application/json',
|
|
110
|
-
}, payload);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* List countries phone codes
|
|
115
|
-
*
|
|
116
|
-
* List of all countries phone codes. You can use the locale header to get the
|
|
117
|
-
* data in a supported language.
|
|
118
|
-
*
|
|
119
|
-
* @throws {AppwriteException}
|
|
120
|
-
* @returns {Promise}
|
|
121
|
-
*/
|
|
122
|
-
async listCountriesPhones() {
|
|
123
|
-
const apiPath = '/locale/countries/phones';
|
|
124
|
-
let payload = {};
|
|
125
|
-
|
|
126
|
-
return await this.client.call('get', apiPath, {
|
|
127
|
-
'content-type': 'application/json',
|
|
128
|
-
}, payload);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* List currencies
|
|
133
|
-
*
|
|
134
|
-
* List of all currencies, including currency symbol, name, plural, and
|
|
135
|
-
* decimal digits for all major and minor currencies. You can use the locale
|
|
136
|
-
* header to get the data in a supported language.
|
|
137
|
-
*
|
|
138
|
-
* @throws {AppwriteException}
|
|
139
|
-
* @returns {Promise}
|
|
140
|
-
*/
|
|
141
|
-
async listCurrencies() {
|
|
142
|
-
const apiPath = '/locale/currencies';
|
|
143
|
-
let payload = {};
|
|
144
|
-
|
|
145
|
-
return await this.client.call('get', apiPath, {
|
|
146
|
-
'content-type': 'application/json',
|
|
147
|
-
}, payload);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* List languages
|
|
152
|
-
*
|
|
153
|
-
* List of all languages classified by ISO 639-1 including 2-letter code, name
|
|
154
|
-
* in English, and name in the respective language.
|
|
155
|
-
*
|
|
156
|
-
* @throws {AppwriteException}
|
|
157
|
-
* @returns {Promise}
|
|
158
|
-
*/
|
|
159
|
-
async listLanguages() {
|
|
160
|
-
const apiPath = '/locale/languages';
|
|
161
|
-
let payload = {};
|
|
162
|
-
|
|
163
|
-
return await this.client.call('get', apiPath, {
|
|
164
|
-
'content-type': 'application/json',
|
|
165
|
-
}, payload);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
module.exports = Locale;
|