@eik/cli 3.1.67 → 3.1.69

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 (30) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/classes/publish/package/tasks/upload-files.js +5 -0
  3. package/package.json +13 -13
  4. package/types/classes/alias.d.ts +25 -25
  5. package/types/classes/index.d.ts +10 -10
  6. package/types/classes/integrity.d.ts +16 -16
  7. package/types/classes/login.d.ts +9 -9
  8. package/types/classes/meta.d.ts +11 -11
  9. package/types/classes/ping.d.ts +7 -7
  10. package/types/classes/publish/map.d.ts +21 -21
  11. package/types/classes/publish/package/publish.d.ts +45 -45
  12. package/types/classes/publish/package/tasks/check-bundle-sizes.d.ts +1 -1
  13. package/types/classes/publish/package/tasks/check-if-already-published.d.ts +1 -1
  14. package/types/classes/publish/package/tasks/cleanup.d.ts +1 -1
  15. package/types/classes/publish/package/tasks/create-temp-directory.d.ts +1 -1
  16. package/types/classes/publish/package/tasks/create-zip-file.d.ts +1 -1
  17. package/types/classes/publish/package/tasks/dry-run.d.ts +1 -1
  18. package/types/classes/publish/package/tasks/save-metafile.d.ts +1 -1
  19. package/types/classes/publish/package/tasks/task.d.ts +3 -3
  20. package/types/classes/publish/package/tasks/upload-files.d.ts +1 -1
  21. package/types/classes/publish/package/tasks/validate-input.d.ts +1 -1
  22. package/types/classes/version.d.ts +18 -18
  23. package/types/utils/hash/compare.d.ts +11 -1
  24. package/types/utils/hash/file.d.ts +10 -1
  25. package/types/utils/hash/files.d.ts +10 -1
  26. package/types/utils/http/integrity.d.ts +13 -1
  27. package/types/utils/http/request.d.ts +5 -5
  28. package/types/utils/http/versions.d.ts +12 -1
  29. package/types/utils/json/write.d.ts +18 -1
  30. package/types/utils/url.d.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [3.1.69](https://github.com/eik-lib/cli/compare/v3.1.68...v3.1.69) (2026-08-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency @eik/common to v5.2.1 ([#762](https://github.com/eik-lib/cli/issues/762)) ([90803dd](https://github.com/eik-lib/cli/commit/90803dda991db423a0730be4a99e5cdffbca0f38))
7
+
8
+ ## [3.1.68](https://github.com/eik-lib/cli/compare/v3.1.67...v3.1.68) (2026-08-14)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * shorten the 413 error message ([e56b292](https://github.com/eik-lib/cli/commit/e56b29240d5b2c53f96bdf84a543f636f9e44816))
14
+ * surface a clear error message when a package upload exceeds the server size limit ([515cc9b](https://github.com/eik-lib/cli/commit/515cc9bfd843d9cfa931ea03a9d244a7fc39a3e0))
15
+ * type assert.rejects validation callback parameter as Error ([4873c48](https://github.com/eik-lib/cli/commit/4873c48885cdbeeba7a03d36809c16bae06fdd27))
16
+
1
17
  ## [3.1.67](https://github.com/eik-lib/cli/compare/v3.1.66...v3.1.67) (2026-08-03)
2
18
 
3
19
 
@@ -49,6 +49,11 @@ export default class UploadFiles extends Task {
49
49
  `Package with name "${name}" and version "${version}" already exists on server`,
50
50
  { cause: err },
51
51
  );
52
+ case 413:
53
+ throw new Error(
54
+ `${e.statusCode}: Package is too large to upload. Reduce the package size.`,
55
+ { cause: err },
56
+ );
52
57
  case 415:
53
58
  throw new Error(
54
59
  `${e.statusCode}: Client attempted to send an unsupported file format to server`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eik/cli",
3
- "version": "3.1.67",
3
+ "version": "3.1.69",
4
4
  "description": "CLI tool for publishing assets to an Eik server",
5
5
  "main": "./classes/index.js",
6
6
  "types": "./types/classes/index.d.ts",
@@ -42,7 +42,7 @@
42
42
  "author": "",
43
43
  "license": "MIT",
44
44
  "dependencies": {
45
- "@eik/common": "5.1.34",
45
+ "@eik/common": "5.2.1",
46
46
  "abslog": "2.4.4",
47
47
  "bytes": "3.1.2",
48
48
  "date-fns": "4.4.0",
@@ -59,22 +59,22 @@
59
59
  }
60
60
  },
61
61
  "devDependencies": {
62
- "@eik/eslint-config": "2.0.7",
62
+ "@eik/eslint-config": "2.0.15",
63
63
  "@eik/prettier-config": "1.0.2",
64
- "@eik/semantic-release-config": "1.0.18",
65
- "@eik/service": "5.1.65",
64
+ "@eik/semantic-release-config": "1.0.19",
65
+ "@eik/service": "5.1.69",
66
66
  "@eik/sink-memory": "2.0.37",
67
67
  "@eik/typescript-config": "1.0.2",
68
- "@types/node": "25.9.5",
69
- "@types/semver": "7.7.1",
68
+ "@types/node": "26.2.0",
69
+ "@types/semver": "7.8.0",
70
70
  "@types/yargs": "17.0.35",
71
71
  "cross-env": "10.1.0",
72
- "eslint": "10.4.0",
73
- "fastify": "5.8.5",
74
- "npm-run-all2": "9.0.1",
75
- "prettier": "3.8.3",
76
- "semantic-release": "25.0.3",
72
+ "eslint": "10.8.1",
73
+ "fastify": "5.11.3",
74
+ "npm-run-all2": "9.0.3",
75
+ "prettier": "3.9.6",
76
+ "semantic-release": "25.0.9",
77
77
  "semantic-release-slack-bot": "4.0.2",
78
- "typescript": "6.0.3"
78
+ "typescript": "7.0.2"
79
79
  }
80
80
  }
@@ -1,3 +1,24 @@
1
+ import abslog from "abslog";
2
+ export type AliasOptions = {
3
+ logger?: import('abslog').AbstractLoggerOptions;
4
+ server: string;
5
+ type?: "package" | "npm" | "image" | "map";
6
+ name: string;
7
+ version: string;
8
+ alias: string;
9
+ token: string;
10
+ };
11
+ export type AliasResult = {
12
+ server: string;
13
+ type: string;
14
+ name: string;
15
+ alias: string;
16
+ version: string;
17
+ update: boolean;
18
+ files: string[];
19
+ org: string;
20
+ integrity: string;
21
+ };
1
22
  /**
2
23
  * @typedef {object} AliasOptions
3
24
  * @property {import('abslog').AbstractLoggerOptions} [logger]
@@ -21,10 +42,6 @@
21
42
  * @property {string} integrity
22
43
  */
23
44
  export default class Alias {
24
- /**
25
- * @param {AliasOptions} options
26
- */
27
- constructor({ logger, server, token, type, name, version, alias }: AliasOptions);
28
45
  log: abslog.ValidLogger;
29
46
  server: string;
30
47
  token: string;
@@ -32,29 +49,12 @@ export default class Alias {
32
49
  name: string;
33
50
  alias: string;
34
51
  version: string;
52
+ /**
53
+ * @param {AliasOptions} options
54
+ */
55
+ constructor({ logger, server, token, type, name, version, alias }: AliasOptions);
35
56
  /**
36
57
  * @returns {Promise<AliasResult>}
37
58
  */
38
59
  run(): Promise<AliasResult>;
39
60
  }
40
- export type AliasOptions = {
41
- logger?: import("abslog").AbstractLoggerOptions;
42
- server: string;
43
- type?: "map" | "package" | "npm" | "image" | undefined;
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";
@@ -1,37 +1,37 @@
1
- declare namespace _default {
1
+ declare const _default: {
2
2
  /**
3
3
  * @param {import('./alias.js').AliasOptions} opts
4
4
  */
5
- function alias(opts: import("./alias.js").AliasOptions): Promise<import("./alias.js").AliasResult>;
5
+ alias(opts: import('./alias.js').AliasOptions): Promise<import("./alias.js").AliasResult>;
6
6
  /**
7
7
  * @param {import('./integrity.js').IntegrityOptions} opts
8
8
  */
9
- function integrity(opts: import("./integrity.js").IntegrityOptions): Promise<any>;
9
+ integrity(opts: import('./integrity.js').IntegrityOptions): Promise<any>;
10
10
  /**
11
11
  * Log in using a key to get a Bearer token for use with other commands.
12
12
  *
13
13
  * @param {import('./login.js').LoginOptions} opts
14
14
  */
15
- function login(opts: import("./login.js").LoginOptions): Promise<string | false>;
15
+ login(opts: import('./login.js').LoginOptions): Promise<string | false>;
16
16
  /**
17
17
  * @param {import('./publish/map.js').PublishMapOptions} opts
18
18
  */
19
- function map(opts: import("./publish/map.js").PublishMapOptions): Promise<import("./publish/map.js").PublishMapResult>;
19
+ map(opts: import('./publish/map.js').PublishMapOptions): Promise<import("./publish/map.js").PublishMapResult>;
20
20
  /**
21
21
  * @param {import('./meta.js').MetaOptions} opts
22
22
  */
23
- function meta(opts: import("./meta.js").MetaOptions): Promise<unknown>;
23
+ meta(opts: import('./meta.js').MetaOptions): Promise<unknown>;
24
24
  /**
25
25
  * @param {import('./ping.js').PingOptions} opts
26
26
  */
27
- function ping(opts: import("./ping.js").PingOptions): Promise<boolean>;
27
+ ping(opts: import('./ping.js').PingOptions): Promise<boolean>;
28
28
  /**
29
29
  * @param {import('./publish/package/publish.js').PublishOptions} opts
30
30
  */
31
- function publish(opts: import("./publish/package/publish.js").PublishOptions): Promise<import("./publish/package/publish.js").PublishResult>;
31
+ publish(opts: import('./publish/package/publish.js').PublishOptions): Promise<import("./publish/package/publish.js").PublishResult>;
32
32
  /**
33
33
  * @param {import('./version.js').VersionOptions} opts
34
34
  */
35
- function version(opts: import("./version.js").VersionOptions): Promise<string | null>;
36
- }
35
+ version(opts: import('./version.js').VersionOptions): Promise<string | null>;
36
+ };
37
37
  export default _default;
@@ -1,3 +1,13 @@
1
+ import abslog from "abslog";
2
+ export type IntegrityOptions = {
3
+ logger?: import('abslog').AbstractLoggerOptions;
4
+ server: string;
5
+ type?: "package" | "npm" | "map";
6
+ name: string;
7
+ version: string;
8
+ cwd?: string;
9
+ debug?: boolean;
10
+ };
1
11
  /**
2
12
  * @typedef {object} IntegrityOptions
3
13
  * @property {import('abslog').AbstractLoggerOptions} [logger]
@@ -9,27 +19,17 @@
9
19
  * @property {boolean} [debug]
10
20
  */
11
21
  export default class Integrity {
12
- /**
13
- *
14
- * @param {IntegrityOptions} options
15
- */
16
- constructor({ logger, name, version, server, type, debug, cwd, }: IntegrityOptions);
17
22
  log: abslog.ValidLogger;
18
23
  server: string;
19
24
  name: string;
20
25
  version: string;
21
26
  debug: boolean;
22
27
  cwd: string;
23
- type: "map" | "package" | "npm" | undefined;
28
+ type: "map" | "npm" | "package" | undefined;
29
+ /**
30
+ *
31
+ * @param {IntegrityOptions} options
32
+ */
33
+ constructor({ logger, name, version, server, type, debug, cwd, }: IntegrityOptions);
24
34
  run(): Promise<any>;
25
35
  }
26
- export type IntegrityOptions = {
27
- logger?: import("abslog").AbstractLoggerOptions;
28
- server: string;
29
- type?: "map" | "package" | "npm" | undefined;
30
- name: string;
31
- version: string;
32
- cwd?: string | undefined;
33
- debug?: boolean | undefined;
34
- };
35
- import abslog from "abslog";
@@ -1,3 +1,9 @@
1
+ import abslog from "abslog";
2
+ export type LoginOptions = {
3
+ logger?: import('abslog').AbstractLoggerOptions;
4
+ server: string;
5
+ key: string;
6
+ };
1
7
  /**
2
8
  * @typedef {object} LoginOptions
3
9
  * @property {import('abslog').AbstractLoggerOptions} [logger]
@@ -5,21 +11,15 @@
5
11
  * @property {string} key
6
12
  */
7
13
  export default class Login {
14
+ log: abslog.ValidLogger;
15
+ server: string;
16
+ key: string;
8
17
  /**
9
18
  * @param {LoginOptions} options
10
19
  */
11
20
  constructor({ logger, server, key }: LoginOptions);
12
- log: abslog.ValidLogger;
13
- server: string;
14
- key: string;
15
21
  /**
16
22
  * @returns {Promise<string | false>} Bearer token, or false if login fails
17
23
  */
18
24
  run(): Promise<string | false>;
19
25
  }
20
- export type LoginOptions = {
21
- logger?: import("abslog").AbstractLoggerOptions;
22
- server: string;
23
- key: string;
24
- };
25
- import abslog from "abslog";
@@ -1,3 +1,10 @@
1
+ import abslog from "abslog";
2
+ export type MetaOptions = {
3
+ logger?: import('abslog').AbstractLoggerOptions;
4
+ server: string;
5
+ name: string;
6
+ version?: string;
7
+ };
1
8
  /**
2
9
  * @typedef {object} MetaOptions
3
10
  * @property {import('abslog').AbstractLoggerOptions} [logger]
@@ -6,23 +13,16 @@
6
13
  * @property {string} [version]
7
14
  */
8
15
  export default class Meta {
9
- /**
10
- * @param {MetaOptions} options
11
- */
12
- constructor({ logger, server, name, version }: MetaOptions);
13
16
  log: abslog.ValidLogger;
14
17
  server: string;
15
18
  name: string;
16
19
  version: string | undefined;
20
+ /**
21
+ * @param {MetaOptions} options
22
+ */
23
+ constructor({ logger, server, name, version }: MetaOptions);
17
24
  /**
18
25
  * @returns {Promise<unknown | false>}
19
26
  */
20
27
  run(): Promise<unknown | false>;
21
28
  }
22
- export type MetaOptions = {
23
- logger?: import("abslog").AbstractLoggerOptions;
24
- server: string;
25
- name: string;
26
- version?: string | undefined;
27
- };
28
- import abslog from "abslog";
@@ -1,23 +1,23 @@
1
+ import abslog from "abslog";
2
+ export type PingOptions = {
3
+ server?: string;
4
+ logger?: import('abslog').AbstractLoggerOptions;
5
+ };
1
6
  /**
2
7
  * @typedef {object} PingOptions
3
8
  * @property {string} [server]
4
9
  * @property {import('abslog').AbstractLoggerOptions} [logger]
5
10
  */
6
11
  export default class Ping {
12
+ log: abslog.ValidLogger;
13
+ server: string | undefined;
7
14
  /**
8
15
  * @param {PingOptions} options
9
16
  */
10
17
  constructor({ logger, server }?: PingOptions);
11
- log: abslog.ValidLogger;
12
- server: string | undefined;
13
18
  /**
14
19
  * Run the ping command
15
20
  * @returns {Promise<boolean>}
16
21
  */
17
22
  run(): Promise<boolean>;
18
23
  }
19
- export type PingOptions = {
20
- server?: string | undefined;
21
- logger?: import("abslog").AbstractLoggerOptions;
22
- };
23
- import abslog from "abslog";
@@ -1,3 +1,19 @@
1
+ import abslog from "abslog";
2
+ export type PublishMapOptions = {
3
+ logger?: import('abslog').AbstractLoggerOptions;
4
+ server: string;
5
+ cwd?: string;
6
+ token: string;
7
+ file: string;
8
+ name: string;
9
+ version: string;
10
+ };
11
+ export type PublishMapResult = {
12
+ server: string;
13
+ name: string;
14
+ version: string;
15
+ type: string;
16
+ };
1
17
  /**
2
18
  * @typedef {object} PublishMapOptions
3
19
  * @property {import('abslog').AbstractLoggerOptions} [logger]
@@ -16,10 +32,6 @@
16
32
  * @property {string} type
17
33
  */
18
34
  export default class PublishMap {
19
- /**
20
- * @param {PublishMapOptions} options
21
- */
22
- constructor({ logger, cwd, server, token, file, name, version, }: PublishMapOptions);
23
35
  log: abslog.ValidLogger;
24
36
  cwd: string;
25
37
  server: string;
@@ -27,25 +39,13 @@ export default class PublishMap {
27
39
  name: string;
28
40
  version: string;
29
41
  file: string;
42
+ absoluteFile: string | undefined;
43
+ /**
44
+ * @param {PublishMapOptions} options
45
+ */
46
+ constructor({ logger, cwd, server, token, file, name, version, }: PublishMapOptions);
30
47
  /**
31
48
  * @returns {Promise<PublishMapResult>}
32
49
  */
33
50
  run(): Promise<PublishMapResult>;
34
- absoluteFile: string | undefined;
35
51
  }
36
- export type PublishMapOptions = {
37
- logger?: import("abslog").AbstractLoggerOptions;
38
- server: string;
39
- cwd?: string | undefined;
40
- token: string;
41
- file: string;
42
- name: string;
43
- version: string;
44
- };
45
- export type PublishMapResult = {
46
- server: string;
47
- name: string;
48
- version: string;
49
- type: string;
50
- };
51
- import abslog from "abslog";
@@ -1,3 +1,44 @@
1
+ import abslog from "abslog";
2
+ import { EikConfig } from "@eik/common";
3
+ import ValidateInput from "./tasks/validate-input.js";
4
+ import CreateTempDirectory from "./tasks/create-temp-directory.js";
5
+ import CreateZipFile from "./tasks/create-zip-file.js";
6
+ import CheckBundleSizes from "./tasks/check-bundle-sizes.js";
7
+ import DryRun from "./tasks/dry-run.js";
8
+ import CheckIfAlreadyPublished from "./tasks/check-if-already-published.js";
9
+ import UploadFiles from "./tasks/upload-files.js";
10
+ import SaveMetafile from "./tasks/save-metafile.js";
11
+ import Cleanup from "./tasks/cleanup.js";
12
+ export type PublishOptions = {
13
+ logger?: import('abslog').AbstractLoggerOptions;
14
+ cwd?: string;
15
+ token: string;
16
+ dryRun?: boolean;
17
+ server: string;
18
+ type?: "package" | "map" | "npm" | "image";
19
+ name: string;
20
+ version?: string;
21
+ map?: string[];
22
+ out?: string;
23
+ files: Record<string, string>;
24
+ };
25
+ export type PublishResult = {
26
+ type: string;
27
+ server: string;
28
+ name: string;
29
+ level: unknown;
30
+ dryRun: boolean;
31
+ integrity: string;
32
+ created: unknown;
33
+ author: unknown;
34
+ org: string;
35
+ version: string;
36
+ response: unknown;
37
+ files: Array<{
38
+ pathname: string;
39
+ type: string;
40
+ }>;
41
+ };
1
42
  /**
2
43
  * @typedef {object} PublishOptions
3
44
  * @property {import('abslog').AbstractLoggerOptions} [logger]
@@ -28,10 +69,6 @@
28
69
  * @property {Array<{ pathname: string; type: string; }>} files
29
70
  */
30
71
  export default class Publish {
31
- /**
32
- * @param {PublishOptions} options
33
- */
34
- constructor({ logger, cwd, token, dryRun, server, type, name, version, map, out, files, }: PublishOptions);
35
72
  log: abslog.ValidLogger;
36
73
  cwd: string;
37
74
  dryRun: boolean;
@@ -46,49 +83,12 @@ export default class Publish {
46
83
  uploadFiles: UploadFiles;
47
84
  saveMetafile: SaveMetafile;
48
85
  cleanup: Cleanup;
86
+ /**
87
+ * @param {PublishOptions} options
88
+ */
89
+ constructor({ logger, cwd, token, dryRun, server, type, name, version, map, out, files, }: PublishOptions);
49
90
  /**
50
91
  * @returns {Promise<PublishResult>}
51
92
  */
52
93
  run(): Promise<PublishResult>;
53
94
  }
54
- export type PublishOptions = {
55
- logger?: import("abslog").AbstractLoggerOptions;
56
- cwd?: string | undefined;
57
- token: string;
58
- dryRun?: boolean | undefined;
59
- server: string;
60
- type?: "map" | "package" | "npm" | "image" | undefined;
61
- name: string;
62
- version?: string | undefined;
63
- map?: string[] | undefined;
64
- out?: string | undefined;
65
- files: Record<string, string>;
66
- };
67
- export type PublishResult = {
68
- type: string;
69
- server: string;
70
- name: string;
71
- level: unknown;
72
- dryRun: boolean;
73
- integrity: string;
74
- created: unknown;
75
- author: unknown;
76
- org: string;
77
- version: string;
78
- response: unknown;
79
- files: Array<{
80
- pathname: string;
81
- type: string;
82
- }>;
83
- };
84
- import abslog from "abslog";
85
- import { EikConfig } from "@eik/common";
86
- import ValidateInput from "./tasks/validate-input.js";
87
- import CreateTempDirectory from "./tasks/create-temp-directory.js";
88
- import CreateZipFile from "./tasks/create-zip-file.js";
89
- import CheckBundleSizes from "./tasks/check-bundle-sizes.js";
90
- import DryRun from "./tasks/dry-run.js";
91
- import CheckIfAlreadyPublished from "./tasks/check-if-already-published.js";
92
- import UploadFiles from "./tasks/upload-files.js";
93
- import SaveMetafile from "./tasks/save-metafile.js";
94
- import Cleanup from "./tasks/cleanup.js";
@@ -1,4 +1,4 @@
1
+ import Task from "./task.js";
1
2
  export default class CheckBundleSizes extends Task {
2
3
  process(): Promise<void>;
3
4
  }
4
- import Task from "./task.js";
@@ -1,4 +1,4 @@
1
+ import Task from "./task.js";
1
2
  export default class CheckIfAlreadyPublished extends Task {
2
3
  process(): Promise<string | null>;
3
4
  }
4
- import Task from "./task.js";
@@ -1,4 +1,4 @@
1
+ import Task from "./task.js";
1
2
  export default class Cleanup extends Task {
2
3
  process(): Promise<void>;
3
4
  }
4
- import Task from "./task.js";
@@ -1,4 +1,4 @@
1
+ import Task from "./task.js";
1
2
  export default class CreateTempDir extends Task {
2
3
  process(): Promise<void>;
3
4
  }
4
- import Task from "./task.js";
@@ -1,4 +1,4 @@
1
+ import Task from "./task.js";
1
2
  export default class CreateZipFile extends Task {
2
3
  process(): Promise<string>;
3
4
  }
4
- import Task from "./task.js";
@@ -1,3 +1,4 @@
1
+ import Task from "./task.js";
1
2
  export default class DryRun extends Task {
2
3
  /** @param {string} zipFile */
3
4
  process(zipFile: string): Promise<{
@@ -5,4 +6,3 @@ export default class DryRun extends Task {
5
6
  type: string;
6
7
  }[]>;
7
8
  }
8
- import Task from "./task.js";
@@ -1,5 +1,5 @@
1
+ import Task from "./task.js";
1
2
  export default class SaveMetaFile extends Task {
2
3
  /** @param {any} response */
3
4
  process(response: any): Promise<void>;
4
5
  }
5
- import Task from "./task.js";
@@ -1,9 +1,9 @@
1
+ import abslog from "abslog";
1
2
  export default class Task {
2
- /** @param {any} options */
3
- constructor(options: any);
4
3
  cwd: any;
5
4
  log: abslog.ValidLogger;
6
5
  path: any;
7
6
  config: any;
7
+ /** @param {any} options */
8
+ constructor(options: any);
8
9
  }
9
- import abslog from "abslog";
@@ -1,5 +1,5 @@
1
+ import Task from "./task.js";
1
2
  export default class UploadFiles extends Task {
2
3
  /** @param {string} zipFile */
3
4
  process(zipFile: string): Promise<any>;
4
5
  }
5
- import Task from "./task.js";
@@ -1,4 +1,4 @@
1
+ import Task from "./task.js";
1
2
  export default class ValidateInput extends Task {
2
3
  process(): void;
3
4
  }
4
- import Task from "./task.js";
@@ -1,3 +1,17 @@
1
+ import abslog from "abslog";
2
+ export type VersionOptions = {
3
+ logger?: import('abslog').AbstractLoggerOptions;
4
+ server: string;
5
+ type?: "package" | "npm" | "map";
6
+ name: string;
7
+ version: string;
8
+ level?: import("semver").ReleaseType;
9
+ cwd: string;
10
+ map?: string[];
11
+ out?: string;
12
+ files: string | Record<string, string>;
13
+ configFile?: string;
14
+ };
1
15
  /**
2
16
  * @typedef {object} VersionOptions
3
17
  * @property {import('abslog').AbstractLoggerOptions} [logger]
@@ -13,32 +27,18 @@
13
27
  * @property {string} [configFile="eik.json"]
14
28
  */
15
29
  export default class Version {
16
- /**
17
- * @param {VersionOptions} options
18
- */
19
- constructor({ logger, server, type, name, version, level, cwd, map, out, files, configFile, }: VersionOptions);
20
30
  log: abslog.ValidLogger;
21
31
  config: any;
22
32
  configFile: string;
23
33
  path: any;
24
34
  level: import("semver").ReleaseType;
35
+ /**
36
+ * @param {VersionOptions} options
37
+ */
38
+ constructor({ logger, server, type, name, version, level, cwd, map, out, files, configFile, }: VersionOptions);
25
39
  /**
26
40
  * Similar to `npm version`, but updates `eik.json`
27
41
  * @returns {Promise<string | null>} The new version number, or null if the versioning failed
28
42
  */
29
43
  run(): Promise<string | null>;
30
44
  }
31
- export type VersionOptions = {
32
- logger?: import("abslog").AbstractLoggerOptions;
33
- server: string;
34
- type?: "map" | "package" | "npm" | undefined;
35
- name: string;
36
- version: string;
37
- level?: import("semver").ReleaseType | undefined;
38
- cwd: string;
39
- map?: string[] | undefined;
40
- out?: string | undefined;
41
- files: string | Record<string, string>;
42
- configFile?: string | undefined;
43
- };
44
- import abslog from "abslog";
@@ -1,2 +1,12 @@
1
- declare function _default(hash1: string, hash2: string): boolean;
2
1
  export default _default;
2
+ /**
3
+ * Compares 2 hash strings for comparison. Returns `true` if hashes are identical, false otherwise.
4
+ *
5
+ * @param {string} hash1 - first hash string to compare
6
+ * @param {string} hash2 - second hash string to compare
7
+ *
8
+ * @returns {boolean}
9
+ *
10
+ * @example hash.compare('a1b22c23d24e25f4g33a123b23c34', 'a1b22c23d24e25f4g33a123b23c34');
11
+ */
12
+ declare function _default(hash1: string, hash2: string): boolean;
@@ -1,2 +1,11 @@
1
- declare function _default(path: string): Promise<string>;
2
1
  export default _default;
2
+ /**
3
+ * Reads a file from a given path and produces and returns an integrity hash from its contents
4
+ *
5
+ * @param {string} path - path to file to hash
6
+ *
7
+ * @returns {Promise<string>} - integrity hash
8
+ *
9
+ * @example hash.file('/path/to/file.js');
10
+ */
11
+ declare function _default(path: string): Promise<string>;
@@ -1,2 +1,11 @@
1
- declare function _default(files: string[]): Promise<string>;
2
1
  export default _default;
2
+ /**
3
+ * Reads files from given paths and produces and returns an integrity hash from all files contents
4
+ *
5
+ * @param {string[]} files - an array of file paths
6
+ *
7
+ * @returns {Promise<string>} - integrity string
8
+ *
9
+ * @example hash.files(['/path/to/file1.js', '/path/to/file2.js']);
10
+ */
11
+ declare function _default(files: string[]): Promise<string>;
@@ -1,2 +1,14 @@
1
- declare function _default(server: string, type: string, name: string, version: string): Promise<string | null>;
2
1
  export default _default;
2
+ /**
3
+ * Fetches package integrity string by name and version from a given Eik asset server.
4
+ *
5
+ * @param {string} server - Eik asset server URL to perform lookup against
6
+ * @param {string} type - Package type (pkg, npm, map)
7
+ * @param {string} name - Package name to lookup
8
+ * @param {string} version - Semver major version to lock fetch to
9
+ *
10
+ * @returns {Promise<string|null>} - Package integrity string
11
+ *
12
+ * @throws Error
13
+ */
14
+ declare function _default(server: string, type: string, name: string, version: string): Promise<string | null>;
@@ -1,12 +1,11 @@
1
- export default request;
2
1
  export type RequestOptions = {
3
- method?: string | undefined;
2
+ method?: string;
4
3
  host: string;
5
4
  pathname: string;
6
5
  data?: unknown;
7
- file?: string | undefined;
8
- map?: string | undefined;
9
- token?: string | undefined;
6
+ file?: string;
7
+ map?: string;
8
+ token?: string;
10
9
  };
11
10
  /**
12
11
  * @typedef {object} RequestOptions
@@ -31,3 +30,4 @@ declare function request(options: RequestOptions): Promise<{
31
30
  status: number;
32
31
  message: any;
33
32
  }>;
33
+ export default request;
@@ -1,5 +1,16 @@
1
+ export default _default;
2
+ /**
3
+ * Fetches package versions by name from a given Eik asset server.
4
+ *
5
+ * @param {string} server - Eik asset server URL to perform lookup against
6
+ * @param {string} type - Package type (pkg, npm, map)
7
+ * @param {string} name - Package name to lookup
8
+ *
9
+ * @returns {Promise<[number, {version: string, integrity: string}][]|null>}
10
+ *
11
+ * @throws Error
12
+ */
1
13
  declare function _default(server: string, type: string, name: string): Promise<[number, {
2
14
  version: string;
3
15
  integrity: string;
4
16
  }][] | null>;
5
- export default _default;
@@ -1,5 +1,22 @@
1
+ export default _default;
2
+ /**
3
+ * Utility function that can be used to write a JavaScript object to a file at a given location.
4
+ *
5
+ * @param {object} meta - JavaScript object to be written as JSON to a file
6
+ * @param {string|{cwd?:string,filename:string}} location - Path string or object describing location for where to write JSON to.
7
+ * If location is a string it can be relative or absolute.
8
+ * If location is an object, `pathname` must be given which can be relative or absolute. `cwd` can also be given to define the current working directory.
9
+ * @returns {Promise<undefined>}
10
+ *
11
+ * @example json.write({ key: 'value' }, '/path/to/file.json');
12
+ * @example json.write({ key: 'value' }, './relative/path/to/file.json');
13
+ * @example json.write({ key: 'value' }, { filename: '/path/to/file.json' });
14
+ * @example json.write({ key: 'value' }, { filename: './relative/path/to/file.json' });
15
+ * @example json.write({ key: 'value' }, { filename: './relative/path/to/file.json', cwd: '/path/to/cwd' });
16
+ *
17
+ * @throws Error
18
+ */
1
19
  declare function _default(meta: object | undefined, location: string | {
2
20
  cwd?: string;
3
21
  filename: string;
4
22
  }): Promise<undefined>;
5
- export default _default;
@@ -3,4 +3,4 @@
3
3
  * @param {...string} parts
4
4
  * @returns {string}
5
5
  */
6
- export function joinUrlPathname(...parts: string[]): string;
6
+ export declare function joinUrlPathname(...parts: string[]): string;