kourou 0.26.2 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -57
- package/lib/commands/sdk/execute.d.ts +1 -0
- package/lib/commands/sdk/execute.js +21 -7
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ $ npm install -g kourou
|
|
|
27
27
|
$ kourou COMMAND
|
|
28
28
|
running command...
|
|
29
29
|
$ kourou (-v|--version|version)
|
|
30
|
-
kourou/0.
|
|
30
|
+
kourou/0.27.1 darwin-arm64 node-v18.17.1
|
|
31
31
|
$ kourou --help [COMMAND]
|
|
32
32
|
USAGE
|
|
33
33
|
$ kourou COMMAND
|
|
@@ -211,7 +211,7 @@ EXAMPLE
|
|
|
211
211
|
kourou api-key:check eyJhbG...QxfQrc
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
_See code: [
|
|
214
|
+
_See code: [lib/commands/api-key/check.js](lib/commands/api-key/check.js)_
|
|
215
215
|
|
|
216
216
|
## `kourou api-key:create USER`
|
|
217
217
|
|
|
@@ -239,7 +239,7 @@ OPTIONS
|
|
|
239
239
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
240
240
|
```
|
|
241
241
|
|
|
242
|
-
_See code: [
|
|
242
|
+
_See code: [lib/commands/api-key/create.js](lib/commands/api-key/create.js)_
|
|
243
243
|
|
|
244
244
|
## `kourou api-key:delete USER ID`
|
|
245
245
|
|
|
@@ -268,7 +268,7 @@ EXAMPLE
|
|
|
268
268
|
kourou vault:delete sigfox-gateway 1k-BF3EBjsXdvA2PR8x
|
|
269
269
|
```
|
|
270
270
|
|
|
271
|
-
_See code: [
|
|
271
|
+
_See code: [lib/commands/api-key/delete.js](lib/commands/api-key/delete.js)_
|
|
272
272
|
|
|
273
273
|
## `kourou api-key:search USER`
|
|
274
274
|
|
|
@@ -294,7 +294,7 @@ OPTIONS
|
|
|
294
294
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
295
295
|
```
|
|
296
296
|
|
|
297
|
-
_See code: [
|
|
297
|
+
_See code: [lib/commands/api-key/search.js](lib/commands/api-key/search.js)_
|
|
298
298
|
|
|
299
299
|
## `kourou app:debug-proxy`
|
|
300
300
|
|
|
@@ -332,7 +332,7 @@ OPTIONS
|
|
|
332
332
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
333
333
|
```
|
|
334
334
|
|
|
335
|
-
_See code: [
|
|
335
|
+
_See code: [lib/commands/app/debug-proxy.js](lib/commands/app/debug-proxy.js)_
|
|
336
336
|
|
|
337
337
|
## `kourou app:doctor`
|
|
338
338
|
|
|
@@ -355,7 +355,7 @@ OPTIONS
|
|
|
355
355
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
356
356
|
```
|
|
357
357
|
|
|
358
|
-
_See code: [
|
|
358
|
+
_See code: [lib/commands/app/doctor.js](lib/commands/app/doctor.js)_
|
|
359
359
|
|
|
360
360
|
## `kourou app:scaffold DESTINATION`
|
|
361
361
|
|
|
@@ -373,7 +373,7 @@ OPTIONS
|
|
|
373
373
|
--help show CLI help
|
|
374
374
|
```
|
|
375
375
|
|
|
376
|
-
_See code: [
|
|
376
|
+
_See code: [lib/commands/app/scaffold.js](lib/commands/app/scaffold.js)_
|
|
377
377
|
|
|
378
378
|
## `kourou app:start-services`
|
|
379
379
|
|
|
@@ -388,7 +388,7 @@ OPTIONS
|
|
|
388
388
|
--help show CLI help
|
|
389
389
|
```
|
|
390
390
|
|
|
391
|
-
_See code: [
|
|
391
|
+
_See code: [lib/commands/app/start-services.js](lib/commands/app/start-services.js)_
|
|
392
392
|
|
|
393
393
|
## `kourou autocomplete [SHELL]`
|
|
394
394
|
|
|
@@ -438,7 +438,7 @@ OPTIONS
|
|
|
438
438
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
439
439
|
```
|
|
440
440
|
|
|
441
|
-
_See code: [
|
|
441
|
+
_See code: [lib/commands/collection/create.js](lib/commands/collection/create.js)_
|
|
442
442
|
|
|
443
443
|
## `kourou collection:export INDEX COLLECTION`
|
|
444
444
|
|
|
@@ -519,7 +519,7 @@ EXAMPLES
|
|
|
519
519
|
kourou collection:export nyc-open-data yellow-taxi --query '{ term: { city: "Saigon" } }'
|
|
520
520
|
```
|
|
521
521
|
|
|
522
|
-
_See code: [
|
|
522
|
+
_See code: [lib/commands/collection/export.js](lib/commands/collection/export.js)_
|
|
523
523
|
|
|
524
524
|
## `kourou collection:import PATH`
|
|
525
525
|
|
|
@@ -548,7 +548,7 @@ OPTIONS
|
|
|
548
548
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
549
549
|
```
|
|
550
550
|
|
|
551
|
-
_See code: [
|
|
551
|
+
_See code: [lib/commands/collection/import.js](lib/commands/collection/import.js)_
|
|
552
552
|
|
|
553
553
|
## `kourou collection:migrate SCRIPT PATH`
|
|
554
554
|
|
|
@@ -577,7 +577,7 @@ OPTIONS
|
|
|
577
577
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
578
578
|
```
|
|
579
579
|
|
|
580
|
-
_See code: [
|
|
580
|
+
_See code: [lib/commands/collection/migrate.js](lib/commands/collection/migrate.js)_
|
|
581
581
|
|
|
582
582
|
## `kourou config:diff FIRST SECOND`
|
|
583
583
|
|
|
@@ -599,7 +599,7 @@ EXAMPLE
|
|
|
599
599
|
kourou config:diff config/local/kuzzlerc config/production/kuzzlerc
|
|
600
600
|
```
|
|
601
601
|
|
|
602
|
-
_See code: [
|
|
602
|
+
_See code: [lib/commands/config/diff.js](lib/commands/config/diff.js)_
|
|
603
603
|
|
|
604
604
|
## `kourou document:search INDEX COLLECTION [QUERY]`
|
|
605
605
|
|
|
@@ -637,7 +637,7 @@ EXAMPLES
|
|
|
637
637
|
kourou document:search iot sensors --editor
|
|
638
638
|
```
|
|
639
639
|
|
|
640
|
-
_See code: [
|
|
640
|
+
_See code: [lib/commands/document/search.js](lib/commands/document/search.js)_
|
|
641
641
|
|
|
642
642
|
## `kourou es:aliases:cat`
|
|
643
643
|
|
|
@@ -653,7 +653,7 @@ OPTIONS
|
|
|
653
653
|
--help show CLI help
|
|
654
654
|
```
|
|
655
655
|
|
|
656
|
-
_See code: [
|
|
656
|
+
_See code: [lib/commands/es/aliases/cat.js](lib/commands/es/aliases/cat.js)_
|
|
657
657
|
|
|
658
658
|
## `kourou es:indices:cat`
|
|
659
659
|
|
|
@@ -669,7 +669,7 @@ OPTIONS
|
|
|
669
669
|
--help show CLI help
|
|
670
670
|
```
|
|
671
671
|
|
|
672
|
-
_See code: [
|
|
672
|
+
_See code: [lib/commands/es/indices/cat.js](lib/commands/es/indices/cat.js)_
|
|
673
673
|
|
|
674
674
|
## `kourou es:indices:get INDEX ID`
|
|
675
675
|
|
|
@@ -688,7 +688,7 @@ OPTIONS
|
|
|
688
688
|
--help show CLI help
|
|
689
689
|
```
|
|
690
690
|
|
|
691
|
-
_See code: [
|
|
691
|
+
_See code: [lib/commands/es/indices/get.js](lib/commands/es/indices/get.js)_
|
|
692
692
|
|
|
693
693
|
## `kourou es:indices:insert INDEX`
|
|
694
694
|
|
|
@@ -708,7 +708,7 @@ OPTIONS
|
|
|
708
708
|
--id=id Document ID
|
|
709
709
|
```
|
|
710
710
|
|
|
711
|
-
_See code: [
|
|
711
|
+
_See code: [lib/commands/es/indices/insert.js](lib/commands/es/indices/insert.js)_
|
|
712
712
|
|
|
713
713
|
## `kourou es:migrate`
|
|
714
714
|
|
|
@@ -735,7 +735,7 @@ EXAMPLES
|
|
|
735
735
|
kourou es:migrate --src ./my-backup --dest http://elasticsearch:9200 --reset --batch-size 2000 --no-interactive
|
|
736
736
|
```
|
|
737
737
|
|
|
738
|
-
_See code: [
|
|
738
|
+
_See code: [lib/commands/es/migrate.js](lib/commands/es/migrate.js)_
|
|
739
739
|
|
|
740
740
|
## `kourou es:snapshot:create REPOSITORY NAME`
|
|
741
741
|
|
|
@@ -754,7 +754,7 @@ OPTIONS
|
|
|
754
754
|
--help show CLI help
|
|
755
755
|
```
|
|
756
756
|
|
|
757
|
-
_See code: [
|
|
757
|
+
_See code: [lib/commands/es/snapshot/create.js](lib/commands/es/snapshot/create.js)_
|
|
758
758
|
|
|
759
759
|
## `kourou es:snapshot:create-repository REPOSITORY LOCATION`
|
|
760
760
|
|
|
@@ -774,7 +774,7 @@ OPTIONS
|
|
|
774
774
|
--help show CLI help
|
|
775
775
|
```
|
|
776
776
|
|
|
777
|
-
_See code: [
|
|
777
|
+
_See code: [lib/commands/es/snapshot/create-repository.js](lib/commands/es/snapshot/create-repository.js)_
|
|
778
778
|
|
|
779
779
|
## `kourou es:snapshot:list REPOSITORY`
|
|
780
780
|
|
|
@@ -792,7 +792,7 @@ OPTIONS
|
|
|
792
792
|
--help show CLI help
|
|
793
793
|
```
|
|
794
794
|
|
|
795
|
-
_See code: [
|
|
795
|
+
_See code: [lib/commands/es/snapshot/list.js](lib/commands/es/snapshot/list.js)_
|
|
796
796
|
|
|
797
797
|
## `kourou file:decrypt FILE`
|
|
798
798
|
|
|
@@ -815,7 +815,7 @@ EXAMPLES
|
|
|
815
815
|
kourou file:decrypt books/cryptonomicon.txt.enc -o books/cryptonomicon.txt --vault-key <vault-key>
|
|
816
816
|
```
|
|
817
817
|
|
|
818
|
-
_See code: [
|
|
818
|
+
_See code: [lib/commands/file/decrypt.js](lib/commands/file/decrypt.js)_
|
|
819
819
|
|
|
820
820
|
## `kourou file:encrypt FILE`
|
|
821
821
|
|
|
@@ -838,7 +838,7 @@ EXAMPLES
|
|
|
838
838
|
kourou file:encrypt books/cryptonomicon.txt -o books/cryptonomicon.txt.enc --vault-key <vault-key>
|
|
839
839
|
```
|
|
840
840
|
|
|
841
|
-
_See code: [
|
|
841
|
+
_See code: [lib/commands/file/encrypt.js](lib/commands/file/encrypt.js)_
|
|
842
842
|
|
|
843
843
|
## `kourou file:test FILE`
|
|
844
844
|
|
|
@@ -858,7 +858,7 @@ EXAMPLE
|
|
|
858
858
|
kourou file:test books/cryptonomicon.txt.enc --vault-key <vault-key>
|
|
859
859
|
```
|
|
860
860
|
|
|
861
|
-
_See code: [
|
|
861
|
+
_See code: [lib/commands/file/test.js](lib/commands/file/test.js)_
|
|
862
862
|
|
|
863
863
|
## `kourou help [COMMAND]`
|
|
864
864
|
|
|
@@ -902,7 +902,7 @@ OPTIONS
|
|
|
902
902
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
903
903
|
```
|
|
904
904
|
|
|
905
|
-
_See code: [
|
|
905
|
+
_See code: [lib/commands/import.js](lib/commands/import.js)_
|
|
906
906
|
|
|
907
907
|
## `kourou index:export INDEX`
|
|
908
908
|
|
|
@@ -952,7 +952,7 @@ EXAMPLES
|
|
|
952
952
|
kourou index:export nyc-open-data --query '{"range":{"_kuzzle_info.createdAt":{"gt":1632935638866}}}'
|
|
953
953
|
```
|
|
954
954
|
|
|
955
|
-
_See code: [
|
|
955
|
+
_See code: [lib/commands/index/export.js](lib/commands/index/export.js)_
|
|
956
956
|
|
|
957
957
|
## `kourou index:import PATH`
|
|
958
958
|
|
|
@@ -984,7 +984,7 @@ EXAMPLES
|
|
|
984
984
|
kourou index:import ./dump/iot-data --index iot-data-production --no-mappings
|
|
985
985
|
```
|
|
986
986
|
|
|
987
|
-
_See code: [
|
|
987
|
+
_See code: [lib/commands/index/import.js](lib/commands/index/import.js)_
|
|
988
988
|
|
|
989
989
|
## `kourou instance:kill`
|
|
990
990
|
|
|
@@ -999,7 +999,7 @@ OPTIONS
|
|
|
999
999
|
-i, --instance=instance Kuzzle instance name [ex: stack-0]
|
|
1000
1000
|
```
|
|
1001
1001
|
|
|
1002
|
-
_See code: [
|
|
1002
|
+
_See code: [lib/commands/instance/kill.js](lib/commands/instance/kill.js)_
|
|
1003
1003
|
|
|
1004
1004
|
## `kourou instance:list`
|
|
1005
1005
|
|
|
@@ -1010,7 +1010,7 @@ USAGE
|
|
|
1010
1010
|
$ kourou instance:list
|
|
1011
1011
|
```
|
|
1012
1012
|
|
|
1013
|
-
_See code: [
|
|
1013
|
+
_See code: [lib/commands/instance/list.js](lib/commands/instance/list.js)_
|
|
1014
1014
|
|
|
1015
1015
|
## `kourou instance:logs`
|
|
1016
1016
|
|
|
@@ -1025,7 +1025,7 @@ OPTIONS
|
|
|
1025
1025
|
-i, --instance=instance Kuzzle instance name
|
|
1026
1026
|
```
|
|
1027
1027
|
|
|
1028
|
-
_See code: [
|
|
1028
|
+
_See code: [lib/commands/instance/logs.js](lib/commands/instance/logs.js)_
|
|
1029
1029
|
|
|
1030
1030
|
## `kourou instance:spawn`
|
|
1031
1031
|
|
|
@@ -1041,7 +1041,7 @@ OPTIONS
|
|
|
1041
1041
|
--help show CLI help
|
|
1042
1042
|
```
|
|
1043
1043
|
|
|
1044
|
-
_See code: [
|
|
1044
|
+
_See code: [lib/commands/instance/spawn.js](lib/commands/instance/spawn.js)_
|
|
1045
1045
|
|
|
1046
1046
|
## `kourou paas:deploy ENVIRONMENT APPLICATIONID IMAGE`
|
|
1047
1047
|
|
|
@@ -1062,7 +1062,7 @@ OPTIONS
|
|
|
1062
1062
|
--token=token Authentication token
|
|
1063
1063
|
```
|
|
1064
1064
|
|
|
1065
|
-
_See code: [
|
|
1065
|
+
_See code: [lib/commands/paas/deploy.js](lib/commands/paas/deploy.js)_
|
|
1066
1066
|
|
|
1067
1067
|
## `kourou paas:init PROJECT`
|
|
1068
1068
|
|
|
@@ -1079,7 +1079,7 @@ OPTIONS
|
|
|
1079
1079
|
--help show CLI help
|
|
1080
1080
|
```
|
|
1081
1081
|
|
|
1082
|
-
_See code: [
|
|
1082
|
+
_See code: [lib/commands/paas/init.js](lib/commands/paas/init.js)_
|
|
1083
1083
|
|
|
1084
1084
|
## `kourou paas:login`
|
|
1085
1085
|
|
|
@@ -1096,7 +1096,7 @@ OPTIONS
|
|
|
1096
1096
|
--username=username PaaS username
|
|
1097
1097
|
```
|
|
1098
1098
|
|
|
1099
|
-
_See code: [
|
|
1099
|
+
_See code: [lib/commands/paas/login.js](lib/commands/paas/login.js)_
|
|
1100
1100
|
|
|
1101
1101
|
## `kourou paas:logs ENVIRONMENT APPLICATION`
|
|
1102
1102
|
|
|
@@ -1121,7 +1121,7 @@ OPTIONS
|
|
|
1121
1121
|
--until=until Display logs until a specific absolute (e.g. 2022/12/02 09:41) or relative (e.g. a minute ago) time
|
|
1122
1122
|
```
|
|
1123
1123
|
|
|
1124
|
-
_See code: [
|
|
1124
|
+
_See code: [lib/commands/paas/logs.js](lib/commands/paas/logs.js)_
|
|
1125
1125
|
|
|
1126
1126
|
## `kourou paas:snapshots:cat ENVIRONMENT APPLICATIONID`
|
|
1127
1127
|
|
|
@@ -1144,7 +1144,7 @@ EXAMPLE
|
|
|
1144
1144
|
kourou paas:snapshots:cat --project paas-project-myproject api main
|
|
1145
1145
|
```
|
|
1146
1146
|
|
|
1147
|
-
_See code: [
|
|
1147
|
+
_See code: [lib/commands/paas/snapshots/cat.js](lib/commands/paas/snapshots/cat.js)_
|
|
1148
1148
|
|
|
1149
1149
|
## `kourou paas:snapshots:dump ENVIRONMENT APPLICATIONID`
|
|
1150
1150
|
|
|
@@ -1167,7 +1167,7 @@ EXAMPLE
|
|
|
1167
1167
|
kourou paas:snapshots:dump --project paas-project-myproject api main
|
|
1168
1168
|
```
|
|
1169
1169
|
|
|
1170
|
-
_See code: [
|
|
1170
|
+
_See code: [lib/commands/paas/snapshots/dump.js](lib/commands/paas/snapshots/dump.js)_
|
|
1171
1171
|
|
|
1172
1172
|
## `kourou paas:snapshots:restore ENVIRONMENT APPLICATIONID SNAPSHOTID`
|
|
1173
1173
|
|
|
@@ -1191,7 +1191,7 @@ EXAMPLE
|
|
|
1191
1191
|
kourou paas:snapshots:restore --project paas-project-myproject api main snapshot-id
|
|
1192
1192
|
```
|
|
1193
1193
|
|
|
1194
|
-
_See code: [
|
|
1194
|
+
_See code: [lib/commands/paas/snapshots/restore.js](lib/commands/paas/snapshots/restore.js)_
|
|
1195
1195
|
|
|
1196
1196
|
## `kourou profile:export`
|
|
1197
1197
|
|
|
@@ -1214,7 +1214,7 @@ OPTIONS
|
|
|
1214
1214
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
1215
1215
|
```
|
|
1216
1216
|
|
|
1217
|
-
_See code: [
|
|
1217
|
+
_See code: [lib/commands/profile/export.js](lib/commands/profile/export.js)_
|
|
1218
1218
|
|
|
1219
1219
|
## `kourou profile:import PATH`
|
|
1220
1220
|
|
|
@@ -1239,7 +1239,7 @@ OPTIONS
|
|
|
1239
1239
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
1240
1240
|
```
|
|
1241
1241
|
|
|
1242
|
-
_See code: [
|
|
1242
|
+
_See code: [lib/commands/profile/import.js](lib/commands/profile/import.js)_
|
|
1243
1243
|
|
|
1244
1244
|
## `kourou realtime:subscribe INDEX COLLECTION [FILTERS]`
|
|
1245
1245
|
|
|
@@ -1291,7 +1291,7 @@ EXAMPLES
|
|
|
1291
1291
|
kourou realtime:subscribe iot-data sensors --display result._source.temperature
|
|
1292
1292
|
```
|
|
1293
1293
|
|
|
1294
|
-
_See code: [
|
|
1294
|
+
_See code: [lib/commands/realtime/subscribe.js](lib/commands/realtime/subscribe.js)_
|
|
1295
1295
|
|
|
1296
1296
|
## `kourou redis:list-keys [MATCH]`
|
|
1297
1297
|
|
|
@@ -1323,7 +1323,7 @@ EXAMPLES
|
|
|
1323
1323
|
kourou redis:list-keys "counters/*" --remove
|
|
1324
1324
|
```
|
|
1325
1325
|
|
|
1326
|
-
_See code: [
|
|
1326
|
+
_See code: [lib/commands/redis/list-keys.js](lib/commands/redis/list-keys.js)_
|
|
1327
1327
|
|
|
1328
1328
|
## `kourou role:export`
|
|
1329
1329
|
|
|
@@ -1346,7 +1346,7 @@ OPTIONS
|
|
|
1346
1346
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
1347
1347
|
```
|
|
1348
1348
|
|
|
1349
|
-
_See code: [
|
|
1349
|
+
_See code: [lib/commands/role/export.js](lib/commands/role/export.js)_
|
|
1350
1350
|
|
|
1351
1351
|
## `kourou role:import PATH`
|
|
1352
1352
|
|
|
@@ -1372,7 +1372,7 @@ OPTIONS
|
|
|
1372
1372
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
1373
1373
|
```
|
|
1374
1374
|
|
|
1375
|
-
_See code: [
|
|
1375
|
+
_See code: [lib/commands/role/import.js](lib/commands/role/import.js)_
|
|
1376
1376
|
|
|
1377
1377
|
## `kourou sdk:execute [CODE]`
|
|
1378
1378
|
|
|
@@ -1430,7 +1430,7 @@ DESCRIPTION
|
|
|
1430
1430
|
- kourou sdk:execute 'return await sdk.server.now()' --editor
|
|
1431
1431
|
```
|
|
1432
1432
|
|
|
1433
|
-
_See code: [
|
|
1433
|
+
_See code: [lib/commands/sdk/execute.js](lib/commands/sdk/execute.js)_
|
|
1434
1434
|
|
|
1435
1435
|
## `kourou sdk:query CONTROLLER:ACTION`
|
|
1436
1436
|
|
|
@@ -1531,7 +1531,7 @@ DESCRIPTION
|
|
|
1531
1531
|
- kourou admin:loadMappings < mappings.json
|
|
1532
1532
|
```
|
|
1533
1533
|
|
|
1534
|
-
_See code: [
|
|
1534
|
+
_See code: [lib/commands/sdk/query.js](lib/commands/sdk/query.js)_
|
|
1535
1535
|
|
|
1536
1536
|
## `kourou user:export`
|
|
1537
1537
|
|
|
@@ -1583,7 +1583,7 @@ DESCRIPTION
|
|
|
1583
1583
|
- kourou user:export --generate-credentials --generated-username content.email
|
|
1584
1584
|
```
|
|
1585
1585
|
|
|
1586
|
-
_See code: [
|
|
1586
|
+
_See code: [lib/commands/user/export.js](lib/commands/user/export.js)_
|
|
1587
1587
|
|
|
1588
1588
|
## `kourou user:export-mappings`
|
|
1589
1589
|
|
|
@@ -1606,7 +1606,7 @@ OPTIONS
|
|
|
1606
1606
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
1607
1607
|
```
|
|
1608
1608
|
|
|
1609
|
-
_See code: [
|
|
1609
|
+
_See code: [lib/commands/user/export-mappings.js](lib/commands/user/export-mappings.js)_
|
|
1610
1610
|
|
|
1611
1611
|
## `kourou user:import PATH`
|
|
1612
1612
|
|
|
@@ -1631,7 +1631,7 @@ OPTIONS
|
|
|
1631
1631
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
1632
1632
|
```
|
|
1633
1633
|
|
|
1634
|
-
_See code: [
|
|
1634
|
+
_See code: [lib/commands/user/import.js](lib/commands/user/import.js)_
|
|
1635
1635
|
|
|
1636
1636
|
## `kourou user:import-mappings PATH`
|
|
1637
1637
|
|
|
@@ -1656,7 +1656,7 @@ OPTIONS
|
|
|
1656
1656
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
1657
1657
|
```
|
|
1658
1658
|
|
|
1659
|
-
_See code: [
|
|
1659
|
+
_See code: [lib/commands/user/import-mappings.js](lib/commands/user/import-mappings.js)_
|
|
1660
1660
|
|
|
1661
1661
|
## `kourou vault:add SECRETS-FILE KEY VALUE`
|
|
1662
1662
|
|
|
@@ -1687,7 +1687,7 @@ EXAMPLE
|
|
|
1687
1687
|
kourou vault:add config/secrets.enc.json aws.s3.keyId b61e267676660c314b006b06 --vault-key <vault-key>
|
|
1688
1688
|
```
|
|
1689
1689
|
|
|
1690
|
-
_See code: [
|
|
1690
|
+
_See code: [lib/commands/vault/add.js](lib/commands/vault/add.js)_
|
|
1691
1691
|
|
|
1692
1692
|
## `kourou vault:decrypt FILE`
|
|
1693
1693
|
|
|
@@ -1717,7 +1717,7 @@ EXAMPLES
|
|
|
1717
1717
|
kourou vault:decrypt config/secrets.enc.json -o config/secrets.json --vault-key <vault-key>
|
|
1718
1718
|
```
|
|
1719
1719
|
|
|
1720
|
-
_See code: [
|
|
1720
|
+
_See code: [lib/commands/vault/decrypt.js](lib/commands/vault/decrypt.js)_
|
|
1721
1721
|
|
|
1722
1722
|
## `kourou vault:encrypt FILE`
|
|
1723
1723
|
|
|
@@ -1758,7 +1758,7 @@ EXAMPLES
|
|
|
1758
1758
|
kourou vault:encrypt config/secrets.json -o config/secrets_prod.enc.json --vault-key <vault-key>
|
|
1759
1759
|
```
|
|
1760
1760
|
|
|
1761
|
-
_See code: [
|
|
1761
|
+
_See code: [lib/commands/vault/encrypt.js](lib/commands/vault/encrypt.js)_
|
|
1762
1762
|
|
|
1763
1763
|
## `kourou vault:show SECRETS-FILE [KEY]`
|
|
1764
1764
|
|
|
@@ -1789,7 +1789,7 @@ EXAMPLES
|
|
|
1789
1789
|
kourou vault:show config/secrets.enc.json aws.s3.secretKey --vault-key <vault-key>
|
|
1790
1790
|
```
|
|
1791
1791
|
|
|
1792
|
-
_See code: [
|
|
1792
|
+
_See code: [lib/commands/vault/show.js](lib/commands/vault/show.js)_
|
|
1793
1793
|
|
|
1794
1794
|
## `kourou vault:test SECRETS-FILE`
|
|
1795
1795
|
|
|
@@ -1814,7 +1814,7 @@ EXAMPLE
|
|
|
1814
1814
|
kourou vault:test config/secrets.enc.json --vault-key <vault-key>
|
|
1815
1815
|
```
|
|
1816
1816
|
|
|
1817
|
-
_See code: [
|
|
1817
|
+
_See code: [lib/commands/vault/test.js](lib/commands/vault/test.js)_
|
|
1818
1818
|
<!-- commandsstop -->
|
|
1819
1819
|
|
|
1820
1820
|
# Where does this weird name come from?
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
3
4
|
const command_1 = require("@oclif/command");
|
|
4
5
|
const lodash_1 = require("lodash");
|
|
5
6
|
const editor_1 = require("../../support/editor");
|
|
6
7
|
const common_1 = require("../../common");
|
|
7
8
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
9
|
+
const typescript_1 = (0, tslib_1.__importDefault)(require("typescript"));
|
|
10
|
+
const node_vm_1 = (0, tslib_1.__importDefault)(require("node:vm"));
|
|
8
11
|
class SdkExecute extends common_1.Kommand {
|
|
9
12
|
constructor() {
|
|
10
13
|
super(...arguments);
|
|
@@ -12,25 +15,36 @@ class SdkExecute extends common_1.Kommand {
|
|
|
12
15
|
}
|
|
13
16
|
async beforeConnect() {
|
|
14
17
|
this.code = this.stdin || this.args.code || "// paste your code here";
|
|
18
|
+
try {
|
|
19
|
+
node_vm_1.default.runInContext(this.code, node_vm_1.default.createContext({}));
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
if (e.name === "SyntaxError") {
|
|
23
|
+
const result = typescript_1.default.transpileModule(this.code, { compilerOptions: { module: typescript_1.default.ModuleKind.CommonJS } });
|
|
24
|
+
this.code = result.outputText;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
15
27
|
if (this.haveSubscription) {
|
|
16
28
|
this.sdkOptions.protocol = "ws";
|
|
17
29
|
}
|
|
18
30
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
throw new Error("No code provided.");
|
|
22
|
-
}
|
|
23
|
-
let userError = null;
|
|
24
|
-
const variables = (this.flags.var || [])
|
|
31
|
+
getVariables() {
|
|
32
|
+
return (this.flags.var || [])
|
|
25
33
|
.map((nameValue) => {
|
|
26
34
|
const [name, value] = nameValue.split("=");
|
|
27
35
|
return ` let ${name} = ${value};`;
|
|
28
36
|
})
|
|
29
37
|
.join("\n");
|
|
38
|
+
}
|
|
39
|
+
async runSafe() {
|
|
40
|
+
if ((0, lodash_1.isEmpty)(this.code)) {
|
|
41
|
+
throw new Error("No code provided.");
|
|
42
|
+
}
|
|
43
|
+
let userError = null;
|
|
30
44
|
this.code = `
|
|
31
45
|
(async () => {
|
|
32
46
|
try {
|
|
33
|
-
${
|
|
47
|
+
${this.getVariables()}
|
|
34
48
|
${this.code}
|
|
35
49
|
}
|
|
36
50
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kourou",
|
|
3
3
|
"description": "The CLI that helps you manage your Kuzzle instances",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.27.1",
|
|
5
5
|
"author": "The Kuzzle Team <support@kuzzle.io>",
|
|
6
6
|
"bin": {
|
|
7
7
|
"kourou": "./bin/run"
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"tar": "^6.1.11",
|
|
43
43
|
"tmp": "^0.2.1",
|
|
44
44
|
"tslib": "^2.3.1",
|
|
45
|
+
"typescript": "4.4.*",
|
|
45
46
|
"ws": "^8.8.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
@@ -72,8 +73,7 @@
|
|
|
72
73
|
"prettier-eslint": "^12.0.0",
|
|
73
74
|
"should": "^13.2.3",
|
|
74
75
|
"source-map-support": "^0.5.19",
|
|
75
|
-
"ts-node": "10.9.*"
|
|
76
|
-
"typescript": "4.4.*"
|
|
76
|
+
"ts-node": "10.9.*"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": ">=10.0.0"
|