verdaccio 6.7.4 → 6.9.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.
- package/README.md +2 -2
- package/bin/verdaccio +5 -1
- package/build/_virtual/_rolldown/runtime.js +23 -0
- package/build/api/debug/index.js +23 -26
- package/build/api/debug/index.js.map +1 -0
- package/build/api/debug/index.mjs +19 -0
- package/build/api/debug/index.mjs.map +1 -0
- package/build/api/endpoint/api/dist-tags.js +62 -75
- package/build/api/endpoint/api/dist-tags.js.map +1 -0
- package/build/api/endpoint/api/dist-tags.mjs +56 -0
- package/build/api/endpoint/api/dist-tags.mjs.map +1 -0
- package/build/api/endpoint/api/package.js +91 -99
- package/build/api/endpoint/api/package.js.map +1 -0
- package/build/api/endpoint/api/package.mjs +89 -0
- package/build/api/endpoint/api/package.mjs.map +1 -0
- package/build/api/endpoint/api/ping.js +13 -11
- package/build/api/endpoint/api/ping.js.map +1 -0
- package/build/api/endpoint/api/ping.mjs +11 -0
- package/build/api/endpoint/api/ping.mjs.map +1 -0
- package/build/api/endpoint/api/publish.d.ts +2 -2
- package/build/api/endpoint/api/publish.js +278 -343
- package/build/api/endpoint/api/publish.js.map +1 -0
- package/build/api/endpoint/api/publish.mjs +280 -0
- package/build/api/endpoint/api/publish.mjs.map +1 -0
- package/build/api/endpoint/api/search.js +57 -105
- package/build/api/endpoint/api/search.js.map +1 -0
- package/build/api/endpoint/api/search.mjs +54 -0
- package/build/api/endpoint/api/search.mjs.map +1 -0
- package/build/api/endpoint/api/star.js +60 -71
- package/build/api/endpoint/api/star.js.map +1 -0
- package/build/api/endpoint/api/star.mjs +54 -0
- package/build/api/endpoint/api/star.mjs.map +1 -0
- package/build/api/endpoint/api/stars.js +40 -40
- package/build/api/endpoint/api/stars.js.map +1 -0
- package/build/api/endpoint/api/stars.mjs +35 -0
- package/build/api/endpoint/api/stars.mjs.map +1 -0
- package/build/api/endpoint/api/user.js +69 -82
- package/build/api/endpoint/api/user.js.map +1 -0
- package/build/api/endpoint/api/user.mjs +64 -0
- package/build/api/endpoint/api/user.mjs.map +1 -0
- package/build/api/endpoint/api/v1/profile.js +50 -67
- package/build/api/endpoint/api/v1/profile.js.map +1 -0
- package/build/api/endpoint/api/v1/profile.mjs +46 -0
- package/build/api/endpoint/api/v1/profile.mjs.map +1 -0
- package/build/api/endpoint/api/v1/search.d.ts +2 -1
- package/build/api/endpoint/api/v1/search.js +149 -168
- package/build/api/endpoint/api/v1/search.js.map +1 -0
- package/build/api/endpoint/api/v1/search.mjs +154 -0
- package/build/api/endpoint/api/v1/search.mjs.map +1 -0
- package/build/api/endpoint/api/v1/token.js +122 -155
- package/build/api/endpoint/api/v1/token.js.map +1 -0
- package/build/api/endpoint/api/v1/token.mjs +119 -0
- package/build/api/endpoint/api/v1/token.mjs.map +1 -0
- package/build/api/endpoint/api/whoami.js +13 -13
- package/build/api/endpoint/api/whoami.js.map +1 -0
- package/build/api/endpoint/api/whoami.mjs +11 -0
- package/build/api/endpoint/api/whoami.mjs.map +1 -0
- package/build/api/endpoint/index.js +58 -67
- package/build/api/endpoint/index.js.map +1 -0
- package/build/api/endpoint/index.mjs +54 -0
- package/build/api/endpoint/index.mjs.map +1 -0
- package/build/api/index.js +85 -106
- package/build/api/index.js.map +1 -0
- package/build/api/index.mjs +78 -0
- package/build/api/index.mjs.map +1 -0
- package/build/api/middleware.js +60 -54
- package/build/api/middleware.js.map +1 -0
- package/build/api/middleware.mjs +55 -0
- package/build/api/middleware.mjs.map +1 -0
- package/build/api/web/api/index.js +25 -29
- package/build/api/web/api/index.js.map +1 -0
- package/build/api/web/api/index.mjs +23 -0
- package/build/api/web/api/index.mjs.map +1 -0
- package/build/api/web/api/package.js +142 -161
- package/build/api/web/api/package.js.map +1 -0
- package/build/api/web/api/package.mjs +139 -0
- package/build/api/web/api/package.mjs.map +1 -0
- package/build/api/web/api/search.js +37 -50
- package/build/api/web/api/search.js.map +1 -0
- package/build/api/web/api/search.mjs +36 -0
- package/build/api/web/api/search.mjs.map +1 -0
- package/build/api/web/api/user.js +52 -73
- package/build/api/web/api/user.js.map +1 -0
- package/build/api/web/api/user.mjs +49 -0
- package/build/api/web/api/user.mjs.map +1 -0
- package/build/api/web/api/utils.js +9 -10
- package/build/api/web/api/utils.js.map +1 -0
- package/build/api/web/api/utils.mjs +11 -0
- package/build/api/web/api/utils.mjs.map +1 -0
- package/build/api/web/index.js +76 -88
- package/build/api/web/index.js.map +1 -0
- package/build/api/web/index.mjs +70 -0
- package/build/api/web/index.mjs.map +1 -0
- package/build/index.js +43 -60
- package/build/index.mjs +5 -0
- package/build/lib/auth-utils.js +12 -14
- package/build/lib/auth-utils.js.map +1 -0
- package/build/lib/auth-utils.mjs +11 -0
- package/build/lib/auth-utils.mjs.map +1 -0
- package/build/lib/bootstrap.js +125 -157
- package/build/lib/bootstrap.js.map +1 -0
- package/build/lib/bootstrap.mjs +125 -0
- package/build/lib/bootstrap.mjs.map +1 -0
- package/build/lib/cli/cli.js +22 -24
- package/build/lib/cli/cli.js.map +1 -0
- package/build/lib/cli/cli.mjs +23 -0
- package/build/lib/cli/cli.mjs.map +1 -0
- package/build/lib/cli/commands/info.js +34 -25
- package/build/lib/cli/commands/info.js.map +1 -0
- package/build/lib/cli/commands/info.mjs +32 -0
- package/build/lib/cli/commands/info.mjs.map +1 -0
- package/build/lib/cli/commands/init.js +61 -79
- package/build/lib/cli/commands/init.js.map +1 -0
- package/build/lib/cli/commands/init.mjs +70 -0
- package/build/lib/cli/commands/init.mjs.map +1 -0
- package/build/lib/cli/commands/version.js +14 -16
- package/build/lib/cli/commands/version.js.map +1 -0
- package/build/lib/cli/commands/version.mjs +14 -0
- package/build/lib/cli/commands/version.mjs.map +1 -0
- package/build/lib/cli/utils.d.ts +2 -2
- package/build/lib/cli/utils.js +16 -15
- package/build/lib/cli/utils.js.map +1 -0
- package/build/lib/cli/utils.mjs +14 -0
- package/build/lib/cli/utils.mjs.map +1 -0
- package/build/lib/cli.js +11 -14
- package/build/lib/cli.js.map +1 -0
- package/build/lib/cli.mjs +12 -0
- package/build/lib/cli.mjs.map +1 -0
- package/build/lib/config.js +19 -21
- package/build/lib/config.js.map +1 -0
- package/build/lib/config.mjs +16 -0
- package/build/lib/config.mjs.map +1 -0
- package/build/lib/constants.js +100 -93
- package/build/lib/constants.js.map +1 -0
- package/build/lib/constants.mjs +28 -0
- package/build/lib/constants.mjs.map +1 -0
- package/build/lib/experiments.js +19 -27
- package/build/lib/experiments.js.map +1 -0
- package/build/lib/experiments.mjs +20 -0
- package/build/lib/experiments.mjs.map +1 -0
- package/build/lib/local-storage.d.ts +5 -2
- package/build/lib/local-storage.js +606 -757
- package/build/lib/local-storage.js.map +1 -0
- package/build/lib/local-storage.mjs +600 -0
- package/build/lib/local-storage.mjs.map +1 -0
- package/build/lib/logger/index.js +24 -19
- package/build/lib/logger/index.js.map +1 -0
- package/build/lib/logger/index.mjs +17 -0
- package/build/lib/logger/index.mjs.map +1 -0
- package/build/lib/metadata-utils.js +24 -36
- package/build/lib/metadata-utils.js.map +1 -0
- package/build/lib/metadata-utils.mjs +23 -0
- package/build/lib/metadata-utils.mjs.map +1 -0
- package/build/lib/run-server.js +83 -114
- package/build/lib/run-server.js.map +1 -0
- package/build/lib/run-server.mjs +82 -0
- package/build/lib/run-server.mjs.map +1 -0
- package/build/lib/storage-utils.d.ts +120 -8
- package/build/lib/storage-utils.js +390 -251
- package/build/lib/storage-utils.js.map +1 -0
- package/build/lib/storage-utils.mjs +400 -0
- package/build/lib/storage-utils.mjs.map +1 -0
- package/build/lib/storage.d.ts +127 -57
- package/build/lib/storage.js +674 -681
- package/build/lib/storage.js.map +1 -0
- package/build/lib/storage.mjs +665 -0
- package/build/lib/storage.mjs.map +1 -0
- package/build/lib/up-storage.js +490 -599
- package/build/lib/up-storage.js.map +1 -0
- package/build/lib/up-storage.mjs +484 -0
- package/build/lib/up-storage.mjs.map +1 -0
- package/build/lib/uplink-util.js +21 -31
- package/build/lib/uplink-util.js.map +1 -0
- package/build/lib/uplink-util.mjs +24 -0
- package/build/lib/uplink-util.mjs.map +1 -0
- package/build/lib/utils.js +172 -231
- package/build/lib/utils.js.map +1 -0
- package/build/lib/utils.mjs +188 -0
- package/build/lib/utils.mjs.map +1 -0
- package/package.json +105 -100
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-server.mjs","names":[],"sources":["../../src/lib/run-server.ts"],"sourcesContent":["import constants from 'constants';\nimport buildDebug from 'debug';\nimport fs from 'fs';\nimport http from 'http';\nimport https from 'https';\nimport _ from 'lodash';\n\nimport { getConfigParsed, getListenAddress } from '@verdaccio/config';\nimport { ConfigYaml, HttpsConfKeyCert, HttpsConfPfx } from '@verdaccio/types';\n\nimport endPointAPI from '../api/index';\nimport { displayExperimentsInfoBox } from './experiments';\nimport { logger } from './logger';\nimport { initLogger } from './utils';\n\nconst debug = buildDebug('verdaccio:run-server');\n\n/**\n * Exposes a server factory to be instantiated programmatically.\n *\n const app = await runServer(); // default configuration\n const app = await runServer('./config/config.yaml');\n const app = await runServer({ configuration });\n app.listen(4000, (event) => {\n // do something\n });\n * @param config\n */\nexport async function runServer(\n config?: string | ConfigYaml,\n options?: { listenArg?: string }\n): Promise<any> {\n const configurationParsed = getConfigParsed(config);\n\n initLogger(configurationParsed);\n // merge flags and experiments for backward compatibility\n const flags = {\n ...(configurationParsed?.flags || {}),\n ...(configurationParsed?.experiments || {}),\n };\n displayExperimentsInfoBox(flags);\n\n const listen = options?.listenArg ?? configurationParsed?.listen;\n const address = getListenAddress(listen, logger);\n\n const app = await endPointAPI(configurationParsed);\n return createServerFactory(configurationParsed, address, app);\n}\n\n/**\n * Return a native HTTP/HTTPS server instance\n * @param config\n * @param addr\n * @param app\n */\nexport function createServerFactory(config: ConfigYaml, addr, app) {\n let serverFactory;\n if (addr.proto === 'https') {\n debug('https enabled');\n try {\n let httpsOptions = {\n // disable insecure SSLv2 and SSLv3\n secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3,\n };\n\n const keyCertConfig = config.https as HttpsConfKeyCert;\n const pfxConfig = config.https as HttpsConfPfx;\n\n // https must either have key and cert or a pfx and (optionally) a passphrase\n if (!((keyCertConfig.key && keyCertConfig.cert) || pfxConfig.pfx)) {\n throw Error('bad format https configuration');\n }\n\n if (pfxConfig.pfx) {\n const { pfx, passphrase } = pfxConfig;\n httpsOptions = _.assign(httpsOptions, {\n pfx: fs.readFileSync(pfx),\n passphrase: passphrase || '',\n });\n } else {\n const { key, cert, ca } = keyCertConfig;\n httpsOptions = _.assign(httpsOptions, {\n key: fs.readFileSync(key),\n cert: fs.readFileSync(cert),\n ...(ca && {\n ca: fs.readFileSync(ca),\n }),\n });\n }\n // TODO: enable http2 as feature\n // if (config.server.http2) <-- check if force http2\n serverFactory = https.createServer(httpsOptions, app);\n } catch (err: any) {\n logger.fatal({ err: err }, 'cannot create server: @{err.message}');\n process.exit(2);\n }\n } else {\n // http\n debug('http enabled');\n serverFactory = http.createServer(app);\n }\n\n if (\n config.server &&\n typeof config.server.keepAliveTimeout !== 'undefined' &&\n // @ts-ignore\n config.server.keepAliveTimeout !== 'null'\n ) {\n // library definition for node is not up to date (doesn't contain recent 8.0 changes)\n serverFactory.keepAliveTimeout = config.server.keepAliveTimeout * 1000;\n }\n // FIXE: I could not find the reason of this code.\n unlinkAddressPath(addr);\n\n return serverFactory;\n}\n\nfunction unlinkAddressPath(addr) {\n if (addr.path && fs.existsSync(addr.path)) {\n fs.unlinkSync(addr.path);\n }\n}\n"],"mappings":";;;;;;;;;;;;AAeA,IAAM,QAAQ,YAAW,sBAAsB;;;;;;;;;;;;AAa/C,eAAsB,UACpB,QACA,SACc;CACd,MAAM,sBAAsB,gBAAgB,MAAM;CAElD,WAAW,mBAAmB;CAM9B,0BAA0B;EAHxB,GAAI,qBAAqB,SAAS,CAAC;EACnC,GAAI,qBAAqB,eAAe,CAAC;CAEjB,CAAK;CAM/B,OAAO,oBAAoB,qBAHX,iBADD,SAAS,aAAa,qBAAqB,QACjB,MAGO,GAAS,MADvC,YAAY,mBAAmB,CACW;AAC9D;;;;;;;AAQA,SAAgB,oBAAoB,QAAoB,MAAM,KAAK;CACjE,IAAI;CACJ,IAAI,KAAK,UAAU,SAAS;EAC1B,MAAM,eAAe;EACrB,IAAI;GACF,IAAI,eAAe,EAEjB,eAAe,UAAU,kBAAkB,UAAU,gBACvD;GAEA,MAAM,gBAAgB,OAAO;GAC7B,MAAM,YAAY,OAAO;GAGzB,IAAI,EAAG,cAAc,OAAO,cAAc,QAAS,UAAU,MAC3D,MAAM,MAAM,gCAAgC;GAG9C,IAAI,UAAU,KAAK;IACjB,MAAM,EAAE,KAAK,eAAe;IAC5B,eAAe,EAAE,OAAO,cAAc;KACpC,KAAK,GAAG,aAAa,GAAG;KACxB,YAAY,cAAc;IAC5B,CAAC;GACH,OAAO;IACL,MAAM,EAAE,KAAK,MAAM,OAAO;IAC1B,eAAe,EAAE,OAAO,cAAc;KACpC,KAAK,GAAG,aAAa,GAAG;KACxB,MAAM,GAAG,aAAa,IAAI;KAC1B,GAAI,MAAM,EACR,IAAI,GAAG,aAAa,EAAE,EACxB;IACF,CAAC;GACH;GAGA,gBAAgB,MAAM,aAAa,cAAc,GAAG;EACtD,SAAS,KAAU;GACjB,OAAO,MAAM,EAAO,IAAI,GAAG,sCAAsC;GACjE,QAAQ,KAAK,CAAC;EAChB;CACF,OAAO;EAEL,MAAM,cAAc;EACpB,gBAAgB,KAAK,aAAa,GAAG;CACvC;CAEA,IACE,OAAO,UACP,OAAO,OAAO,OAAO,qBAAqB,eAE1C,OAAO,OAAO,qBAAqB,QAGnC,cAAc,mBAAmB,OAAO,OAAO,mBAAmB;CAGpE,kBAAkB,IAAI;CAEtB,OAAO;AACT;AAEA,SAAS,kBAAkB,MAAM;CAC/B,IAAI,KAAK,QAAQ,GAAG,WAAW,KAAK,IAAI,GACtC,GAAG,WAAW,KAAK,IAAI;AAE3B"}
|
|
@@ -1,30 +1,142 @@
|
|
|
1
|
-
import { AbbreviatedManifest, Manifest, Version } from '@verdaccio/types';
|
|
1
|
+
import { AbbreviatedManifest, DistFile, Manifest, Version } from '@verdaccio/types';
|
|
2
2
|
import LocalStorage from './local-storage';
|
|
3
|
+
/**
|
|
4
|
+
* Create an empty package manifest with all the internal bookkeeping
|
|
5
|
+
* sections (`_uplinks`, `_distfiles`, `_attachments`, `_rev`) initialized.
|
|
6
|
+
* Used as the starting point when a package is seen for the first time.
|
|
7
|
+
* @param name package name
|
|
8
|
+
* @return an empty manifest for the given package
|
|
9
|
+
*/
|
|
3
10
|
export declare function generatePackageTemplate(name: string): Manifest;
|
|
4
11
|
/**
|
|
5
|
-
* Normalize
|
|
6
|
-
*
|
|
12
|
+
* Normalize a manifest read from storage: ensure the object sections
|
|
13
|
+
* (`versions`, `dist-tags`, `_distfiles`, `_attachments`, `_uplinks`, `time`)
|
|
14
|
+
* exist, default the revision and `_id`, and normalize the dist-tags shape.
|
|
15
|
+
* The manifest is mutated in place.
|
|
16
|
+
* @param pkg package manifest reference
|
|
17
|
+
* @return the same manifest, normalized
|
|
7
18
|
*/
|
|
8
19
|
export declare function normalizePackage(pkg: Manifest): Manifest;
|
|
20
|
+
/**
|
|
21
|
+
* Produce the next revision id in the `<counter>-<hash>` format used by the
|
|
22
|
+
* storage layer, incrementing the counter of the previous revision.
|
|
23
|
+
* @param rev previous revision id, eg. `2-a1b2c3`
|
|
24
|
+
* @return the next revision id
|
|
25
|
+
*/
|
|
9
26
|
export declare function generateRevision(rev: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Pick the most relevant readme for a package: the manifest readme or the
|
|
29
|
+
* `latest` version readme first, otherwise the first readme found across the
|
|
30
|
+
* `next`, `beta`, `alpha`, `test`, `dev` and `canary` dist-tags, in that order.
|
|
31
|
+
* @param pkg package manifest
|
|
32
|
+
* @return the readme content, or an empty string when none is available
|
|
33
|
+
*/
|
|
10
34
|
export declare function getLatestReadme(pkg: Manifest): string;
|
|
35
|
+
/**
|
|
36
|
+
* Remove the readme from a version object: only one readme is kept per
|
|
37
|
+
* package (see getLatestReadme), never one per version. The version is
|
|
38
|
+
* mutated in place.
|
|
39
|
+
* @param version version metadata
|
|
40
|
+
* @return the same version without its readme
|
|
41
|
+
*/
|
|
11
42
|
export declare function cleanUpReadme(version: Version): Version;
|
|
43
|
+
/**
|
|
44
|
+
* Manifest properties allowed in responses served to clients; everything
|
|
45
|
+
* else is verdaccio-internal bookkeeping and is stripped by cleanUpLinksRef.
|
|
46
|
+
*/
|
|
12
47
|
export declare const WHITELIST: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Strip verdaccio-internal sections (`_distfiles`, `_attachments`, ...) from
|
|
50
|
+
* a manifest before serving it to a client. The manifest is mutated in place.
|
|
51
|
+
* @param keepUpLinkData whether the `_uplinks` section should be preserved
|
|
52
|
+
* @param result manifest to clean up
|
|
53
|
+
* @return the same manifest with only whitelisted properties
|
|
54
|
+
*/
|
|
13
55
|
export declare function cleanUpLinksRef(keepUpLinkData: boolean, result: Manifest): Manifest;
|
|
14
56
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
57
|
+
* Verify a package does not exist locally yet; part of the publish flow.
|
|
58
|
+
* @param name package name
|
|
59
|
+
* @param localStorage local storage instance
|
|
60
|
+
* @throws conflict error when the package already exists locally
|
|
18
61
|
*/
|
|
19
62
|
export declare function checkPackageLocal(name: string, localStorage: LocalStorage): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Create a new package in the local storage and register its latest version
|
|
65
|
+
* in the in-memory search indexer.
|
|
66
|
+
* @param name package name
|
|
67
|
+
* @param metadata package manifest to store
|
|
68
|
+
* @param localStorage local storage instance
|
|
69
|
+
*/
|
|
20
70
|
export declare function publishPackage(name: string, metadata: any, localStorage: LocalStorage): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Verify a package does not exist on any uplink yet; part of the publish
|
|
73
|
+
* flow. Uplink failures other than 404 reject the publish, unless
|
|
74
|
+
* `publish.allow_offline` is enabled in the configuration.
|
|
75
|
+
* @param name package name
|
|
76
|
+
* @param isAllowPublishOffline whether publishing with unreachable uplinks is allowed
|
|
77
|
+
* @param syncMetadata bound Storage._syncUplinksMetadata function
|
|
78
|
+
* @throws conflict error when the package exists upstream, service unavailable when uplinks are offline
|
|
79
|
+
*/
|
|
21
80
|
export declare function checkPackageRemote(name: string, isAllowPublishOffline: boolean, syncMetadata: any): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Merge the `time` field of a remote manifest into the cached one; remote
|
|
83
|
+
* entries win on conflicts. Returns a new manifest, the inputs are untouched.
|
|
84
|
+
* @param cacheManifest local cached manifest
|
|
85
|
+
* @param remoteManifest manifest fetched from an uplink
|
|
86
|
+
* @return the cached manifest with the merged time field
|
|
87
|
+
*/
|
|
22
88
|
export declare function mergeUplinkTimeIntoLocal(cacheManifest: Manifest, remoteManifest: Manifest): any;
|
|
89
|
+
/**
|
|
90
|
+
* Build the search item emitted for a local package during a search stream,
|
|
91
|
+
* based on its latest version: npm-search compatible maintainers
|
|
92
|
+
* (`{ username, email }`), publisher (from `_npmUser`, falling back to the
|
|
93
|
+
* first maintainer), license and links.
|
|
94
|
+
* @param data package manifest
|
|
95
|
+
* @param time modified time attached to the search item
|
|
96
|
+
* @return the search item, or undefined when the package has no usable latest version
|
|
97
|
+
*/
|
|
23
98
|
export declare function prepareSearchPackage(data: Manifest, time: unknown): any;
|
|
24
99
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
100
|
+
* Whether the tarball url path ends with the given file name
|
|
101
|
+
* (any query string or fragment is ignored, like the path parsing
|
|
102
|
+
* in updateVersions).
|
|
103
|
+
*/
|
|
104
|
+
export declare function tarballMatchesFilename(tarball: string, filename: string): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Build a distfile record from a version's dist metadata when its tarball
|
|
107
|
+
* url matches the given file name.
|
|
108
|
+
*/
|
|
109
|
+
export declare function distFileFromVersion(version: Version | undefined, filename: string): DistFile | null;
|
|
110
|
+
/**
|
|
111
|
+
* Resolve the distfile record for a tarball filename. Prefers the
|
|
112
|
+
* `_distfiles` bookkeeping, but falls back to the version metadata when the
|
|
113
|
+
* record is missing (storages written by other verdaccio versions cache
|
|
114
|
+
* versions without their distfile records, which made those tarballs
|
|
115
|
+
* permanently unavailable).
|
|
116
|
+
* @param manifest cached manifest
|
|
117
|
+
* @param filename tarball file name, eg. pkg-1.0.0.tgz
|
|
118
|
+
*/
|
|
119
|
+
export declare function lookupDistFile(manifest: Manifest, filename: string): DistFile | null;
|
|
120
|
+
/**
|
|
121
|
+
* Check whether the package metadata has enough data to be published.
|
|
122
|
+
* @param pkg package manifest
|
|
123
|
+
* @return true when the manifest carries a versions section
|
|
27
124
|
*/
|
|
28
125
|
export declare function isPublishablePackage(pkg: Manifest): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Whether a version declares an install lifecycle script (`install`,
|
|
128
|
+
* `preinstall` or `postinstall`); surfaced in abbreviated manifests as
|
|
129
|
+
* `hasInstallScript` so clients can warn about script execution.
|
|
130
|
+
* @param version version metadata
|
|
131
|
+
* @return true when an install script is present
|
|
132
|
+
*/
|
|
29
133
|
export declare function hasInstallScript(version: Version): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Convert a full manifest into the abbreviated format served when the client
|
|
136
|
+
* requests `application/vnd.npm.install-v1+json` (npm install), keeping only
|
|
137
|
+
* the fields the npm registry contract defines for installation.
|
|
138
|
+
* https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md
|
|
139
|
+
* @param manifest full package manifest
|
|
140
|
+
* @return the abbreviated manifest
|
|
141
|
+
*/
|
|
30
142
|
export declare function convertAbbreviatedManifest(manifest: Manifest): AbbreviatedManifest;
|