appwrite-cli 2.0.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -6
- package/docs/examples/account/delete-identity.md +2 -0
- package/docs/examples/account/list-identities.md +2 -0
- package/docs/examples/assistant/chat.md +2 -0
- package/docs/examples/databases/create-collection.md +1 -0
- package/docs/examples/databases/create-string-attribute.md +1 -0
- package/docs/examples/databases/create.md +2 -1
- package/docs/examples/databases/list-attributes.md +2 -1
- package/docs/examples/databases/list-indexes.md +2 -1
- package/docs/examples/databases/update.md +2 -1
- package/docs/examples/functions/create-deployment.md +3 -2
- package/docs/examples/functions/create-execution.md +3 -0
- package/docs/examples/functions/create.md +12 -0
- package/docs/examples/functions/download-deployment.md +3 -0
- package/docs/examples/functions/update.md +9 -0
- package/docs/examples/health/get-pub-sub.md +1 -0
- package/docs/examples/health/get-queue.md +1 -0
- package/docs/examples/locale/list-codes.md +1 -0
- package/docs/examples/migrations/create-appwrite-migration.md +5 -0
- package/docs/examples/migrations/create-firebase-migration.md +3 -0
- package/docs/examples/migrations/create-firebase-o-auth-migration.md +3 -0
- package/docs/examples/migrations/create-n-host-migration.md +9 -0
- package/docs/examples/migrations/create-supabase-migration.md +8 -0
- package/docs/examples/migrations/delete-firebase-auth.md +1 -0
- package/docs/examples/migrations/delete.md +2 -0
- package/docs/examples/migrations/get-appwrite-report.md +5 -0
- package/docs/examples/migrations/get-firebase-report-o-auth.md +3 -0
- package/docs/examples/migrations/get-firebase-report.md +3 -0
- package/docs/examples/migrations/get-n-host-report.md +9 -0
- package/docs/examples/migrations/get-supabase-report.md +8 -0
- package/docs/examples/migrations/get.md +2 -0
- package/docs/examples/migrations/list-firebase-projects.md +1 -0
- package/docs/examples/migrations/list.md +3 -0
- package/docs/examples/migrations/retry.md +2 -0
- package/docs/examples/project/create-variable.md +3 -0
- package/docs/examples/project/delete-variable.md +2 -0
- package/docs/examples/project/get-usage.md +2 -0
- package/docs/examples/project/get-variable.md +2 -0
- package/docs/examples/project/list-variables.md +1 -0
- package/docs/examples/project/update-variable.md +4 -0
- package/docs/examples/projects/create.md +1 -1
- package/docs/examples/projects/delete-email-template.md +4 -0
- package/docs/examples/projects/delete-sms-template.md +4 -0
- package/docs/examples/projects/delete.md +1 -2
- package/docs/examples/projects/get-email-template.md +4 -0
- package/docs/examples/projects/get-sms-template.md +4 -0
- package/docs/examples/projects/update-email-template.md +9 -0
- package/docs/examples/projects/update-personal-data-check.md +3 -0
- package/docs/examples/projects/update-service-status-all.md +3 -0
- package/docs/examples/projects/update-sms-template.md +5 -0
- package/docs/examples/projects/update-smtp-configuration.md +11 -0
- package/docs/examples/projects/update-team.md +3 -0
- package/docs/examples/proxy/create-rule.md +4 -0
- package/docs/examples/proxy/delete-rule.md +2 -0
- package/docs/examples/proxy/get-rule.md +2 -0
- package/docs/examples/proxy/list-rules.md +3 -0
- package/docs/examples/proxy/update-rule-verification.md +2 -0
- package/docs/examples/storage/update-file.md +1 -0
- package/docs/examples/teams/{update-membership-roles.md → update-membership.md} +1 -1
- package/docs/examples/users/delete-identity.md +2 -0
- package/docs/examples/users/list-identities.md +3 -0
- package/docs/examples/users/update-labels.md +3 -0
- package/docs/examples/vcs/create-repository-detection.md +4 -0
- package/docs/examples/vcs/create-repository.md +4 -0
- package/docs/examples/vcs/delete-installation.md +2 -0
- package/docs/examples/vcs/get-installation.md +2 -0
- package/docs/examples/vcs/get-repository.md +3 -0
- package/docs/examples/vcs/list-installations.md +3 -0
- package/docs/examples/vcs/list-repositories.md +3 -0
- package/docs/examples/vcs/list-repository-branches.md +3 -0
- package/docs/examples/vcs/update-external-deployments.md +4 -0
- package/index.js +10 -0
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +3 -3
- package/lib/commands/account.js +122 -67
- package/lib/commands/assistant.js +53 -0
- package/lib/commands/avatars.js +21 -21
- package/lib/commands/console.js +2 -2
- package/lib/commands/databases.js +146 -104
- package/lib/commands/functions.js +277 -70
- package/lib/commands/generic.js +1 -0
- package/lib/commands/graphql.js +4 -4
- package/lib/commands/health.js +68 -22
- package/lib/commands/locale.js +37 -14
- package/lib/commands/migrations.js +708 -0
- package/lib/commands/project.js +204 -0
- package/lib/commands/projects.js +459 -196
- package/lib/commands/proxy.js +177 -0
- package/lib/commands/storage.js +47 -40
- package/lib/commands/teams.js +33 -33
- package/lib/commands/users.js +147 -52
- package/lib/commands/vcs.js +305 -0
- package/lib/config.js +1 -2
- package/lib/parser.js +2 -2
- package/package.json +1 -1
- package/scoop/appwrite.json +30 -0
- package/docs/examples/projects/create-domain.md +0 -3
- package/docs/examples/projects/delete-domain.md +0 -3
- package/docs/examples/projects/get-domain.md +0 -3
- package/docs/examples/projects/list-domains.md +0 -2
- package/docs/examples/projects/update-domain-verification.md +0 -3
package/lib/commands/generic.js
CHANGED
package/lib/commands/graphql.js
CHANGED
|
@@ -18,7 +18,7 @@ const graphqlQuery = async ({ query, parseOutput = true, sdk = undefined}) => {
|
|
|
18
18
|
/* @param {object} query */
|
|
19
19
|
|
|
20
20
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
21
|
-
let
|
|
21
|
+
let apiPath = '/graphql';
|
|
22
22
|
let payload = {};
|
|
23
23
|
|
|
24
24
|
/** Body Params */
|
|
@@ -27,7 +27,7 @@ const graphqlQuery = async ({ query, parseOutput = true, sdk = undefined}) => {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
let response = undefined;
|
|
30
|
-
response = await client.call('post',
|
|
30
|
+
response = await client.call('post', apiPath, {
|
|
31
31
|
'x-sdk-graphql': 'true',
|
|
32
32
|
'content-type': 'application/json',
|
|
33
33
|
}, payload);
|
|
@@ -43,7 +43,7 @@ const graphqlMutation = async ({ query, parseOutput = true, sdk = undefined}) =>
|
|
|
43
43
|
/* @param {object} query */
|
|
44
44
|
|
|
45
45
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
46
|
-
let
|
|
46
|
+
let apiPath = '/graphql/mutation';
|
|
47
47
|
let payload = {};
|
|
48
48
|
|
|
49
49
|
/** Body Params */
|
|
@@ -52,7 +52,7 @@ const graphqlMutation = async ({ query, parseOutput = true, sdk = undefined}) =>
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
let response = undefined;
|
|
55
|
-
response = await client.call('post',
|
|
55
|
+
response = await client.call('post', apiPath, {
|
|
56
56
|
'x-sdk-graphql': 'true',
|
|
57
57
|
'content-type': 'application/json',
|
|
58
58
|
}, payload);
|
package/lib/commands/health.js
CHANGED
|
@@ -17,10 +17,10 @@ const health = new Command("health").description(commandDescriptions['health']).
|
|
|
17
17
|
const healthGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
18
18
|
|
|
19
19
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
20
|
-
let
|
|
20
|
+
let apiPath = '/health';
|
|
21
21
|
let payload = {};
|
|
22
22
|
let response = undefined;
|
|
23
|
-
response = await client.call('get',
|
|
23
|
+
response = await client.call('get', apiPath, {
|
|
24
24
|
'content-type': 'application/json',
|
|
25
25
|
}, payload);
|
|
26
26
|
|
|
@@ -34,10 +34,10 @@ const healthGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
34
34
|
const healthGetAntivirus = async ({ parseOutput = true, sdk = undefined}) => {
|
|
35
35
|
|
|
36
36
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
37
|
-
let
|
|
37
|
+
let apiPath = '/health/anti-virus';
|
|
38
38
|
let payload = {};
|
|
39
39
|
let response = undefined;
|
|
40
|
-
response = await client.call('get',
|
|
40
|
+
response = await client.call('get', apiPath, {
|
|
41
41
|
'content-type': 'application/json',
|
|
42
42
|
}, payload);
|
|
43
43
|
|
|
@@ -51,10 +51,10 @@ const healthGetAntivirus = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
51
51
|
const healthGetCache = async ({ parseOutput = true, sdk = undefined}) => {
|
|
52
52
|
|
|
53
53
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
54
|
-
let
|
|
54
|
+
let apiPath = '/health/cache';
|
|
55
55
|
let payload = {};
|
|
56
56
|
let response = undefined;
|
|
57
|
-
response = await client.call('get',
|
|
57
|
+
response = await client.call('get', apiPath, {
|
|
58
58
|
'content-type': 'application/json',
|
|
59
59
|
}, payload);
|
|
60
60
|
|
|
@@ -68,10 +68,44 @@ const healthGetCache = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
68
68
|
const healthGetDB = async ({ parseOutput = true, sdk = undefined}) => {
|
|
69
69
|
|
|
70
70
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
71
|
-
let
|
|
71
|
+
let apiPath = '/health/db';
|
|
72
72
|
let payload = {};
|
|
73
73
|
let response = undefined;
|
|
74
|
-
response = await client.call('get',
|
|
74
|
+
response = await client.call('get', apiPath, {
|
|
75
|
+
'content-type': 'application/json',
|
|
76
|
+
}, payload);
|
|
77
|
+
|
|
78
|
+
if (parseOutput) {
|
|
79
|
+
parse(response)
|
|
80
|
+
success()
|
|
81
|
+
}
|
|
82
|
+
return response;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const healthGetPubSub = async ({ parseOutput = true, sdk = undefined}) => {
|
|
86
|
+
|
|
87
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
88
|
+
let apiPath = '/health/pubsub';
|
|
89
|
+
let payload = {};
|
|
90
|
+
let response = undefined;
|
|
91
|
+
response = await client.call('get', apiPath, {
|
|
92
|
+
'content-type': 'application/json',
|
|
93
|
+
}, payload);
|
|
94
|
+
|
|
95
|
+
if (parseOutput) {
|
|
96
|
+
parse(response)
|
|
97
|
+
success()
|
|
98
|
+
}
|
|
99
|
+
return response;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const healthGetQueue = async ({ parseOutput = true, sdk = undefined}) => {
|
|
103
|
+
|
|
104
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
105
|
+
let apiPath = '/health/queue';
|
|
106
|
+
let payload = {};
|
|
107
|
+
let response = undefined;
|
|
108
|
+
response = await client.call('get', apiPath, {
|
|
75
109
|
'content-type': 'application/json',
|
|
76
110
|
}, payload);
|
|
77
111
|
|
|
@@ -85,10 +119,10 @@ const healthGetDB = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
85
119
|
const healthGetQueueCertificates = async ({ parseOutput = true, sdk = undefined}) => {
|
|
86
120
|
|
|
87
121
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
88
|
-
let
|
|
122
|
+
let apiPath = '/health/queue/certificates';
|
|
89
123
|
let payload = {};
|
|
90
124
|
let response = undefined;
|
|
91
|
-
response = await client.call('get',
|
|
125
|
+
response = await client.call('get', apiPath, {
|
|
92
126
|
'content-type': 'application/json',
|
|
93
127
|
}, payload);
|
|
94
128
|
|
|
@@ -102,10 +136,10 @@ const healthGetQueueCertificates = async ({ parseOutput = true, sdk = undefined}
|
|
|
102
136
|
const healthGetQueueFunctions = async ({ parseOutput = true, sdk = undefined}) => {
|
|
103
137
|
|
|
104
138
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
105
|
-
let
|
|
139
|
+
let apiPath = '/health/queue/functions';
|
|
106
140
|
let payload = {};
|
|
107
141
|
let response = undefined;
|
|
108
|
-
response = await client.call('get',
|
|
142
|
+
response = await client.call('get', apiPath, {
|
|
109
143
|
'content-type': 'application/json',
|
|
110
144
|
}, payload);
|
|
111
145
|
|
|
@@ -119,10 +153,10 @@ const healthGetQueueFunctions = async ({ parseOutput = true, sdk = undefined}) =
|
|
|
119
153
|
const healthGetQueueLogs = async ({ parseOutput = true, sdk = undefined}) => {
|
|
120
154
|
|
|
121
155
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
122
|
-
let
|
|
156
|
+
let apiPath = '/health/queue/logs';
|
|
123
157
|
let payload = {};
|
|
124
158
|
let response = undefined;
|
|
125
|
-
response = await client.call('get',
|
|
159
|
+
response = await client.call('get', apiPath, {
|
|
126
160
|
'content-type': 'application/json',
|
|
127
161
|
}, payload);
|
|
128
162
|
|
|
@@ -136,10 +170,10 @@ const healthGetQueueLogs = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
136
170
|
const healthGetQueueWebhooks = async ({ parseOutput = true, sdk = undefined}) => {
|
|
137
171
|
|
|
138
172
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
139
|
-
let
|
|
173
|
+
let apiPath = '/health/queue/webhooks';
|
|
140
174
|
let payload = {};
|
|
141
175
|
let response = undefined;
|
|
142
|
-
response = await client.call('get',
|
|
176
|
+
response = await client.call('get', apiPath, {
|
|
143
177
|
'content-type': 'application/json',
|
|
144
178
|
}, payload);
|
|
145
179
|
|
|
@@ -153,10 +187,10 @@ const healthGetQueueWebhooks = async ({ parseOutput = true, sdk = undefined}) =>
|
|
|
153
187
|
const healthGetStorageLocal = async ({ parseOutput = true, sdk = undefined}) => {
|
|
154
188
|
|
|
155
189
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
156
|
-
let
|
|
190
|
+
let apiPath = '/health/storage/local';
|
|
157
191
|
let payload = {};
|
|
158
192
|
let response = undefined;
|
|
159
|
-
response = await client.call('get',
|
|
193
|
+
response = await client.call('get', apiPath, {
|
|
160
194
|
'content-type': 'application/json',
|
|
161
195
|
}, payload);
|
|
162
196
|
|
|
@@ -170,10 +204,10 @@ const healthGetStorageLocal = async ({ parseOutput = true, sdk = undefined}) =>
|
|
|
170
204
|
const healthGetTime = async ({ parseOutput = true, sdk = undefined}) => {
|
|
171
205
|
|
|
172
206
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
173
|
-
let
|
|
207
|
+
let apiPath = '/health/time';
|
|
174
208
|
let payload = {};
|
|
175
209
|
let response = undefined;
|
|
176
|
-
response = await client.call('get',
|
|
210
|
+
response = await client.call('get', apiPath, {
|
|
177
211
|
'content-type': 'application/json',
|
|
178
212
|
}, payload);
|
|
179
213
|
|
|
@@ -197,14 +231,24 @@ health
|
|
|
197
231
|
|
|
198
232
|
health
|
|
199
233
|
.command(`getCache`)
|
|
200
|
-
.description(`Check the Appwrite in-memory cache
|
|
234
|
+
.description(`Check the Appwrite in-memory cache servers are up and connection is successful.`)
|
|
201
235
|
.action(actionRunner(healthGetCache))
|
|
202
236
|
|
|
203
237
|
health
|
|
204
238
|
.command(`getDB`)
|
|
205
|
-
.description(`Check the Appwrite database
|
|
239
|
+
.description(`Check the Appwrite database servers are up and connection is successful.`)
|
|
206
240
|
.action(actionRunner(healthGetDB))
|
|
207
241
|
|
|
242
|
+
health
|
|
243
|
+
.command(`getPubSub`)
|
|
244
|
+
.description(`Check the Appwrite pub-sub servers are up and connection is successful.`)
|
|
245
|
+
.action(actionRunner(healthGetPubSub))
|
|
246
|
+
|
|
247
|
+
health
|
|
248
|
+
.command(`getQueue`)
|
|
249
|
+
.description(`Check the Appwrite queue messaging servers are up and connection is successful.`)
|
|
250
|
+
.action(actionRunner(healthGetQueue))
|
|
251
|
+
|
|
208
252
|
health
|
|
209
253
|
.command(`getQueueCertificates`)
|
|
210
254
|
.description(`Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.`)
|
|
@@ -242,6 +286,8 @@ module.exports = {
|
|
|
242
286
|
healthGetAntivirus,
|
|
243
287
|
healthGetCache,
|
|
244
288
|
healthGetDB,
|
|
289
|
+
healthGetPubSub,
|
|
290
|
+
healthGetQueue,
|
|
245
291
|
healthGetQueueCertificates,
|
|
246
292
|
healthGetQueueFunctions,
|
|
247
293
|
healthGetQueueLogs,
|
package/lib/commands/locale.js
CHANGED
|
@@ -17,10 +17,27 @@ const locale = new Command("locale").description(commandDescriptions['locale']).
|
|
|
17
17
|
const localeGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
18
18
|
|
|
19
19
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
20
|
-
let
|
|
20
|
+
let apiPath = '/locale';
|
|
21
21
|
let payload = {};
|
|
22
22
|
let response = undefined;
|
|
23
|
-
response = await client.call('get',
|
|
23
|
+
response = await client.call('get', apiPath, {
|
|
24
|
+
'content-type': 'application/json',
|
|
25
|
+
}, payload);
|
|
26
|
+
|
|
27
|
+
if (parseOutput) {
|
|
28
|
+
parse(response)
|
|
29
|
+
success()
|
|
30
|
+
}
|
|
31
|
+
return response;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const localeListCodes = async ({ parseOutput = true, sdk = undefined}) => {
|
|
35
|
+
|
|
36
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
37
|
+
let apiPath = '/locale/codes';
|
|
38
|
+
let payload = {};
|
|
39
|
+
let response = undefined;
|
|
40
|
+
response = await client.call('get', apiPath, {
|
|
24
41
|
'content-type': 'application/json',
|
|
25
42
|
}, payload);
|
|
26
43
|
|
|
@@ -34,10 +51,10 @@ const localeGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
34
51
|
const localeListContinents = async ({ parseOutput = true, sdk = undefined}) => {
|
|
35
52
|
|
|
36
53
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
37
|
-
let
|
|
54
|
+
let apiPath = '/locale/continents';
|
|
38
55
|
let payload = {};
|
|
39
56
|
let response = undefined;
|
|
40
|
-
response = await client.call('get',
|
|
57
|
+
response = await client.call('get', apiPath, {
|
|
41
58
|
'content-type': 'application/json',
|
|
42
59
|
}, payload);
|
|
43
60
|
|
|
@@ -51,10 +68,10 @@ const localeListContinents = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
51
68
|
const localeListCountries = async ({ parseOutput = true, sdk = undefined}) => {
|
|
52
69
|
|
|
53
70
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
54
|
-
let
|
|
71
|
+
let apiPath = '/locale/countries';
|
|
55
72
|
let payload = {};
|
|
56
73
|
let response = undefined;
|
|
57
|
-
response = await client.call('get',
|
|
74
|
+
response = await client.call('get', apiPath, {
|
|
58
75
|
'content-type': 'application/json',
|
|
59
76
|
}, payload);
|
|
60
77
|
|
|
@@ -68,10 +85,10 @@ const localeListCountries = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
68
85
|
const localeListCountriesEU = async ({ parseOutput = true, sdk = undefined}) => {
|
|
69
86
|
|
|
70
87
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
71
|
-
let
|
|
88
|
+
let apiPath = '/locale/countries/eu';
|
|
72
89
|
let payload = {};
|
|
73
90
|
let response = undefined;
|
|
74
|
-
response = await client.call('get',
|
|
91
|
+
response = await client.call('get', apiPath, {
|
|
75
92
|
'content-type': 'application/json',
|
|
76
93
|
}, payload);
|
|
77
94
|
|
|
@@ -85,10 +102,10 @@ const localeListCountriesEU = async ({ parseOutput = true, sdk = undefined}) =>
|
|
|
85
102
|
const localeListCountriesPhones = async ({ parseOutput = true, sdk = undefined}) => {
|
|
86
103
|
|
|
87
104
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
88
|
-
let
|
|
105
|
+
let apiPath = '/locale/countries/phones';
|
|
89
106
|
let payload = {};
|
|
90
107
|
let response = undefined;
|
|
91
|
-
response = await client.call('get',
|
|
108
|
+
response = await client.call('get', apiPath, {
|
|
92
109
|
'content-type': 'application/json',
|
|
93
110
|
}, payload);
|
|
94
111
|
|
|
@@ -102,10 +119,10 @@ const localeListCountriesPhones = async ({ parseOutput = true, sdk = undefined})
|
|
|
102
119
|
const localeListCurrencies = async ({ parseOutput = true, sdk = undefined}) => {
|
|
103
120
|
|
|
104
121
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
105
|
-
let
|
|
122
|
+
let apiPath = '/locale/currencies';
|
|
106
123
|
let payload = {};
|
|
107
124
|
let response = undefined;
|
|
108
|
-
response = await client.call('get',
|
|
125
|
+
response = await client.call('get', apiPath, {
|
|
109
126
|
'content-type': 'application/json',
|
|
110
127
|
}, payload);
|
|
111
128
|
|
|
@@ -119,10 +136,10 @@ const localeListCurrencies = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
119
136
|
const localeListLanguages = async ({ parseOutput = true, sdk = undefined}) => {
|
|
120
137
|
|
|
121
138
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
122
|
-
let
|
|
139
|
+
let apiPath = '/locale/languages';
|
|
123
140
|
let payload = {};
|
|
124
141
|
let response = undefined;
|
|
125
|
-
response = await client.call('get',
|
|
142
|
+
response = await client.call('get', apiPath, {
|
|
126
143
|
'content-type': 'application/json',
|
|
127
144
|
}, payload);
|
|
128
145
|
|
|
@@ -139,6 +156,11 @@ locale
|
|
|
139
156
|
.description(`Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language. ([IP Geolocation by DB-IP](https://db-ip.com))`)
|
|
140
157
|
.action(actionRunner(localeGet))
|
|
141
158
|
|
|
159
|
+
locale
|
|
160
|
+
.command(`listCodes`)
|
|
161
|
+
.description(`List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).`)
|
|
162
|
+
.action(actionRunner(localeListCodes))
|
|
163
|
+
|
|
142
164
|
locale
|
|
143
165
|
.command(`listContinents`)
|
|
144
166
|
.description(`List of all continents. You can use the locale header to get the data in a supported language.`)
|
|
@@ -173,6 +195,7 @@ locale
|
|
|
173
195
|
module.exports = {
|
|
174
196
|
locale,
|
|
175
197
|
localeGet,
|
|
198
|
+
localeListCodes,
|
|
176
199
|
localeListContinents,
|
|
177
200
|
localeListCountries,
|
|
178
201
|
localeListCountriesEU,
|