@verdaccio/store 7.0.0-next-7.20 → 7.0.0-next-8.21

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @verdaccio/store
2
2
 
3
+ ## 7.0.0-next-8.21
4
+
5
+ ### Patch Changes
6
+
7
+ - 7c9f3cf: chore: improve startup logging
8
+ - Updated dependencies [8c10a3e]
9
+ - Updated dependencies [a05a7d8]
10
+ - Updated dependencies [7c9f3cf]
11
+ - @verdaccio/config@7.0.0-next-8.21
12
+ - @verdaccio/local-storage@12.0.0-next-8.21
13
+ - @verdaccio/core@7.0.0-next-8.21
14
+ - @verdaccio/loaders@7.0.0-next-8.21
15
+ - @verdaccio/hooks@7.0.0-next-8.21
16
+ - @verdaccio/proxy@7.0.0-next-8.21
17
+ - @verdaccio/search@7.0.0-next-8.10
18
+ - @verdaccio/tarball@12.0.0-next-8.21
19
+ - @verdaccio/url@12.0.0-next-8.21
20
+ - @verdaccio/utils@7.0.0-next-8.21
21
+ - @verdaccio/logger@7.0.0-next-8.21
22
+
3
23
  ## 7.0.0-next-7.20
4
24
 
5
25
  ### Patch Changes
