appwrite-cli 4.2.1 → 4.2.2
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 +2 -2
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +7 -2
- package/lib/commands/account.js +63 -158
- package/lib/commands/assistant.js +3 -8
- package/lib/commands/avatars.js +29 -45
- package/lib/commands/console.js +3 -8
- package/lib/commands/databases.js +97 -243
- package/lib/commands/functions.js +54 -119
- package/lib/commands/generic.js +0 -1
- package/lib/commands/graphql.js +5 -13
- package/lib/commands/health.js +37 -93
- package/lib/commands/locale.js +17 -43
- package/lib/commands/migrations.js +33 -83
- package/lib/commands/project.js +13 -33
- package/lib/commands/projects.js +81 -203
- package/lib/commands/proxy.js +11 -28
- package/lib/commands/storage.js +36 -81
- package/lib/commands/teams.js +29 -73
- package/lib/commands/users.js +59 -148
- package/lib/commands/vcs.js +19 -48
- package/package.json +1 -1
- package/scoop/appwrite.json +3 -3
package/lib/commands/health.js
CHANGED
|
@@ -37,7 +37,7 @@ function convertReadStreamToReadableStream(readStream) {
|
|
|
37
37
|
|
|
38
38
|
const health = new Command("health").description(commandDescriptions['health']).configureHelp({
|
|
39
39
|
helpWidth: process.stdout.columns || 80
|
|
40
|
-
|
|
40
|
+
})
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* @typedef {Object} HealthGetRequestParams
|
|
@@ -50,18 +50,15 @@ const health = new Command("health").description(commandDescriptions['health']).
|
|
|
50
50
|
*/
|
|
51
51
|
const healthGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
52
52
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
53
|
-
|
|
54
53
|
let apiPath = '/health';
|
|
55
54
|
let payload = {};
|
|
56
55
|
|
|
57
|
-
|
|
58
56
|
let response = undefined;
|
|
59
|
-
|
|
57
|
+
|
|
60
58
|
response = await client.call('get', apiPath, {
|
|
61
59
|
'content-type': 'application/json',
|
|
62
60
|
}, payload);
|
|
63
61
|
|
|
64
|
-
|
|
65
62
|
if (parseOutput) {
|
|
66
63
|
parse(response)
|
|
67
64
|
success()
|
|
@@ -81,18 +78,15 @@ const healthGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
81
78
|
*/
|
|
82
79
|
const healthGetAntivirus = async ({ parseOutput = true, sdk = undefined}) => {
|
|
83
80
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
84
|
-
|
|
85
81
|
let apiPath = '/health/anti-virus';
|
|
86
82
|
let payload = {};
|
|
87
83
|
|
|
88
|
-
|
|
89
84
|
let response = undefined;
|
|
90
|
-
|
|
85
|
+
|
|
91
86
|
response = await client.call('get', apiPath, {
|
|
92
87
|
'content-type': 'application/json',
|
|
93
88
|
}, payload);
|
|
94
89
|
|
|
95
|
-
|
|
96
90
|
if (parseOutput) {
|
|
97
91
|
parse(response)
|
|
98
92
|
success()
|
|
@@ -112,18 +106,15 @@ const healthGetAntivirus = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
112
106
|
*/
|
|
113
107
|
const healthGetCache = async ({ parseOutput = true, sdk = undefined}) => {
|
|
114
108
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
115
|
-
|
|
116
109
|
let apiPath = '/health/cache';
|
|
117
110
|
let payload = {};
|
|
118
111
|
|
|
119
|
-
|
|
120
112
|
let response = undefined;
|
|
121
|
-
|
|
113
|
+
|
|
122
114
|
response = await client.call('get', apiPath, {
|
|
123
115
|
'content-type': 'application/json',
|
|
124
116
|
}, payload);
|
|
125
117
|
|
|
126
|
-
|
|
127
118
|
if (parseOutput) {
|
|
128
119
|
parse(response)
|
|
129
120
|
success()
|
|
@@ -143,18 +134,15 @@ const healthGetCache = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
143
134
|
*/
|
|
144
135
|
const healthGetDB = async ({ parseOutput = true, sdk = undefined}) => {
|
|
145
136
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
146
|
-
|
|
147
137
|
let apiPath = '/health/db';
|
|
148
138
|
let payload = {};
|
|
149
139
|
|
|
150
|
-
|
|
151
140
|
let response = undefined;
|
|
152
|
-
|
|
141
|
+
|
|
153
142
|
response = await client.call('get', apiPath, {
|
|
154
143
|
'content-type': 'application/json',
|
|
155
144
|
}, payload);
|
|
156
145
|
|
|
157
|
-
|
|
158
146
|
if (parseOutput) {
|
|
159
147
|
parse(response)
|
|
160
148
|
success()
|
|
@@ -174,18 +162,15 @@ const healthGetDB = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
174
162
|
*/
|
|
175
163
|
const healthGetPubSub = async ({ parseOutput = true, sdk = undefined}) => {
|
|
176
164
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
177
|
-
|
|
178
165
|
let apiPath = '/health/pubsub';
|
|
179
166
|
let payload = {};
|
|
180
167
|
|
|
181
|
-
|
|
182
168
|
let response = undefined;
|
|
183
|
-
|
|
169
|
+
|
|
184
170
|
response = await client.call('get', apiPath, {
|
|
185
171
|
'content-type': 'application/json',
|
|
186
172
|
}, payload);
|
|
187
173
|
|
|
188
|
-
|
|
189
174
|
if (parseOutput) {
|
|
190
175
|
parse(response)
|
|
191
176
|
success()
|
|
@@ -205,18 +190,15 @@ const healthGetPubSub = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
205
190
|
*/
|
|
206
191
|
const healthGetQueue = async ({ parseOutput = true, sdk = undefined}) => {
|
|
207
192
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
208
|
-
|
|
209
193
|
let apiPath = '/health/queue';
|
|
210
194
|
let payload = {};
|
|
211
195
|
|
|
212
|
-
|
|
213
196
|
let response = undefined;
|
|
214
|
-
|
|
197
|
+
|
|
215
198
|
response = await client.call('get', apiPath, {
|
|
216
199
|
'content-type': 'application/json',
|
|
217
200
|
}, payload);
|
|
218
201
|
|
|
219
|
-
|
|
220
202
|
if (parseOutput) {
|
|
221
203
|
parse(response)
|
|
222
204
|
success()
|
|
@@ -237,21 +219,18 @@ const healthGetQueue = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
237
219
|
*/
|
|
238
220
|
const healthGetQueueBuilds = async ({ threshold, parseOutput = true, sdk = undefined}) => {
|
|
239
221
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
240
|
-
|
|
241
222
|
let apiPath = '/health/queue/builds';
|
|
242
223
|
let payload = {};
|
|
243
224
|
if (typeof threshold !== 'undefined') {
|
|
244
225
|
payload['threshold'] = threshold;
|
|
245
226
|
}
|
|
246
227
|
|
|
247
|
-
|
|
248
228
|
let response = undefined;
|
|
249
|
-
|
|
229
|
+
|
|
250
230
|
response = await client.call('get', apiPath, {
|
|
251
231
|
'content-type': 'application/json',
|
|
252
232
|
}, payload);
|
|
253
233
|
|
|
254
|
-
|
|
255
234
|
if (parseOutput) {
|
|
256
235
|
parse(response)
|
|
257
236
|
success()
|
|
@@ -272,21 +251,18 @@ const healthGetQueueBuilds = async ({ threshold, parseOutput = true, sdk = undef
|
|
|
272
251
|
*/
|
|
273
252
|
const healthGetQueueCertificates = async ({ threshold, parseOutput = true, sdk = undefined}) => {
|
|
274
253
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
275
|
-
|
|
276
254
|
let apiPath = '/health/queue/certificates';
|
|
277
255
|
let payload = {};
|
|
278
256
|
if (typeof threshold !== 'undefined') {
|
|
279
257
|
payload['threshold'] = threshold;
|
|
280
258
|
}
|
|
281
259
|
|
|
282
|
-
|
|
283
260
|
let response = undefined;
|
|
284
|
-
|
|
261
|
+
|
|
285
262
|
response = await client.call('get', apiPath, {
|
|
286
263
|
'content-type': 'application/json',
|
|
287
264
|
}, payload);
|
|
288
265
|
|
|
289
|
-
|
|
290
266
|
if (parseOutput) {
|
|
291
267
|
parse(response)
|
|
292
268
|
success()
|
|
@@ -308,7 +284,6 @@ const healthGetQueueCertificates = async ({ threshold, parseOutput = true, sdk =
|
|
|
308
284
|
*/
|
|
309
285
|
const healthGetQueueDatabases = async ({ name, threshold, parseOutput = true, sdk = undefined}) => {
|
|
310
286
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
311
|
-
|
|
312
287
|
let apiPath = '/health/queue/databases';
|
|
313
288
|
let payload = {};
|
|
314
289
|
if (typeof name !== 'undefined') {
|
|
@@ -318,14 +293,12 @@ const healthGetQueueDatabases = async ({ name, threshold, parseOutput = true, sd
|
|
|
318
293
|
payload['threshold'] = threshold;
|
|
319
294
|
}
|
|
320
295
|
|
|
321
|
-
|
|
322
296
|
let response = undefined;
|
|
323
|
-
|
|
297
|
+
|
|
324
298
|
response = await client.call('get', apiPath, {
|
|
325
299
|
'content-type': 'application/json',
|
|
326
300
|
}, payload);
|
|
327
301
|
|
|
328
|
-
|
|
329
302
|
if (parseOutput) {
|
|
330
303
|
parse(response)
|
|
331
304
|
success()
|
|
@@ -346,21 +319,18 @@ const healthGetQueueDatabases = async ({ name, threshold, parseOutput = true, sd
|
|
|
346
319
|
*/
|
|
347
320
|
const healthGetQueueDeletes = async ({ threshold, parseOutput = true, sdk = undefined}) => {
|
|
348
321
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
349
|
-
|
|
350
322
|
let apiPath = '/health/queue/deletes';
|
|
351
323
|
let payload = {};
|
|
352
324
|
if (typeof threshold !== 'undefined') {
|
|
353
325
|
payload['threshold'] = threshold;
|
|
354
326
|
}
|
|
355
327
|
|
|
356
|
-
|
|
357
328
|
let response = undefined;
|
|
358
|
-
|
|
329
|
+
|
|
359
330
|
response = await client.call('get', apiPath, {
|
|
360
331
|
'content-type': 'application/json',
|
|
361
332
|
}, payload);
|
|
362
333
|
|
|
363
|
-
|
|
364
334
|
if (parseOutput) {
|
|
365
335
|
parse(response)
|
|
366
336
|
success()
|
|
@@ -381,21 +351,18 @@ const healthGetQueueDeletes = async ({ threshold, parseOutput = true, sdk = unde
|
|
|
381
351
|
*/
|
|
382
352
|
const healthGetQueueFunctions = async ({ threshold, parseOutput = true, sdk = undefined}) => {
|
|
383
353
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
384
|
-
|
|
385
354
|
let apiPath = '/health/queue/functions';
|
|
386
355
|
let payload = {};
|
|
387
356
|
if (typeof threshold !== 'undefined') {
|
|
388
357
|
payload['threshold'] = threshold;
|
|
389
358
|
}
|
|
390
359
|
|
|
391
|
-
|
|
392
360
|
let response = undefined;
|
|
393
|
-
|
|
361
|
+
|
|
394
362
|
response = await client.call('get', apiPath, {
|
|
395
363
|
'content-type': 'application/json',
|
|
396
364
|
}, payload);
|
|
397
365
|
|
|
398
|
-
|
|
399
366
|
if (parseOutput) {
|
|
400
367
|
parse(response)
|
|
401
368
|
success()
|
|
@@ -416,21 +383,18 @@ const healthGetQueueFunctions = async ({ threshold, parseOutput = true, sdk = un
|
|
|
416
383
|
*/
|
|
417
384
|
const healthGetQueueLogs = async ({ threshold, parseOutput = true, sdk = undefined}) => {
|
|
418
385
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
419
|
-
|
|
420
386
|
let apiPath = '/health/queue/logs';
|
|
421
387
|
let payload = {};
|
|
422
388
|
if (typeof threshold !== 'undefined') {
|
|
423
389
|
payload['threshold'] = threshold;
|
|
424
390
|
}
|
|
425
391
|
|
|
426
|
-
|
|
427
392
|
let response = undefined;
|
|
428
|
-
|
|
393
|
+
|
|
429
394
|
response = await client.call('get', apiPath, {
|
|
430
395
|
'content-type': 'application/json',
|
|
431
396
|
}, payload);
|
|
432
397
|
|
|
433
|
-
|
|
434
398
|
if (parseOutput) {
|
|
435
399
|
parse(response)
|
|
436
400
|
success()
|
|
@@ -451,21 +415,18 @@ const healthGetQueueLogs = async ({ threshold, parseOutput = true, sdk = undefin
|
|
|
451
415
|
*/
|
|
452
416
|
const healthGetQueueMails = async ({ threshold, parseOutput = true, sdk = undefined}) => {
|
|
453
417
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
454
|
-
|
|
455
418
|
let apiPath = '/health/queue/mails';
|
|
456
419
|
let payload = {};
|
|
457
420
|
if (typeof threshold !== 'undefined') {
|
|
458
421
|
payload['threshold'] = threshold;
|
|
459
422
|
}
|
|
460
423
|
|
|
461
|
-
|
|
462
424
|
let response = undefined;
|
|
463
|
-
|
|
425
|
+
|
|
464
426
|
response = await client.call('get', apiPath, {
|
|
465
427
|
'content-type': 'application/json',
|
|
466
428
|
}, payload);
|
|
467
429
|
|
|
468
|
-
|
|
469
430
|
if (parseOutput) {
|
|
470
431
|
parse(response)
|
|
471
432
|
success()
|
|
@@ -486,21 +447,18 @@ const healthGetQueueMails = async ({ threshold, parseOutput = true, sdk = undefi
|
|
|
486
447
|
*/
|
|
487
448
|
const healthGetQueueMessaging = async ({ threshold, parseOutput = true, sdk = undefined}) => {
|
|
488
449
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
489
|
-
|
|
490
450
|
let apiPath = '/health/queue/messaging';
|
|
491
451
|
let payload = {};
|
|
492
452
|
if (typeof threshold !== 'undefined') {
|
|
493
453
|
payload['threshold'] = threshold;
|
|
494
454
|
}
|
|
495
455
|
|
|
496
|
-
|
|
497
456
|
let response = undefined;
|
|
498
|
-
|
|
457
|
+
|
|
499
458
|
response = await client.call('get', apiPath, {
|
|
500
459
|
'content-type': 'application/json',
|
|
501
460
|
}, payload);
|
|
502
461
|
|
|
503
|
-
|
|
504
462
|
if (parseOutput) {
|
|
505
463
|
parse(response)
|
|
506
464
|
success()
|
|
@@ -521,21 +479,18 @@ const healthGetQueueMessaging = async ({ threshold, parseOutput = true, sdk = un
|
|
|
521
479
|
*/
|
|
522
480
|
const healthGetQueueMigrations = async ({ threshold, parseOutput = true, sdk = undefined}) => {
|
|
523
481
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
524
|
-
|
|
525
482
|
let apiPath = '/health/queue/migrations';
|
|
526
483
|
let payload = {};
|
|
527
484
|
if (typeof threshold !== 'undefined') {
|
|
528
485
|
payload['threshold'] = threshold;
|
|
529
486
|
}
|
|
530
487
|
|
|
531
|
-
|
|
532
488
|
let response = undefined;
|
|
533
|
-
|
|
489
|
+
|
|
534
490
|
response = await client.call('get', apiPath, {
|
|
535
491
|
'content-type': 'application/json',
|
|
536
492
|
}, payload);
|
|
537
493
|
|
|
538
|
-
|
|
539
494
|
if (parseOutput) {
|
|
540
495
|
parse(response)
|
|
541
496
|
success()
|
|
@@ -556,21 +511,18 @@ const healthGetQueueMigrations = async ({ threshold, parseOutput = true, sdk = u
|
|
|
556
511
|
*/
|
|
557
512
|
const healthGetQueueWebhooks = async ({ threshold, parseOutput = true, sdk = undefined}) => {
|
|
558
513
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
559
|
-
|
|
560
514
|
let apiPath = '/health/queue/webhooks';
|
|
561
515
|
let payload = {};
|
|
562
516
|
if (typeof threshold !== 'undefined') {
|
|
563
517
|
payload['threshold'] = threshold;
|
|
564
518
|
}
|
|
565
519
|
|
|
566
|
-
|
|
567
520
|
let response = undefined;
|
|
568
|
-
|
|
521
|
+
|
|
569
522
|
response = await client.call('get', apiPath, {
|
|
570
523
|
'content-type': 'application/json',
|
|
571
524
|
}, payload);
|
|
572
525
|
|
|
573
|
-
|
|
574
526
|
if (parseOutput) {
|
|
575
527
|
parse(response)
|
|
576
528
|
success()
|
|
@@ -590,18 +542,15 @@ const healthGetQueueWebhooks = async ({ threshold, parseOutput = true, sdk = und
|
|
|
590
542
|
*/
|
|
591
543
|
const healthGetStorageLocal = async ({ parseOutput = true, sdk = undefined}) => {
|
|
592
544
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
593
|
-
|
|
594
545
|
let apiPath = '/health/storage/local';
|
|
595
546
|
let payload = {};
|
|
596
547
|
|
|
597
|
-
|
|
598
548
|
let response = undefined;
|
|
599
|
-
|
|
549
|
+
|
|
600
550
|
response = await client.call('get', apiPath, {
|
|
601
551
|
'content-type': 'application/json',
|
|
602
552
|
}, payload);
|
|
603
553
|
|
|
604
|
-
|
|
605
554
|
if (parseOutput) {
|
|
606
555
|
parse(response)
|
|
607
556
|
success()
|
|
@@ -621,18 +570,15 @@ const healthGetStorageLocal = async ({ parseOutput = true, sdk = undefined}) =>
|
|
|
621
570
|
*/
|
|
622
571
|
const healthGetTime = async ({ parseOutput = true, sdk = undefined}) => {
|
|
623
572
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
624
|
-
|
|
625
573
|
let apiPath = '/health/time';
|
|
626
574
|
let payload = {};
|
|
627
575
|
|
|
628
|
-
|
|
629
576
|
let response = undefined;
|
|
630
|
-
|
|
577
|
+
|
|
631
578
|
response = await client.call('get', apiPath, {
|
|
632
579
|
'content-type': 'application/json',
|
|
633
580
|
}, payload);
|
|
634
581
|
|
|
635
|
-
|
|
636
582
|
if (parseOutput) {
|
|
637
583
|
parse(response)
|
|
638
584
|
success()
|
|
@@ -641,7 +587,6 @@ const healthGetTime = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
641
587
|
return response;
|
|
642
588
|
}
|
|
643
589
|
|
|
644
|
-
|
|
645
590
|
health
|
|
646
591
|
.command(`get`)
|
|
647
592
|
.description(`Check the Appwrite HTTP server is up and responsive.`)
|
|
@@ -743,25 +688,24 @@ health
|
|
|
743
688
|
.description(`Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.`)
|
|
744
689
|
.action(actionRunner(healthGetTime))
|
|
745
690
|
|
|
746
|
-
|
|
747
691
|
module.exports = {
|
|
748
692
|
health,
|
|
749
|
-
healthGet,
|
|
750
|
-
healthGetAntivirus,
|
|
751
|
-
healthGetCache,
|
|
752
|
-
healthGetDB,
|
|
753
|
-
healthGetPubSub,
|
|
754
|
-
healthGetQueue,
|
|
755
|
-
healthGetQueueBuilds,
|
|
756
|
-
healthGetQueueCertificates,
|
|
757
|
-
healthGetQueueDatabases,
|
|
758
|
-
healthGetQueueDeletes,
|
|
759
|
-
healthGetQueueFunctions,
|
|
760
|
-
healthGetQueueLogs,
|
|
761
|
-
healthGetQueueMails,
|
|
762
|
-
healthGetQueueMessaging,
|
|
763
|
-
healthGetQueueMigrations,
|
|
764
|
-
healthGetQueueWebhooks,
|
|
765
|
-
healthGetStorageLocal,
|
|
766
|
-
healthGetTime
|
|
693
|
+
healthGet,
|
|
694
|
+
healthGetAntivirus,
|
|
695
|
+
healthGetCache,
|
|
696
|
+
healthGetDB,
|
|
697
|
+
healthGetPubSub,
|
|
698
|
+
healthGetQueue,
|
|
699
|
+
healthGetQueueBuilds,
|
|
700
|
+
healthGetQueueCertificates,
|
|
701
|
+
healthGetQueueDatabases,
|
|
702
|
+
healthGetQueueDeletes,
|
|
703
|
+
healthGetQueueFunctions,
|
|
704
|
+
healthGetQueueLogs,
|
|
705
|
+
healthGetQueueMails,
|
|
706
|
+
healthGetQueueMessaging,
|
|
707
|
+
healthGetQueueMigrations,
|
|
708
|
+
healthGetQueueWebhooks,
|
|
709
|
+
healthGetStorageLocal,
|
|
710
|
+
healthGetTime
|
|
767
711
|
};
|
package/lib/commands/locale.js
CHANGED
|
@@ -37,7 +37,7 @@ function convertReadStreamToReadableStream(readStream) {
|
|
|
37
37
|
|
|
38
38
|
const locale = new Command("locale").description(commandDescriptions['locale']).configureHelp({
|
|
39
39
|
helpWidth: process.stdout.columns || 80
|
|
40
|
-
|
|
40
|
+
})
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* @typedef {Object} LocaleGetRequestParams
|
|
@@ -50,18 +50,15 @@ const locale = new Command("locale").description(commandDescriptions['locale']).
|
|
|
50
50
|
*/
|
|
51
51
|
const localeGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
52
52
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
53
|
-
|
|
54
53
|
let apiPath = '/locale';
|
|
55
54
|
let payload = {};
|
|
56
55
|
|
|
57
|
-
|
|
58
56
|
let response = undefined;
|
|
59
|
-
|
|
57
|
+
|
|
60
58
|
response = await client.call('get', apiPath, {
|
|
61
59
|
'content-type': 'application/json',
|
|
62
60
|
}, payload);
|
|
63
61
|
|
|
64
|
-
|
|
65
62
|
if (parseOutput) {
|
|
66
63
|
parse(response)
|
|
67
64
|
success()
|
|
@@ -81,18 +78,15 @@ const localeGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
81
78
|
*/
|
|
82
79
|
const localeListCodes = async ({ parseOutput = true, sdk = undefined}) => {
|
|
83
80
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
84
|
-
|
|
85
81
|
let apiPath = '/locale/codes';
|
|
86
82
|
let payload = {};
|
|
87
83
|
|
|
88
|
-
|
|
89
84
|
let response = undefined;
|
|
90
|
-
|
|
85
|
+
|
|
91
86
|
response = await client.call('get', apiPath, {
|
|
92
87
|
'content-type': 'application/json',
|
|
93
88
|
}, payload);
|
|
94
89
|
|
|
95
|
-
|
|
96
90
|
if (parseOutput) {
|
|
97
91
|
parse(response)
|
|
98
92
|
success()
|
|
@@ -112,18 +106,15 @@ const localeListCodes = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
112
106
|
*/
|
|
113
107
|
const localeListContinents = async ({ parseOutput = true, sdk = undefined}) => {
|
|
114
108
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
115
|
-
|
|
116
109
|
let apiPath = '/locale/continents';
|
|
117
110
|
let payload = {};
|
|
118
111
|
|
|
119
|
-
|
|
120
112
|
let response = undefined;
|
|
121
|
-
|
|
113
|
+
|
|
122
114
|
response = await client.call('get', apiPath, {
|
|
123
115
|
'content-type': 'application/json',
|
|
124
116
|
}, payload);
|
|
125
117
|
|
|
126
|
-
|
|
127
118
|
if (parseOutput) {
|
|
128
119
|
parse(response)
|
|
129
120
|
success()
|
|
@@ -143,18 +134,15 @@ const localeListContinents = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
143
134
|
*/
|
|
144
135
|
const localeListCountries = async ({ parseOutput = true, sdk = undefined}) => {
|
|
145
136
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
146
|
-
|
|
147
137
|
let apiPath = '/locale/countries';
|
|
148
138
|
let payload = {};
|
|
149
139
|
|
|
150
|
-
|
|
151
140
|
let response = undefined;
|
|
152
|
-
|
|
141
|
+
|
|
153
142
|
response = await client.call('get', apiPath, {
|
|
154
143
|
'content-type': 'application/json',
|
|
155
144
|
}, payload);
|
|
156
145
|
|
|
157
|
-
|
|
158
146
|
if (parseOutput) {
|
|
159
147
|
parse(response)
|
|
160
148
|
success()
|
|
@@ -174,18 +162,15 @@ const localeListCountries = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
174
162
|
*/
|
|
175
163
|
const localeListCountriesEU = async ({ parseOutput = true, sdk = undefined}) => {
|
|
176
164
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
177
|
-
|
|
178
165
|
let apiPath = '/locale/countries/eu';
|
|
179
166
|
let payload = {};
|
|
180
167
|
|
|
181
|
-
|
|
182
168
|
let response = undefined;
|
|
183
|
-
|
|
169
|
+
|
|
184
170
|
response = await client.call('get', apiPath, {
|
|
185
171
|
'content-type': 'application/json',
|
|
186
172
|
}, payload);
|
|
187
173
|
|
|
188
|
-
|
|
189
174
|
if (parseOutput) {
|
|
190
175
|
parse(response)
|
|
191
176
|
success()
|
|
@@ -205,18 +190,15 @@ const localeListCountriesEU = async ({ parseOutput = true, sdk = undefined}) =>
|
|
|
205
190
|
*/
|
|
206
191
|
const localeListCountriesPhones = async ({ parseOutput = true, sdk = undefined}) => {
|
|
207
192
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
208
|
-
|
|
209
193
|
let apiPath = '/locale/countries/phones';
|
|
210
194
|
let payload = {};
|
|
211
195
|
|
|
212
|
-
|
|
213
196
|
let response = undefined;
|
|
214
|
-
|
|
197
|
+
|
|
215
198
|
response = await client.call('get', apiPath, {
|
|
216
199
|
'content-type': 'application/json',
|
|
217
200
|
}, payload);
|
|
218
201
|
|
|
219
|
-
|
|
220
202
|
if (parseOutput) {
|
|
221
203
|
parse(response)
|
|
222
204
|
success()
|
|
@@ -236,18 +218,15 @@ const localeListCountriesPhones = async ({ parseOutput = true, sdk = undefined})
|
|
|
236
218
|
*/
|
|
237
219
|
const localeListCurrencies = async ({ parseOutput = true, sdk = undefined}) => {
|
|
238
220
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
239
|
-
|
|
240
221
|
let apiPath = '/locale/currencies';
|
|
241
222
|
let payload = {};
|
|
242
223
|
|
|
243
|
-
|
|
244
224
|
let response = undefined;
|
|
245
|
-
|
|
225
|
+
|
|
246
226
|
response = await client.call('get', apiPath, {
|
|
247
227
|
'content-type': 'application/json',
|
|
248
228
|
}, payload);
|
|
249
229
|
|
|
250
|
-
|
|
251
230
|
if (parseOutput) {
|
|
252
231
|
parse(response)
|
|
253
232
|
success()
|
|
@@ -267,18 +246,15 @@ const localeListCurrencies = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
267
246
|
*/
|
|
268
247
|
const localeListLanguages = async ({ parseOutput = true, sdk = undefined}) => {
|
|
269
248
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
270
|
-
|
|
271
249
|
let apiPath = '/locale/languages';
|
|
272
250
|
let payload = {};
|
|
273
251
|
|
|
274
|
-
|
|
275
252
|
let response = undefined;
|
|
276
|
-
|
|
253
|
+
|
|
277
254
|
response = await client.call('get', apiPath, {
|
|
278
255
|
'content-type': 'application/json',
|
|
279
256
|
}, payload);
|
|
280
257
|
|
|
281
|
-
|
|
282
258
|
if (parseOutput) {
|
|
283
259
|
parse(response)
|
|
284
260
|
success()
|
|
@@ -287,7 +263,6 @@ const localeListLanguages = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
287
263
|
return response;
|
|
288
264
|
}
|
|
289
265
|
|
|
290
|
-
|
|
291
266
|
locale
|
|
292
267
|
.command(`get`)
|
|
293
268
|
.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))`)
|
|
@@ -328,15 +303,14 @@ locale
|
|
|
328
303
|
.description(`List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.`)
|
|
329
304
|
.action(actionRunner(localeListLanguages))
|
|
330
305
|
|
|
331
|
-
|
|
332
306
|
module.exports = {
|
|
333
307
|
locale,
|
|
334
|
-
localeGet,
|
|
335
|
-
localeListCodes,
|
|
336
|
-
localeListContinents,
|
|
337
|
-
localeListCountries,
|
|
338
|
-
localeListCountriesEU,
|
|
339
|
-
localeListCountriesPhones,
|
|
340
|
-
localeListCurrencies,
|
|
341
|
-
localeListLanguages
|
|
308
|
+
localeGet,
|
|
309
|
+
localeListCodes,
|
|
310
|
+
localeListContinents,
|
|
311
|
+
localeListCountries,
|
|
312
|
+
localeListCountriesEU,
|
|
313
|
+
localeListCountriesPhones,
|
|
314
|
+
localeListCurrencies,
|
|
315
|
+
localeListLanguages
|
|
342
316
|
};
|