@eik/cli 3.0.0-next.2 → 3.1.0

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 (94) hide show
  1. package/CHANGELOG.md +152 -9
  2. package/classes/alias.js +49 -22
  3. package/classes/index.js +47 -23
  4. package/classes/integrity.js +27 -16
  5. package/classes/login.js +21 -7
  6. package/classes/meta.js +20 -12
  7. package/classes/ping.js +20 -9
  8. package/classes/publish/map.js +33 -10
  9. package/classes/publish/package/index.js +54 -17
  10. package/classes/publish/package/tasks/check-bundle-sizes.js +7 -11
  11. package/classes/publish/package/tasks/check-if-already-published.js +8 -11
  12. package/classes/publish/package/tasks/cleanup.js +7 -9
  13. package/classes/publish/package/tasks/create-temp-directory.js +5 -9
  14. package/classes/publish/package/tasks/create-zip-file.js +6 -11
  15. package/classes/publish/package/tasks/dry-run.js +4 -8
  16. package/classes/publish/package/tasks/save-metafile.js +5 -7
  17. package/classes/publish/package/tasks/task.js +3 -5
  18. package/classes/publish/package/tasks/upload-files.js +16 -17
  19. package/classes/publish/package/tasks/validate-input.js +4 -8
  20. package/classes/version.js +38 -21
  21. package/commands/alias.js +51 -71
  22. package/commands/index.js +27 -0
  23. package/commands/init.js +69 -52
  24. package/commands/integrity.js +15 -32
  25. package/commands/login.js +23 -35
  26. package/commands/map-alias.js +95 -0
  27. package/commands/map.js +90 -0
  28. package/commands/meta.js +12 -29
  29. package/commands/npm-alias.js +90 -0
  30. package/commands/package-alias.js +102 -0
  31. package/commands/ping.js +11 -21
  32. package/commands/publish.js +82 -138
  33. package/commands/version.js +16 -33
  34. package/formatters/alias.js +8 -14
  35. package/formatters/artifact.js +8 -8
  36. package/formatters/file.js +3 -10
  37. package/formatters/index.js +5 -5
  38. package/formatters/version.js +5 -12
  39. package/index.js +53 -12
  40. package/package.json +49 -52
  41. package/readme.md +16 -4
  42. package/types/classes/alias.d.ts +60 -0
  43. package/types/classes/index.d.ts +37 -0
  44. package/types/classes/integrity.d.ts +35 -0
  45. package/types/classes/login.d.ts +25 -0
  46. package/types/classes/meta.d.ts +28 -0
  47. package/types/classes/ping.d.ts +23 -0
  48. package/types/classes/publish/map.d.ts +51 -0
  49. package/types/classes/publish/package/index.d.ts +94 -0
  50. package/types/classes/publish/package/tasks/check-bundle-sizes.d.ts +4 -0
  51. package/types/classes/publish/package/tasks/check-if-already-published.d.ts +4 -0
  52. package/types/classes/publish/package/tasks/cleanup.d.ts +4 -0
  53. package/types/classes/publish/package/tasks/create-temp-directory.d.ts +4 -0
  54. package/types/classes/publish/package/tasks/create-zip-file.d.ts +4 -0
  55. package/types/classes/publish/package/tasks/dry-run.d.ts +7 -0
  56. package/types/classes/publish/package/tasks/save-metafile.d.ts +4 -0
  57. package/types/classes/publish/package/tasks/task.d.ts +8 -0
  58. package/types/classes/publish/package/tasks/upload-files.d.ts +4 -0
  59. package/types/classes/publish/package/tasks/validate-input.d.ts +4 -0
  60. package/types/classes/version.d.ts +43 -0
  61. package/types/utils/hash/compare.d.ts +2 -0
  62. package/types/utils/hash/file.d.ts +2 -0
  63. package/types/utils/hash/files.d.ts +2 -0
  64. package/types/utils/hash/index.d.ts +9 -0
  65. package/types/utils/http/index.d.ts +12 -0
  66. package/types/utils/http/integrity.d.ts +2 -0
  67. package/types/utils/http/latest-version.d.ts +2 -0
  68. package/types/utils/http/request.d.ts +33 -0
  69. package/types/utils/http/versions.d.ts +5 -0
  70. package/types/utils/index.d.ts +6 -0
  71. package/types/utils/json/index.d.ts +9 -0
  72. package/types/utils/json/read.d.ts +5 -0
  73. package/types/utils/json/write-eik.d.ts +5 -0
  74. package/types/utils/json/write.d.ts +5 -0
  75. package/types/utils/logger.d.ts +33 -0
  76. package/types/utils/type-title.d.ts +2 -0
  77. package/utils/hash/compare.js +1 -3
  78. package/utils/hash/file.js +3 -5
  79. package/utils/hash/files.js +4 -6
  80. package/utils/hash/index.js +4 -4
  81. package/utils/http/index.js +6 -5
  82. package/utils/http/integrity.js +2 -5
  83. package/utils/http/latest-version.js +2 -5
  84. package/utils/http/request.js +25 -19
  85. package/utils/http/versions.js +2 -5
  86. package/utils/index.js +5 -4
  87. package/utils/json/index.js +4 -4
  88. package/utils/json/read.js +5 -7
  89. package/utils/json/write-eik.js +4 -6
  90. package/utils/json/write.js +4 -6
  91. package/utils/logger.js +2 -5
  92. package/utils/type-title.js +1 -1
  93. package/utils/get-cwd.js +0 -14
  94. package/utils/type-slug.js +0 -4
