@apollo-annotation/cli 0.1.17 → 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.
Files changed (47) hide show
  1. package/README.md +120 -58
  2. package/bin/dev.js +2 -2
  3. package/bin/run.js +2 -2
  4. package/dist/ApolloConf.d.ts +22 -0
  5. package/dist/ApolloConf.js +144 -0
  6. package/dist/baseCommand.js +7 -17
  7. package/dist/commands/assembly/add-fasta.js +16 -27
  8. package/dist/commands/assembly/add-gff.js +11 -24
  9. package/dist/commands/assembly/check.js +7 -18
  10. package/dist/commands/assembly/delete.js +1 -1
  11. package/dist/commands/assembly/get.test.js +3 -3
  12. package/dist/commands/assembly/sequence.js +7 -21
  13. package/dist/commands/change/get.test.js +1 -1
  14. package/dist/commands/config.js +21 -53
  15. package/dist/commands/feature/add-child.js +21 -29
  16. package/dist/commands/feature/check.js +5 -5
  17. package/dist/commands/feature/copy.js +20 -32
  18. package/dist/commands/feature/delete.js +16 -31
  19. package/dist/commands/feature/edit-attribute.js +15 -10
  20. package/dist/commands/feature/edit-coords.js +39 -27
  21. package/dist/commands/feature/edit-type.js +5 -8
  22. package/dist/commands/feature/edit.js +3 -16
  23. package/dist/commands/feature/get-id.js +0 -1
  24. package/dist/commands/feature/get.js +6 -18
  25. package/dist/commands/feature/import.js +22 -41
  26. package/dist/commands/feature/search.js +1 -1
  27. package/dist/commands/login.js +17 -29
  28. package/dist/commands/logout.js +5 -14
  29. package/dist/commands/refseq/add-alias.d.ts +14 -0
  30. package/dist/commands/refseq/add-alias.js +72 -0
  31. package/dist/commands/status.js +5 -13
  32. package/dist/commands/user/get.test.js +1 -1
  33. package/dist/test/fixtures.js +2 -2
  34. package/dist/utils.d.ts +3 -3
  35. package/dist/utils.js +50 -25
  36. package/oclif.manifest.json +163 -102
  37. package/package.json +11 -3
  38. package/dist/Config.d.ts +0 -43
  39. package/dist/Config.js +0 -233
  40. package/dist/commands/config.test.d.ts +0 -1
  41. package/dist/commands/config.test.js +0 -188
  42. package/dist/commands/login.test.d.ts +0 -1
  43. package/dist/commands/login.test.js +0 -52
  44. package/dist/commands/logout.test.d.ts +0 -1
  45. package/dist/commands/logout.test.js +0 -67
  46. package/dist/commands/status.test.d.ts +0 -1
  47. package/dist/commands/status.test.js +0 -54
