@apollo-annotation/cli 0.3.10 → 0.3.12
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 +98 -37
- package/dist/ApolloConf.d.ts +1 -0
- package/dist/ApolloConf.d.ts.map +1 -0
- package/dist/ApolloConf.js +1 -0
- package/dist/ApolloConf.js.map +1 -0
- package/dist/baseCommand.d.ts +1 -0
- package/dist/baseCommand.d.ts.map +1 -0
- package/dist/baseCommand.js +1 -0
- package/dist/baseCommand.js.map +1 -0
- package/dist/commands/assembly/add-from-fasta.d.ts +1 -0
- package/dist/commands/assembly/add-from-fasta.d.ts.map +1 -0
- package/dist/commands/assembly/add-from-fasta.js +2 -14
- package/dist/commands/assembly/add-from-fasta.js.map +1 -0
- package/dist/commands/assembly/add-from-gff.d.ts +2 -0
- package/dist/commands/assembly/add-from-gff.d.ts.map +1 -0
- package/dist/commands/assembly/add-from-gff.js +5 -0
- package/dist/commands/assembly/add-from-gff.js.map +1 -0
- package/dist/commands/assembly/check.d.ts +1 -0
- package/dist/commands/assembly/check.d.ts.map +1 -0
- package/dist/commands/assembly/check.js +1 -0
- package/dist/commands/assembly/check.js.map +1 -0
- package/dist/commands/assembly/delete.d.ts +1 -0
- package/dist/commands/assembly/delete.d.ts.map +1 -0
- package/dist/commands/assembly/delete.js +1 -0
- package/dist/commands/assembly/delete.js.map +1 -0
- package/dist/commands/assembly/get.d.ts +1 -0
- package/dist/commands/assembly/get.d.ts.map +1 -0
- package/dist/commands/assembly/get.js +1 -0
- package/dist/commands/assembly/get.js.map +1 -0
- package/dist/commands/assembly/sequence.d.ts +1 -0
- package/dist/commands/assembly/sequence.d.ts.map +1 -0
- package/dist/commands/assembly/sequence.js +1 -0
- package/dist/commands/assembly/sequence.js.map +1 -0
- package/dist/commands/change/get.d.ts +1 -0
- package/dist/commands/change/get.d.ts.map +1 -0
- package/dist/commands/change/get.js +1 -0
- package/dist/commands/change/get.js.map +1 -0
- package/dist/commands/config.d.ts +1 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +1 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/export/gff3.d.ts +1 -0
- package/dist/commands/export/gff3.d.ts.map +1 -0
- package/dist/commands/export/gff3.js +1 -0
- package/dist/commands/export/gff3.js.map +1 -0
- package/dist/commands/feature/add-child.d.ts +1 -0
- package/dist/commands/feature/add-child.d.ts.map +1 -0
- package/dist/commands/feature/add-child.js +1 -0
- package/dist/commands/feature/add-child.js.map +1 -0
- package/dist/commands/feature/add.d.ts +58 -0
- package/dist/commands/feature/add.d.ts.map +1 -0
- package/dist/commands/feature/add.js +324 -0
- package/dist/commands/feature/add.js.map +1 -0
- package/dist/commands/feature/check.d.ts +1 -0
- package/dist/commands/feature/check.d.ts.map +1 -0
- package/dist/commands/feature/check.js +1 -0
- package/dist/commands/feature/check.js.map +1 -0
- package/dist/commands/feature/copy.d.ts +1 -0
- package/dist/commands/feature/copy.d.ts.map +1 -0
- package/dist/commands/feature/copy.js +1 -0
- package/dist/commands/feature/copy.js.map +1 -0
- package/dist/commands/feature/delete.d.ts +1 -0
- package/dist/commands/feature/delete.d.ts.map +1 -0
- package/dist/commands/feature/delete.js +1 -0
- package/dist/commands/feature/delete.js.map +1 -0
- package/dist/commands/feature/edit-attribute.d.ts +1 -0
- package/dist/commands/feature/edit-attribute.d.ts.map +1 -0
- package/dist/commands/feature/edit-attribute.js +1 -0
- package/dist/commands/feature/edit-attribute.js.map +1 -0
- package/dist/commands/feature/edit-coords.d.ts +1 -0
- package/dist/commands/feature/edit-coords.d.ts.map +1 -0
- package/dist/commands/feature/edit-coords.js +1 -0
- package/dist/commands/feature/edit-coords.js.map +1 -0
- package/dist/commands/feature/edit-type.d.ts +1 -0
- package/dist/commands/feature/edit-type.d.ts.map +1 -0
- package/dist/commands/feature/edit-type.js +1 -0
- package/dist/commands/feature/edit-type.js.map +1 -0
- package/dist/commands/feature/edit.d.ts +1 -0
- package/dist/commands/feature/edit.d.ts.map +1 -0
- package/dist/commands/feature/edit.js +1 -0
- package/dist/commands/feature/edit.js.map +1 -0
- package/dist/commands/feature/get-id.d.ts +1 -0
- package/dist/commands/feature/get-id.d.ts.map +1 -0
- package/dist/commands/feature/get-id.js +1 -0
- package/dist/commands/feature/get-id.js.map +1 -0
- package/dist/commands/feature/get-indexed-id.d.ts +1 -0
- package/dist/commands/feature/get-indexed-id.d.ts.map +1 -0
- package/dist/commands/feature/get-indexed-id.js +1 -0
- package/dist/commands/feature/get-indexed-id.js.map +1 -0
- package/dist/commands/feature/get.d.ts +1 -0
- package/dist/commands/feature/get.d.ts.map +1 -0
- package/dist/commands/feature/get.js +1 -0
- package/dist/commands/feature/get.js.map +1 -0
- package/dist/commands/feature/import.d.ts +2 -0
- package/dist/commands/feature/import.d.ts.map +1 -0
- package/dist/commands/feature/import.js +18 -5
- package/dist/commands/feature/import.js.map +1 -0
- package/dist/commands/feature/search.d.ts +1 -0
- package/dist/commands/feature/search.d.ts.map +1 -0
- package/dist/commands/feature/search.js +1 -0
- package/dist/commands/feature/search.js.map +1 -0
- package/dist/commands/file/delete.d.ts +1 -0
- package/dist/commands/file/delete.d.ts.map +1 -0
- package/dist/commands/file/delete.js +1 -0
- package/dist/commands/file/delete.js.map +1 -0
- package/dist/commands/file/download.d.ts +1 -0
- package/dist/commands/file/download.d.ts.map +1 -0
- package/dist/commands/file/download.js +1 -0
- package/dist/commands/file/download.js.map +1 -0
- package/dist/commands/file/get.d.ts +1 -0
- package/dist/commands/file/get.d.ts.map +1 -0
- package/dist/commands/file/get.js +1 -0
- package/dist/commands/file/get.js.map +1 -0
- package/dist/commands/file/upload.d.ts +1 -0
- package/dist/commands/file/upload.d.ts.map +1 -0
- package/dist/commands/file/upload.js +1 -0
- package/dist/commands/file/upload.js.map +1 -0
- package/dist/commands/jbrowse/desktop.d.ts +1 -0
- package/dist/commands/jbrowse/desktop.d.ts.map +1 -0
- package/dist/commands/jbrowse/desktop.js +1 -0
- package/dist/commands/jbrowse/desktop.js.map +1 -0
- package/dist/commands/jbrowse/get-config.d.ts +1 -0
- package/dist/commands/jbrowse/get-config.d.ts.map +1 -0
- package/dist/commands/jbrowse/get-config.js +1 -0
- package/dist/commands/jbrowse/get-config.js.map +1 -0
- package/dist/commands/jbrowse/set-config.d.ts +1 -0
- package/dist/commands/jbrowse/set-config.d.ts.map +1 -0
- package/dist/commands/jbrowse/set-config.js +1 -0
- package/dist/commands/jbrowse/set-config.js.map +1 -0
- package/dist/commands/login.d.ts +1 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +1 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +1 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +1 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/refseq/add-alias.d.ts +1 -0
- package/dist/commands/refseq/add-alias.d.ts.map +1 -0
- package/dist/commands/refseq/add-alias.js +1 -0
- package/dist/commands/refseq/add-alias.js.map +1 -0
- package/dist/commands/refseq/get.d.ts +1 -0
- package/dist/commands/refseq/get.d.ts.map +1 -0
- package/dist/commands/refseq/get.js +1 -0
- package/dist/commands/refseq/get.js.map +1 -0
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +1 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/user/get.d.ts +1 -0
- package/dist/commands/user/get.d.ts.map +1 -0
- package/dist/commands/user/get.js +1 -0
- package/dist/commands/user/get.js.map +1 -0
- package/dist/fileCommand.d.ts +1 -0
- package/dist/fileCommand.d.ts.map +1 -0
- package/dist/fileCommand.js +1 -0
- package/dist/fileCommand.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/test/test.d.ts +1 -0
- package/dist/test/test.d.ts.map +1 -0
- package/dist/test/test.js +139 -0
- package/dist/test/test.js.map +1 -0
- package/dist/test/test_docker.d.ts +1 -0
- package/dist/test/test_docker.d.ts.map +1 -0
- package/dist/test/test_docker.js +1 -0
- package/dist/test/test_docker.js.map +1 -0
- package/dist/test/utils.d.ts +1 -0
- package/dist/test/utils.d.ts.map +1 -0
- package/dist/test/utils.js +1 -0
- package/dist/test/utils.js.map +1 -0
- package/dist/utils.d.ts +4 -2
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +14 -0
- package/dist/utils.js.map +1 -0
- package/oclif.manifest.json +153 -1
- package/package.json +7 -12
- package/dist/commands/assembly/get.test.d.ts +0 -1
- package/dist/commands/assembly/get.test.js +0 -50
- package/dist/commands/change/get.test.d.ts +0 -1
- package/dist/commands/change/get.test.js +0 -22
- package/dist/commands/user/get.test.d.ts +0 -1
- package/dist/commands/user/get.test.js +0 -23
- package/dist/test/fixtures.d.ts +0 -7
- package/dist/test/fixtures.js +0 -40
package/oclif.manifest.json
CHANGED
|
@@ -404,6 +404,12 @@
|
|
|
404
404
|
"name": "force",
|
|
405
405
|
"allowNo": false,
|
|
406
406
|
"type": "boolean"
|
|
407
|
+
},
|
|
408
|
+
"no-strict": {
|
|
409
|
+
"description": "If any feature lines in the GFF3 can't be processed, skip them instead of aborting the import",
|
|
410
|
+
"name": "no-strict",
|
|
411
|
+
"allowNo": false,
|
|
412
|
+
"type": "boolean"
|
|
407
413
|
}
|
|
408
414
|
},
|
|
409
415
|
"hasDynamicHelp": false,
|
|
@@ -862,6 +868,146 @@
|
|
|
862
868
|
"add-child.js"
|
|
863
869
|
]
|
|
864
870
|
},
|
|
871
|
+
"feature:add": {
|
|
872
|
+
"aliases": [],
|
|
873
|
+
"args": {
|
|
874
|
+
"feature-json": {
|
|
875
|
+
"description": "Inline JSON describing the feature(s) to add. Can also be provided via stdin.",
|
|
876
|
+
"name": "feature-json"
|
|
877
|
+
}
|
|
878
|
+
},
|
|
879
|
+
"description": "A single simple feature can be added using the --min, --max, etc. flags.\n\nTo add multiple features, features with more details, or features with children, you can pass in JSON via argument or stdin or use the --feature-json-file options.\n",
|
|
880
|
+
"examples": [
|
|
881
|
+
{
|
|
882
|
+
"description": "Add a single feature by specifying its location and type",
|
|
883
|
+
"command": "<%= config.bin %> <%= command.id %> --assembly hg19 --refSeq chr3 --min 1000 --max 5000 --type remark"
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
"description": "Add a single feature from inline JSON",
|
|
887
|
+
"command": "<%= config.bin %> <%= command.id %> '{\"assembly\":\"<assemblyNameOrId>\",\"refseq\":\"<refSeqNameOrId>\",\"min\":1,\"max\":100,\"type\":\"<featureType>\"}'"
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
"description": "Add mutilple features from stdin JSON",
|
|
891
|
+
"command": "echo '[{\"assembly\":\"<assemblyNameOrId>\",\"refseq\":\"<refSeqNameOrId>\",\"min\":1,\"max\":100,\"type\":\"<featureType>\"},{\"assembly\":\"<assemblyNameOrId>\",\"refseq\":\"<refSeqNameOrId>\",\"min\":101,\"max\":200,\"type\":\"<featureType>\"}]' | <%= config.bin %> <%= command.id %>"
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
"description": "Add a feature with children from inline JSON",
|
|
895
|
+
"command": "<%= config.bin %> <%= command.id %> '{\"assembly\":\"<assemblyNameOrId>\",\"refseq\":\"<refSeqNameOrId>\",\"min\":1,\"max\":100,\"type\":\"<featureType>\",\"children\":[{\"min\":1,\"max\":50,\"type\":\"<featureType>\"}]}'"
|
|
896
|
+
}
|
|
897
|
+
],
|
|
898
|
+
"flags": {
|
|
899
|
+
"profile": {
|
|
900
|
+
"description": "Use credentials from this profile",
|
|
901
|
+
"name": "profile",
|
|
902
|
+
"hasDynamicHelp": false,
|
|
903
|
+
"multiple": false,
|
|
904
|
+
"type": "option"
|
|
905
|
+
},
|
|
906
|
+
"config-file": {
|
|
907
|
+
"description": "Use this config file (mostly for testing)",
|
|
908
|
+
"name": "config-file",
|
|
909
|
+
"hasDynamicHelp": false,
|
|
910
|
+
"multiple": false,
|
|
911
|
+
"type": "option"
|
|
912
|
+
},
|
|
913
|
+
"assembly": {
|
|
914
|
+
"char": "a",
|
|
915
|
+
"description": "Name or ID of target assembly. Not required if refseq is unique in the database",
|
|
916
|
+
"name": "assembly",
|
|
917
|
+
"hasDynamicHelp": false,
|
|
918
|
+
"multiple": false,
|
|
919
|
+
"type": "option"
|
|
920
|
+
},
|
|
921
|
+
"refSeq": {
|
|
922
|
+
"char": "r",
|
|
923
|
+
"dependsOn": [
|
|
924
|
+
"min",
|
|
925
|
+
"max",
|
|
926
|
+
"type"
|
|
927
|
+
],
|
|
928
|
+
"description": "Name or ID of target reference sequence",
|
|
929
|
+
"exclusive": [
|
|
930
|
+
"feature-json-file"
|
|
931
|
+
],
|
|
932
|
+
"name": "refSeq",
|
|
933
|
+
"hasDynamicHelp": false,
|
|
934
|
+
"multiple": false,
|
|
935
|
+
"type": "option"
|
|
936
|
+
},
|
|
937
|
+
"min": {
|
|
938
|
+
"char": "s",
|
|
939
|
+
"dependsOn": [
|
|
940
|
+
"refSeq",
|
|
941
|
+
"max",
|
|
942
|
+
"type"
|
|
943
|
+
],
|
|
944
|
+
"description": "Start position in target reference sequence",
|
|
945
|
+
"exclusive": [
|
|
946
|
+
"feature-json-file"
|
|
947
|
+
],
|
|
948
|
+
"name": "min",
|
|
949
|
+
"hasDynamicHelp": false,
|
|
950
|
+
"multiple": false,
|
|
951
|
+
"type": "option"
|
|
952
|
+
},
|
|
953
|
+
"max": {
|
|
954
|
+
"char": "e",
|
|
955
|
+
"dependsOn": [
|
|
956
|
+
"refSeq",
|
|
957
|
+
"min",
|
|
958
|
+
"type"
|
|
959
|
+
],
|
|
960
|
+
"description": "End position in target reference sequence",
|
|
961
|
+
"exclusive": [
|
|
962
|
+
"feature-json-file"
|
|
963
|
+
],
|
|
964
|
+
"name": "max",
|
|
965
|
+
"hasDynamicHelp": false,
|
|
966
|
+
"multiple": false,
|
|
967
|
+
"type": "option"
|
|
968
|
+
},
|
|
969
|
+
"type": {
|
|
970
|
+
"char": "t",
|
|
971
|
+
"dependsOn": [
|
|
972
|
+
"refSeq",
|
|
973
|
+
"min",
|
|
974
|
+
"max"
|
|
975
|
+
],
|
|
976
|
+
"description": "Type of child feature",
|
|
977
|
+
"exclusive": [
|
|
978
|
+
"feature-json-file"
|
|
979
|
+
],
|
|
980
|
+
"name": "type",
|
|
981
|
+
"hasDynamicHelp": false,
|
|
982
|
+
"multiple": false,
|
|
983
|
+
"type": "option"
|
|
984
|
+
},
|
|
985
|
+
"feature-json-file": {
|
|
986
|
+
"char": "F",
|
|
987
|
+
"description": "File with JSON describing the feature(s) to add",
|
|
988
|
+
"name": "feature-json-file",
|
|
989
|
+
"hasDynamicHelp": false,
|
|
990
|
+
"multiple": false,
|
|
991
|
+
"type": "option"
|
|
992
|
+
}
|
|
993
|
+
},
|
|
994
|
+
"hasDynamicHelp": false,
|
|
995
|
+
"hiddenAliases": [],
|
|
996
|
+
"id": "feature:add",
|
|
997
|
+
"pluginAlias": "@apollo-annotation/cli",
|
|
998
|
+
"pluginName": "@apollo-annotation/cli",
|
|
999
|
+
"pluginType": "core",
|
|
1000
|
+
"strict": true,
|
|
1001
|
+
"summary": "Add one or more features to Apollo",
|
|
1002
|
+
"enableJsonFlag": false,
|
|
1003
|
+
"isESM": true,
|
|
1004
|
+
"relativePath": [
|
|
1005
|
+
"dist",
|
|
1006
|
+
"commands",
|
|
1007
|
+
"feature",
|
|
1008
|
+
"add.js"
|
|
1009
|
+
]
|
|
1010
|
+
},
|
|
865
1011
|
"feature:check": {
|
|
866
1012
|
"aliases": [],
|
|
867
1013
|
"args": {},
|
|
@@ -1570,6 +1716,12 @@
|
|
|
1570
1716
|
"name": "delete-existing",
|
|
1571
1717
|
"allowNo": false,
|
|
1572
1718
|
"type": "boolean"
|
|
1719
|
+
},
|
|
1720
|
+
"no-strict": {
|
|
1721
|
+
"description": "If any lines in the GFF3 can't be processed, skip them instead of aborting the import",
|
|
1722
|
+
"name": "no-strict",
|
|
1723
|
+
"allowNo": false,
|
|
1724
|
+
"type": "boolean"
|
|
1573
1725
|
}
|
|
1574
1726
|
},
|
|
1575
1727
|
"hasDynamicHelp": false,
|
|
@@ -2259,5 +2411,5 @@
|
|
|
2259
2411
|
]
|
|
2260
2412
|
}
|
|
2261
2413
|
},
|
|
2262
|
-
"version": "0.3.
|
|
2414
|
+
"version": "0.3.12"
|
|
2263
2415
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apollo-annotation/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"description": "Command line interface for the Apollo annotation server",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"author": "Apollo Team",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"exports": "./dist/index.js",
|
|
13
|
-
"main": "",
|
|
14
13
|
"types": "dist/index.d.ts",
|
|
15
14
|
"bin": {
|
|
16
15
|
"apollo": "./bin/run.js"
|
|
@@ -26,10 +25,8 @@
|
|
|
26
25
|
"prepack": "yarn build && oclif manifest && oclif readme && prettier --write README.md",
|
|
27
26
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
28
27
|
"prepare": "yarn build",
|
|
29
|
-
"test": "
|
|
30
|
-
"
|
|
31
|
-
"test:ci": "nyc mocha 'src/**/*.test.ts'",
|
|
32
|
-
"test:cli": "yarn tsx src/test/test.ts",
|
|
28
|
+
"test": "yarn tsx src/test/test.ts",
|
|
29
|
+
"test:ci": "yarn tsx src/test/test.ts",
|
|
33
30
|
"version": "oclif readme --multi --dir ../website/docs/03-guides/04-cli/ && oclif readme && git add README.md"
|
|
34
31
|
},
|
|
35
32
|
"oclif": {
|
|
@@ -89,8 +86,8 @@
|
|
|
89
86
|
"yaml": "^2.3.4"
|
|
90
87
|
},
|
|
91
88
|
"devDependencies": {
|
|
92
|
-
"@apollo-annotation/mst": "^0.3.
|
|
93
|
-
"@apollo-annotation/shared": "^0.3.
|
|
89
|
+
"@apollo-annotation/mst": "^0.3.12",
|
|
90
|
+
"@apollo-annotation/shared": "^0.3.12",
|
|
94
91
|
"@istanbuljs/esm-loader-hook": "^0.2.0",
|
|
95
92
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
96
93
|
"@oclif/test": "^3.1.3",
|
|
@@ -98,11 +95,9 @@
|
|
|
98
95
|
"@types/cli-progress": "^3",
|
|
99
96
|
"@types/cross-spawn": "^6.0.6",
|
|
100
97
|
"@types/inquirer": "^9.0.7",
|
|
101
|
-
"@types/
|
|
102
|
-
"@types/node": "^20.19.15",
|
|
98
|
+
"@types/node": "^24.10.9",
|
|
103
99
|
"babel-plugin-istanbul": "^6.1.1",
|
|
104
100
|
"cross-spawn": "^7.0.3",
|
|
105
|
-
"mocha": "^10.2.0",
|
|
106
101
|
"mongodb": "^4.7.0",
|
|
107
102
|
"nyc": "^15.1.0",
|
|
108
103
|
"oclif": "^4.4.2",
|
|
@@ -116,7 +111,7 @@
|
|
|
116
111
|
"typescript": "^5.5.3"
|
|
117
112
|
},
|
|
118
113
|
"engines": {
|
|
119
|
-
"node": ">=
|
|
114
|
+
"node": ">=20.0.0"
|
|
120
115
|
},
|
|
121
116
|
"publishConfig": {
|
|
122
117
|
"access": "public"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { expect, test } from '@oclif/test';
|
|
5
|
-
import { CONFIG_FILE, TEST_DATA_DIR, VERBOSE, copyFile, } from '../../test/fixtures.js';
|
|
6
|
-
// import nock from 'nock'
|
|
7
|
-
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
8
|
-
describe.skip('apollo assembly get: Fail without token', () => {
|
|
9
|
-
before(() => {
|
|
10
|
-
copyFile(`${TEST_DATA_DIR}/guest.yml`, CONFIG_FILE, VERBOSE);
|
|
11
|
-
});
|
|
12
|
-
after(() => {
|
|
13
|
-
fs.rmSync(CONFIG_FILE);
|
|
14
|
-
});
|
|
15
|
-
const cmd = ['assembly:get'];
|
|
16
|
-
test
|
|
17
|
-
.stderr()
|
|
18
|
-
.command(cmd, { root: path.dirname(path.dirname(__dirname)) })
|
|
19
|
-
.exit(1)
|
|
20
|
-
.do((output) => expect(output.stderr).to.contain('Profile "default" has no access token'))
|
|
21
|
-
.do((output) => expect(output.stderr).to.not.contain(' at async ')) // Don't print error stack
|
|
22
|
-
.it(cmd.join(' '));
|
|
23
|
-
});
|
|
24
|
-
// TODO: Need valid token
|
|
25
|
-
describe.skip('apollo assembly get: Get assemblies as YAML string', () => {
|
|
26
|
-
before(() => {
|
|
27
|
-
copyFile(`${TEST_DATA_DIR}/complete_config.yml`, CONFIG_FILE, VERBOSE);
|
|
28
|
-
});
|
|
29
|
-
after(() => {
|
|
30
|
-
fs.rmSync(CONFIG_FILE);
|
|
31
|
-
});
|
|
32
|
-
const cmd = ['assembly:get'];
|
|
33
|
-
test
|
|
34
|
-
.stdout()
|
|
35
|
-
.command(cmd, { root: path.dirname(path.dirname(__dirname)) })
|
|
36
|
-
.it(cmd.join(' '), (output) => {
|
|
37
|
-
JSON.parse(output.stdout);
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
describe.skip('apollo assembly get: Test nock', () => {
|
|
41
|
-
const cmd = ['assembly:get', '--config-file', 'tmp.yml'];
|
|
42
|
-
test
|
|
43
|
-
.stdout()
|
|
44
|
-
.nock('http://127.0.0.1:3999', (api) => api.persist().get('/assemblies').reply(200, { stuff: 'foo' }))
|
|
45
|
-
.command(cmd, { root: path.dirname(path.dirname(__dirname)) })
|
|
46
|
-
.it(cmd.join(' '), (output) => {
|
|
47
|
-
console.error(output.stdout);
|
|
48
|
-
// const out = JSON.parse(output.stdout)
|
|
49
|
-
});
|
|
50
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { test } from '@oclif/test';
|
|
5
|
-
import { CONFIG_FILE, TEST_DATA_DIR, VERBOSE, copyFile, } from '../../test/fixtures.js';
|
|
6
|
-
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
7
|
-
// TODO: Need valid token
|
|
8
|
-
describe.skip('apollo change get: Get changes as YAML string', () => {
|
|
9
|
-
before(() => {
|
|
10
|
-
copyFile(`${TEST_DATA_DIR}/complete_config.yml`, CONFIG_FILE, VERBOSE);
|
|
11
|
-
});
|
|
12
|
-
after(() => {
|
|
13
|
-
fs.rmSync(CONFIG_FILE);
|
|
14
|
-
});
|
|
15
|
-
const cmd = ['change:get'];
|
|
16
|
-
test
|
|
17
|
-
.stdout()
|
|
18
|
-
.command(cmd, { root: path.dirname(path.dirname(__dirname)) })
|
|
19
|
-
.it(cmd.join(' '), (output) => {
|
|
20
|
-
JSON.parse(output.stdout);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { expect, test } from '@oclif/test';
|
|
5
|
-
import { CONFIG_FILE, TEST_DATA_DIR, VERBOSE, copyFile, } from '../../test/fixtures.js';
|
|
6
|
-
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
7
|
-
// TODO: Need valid token
|
|
8
|
-
describe.skip('apollo user get: Get users as YAML string', () => {
|
|
9
|
-
before(() => {
|
|
10
|
-
copyFile(`${TEST_DATA_DIR}/complete_config.yml`, CONFIG_FILE, VERBOSE);
|
|
11
|
-
});
|
|
12
|
-
after(() => {
|
|
13
|
-
fs.rmSync(CONFIG_FILE);
|
|
14
|
-
});
|
|
15
|
-
const cmd = ['user:get'];
|
|
16
|
-
test
|
|
17
|
-
.stdout()
|
|
18
|
-
.command(cmd, { root: path.dirname(path.dirname(__dirname)) })
|
|
19
|
-
.it(cmd.join(' '), (output) => {
|
|
20
|
-
const str = JSON.stringify(JSON.parse(output.stdout));
|
|
21
|
-
expect(str).contain('username');
|
|
22
|
-
});
|
|
23
|
-
});
|
package/dist/test/fixtures.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const TEST_DATA_DIR: string;
|
|
2
|
-
export declare const VERBOSE = false;
|
|
3
|
-
export declare const CONFIG_DIR: string;
|
|
4
|
-
export declare const CONFIG_FILE: string;
|
|
5
|
-
export declare function copyFile(src: string, dest: string, verbose: boolean): void;
|
|
6
|
-
export declare function mochaGlobalSetup(): void;
|
|
7
|
-
export declare function mochaGlobalTeardown(): void;
|
package/dist/test/fixtures.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import os from 'node:os';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
export const TEST_DATA_DIR = path.resolve('test_data');
|
|
5
|
-
export const VERBOSE = false;
|
|
6
|
-
export const CONFIG_DIR = path.join(os.homedir(), '.config', 'apollo-cli');
|
|
7
|
-
export const CONFIG_FILE = path.join(CONFIG_DIR, 'config.yml');
|
|
8
|
-
const CONFIG_BAK = path.join(TEST_DATA_DIR, 'original.config.yml.bak');
|
|
9
|
-
function renameFile(src, dest, verbose = true) {
|
|
10
|
-
if (fs.existsSync(dest)) {
|
|
11
|
-
throw new Error(`File ${dest} already exists`);
|
|
12
|
-
}
|
|
13
|
-
let msg = '';
|
|
14
|
-
if (fs.existsSync(src)) {
|
|
15
|
-
fs.renameSync(src, dest);
|
|
16
|
-
msg = `mv ${src} ${dest}`;
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
msg = `${src} does not exist`;
|
|
20
|
-
}
|
|
21
|
-
if (verbose) {
|
|
22
|
-
process.stdout.write(`${msg}\n`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export function copyFile(src, dest, verbose) {
|
|
26
|
-
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
27
|
-
fs.copyFileSync(src, dest);
|
|
28
|
-
if (verbose) {
|
|
29
|
-
const msg = `cp ${src} ${dest}`;
|
|
30
|
-
process.stdout.write(`${msg} # Copied: ${fs.existsSync(dest)}\n`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export function mochaGlobalSetup() {
|
|
34
|
-
process.stdout.write(`Temporarily remove config file ${CONFIG_FILE} if any`);
|
|
35
|
-
renameFile(CONFIG_FILE, CONFIG_BAK, VERBOSE);
|
|
36
|
-
}
|
|
37
|
-
export function mochaGlobalTeardown() {
|
|
38
|
-
process.stdout.write(`Putting back config file ${CONFIG_FILE} if any\n`);
|
|
39
|
-
renameFile(CONFIG_BAK, CONFIG_FILE, VERBOSE);
|
|
40
|
-
}
|