@apollo-annotation/cli 0.1.17 → 0.1.18

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 (36) hide show
  1. package/README.md +28 -28
  2. package/dist/ApolloConf.d.ts +22 -0
  3. package/dist/ApolloConf.js +143 -0
  4. package/dist/baseCommand.js +3 -14
  5. package/dist/commands/assembly/add-fasta.js +16 -26
  6. package/dist/commands/assembly/add-gff.js +11 -23
  7. package/dist/commands/assembly/check.js +7 -18
  8. package/dist/commands/assembly/delete.js +1 -1
  9. package/dist/commands/assembly/sequence.js +3 -11
  10. package/dist/commands/config.js +20 -52
  11. package/dist/commands/feature/add-child.js +10 -16
  12. package/dist/commands/feature/copy.js +13 -22
  13. package/dist/commands/feature/delete.js +7 -16
  14. package/dist/commands/feature/edit-attribute.js +3 -4
  15. package/dist/commands/feature/edit-coords.js +8 -11
  16. package/dist/commands/feature/edit-type.js +4 -3
  17. package/dist/commands/feature/edit.js +3 -15
  18. package/dist/commands/feature/get.js +6 -17
  19. package/dist/commands/feature/import.js +6 -12
  20. package/dist/commands/login.js +16 -28
  21. package/dist/commands/logout.js +4 -13
  22. package/dist/commands/status.js +4 -12
  23. package/dist/utils.d.ts +2 -2
  24. package/dist/utils.js +8 -14
  25. package/oclif.manifest.json +57 -57
  26. package/package.json +2 -1
  27. package/dist/Config.d.ts +0 -43
  28. package/dist/Config.js +0 -233
  29. package/dist/commands/config.test.d.ts +0 -1
  30. package/dist/commands/config.test.js +0 -188
  31. package/dist/commands/login.test.d.ts +0 -1
  32. package/dist/commands/login.test.js +0 -52
  33. package/dist/commands/logout.test.d.ts +0 -1
  34. package/dist/commands/logout.test.js +0 -67
  35. package/dist/commands/status.test.d.ts +0 -1
  36. package/dist/commands/status.test.js +0 -54
