node-appwrite 11.0.0 → 12.0.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/LICENSE +1 -1
- package/README.md +2 -2
- package/docs/examples/account/add-authenticator.md +12 -0
- package/docs/examples/account/create-anonymous-session.md +9 -0
- package/docs/examples/account/create-email-password-session.md +12 -0
- package/docs/examples/account/create-email-token.md +13 -0
- package/docs/examples/account/create-j-w-t.md +9 -0
- package/docs/examples/account/create-magic-u-r-l-token.md +14 -0
- package/docs/examples/account/create-o-auth2session.md +15 -0
- package/docs/examples/account/create-phone-token.md +12 -0
- package/docs/examples/account/create-phone-verification.md +4 -14
- package/docs/examples/account/create-recovery.md +7 -14
- package/docs/examples/account/create-session.md +12 -0
- package/docs/examples/account/create-verification.md +6 -14
- package/docs/examples/account/create.md +14 -0
- package/docs/examples/account/create2f-a-challenge.md +11 -0
- package/docs/examples/account/delete-authenticator.md +13 -0
- package/docs/examples/account/delete-identity.md +6 -14
- package/docs/examples/account/delete-session.md +6 -14
- package/docs/examples/account/delete-sessions.md +4 -14
- package/docs/examples/account/get-prefs.md +4 -14
- package/docs/examples/account/get-session.md +6 -14
- package/docs/examples/account/get.md +4 -14
- package/docs/examples/account/list-factors.md +10 -0
- package/docs/examples/account/list-identities.md +6 -14
- package/docs/examples/account/list-logs.md +6 -14
- package/docs/examples/account/list-sessions.md +4 -14
- package/docs/examples/account/update-challenge.md +13 -0
- package/docs/examples/account/update-email.md +7 -14
- package/docs/examples/account/update-m-f-a.md +12 -0
- package/docs/examples/account/update-magic-u-r-l-session.md +12 -0
- package/docs/examples/account/update-name.md +6 -14
- package/docs/examples/account/update-password.md +7 -14
- package/docs/examples/account/update-phone-verification.md +7 -14
- package/docs/examples/account/update-phone.md +7 -14
- package/docs/examples/account/update-prefs.md +6 -14
- package/docs/examples/account/update-recovery.md +8 -14
- package/docs/examples/account/update-session.md +6 -14
- package/docs/examples/account/update-status.md +4 -14
- package/docs/examples/account/update-verification.md +7 -14
- package/docs/examples/account/verify-authenticator.md +13 -0
- package/docs/examples/avatars/get-browser.md +9 -14
- package/docs/examples/avatars/get-credit-card.md +9 -14
- package/docs/examples/avatars/get-favicon.md +6 -14
- package/docs/examples/avatars/get-flag.md +9 -14
- package/docs/examples/avatars/get-image.md +8 -14
- package/docs/examples/avatars/get-initials.md +9 -14
- package/docs/examples/avatars/get-q-r.md +9 -14
- package/docs/examples/databases/create-boolean-attribute.md +11 -14
- package/docs/examples/databases/create-collection.md +11 -14
- package/docs/examples/databases/create-datetime-attribute.md +11 -14
- package/docs/examples/databases/create-document.md +10 -14
- package/docs/examples/databases/create-email-attribute.md +11 -14
- package/docs/examples/databases/create-enum-attribute.md +12 -14
- package/docs/examples/databases/create-float-attribute.md +13 -14
- package/docs/examples/databases/create-index.md +11 -14
- package/docs/examples/databases/create-integer-attribute.md +13 -14
- package/docs/examples/databases/create-ip-attribute.md +11 -14
- package/docs/examples/databases/create-relationship-attribute.md +13 -14
- package/docs/examples/databases/create-string-attribute.md +13 -14
- package/docs/examples/databases/create-url-attribute.md +11 -14
- package/docs/examples/databases/create.md +8 -14
- package/docs/examples/databases/delete-attribute.md +8 -14
- package/docs/examples/databases/delete-collection.md +7 -14
- package/docs/examples/databases/delete-document.md +8 -14
- package/docs/examples/databases/delete-index.md +8 -14
- package/docs/examples/databases/delete.md +6 -14
- package/docs/examples/databases/get-attribute.md +8 -14
- package/docs/examples/databases/get-collection.md +7 -14
- package/docs/examples/databases/get-document.md +9 -14
- package/docs/examples/databases/get-index.md +8 -14
- package/docs/examples/databases/get.md +6 -14
- package/docs/examples/databases/list-attributes.md +8 -14
- package/docs/examples/databases/list-collections.md +8 -14
- package/docs/examples/databases/list-documents.md +8 -14
- package/docs/examples/databases/list-indexes.md +8 -14
- package/docs/examples/databases/list.md +7 -14
- package/docs/examples/databases/update-boolean-attribute.md +10 -14
- package/docs/examples/databases/update-collection.md +11 -14
- package/docs/examples/databases/update-datetime-attribute.md +10 -14
- package/docs/examples/databases/update-document.md +10 -14
- package/docs/examples/databases/update-email-attribute.md +10 -14
- package/docs/examples/databases/update-enum-attribute.md +11 -14
- package/docs/examples/databases/update-float-attribute.md +12 -14
- package/docs/examples/databases/update-integer-attribute.md +12 -14
- package/docs/examples/databases/update-ip-attribute.md +10 -14
- package/docs/examples/databases/update-relationship-attribute.md +9 -14
- package/docs/examples/databases/update-string-attribute.md +10 -14
- package/docs/examples/databases/update-url-attribute.md +10 -14
- package/docs/examples/databases/update.md +8 -14
- package/docs/examples/functions/create-build.md +8 -14
- package/docs/examples/functions/create-deployment.md +10 -14
- package/docs/examples/functions/create-execution.md +11 -14
- package/docs/examples/functions/create-variable.md +8 -14
- package/docs/examples/functions/create.md +25 -14
- package/docs/examples/functions/delete-deployment.md +7 -14
- package/docs/examples/functions/delete-variable.md +7 -14
- package/docs/examples/functions/delete.md +6 -14
- package/docs/examples/functions/download-deployment.md +7 -14
- package/docs/examples/functions/get-deployment.md +7 -14
- package/docs/examples/functions/get-execution.md +7 -14
- package/docs/examples/functions/get-variable.md +7 -14
- package/docs/examples/functions/get.md +6 -14
- package/docs/examples/functions/list-deployments.md +8 -14
- package/docs/examples/functions/list-executions.md +8 -14
- package/docs/examples/functions/list-runtimes.md +4 -14
- package/docs/examples/functions/list-variables.md +6 -14
- package/docs/examples/functions/list.md +7 -14
- package/docs/examples/functions/update-deployment.md +7 -14
- package/docs/examples/functions/update-variable.md +9 -14
- package/docs/examples/functions/update.md +21 -14
- package/docs/examples/graphql/mutation.md +6 -14
- package/docs/examples/graphql/query.md +6 -14
- package/docs/examples/health/get-antivirus.md +4 -14
- package/docs/examples/health/get-cache.md +4 -14
- package/docs/examples/health/get-certificate.md +12 -0
- package/docs/examples/health/get-d-b.md +4 -14
- package/docs/examples/health/get-failed-jobs.md +13 -0
- package/docs/examples/health/get-pub-sub.md +4 -14
- package/docs/examples/health/get-queue-builds.md +12 -0
- package/docs/examples/health/get-queue-certificates.md +6 -14
- package/docs/examples/health/get-queue-databases.md +13 -0
- package/docs/examples/health/get-queue-deletes.md +12 -0
- package/docs/examples/health/get-queue-functions.md +6 -14
- package/docs/examples/health/get-queue-logs.md +6 -14
- package/docs/examples/health/get-queue-mails.md +12 -0
- package/docs/examples/health/get-queue-messaging.md +12 -0
- package/docs/examples/health/get-queue-migrations.md +12 -0
- package/docs/examples/health/get-queue-webhooks.md +6 -14
- package/docs/examples/health/get-queue.md +4 -14
- package/docs/examples/health/get-storage-local.md +4 -14
- package/docs/examples/health/get-time.md +4 -14
- package/docs/examples/health/get.md +4 -14
- package/docs/examples/locale/get.md +4 -14
- package/docs/examples/locale/list-codes.md +4 -14
- package/docs/examples/locale/list-continents.md +4 -14
- package/docs/examples/locale/list-countries-e-u.md +4 -14
- package/docs/examples/locale/list-countries-phones.md +4 -14
- package/docs/examples/locale/list-countries.md +4 -14
- package/docs/examples/locale/list-currencies.md +4 -14
- package/docs/examples/locale/list-languages.md +4 -14
- package/docs/examples/messaging/create-apns-provider.md +18 -0
- package/docs/examples/messaging/create-email.md +23 -0
- package/docs/examples/messaging/create-fcm-provider.md +15 -0
- package/docs/examples/messaging/create-mailgun-provider.md +21 -0
- package/docs/examples/messaging/create-msg91provider.md +17 -0
- package/docs/examples/messaging/create-push.md +27 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +19 -0
- package/docs/examples/messaging/create-sms.md +18 -0
- package/docs/examples/messaging/create-smtp-provider.md +25 -0
- package/docs/examples/messaging/create-subscriber.md +14 -0
- package/docs/examples/messaging/create-telesign-provider.md +17 -0
- package/docs/examples/messaging/create-textmagic-provider.md +17 -0
- package/docs/examples/messaging/create-topic.md +14 -0
- package/docs/examples/messaging/create-twilio-provider.md +17 -0
- package/docs/examples/messaging/create-vonage-provider.md +17 -0
- package/docs/examples/messaging/delete-provider.md +12 -0
- package/docs/examples/messaging/delete-subscriber.md +13 -0
- package/docs/examples/messaging/delete-topic.md +12 -0
- package/docs/examples/messaging/delete.md +12 -0
- package/docs/examples/messaging/get-message.md +12 -0
- package/docs/examples/messaging/get-provider.md +12 -0
- package/docs/examples/messaging/get-subscriber.md +13 -0
- package/docs/examples/messaging/get-topic.md +12 -0
- package/docs/examples/messaging/list-message-logs.md +13 -0
- package/docs/examples/messaging/list-messages.md +13 -0
- package/docs/examples/messaging/list-provider-logs.md +13 -0
- package/docs/examples/messaging/list-providers.md +13 -0
- package/docs/examples/messaging/list-subscriber-logs.md +13 -0
- package/docs/examples/messaging/list-subscribers.md +14 -0
- package/docs/examples/messaging/list-targets.md +13 -0
- package/docs/examples/messaging/list-topic-logs.md +13 -0
- package/docs/examples/messaging/list-topics.md +13 -0
- package/docs/examples/messaging/update-a-p-n-s-provider.md +18 -0
- package/docs/examples/messaging/update-email.md +22 -0
- package/docs/examples/messaging/update-f-c-m-provider.md +15 -0
- package/docs/examples/messaging/update-mailgun-provider.md +21 -0
- package/docs/examples/messaging/update-msg91provider.md +17 -0
- package/docs/examples/messaging/update-push.md +27 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +19 -0
- package/docs/examples/messaging/update-sms.md +18 -0
- package/docs/examples/messaging/update-smtp-provider.md +25 -0
- package/docs/examples/messaging/update-telesign-provider.md +17 -0
- package/docs/examples/messaging/update-textmagic-provider.md +17 -0
- package/docs/examples/messaging/update-topic.md +13 -0
- package/docs/examples/messaging/update-twilio-provider.md +17 -0
- package/docs/examples/messaging/update-vonage-provider.md +17 -0
- package/docs/examples/storage/create-bucket.md +15 -14
- package/docs/examples/storage/create-file.md +9 -14
- package/docs/examples/storage/delete-bucket.md +6 -14
- package/docs/examples/storage/delete-file.md +7 -14
- package/docs/examples/storage/get-bucket.md +6 -14
- package/docs/examples/storage/get-file-download.md +7 -14
- package/docs/examples/storage/get-file-preview.md +18 -14
- package/docs/examples/storage/get-file-view.md +7 -14
- package/docs/examples/storage/get-file.md +7 -14
- package/docs/examples/storage/list-buckets.md +7 -14
- package/docs/examples/storage/list-files.md +8 -14
- package/docs/examples/storage/update-bucket.md +15 -14
- package/docs/examples/storage/update-file.md +9 -14
- package/docs/examples/teams/create-membership.md +12 -14
- package/docs/examples/teams/create.md +8 -14
- package/docs/examples/teams/delete-membership.md +7 -14
- package/docs/examples/teams/delete.md +6 -14
- package/docs/examples/teams/get-membership.md +7 -14
- package/docs/examples/teams/get-prefs.md +6 -14
- package/docs/examples/teams/get.md +6 -14
- package/docs/examples/teams/list-memberships.md +8 -14
- package/docs/examples/teams/list.md +7 -14
- package/docs/examples/teams/update-membership-status.md +9 -14
- package/docs/examples/teams/update-membership.md +8 -14
- package/docs/examples/teams/update-name.md +7 -14
- package/docs/examples/teams/update-prefs.md +7 -14
- package/docs/examples/users/create-argon2user.md +9 -14
- package/docs/examples/users/create-bcrypt-user.md +9 -14
- package/docs/examples/users/create-m-d5user.md +9 -14
- package/docs/examples/users/create-p-h-pass-user.md +9 -14
- package/docs/examples/users/create-s-h-a-user.md +10 -14
- package/docs/examples/users/create-scrypt-modified-user.md +12 -14
- package/docs/examples/users/create-scrypt-user.md +14 -14
- package/docs/examples/users/create-session.md +12 -0
- package/docs/examples/users/create-target.md +17 -0
- package/docs/examples/users/create-token.md +14 -0
- package/docs/examples/users/create.md +10 -14
- package/docs/examples/users/delete-authenticator.md +14 -0
- package/docs/examples/users/delete-identity.md +6 -14
- package/docs/examples/users/delete-session.md +7 -14
- package/docs/examples/users/delete-sessions.md +6 -14
- package/docs/examples/users/delete-target.md +13 -0
- package/docs/examples/users/delete.md +6 -14
- package/docs/examples/users/get-prefs.md +6 -14
- package/docs/examples/users/get-target.md +13 -0
- package/docs/examples/users/get.md +6 -14
- package/docs/examples/users/list-factors.md +12 -0
- package/docs/examples/users/list-identities.md +7 -14
- package/docs/examples/users/list-logs.md +7 -14
- package/docs/examples/users/list-memberships.md +6 -14
- package/docs/examples/users/list-sessions.md +6 -14
- package/docs/examples/users/list-targets.md +13 -0
- package/docs/examples/users/list.md +7 -14
- package/docs/examples/users/update-email-verification.md +7 -14
- package/docs/examples/users/update-email.md +7 -14
- package/docs/examples/users/update-labels.md +7 -14
- package/docs/examples/users/update-mfa.md +13 -0
- package/docs/examples/users/update-name.md +7 -14
- package/docs/examples/users/update-password.md +7 -14
- package/docs/examples/users/update-phone-verification.md +7 -14
- package/docs/examples/users/update-phone.md +7 -14
- package/docs/examples/users/update-prefs.md +7 -14
- package/docs/examples/users/update-status.md +7 -14
- package/docs/examples/users/update-target.md +16 -0
- package/index.d.ts +2280 -309
- package/index.js +40 -0
- package/lib/client.js +122 -65
- package/lib/enums/authentication-factor.js +7 -0
- package/lib/enums/authenticator-type.js +5 -0
- package/lib/enums/browser.js +18 -0
- package/lib/enums/compression.js +7 -0
- package/lib/enums/credit-card.js +20 -0
- package/lib/enums/encryption.js +7 -0
- package/lib/enums/execution-method.js +10 -0
- package/lib/enums/flag.js +198 -0
- package/lib/enums/image-format.js +9 -0
- package/lib/enums/image-gravity.js +13 -0
- package/lib/enums/index-type.js +8 -0
- package/lib/enums/message-status.js +7 -0
- package/lib/enums/messaging-provider-type.js +7 -0
- package/lib/enums/name.js +16 -0
- package/lib/enums/o-auth-provider.js +43 -0
- package/lib/enums/password-hash.js +15 -0
- package/lib/enums/relation-mutate.js +7 -0
- package/lib/enums/relationship-type.js +8 -0
- package/lib/enums/runtime.js +40 -0
- package/lib/inputFile.js +88 -16
- package/lib/query.js +56 -38
- package/lib/services/account.js +639 -46
- package/lib/services/avatars.js +16 -13
- package/lib/services/databases.js +54 -52
- package/lib/services/functions.js +77 -109
- package/lib/services/graphql.js +4 -2
- package/lib/services/health.js +229 -14
- package/lib/services/locale.js +9 -7
- package/lib/services/messaging.js +2198 -0
- package/lib/services/storage.js +64 -100
- package/lib/services/teams.js +19 -17
- package/lib/services/users.js +367 -45
- package/package.json +2 -3
package/lib/services/health.js
CHANGED
|
@@ -5,6 +5,8 @@ const client = require('../client.js');
|
|
|
5
5
|
const Stream = require('stream');
|
|
6
6
|
const { promisify } = require('util');
|
|
7
7
|
const fs = require('fs');
|
|
8
|
+
const { File } = require('undici');
|
|
9
|
+
const Query = require('../query.js');
|
|
8
10
|
|
|
9
11
|
class Health extends Service {
|
|
10
12
|
|
|
@@ -32,7 +34,7 @@ class Health extends Service {
|
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
|
-
* Get
|
|
37
|
+
* Get antivirus
|
|
36
38
|
*
|
|
37
39
|
* Check the Appwrite Antivirus server is up and connection is successful.
|
|
38
40
|
*
|
|
@@ -49,7 +51,7 @@ class Health extends Service {
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
/**
|
|
52
|
-
* Get
|
|
54
|
+
* Get cache
|
|
53
55
|
*
|
|
54
56
|
* Check the Appwrite in-memory cache servers are up and connection is
|
|
55
57
|
* successful.
|
|
@@ -66,6 +68,28 @@ class Health extends Service {
|
|
|
66
68
|
}, payload);
|
|
67
69
|
}
|
|
68
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
|
+
|
|
69
93
|
/**
|
|
70
94
|
* Get DB
|
|
71
95
|
*
|
|
@@ -84,7 +108,7 @@ class Health extends Service {
|
|
|
84
108
|
}
|
|
85
109
|
|
|
86
110
|
/**
|
|
87
|
-
* Get
|
|
111
|
+
* Get pubsub
|
|
88
112
|
*
|
|
89
113
|
* Check the Appwrite pub-sub servers are up and connection is successful.
|
|
90
114
|
*
|
|
@@ -101,7 +125,7 @@ class Health extends Service {
|
|
|
101
125
|
}
|
|
102
126
|
|
|
103
127
|
/**
|
|
104
|
-
* Get
|
|
128
|
+
* Get queue
|
|
105
129
|
*
|
|
106
130
|
* Check the Appwrite queue messaging servers are up and connection is
|
|
107
131
|
* successful.
|
|
@@ -119,77 +143,268 @@ class Health extends Service {
|
|
|
119
143
|
}
|
|
120
144
|
|
|
121
145
|
/**
|
|
122
|
-
* Get
|
|
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
|
|
123
170
|
*
|
|
124
171
|
* Get the number of certificates that are waiting to be issued against
|
|
125
172
|
* [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
|
|
126
173
|
* server.
|
|
127
174
|
*
|
|
175
|
+
* @param {number} threshold
|
|
128
176
|
* @throws {AppwriteException}
|
|
129
177
|
* @returns {Promise}
|
|
130
178
|
*/
|
|
131
|
-
async getQueueCertificates() {
|
|
179
|
+
async getQueueCertificates(threshold) {
|
|
132
180
|
const apiPath = '/health/queue/certificates';
|
|
133
181
|
let payload = {};
|
|
134
182
|
|
|
183
|
+
if (typeof threshold !== 'undefined') {
|
|
184
|
+
payload['threshold'] = threshold;
|
|
185
|
+
}
|
|
186
|
+
|
|
135
187
|
return await this.client.call('get', apiPath, {
|
|
136
188
|
'content-type': 'application/json',
|
|
137
189
|
}, payload);
|
|
138
190
|
}
|
|
139
191
|
|
|
140
192
|
/**
|
|
141
|
-
* Get
|
|
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.
|
|
142
197
|
*
|
|
198
|
+
* @param {string} name
|
|
199
|
+
* @param {number} threshold
|
|
143
200
|
* @throws {AppwriteException}
|
|
144
201
|
* @returns {Promise}
|
|
145
202
|
*/
|
|
146
|
-
async
|
|
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
|
+
* @param {number} threshold
|
|
275
|
+
* @throws {AppwriteException}
|
|
276
|
+
* @returns {Promise}
|
|
277
|
+
*/
|
|
278
|
+
async getQueueFunctions(threshold) {
|
|
147
279
|
const apiPath = '/health/queue/functions';
|
|
148
280
|
let payload = {};
|
|
149
281
|
|
|
282
|
+
if (typeof threshold !== 'undefined') {
|
|
283
|
+
payload['threshold'] = threshold;
|
|
284
|
+
}
|
|
285
|
+
|
|
150
286
|
return await this.client.call('get', apiPath, {
|
|
151
287
|
'content-type': 'application/json',
|
|
152
288
|
}, payload);
|
|
153
289
|
}
|
|
154
290
|
|
|
155
291
|
/**
|
|
156
|
-
* Get
|
|
292
|
+
* Get logs queue
|
|
157
293
|
*
|
|
158
294
|
* Get the number of logs that are waiting to be processed in the Appwrite
|
|
159
295
|
* internal queue server.
|
|
160
296
|
*
|
|
297
|
+
* @param {number} threshold
|
|
161
298
|
* @throws {AppwriteException}
|
|
162
299
|
* @returns {Promise}
|
|
163
300
|
*/
|
|
164
|
-
async getQueueLogs() {
|
|
301
|
+
async getQueueLogs(threshold) {
|
|
165
302
|
const apiPath = '/health/queue/logs';
|
|
166
303
|
let payload = {};
|
|
167
304
|
|
|
305
|
+
if (typeof threshold !== 'undefined') {
|
|
306
|
+
payload['threshold'] = threshold;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return await this.client.call('get', apiPath, {
|
|
310
|
+
'content-type': 'application/json',
|
|
311
|
+
}, payload);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Get mails queue
|
|
316
|
+
*
|
|
317
|
+
* Get the number of mails that are waiting to be processed in the Appwrite
|
|
318
|
+
* internal queue server.
|
|
319
|
+
*
|
|
320
|
+
* @param {number} threshold
|
|
321
|
+
* @throws {AppwriteException}
|
|
322
|
+
* @returns {Promise}
|
|
323
|
+
*/
|
|
324
|
+
async getQueueMails(threshold) {
|
|
325
|
+
const apiPath = '/health/queue/mails';
|
|
326
|
+
let payload = {};
|
|
327
|
+
|
|
328
|
+
if (typeof threshold !== 'undefined') {
|
|
329
|
+
payload['threshold'] = threshold;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
return await this.client.call('get', apiPath, {
|
|
333
|
+
'content-type': 'application/json',
|
|
334
|
+
}, payload);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Get messaging queue
|
|
339
|
+
*
|
|
340
|
+
* Get the number of messages that are waiting to be processed in the Appwrite
|
|
341
|
+
* internal queue server.
|
|
342
|
+
*
|
|
343
|
+
* @param {number} threshold
|
|
344
|
+
* @throws {AppwriteException}
|
|
345
|
+
* @returns {Promise}
|
|
346
|
+
*/
|
|
347
|
+
async getQueueMessaging(threshold) {
|
|
348
|
+
const apiPath = '/health/queue/messaging';
|
|
349
|
+
let payload = {};
|
|
350
|
+
|
|
351
|
+
if (typeof threshold !== 'undefined') {
|
|
352
|
+
payload['threshold'] = threshold;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return await this.client.call('get', apiPath, {
|
|
356
|
+
'content-type': 'application/json',
|
|
357
|
+
}, payload);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Get migrations queue
|
|
362
|
+
*
|
|
363
|
+
* Get the number of migrations that are waiting to be processed in the
|
|
364
|
+
* Appwrite internal queue server.
|
|
365
|
+
*
|
|
366
|
+
* @param {number} threshold
|
|
367
|
+
* @throws {AppwriteException}
|
|
368
|
+
* @returns {Promise}
|
|
369
|
+
*/
|
|
370
|
+
async getQueueMigrations(threshold) {
|
|
371
|
+
const apiPath = '/health/queue/migrations';
|
|
372
|
+
let payload = {};
|
|
373
|
+
|
|
374
|
+
if (typeof threshold !== 'undefined') {
|
|
375
|
+
payload['threshold'] = threshold;
|
|
376
|
+
}
|
|
377
|
+
|
|
168
378
|
return await this.client.call('get', apiPath, {
|
|
169
379
|
'content-type': 'application/json',
|
|
170
380
|
}, payload);
|
|
171
381
|
}
|
|
172
382
|
|
|
173
383
|
/**
|
|
174
|
-
* Get
|
|
384
|
+
* Get webhooks queue
|
|
175
385
|
*
|
|
176
386
|
* Get the number of webhooks that are waiting to be processed in the Appwrite
|
|
177
387
|
* internal queue server.
|
|
178
388
|
*
|
|
389
|
+
* @param {number} threshold
|
|
179
390
|
* @throws {AppwriteException}
|
|
180
391
|
* @returns {Promise}
|
|
181
392
|
*/
|
|
182
|
-
async getQueueWebhooks() {
|
|
393
|
+
async getQueueWebhooks(threshold) {
|
|
183
394
|
const apiPath = '/health/queue/webhooks';
|
|
184
395
|
let payload = {};
|
|
185
396
|
|
|
397
|
+
if (typeof threshold !== 'undefined') {
|
|
398
|
+
payload['threshold'] = threshold;
|
|
399
|
+
}
|
|
400
|
+
|
|
186
401
|
return await this.client.call('get', apiPath, {
|
|
187
402
|
'content-type': 'application/json',
|
|
188
403
|
}, payload);
|
|
189
404
|
}
|
|
190
405
|
|
|
191
406
|
/**
|
|
192
|
-
* Get
|
|
407
|
+
* Get local storage
|
|
193
408
|
*
|
|
194
409
|
* Check the Appwrite local storage device is up and connection is successful.
|
|
195
410
|
*
|
|
@@ -206,7 +421,7 @@ class Health extends Service {
|
|
|
206
421
|
}
|
|
207
422
|
|
|
208
423
|
/**
|
|
209
|
-
* Get
|
|
424
|
+
* Get time
|
|
210
425
|
*
|
|
211
426
|
* Check the Appwrite server time is synced with Google remote NTP server. We
|
|
212
427
|
* use this technology to smoothly handle leap seconds with no disruptive
|
package/lib/services/locale.js
CHANGED
|
@@ -5,6 +5,8 @@ const client = require('../client.js');
|
|
|
5
5
|
const Stream = require('stream');
|
|
6
6
|
const { promisify } = require('util');
|
|
7
7
|
const fs = require('fs');
|
|
8
|
+
const { File } = require('undici');
|
|
9
|
+
const Query = require('../query.js');
|
|
8
10
|
|
|
9
11
|
class Locale extends Service {
|
|
10
12
|
|
|
@@ -15,7 +17,7 @@ class Locale extends Service {
|
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
/**
|
|
18
|
-
* Get
|
|
20
|
+
* Get user locale
|
|
19
21
|
*
|
|
20
22
|
* Get the current user location based on IP. Returns an object with user
|
|
21
23
|
* country code, country name, continent name, continent code, ip address and
|
|
@@ -55,7 +57,7 @@ class Locale extends Service {
|
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
/**
|
|
58
|
-
* List
|
|
60
|
+
* List continents
|
|
59
61
|
*
|
|
60
62
|
* List of all continents. You can use the locale header to get the data in a
|
|
61
63
|
* supported language.
|
|
@@ -73,7 +75,7 @@ class Locale extends Service {
|
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
/**
|
|
76
|
-
* List
|
|
78
|
+
* List countries
|
|
77
79
|
*
|
|
78
80
|
* List of all countries. You can use the locale header to get the data in a
|
|
79
81
|
* supported language.
|
|
@@ -91,7 +93,7 @@ class Locale extends Service {
|
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
/**
|
|
94
|
-
* List EU
|
|
96
|
+
* List EU countries
|
|
95
97
|
*
|
|
96
98
|
* List of all countries that are currently members of the EU. You can use the
|
|
97
99
|
* locale header to get the data in a supported language.
|
|
@@ -109,7 +111,7 @@ class Locale extends Service {
|
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
/**
|
|
112
|
-
* List
|
|
114
|
+
* List countries phone codes
|
|
113
115
|
*
|
|
114
116
|
* List of all countries phone codes. You can use the locale header to get the
|
|
115
117
|
* data in a supported language.
|
|
@@ -127,7 +129,7 @@ class Locale extends Service {
|
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
/**
|
|
130
|
-
* List
|
|
132
|
+
* List currencies
|
|
131
133
|
*
|
|
132
134
|
* List of all currencies, including currency symbol, name, plural, and
|
|
133
135
|
* decimal digits for all major and minor currencies. You can use the locale
|
|
@@ -146,7 +148,7 @@ class Locale extends Service {
|
|
|
146
148
|
}
|
|
147
149
|
|
|
148
150
|
/**
|
|
149
|
-
* List
|
|
151
|
+
* List languages
|
|
150
152
|
*
|
|
151
153
|
* List of all languages classified by ISO 639-1 including 2-letter code, name
|
|
152
154
|
* in English, and name in the respective language.
|