@wvb/config 0.1.0-next.68e19d2 → 0.1.0-next.7e38986

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/dist/index.cjs CHANGED
@@ -1,8 +1,7 @@
1
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region src/config.ts
3
3
  function defineConfig(config) {
4
4
  return config;
5
5
  }
6
-
7
6
  //#endregion
8
- exports.defineConfig = defineConfig;
7
+ exports.defineConfig = defineConfig;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,21 @@
1
- import { n as RemoteConfig } from "./index-C5v3A9IM.cjs";
1
+ import { C as BundleNameResolver, S as BundleInfoResolverParams, T as PackageJson, g as IntegrityMakeConfig, l as SignatureSignConfig, n as RemoteConfig, w as VersionResolver } from "./index-UT0J3u_e.cjs";
2
2
 
3
+ //#region ../node/index.d.ts
4
+ interface HttpOptions {
5
+ defaultHeaders?: Record<string, string>;
6
+ userAgent?: string;
7
+ timeout?: number;
8
+ readTimeout?: number;
9
+ connectTimeout?: number;
10
+ poolIdleTimeout?: number;
11
+ poolMaxIdlePerHost?: number;
12
+ referer?: boolean;
13
+ tcpNodelay?: boolean;
14
+ hickoryDns?: boolean;
15
+ }
16
+ //#endregion
3
17
  //#region src/builtin.d.ts