@@ -1,52 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3
- import fs from 'node:fs';
4
- import { dirname } from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- import { expect, test } from '@oclif/test';
7
- import YAML from 'yaml';
8
- import { CONFIG_FILE, TEST_DATA_DIR, VERBOSE, copyFile, } from '../test/fixtures.js';
9
- const __dirname = fileURLToPath(new URL('.', import.meta.url));
10
- describe('apollo login: Config file does not exist', () => {
11
- const cmd = ['login', '--config-file', '_tmp.yaml'];
12
- test
13
- .stderr()
14
- .command(cmd, { root: dirname(dirname(__dirname)) })
15
- .exit(1)
16
- .do((output) => expect(output.stderr).to.contain('apollo config'))
17
- .it(cmd.join(' '));
18
- });
19
- describe('apollo login: Profile does not exist', () => {
20
- const cmd = [
21
- 'login',
22
- '--config-file',
23
- 'test_data/complete_config.yaml',
24
- '--profile',
25
- 'notavailable',
26
- ];
27
- test
28
- .stderr()
29
- .command(cmd, { root: dirname(dirname(__dirname)) })
30
- .exit(1)
31
- .do((output) => expect(output.stderr).to.contain('apollo config'))
32
- .do((output) => expect(output.stderr).to.contain('Profile'))
33
- .do((output) => expect(output.stderr).to.contain('notavailable'))
34
- .it(cmd.join(' '));
35
- });
36
- // TODO: Mock server
37
- describe.skip('apollo login: Add token for guest', () => {
38
- before(() => {
39
- copyFile(`${TEST_DATA_DIR}/guest.yaml`, CONFIG_FILE, VERBOSE);
40
- });
41
- after(() => {
42
- fs.rmSync(CONFIG_FILE);
43
- });
44
- const cmd = ['login'];
45
- test
46
- .stdout()
47
- .command(cmd, { root: dirname(dirname(__dirname)) })
48
- .it(cmd.join(' '), () => {
49
- const cfg = YAML.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
50
- expect(cfg.default.accessToken).not.empty;
51
- });
52
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,67 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3
- import fs from 'node:fs';
4
- import { dirname } from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- import { expect, test } from '@oclif/test';
7
- import YAML from 'yaml';
8
- import { CONFIG_FILE, TEST_DATA_DIR, VERBOSE, copyFile, } from '../test/fixtures.js';
9
- const __dirname = fileURLToPath(new URL('.', import.meta.url));
10
- describe('apollo logout: Set token to empty string', () => {
11
- before(() => {
12
- copyFile(`${TEST_DATA_DIR}/complete_config.yaml`, CONFIG_FILE, VERBOSE);
13
- });
14
- after(() => {
15
- fs.rmSync(CONFIG_FILE);
16
- });
17
- let cmd = ['logout', '--profile', 'default'];
18
- test
19
- .stdout()
20
- .command(cmd, { root: dirname(dirname(__dirname)) })
21
- .it(cmd.join(' '), () => {
22
- const cfg = YAML.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
23
- expect(cfg.default.accessToken).to.equal('');
24
- });
25
- cmd = ['logout', '--profile', 'profile1'];
26
- test
27
- .stdout()
28
- .command(cmd, { root: dirname(dirname(__dirname)) })
29
- .it(cmd.join(' '), () => {
30
- const cfg = YAML.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
31
- expect(cfg.profile1.accessToken).to.equal('');
32
- });
33
- cmd = ['logout', '--profile', 'noAccessToken'];
34
- test
35
- .stdout()
36
- .command(cmd, { root: dirname(dirname(__dirname)) })
37
- .it(cmd.join(' '), () => {
38
- const cfg = YAML.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
39
- expect(cfg.profile1.accessToken).to.equal('');
40
- });
41
- });
42
- describe('apollo logout: Config file does not exist', () => {
43
- const cmd = ['logout', '--config-file', '_tmp.yaml'];
44
- test
45
- .stderr()
46
- .command(cmd, { root: dirname(dirname(__dirname)) })
47
- .exit(1)
48
- .do((output) => expect(output.stderr).to.contain('apollo config'))
49
- .it(cmd.join(' '));
50
- });
51
- describe('apollo logout: Profile does not exist', () => {
52
- const cmd = [
53
- 'logout',
54
- '--config-file',
55
- 'test_data/complete_config.yaml',
56
- '--profile',
57
- 'notavailable',
58
- ];
59
- test
60
- .stderr()
61
- .command(cmd, { root: dirname(dirname(__dirname)) })
62
- .exit(1)
63
- .do((output) => expect(output.stderr).to.contain('apollo config'))
64
- .do((output) => expect(output.stderr).to.contain('Profile'))
65
- .do((output) => expect(output.stderr).to.contain('notavailable'))
66
- .it(cmd.join(' '));
67
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,54 +0,0 @@
1
- import fs from 'node:fs';
2
- import { dirname } 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
- describe('apollo status: Check logged in', () => {
8
- before(() => {
9
- copyFile(`${TEST_DATA_DIR}/complete_config.yaml`, CONFIG_FILE, VERBOSE);
10
- });
11
- after(() => {
12
- fs.rmSync(CONFIG_FILE);
13
- });
14
- let cmd = ['status', '--profile', 'default'];
15
- test
16
- .stdout()
17
- .command(cmd, { root: dirname(dirname(__dirname)) })
18
- .it(cmd.join(' '), (ctx) => {
19
- expect(ctx.stdout).contain('Logged in');
20
- });
21
- cmd = ['status', '--profile', 'noAccessToken'];
22
- test
23
- .stdout()
24
- .command(cmd, { root: dirname(dirname(__dirname)) })
25
- .it(cmd.join(' '), (ctx) => {
26
- expect(ctx.stdout).contain('Logged out');
27
- });
28
- });
29
- describe('apollo status: Config file does not exist', () => {
30
- const cmd = ['status', '--config-file', '_tmp.yaml'];
31
- test
32
- .stderr()
33
- .command(cmd, { root: dirname(dirname(__dirname)) })
34
- .exit(1)
35
- .do((output) => expect(output.stderr).to.contain('apollo config'))
36
- .it(cmd.join(' '));
37
- });
38
- describe('apollo status: Profile does not exist', () => {
39
- const cmd = [
40
- 'status',
41
- '--config-file',
42
- 'test_data/complete_config.yaml',
43
- '--profile',
44
- 'notavailable',
45
- ];
46
- test
47
- .stderr()
48
- .command(cmd, { root: dirname(dirname(__dirname)) })
49
- .exit(1)
50
- .do((output) => expect(output.stderr).to.contain('apollo config'))
51
- .do((output) => expect(output.stderr).to.contain('Profile'))
52
- .do((output) => expect(output.stderr).to.contain('notavailable'))
53
- .it(cmd.join(' '));
54
- });