@wvb/config 0.1.0-next.e0bfd59 → 0.1.0-next.e459de3

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.
@@ -0,0 +1,740 @@
1
+ import { Buffer } from "node:buffer";
2
+
3
+ //#region ../../node_modules/type-fest/source/primitive.d.ts
4
+ /**
5
+ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
6
+
7
+ @category Type
8
+ */
9
+ type Primitive = null | undefined | string | number | boolean | symbol | bigint;
10
+ //#endregion
11
+ //#region ../../node_modules/type-fest/source/basic.d.ts
12
+ /**
13
+ Matches a JSON object.
14
+
15
+ This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
16
+
17
+ @category JSON
18
+ */
19
+ type JsonObject = { [Key in string]: JsonValue } & { [Key in string]?: JsonValue | undefined };
20
+ /**
21
+ Matches a JSON array.
22
+
23
+ @category JSON
24
+ */
25
+ type JsonArray = JsonValue[] | readonly JsonValue[];
26
+ /**
27
+ Matches any valid JSON primitive value.
28
+
29
+ @category JSON
30
+ */
31
+ type JsonPrimitive = string | number | boolean | null;
32
+ /**
33
+ Matches any valid JSON value.
34
+
35
+ @see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.
36
+
37
+ @category JSON
38
+ */
39
+ type JsonValue = JsonPrimitive | JsonObject | JsonArray;
40
+ //#endregion
41
+ //#region ../../node_modules/type-fest/source/observable-like.d.ts
42
+ declare global {
43
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
44
+ interface SymbolConstructor {
45
+ readonly observable: symbol;
46
+ }
47
+ }
48
+ /**
49
+ @remarks
50
+ The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
51
+ As well, some guidance on making an `Observable` to not include `closed` property.
52
+ @see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
53
+ @see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
54
+ @see https://github.com/benlesh/symbol-observable#making-an-object-observable
55
+
56
+ @category Observable
57
+ */
58
+ //#endregion
59
+ //#region ../../node_modules/type-fest/source/literal-union.d.ts
60
+ /**
61
+ Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
62
+
63
+ Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
64
+
65
+ This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
66
+
67
+ @example
68
+ ```
69
+ import type {LiteralUnion} from 'type-fest';
70
+
71
+ // Before
72
+
73
+ type Pet = 'dog' | 'cat' | string;
74
+
75
+ const pet: Pet = '';
76
+ // Start typing in your TypeScript-enabled IDE.
77
+ // You **will not** get auto-completion for `dog` and `cat` literals.
78
+
79
+ // After
80
+
81
+ type Pet2 = LiteralUnion<'dog' | 'cat', string>;
82
+
83
+ const pet: Pet2 = '';
84
+ // You **will** get auto-completion for `dog` and `cat` literals.
85
+ ```
86
+
87
+ @category Type
88
+ */
89
+ type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
90
+ //#endregion
91
+ //#region ../../node_modules/type-fest/source/package-json.d.ts
92
+ declare namespace PackageJson {
93
+ /**
94
+ A person who has been involved in creating or maintaining the package.
95
+ */
96
+ export type Person = string | {
97
+ name: string;
98
+ url?: string;
99
+ email?: string;
100
+ };
101
+ export type BugsLocation = string | {
102
+ /**
103
+ The URL to the package's issue tracker.
104
+ */
105
+ url?: string;
106
+ /**
107
+ The email address to which issues should be reported.
108
+ */
109
+ email?: string;
110
+ };
111
+ export type DirectoryLocations = {
112
+ [directoryType: string]: JsonValue | undefined;
113
+ /**
114
+ Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder.
115
+ */
116
+ bin?: string;
117
+ /**
118
+ Location for Markdown files.
119
+ */
120
+ doc?: string;
121
+ /**
122
+ Location for example scripts.
123
+ */
124
+ example?: string;
125
+ /**
126
+ Location for the bulk of the library.
127
+ */
128
+ lib?: string;
129
+ /**
130
+ Location for man pages. Sugar to generate a `man` array by walking the folder.
131
+ */
132
+ man?: string;
133
+ /**
134
+ Location for test files.
135
+ */
136
+ test?: string;
137
+ };
138
+ export type Scripts = {
139
+ /**
140
+ Run **before** the package is published (Also run on local `npm install` without any arguments).
141
+ */
142
+ prepublish?: string;
143
+ /**
144
+ Run both **before** the package is packed and published, and on local `npm install` without any arguments. This is run **after** `prepublish`, but **before** `prepublishOnly`.
145
+ */
146
+ prepare?: string;
147
+ /**
148
+ Run **before** the package is prepared and packed, **only** on `npm publish`.
149
+ */
150
+ prepublishOnly?: string;
151
+ /**
152
+ Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies).
153
+ */
154
+ prepack?: string;
155
+ /**
156
+ Run **after** the tarball has been generated and moved to its final destination.
157
+ */
158
+ postpack?: string;
159
+ /**
160
+ Run **after** the package is published.
161
+ */
162
+ publish?: string;
163
+ /**
164
+ Run **after** the package is published.
165
+ */
166
+ postpublish?: string;
167
+ /**
168
+ Run **before** the package is installed.
169
+ */
170
+ preinstall?: string;
171
+ /**
172
+ Run **after** the package is installed.
173
+ */
174
+ install?: string;
175
+ /**
176
+ Run **after** the package is installed and after `install`.
177
+ */
178
+ postinstall?: string;
179
+ /**
180
+ Run **before** the package is uninstalled and before `uninstall`.
181
+ */
182
+ preuninstall?: string;
183
+ /**
184
+ Run **before** the package is uninstalled.
185
+ */
186
+ uninstall?: string;
187
+ /**
188
+ Run **after** the package is uninstalled.
189
+ */
190
+ postuninstall?: string;
191
+ /**
192
+ Run **before** bump the package version and before `version`.
193
+ */
194
+ preversion?: string;
195
+ /**
196
+ Run **before** bump the package version.
197
+ */
198
+ version?: string;
199
+ /**
200
+ Run **after** bump the package version.
201
+ */
202
+ postversion?: string;
203
+ /**
204
+ Run with the `npm test` command, before `test`.
205
+ */
206
+ pretest?: string;
207
+ /**
208
+ Run with the `npm test` command.
209
+ */
210
+ test?: string;
211
+ /**
212
+ Run with the `npm test` command, after `test`.
213
+ */
214
+ posttest?: string;
215
+ /**
216
+ Run with the `npm stop` command, before `stop`.
217
+ */
218
+ prestop?: string;
219
+ /**
220
+ Run with the `npm stop` command.
221
+ */
222
+ stop?: string;
223
+ /**
224
+ Run with the `npm stop` command, after `stop`.
225
+ */
226
+ poststop?: string;
227
+ /**
228
+ Run with the `npm start` command, before `start`.
229
+ */
230
+ prestart?: string;
231
+ /**
232
+ Run with the `npm start` command.
233
+ */
234
+ start?: string;
235
+ /**
236
+ Run with the `npm start` command, after `start`.
237
+ */
238
+ poststart?: string;
239
+ /**
240
+ Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
241
+ */
242
+ prerestart?: string;
243
+ /**
244
+ Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
245
+ */
246
+ restart?: string;
247
+ /**
248
+ Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
249
+ */
250
+ postrestart?: string;
251
+ } & Partial<Record<string, string>>;
252
+ /**
253
+ Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL.
254
+ */
255
+ export type Dependency = Partial<Record<string, string>>;
256
+ /**
257
+ A mapping of conditions and the paths to which they resolve.
258
+ */
259
+ type ExportConditions = {
260
+ // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
261
+ [condition: string]: Exports;
262
+ };
263
+ /**
264
+ Entry points of a module, optionally with conditions and subpath exports.
265
+ */
266
+ export type Exports = null | string | Array<string | ExportConditions> | ExportConditions;
267
+ /**
268
+ Import map entries of a module, optionally with conditions and subpath imports.
269
+ */
270
+ export type Imports = {
271
+ // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
272
+ [key: `#${string}`]: Exports;
273
+ }; // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
274
+ export interface NonStandardEntryPoints {
275
+ /**
276
+ An ECMAScript module ID that is the primary entry point to the program.
277
+ */
278
+ module?: string;
279
+ /**
280
+ A module ID with untranspiled code that is the primary entry point to the program.
281
+ */
282
+ esnext?: string | {
283
+ [moduleName: string]: string | undefined;
284
+ main?: string;
285
+ browser?: string;
286
+ };
287
+ /**
288
+ A hint to JavaScript bundlers or component tools when packaging modules for client side use.
289
+ */
290
+ browser?: string | Partial<Record<string, string | false>>;
291
+ /**
292
+ Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused.
293
+ [Read more.](https://webpack.js.org/guides/tree-shaking/)
294
+ */
295
+ sideEffects?: boolean | string[];
296
+ }
297
+ export type TypeScriptConfiguration = {
298
+ /**
299
+ Location of the bundled TypeScript declaration file.
300
+ */
301
+ types?: string;
302
+ /**
303
+ Version selection map of TypeScript.
304
+ */
305
+ typesVersions?: Partial<Record<string, Partial<Record<string, string[]>>>>;
306
+ /**
307
+ Location of the bundled TypeScript declaration file. Alias of `types`.
308
+ */
309
+ typings?: string;
310
+ };
311
+ /**
312
+ An alternative configuration for workspaces.
313
+ */
314
+ export type WorkspaceConfig = {
315
+ /**
316
+ An array of workspace pattern strings which contain the workspace packages.
317
+ */
318
+ packages?: WorkspacePattern[];
319
+ /**
320
+ Designed to solve the problem of packages which break when their `node_modules` are moved to the root workspace directory - a process known as hoisting. For these packages, both within your workspace, and also some that have been installed via `node_modules`, it is important to have a mechanism for preventing the default Yarn workspace behavior. By adding workspace pattern strings here, Yarn will resume non-workspace behavior for any package which matches the defined patterns.
321
+ [Supported](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) by Yarn.
322
+ [Not supported](https://github.com/npm/rfcs/issues/287) by npm.
323
+ */
324
+ nohoist?: WorkspacePattern[];
325
+ };
326
+ /**
327
+ A workspace pattern points to a directory or group of directories which contain packages that should be included in the workspace installation process.
328
+ The patterns are handled with [minimatch](https://github.com/isaacs/minimatch).
329
+ @example
330
+ `docs` → Include the docs directory and install its dependencies.
331
+ `packages/*` → Include all nested directories within the packages directory, like `packages/cli` and `packages/core`.
332
+ */
333
+ type WorkspacePattern = string;
334
+ export type YarnConfiguration = {
335
+ /**
336
+ If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`.
337
+ Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an app), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line.
338
+ */
339
+ flat?: boolean;
340
+ /**
341
+ Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file.
342
+ */
343
+ resolutions?: Dependency;
344
+ };
345
+ export type JSPMConfiguration = {
346
+ /**
347
+ JSPM configuration.
348
+ */
349
+ jspm?: PackageJson;
350
+ };
351
+ /**
352
+ Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Containing standard npm properties.
353
+ */
354
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
355
+ export interface PackageJsonStandard {
356
+ /**
357
+ The name of the package.
358
+ */
359
+ name?: string;
360
+ /**
361
+ Package version, parseable by [`node-semver`](https://github.com/npm/node-semver).
362
+ */
363
+ version?: string;
364
+ /**
365
+ Package description, listed in `npm search`.
366
+ */
367
+ description?: string;
368
+ /**
369
+ Keywords associated with package, listed in `npm search`.
370
+ */
371
+ keywords?: string[];
372
+ /**
373
+ The URL to the package's homepage.
374
+ */
375
+ homepage?: LiteralUnion<'.', string>;
376
+ /**
377
+ The URL to the package's issue tracker and/or the email address to which issues should be reported.
378
+ */
379
+ bugs?: BugsLocation;
380
+ /**
381
+ The license for the package.
382
+ */
383
+ license?: string;
384
+ /**
385
+ The licenses for the package.
386
+ */
387
+ licenses?: Array<{
388
+ type?: string;
389
+ url?: string;
390
+ }>;
391
+ author?: Person;
392
+ /**
393
+ A list of people who contributed to the package.
394
+ */
395
+ contributors?: Person[];
396
+ /**
397
+ A list of people who maintain the package.
398
+ */
399
+ maintainers?: Person[];
400
+ /**
401
+ The files included in the package.
402
+ */
403
+ files?: string[];
404
+ /**
405
+ Resolution algorithm for importing ".js" files from the package's scope.
406
+ [Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field)
407
+ */
408
+ type?: 'module' | 'commonjs';
409
+ /**
410
+ The module ID that is the primary entry point to the program.
411
+ */
412
+ main?: string;
413
+ /**
414
+ Subpath exports to define entry points of the package.
415
+ [Read more.](https://nodejs.org/api/packages.html#subpath-exports)
416
+ */
417
+ exports?: Exports;
418
+ /**
419
+ Subpath imports to define internal package import maps that only apply to import specifiers from within the package itself.
420
+ [Read more.](https://nodejs.org/api/packages.html#subpath-imports)
421
+ */
422
+ imports?: Imports;
423
+ /**
424
+ The executable files that should be installed into the `PATH`.
425
+ */
426
+ bin?: string | Partial<Record<string, string>>;
427
+ /**
428
+ Filenames to put in place for the `man` program to find.
429
+ */
430
+ man?: string | string[];
431
+ /**
432
+ Indicates the structure of the package.
433
+ */
434
+ directories?: DirectoryLocations;
435
+ /**
436
+ Location for the code repository.
437
+ */
438
+ repository?: string | {
439
+ type: string;
440
+ url: string;
441
+ /**
442
+ Relative path to package.json if it is placed in non-root directory (for example if it is part of a monorepo).
443
+ [Read more.](https://github.com/npm/rfcs/blob/latest/implemented/0010-monorepo-subdirectory-declaration.md)
444
+ */
445
+ directory?: string;
446
+ };
447
+ /**
448
+ Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point.
449
+ */
450
+ scripts?: Scripts;
451
+ /**
452
+ Is used to set configuration parameters used in package scripts that persist across upgrades.
453
+ */
454
+ config?: JsonObject;
455
+ /**
456
+ The dependencies of the package.
457
+ */
458
+ dependencies?: Dependency;
459
+ /**
460
+ Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling.
461
+ */
462
+ devDependencies?: Dependency;
463
+ /**
464
+ Dependencies that are skipped if they fail to install.
465
+ */
466
+ optionalDependencies?: Dependency;
467
+ /**
468
+ Dependencies that will usually be required by the package user directly or via another dependency.
469
+ */
470
+ peerDependencies?: Dependency;
471
+ /**
472
+ Indicate peer dependencies that are optional.
473
+ */
474
+ peerDependenciesMeta?: Partial<Record<string, {
475
+ optional: true;
476
+ }>>;
477
+ /**
478
+ Package names that are bundled when the package is published.
479
+ */
480
+ bundledDependencies?: string[];
481
+ /**
482
+ Alias of `bundledDependencies`.
483
+ */
484
+ bundleDependencies?: string[];
485
+ /**
486
+ Engines that this package runs on.
487
+ */
488
+ engines?: { [EngineName in 'npm' | 'node' | string]?: string };
489
+ /**
490
+ @deprecated
491
+ */
492
+ engineStrict?: boolean;
493
+ /**
494
+ Operating systems the module runs on.
495
+ */
496
+ os?: Array<LiteralUnion<'aix' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32' | '!aix' | '!darwin' | '!freebsd' | '!linux' | '!openbsd' | '!sunos' | '!win32', string>>;
497
+ /**
498
+ CPU architectures the module runs on.
499
+ */
500
+ cpu?: Array<LiteralUnion<'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64' | '!arm' | '!arm64' | '!ia32' | '!mips' | '!mipsel' | '!ppc' | '!ppc64' | '!s390' | '!s390x' | '!x32' | '!x64', string>>;
501
+ /**
502
+ If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally.
503
+ @deprecated
504
+ */
505
+ preferGlobal?: boolean;
506
+ /**
507
+ If set to `true`, then npm will refuse to publish it.
508
+ */
509
+ private?: boolean;
510
+ /**
511
+ A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default.
512
+ */
513
+ publishConfig?: PublishConfig;
514
+ /**
515
+ Describes and notifies consumers of a package's monetary support information.
516
+ [Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md)
517
+ */
518
+ funding?: string | {
519
+ /**
520
+ The type of funding.
521
+ */
522
+ type?: LiteralUnion<'github' | 'opencollective' | 'patreon' | 'individual' | 'foundation' | 'corporation', string>;
523
+ /**
524
+ The URL to the funding page.
525
+ */
526
+ url: string;
527
+ };
528
+ /**
529
+ Used to configure [npm workspaces](https://docs.npmjs.com/cli/using-npm/workspaces) / [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/).
530
+ Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run your install command once in order to install all of them in a single pass.
531
+ Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces.
532
+ */
533
+ workspaces?: WorkspacePattern[] | WorkspaceConfig;
534
+ }
535
+ /**
536
+ Type for [`package.json` file used by the Node.js runtime](https://nodejs.org/api/packages.html#nodejs-packagejson-field-definitions).
537
+ */
538
+ export type NodeJsStandard = {
539
+ /**
540
+ Defines which package manager is expected to be used when working on the current project. It can set to any of the [supported package managers](https://nodejs.org/api/corepack.html#supported-package-managers), and will ensure that your teams use the exact same package manager versions without having to install anything else than Node.js.
541
+ __This field is currently experimental and needs to be opted-in; check the [Corepack](https://nodejs.org/api/corepack.html) page for details about the procedure.__
542
+ @example
543
+ ```json
544
+ {
545
+ "packageManager": "<package manager name>@<version>"
546
+ }
547
+ ```
548
+ */
549
+ packageManager?: string;
550
+ };
551
+ export type PublishConfig = {
552
+ /**
553
+ Additional, less common properties from the [npm docs on `publishConfig`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig).
554
+ */
555
+ [additionalProperties: string]: JsonValue | undefined;
556
+ /**
557
+ When publishing scoped packages, the access level defaults to restricted. If you want your scoped package to be publicly viewable (and installable) set `--access=public`. The only valid values for access are public and restricted. Unscoped packages always have an access level of public.
558
+ */
559
+ access?: 'public' | 'restricted';
560
+ /**
561
+ The base URL of the npm registry.
562
+ Default: `'https://registry.npmjs.org/'`
563
+ */
564
+ registry?: string;
565
+ /**
566
+ The tag to publish the package under.
567
+ Default: `'latest'`
568
+ */
569
+ tag?: string;
570
+ };
571
+ }
572
+ /**
573
+ Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn.
574
+
575
+ @category File
576
+ */
577
+ type PackageJson = JsonObject & PackageJson.NodeJsStandard & PackageJson.PackageJsonStandard & PackageJson.NonStandardEntryPoints & PackageJson.TypeScriptConfiguration & PackageJson.YarnConfiguration & PackageJson.JSPMConfiguration;
578
+ //#endregion
579
+ //#region src/common.d.ts
580
+ interface BundleInfoResolverParams {
581
+ /**
582
+ * Resolved "package.json" file data from the package.
583
+ */
584
+ packageJson?: PackageJson;
585
+ /**
586
+ * Absolute path to the package directory.
587
+ */
588
+ dir?: string;
589
+ /**
590
+ * Absolute path to the bundle file.
591
+ */
592
+ file?: string;
593
+ }
594
+ /**
595
+ * Version resolver to determine the version of the bundle to be used in remote or builtin.
596
+ *
597
+ * From "package.json", will use the "version" field from "package.json",
598
+ * if not specified, will be throw error.
599
+ *
600
+ * From "git", will use the "HEAD" commit hash.
601
+ *
602
+ * Or, specify a custom version string or a function that returns a version string.
603
+ *
604
+ * @default { from: 'package.json' }
605
+ */
606
+ type VersionResolver = {
607
+ from: "package.json";
608
+ } | {
609
+ from: "git";
610
+ } | string | ((params: BundleInfoResolverParams) => string | Promise<string>);
611
+ /**
612
+ * Bundle name resolver to determine the name of the bundle to be used in remote or builtin.
613
+ *
614
+ * From "package.json", will use the "name" field from "package.json",
615
+ * if not specified, will be throw error.
616
+ * If "name" is with a scope prefix, it will be removed.
617
+ *
618
+ * Or, specify a custom bundle name string or a function that returns a bundle name string.
619
+ *
620
+ * @default { from: 'package.json' }
621
+ */
622
+ type BundleNameResolver = {
623
+ from: "package.json";
624
+ } | string | ((params: BundleInfoResolverParams) => string | Promise<string>);
625
+ //#endregion
626
+ //#region src/remote/deployer.d.ts
627
+ interface RemoteDeployParams {
628
+ bundleName: string;
629
+ version: string;
630
+ channel?: string;
631
+ }
632
+ interface BaseRemoteDeployer {
633
+ deploy(params: RemoteDeployParams): Promise<void>;
634
+ }
635
+ //#endregion
636
+ //#region src/remote/integrity.d.ts
637
+ type IntegrityAlgorithm = "sha256" | "sha384" | "sha512";
638
+ interface IntegrityMakeConfig {
639
+ algorithm?: IntegrityAlgorithm;
640
+ }
641
+ type IntegrityMakeFn = (params: {
642
+ data: Buffer;
643
+ }) => Promise<string>;
644
+ type IntegrityMaker = IntegrityMakeConfig | IntegrityMakeFn;
645
+ declare function makeIntegrity(maker: IntegrityMaker, data: Buffer): Promise<string>;
646
+ //#endregion
647
+ //#region src/remote/signature.d.ts
648
+ type SignatureAlgorithm = "ecdsa" | "ed25519" | "rsa-pkcs1-v1.5" | "rsa-pss";
649
+ type SignatureEcdsaCurve = "p256" | "p384";
650
+ type SignatureHash = "sha256" | "sha384" | "sha512";
651
+ type SigningKeyFormat = "raw" | "pkcs8" | "spki" | "jwk";
652
+ type SignatureSigningKeyConfig = {
653
+ format: "jwk";
654
+ data: JsonWebKey;
655
+ } | {
656
+ format: Exclude<SigningKeyFormat, "jwk">;
657
+ data: Buffer;
658
+ };
659
+ type SignatureSignConfig = {
660
+ algorithm: "ecdsa";
661
+ curve: SignatureEcdsaCurve;
662
+ hash: SignatureHash;
663
+ key: SignatureSigningKeyConfig;
664
+ } | {
665
+ algorithm: "rsa-pkcs1-v1.5";
666
+ hash: SignatureHash;
667
+ key: SignatureSigningKeyConfig;
668
+ } | {
669
+ algorithm: "rsa-pss";
670
+ hash: SignatureHash;
671
+ saltLength?: number;
672
+ key: SignatureSigningKeyConfig;
673
+ } | {
674
+ algorithm: Exclude<SignatureAlgorithm, "ecdsa" | "rsa-pkcs1-v1.5" | "rsa-pss">;
675
+ key: SignatureSigningKeyConfig;
676
+ };
677
+ type SignatureSignFn = (params: {
678
+ message: Buffer;
679
+ }) => Promise<string>;
680
+ type SignatureSigner = SignatureSignConfig | SignatureSignFn;
681
+ declare function signSignature(signer: SignatureSigner, message: Buffer): Promise<string>;
682
+ //#endregion
683
+ //#region src/remote/uploader.d.ts
684
+ interface RemoteUploadParams {
685
+ bundle: Buffer;
686
+ bundleName: string;
687
+ version: string;
688
+ force?: boolean;
689
+ integrity?: string;
690
+ signature?: string;
691
+ }
692
+ interface RemoteUploadProgress {
693
+ /** Number of bytes successfully transferred so far */
694
+ loaded?: number;
695
+ /** Total payload size in byres */
696
+ total?: number;
697
+ /** 1-based multipart part index currently being uploaded */
698
+ part?: number;
699
+ }
700
+ interface BaseRemoteUploader {
701
+ _onUploadProgress?: (progress: RemoteUploadProgress) => void;
702
+ upload(params: RemoteUploadParams): Promise<void>;
703
+ }
704
+ //#endregion
705
+ //#region src/remote/config.d.ts
706
+ interface RemoteConfig {
707
+ /**
708
+ * Endpoint to remote server.
709
+ */
710
+ endpoint?: string;
711
+ /**
712
+ * Name of the bundle to be used in remote.
713
+ */
714
+ bundleName?: BundleNameResolver;
715
+ /**
716
+ * Version of the bundle to be used in remote.
717
+ */
718
+ version?: VersionResolver;
719
+ /**
720
+ * Whether to pack the bundle before uploading.
721
+ * @default true
722
+ */
723
+ packBeforeUpload?: boolean;
724
+ uploader?: BaseRemoteUploader;
725
+ deployer?: BaseRemoteDeployer;
726
+ integrity?: boolean | IntegrityMakeConfig;
727
+ signature?: SignatureSignConfig;
728
+ }
729
+ //#endregion
730
+ //#region src/remote/types.d.ts
731
+ interface RemoteBundleDeployment {
732
+ /** The name of the bundle */
733
+ name: string;
734
+ /** Current deployed version of the bundle */
735
+ version?: string;
736
+ /** Versions deployed in each channel */
737
+ channels?: Record<string, string>;
738
+ }
739
+ //#endregion
740
+ export { BundleNameResolver as C, BundleInfoResolverParams as S, PackageJson as T, 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, VersionResolver as w, RemoteDeployParams as x, makeIntegrity as y };