@apollo-annotation/cli 0.1.18 → 0.1.19

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 CHANGED
@@ -1,56 +1,61 @@
1
1
  # Table of contents
2
2
 
3
3
  <!-- toc -->
4
- * [Table of contents](#table-of-contents)
5
- * [Usage](#usage)
6
- * [Commands](#commands)
4
+
5
+ - [Table of contents](#table-of-contents)
6
+ - [Usage](#usage)
7
+ - [Commands](#commands)
7
8
  <!-- tocstop -->
8
9
 
9
10
  # Usage
10
11
 
11
12
  <!-- usage -->
13
+
12
14
  ```sh-session
13
15
  $ npm install -g @apollo-annotation/cli
14
16
  $ apollo COMMAND
15
17
  running command...
16
18
  $ apollo (--version)
17
- @apollo-annotation/cli/0.1.18 linux-x64 node-v18.20.3
19
+ @apollo-annotation/cli/0.1.19 linux-x64 node-v20.14.0
18
20
  $ apollo --help [COMMAND]
19
21
  USAGE
20
22
  $ apollo COMMAND
21
23
  ...
22
24
  ```
25
+
23
26
  <!-- usagestop -->
24
27
 
25
28
  # Commands
26
29
 
27
30
  <!-- commands -->
28
- * [`apollo assembly add-fasta`](#apollo-assembly-add-fasta)
29
- * [`apollo assembly add-gff`](#apollo-assembly-add-gff)
30
- * [`apollo assembly check`](#apollo-assembly-check)
31
- * [`apollo assembly delete`](#apollo-assembly-delete)
32
- * [`apollo assembly get`](#apollo-assembly-get)
33
- * [`apollo assembly sequence`](#apollo-assembly-sequence)
34
- * [`apollo change get`](#apollo-change-get)
35
- * [`apollo config [KEY] [VALUE]`](#apollo-config-key-value)
36
- * [`apollo feature add-child`](#apollo-feature-add-child)
37
- * [`apollo feature check`](#apollo-feature-check)
38
- * [`apollo feature copy`](#apollo-feature-copy)
39
- * [`apollo feature delete`](#apollo-feature-delete)
40
- * [`apollo feature edit`](#apollo-feature-edit)
41
- * [`apollo feature edit-attribute`](#apollo-feature-edit-attribute)
42
- * [`apollo feature edit-coords`](#apollo-feature-edit-coords)
43
- * [`apollo feature edit-type`](#apollo-feature-edit-type)
44
- * [`apollo feature get`](#apollo-feature-get)
45
- * [`apollo feature get-id`](#apollo-feature-get-id)
46
- * [`apollo feature import`](#apollo-feature-import)
47
- * [`apollo feature search`](#apollo-feature-search)
48
- * [`apollo help [COMMANDS]`](#apollo-help-commands)
49
- * [`apollo login`](#apollo-login)
50
- * [`apollo logout`](#apollo-logout)
51
- * [`apollo refseq get`](#apollo-refseq-get)
52
- * [`apollo status`](#apollo-status)
53
- * [`apollo user get`](#apollo-user-get)
31
+
32
+ - [`apollo assembly add-fasta`](#apollo-assembly-add-fasta)
33
+ - [`apollo assembly add-gff`](#apollo-assembly-add-gff)
34
+ - [`apollo assembly check`](#apollo-assembly-check)
35
+ - [`apollo assembly delete`](#apollo-assembly-delete)
36
+ - [`apollo assembly get`](#apollo-assembly-get)
37
+ - [`apollo assembly sequence`](#apollo-assembly-sequence)
38
+ - [`apollo change get`](#apollo-change-get)
39
+ - [`apollo config [KEY] [VALUE]`](#apollo-config-key-value)
40
+ - [`apollo feature add-child`](#apollo-feature-add-child)
41
+ - [`apollo feature check`](#apollo-feature-check)
42
+ - [`apollo feature copy`](#apollo-feature-copy)
43
+ - [`apollo feature delete`](#apollo-feature-delete)
44
+ - [`apollo feature edit`](#apollo-feature-edit)
45
+ - [`apollo feature edit-attribute`](#apollo-feature-edit-attribute)
46
+ - [`apollo feature edit-coords`](#apollo-feature-edit-coords)
47
+ - [`apollo feature edit-type`](#apollo-feature-edit-type)
48
+ - [`apollo feature get`](#apollo-feature-get)
49
+ - [`apollo feature get-id`](#apollo-feature-get-id)
50
+ - [`apollo feature import`](#apollo-feature-import)
51
+ - [`apollo feature search`](#apollo-feature-search)
52
+ - [`apollo help [COMMANDS]`](#apollo-help-commands)
53
+ - [`apollo login`](#apollo-login)
54
+ - [`apollo logout`](#apollo-logout)
55
+ - [`apollo refseq add-alias`](#apollo-refseq-add-alias)
56
+ - [`apollo refseq get`](#apollo-refseq-get)
57
+ - [`apollo status`](#apollo-status)
58
+ - [`apollo user get`](#apollo-user-get)
54
59
 
55
60
  ## `apollo assembly add-fasta`
56
61
 
@@ -82,7 +87,8 @@ EXAMPLES
82
87
  $ apollo assembly add-fasta -i https://.../genome.fa -x https://.../genome.fa.fai -a myAssembly
83
88
  ```
84
89
 
85
- _See code: [src/commands/assembly/add-fasta.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/assembly/add-fasta.ts)_
90
+ _See code:
91
+ [src/commands/assembly/add-fasta.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/add-fasta.ts)_
86
92
 
87
93
  ## `apollo assembly add-gff`
88
94
 
@@ -116,7 +122,8 @@ EXAMPLES
116
122
  $ apollo assembly add-gff -i genome.gff -a myAssembly -o
117
123
  ```
118
124
 
119
- _See code: [src/commands/assembly/add-gff.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/assembly/add-gff.ts)_
125
+ _See code:
126
+ [src/commands/assembly/add-gff.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/add-gff.ts)_
120
127
 
121
128
  ## `apollo assembly check`
122
129
 
@@ -158,7 +165,8 @@ EXAMPLES
158
165
  $ apollo assembly check -a hg19 -c CDSCheck --delete
159
166
  ```
160
167
 
161
- _See code: [src/commands/assembly/check.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/assembly/check.ts)_
168
+ _See code:
169
+ [src/commands/assembly/check.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/check.ts)_
162
170
 
163
171
  ## `apollo assembly delete`
164
172
 
@@ -185,7 +193,8 @@ EXAMPLES
185
193
  $ apollo assembly delete -a mouse 6605826fbd0eee691f83e73f
186
194
  ```
187
195
 
188
- _See code: [src/commands/assembly/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/assembly/delete.ts)_
196
+ _See code:
197
+ [src/commands/assembly/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/delete.ts)_
189
198
 
190
199
  ## `apollo assembly get`
191
200
 
@@ -206,7 +215,8 @@ DESCRIPTION
206
215
  Print to stdout the list of assemblies in json format
207
216
  ```
208
217
 
209
- _See code: [src/commands/assembly/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/assembly/get.ts)_
218
+ _See code:
219
+ [src/commands/assembly/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/get.ts)_
210
220
 
211
221
  ## `apollo assembly sequence`
212
222
 
@@ -240,7 +250,8 @@ EXAMPLES
240
250
  $ apollo assembly sequence -a myAssembly -r chr1 -s 1 -e 1000
241
251
  ```
242
252
 
243
- _See code: [src/commands/assembly/sequence.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/assembly/sequence.ts)_
253
+ _See code:
254
+ [src/commands/assembly/sequence.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/assembly/sequence.ts)_
244
255
 
245
256
  ## `apollo change get`
246
257
 
@@ -264,7 +275,8 @@ DESCRIPTION
264
275
  need to use the assembly ID.
265
276
  ```
266
277
 
267
- _See code: [src/commands/change/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/change/get.ts)_
278
+ _See code:
279
+ [src/commands/change/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/change/get.ts)_
268
280
 
269
281
  ## `apollo config [KEY] [VALUE]`
270
282
 
@@ -319,7 +331,8 @@ EXAMPLES
319
331
  $ apollo config address
320
332
  ```
321
333
 
322
- _See code: [src/commands/config.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/config.ts)_
334
+ _See code:
335
+ [src/commands/config.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/config.ts)_
323
336
 
324
337
  ## `apollo feature add-child`
325
338
 
@@ -349,7 +362,8 @@ EXAMPLES
349
362
  $ apollo feature add-child -i 6605826fbd0eee691f83e73f -t exon -s 10 -e 20
350
363
  ```
351
364
 
352
- _See code: [src/commands/feature/add-child.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/feature/add-child.ts)_
365
+ _See code:
366
+ [src/commands/feature/add-child.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/add-child.ts)_
353
367
 
354
368
  ## `apollo feature check`
355
369
 
@@ -382,7 +396,8 @@ EXAMPLES
382
396
  $ apollo feature check -a hg19
383
397
  ```
384
398
 
385
- _See code: [src/commands/feature/check.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/feature/check.ts)_
399
+ _See code:
400
+ [src/commands/feature/check.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/check.ts)_
386
401
 
387
402
  ## `apollo feature copy`
388
403
 
@@ -413,7 +428,8 @@ EXAMPLES
413
428
  $ apollo feature copy -i 6605826fbd0eee691f83e73f -r chr1 -s 100 -a hg38
414
429
  ```
415
430
 
416
- _See code: [src/commands/feature/copy.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/feature/copy.ts)_
431
+ _See code:
432
+ [src/commands/feature/copy.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/copy.ts)_
417
433
 
418
434
  ## `apollo feature delete`
419
435
 
@@ -437,7 +453,8 @@ DESCRIPTION
437
453
  error unless you set -f/--force.
438
454
  ```
439
455
 
440
- _See code: [src/commands/feature/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/feature/delete.ts)_
456
+ _See code:
457
+ [src/commands/feature/delete.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/delete.ts)_
441
458
 
442
459
  ## `apollo feature edit`
443
460
 
@@ -479,7 +496,8 @@ EXAMPLES
479
496
  echo '{"typeName": ... "newType": "G_quartet"}' | apollo feature edit -j -
480
497
  ```
481
498
 
482
- _See code: [src/commands/feature/edit.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/feature/edit.ts)_
499
+ _See code:
500
+ [src/commands/feature/edit.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/edit.ts)_
483
501
 
484
502
  ## `apollo feature edit-attribute`
485
503
 
@@ -519,7 +537,8 @@ EXAMPLES
519
537
  $ apollo feature edit-attribute -i 66...3f -a domains -d
520
538
  ```
521
539
 
522
- _See code: [src/commands/feature/edit-attribute.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/feature/edit-attribute.ts)_
540
+ _See code:
541
+ [src/commands/feature/edit-attribute.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/edit-attribute.ts)_
523
542
 
524
543
  ## `apollo feature edit-coords`
525
544
 
@@ -553,7 +572,8 @@ EXAMPLES
553
572
  $ apollo feature edit-coords -i abc...xyz -e 2000
554
573
  ```
555
574
 
556
- _See code: [src/commands/feature/edit-coords.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/feature/edit-coords.ts)_
575
+ _See code:
576
+ [src/commands/feature/edit-coords.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/edit-coords.ts)_
557
577
 
558
578
  ## `apollo feature edit-type`
559
579
 
@@ -576,7 +596,8 @@ DESCRIPTION
576
596
  term although but the valifdity of the new term is not checked.
577
597
  ```
578
598
 
579
- _See code: [src/commands/feature/edit-type.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/feature/edit-type.ts)_
599
+ _See code:
600
+ [src/commands/feature/edit-type.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/edit-type.ts)_
580
601
 
581
602
  ## `apollo feature get`
582
603
 
@@ -609,7 +630,8 @@ EXAMPLES
609
630
  $ apollo feature get -a myAssembly -r chr1 -s 1 -e 1000
610
631
  ```
611
632
 
612
- _See code: [src/commands/feature/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/feature/get.ts)_
633
+ _See code:
634
+ [src/commands/feature/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/get.ts)_
613
635
 
614
636
  ## `apollo feature get-id`
615
637
 
@@ -638,7 +660,8 @@ EXAMPLES
638
660
  $ apollo feature get-id -i abc...zyz def...foo
639
661
  ```
640
662
 
641
- _See code: [src/commands/feature/get-id.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/feature/get-id.ts)_
663
+ _See code:
664
+ [src/commands/feature/get-id.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/get-id.ts)_
642
665
 
643
666
  ## `apollo feature import`
644
667
 
@@ -666,7 +689,8 @@ EXAMPLES
666
689
  $ apollo feature import -d -i features.gff3 -a myAssembly
667
690
  ```
668
691
 
669
- _See code: [src/commands/feature/import.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/feature/import.ts)_
692
+ _See code:
693
+ [src/commands/feature/import.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/import.ts)_
670
694
 
671
695
  ## `apollo feature search`
672
696
 
@@ -717,7 +741,8 @@ EXAMPLES
717
741
  $ apollo feature search -a mm9 mm10 -t bac
718
742
  ```
719
743
 
720
- _See code: [src/commands/feature/search.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/feature/search.ts)_
744
+ _See code:
745
+ [src/commands/feature/search.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/feature/search.ts)_
721
746
 
722
747
  ## `apollo help [COMMANDS]`
723
748
 
@@ -737,7 +762,8 @@ DESCRIPTION
737
762
  Display help for apollo.
738
763
  ```
739
764
 
740
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.8/src/commands/help.ts)_
765
+ _See code:
766
+ [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.8/src/commands/help.ts)_
741
767
 
742
768
  ## `apollo login`
743
769
 
@@ -777,7 +803,8 @@ EXAMPLES
777
803
  $ apollo login --profile my-profile
778
804
  ```
779
805
 
780
- _See code: [src/commands/login.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/login.ts)_
806
+ _See code:
807
+ [src/commands/login.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/login.ts)_
781
808
 
782
809
  ## `apollo logout`
783
810
 
@@ -806,7 +833,38 @@ EXAMPLES
806
833
  $ apollo logout --profile my-profile
807
834
  ```
808
835
 
809
- _See code: [src/commands/logout.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/logout.ts)_
836
+ _See code:
837
+ [src/commands/logout.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/logout.ts)_
838
+
839
+ ## `apollo refseq add-alias`
840
+
841
+ Add reference name aliases from a file
842
+
843
+ ```
844
+ USAGE
845
+ $ apollo refseq add-alias -i <value> -a <value> [--profile <value>] [--config-file <value>]
846
+
847
+ FLAGS
848
+ -a, --assembly=<value> (required) Name for this assembly.
849
+ -i, --input-file=<value> (required) Input refname alias file
850
+ --config-file=<value> Use this config file (mostly for testing)
851
+ --profile=<value> Use credentials from this profile
852
+
853
+ DESCRIPTION
854
+ Add reference name aliases from a file
855
+
856
+ Reference name aliasing is a process to make chromosomes that are named slightly
857
+ differently but which refer to the same thing render properly. This command
858
+ reads a file with reference name aliases and adds them to the database.
859
+
860
+ EXAMPLES
861
+ Add reference name aliases:
862
+
863
+ $ apollo refseq add-alias -i alias.txt -a myAssembly
864
+ ```
865
+
866
+ _See code:
867
+ [src/commands/refseq/add-alias.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/refseq/add-alias.ts)_
810
868
 
811
869
  ## `apollo refseq get`
812
870
 
@@ -838,7 +896,8 @@ EXAMPLES
838
896
  $ apollo refseq get -a mm9 mm10
839
897
  ```
840
898
 
841
- _See code: [src/commands/refseq/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/refseq/get.ts)_
899
+ _See code:
900
+ [src/commands/refseq/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/refseq/get.ts)_
842
901
 
843
902
  ## `apollo status`
844
903
 
@@ -860,7 +919,8 @@ DESCRIPTION
860
919
  not check the validity of the access token.
861
920
  ```
862
921
 
863
- _See code: [src/commands/status.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/status.ts)_
922
+ _See code:
923
+ [src/commands/status.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/status.ts)_
864
924
 
865
925
  ## `apollo user get`
866
926
 
@@ -895,5 +955,7 @@ EXAMPLES
895
955
  $ apollo user get | jq '.[] | select(.createdAt > "2024-03-18")'
896
956
  ```
897
957
 
898
- _See code: [src/commands/user/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.18/packages/apollo-cli/src/commands/user/get.ts)_
958
+ _See code:
959
+ [src/commands/user/get.ts](https://github.com/GMOD/Apollo3/blob/v0.1.19/packages/apollo-cli/src/commands/user/get.ts)_
960
+
899
961
  <!-- commandsstop -->
package/bin/dev.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  // eslint-disable-next-line node/shebang
4
4
  async function main() {
5
- const {execute} = await import('@oclif/core')
6
- await execute({development: true, dir: import.meta.url})
5
+ const { execute } = await import('@oclif/core')
6
+ await execute({ development: true, dir: import.meta.url })
7
7
  }
8
8
 
9
9
  await main()
package/bin/run.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  async function main() {
4
- const {execute} = await import('@oclif/core')
5
- await execute({dir: import.meta.url})
4
+ const { execute } = await import('@oclif/core')
5
+ await execute({ dir: import.meta.url })
6
6
  }
7
7
 
8
8
  await main()
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
1
2
  import fs from 'node:fs';
2
3
  import path from 'node:path';
3
4
  import Conf from 'conf';
@@ -26,7 +26,7 @@ export class BaseCommand extends Command {
26
26
  }
27
27
  getConfig(configFile) {
28
28
  if (configFile === undefined) {
29
- configFile = path.join(this.config.configDir, 'config.yaml');
29
+ configFile = path.join(this.config.configDir, 'config.yml');
30
30
  }
31
31
  checkConfigfileExists(configFile);
32
32
  const config = new ApolloConf(configFile);
@@ -40,8 +40,9 @@ export class BaseCommand extends Command {
40
40
  return config.getAccess(profileName);
41
41
  }
42
42
  async catch(err) {
43
- // add any custom logic to handle errors from the command
44
- // or simply return the parent class error handling
43
+ if (err.cause instanceof Error) {
44
+ console.error(err.cause);
45
+ }
45
46
  return super.catch(err);
46
47
  }
47
48
  async finally(_) {
@@ -73,7 +73,6 @@ export default class Get extends BaseCommand {
73
73
  const errorMessage = await createFetchErrorMessage(res, 'Submit assembly failed');
74
74
  throw new Error(errorMessage);
75
75
  }
76
- this.exit(0);
77
76
  }
78
77
  }
79
78
  function isValidHttpUrl(x) {
@@ -59,6 +59,5 @@ export default class AddGff extends BaseCommand {
59
59
  const errorMessage = await createFetchErrorMessage(res, 'getFeatureById failed');
60
60
  throw new Error(errorMessage);
61
61
  }
62
- this.exit(0);
63
62
  }
64
63
  }
@@ -7,7 +7,7 @@ import { CONFIG_FILE, TEST_DATA_DIR, VERBOSE, copyFile, } from '../../test/fixtu
7
7
  const __dirname = fileURLToPath(new URL('.', import.meta.url));
8
8
  describe.skip('apollo assembly get: Fail without token', () => {
9
9
  before(() => {
10
- copyFile(`${TEST_DATA_DIR}/guest.yaml`, CONFIG_FILE, VERBOSE);
10
+ copyFile(`${TEST_DATA_DIR}/guest.yml`, CONFIG_FILE, VERBOSE);
11
11
  });
12
12
  after(() => {
13
13
  fs.rmSync(CONFIG_FILE);
@@ -24,7 +24,7 @@ describe.skip('apollo assembly get: Fail without token', () => {
24
24
  // TODO: Need valid token
25
25
  describe.skip('apollo assembly get: Get assemblies as YAML string', () => {
26
26
  before(() => {
27
- copyFile(`${TEST_DATA_DIR}/complete_config.yaml`, CONFIG_FILE, VERBOSE);
27
+ copyFile(`${TEST_DATA_DIR}/complete_config.yml`, CONFIG_FILE, VERBOSE);
28
28
  });
29
29
  after(() => {
30
30
  fs.rmSync(CONFIG_FILE);
@@ -38,7 +38,7 @@ describe.skip('apollo assembly get: Get assemblies as YAML string', () => {
38
38
  });
39
39
  });
40
40
  describe.skip('apollo assembly get: Test nock', () => {
41
- const cmd = ['assembly:get', '--config-file', 'tmp.yaml'];
41
+ const cmd = ['assembly:get', '--config-file', 'tmp.yml'];
42
42
  test
43
43
  .stdout()
44
44
  .nock('http://127.0.0.1:3999', (api) => api.persist().get('/assemblies').reply(200, { stuff: 'foo' }))
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
2
- /* eslint-disable @typescript-eslint/restrict-template-expressions */
3
2
  import { Flags } from '@oclif/core';
4
- import { fetch } from 'undici';
3
+ import { Agent, fetch } from 'undici';
5
4
  import { BaseCommand } from '../../baseCommand.js';
6
5
  import { createFetchErrorMessage, getRefseqId, idReader, localhostToAddress, queryApollo, wrapLines, } from '../../utils.js';
7
6
  async function getSequence(address, accessToken, refSeq, start, end) {
@@ -13,15 +12,11 @@ async function getSequence(address, accessToken, refSeq, start, end) {
13
12
  });
14
13
  url.search = searchParams.toString();
15
14
  const uri = url.toString();
16
- const controller = new AbortController();
17
- setTimeout(() => {
18
- controller.abort();
19
- }, 24 * 60 * 60 * 1000);
20
15
  const auth = {
21
16
  headers: {
22
17
  authorization: `Bearer ${accessToken}`,
23
18
  },
24
- signal: controller.signal,
19
+ dispatcher: new Agent({ headersTimeout: 60 * 60 * 1000 }),
25
20
  };
26
21
  const response = await fetch(uri, auth);
27
22
  if (!response.ok) {
@@ -87,8 +82,8 @@ export default class ApolloCmd extends BaseCommand {
87
82
  const seq = new TextDecoder().decode(seqObj?.value);
88
83
  let header = '';
89
84
  for (const x of refSeqs) {
90
- if (x['_id'] === rid) {
91
- const rname = x['name'];
85
+ if (x._id === rid) {
86
+ const rname = x.name;
92
87
  header = `>${rname}:${flags.start}..${flags.start + seq.length - 1}`;
93
88
  break;
94
89
  }
@@ -96,7 +91,6 @@ export default class ApolloCmd extends BaseCommand {
96
91
  this.log(header);
97
92
  this.log(splitStringIntoChunks(seq, 80).join('\n'));
98
93
  }
99
- this.exit(0);
100
94
  }
101
95
  }
102
96
  function splitStringIntoChunks(input, chunkSize) {
@@ -7,7 +7,7 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url));
7
7
  // TODO: Need valid token
8
8
  describe.skip('apollo change get: Get changes as YAML string', () => {
9
9
  before(() => {
10
- copyFile(`${TEST_DATA_DIR}/complete_config.yaml`, CONFIG_FILE, VERBOSE);
10
+ copyFile(`${TEST_DATA_DIR}/complete_config.yml`, CONFIG_FILE, VERBOSE);
11
11
  });
12
12
  after(() => {
13
13
  fs.rmSync(CONFIG_FILE);
@@ -53,7 +53,7 @@ export default class ApolloConfig extends BaseCommand {
53
53
  let configFile = flags['config-file'];
54
54
  configFile =
55
55
  configFile === undefined
56
- ? path.join(this.config.configDir, 'config.yaml')
56
+ ? path.join(this.config.configDir, 'config.yml')
57
57
  : path.resolve(configFile);
58
58
  if (flags['get-config-file']) {
59
59
  this.log(configFile);
@@ -1,5 +1,3 @@
1
- /* eslint-disable @typescript-eslint/restrict-template-expressions */
2
- /* eslint-disable @typescript-eslint/restrict-plus-operands */
3
1
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
4
2
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
5
3
  import { Flags } from '@oclif/core';
@@ -63,17 +61,16 @@ export default class Get extends BaseCommand {
63
61
  const errorMessage = await createFetchErrorMessage(childRes, 'Add child failed');
64
62
  throw new Error(errorMessage);
65
63
  }
66
- this.exit(0);
67
64
  }
68
- async addChild(address, accessToken, parentFeature, start, end, type) {
69
- const pStart = parentFeature['start'];
70
- const pEnd = parentFeature['end'];
71
- if (start < pStart || end > pEnd) {
72
- this.error(`Error: Child feature coordinates (${start + 1}-${end}) cannot extend beyond parent coordinates (${pStart + 1}-${pEnd})`);
65
+ async addChild(address, accessToken, parentFeature, min, max, type) {
66
+ const pMin = parentFeature.min;
67
+ const pMax = parentFeature.max;
68
+ if (min < pMin || max > pMax) {
69
+ this.error(`Error: Child feature coordinates (${min + 1}-${max}) cannot extend beyond parent coordinates (${pMin + 1}-${pMax})`);
73
70
  }
74
71
  const res = await queryApollo(address, accessToken, 'refSeqs');
75
72
  const refSeqs = (await res.json());
76
- const refSeq = parentFeature['refSeq'];
73
+ const { refSeq } = parentFeature;
77
74
  let assembly = '';
78
75
  for (const x of refSeqs) {
79
76
  if (x['_id'] === refSeq) {
@@ -83,17 +80,18 @@ export default class Get extends BaseCommand {
83
80
  }
84
81
  const change = {
85
82
  typeName: 'AddFeatureChange',
86
- changedIds: [parentFeature['_id']],
83
+ // eslint-disable-next-line unicorn/consistent-destructuring
84
+ changedIds: [parentFeature._id],
87
85
  assembly,
88
86
  addedFeature: {
89
87
  _id: new ObjectId().toHexString(),
90
- gffId: '',
91
88
  refSeq,
92
- start,
93
- end,
89
+ min,
90
+ max,
94
91
  type,
95
92
  },
96
- parentFeatureId: parentFeature['_id'],
93
+ // eslint-disable-next-line unicorn/consistent-destructuring
94
+ parentFeatureId: parentFeature._id,
97
95
  };
98
96
  const url = new URL(localhostToAddress(`${address}/changes`));
99
97
  const auth = {
@@ -50,15 +50,15 @@ export default class Check extends BaseCommand {
50
50
  if (flags['feature-id'] === undefined) {
51
51
  keep = true;
52
52
  }
53
- else {
54
- for (const x of chk['ids']) {
55
- if (keepFeatures.has(x)) {
53
+ else if (chk.ids !== undefined) {
54
+ for (const x of chk.ids) {
55
+ if (x !== undefined && keepFeatures.has(x.toString())) {
56
56
  keep = true;
57
57
  break;
58
58
  }
59
59
  }
60
60
  }
61
- if (keep && refseqId.has(chk['refSeq'])) {
61
+ if (keep && refseqId.has(chk.refSeq)) {
62
62
  results.push(chk);
63
63
  }
64
64
  }
@@ -71,7 +71,7 @@ async function keepAssemblies(address, accessToken, assembly) {
71
71
  const res = await queryApollo(address, accessToken, 'assemblies');
72
72
  const asm = (await res.json());
73
73
  for (const x of asm) {
74
- keepAssembly.push(x['_id']);
74
+ keepAssembly.push(x._id);
75
75
  }
76
76
  }
77
77
  else {
@@ -60,11 +60,9 @@ export default class Copy extends BaseCommand {
60
60
  const errorMessage = await createFetchErrorMessage(rescopy, 'Copy feature failed');
61
61
  throw new Error(errorMessage);
62
62
  }
63
- this.exit(0);
64
63
  }
65
- async copyFeature(address, accessToken, feature, refseq, start, assembly, newId) {
66
- const featureLen = feature['end'] -
67
- feature['start'];
64
+ async copyFeature(address, accessToken, feature, refseq, min, assembly, newId) {
65
+ const featureLen = feature.max - feature.min;
68
66
  const change = {
69
67
  typeName: 'AddFeatureChange',
70
68
  changedIds: [newId],
@@ -72,12 +70,11 @@ export default class Copy extends BaseCommand {
72
70
  addedFeature: {
73
71
  _id: newId,
74
72
  refSeq: refseq,
75
- start: start - 1,
76
- end: start + featureLen - 1,
77
- type: feature['type'],
78
- attributes: feature['attributes'],
79
- discontinuousLocations: feature['discontinuousLocations'],
80
- strand: feature['strand'],
73
+ min: min - 1,
74
+ max: min + featureLen - 1,
75
+ type: feature.type,
76
+ attributes: feature.attributes,
77
+ strand: feature.strand,
81
78
  },
82
79
  copyFeature: true,
83
80
  allIds: [newId],