4
- type RemoteBundleMatches = string | RegExp | Array<string | RegExp> | ((info: {
18
+ type BuiltinBundleMatches = string | RegExp | Array<string | RegExp> | ((info: {
5
19
  name: string;
6
20
  version: string;
7
21
  }) => boolean | Promise<boolean>);
@@ -10,27 +24,66 @@ interface BuiltinDownloadConfig {
10
24
  * Concurrency of the download bundles.
11
25
  */
12
26
  concurrency?: number;
27
+ http?: HttpOptions;
28
+ }
29
+ /**
30
+ * Install builtin bundles from a remote target.
31
+ */
32
+ interface BuiltinRemoteTargetConfig extends Pick<RemoteConfig, "endpoint"> {
33
+ download?: BuiltinDownloadConfig;
13
34
  }
35
+ /**
36
+ * Install builtin bundles from a local target.
37
+ */
38
+ interface BuiltinLocalTargetConfig {
39
+ /**
40
+ * Workspace directory path to install builtin bundles.
41
+ * Glob pattern is supported.
42
+ *
43
+ * Automatically resolve the workspace directory which includes a config file inside.
44
+ * (e.g. wvb.config.ts)
45
+ */
46
+ workspaces: string[] | (() => string[] | Promise<string[]>);
47
+ bundleName?: BundleNameResolver;
48
+ version?: VersionResolver;
49
+ integrity?: boolean | IntegrityMakeConfig;
50
+ signature?: SignatureSignConfig;
51
+ /**
52
+ * Whether to pack the bundle before installing.
53
+ * This option is used when the workspace detected.
54
+ * @default true
55
+ */
56
+ packBeforeInstall?: boolean;
57
+ }
58
+ type BuiltinTarget = ({
59
+ type: "remote";
60
+ } & BuiltinRemoteTargetConfig) | ({
61
+ type: "local";
62
+ } & BuiltinLocalTargetConfig);
14
63
  interface BuiltinConfig {
15
64
  /**
16
- * Directory path where to download builtin bundles from remote.
65
+ * Directory path where to download builtin bundles from target.
17
66
  * @default ".wvb/builtin/bundles"
18
67
  */
19
68
  outDir?: string;
20
69
  /**
21
- * Patterns to which bundles should be included from remote bundles.
70
+ * Target to install builtin bundles.
71
+ * @default { type: "remote" }
22
72
  */
23
- include?: RemoteBundleMatches;
73
+ target?: BuiltinTarget;
24
74
  /**
25
- * Patterns to which bundles should be excluded from remote bundles.
75
+ * Patterns to which bundles should be included from target bundles.
26
76
  */
27
- exclude?: RemoteBundleMatches;
77
+ include?: BuiltinBundleMatches;
78
+ /**
79
+ * Patterns to which bundles should be excluded from target bundles.
80
+ */
81
+ exclude?: BuiltinBundleMatches;
28
82
  /**
29
83
  * Clean up builtin directory before the operation.
30
84
  * @default true
31
85
  */
32
86
  clean?: boolean;
33
- download?: BuiltinDownloadConfig;
34
87
  }
35
88
  //#endregion
36
89
  //#region src/pack.d.ts
@@ -45,18 +98,20 @@ interface PackConfig {
45
98
  *
46
99
  * All files under this directory will be included in the Webview Bundle.
47
100
  * Use "ignore" to exclude files you don't want to pack.
101
+ *
102
+ * @default "./dist"
48
103
  */
49
104
  srcDir?: string;
50
105
  /**
51
106
  * Directory that out-file should be created.
52
- * @default ".wvb"
107
+ * @default "./.wvb"
53
108
  */
54
109
  outDir?: string;
55
110
  /**
56
111
  * Outfile name to create Webview Bundle archive.
57
112
  * If not provided, default to name field in "package.json" with normalized.
58
113
  */
59
- outFile?: string;
114
+ outFileName?: string;
60
115
  /**
61
116
  * Overwrite out-file if file is already exists
62
117
  * @default true
@@ -67,7 +122,7 @@ interface PackConfig {
67
122
  */
68
123
  ignore?: IgnoreConfig;
69
124
  /**
70
- * Headers to set for each files in the Webview Bundle.
125
+ * Headers to set for each file in the Webview Bundle.
71
126
  *
72
127
  * @example
73
128
  * {
@@ -122,4 +177,4 @@ interface Config {
122
177
  builtin?: BuiltinConfig;
123
178
  }
124
179
  //#endregion
125
- export { type BuiltinConfig, type Config, type ConfigInput, type ConfigInputFn, type ConfigInputFnObj, type ConfigInputFnPromise, type HeadersConfig, type IgnoreConfig, type PackConfig, type RemoteBundleMatches, type ServeConfig, defineConfig };
180
+ export { type BuiltinBundleMatches, type BuiltinConfig, type BuiltinDownloadConfig, type BuiltinLocalTargetConfig, type BuiltinRemoteTargetConfig, type BuiltinTarget, type BundleInfoResolverParams, type BundleNameResolver, type Config, type ConfigInput, type ConfigInputFn, type ConfigInputFnObj, type ConfigInputFnPromise, type HeadersConfig, type IgnoreConfig, type PackConfig, type PackageJson, type ServeConfig, type VersionResolver, defineConfig };
package/dist/index.d.mts CHANGED
@@ -1,7 +1,21 @@
1
- import { n as RemoteConfig } from "./index-f7Ruzcf_.mjs";
1
+ import { C as BundleNameResolver, S as BundleInfoResolverParams, T as PackageJson, g as IntegrityMakeConfig, l as SignatureSignConfig, n as RemoteConfig, w as VersionResolver } from "./index-UT0J3u_e.mjs";
2
2
 
3
+ //#region ../node/index.d.ts
4
+ interface HttpOptions {
5
+ defaultHeaders?: Record<string, string>;
6
+ userAgent?: string;
7
+ timeout?: number;
8
+ readTimeout?: number;
9
+ connectTimeout?: number;
10
+ poolIdleTimeout?: number;
11
+ poolMaxIdlePerHost?: number;
12
+ referer?: boolean;
13
+ tcpNodelay?: boolean;
14
+ hickoryDns?: boolean;
15
+ }
16
+ //#endregion
3
17
  //#region src/builtin.d.ts
4
- type RemoteBundleMatches = string | RegExp | Array<string | RegExp> | ((info: {
18
+ type BuiltinBundleMatches = string | RegExp | Array<string | RegExp> | ((info: {
5
19
  name: string;
6
20
  version: string;
7
21
  }) => boolean | Promise<boolean>);
@@ -10,27 +24,66 @@ interface BuiltinDownloadConfig {
10
24
  * Concurrency of the download bundles.
11
25
  */
12
26
  concurrency?: number;
27
+ http?: HttpOptions;
28
+ }
29
+ /**
30
+ * Install builtin bundles from a remote target.
31
+ */
32
+ interface BuiltinRemoteTargetConfig extends Pick<RemoteConfig, "endpoint"> {
33
+ download?: BuiltinDownloadConfig;
13
34
  }
35
+ /**
36
+ * Install builtin bundles from a local target.
37
+ */
38
+ interface BuiltinLocalTargetConfig {
39
+ /**
40
+ * Workspace directory path to install builtin bundles.
41
+ * Glob pattern is supported.
42
+ *
43
+ * Automatically resolve the workspace directory which includes a config file inside.
44
+ * (e.g. wvb.config.ts)
45
+ */
46
+ workspaces: string[] | (() => string[] | Promise<string[]>);
47
+ bundleName?: BundleNameResolver;
48
+ version?: VersionResolver;
49
+ integrity?: boolean | IntegrityMakeConfig;
50
+ signature?: SignatureSignConfig;
51
+ /**
52
+ * Whether to pack the bundle before installing.
53
+ * This option is used when the workspace detected.
54
+ * @default true
55
+ */
56
+ packBeforeInstall?: boolean;
57
+ }
58
+ type BuiltinTarget = ({
59
+ type: "remote";
60
+ } & BuiltinRemoteTargetConfig) | ({
61
+ type: "local";
62
+ } & BuiltinLocalTargetConfig);
14
63
  interface BuiltinConfig {
15
64
  /**
16
- * Directory path where to download builtin bundles from remote.
65
+ * Directory path where to download builtin bundles from target.
17
66
  * @default ".wvb/builtin/bundles"
18
67
  */
19
68
  outDir?: string;
20
69
  /**
21
- * Patterns to which bundles should be included from remote bundles.
70
+ * Target to install builtin bundles.
71
+ * @default { type: "remote" }
22
72
  */
23
- include?: RemoteBundleMatches;
73
+ target?: BuiltinTarget;
24
74
  /**
25
- * Patterns to which bundles should be excluded from remote bundles.
75
+ * Patterns to which bundles should be included from target bundles.
26
76
  */
27
- exclude?: RemoteBundleMatches;
77
+ include?: BuiltinBundleMatches;
78
+ /**
79
+ * Patterns to which bundles should be excluded from target bundles.
80
+ */
81
+ exclude?: BuiltinBundleMatches;
28
82
  /**
29
83
  * Clean up builtin directory before the operation.
30
84
  * @default true
31
85
  */
32
86
  clean?: boolean;
33
- download?: BuiltinDownloadConfig;
34
87
  }
35
88
  //#endregion
36
89
  //#region src/pack.d.ts
@@ -45,18 +98,20 @@ interface PackConfig {
45
98
  *
46
99
  * All files under this directory will be included in the Webview Bundle.
47
100
  * Use "ignore" to exclude files you don't want to pack.
101
+ *
102
+ * @default "./dist"
48
103
  */
49
104
  srcDir?: string;
50
105
  /**
51
106
  * Directory that out-file should be created.
52
- * @default ".wvb"
107
+ * @default "./.wvb"
53
108
  */
54
109
  outDir?: string;
55
110
  /**
56
111
  * Outfile name to create Webview Bundle archive.
57
112
  * If not provided, default to name field in "package.json" with normalized.
58
113
  */
59
- outFile?: string;
114
+ outFileName?: string;
60
115
  /**
61
116
  * Overwrite out-file if file is already exists
62
117
  * @default true
@@ -67,7 +122,7 @@ interface PackConfig {
67
122
  */
68
123
  ignore?: IgnoreConfig;
69
124
  /**
70
- * Headers to set for each files in the Webview Bundle.
125
+ * Headers to set for each file in the Webview Bundle.
71
126
  *
72
127
  * @example
73
128
  * {
@@ -122,4 +177,4 @@ interface Config {
122
177
  builtin?: BuiltinConfig;
123
178
  }
124
179
  //#endregion
125
- export { type BuiltinConfig, type Config, type ConfigInput, type ConfigInputFn, type ConfigInputFnObj, type ConfigInputFnPromise, type HeadersConfig, type IgnoreConfig, type PackConfig, type RemoteBundleMatches, type ServeConfig, defineConfig };
180
+ export { type BuiltinBundleMatches, type BuiltinConfig, type BuiltinDownloadConfig, type BuiltinLocalTargetConfig, type BuiltinRemoteTargetConfig, type BuiltinTarget, type BundleInfoResolverParams, type BundleNameResolver, type Config, type ConfigInput, type ConfigInputFn, type ConfigInputFnObj, type ConfigInputFnPromise, type HeadersConfig, type IgnoreConfig, type PackConfig, type PackageJson, type ServeConfig, type VersionResolver, defineConfig };
package/dist/index.mjs CHANGED
@@ -2,6 +2,5 @@
2
2
  function defineConfig(config) {
3
3
  return config;
4
4
  }
5
-
6
5
  //#endregion
7
- export { defineConfig };
6
+ export { defineConfig };
@@ -1,5 +1,5 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
1
2
  let node_buffer = require("node:buffer");
2
-
3
3
  //#region src/remote/integrity.ts
4
4
  async function makeIntegrity(maker, data) {
5
5
  if (typeof maker === "function") return maker({ data });
@@ -14,7 +14,6 @@ function hashAlg$1(rasHash) {
14
14
  case "sha512": return "SHA-512";
15
15
  }
16
16
  }
17
-
18
17
  //#endregion
19
18
  //#region src/remote/signature.ts
20
19
  async function signSignature(signer, message) {
@@ -75,7 +74,6 @@ function signAlg(config) {
75
74
  };
76
75
  }
77
76
  }
78
-
79
77
  //#endregion
80
78
  exports.makeIntegrity = makeIntegrity;
81
- exports.signSignature = signSignature;
79
+ exports.signSignature = signSignature;
@@ -1,2 +1,2 @@
1
- import { _ as IntegrityMakeFn, a as RemoteUploadProgress, b as BaseRemoteDeployer, c as SignatureHash, d as SignatureSigner, f as SignatureSigningKeyConfig, g as IntegrityMakeConfig, h as IntegrityAlgorithm, i as RemoteUploadParams, l as SignatureSignConfig, m as signSignature, n as RemoteConfig, o as SignatureAlgorithm, p as SigningKeyFormat, r as BaseRemoteUploader, s as SignatureEcdsaCurve, t as RemoteBundleDeployment, u as SignatureSignFn, v as IntegrityMaker, x as RemoteDeployParams, y as makeIntegrity } from "../index-C5v3A9IM.cjs";
2
- export { BaseRemoteDeployer, BaseRemoteUploader, IntegrityAlgorithm, IntegrityMakeConfig, IntegrityMakeFn, IntegrityMaker, RemoteBundleDeployment, RemoteConfig, RemoteDeployParams, RemoteUploadParams, RemoteUploadProgress, SignatureAlgorithm, SignatureEcdsaCurve, SignatureHash, SignatureSignConfig, SignatureSignFn, SignatureSigner, SignatureSigningKeyConfig, SigningKeyFormat, makeIntegrity, signSignature };
1
+ import { _ as IntegrityMakeFn, a as RemoteUploadProgress, b as BaseRemoteDeployer, c as SignatureHash, d as SignatureSigner, f as SignatureSigningKeyConfig, g as IntegrityMakeConfig, h as IntegrityAlgorithm, i as RemoteUploadParams, l as SignatureSignConfig, m as signSignature, n as RemoteConfig, o as SignatureAlgorithm, p as SigningKeyFormat, r as BaseRemoteUploader, s as SignatureEcdsaCurve, t as RemoteBundleDeployment, u as SignatureSignFn, v as IntegrityMaker, x as RemoteDeployParams, y as makeIntegrity } from "../index-UT0J3u_e.cjs";
2
+ export { type BaseRemoteDeployer, type BaseRemoteUploader, type IntegrityAlgorithm, type IntegrityMakeConfig, type IntegrityMakeFn, type IntegrityMaker, type RemoteBundleDeployment, type RemoteConfig, type RemoteDeployParams, type RemoteUploadParams, type RemoteUploadProgress, type SignatureAlgorithm, type SignatureEcdsaCurve, type SignatureHash, type SignatureSignConfig, type SignatureSignFn, type SignatureSigner, type SignatureSigningKeyConfig, type SigningKeyFormat, makeIntegrity, signSignature };
@@ -1,2 +1,2 @@
1
- import { _ as IntegrityMakeFn, a as RemoteUploadProgress, b as BaseRemoteDeployer, c as SignatureHash, d as SignatureSigner, f as SignatureSigningKeyConfig, g as IntegrityMakeConfig, h as IntegrityAlgorithm, i as RemoteUploadParams, l as SignatureSignConfig, m as signSignature, n as RemoteConfig, o as SignatureAlgorithm, p as SigningKeyFormat, r as BaseRemoteUploader, s as SignatureEcdsaCurve, t as RemoteBundleDeployment, u as SignatureSignFn, v as IntegrityMaker, x as RemoteDeployParams, y as makeIntegrity } from "../index-f7Ruzcf_.mjs";
2
- export { BaseRemoteDeployer, BaseRemoteUploader, IntegrityAlgorithm, IntegrityMakeConfig, IntegrityMakeFn, IntegrityMaker, RemoteBundleDeployment, RemoteConfig, RemoteDeployParams, RemoteUploadParams, RemoteUploadProgress, SignatureAlgorithm, SignatureEcdsaCurve, SignatureHash, SignatureSignConfig, SignatureSignFn, SignatureSigner, SignatureSigningKeyConfig, SigningKeyFormat, makeIntegrity, signSignature };
1
+ import { _ as IntegrityMakeFn, a as RemoteUploadProgress, b as BaseRemoteDeployer, c as SignatureHash, d as SignatureSigner, f as SignatureSigningKeyConfig, g as IntegrityMakeConfig, h as IntegrityAlgorithm, i as RemoteUploadParams, l as SignatureSignConfig, m as signSignature, n as RemoteConfig, o as SignatureAlgorithm, p as SigningKeyFormat, r as BaseRemoteUploader, s as SignatureEcdsaCurve, t as RemoteBundleDeployment, u as SignatureSignFn, v as IntegrityMaker, x as RemoteDeployParams, y as makeIntegrity } from "../index-UT0J3u_e.mjs";
2
+ export { type BaseRemoteDeployer, type BaseRemoteUploader, type IntegrityAlgorithm, type IntegrityMakeConfig, type IntegrityMakeFn, type IntegrityMaker, type RemoteBundleDeployment, type RemoteConfig, type RemoteDeployParams, type RemoteUploadParams, type RemoteUploadProgress, type SignatureAlgorithm, type SignatureEcdsaCurve, type SignatureHash, type SignatureSignConfig, type SignatureSignFn, type SignatureSigner, type SignatureSigningKeyConfig, type SigningKeyFormat, makeIntegrity, signSignature };
@@ -1,5 +1,4 @@
1
1
  import { Buffer } from "node:buffer";
2
-
3
2
  //#region src/remote/integrity.ts
4
3
  async function makeIntegrity(maker, data) {
5
4
  if (typeof maker === "function") return maker({ data });
@@ -14,7 +13,6 @@ function hashAlg$1(rasHash) {
14
13
  case "sha512": return "SHA-512";
15
14
  }
16
15
  }
17
-
18
16
  //#endregion
19
17
  //#region src/remote/signature.ts
20
18
  async function signSignature(signer, message) {
@@ -75,6 +73,5 @@ function signAlg(config) {
75
73
  };
76
74
  }
77
75
  }
78
-
79
76
  //#endregion
80
- export { makeIntegrity, signSignature };
77
+ export { makeIntegrity, signSignature };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wvb/config",
3
- "version": "0.1.0-next.68e19d2",
3
+ "version": "0.1.0-next.7e38986",
4
4
  "description": "Configuration for webview bundle",
5
5
  "homepage": "https://github.com/webview-bundle/webview-bundle",
6
6
  "bugs": {
@@ -42,9 +42,11 @@
42
42
  "typecheck": "tsc --noEmit"
43
43
  },
44
44
  "devDependencies": {
45
- "@types/node": "22.19.3",
46
- "tsdown": "0.20.1",
47
- "typescript": "5.9.3",
48
- "vitest": "4.1.5"
45
+ "@types/node": "25.9.1",
46
+ "@wvb/node": "^0.1.0-next.7e38986",
47
+ "tsdown": "0.22.1",
48
+ "type-fest": "^4.40.1",
49
+ "typescript": "6.0.3",
50
+ "vitest": "4.1.8"
49
51
  }
50
52
  }
@@ -1,112 +0,0 @@
1
- import { Buffer } from "node:buffer";
2
-
3
- //#region src/remote/deployer.d.ts
4
- interface RemoteDeployParams {
5
- bundleName: string;
6
- version: string;
7
- channel?: string;
8
- }
9
- interface BaseRemoteDeployer {
10
- deploy(params: RemoteDeployParams): Promise<void>;
11
- }
12
- //#endregion
13
- //#region src/remote/integrity.d.ts
14
- type IntegrityAlgorithm = "sha256" | "sha384" | "sha512";
15
- interface IntegrityMakeConfig {
16
- algorithm?: IntegrityAlgorithm;
17
- }
18
- type IntegrityMakeFn = (params: {
19
- data: Buffer;
20
- }) => Promise<string>;
21
- type IntegrityMaker = IntegrityMakeConfig | IntegrityMakeFn;
22
- declare function makeIntegrity(maker: IntegrityMaker, data: Buffer): Promise<string>;
23
- //#endregion
24
- //#region src/remote/signature.d.ts
25
- type SignatureAlgorithm = "ecdsa" | "ed25519" | "rsa-pkcs1-v1.5" | "rsa-pss";
26
- type SignatureEcdsaCurve = "p256" | "p384";
27
- type SignatureHash = "sha256" | "sha384" | "sha512";
28
- type SigningKeyFormat = "raw" | "pkcs8" | "spki" | "jwk";
29
- type SignatureSigningKeyConfig = {
30
- format: "jwk";
31
- data: JsonWebKey;
32
- } | {
33
- format: Exclude<SigningKeyFormat, "jwk">;
34
- data: Buffer;
35
- };
36
- type SignatureSignConfig = {
37
- algorithm: "ecdsa";
38
- curve: SignatureEcdsaCurve;
39
- hash: SignatureHash;
40
- key: SignatureSigningKeyConfig;
41
- } | {
42
- algorithm: "rsa-pkcs1-v1.5";
43
- hash: SignatureHash;
44
- key: SignatureSigningKeyConfig;
45
- } | {
46
- algorithm: "rsa-pss";
47
- hash: SignatureHash;
48
- saltLength?: number;
49
- key: SignatureSigningKeyConfig;
50
- } | {
51
- algorithm: Exclude<SignatureAlgorithm, "ecdsa" | "rsa-pkcs1-v1.5" | "rsa-pss">;
52
- key: SignatureSigningKeyConfig;
53
- };
54
- type SignatureSignFn = (params: {
55
- message: Buffer;
56
- }) => Promise<string>;
57
- type SignatureSigner = SignatureSignConfig | SignatureSignFn;
58
- declare function signSignature(signer: SignatureSigner, message: Buffer): Promise<string>;
59
- //#endregion
60
- //#region src/remote/uploader.d.ts
61
- interface RemoteUploadParams {
62
- bundle: Buffer;
63
- bundleName: string;
64
- version: string;
65
- force?: boolean;
66
- integrity?: string;
67
- signature?: string;
68
- }
69
- interface RemoteUploadProgress {
70
- /** Number of bytes successfully transferred so far */
71
- loaded?: number;
72
- /** Total payload size in byres */
73
- total?: number;
74
- /** 1-based multipart part index currently being uploaded */
75
- part?: number;
76
- }
77
- interface BaseRemoteUploader {
78
- _onUploadProgress?: (progress: RemoteUploadProgress) => void;
79
- upload(params: RemoteUploadParams): Promise<void>;
80
- }
81
- //#endregion
82
- //#region src/remote/config.d.ts
83
- interface RemoteConfig {
84
- /**
85
- * Endpoint to remote server.
86
- */
87
- endpoint: string;
88
- /**
89
- * Name of the bundle to be used in remote.
90
- */
91
- bundleName?: string | (() => string | Promise<string>);
92
- /**
93
- * Name of the bundle to be used in remote.
94
- */
95
- version?: string | (() => string | Promise<string>);
96
- uploader?: BaseRemoteUploader;
97
- deployer?: BaseRemoteDeployer;
98
- integrity?: boolean | IntegrityMakeConfig;
99
- signature?: SignatureSignConfig;
100
- }
101
- //#endregion
102
- //#region src/remote/types.d.ts
103
- interface RemoteBundleDeployment {
104
- /** The name of the bundle */
105
- name: string;
106
- /** Current deployed version of the bundle */
107
- version?: string;
108
- /** Versions deployed in each channel */
109
- channels?: Record<string, string>;
110
- }
111
- //#endregion
112
- export { IntegrityMakeFn as _, RemoteUploadProgress as a, BaseRemoteDeployer as b, SignatureHash as c, SignatureSigner as d, SignatureSigningKeyConfig as f, IntegrityMakeConfig as g, IntegrityAlgorithm as h, RemoteUploadParams as i, SignatureSignConfig as l, signSignature as m, RemoteConfig as n, SignatureAlgorithm as o, SigningKeyFormat as p, BaseRemoteUploader as r, SignatureEcdsaCurve as s, RemoteBundleDeployment as t, SignatureSignFn as u, IntegrityMaker as v, RemoteDeployParams as x, makeIntegrity as y };
@@ -1,112 +0,0 @@
1
- import { Buffer } from "node:buffer";
2
-
3
- //#region src/remote/deployer.d.ts
4
- interface RemoteDeployParams {
5
- bundleName: string;
6
- version: string;
7
- channel?: string;
8
- }
9
- interface BaseRemoteDeployer {
10
- deploy(params: RemoteDeployParams): Promise<void>;
11
- }
12
- //#endregion
13
- //#region src/remote/integrity.d.ts
14
- type IntegrityAlgorithm = "sha256" | "sha384" | "sha512";
15
- interface IntegrityMakeConfig {
16
- algorithm?: IntegrityAlgorithm;
17
- }
18
- type IntegrityMakeFn = (params: {
19
- data: Buffer;
20
- }) => Promise<string>;
21
- type IntegrityMaker = IntegrityMakeConfig | IntegrityMakeFn;
22
- declare function makeIntegrity(maker: IntegrityMaker, data: Buffer): Promise<string>;
23
- //#endregion
24
- //#region src/remote/signature.d.ts
25
- type SignatureAlgorithm = "ecdsa" | "ed25519" | "rsa-pkcs1-v1.5" | "rsa-pss";
26
- type SignatureEcdsaCurve = "p256" | "p384";
27
- type SignatureHash = "sha256" | "sha384" | "sha512";
28
- type SigningKeyFormat = "raw" | "pkcs8" | "spki" | "jwk";
29
- type SignatureSigningKeyConfig = {
30
- format: "jwk";
31
- data: JsonWebKey;
32
- } | {
33
- format: Exclude<SigningKeyFormat, "jwk">;
34
- data: Buffer;
35
- };
36
- type SignatureSignConfig = {
37
- algorithm: "ecdsa";
38
- curve: SignatureEcdsaCurve;
39
- hash: SignatureHash;
40
- key: SignatureSigningKeyConfig;
41
- } | {
42
- algorithm: "rsa-pkcs1-v1.5";
43
- hash: SignatureHash;
44
- key: SignatureSigningKeyConfig;
45
- } | {
46
- algorithm: "rsa-pss";
47
- hash: SignatureHash;
48
- saltLength?: number;
49
- key: SignatureSigningKeyConfig;
50
- } | {
51
- algorithm: Exclude<SignatureAlgorithm, "ecdsa" | "rsa-pkcs1-v1.5" | "rsa-pss">;
52
- key: SignatureSigningKeyConfig;
53
- };
54
- type SignatureSignFn = (params: {
55
- message: Buffer;
56
- }) => Promise<string>;
57
- type SignatureSigner = SignatureSignConfig | SignatureSignFn;
58
- declare function signSignature(signer: SignatureSigner, message: Buffer): Promise<string>;
59
- //#endregion
60
- //#region src/remote/uploader.d.ts
61
- interface RemoteUploadParams {
62
- bundle: Buffer;
63
- bundleName: string;
64
- version: string;
65
- force?: boolean;
66
- integrity?: string;
67
- signature?: string;
68
- }
69
- interface RemoteUploadProgress {
70
- /** Number of bytes successfully transferred so far */
71
- loaded?: number;
72
- /** Total payload size in byres */
73
- total?: number;
74
- /** 1-based multipart part index currently being uploaded */
75
- part?: number;
76
- }
77
- interface BaseRemoteUploader {
78
- _onUploadProgress?: (progress: RemoteUploadProgress) => void;
79
- upload(params: RemoteUploadParams): Promise<void>;
80
- }
81
- //#endregion
82
- //#region src/remote/config.d.ts
83
- interface RemoteConfig {
84
- /**
85
- * Endpoint to remote server.
86
- */
87
- endpoint: string;
88
- /**
89
- * Name of the bundle to be used in remote.
90
- */
91
- bundleName?: string | (() => string | Promise<string>);
92
- /**
93
- * Name of the bundle to be used in remote.
94
- */
95
- version?: string | (() => string | Promise<string>);
96
- uploader?: BaseRemoteUploader;
97
- deployer?: BaseRemoteDeployer;
98
- integrity?: boolean | IntegrityMakeConfig;
99
- signature?: SignatureSignConfig;
100
- }
101
- //#endregion
102
- //#region src/remote/types.d.ts
103
- interface RemoteBundleDeployment {
104
- /** The name of the bundle */
105
- name: string;
106
- /** Current deployed version of the bundle */
107
- version?: string;
108
- /** Versions deployed in each channel */
109
- channels?: Record<string, string>;
110
- }
111
- //#endregion
112
- export { IntegrityMakeFn as _, RemoteUploadProgress as a, BaseRemoteDeployer as b, SignatureHash as c, SignatureSigner as d, SignatureSigningKeyConfig as f, IntegrityMakeConfig as g, IntegrityAlgorithm as h, RemoteUploadParams as i, SignatureSignConfig as l, signSignature as m, RemoteConfig as n, SignatureAlgorithm as o, SigningKeyFormat as p, BaseRemoteUploader as r, SignatureEcdsaCurve as s, RemoteBundleDeployment as t, SignatureSignFn as u, IntegrityMaker as v, RemoteDeployParams as x, makeIntegrity as y };