@@ -64,7 +64,7 @@ class LocalStorage {
64
64
  logger: this.logger
65
65
  }, plugin => {
66
66
  return typeof plugin.getPackageStorage !== 'undefined';
67
- }, (_this$config = this.config) === null || _this$config === void 0 || (_this$config = _this$config.serverSettings) === null || _this$config === void 0 ? void 0 : _this$config.pluginPrefix);
67
+ }, (_this$config = this.config) === null || _this$config === void 0 || (_this$config = _this$config.serverSettings) === null || _this$config === void 0 ? void 0 : _this$config.pluginPrefix, _core.PLUGIN_CATEGORY.STORAGE);
68
68
  if (plugins.length > 1) {
69
69
  this.logger.warn('more than one storage plugins has been detected, multiple storage are not supported, one will be selected automatically');
70
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"local-storage.js","names":["_assert","_interopRequireDefault","require","_debug","_lodash","_core","_loaders","_localStorage","e","__esModule","default","debug","buildDebug","noSuchFile","exports","resourceNotAvailable","LocalStorage","constructor","config","logger","child","sub","storagePlugin","init","loadStorage","warn","getStoragePlugin","errorUtils","getInternalError","getSecret","secretKey","setSecret","checkSecretKey","Storage","loadStorePlugin","_","isNil","assert","storage","LocalDatabase","_this$config","plugins","asyncLoadPlugin","store","plugin","getPackageStorage","serverSettings","pluginPrefix","length","head"],"sources":["../src/local-storage.ts"],"sourcesContent":["import assert from 'assert';\nimport buildDebug from 'debug';\nimport _ from 'lodash';\n\nimport { errorUtils, pluginUtils } from '@verdaccio/core';\nimport { asyncLoadPlugin } from '@verdaccio/loaders';\nimport LocalDatabase from '@verdaccio/local-storage';\nimport { Config, Logger } from '@verdaccio/types';\n\nconst debug = buildDebug('verdaccio:storage:local');\n\nexport const noSuchFile = 'ENOENT';\nexport const resourceNotAvailable = 'EAGAIN';\nexport type PluginStorage = pluginUtils.Storage<Config>;\n\n/**\n * Implements Storage interface (same for storage.js, local-storage.js, up-storage.js).\n */\nclass LocalStorage {\n public config: Config;\n public storagePlugin: PluginStorage;\n public logger: Logger;\n\n public constructor(config: Config, logger: Logger) {\n debug('local storage created');\n this.logger = logger.child({ sub: 'fs' });\n this.config = config;\n // @ts-expect-error\n this.storagePlugin = null;\n }\n\n public async init() {\n if (this.storagePlugin === null) {\n this.storagePlugin = await this.loadStorage(this.config, this.logger);\n debug('storage plugin init');\n await this.storagePlugin.init();\n debug('storage plugin initialized');\n } else {\n this.logger.warn('storage plugin has been already initialized');\n }\n return;\n }\n\n public getStoragePlugin(): PluginStorage {\n if (this.storagePlugin === null) {\n throw errorUtils.getInternalError('storage plugin is not initialized');\n }\n\n return this.storagePlugin;\n }\n\n public async getSecret(config: Config): Promise<void> {\n const secretKey = await this.storagePlugin.getSecret();\n\n return this.storagePlugin.setSecret(config.checkSecretKey(secretKey));\n }\n\n private async loadStorage(config: Config, logger: Logger): Promise<PluginStorage> {\n const Storage = await this.loadStorePlugin();\n if (_.isNil(Storage)) {\n assert(this.config.storage, 'CONFIG: storage path not defined');\n debug('no custom storage found, loading default storage @verdaccio/local-storage');\n return new LocalDatabase(config, logger);\n }\n return Storage as PluginStorage;\n }\n\n private async loadStorePlugin(): Promise<PluginStorage | undefined> {\n const plugins: PluginStorage[] = await asyncLoadPlugin<pluginUtils.Storage<unknown>>(\n this.config.store,\n {\n config: this.config,\n logger: this.logger,\n },\n (plugin) => {\n return typeof plugin.getPackageStorage !== 'undefined';\n },\n this.config?.serverSettings?.pluginPrefix\n );\n\n if (plugins.length > 1) {\n this.logger.warn(\n 'more than one storage plugins has been detected, multiple storage are not supported, one will be selected automatically'\n );\n }\n\n return _.head(plugins);\n }\n}\n\nexport { LocalStorage };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AAAqD,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGrD,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,yBAAyB,CAAC;AAE5C,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,QAAQ;AAC3B,MAAME,oBAAoB,GAAAD,OAAA,CAAAC,oBAAA,GAAG,QAAQ;AAG5C;AACA;AACA;AACA,MAAMC,YAAY,CAAC;EAKVC,WAAWA,CAACC,MAAc,EAAEC,MAAc,EAAE;IACjDR,KAAK,CAAC,uBAAuB,CAAC;IAC9B,IAAI,CAACQ,MAAM,GAAGA,MAAM,CAACC,KAAK,CAAC;MAAEC,GAAG,EAAE;IAAK,CAAC,CAAC;IACzC,IA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c,OAAO;EAChB;EAEA,MAAcC,eAAeA,CAAA,EAAuC;IAAA,IAAAM,YAAA;IAClE,MAAMC,OAAwB,GAAG,MAAM,IAAAC,wBAAe,EACpD,IAAI,CAACxB,MAAM,CAACyB,KAAK,EACjB;MACEzB,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,MAAM,EAAE,IAAI,CAACA;IACf,CAAC,EACAyB,MAAM,IAAK;MACV,OAAO,OAAOA,MAAM,CAACC,iBAAiB,KAAK,WAAW;IACxD,CAAC,GAAAL,YAAA,GACD,IAAI,CAACtB,MAAM,cAAAsB,YAAA,gBAAAA,YAAA,GAAXA,YAAA,CAAaM,cAAc,cAAAN,YAAA,uBAA3BA,YAAA,CAA6BO,YAC/B,CAAC;IAED,IAAIN,OAAO,CAACO,MAAM,GAAG,CAAC,EAAE;MACtB,IAAI,CAAC7B,MAAM,CAACM,IAAI,CACd,yHACF,CAAC;IACH;IAEA,OAAOU,eAAC,CAACc,IAAI,CAACR,OAAO,CAAC;EACxB;AACF;AAAC3B,OAAA,CAAAE,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"file":"local-storage.js","names":["_assert","_interopRequireDefault","require","_debug","_lodash","_core","_loaders","_localStorage","e","__esModule","default","debug","buildDebug","noSuchFile","exports","resourceNotAvailable","LocalStorage","constructor","config","logger","child","sub","storagePlugin","init","loadStorage","warn","getStoragePlugin","errorUtils","getInternalError","getSecret","secretKey","setSecret","checkSecretKey","Storage","loadStorePlugin","_","isNil","assert","storage","LocalDatabase","_this$config","plugins","asyncLoadPlugin","store","plugin","getPackageStorage","serverSettings","pluginPrefix","PLUGIN_CATEGORY","STORAGE","length","head"],"sources":["../src/local-storage.ts"],"sourcesContent":["import assert from 'assert';\nimport buildDebug from 'debug';\nimport _ from 'lodash';\n\nimport { PLUGIN_CATEGORY, errorUtils, pluginUtils } from '@verdaccio/core';\nimport { asyncLoadPlugin } from '@verdaccio/loaders';\nimport LocalDatabase from '@verdaccio/local-storage';\nimport { Config, Logger } from '@verdaccio/types';\n\nconst debug = buildDebug('verdaccio:storage:local');\n\nexport const noSuchFile = 'ENOENT';\nexport const resourceNotAvailable = 'EAGAIN';\nexport type PluginStorage = pluginUtils.Storage<Config>;\n\n/**\n * Implements Storage interface (same for storage.js, local-storage.js, up-storage.js).\n */\nclass LocalStorage {\n public config: Config;\n public storagePlugin: PluginStorage;\n public logger: Logger;\n\n public constructor(config: Config, logger: Logger) {\n debug('local storage created');\n this.logger = logger.child({ sub: 'fs' });\n this.config = config;\n // @ts-expect-error\n this.storagePlugin = null;\n }\n\n public async init() {\n if (this.storagePlugin === null) {\n this.storagePlugin = await this.loadStorage(this.config, this.logger);\n debug('storage plugin init');\n await this.storagePlugin.init();\n debug('storage plugin initialized');\n } else {\n this.logger.warn('storage plugin has been already initialized');\n }\n return;\n }\n\n public getStoragePlugin(): PluginStorage {\n if (this.storagePlugin === null) {\n throw errorUtils.getInternalError('storage plugin is not initialized');\n }\n\n return this.storagePlugin;\n }\n\n public async getSecret(config: Config): Promise<void> {\n const secretKey = await this.storagePlugin.getSecret();\n\n return this.storagePlugin.setSecret(config.checkSecretKey(secretKey));\n }\n\n private async loadStorage(config: Config, logger: Logger): Promise<PluginStorage> {\n const Storage = await this.loadStorePlugin();\n if (_.isNil(Storage)) {\n assert(this.config.storage, 'CONFIG: storage path not defined');\n debug('no custom storage found, loading default storage @verdaccio/local-storage');\n return new LocalDatabase(config, logger);\n }\n return Storage as PluginStorage;\n }\n\n private async loadStorePlugin(): Promise<PluginStorage | undefined> {\n const plugins: PluginStorage[] = await asyncLoadPlugin<pluginUtils.Storage<unknown>>(\n this.config.store,\n {\n config: this.config,\n logger: this.logger,\n },\n (plugin) => {\n return typeof plugin.getPackageStorage !== 'undefined';\n },\n this.config?.serverSettings?.pluginPrefix,\n PLUGIN_CATEGORY.STORAGE\n );\n\n if (plugins.length > 1) {\n this.logger.warn(\n 'more than one storage plugins has been detected, multiple storage are not supported, one will be selected automatically'\n );\n }\n\n return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AN,YAAA,uBAA3BA,YAAA,CAA6BO,YAAY,EACzCC,qBAAe,CAACC,OAClB,CAAC;IAED,IAAIR,OAAO,CAACS,MAAM,GAAG,CAAC,EAAE;MACtB,IAAI,CAAC/B,MAAM,CAACM,IAAI,CACd,yHACF,CAAC;IACH;IAEA,OAAOU,eAAC,CAACgB,IAAI,CAACV,OAAO,CAAC;EACxB;AACF;AAAC3B,OAAA,CAAAE,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -17,7 +17,7 @@ declare class Storage {
17
17
  readonly logger: Logger;
18
18
  readonly uplinks: ProxyInstanceList;
19
19
  private searchService;
20
- constructor(config: Config);
20
+ constructor(config: Config, logger: Logger);
21
21
  static ABBREVIATED_HEADER: string;
22
22
  /**
23
23
  * Change an existing package (i.e. unpublish one version)
package/build/storage.js CHANGED
@@ -14,7 +14,6 @@ var _url = _interopRequireDefault(require("url"));
14
14
  var _config = require("@verdaccio/config");
15
15
  var _core = require("@verdaccio/core");
16
16
  var _loaders = require("@verdaccio/loaders");
17
- var _logger = require("@verdaccio/logger");
18
17
  var _proxy = require("@verdaccio/proxy");
19
18
  var _search = _interopRequireDefault(require("@verdaccio/search"));
20
19
  var _tarball = require("@verdaccio/tarball");
@@ -32,9 +31,9 @@ const noSuchFile = exports.noSuchFile = 'ENOENT';
32
31
  const resourceNotAvailable = exports.resourceNotAvailable = 'EAGAIN';
33
32
  const PROTO_NAME = exports.PROTO_NAME = '__proto__';
34
33
  class Storage {
35
- constructor(config) {
34
+ constructor(config, logger) {
36
35
  this.config = config;
37
- this.logger = _logger.logger.child({
36
+ this.logger = logger.child({
38
37
  module: 'storage'
39
38
  });
40
39
  this.uplinks = (0, _proxy.setupUpLinks)(config, this.logger);
@@ -393,7 +392,7 @@ class Storage {
393
392
  try {
394
393
  await this.checkAllowedToChangePackage(manifest, options.requestOptions.username);
395
394
  } catch (error) {
396
- _logger.logger.error({
395
+ this.logger.error({
397
396
  error: error.message
398
397
  }, 'getting package has failed: @{error}');
399
398
  throw _core.errorUtils.getBadRequest(error.message);
@@ -516,7 +515,7 @@ class Storage {
516
515
  */
517
516
  async init(config) {
518
517
  if (this.localStorage === null) {
519
- this.localStorage = new _localStorage.LocalStorage(this.config, _logger.logger);
518
+ this.localStorage = new _localStorage.LocalStorage(this.config, this.logger);
520
519
  await this.localStorage.init();
521
520
  debug('local init storage initialized');
522
521
  await this.localStorage.getSecret(config);
@@ -531,7 +530,7 @@ class Storage {
531
530
  logger: this.logger
532
531
  }, plugin => {
533
532
  return typeof plugin.filter_metadata !== 'undefined';
534
- }, (_this$config = this.config) === null || _this$config === void 0 || (_this$config = _this$config.serverSettings) === null || _this$config === void 0 ? void 0 : _this$config.pluginPrefix);
533
+ }, (_this$config = this.config) === null || _this$config === void 0 || (_this$config = _this$config.serverSettings) === null || _this$config === void 0 ? void 0 : _this$config.pluginPrefix, _core.PLUGIN_CATEGORY.FILTER);
535
534
  debug('filters available %o', this.filters.length);
536
535
  }
537
536
  return;
@@ -573,7 +572,7 @@ class Storage {
573
572
  debug('search query for cached not found');
574
573
  return results;
575
574
  }
576
- _logger.logger.info({
575
+ this.logger.info({
577
576
  t: query.text,
578
577
  q: query.quality,
579
578
  p: query.popularity,
@@ -581,7 +580,7 @@ class Storage {
581
580
  s: query.size
582
581
  }, 'search by text @{t}| maintenance @{m}| quality @{q}| popularity @{p}');
583
582
  if (typeof this.localStorage.getStoragePlugin().search === 'undefined') {
584
- _logger.logger.info('plugin search not implemented yet');
583
+ this.logger.info('plugin search not implemented yet');
585
584
  } else {
586
585
  debug('search on each package by plugin query');
587
586
  const items = await this.localStorage.getStoragePlugin().search(query);
@@ -628,13 +627,13 @@ class Storage {
628
627
  manifest = (0, _storageUtils.normalizePackage)(manifest);
629
628
  } catch (err) {
630
629
  if (err.code === _storageUtils.STORAGE.NO_SUCH_FILE_ERROR || err.code === _core.HTTP_STATUS.NOT_FOUND) {
631
- _logger.logger.info({
630
+ this.logger.info({
632
631
  pkgName,
633
632
  revision
634
633
  }, 'package not found');
635
634
  throw _core.errorUtils.getNotFound();
636
635
  }
637
- _logger.logger.error({
636
+ this.logger.error({
638
637
  pkgName,
639
638
  revision,
640
639
  err: err.message
@@ -653,7 +652,7 @@ class Storage {
653
652
  for (let attachment of attachments) {
654
653
  debug('remove attachment %s', attachment);
655
654
  await storage.deletePackage(attachment);
656
- _logger.logger.info({
655
+ this.logger.info({
657
656
  attachment
658
657
  }, 'attachment @{attachment} removed');
659
658
  }
@@ -663,7 +662,7 @@ class Storage {
663
662
  // remove folder
664
663
  debug('remove package folder');
665
664
  await storage.removePackage();
666
- _logger.logger.info({
665
+ this.logger.info({
667
666
  pkgName
668
667
  }, 'package @{pkgName} removed');
669
668
  } catch (err) {
@@ -757,7 +756,7 @@ class Storage {
757
756
  uplink = new _proxy.ProxyStorage({
758
757
  url: distFile.url,
759
758
  cache: true
760
- }, this.config, _logger.logger);
759
+ }, this.config, this.logger);
761
760
  }
762
761
  return uplink;
763
762
  }
@@ -792,19 +791,19 @@ class Storage {
792
791
  name
793
792
  } = mergedManifest;
794
793
  await this.notify(mergedManifest, `${name}@${version}`);
795
- _logger.logger.info({
794
+ this.logger.info({
796
795
  name,
797
796
  version
798
797
  }, 'notify for @{name}@@{version} has been sent');
799
798
  } catch (error) {
800
- _logger.logger.error({
799
+ this.logger.error({
801
800
  error: error.message
802
801
  }, 'notify batch service has failed: @{error}');
803
802
  }
804
803
  return message;
805
804
  } else {
806
805
  debug('invalid body format');
807
- _logger.logger.warn({
806
+ this.logger.warn({
808
807
  packageName: options.name
809
808
  }, `wrong package format on publish a package @{packageName}`);
810
809
  throw _core.errorUtils.getBadRequest(_core.API_ERROR.UNSUPORTED_REGISTRY_CALL);
@@ -996,7 +995,7 @@ class Storage {
996
995
  }
997
996
  } catch (err) {
998
997
  debug('error on change or update a package with %o', err.message);
999
- _logger.logger.error({
998
+ this.logger.error({
1000
999
  err: err.message
1001
1000
  }, 'error on publish new version: @{err}');
1002
1001
  throw err;
@@ -1012,7 +1011,7 @@ class Storage {
1012
1011
  // addVersion will move the readme from the the published version to the root level
1013
1012
  await this.addVersion(name, versionToPublish, versions[versionToPublish], null, tarballStats);
1014
1013
  } catch (err) {
1015
- _logger.logger.error({
1014
+ this.logger.error({
1016
1015
  err: err.message
1017
1016
  }, 'updated version has failed: @{err}');
1018
1017
  debug('error on create a version for %o with error %o', name, err.message);
@@ -1029,7 +1028,7 @@ class Storage {
1029
1028
  // 4. update once to the storage (easy peasy)
1030
1029
  mergedManifest = await this.mergeTagsNext(name, manifest[_core.DIST_TAGS]);
1031
1030
  } catch (err) {
1032
- _logger.logger.error({
1031
+ this.logger.error({
1033
1032
  err: err.message
1034
1033
  }, 'merge version has failed: @{err}');
1035
1034
  debug('error on create a version for %o with error %o', name, err.message);
@@ -1045,7 +1044,7 @@ class Storage {
1045
1044
  signal: options.signal
1046
1045
  });
1047
1046
  } catch (err) {
1048
- _logger.logger.error({
1047
+ this.logger.error({
1049
1048
  err: err.message
1050
1049
  }, 'upload tarball has failed: @{err}');
1051
1050
  // TODO: undo if this fails
@@ -1053,7 +1052,7 @@ class Storage {
1053
1052
  // 2. remove new dist tags
1054
1053
  throw err;
1055
1054
  }
1056
- _logger.logger.info({
1055
+ this.logger.info({
1057
1056
  name,
1058
1057
  version: versionToPublish
1059
1058
  }, 'package @{name}@@{version} has been published');
@@ -1790,7 +1789,7 @@ class Storage {
1790
1789
  debug('check if user %o is an owner and allowed to change package', username);
1791
1790
  // if name of owner is not included in list of maintainers, then throw an error
1792
1791
  if (((_this$config3 = this.config) === null || _this$config3 === void 0 || (_this$config3 = _this$config3.publish) === null || _this$config3 === void 0 ? void 0 : _this$config3.check_owners) === true && manifest.maintainers && manifest.maintainers.length > 0 && !manifest.maintainers.some(maintainer => maintainer.name === username)) {
1793
- _logger.logger.error({
1792
+ this.logger.error({
1794
1793
  username
1795
1794
  }, '@{username} is not a maintainer (package owner)');
1796
1795
  throw Error('only owners are allowed to change package');