@@ -0,0 +1,72 @@
1
+ import * as fs from 'node:fs';
2
+ import { Agent, fetch } from 'undici';
3
+ import { Flags } from '@oclif/core';
4
+ import { BaseCommand } from '../../baseCommand.js';
5
+ import { createFetchErrorMessage, localhostToAddress, queryApollo, wrapLines, } from '../../utils.js';
6
+ import { ConfigError } from '../../ApolloConf.js';
7
+ export default class AddRefNameAlias extends BaseCommand {
8
+ static summary = 'Add reference name aliases from a file';
9
+ static description = wrapLines('Reference name aliasing is a process to make chromosomes that are named slightly differently but which refer to the same thing render properly. This command reads a file with reference name aliases and adds them to the database.');
10
+ static examples = [
11
+ {
12
+ description: 'Add reference name aliases:',
13
+ command: '<%= config.bin %> <%= command.id %> -i alias.txt -a myAssembly',
14
+ },
15
+ ];
16
+ static flags = {
17
+ 'input-file': Flags.string({
18
+ char: 'i',
19
+ description: 'Input refname alias file',
20
+ required: true,
21
+ }),
22
+ assembly: Flags.string({
23
+ char: 'a',
24
+ description: 'Name for this assembly.',
25
+ required: true,
26
+ }),
27
+ };
28
+ async run() {
29
+ const { flags } = await this.parse(AddRefNameAlias);
30
+ if (!fs.existsSync(flags['input-file'])) {
31
+ this.error(`File ${flags['input-file']} does not exist`);
32
+ }
33
+ const access = await this.getAccess(flags['config-file'], flags.profile);
34
+ const filehandle = await fs.promises.open(flags['input-file']);
35
+ const fileContent = await filehandle.readFile({ encoding: 'utf8' });
36
+ await filehandle.close();
37
+ const lines = fileContent.split('\n');
38
+ const refNameAliases = [];
39
+ for (const line of lines) {
40
+ const [refName, ...aliases] = line.split('\t');
41
+ refNameAliases.push({ refName, aliases });
42
+ }
43
+ const assemblies = await queryApollo(access.address, access.accessToken, 'assemblies');
44
+ const json = (await assemblies.json());
45
+ const assembly = json.find((x) => 'name' in x && x.name === flags.assembly);
46
+ const assemblyId = assembly && '_id' in assembly ? assembly._id : undefined;
47
+ if (!assemblyId) {
48
+ this.error(`Assembly ${flags.assembly} not found`);
49
+ }
50
+ const change = {
51
+ typeName: 'AddRefSeqAliasesChange',
52
+ assembly: assemblyId,
53
+ refSeqAliases: refNameAliases,
54
+ };
55
+ const auth = {
56
+ method: 'POST',
57
+ body: JSON.stringify(change),
58
+ headers: {
59
+ Authorization: `Bearer ${access.accessToken}`,
60
+ 'Content-Type': 'application/json',
61
+ },
62
+ dispatcher: new Agent({ headersTimeout: 60 * 60 * 1000 }),
63
+ };
64
+ const url = new URL(localhostToAddress(`${access.address}/changes`));
65
+ const response = await fetch(url, auth);
66
+ if (!response.ok) {
67
+ const errorMessage = await createFetchErrorMessage(response, 'Failed to add reference name aliases');
68
+ throw new ConfigError(errorMessage);
69
+ }
70
+ this.log(`Reference name aliases added successfully to assembly ${flags.assembly}`);
71
+ }
72
+ }
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
2
2
  import path from 'node:path';
3
+ import { ApolloConf, KEYS } from '../ApolloConf.js';
3
4
  import { BaseCommand } from '../baseCommand.js';
4
- import { Config, ConfigError, KEYS } from '../Config.js';
5
5
  import { basicCheckConfig, wrapLines } from '../utils.js';
6
6
  export default class Status extends BaseCommand {
7
7
  static summary = 'View authentication status';
@@ -15,19 +15,11 @@ export default class Status extends BaseCommand {
15
15
  }
16
16
  let configFile = flags['config-file'];
17
17
  if (configFile === undefined) {
18
- configFile = path.join(this.config.configDir, 'config.yaml');
18
+ configFile = path.join(this.config.configDir, 'config.yml');
19
19
  }
20
- try {
21
- basicCheckConfig(configFile, profileName);
22
- }
23
- catch (error) {
24
- if (error instanceof ConfigError) {
25
- this.logToStderr(error.message);
26
- this.exit(1);
27
- }
28
- }
29
- const config = new Config(configFile);
30
- const accessToken = config.get(KEYS.accessToken, profileName);
20
+ basicCheckConfig(configFile, profileName);
21
+ const config = new ApolloConf(configFile);
22
+ const accessToken = config.get(`${profileName}.${KEYS.accessToken}`);
31
23
  if (accessToken === undefined || accessToken.trim() === '') {
32
24
  this.log(`${profileName}: Logged out`);
33
25
  }
@@ -7,7 +7,7 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url));
7
7
  // TODO: Need valid token