@@ -1,23 +1,15 @@
1
- 'use strict';
1
+ import { execSync } from 'child_process';
2
+ import { join } from 'path';
3
+ import ora from 'ora';
4
+ import VersionPackage from '../classes/version.js';
5
+ import { logger, getDefaults } from '../utils/index.js';
6
+ import json from '../utils/json/index.js';
2
7
 
3
- const { execSync } = require('child_process');
4
- const { join } = require('path');
5
- const ora = require('ora');
6
- const { configStore, getDefaults } = require('@eik/common-config-loader');
7
- const VersionPackage = require('../classes/version');
8
- const { logger, getCWD } = require('../utils');
9
- const json = require('../utils/json');
8
+ export const command = 'version [level]';
10
9
 
11
- exports.command = 'version [level]';
12
-
13
- exports.aliases = ['v'];
14
-
15
- exports.describe = `Compares local files with files on server and increments "version" field in eik.json if necessary.`;
16
-
17
- exports.builder = (yargs) => {
18
- const cwd = getCWD();
19
- const defaults = getDefaults(cwd);
10
+ export const describe = `Compares local files with files on server and increments "version" field in eik.json if necessary.`;
20
11
 
12
+ export const builder = (yargs) => {
21
13
  yargs.positional('level', {
22
14
  describe: 'Semver level to increment version by',
23
15
  default: 'patch',
@@ -26,12 +18,6 @@ exports.builder = (yargs) => {
26
18
  });
27
19
 
28
20
  yargs.options({
29
- cwd: {
30
- alias: 'c',
31
- describe: 'Alter the current working directory.',
32
- default: defaults.cwd,
33
- type: 'string',
34
- },
35
21
  dryRun: {
36
22
  alias: 'd',
37
23
  describe:
@@ -39,23 +25,19 @@ exports.builder = (yargs) => {
39
25
  default: false,
40
26
  type: 'boolean',
41
27
  },
42
- debug: {
43
- describe: 'Logs additional messages',
44
- default: false,
45
- type: 'boolean',
46
- },
47
28
  });
48
29
 
49
30
  yargs.example(`eik version`);
50
31
  yargs.example(`eik version minor`);
51
- yargs.example(`eik v`);
52
32
  };
53
33
 
54
- exports.handler = async (argv) => {
34
+ export const handler = async (argv) => {
55
35
  const spinner = ora({ stream: process.stdout }).start('working...');
56
- const { level, debug, dryRun, cwd } = argv;
57
- const config = configStore.findInDirectory(cwd);
58
- const { name, version, server, map, out, files } = config;
36
+ const { level, debug, dryRun, cwd, config } = argv;
37
+ // @ts-expect-error
38
+ const { name, version, server, map, out, files } = getDefaults(
39
+ config || cwd,
40
+ );
59
41
 
60
42
  try {
61
43
  const log = logger(spinner, debug);
@@ -80,6 +62,7 @@ exports.handler = async (argv) => {
80
62
  );
81
63
  } else {
82
64
  log.debug(`Writing new version ${newVersion} to eik.json`);
65
+ // @ts-expect-error
83
66
  await json.writeEik({ version: newVersion }, { cwd });
84
67
 
85
68
  log.debug(`Committing eik.json to local git repository`);
@@ -1,10 +1,6 @@
1
- /* eslint-disable no-underscore-dangle */
2
-
3
- 'use strict';
4
-
5
- const { join } = require('path');
6
- const chalk = require('chalk');
7
- const File = require('./file');
1
+ import { join } from 'path';
2
+ import chalk from 'chalk';
3
+ import File from './file.js';
8
4
 
9
5
  function colorType(type) {
10
6
  if (type === 'npm') {
@@ -15,6 +11,10 @@ function colorType(type) {
15
11
  return chalk.white.bgYellow.bold(' PACKAGE ');
16
12
  }
17
13
 
14
+ if (type === 'img') {
15
+ return chalk.white.bgYellow.bold(' IMAGE ');
16
+ }
17
+
18
18
  return chalk.white.bgBlue.bold(' IMPORT MAP ');
19
19
  }
20
20
 
@@ -55,12 +55,6 @@ class Alias {
55
55
 
56
56
  if (this.update) {
57
57
  write(`${chalk.bgMagenta.white(' UPDATED \n\n')}`);
58
-
59
- write(
60
- `${chalk.yellow.bold(
61
- '! It may take up to 40 minutes before this alias updates due to caching.',
62
- )}\n\n`,
63
- );
64
58
  } else {
65
59
  write(`${chalk.bgGreen.white(' NEW ')}\n\n`);
66
60
  }
@@ -85,4 +79,4 @@ class Alias {
85
79
  }
86
80
  }
87
81
 
88
- module.exports = Alias;
82
+ export default Alias;
@@ -1,10 +1,6 @@
1
- /* eslint-disable no-underscore-dangle */
2
-
3
- 'use strict';
4
-
5
- const { join } = require('path');
6
- const chalk = require('chalk');
7
- const Version = require('./version');
1
+ import { join } from 'path';
2
+ import chalk from 'chalk';
3
+ import Version from './version.js';
8
4
 
9
5
  const _name = Symbol('name');
10
6
  const _type = Symbol('type');
@@ -20,6 +16,10 @@ function colorType(type) {
20
16
  return chalk.white.bgYellow.bold(' PACKAGE ');
21
17
  }
22
18
 
19
+ if (type === 'img') {
20
+ return chalk.white.bgYellow.bold(' IMAGE ');
21
+ }
22
+
23
23
  return chalk.white.bgBlue.bold(' IMPORT MAP ');
24
24
  }
25
25
 
@@ -86,4 +86,4 @@ class Artifact {
86
86
  }
87
87
  }
88
88
 
89
- module.exports = Artifact;
89
+ export default Artifact;
@@ -1,12 +1,5 @@
1
- /* eslint-disable no-restricted-properties */
2
- /* eslint-disable prefer-template */
3
- /* eslint-disable one-var */
4
- /* eslint-disable no-underscore-dangle */
5
-
6
- 'use strict';
7
-
8
- const { join } = require('path');
9
- const chalk = require('chalk');
1
+ import { join } from 'path';
2
+ import chalk from 'chalk';
10
3
 
11
4
  function readableBytes(bytes) {
12
5
  const i = Math.floor(Math.log(bytes) / Math.log(1024)),
@@ -39,4 +32,4 @@ class File {
39
32
  }
40
33
  }
41
34
 
42
- module.exports = File;
35
+ export default File;
@@ -1,6 +1,6 @@
1
- const Artifact = require('./artifact');
2
- const Alias = require('./alias');
3
- const File = require('./file');
4
- const Version = require('./version');
1
+ import Artifact from './artifact.js';
2
+ import Alias from './alias.js';
3
+ import File from './file.js';
4
+ import Version from './version.js';
5
5
 
6
- module.exports = { Artifact, Alias, Version, File };
6
+ export { Artifact, Alias, Version, File };
@@ -1,14 +1,7 @@
1
- /* eslint-disable no-restricted-properties */
2
- /* eslint-disable prefer-template */
3
- /* eslint-disable one-var */
4
- /* eslint-disable no-underscore-dangle */
5
-
6
- 'use strict';
7
-
8
- const { join } = require('path');
9
- const chalk = require('chalk');
10
- const formatDistance = require('date-fns/formatDistance');
11
- const File = require('./file');
1
+ import { join } from 'path';
2
+ import chalk from 'chalk';
3
+ import { formatDistance } from 'date-fns/formatDistance';
4
+ import File from './file.js';
12
5
 
13
6
  class Version {
14
7
  constructor({
@@ -65,4 +58,4 @@ class Version {
65
58
  }
66
59
  }
67
60
 
68
- module.exports = Version;
61
+ export default Version;
package/index.js CHANGED
@@ -1,14 +1,31 @@
1
1
  #!/usr/bin/env node
2
+ import chalk from 'chalk';
3
+ import yargs from 'yargs';
4
+ import { hideBin } from 'yargs/helpers';
5
+ import boxen from 'boxen';
6
+ import { join } from 'path';
7
+ import { readFileSync } from 'fs';
8
+ import { fileURLToPath } from 'url';
9
+ import { dirname } from 'path';
10
+ import { commands } from './commands/index.js';
2
11
 
3
- 'use strict';
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = dirname(__filename);
4
14
 
5
- const chalk = require('chalk');
6
- const yargs = require('yargs');
7
- const boxen = require('boxen');
8
- const { join } = require('path');
9
- const { readFileSync } = require('fs');
15
+ const { version } = JSON.parse(
16
+ readFileSync(join(__dirname, './package.json'), { encoding: 'utf-8' }),
17
+ );
18
+
19
+ // short circuit and provide a -v and --version flag
20
+ if (
21
+ process.argv.includes('-v') ||
22
+ // last position only to avoid conflict with publish command
23
+ process.argv[process.argv.length - 1].includes('--version')
24
+ ) {
25
+ console.log(version);
26
+ process.exit(0);
27
+ }
10
28
 
11
- const { version } = JSON.parse(readFileSync(join(__dirname, './package.json')));
12
29
  const greeting = chalk.white.bold(`Eik CLI (v${version})`);
13
30
 
14
31
  const boxenOptions = {
@@ -18,26 +35,50 @@ const boxenOptions = {
18
35
  borderColor: 'green',
19
36
  backgroundColor: '#555555',
20
37
  };
38
+ // @ts-expect-error
21
39
  const msgBox = boxen(greeting, boxenOptions);
22
40
 
23
- // eslint-disable-next-line no-console
24
41
  console.log(msgBox);
25
42
 
26
- // eslint-disable-next-line no-unused-expressions
27
- yargs
43
+ yargs(hideBin(process.argv))
44
+ .options({
45
+ config: {
46
+ alias: 'c',
47
+ describe:
48
+ 'Provide an exact path to an eik.json or package.json file to use as config. Default is eik.json in the current working directory.',
49
+ },
50
+ cwd: {
51
+ describe: 'Alter the current working directory.',
52
+ default: process.cwd(),
53
+ },
54
+ debug: {
55
+ describe: 'Logs additional messages',
56
+ default: false,
57
+ type: 'boolean',
58
+ },
59
+ })
60
+ // @ts-expect-error
28
61
  .example('eik init')
62
+ // @ts-expect-error
29
63
  .example('eik login --server https://assets.myserver.com --key ######')
64
+ // @ts-expect-error
30
65
  .example('eik publish')
66
+ // @ts-expect-error
31
67
  .example('eik meta my-app --server https://assets.myserver.com')
32
68
  .example(
69
+ // @ts-expect-error
33
70
  'eik npm-alias lit-html 1.0.0 1 --server https://assets.myserver.com --token ######',
34
71
  )
35
72
  .example(
73
+ // @ts-expect-error
36
74
  'eik map my-map 1.0.0 ./import-map.json --server https://assets.myserver.com --token ######',
37
75
  )
76
+ // @ts-expect-error
38
77
  .example('eik map-alias my-map 1.0.0 1')
39
- .commandDir('commands')
78
+ // @ts-expect-error
79
+ .command(commands)
40
80
  .demandCommand()
41
81
  .wrap(150)
42
82
  .version(false)
43
- .help().argv;
83
+ .help()
84
+ .parse();
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@eik/cli",
3
- "version": "3.0.0-next.2",
4
- "description": "Cli tool for publishing assets",
3
+ "version": "3.1.0",
4
+ "description": "CLI tool for publishing assets to an Eik server",
5
5
  "main": "./classes/index.js",
6
+ "types": "./types/classes/index.d.ts",
7
+ "type": "module",
6
8
  "bin": {
7
9
  "eik": "index.js"
8
10
  },
@@ -14,69 +16,64 @@
14
16
  "commands",
15
17
  "classes",
16
18
  "utils",
17
- "formatters"
19
+ "formatters",
20
+ "types"
18
21
  ],
19
22
  "scripts": {
20
- "test": "HTTP_PORT=0 LOG_LEVEL=fatal tap --no-coverage-report --no-cov --timeout 0 --test-regex=.test.js --test-ignore=node_modules",
21
- "test:integration": "HTTP_PORT=0 LOG_LEVEL=fatal tap --no-coverage-report --no-cov --timeout 0 test/integration/**/*.test.js",
22
- "test:unit": "HTTP_PORT=0 LOG_LEVEL=fatal tap --no-coverage-report --no-cov --timeout 0 test/*.test.js",
23
- "test:tasks": "HTTP_PORT=0 LOG_LEVEL=fatal tap --no-coverage-report --no-cov --timeout 0 test/tasks/*.test.js",
24
- "test:ci": "npm run test:unit -- --jobs=1 && npm run test:tasks -- --jobs=1 && npm run test:integration -- --jobs=1",
25
- "lint:check": "eslint .",
23
+ "clean": "rimraf .tap node_modules types",
24
+ "test": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 0 --disable-coverage test/**/*.test.mjs",
25
+ "test:integration": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 0 --disable-coverage test/integration/**/*.test.mjs",
26
+ "test:unit": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 0 --disable-coverage test/*.test.mjs",
27
+ "test:tasks": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 0 --disable-coverage test/tasks/*.test.mjs",
28
+ "test:ci:integration": "npm run test:integration -- --jobs=1",
29
+ "test:ci:unit": "npm run test:unit -- --jobs=1",
30
+ "test:ci:tasks": "npm run test:tasks -- --jobs=1",
31
+ "test:ci": "run-s test:ci:*",
32
+ "lint": "eslint .",
26
33
  "lint:fix": "eslint --fix .",
27
34
  "format:check": "prettier -c .",
28
35
  "format:fix": "prettier -w .",
29
- "fix": "npm run lint:fix && npm run format:fix"
36
+ "fix": "run-s lint:fix format:fix",
37
+ "types": "run-s types:module types:test",
38
+ "types:module": "tsc",
39
+ "types:test": "tsc --project tsconfig.test.json"
30
40
  },
31
41
  "keywords": [],
32
42
  "author": "",
33
43
  "license": "MIT",
34
44
  "dependencies": {
35
- "@eik/common-config-loader": "^4.0.0-next.8",
36
- "@eik/common-schemas": "^4.0.0-next.8",
37
- "@eik/common-utils": "^4.0.0-next.8",
38
- "@eik/common-validators": "^4.0.0-next.8",
39
- "abslog": "2.4.0",
40
- "boxen": "5.1.2",
45
+ "@eik/common": "4.1.0",
46
+ "abslog": "2.4.4",
47
+ "boxen": "8.0.0",
41
48
  "bytes": "3.1.2",
42
- "chalk": "4.1.2",
43
- "copy": "0.3.2",
44
- "date-fns": "2.28.0",
49
+ "chalk": "5.3.0",
50
+ "date-fns": "3.6.0",
45
51
  "form-data": "4.0.0",
46
- "glob": "7.2.0",
47
- "gzip-size": "6.0.0",
48
- "make-dir": "3.1.0",
49
- "node-fetch": "2.6.7",
50
- "ora": "5.4.1",
51
- "pkg-dir": "6.0.1",
52
- "read-pkg-up": "9.0.0",
53
- "rimraf": "3.0.2",
54
- "semver": "7.3.5",
55
- "ssri": "8.0.1",
56
- "tar": "6.1.11",
57
- "temp-dir": "2.0.0",
58
- "yargs": "17.3.1",
59
- "yargs-parser": "21.0.0"
52
+ "gzip-size": "7.0.0",
53
+ "make-dir": "5.0.0",
54
+ "ora": "8.0.1",
55
+ "rimraf": "6.0.1",
56
+ "semver": "7.6.3",
57
+ "ssri": "10.0.6",
58
+ "tar": "7.4.3",
59
+ "yargs": "17.7.2",
60
+ "yargs-parser": "21.1.1"
60
61
  },
61
62
  "devDependencies": {
62
- "@eik/core": "1.2.28",
63
- "@eik/service": "1.2.98",
64
- "@semantic-release/changelog": "6.0.1",
65
- "@semantic-release/git": "10.0.1",
66
- "eslint": "8.8.0",
67
- "eslint-config-airbnb-base": "15.0.0",
68
- "eslint-config-prettier": "8.3.0",
69
- "eslint-plugin-import": "2.25.4",
70
- "eslint-plugin-prettier": "4.0.0",
71
- "fastify": "3.27.0",
72
- "fastify-cors": "6.0.2",
73
- "fs-extra": "10.0.0",
74
- "prettier": "2.5.1",
75
- "puppeteer": "13.1.2",
76
- "react": "17.0.2",
77
- "react-dom": "17.0.2",
78
- "semantic-release": "19.0.2",
79
- "semantic-release-slack-bot": "3.5.2",
80
- "tap": "15.1.6"
63
+ "@eik/eslint-config": "1.0.2",
64
+ "@eik/semantic-release-config": "1.0.0",
65
+ "@eik/service": "2.3.0",
66
+ "@eik/sink-memory": "1.1.1",
67
+ "@eik/typescript-config": "1.0.0",
68
+ "cross-env": "7.0.3",
69
+ "eslint": "9.8.0",
70
+ "fastify": "4.28.1",
71
+ "fs-extra": "11.2.0",
72
+ "npm-run-all": "4.1.5",
73
+ "prettier": "3.3.3",
74
+ "semantic-release": "24.0.0",
75
+ "semantic-release-slack-bot": "4.0.2",
76
+ "tap": "21.0.0",
77
+ "typescript": "5.5.4"
81
78
  }
82
79
  }
package/readme.md CHANGED
@@ -1,9 +1,21 @@
1
- # Eik CLI
1
+ # @eik/cli
2
2
 
3
- ## Installation
3
+ The Eik CLI helps you publish to an [Eik server](https://eik.dev/docs/introduction/) and manage import maps and aliases.
4
+
5
+ ## Installing
6
+
7
+ Run this command to install the Eik CLI globally.
4
8
 
5
9
  ```sh
6
- npm install -g @eik/cli
10
+ npm install --global @eik/cli
7
11
  ```
8
12
 
9
- See Eik [documentation site](https://eik.dev/) for usage instructions.
13
+ This makes the `eik` command available in your shell.
14
+
15
+ ```sh
16
+ eik --version
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ See [the CLI reference documentation](https://eik.dev/docs/reference/at-eik-cli) to learn about the available commands.
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @typedef {object} AliasOptions
3
+ * @property {import('abslog').AbstractLoggerOptions} [logger]
4
+ * @property {string} server
5
+ * @property {"package" | "npm" | "map"} [type="package"]
6
+ * @property {string} name
7
+ * @property {string} version
8
+ * @property {string} alias
9
+ * @property {string} token
10
+ */
11
+ /**
12
+ * @typedef {object} AliasResult
13
+ * @property {string} server
14
+ * @property {string} type
15
+ * @property {string} name
16
+ * @property {string} alias
17
+ * @property {string} version
18
+ * @property {boolean} update
19
+ * @property {string[]} files
20
+ * @property {string} org
21
+ * @property {string} integrity
22
+ */
23
+ export default class Alias {
24
+ /**
25
+ * @param {AliasOptions} options
26
+ */
27
+ constructor({ logger, server, token, type, name, version, alias }: AliasOptions);
28
+ log: abslog.ValidLogger;
29
+ server: string;
30
+ token: string;
31
+ type: string;
32
+ name: string;
33
+ alias: string;
34
+ version: string;
35
+ /**
36
+ * @returns {Promise<AliasResult>}
37
+ */
38
+ run(): Promise<AliasResult>;
39
+ }
40
+ export type AliasOptions = {
41
+ logger?: import("abslog").AbstractLoggerOptions;
42
+ server: string;
43
+ type?: "package" | "npm" | "map";
44
+ name: string;
45
+ version: string;
46
+ alias: string;
47
+ token: string;
48
+ };
49
+ export type AliasResult = {
50
+ server: string;
51
+ type: string;
52
+ name: string;
53
+ alias: string;
54
+ version: string;
55
+ update: boolean;
56
+ files: string[];
57
+ org: string;
58
+ integrity: string;
59
+ };
60
+ import abslog from 'abslog';
@@ -0,0 +1,37 @@
1
+ declare namespace _default {
2
+ /**
3
+ * @param {import('./alias.js').AliasOptions} opts
4
+ */
5
+ function alias(opts: import("./alias.js").AliasOptions): Promise<import("./alias.js").AliasResult>;
6
+ /**
7
+ * @param {import('./integrity.js').IntegrityOptions} opts
8
+ */
9
+ function integrity(opts: import("./integrity.js").IntegrityOptions): Promise<any>;
10
+ /**
11
+ * Log in using a key to get a Bearer token for use with other commands.
12
+ *
13
+ * @param {import('./login.js').LoginOptions} opts
14
+ */
15
+ function login(opts: import("./login.js").LoginOptions): Promise<string | false>;
16
+ /**
17
+ * @param {import('./publish/map.js').PublishMapOptions} opts
18
+ */
19
+ function map(opts: import("./publish/map.js").PublishMapOptions): Promise<import("./publish/map.js").PublishMapResult>;
20
+ /**
21
+ * @param {import('./meta.js').MetaOptions} opts
22
+ */
23
+ function meta(opts: import("./meta.js").MetaOptions): Promise<unknown>;
24
+ /**
25
+ * @param {import('./ping.js').PingOptions} opts
26
+ */
27
+ function ping(opts: import("./ping.js").PingOptions): Promise<boolean>;
28
+ /**
29
+ * @param {import('./publish/package/index.js').PublishOptions} opts
30
+ */
31
+ function publish(opts: import("./publish/package/index.js").PublishOptions): Promise<import("./publish/package/index.js").PublishResult>;
32
+ /**
33
+ * @param {import('./version.js').VersionOptions} opts
34
+ */
35
+ function version(opts: import("./version.js").VersionOptions): Promise<string>;
36
+ }
37
+ export default _default;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @typedef {object} IntegrityOptions
3
+ * @property {import('abslog').AbstractLoggerOptions} [logger]
4
+ * @property {string} server
5
+ * @property {"package" | "npm" | "map"} [type="package"]
6
+ * @property {string} name
7
+ * @property {string} version
8
+ * @property {string} [cwd]
9
+ * @property {boolean} [debug]
10
+ */
11
+ export default class Integrity {
12
+ /**
13
+ *
14
+ * @param {IntegrityOptions} options
15
+ */
16
+ constructor({ logger, name, version, server, type, debug, cwd, }: IntegrityOptions);
17
+ log: abslog.ValidLogger;
18
+ server: string;
19
+ name: string;
20
+ version: string;
21
+ debug: boolean;
22
+ cwd: string;
23
+ type: "map" | "package" | "npm";
24
+ run(): Promise<any>;
25
+ }
26
+ export type IntegrityOptions = {
27
+ logger?: import("abslog").AbstractLoggerOptions;
28
+ server: string;
29
+ type?: "package" | "npm" | "map";
30
+ name: string;
31
+ version: string;
32
+ cwd?: string;
33
+ debug?: boolean;
34
+ };
35
+ import abslog from 'abslog';
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @typedef {object} LoginOptions
3
+ * @property {import('abslog').AbstractLoggerOptions} [logger]
4
+ * @property {string} server
5
+ * @property {string} key
6
+ */
7
+ export default class Login {
8
+ /**
9
+ * @param {LoginOptions} options
10
+ */
11
+ constructor({ logger, server, key }: LoginOptions);
12
+ log: abslog.ValidLogger;
13
+ server: string;
14
+ key: string;
15
+ /**
16
+ * @returns {Promise<string | false>} Bearer token, or false if login fails
17
+ */
18
+ run(): Promise<string | false>;
19
+ }
20
+ export type LoginOptions = {
21
+ logger?: import("abslog").AbstractLoggerOptions;
22
+ server: string;
23
+ key: string;
24
+ };
25
+ import abslog from 'abslog';
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @typedef {object} MetaOptions
3
+ * @property {import('abslog').AbstractLoggerOptions} [logger]
4
+ * @property {string} server
5
+ * @property {string} name
6
+ * @property {string} version
7
+ */
8
+ export default class Meta {
9
+ /**
10
+ * @param {MetaOptions} options
11
+ */
12
+ constructor({ logger, server, name, version }: MetaOptions);
13
+ log: abslog.ValidLogger;
14
+ server: string;
15
+ name: string;
16
+ version: string;
17
+ /**
18
+ * @returns {Promise<unknown | false>}
19
+ */
20
+ run(): Promise<unknown | false>;
21
+ }
22
+ export type MetaOptions = {
23
+ logger?: import("abslog").AbstractLoggerOptions;
24
+ server: string;
25
+ name: string;
26
+ version: string;
27
+ };
28
+ import abslog from 'abslog';