8
8
  describe.skip('apollo user get: Get users 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);
@@ -4,8 +4,8 @@ import path from 'node:path';
4
4
  export const TEST_DATA_DIR = path.resolve('test_data');
5
5
  export const VERBOSE = false;
6
6
  export const CONFIG_DIR = path.join(os.homedir(), '.config', 'apollo-cli');
7
- export const CONFIG_FILE = path.join(CONFIG_DIR, 'config.yaml');
8
- const CONFIG_BAK = path.join(TEST_DATA_DIR, 'original.config.yaml.bak');
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
9
  function renameFile(src, dest, verbose = true) {
10
10
  if (fs.existsSync(dest)) {
11
11
  throw new Error(`File ${dest} already exists`);
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import EventEmitter from 'node:events';
2
2
  import { Response } from 'undici';
3
- import { Config } from './Config.js';
3
+ import { ApolloConf } from './ApolloConf.js';
4
4
  export declare const CLI_SERVER_ADDRESS = "http://127.0.0.1:5657";
5
5
  export declare const CLI_SERVER_ADDRESS_CALLBACK = "http://127.0.0.1:5657/auth/callback";
6
6
  export declare class CheckError extends Error {
@@ -10,7 +10,7 @@ export interface UserCredentials {
10
10
  }
11
11
  export declare function createFetchErrorMessage(response: Response, additionalText?: string): Promise<string>;
12
12
  export declare function checkConfigfileExists(configFile: string): void;
13
- export declare function checkProfileExists(profileName: string, config: Config): void;
13
+ export declare function checkProfileExists(profileName: string, config: ApolloConf): void;
14
14
  export declare function basicCheckConfig(configFile: string, profileName: string): void;
15
15
  /**
16
16
  * @deprecated Use this function while we wait to resolve the TypeError when using localhost in fetch.
@@ -48,7 +48,7 @@ interface bodyExternalFile {
48
48
  };
49
49
  }
50
50
  export declare function submitAssembly(address: string, accessToken: string, body: bodyLocalFile | bodyExternalFile, force: boolean): Promise<Response>;
51
- export declare function uploadFile(address: string, accessToken: string, file: string, type: string): Promise<string>;
51
+ export declare function uploadFile(address: string, accessToken: string, file: string, type: string): Promise<never>;
52
52
  export declare function wrapLines(s: string, length?: number): string;
53
53
  export declare function idReader(input: string[], removeDuplicates?: boolean): string[];
54
54
  export {};
package/dist/utils.js CHANGED
@@ -7,8 +7,10 @@ import * as crypto from 'node:crypto';
7
7
  import * as fs from 'node:fs';
8
8
  import * as os from 'node:os';
9
9
  import * as path from 'node:path';
10
- import { Agent, FormData, Response, fetch } from 'undici';
11
- import { Config, ConfigError } from './Config.js';
10
+ import { Transform, pipeline, } from 'node:stream';
11
+ import { SingleBar } from 'cli-progress';
12
+ import { Agent, fetch } from 'undici';
13
+ import { ApolloConf, ConfigError } from './ApolloConf.js';
12
14
  const CONFIG_PATH = path.resolve(os.homedir(), '.clirc');
13
15
  export const CLI_SERVER_ADDRESS = 'http://127.0.0.1:5657';
14
16
  export const CLI_SERVER_ADDRESS_CALLBACK = `${CLI_SERVER_ADDRESS}/auth/callback`;
@@ -37,7 +39,7 @@ export function checkProfileExists(profileName, config) {
37
39
  }
38
40
  export function basicCheckConfig(configFile, profileName) {
39
41
  checkConfigfileExists(configFile);
40
- const config = new Config(configFile);
42
+ const config = new ApolloConf(configFile);
41
43
  checkProfileExists(profileName, config);
42
44
  }
43
45
  /**
@@ -61,6 +63,7 @@ export async function deleteAssembly(address, accessToken, assemblyId) {
61
63
  Authorization: `Bearer ${accessToken}`,
62
64
  'Content-Type': 'application/json',
63
65
  },
66
+ dispatcher: new Agent({ headersTimeout: 60 * 60 * 1000 }),
64
67
  };
65
68
  const url = new URL(localhostToAddress(`${address}/changes`));
66
69
  const response = await fetch(url, auth);
@@ -78,7 +81,7 @@ export async function getAssembly(address, accessToken, assemblyNameOrId) {
78
81
  const assemblies = (await res.json());
79
82
  let assemblyObj = {};
80
83
  for (const x of assemblies) {
81
- if (x['_id'] === assemblyId[0]) {
84
+ if (x._id === assemblyId[0]) {
82
85
  assemblyObj = JSON.parse(JSON.stringify(x));
83
86
  break;
84
87
  }
@@ -128,11 +131,11 @@ export async function getRefseqId(address, accessToken, refseqNameOrId, inAssemb
128
131
  }
129
132
  async function checkNameToIdDict(address, accessToken) {
130
133
  const asm = await queryApollo(address, accessToken, 'checks/types');
131
- const ja = (await asm.json());
134
+ const ja = (await asm.json()); // Not sure if CheckResultSnapshot is the right interface
132
135
  const nameToId = {};
133
136
  for (const x of ja) {
134
- const name = x['name'];
135
- nameToId[name] = x['_id'];
137
+ const { _id, name } = x; // x['name' as keyof typeof x]
138
+ nameToId[name] = _id; // x['_id' as keyof typeof x]
136
139
  }
137
140
  return nameToId;
138
141
  }
@@ -267,10 +270,6 @@ export async function submitAssembly(address, accessToken, body, force) {
267
270
  }
268
271
  }
269
272
  }
270
- const controller = new AbortController();
271
- setTimeout(() => {
272
- controller.abort();
273
- }, 24 * 60 * 60 * 1000);
274
273
  const auth = {
275
274
  method: 'POST',
276
275
  body: JSON.stringify(body),
@@ -278,7 +277,7 @@ export async function submitAssembly(address, accessToken, body, force) {
278
277
  Authorization: `Bearer ${accessToken}`,
279
278
  'Content-Type': 'application/json',
280
279
  },
281
- signal: controller.signal,
280
+ dispatcher: new Agent({ headersTimeout: 60 * 60 * 1000 }),
282
281
  };
283
282
  const url = new URL(localhostToAddress(`${address}/changes`));
284
283
  const response = await fetch(url, auth);
@@ -288,27 +287,50 @@ export async function submitAssembly(address, accessToken, body, force) {
288
287
  }
289
288
  return response;
290
289
  }
290
+ class ProgressTransform extends Transform {
291
+ size = 0;
292
+ progressBar;
293
+ constructor(opts) {
294
+ super(opts);
295
+ this.progressBar = opts.progressBar;
296
+ }
297
+ _transform(chunk, _encoding, callback) {
298
+ this.size += chunk.length;
299
+ this.progressBar.update(this.size);
300
+ callback(null, chunk);
301
+ }
302
+ }
291
303
  export async function uploadFile(address, accessToken, file, type) {
292
- const stream = fs.createReadStream(file, 'utf8');
293
- const fileStream = new Response(stream);
294
- const fileBlob = await fileStream.blob();
295
- const formData = new FormData();
296
- formData.append('type', type);
297
- formData.append('file', fileBlob);
298
- const auth = {
304
+ const filehandle = await fs.promises.open(file);
305
+ const { size } = await filehandle.stat();
306
+ const stream = filehandle.createReadStream();
307
+ const progressBar = new SingleBar({ etaBuffer: 100_000_000 });
308
+ const progressTransform = new ProgressTransform({ progressBar });
309
+ const body = pipeline(stream, progressTransform, (error) => {
310
+ if (error) {
311
+ progressBar.stop();
312
+ console.error('Error processing file.', error);
313
+ throw error;
314
+ }
315
+ });
316
+ const init = {
299
317
  method: 'POST',
300
- body: formData,
318
+ body,
319
+ duplex: 'half',
301
320
  headers: {
302
321
  Authorization: `Bearer ${accessToken}`,
322
+ 'Content-Type': type,
323
+ 'Content-Length': String(size),
303
324
  },
304
- dispatcher: new Agent({
305
- keepAliveTimeout: 10 * 60 * 1000,
306
- keepAliveMaxTimeout: 10 * 60 * 1000, // 10 minutes
307
- }),
325
+ dispatcher: new Agent({ headersTimeout: 60 * 60 * 1000 }),
308
326
  };
327
+ const fileName = path.basename(file);
309
328
  const url = new URL(localhostToAddress(`${address}/files`));
329
+ url.searchParams.set('name', fileName);
330
+ url.searchParams.set('type', type);
331
+ progressBar.start(size, 0);
310
332
  try {
311
- const response = await fetch(url, auth);
333
+ const response = await fetch(url, init);
312
334
  if (!response.ok) {
313
335
  const errorMessage = await createFetchErrorMessage(response, 'uploadFile failed');
314
336
  throw new ConfigError(errorMessage);
@@ -320,6 +342,9 @@ export async function uploadFile(address, accessToken, file, type) {
320
342
  console.error(error);
321
343
  throw error;
322
344
  }
345
+ finally {
346
+ progressBar.stop();
347
+ }
323
348
  }
324
349
  /* Wrap text to max `length` per line */
325
350
  export function wrapLines(s, length) {
@@ -395,7 +395,7 @@
395
395
  "assembly:check": {
396
396
  "aliases": [],
397
397
  "args": {},
398
- "description": "Manage checks, i.e. the rules ensuring features in an assembly are plausible.\nThis command only sets the check to apply, to retrieve features flagged by these\nchecks use `apollo feature check`.",
398
+ "description": "Manage checks, i.e. the rules ensuring features in an assembly are plausible.\nThis command only sets the checks to apply, to retrieve features flagged by\nthese checks use `apollo feature check`.",
399
399
  "examples": [
400
400
  {
401
401
  "description": "View available check types:",
@@ -654,106 +654,6 @@
654
654
  "sequence.js"
655
655
  ]
656
656
  },
657
- "change:get": {
658
- "aliases": [],
659
- "args": {},
660
- "description": "Return the change log in json format. Note that when an assembly is deleted the\nlink between common name and ID is lost (it can still be recovered by inspecting\nthe change log but at present this task is left to the user). In such cases you\nneed to use the assembly ID.",
661
- "flags": {
662
- "profile": {
663
- "description": "Use credentials from this profile",
664
- "name": "profile",
665
- "hasDynamicHelp": false,
666
- "multiple": false,
667
- "type": "option"
668
- },
669
- "config-file": {
670
- "description": "Use this config file (mostly for testing)",
671
- "name": "config-file",
672
- "hasDynamicHelp": false,
673
- "multiple": false,
674
- "type": "option"
675
- },
676
- "assembly": {
677
- "char": "a",
678
- "description": "Get changes only for these assembly names or IDs (but see description)",
679
- "name": "assembly",
680
- "hasDynamicHelp": false,
681
- "multiple": true,
682
- "type": "option"
683
- }
684
- },
685
- "hasDynamicHelp": false,
686
- "hiddenAliases": [],
687
- "id": "change:get",
688
- "pluginAlias": "@apollo-annotation/cli",
689
- "pluginName": "@apollo-annotation/cli",
690
- "pluginType": "core",
691
- "strict": true,
692
- "summary": "Get list of changes",
693
- "enableJsonFlag": false,
694
- "isESM": true,
695
- "relativePath": [
696
- "dist",
697
- "commands",
698
- "change",
699
- "get.js"
700
- ]
701
- },
702
- "refseq:get": {
703
- "aliases": [],
704
- "args": {},
705
- "description": "Output the reference sequences in one or more assemblies in json format. This\ncommand returns the sequence characteristics (e.g., name, ID, etc), not the DNA\nsequences. Use `assembly sequence` for that.",
706
- "examples": [
707
- {
708
- "description": "All sequences in the database:",
709
- "command": "<%= config.bin %> <%= command.id %>"
710
- },
711
- {
712
- "description": "Only sequences for these assemblies:",
713
- "command": "<%= config.bin %> <%= command.id %> -a mm9 mm10"
714
- }
715
- ],
716
- "flags": {
717
- "profile": {
718
- "description": "Use credentials from this profile",
719
- "name": "profile",
720
- "hasDynamicHelp": false,
721
- "multiple": false,
722
- "type": "option"
723
- },
724
- "config-file": {
725
- "description": "Use this config file (mostly for testing)",
726
- "name": "config-file",
727
- "hasDynamicHelp": false,
728
- "multiple": false,
729
- "type": "option"
730
- },
731
- "assembly": {
732
- "char": "a",
733
- "description": "Get reference sequences for these assembly names or IDs; use - to read it from stdin",
734
- "name": "assembly",
735
- "hasDynamicHelp": false,
736
- "multiple": true,
737
- "type": "option"
738
- }
739
- },
740
- "hasDynamicHelp": false,
741
- "hiddenAliases": [],
742
- "id": "refseq:get",
743
- "pluginAlias": "@apollo-annotation/cli",
744
- "pluginName": "@apollo-annotation/cli",
745
- "pluginType": "core",
746
- "strict": true,
747
- "summary": "Get reference sequences",
748
- "enableJsonFlag": false,
749
- "isESM": true,
750
- "relativePath": [
751
- "dist",
752
- "commands",
753
- "refseq",
754
- "get.js"
755
- ]
756
- },
757
657
  "feature:add-child": {
758
658
  "aliases": [],
759
659
  "args": {},
@@ -1560,6 +1460,167 @@
1560
1460
  "search.js"
1561
1461
  ]
1562
1462
  },
1463
+ "change:get": {
1464
+ "aliases": [],
1465
+ "args": {},
1466
+ "description": "Return the change log in json format. Note that when an assembly is deleted the\nlink between common name and ID is lost (it can still be recovered by inspecting\nthe change log but at present this task is left to the user). In such cases you\nneed to use the assembly ID.",
1467
+ "flags": {
1468
+ "profile": {
1469
+ "description": "Use credentials from this profile",
1470
+ "name": "profile",
1471
+ "hasDynamicHelp": false,
1472
+ "multiple": false,
1473
+ "type": "option"
1474
+ },
1475
+ "config-file": {
1476
+ "description": "Use this config file (mostly for testing)",
1477
+ "name": "config-file",
1478
+ "hasDynamicHelp": false,
1479
+ "multiple": false,
1480
+ "type": "option"
1481
+ },
1482
+ "assembly": {
1483
+ "char": "a",
1484
+ "description": "Get changes only for these assembly names or IDs (but see description)",
1485
+ "name": "assembly",
1486
+ "hasDynamicHelp": false,
1487
+ "multiple": true,
1488
+ "type": "option"
1489
+ }
1490
+ },
1491
+ "hasDynamicHelp": false,
1492
+ "hiddenAliases": [],
1493
+ "id": "change:get",
1494
+ "pluginAlias": "@apollo-annotation/cli",
1495
+ "pluginName": "@apollo-annotation/cli",
1496
+ "pluginType": "core",
1497
+ "strict": true,
1498
+ "summary": "Get list of changes",
1499
+ "enableJsonFlag": false,
1500
+ "isESM": true,
1501
+ "relativePath": [
1502
+ "dist",
1503
+ "commands",
1504
+ "change",
1505
+ "get.js"
1506
+ ]
1507
+ },
1508
+ "refseq:add-alias": {
1509
+ "aliases": [],
1510
+ "args": {},
1511
+ "description": "Reference name aliasing is a process to make chromosomes that are named slightly\ndifferently but which refer to the same thing render properly. This command\nreads a file with reference name aliases and adds them to the database.",
1512
+ "examples": [
1513
+ {
1514
+ "description": "Add reference name aliases:",
1515
+ "command": "<%= config.bin %> <%= command.id %> -i alias.txt -a myAssembly"
1516
+ }
1517
+ ],
1518
+ "flags": {
1519
+ "profile": {
1520
+ "description": "Use credentials from this profile",
1521
+ "name": "profile",
1522
+ "hasDynamicHelp": false,
1523
+ "multiple": false,
1524
+ "type": "option"
1525
+ },
1526
+ "config-file": {
1527
+ "description": "Use this config file (mostly for testing)",
1528
+ "name": "config-file",
1529
+ "hasDynamicHelp": false,
1530
+ "multiple": false,
1531
+ "type": "option"
1532
+ },
1533
+ "input-file": {
1534
+ "char": "i",
1535
+ "description": "Input refname alias file",
1536
+ "name": "input-file",
1537
+ "required": true,
1538
+ "hasDynamicHelp": false,
1539
+ "multiple": false,
1540
+ "type": "option"
1541
+ },
1542
+ "assembly": {
1543
+ "char": "a",
1544
+ "description": "Name for this assembly.",
1545
+ "name": "assembly",
1546
+ "required": true,
1547
+ "hasDynamicHelp": false,
1548
+ "multiple": false,
1549
+ "type": "option"
1550
+ }
1551
+ },
1552
+ "hasDynamicHelp": false,
1553
+ "hiddenAliases": [],
1554
+ "id": "refseq:add-alias",
1555
+ "pluginAlias": "@apollo-annotation/cli",
1556
+ "pluginName": "@apollo-annotation/cli",
1557
+ "pluginType": "core",
1558
+ "strict": true,
1559
+ "summary": "Add reference name aliases from a file",
1560
+ "enableJsonFlag": false,
1561
+ "isESM": true,
1562
+ "relativePath": [
1563
+ "dist",
1564
+ "commands",
1565
+ "refseq",
1566
+ "add-alias.js"
1567
+ ]
1568
+ },
1569
+ "refseq:get": {
1570
+ "aliases": [],
1571
+ "args": {},
1572
+ "description": "Output the reference sequences in one or more assemblies in json format. This\ncommand returns the sequence characteristics (e.g., name, ID, etc), not the DNA\nsequences. Use `assembly sequence` for that.",
1573
+ "examples": [
1574
+ {
1575
+ "description": "All sequences in the database:",
1576
+ "command": "<%= config.bin %> <%= command.id %>"
1577
+ },
1578
+ {
1579
+ "description": "Only sequences for these assemblies:",
1580
+ "command": "<%= config.bin %> <%= command.id %> -a mm9 mm10"
1581
+ }
1582
+ ],
1583
+ "flags": {
1584
+ "profile": {
1585
+ "description": "Use credentials from this profile",
1586
+ "name": "profile",
1587
+ "hasDynamicHelp": false,
1588
+ "multiple": false,
1589
+ "type": "option"
1590
+ },
1591
+ "config-file": {
1592
+ "description": "Use this config file (mostly for testing)",
1593
+ "name": "config-file",
1594
+ "hasDynamicHelp": false,
1595
+ "multiple": false,
1596
+ "type": "option"
1597
+ },
1598
+ "assembly": {
1599
+ "char": "a",
1600
+ "description": "Get reference sequences for these assembly names or IDs; use - to read it from stdin",
1601
+ "name": "assembly",
1602
+ "hasDynamicHelp": false,
1603
+ "multiple": true,
1604
+ "type": "option"
1605
+ }
1606
+ },
1607
+ "hasDynamicHelp": false,
1608
+ "hiddenAliases": [],
1609
+ "id": "refseq:get",
1610
+ "pluginAlias": "@apollo-annotation/cli",
1611
+ "pluginName": "@apollo-annotation/cli",
1612
+ "pluginType": "core",
1613
+ "strict": true,
1614
+ "summary": "Get reference sequences",
1615
+ "enableJsonFlag": false,
1616
+ "isESM": true,
1617
+ "relativePath": [
1618
+ "dist",
1619
+ "commands",
1620
+ "refseq",
1621
+ "get.js"
1622
+ ]
1623
+ },
1563
1624
  "user:get": {
1564
1625
  "aliases": [],
1565
1626
  "args": {},
@@ -1628,5 +1689,5 @@
1628
1689
  ]
1629
1690
  }
1630
1691
  },
1631
- "version": "0.1.17"
1692
+ "version": "0.1.19"
1632
1693
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apollo-annotation/cli",
3
3
  "description": "Command line interface for the Apollo annotation server",
4
- "version": "0.1.17",
4
+ "version": "0.1.19",
5
5
  "author": "Apollo Team",
6
6
  "repository": {
7
7
  "type": "git",
@@ -28,7 +28,7 @@
28
28
  "dev": "tsx bin/dev.js",
29
29
  "postpack": "shx rm -f oclif.manifest.json",
30
30
  "posttest": "yarn lint",
31
- "prepack": "yarn build && oclif manifest && oclif readme",
31
+ "prepack": "yarn build && oclif manifest && oclif readme && prettier --write README.md",
32
32
  "prepare": "yarn build",
33
33
  "test": "mocha --require src/test/fixtures.ts 'src/**/*.test.ts'",
34
34
  "test:ci": "nyc mocha 'src/**/*.test.ts'",
@@ -41,6 +41,8 @@
41
41
  "@oclif/core": "^3.18.2",
42
42
  "@oclif/plugin-help": "^6.0.8",
43
43
  "bson": "^6.3.0",
44
+ "cli-progress": "^3.12.0",
45
+ "conf": "^12.0.0",
44
46
  "joi": "^17.7.0",
45
47
  "open": "^10.1.0",
46
48
  "tslib": "^2.3.1",
@@ -48,10 +50,13 @@
48
50
  "yaml": "^2.3.4"
49
51
  },
50
52
  "devDependencies": {
53
+ "@apollo-annotation/mst": "^0.1.19",
54
+ "@apollo-annotation/shared": "^0.1.19",
51
55
  "@istanbuljs/esm-loader-hook": "^0.2.0",
52
56
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
53
57
  "@oclif/test": "^3.1.3",
54
58
  "@types/chai": "^4",
59
+ "@types/cli-progress": "^3",
55
60
  "@types/inquirer": "^9.0.7",
56
61
  "@types/mocha": "^10",
57
62
  "@types/node": "^18.14.2",
@@ -59,10 +64,13 @@
59
64
  "mocha": "^10.2.0",
60
65
  "nyc": "^15.1.0",
61
66
  "oclif": "^4.4.2",
67
+ "prettier": "^3.3.2",
68
+ "react-dom": "^18.2.0",
69
+ "rxjs": "^7.4.0",
62
70
  "shx": "^0.3.3",
63
71
  "ts-node": "^10.3.0",
64
72
  "tsx": "^4.6.2",
65
- "typescript": "^5.1.6"
73
+ "typescript": "^5.5.3"
66
74
  },
67
75
  "oclif": {
68
76
  "helpOptions": {