verdaccio-tarball-local-storage 30.3.0 → 31.0.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/dist/index.js CHANGED
@@ -1,32 +1,38 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const path_1 = __importDefault(require("path"));
7
- const debug_1 = __importDefault(require("debug"));
8
- const isNil_1 = __importDefault(require("lodash/isNil"));
9
- const isString_1 = __importDefault(require("lodash/isString"));
10
- const package_storage_1 = require("./package-storage");
11
- const debug = (0, debug_1.default)('verdaccio:plugin:local-storage');
12
- // eslint-disable-next-line import/no-default-export
13
- class LocalStorage {
14
- constructor(config, logger) {
15
- Object.defineProperty(this, "config", {
16
- enumerable: true,
17
- configurable: true,
18
- writable: true,
19
- value: void 0
20
- });
21
- Object.defineProperty(this, "logger", {
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return LocalStorage;
9
+ }
10
+ });
11
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
12
+ const _debug = /*#__PURE__*/ _interop_require_default(require("debug"));
13
+ const _isNil = /*#__PURE__*/ _interop_require_default(require("lodash/isNil"));
14
+ const _isString = /*#__PURE__*/ _interop_require_default(require("lodash/isString"));
15
+ const _packagestorage = require("./package-storage");
16
+ function _define_property(obj, key, value) {
17
+ if (key in obj) {
18
+ Object.defineProperty(obj, key, {
19
+ value: value,
22
20
  enumerable: true,
23
21
  configurable: true,
24
- writable: true,
25
- value: void 0
22
+ writable: true
26
23
  });
27
- this.config = config;
28
- this.logger = logger;
24
+ } else {
25
+ obj[key] = value;
29
26
  }
27
+ return obj;
28
+ }
29
+ function _interop_require_default(obj) {
30
+ return obj && obj.__esModule ? obj : {
31
+ default: obj
32
+ };
33
+ }
34
+ const debug = (0, _debug.default)('verdaccio:plugin:local-storage');
35
+ class LocalStorage {
30
36
  getSecret() {
31
37
  throw new Error('Method not implemented.');
32
38
  }
@@ -49,13 +55,13 @@ class LocalStorage {
49
55
  const packageAccess = this.config.getMatchedPackagesSpec(packageName);
50
56
  const packagePath = this.getLocalStoragePath(packageAccess ? packageAccess.storage : undefined);
51
57
  debug('storage path selected: ', packagePath);
52
- if ((0, isString_1.default)(packagePath) === false) {
58
+ if ((0, _isString.default)(packagePath) === false) {
53
59
  debug('the package %o has no storage defined ', packageName);
54
60
  return;
55
61
  }
56
- const packageStoragePath = path_1.default.join(path_1.default.resolve(path_1.default.dirname(this.config.self_path || ''), packagePath), packageName);
62
+ const packageStoragePath = _path.default.join(_path.default.resolve(_path.default.dirname(this.config.self_path || ''), packagePath), packageName);
57
63
  debug('storage absolute path: ', packageStoragePath);
58
- return new package_storage_1.PackageStorage(packageStoragePath, this.logger);
64
+ return new _packagestorage.PackageStorage(packageStoragePath, this.logger);
59
65
  }
60
66
  saveToken() {
61
67
  throw new Error('Method not implemented.');
@@ -71,19 +77,23 @@ class LocalStorage {
71
77
  * @param {String} path
72
78
  * @return {String}
73
79
  * @private
74
- */
75
- getLocalStoragePath(storage) {
80
+ */ getLocalStoragePath(storage) {
76
81
  const globalConfigStorage = this.config ? this.config.storage : undefined;
77
- if ((0, isNil_1.default)(globalConfigStorage)) {
82
+ if ((0, _isNil.default)(globalConfigStorage)) {
78
83
  throw new Error('global storage is required for this plugin');
79
- }
80
- else {
81
- if ((0, isNil_1.default)(storage) === false && (0, isString_1.default)(storage)) {
82
- return path_1.default.join(globalConfigStorage, storage);
84
+ } else {
85
+ if ((0, _isNil.default)(storage) === false && (0, _isString.default)(storage)) {
86
+ return _path.default.join(globalConfigStorage, storage);
83
87
  }
84
88
  return globalConfigStorage;
85
89
  }
86
90
  }
91
+ constructor(config, logger){
92
+ _define_property(this, "config", void 0);
93
+ _define_property(this, "logger", void 0);
94
+ this.config = config;
95
+ this.logger = logger;
96
+ }
87
97
  }
88
- exports.default = LocalStorage;
98
+
89
99
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,kDAA+B;AAC/B,yDAAiC;AACjC,+DAAuC;AAGvC,uDAAmD;AAEnD,MAAM,KAAK,GAAG,IAAA,eAAU,EAAC,gCAAgC,CAAC,CAAC;AAE3D,oDAAoD;AACpD,MAAqB,YAAY;IAI7B,YAAY,MAAc,EAAE,MAAc;QAH1C;;;;;WAAe;QACf;;;;;WAAe;QAGX,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,SAAS;QACL,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,SAAS;QACL,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,GAAG;QACC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM;QACF,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM;QACF,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,GAAG;QACC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,iBAAiB,CAAC,WAAmB;QACjC,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;QAEtE,MAAM,WAAW,GAAG,IAAI,CAAC,mBAAmB,CACxC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CACpD,CAAC;QACF,KAAK,CAAC,yBAAyB,EAAE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AAC;IACL,CAAC;CACJ;AAtFD,+BAsFC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import path from 'path';\nimport buildDebug from 'debug';\nimport isNil from 'lodash/isNil';\nimport isString from 'lodash/isString';\nimport { Config, Logger, Token, IPluginStorage, IPackageStorage } from '@verdaccio/types';\n\nimport { PackageStorage } from './package-storage';\n\nconst debug = buildDebug('verdaccio:plugin:local-storage');\n\n// eslint-disable-next-line import/no-default-export\nexport default class LocalStorage implements IPluginStorage<unknown> {\n config: Config;\n logger: Logger;\n\n constructor(config: Config, logger: Logger) {\n this.config = config;\n this.logger = logger;\n }\n\n getSecret(): Promise<string> {\n throw new Error('Method not implemented.');\n }\n\n setSecret(): Promise<any> {\n throw new Error('Method not implemented.');\n }\n\n add(): void {\n throw new Error('Method not implemented.');\n }\n\n search(): void {\n throw new Error('Method not implemented.');\n }\n\n remove(): void {\n throw new Error('Method not implemented.');\n }\n\n get(): void {\n throw new Error('Method not implemented.');\n }\n\n getPackageStorage(packageName: string): IPackageStorage {\n const packageAccess = this.config.getMatchedPackagesSpec(packageName);\n\n const packagePath = this.getLocalStoragePath(\n packageAccess ? packageAccess.storage : undefined\n );\n debug('storage path selected: ', packagePath);\n\n if (isString(packagePath) === false) {\n debug('the package %o has no storage defined ', packageName);\n return;\n }\n\n const packageStoragePath = path.join(\n path.resolve(path.dirname(this.config.self_path || ''), packagePath),\n packageName\n );\n\n debug('storage absolute path: ', packageStoragePath);\n\n return new PackageStorage(packageStoragePath, this.logger);\n }\n\n saveToken(): Promise<any> {\n throw new Error('Method not implemented.');\n }\n\n deleteToken(): Promise<any> {\n throw new Error('Method not implemented.');\n }\n\n readTokens(): Promise<Token[]> {\n throw new Error('Method not implemented.');\n }\n\n /**\n * Verify the right local storage location.\n * @param {String} path\n * @return {String}\n * @private\n */\n private getLocalStoragePath(storage: string | void) {\n const globalConfigStorage = this.config ? this.config.storage : undefined;\n if (isNil(globalConfigStorage)) {\n throw new Error('global storage is required for this plugin');\n } else {\n if (isNil(storage) === false && isString(storage)) {\n return path.join(globalConfigStorage as string, storage as string);\n }\n\n return globalConfigStorage as string;\n }\n }\n}\n"],"names":["LocalStorage","debug","buildDebug","getSecret","Error","setSecret","add","search","remove","get","getPackageStorage","packageName","packageAccess","config","getMatchedPackagesSpec","packagePath","getLocalStoragePath","storage","undefined","isString","packageStoragePath","path","join","resolve","dirname","self_path","PackageStorage","logger","saveToken","deleteToken","readTokens","globalConfigStorage","isNil","constructor"],"mappings":";;;;;;;eAWqBA;;;6DAXJ;8DACM;8DACL;iEACG;gCAGU;;;;;;;;;;;;;;;;;;;AAE/B,MAAMC,QAAQC,IAAAA,cAAU,EAAC;AAGV,MAAMF;IASjBG,YAA6B;QACzB,MAAM,IAAIC,MAAM;IACpB;IAEAC,YAA0B;QACtB,MAAM,IAAID,MAAM;IACpB;IAEAE,MAAY;QACR,MAAM,IAAIF,MAAM;IACpB;IAEAG,SAAe;QACX,MAAM,IAAIH,MAAM;IACpB;IAEAI,SAAe;QACX,MAAM,IAAIJ,MAAM;IACpB;IAEAK,MAAY;QACR,MAAM,IAAIL,MAAM;IACpB;IAEAM,kBAAkBC,WAAmB,EAAmB;QACpD,MAAMC,gBAAgB,IAAI,CAACC,MAAM,CAACC,sBAAsB,CAACH;QAEzD,MAAMI,cAAc,IAAI,CAACC,mBAAmB,CACxCJ,gBAAgBA,cAAcK,OAAO,GAAGC;QAE5CjB,MAAM,2BAA2Bc;QAEjC,IAAII,IAAAA,iBAAQ,EAACJ,iBAAiB,OAAO;YACjCd,MAAM,0CAA0CU;YAChD;QACJ;QAEA,MAAMS,qBAAqBC,aAAI,CAACC,IAAI,CAChCD,aAAI,CAACE,OAAO,CAACF,aAAI,CAACG,OAAO,CAAC,IAAI,CAACX,MAAM,CAACY,SAAS,IAAI,KAAKV,cACxDJ;QAGJV,MAAM,2BAA2BmB;QAEjC,OAAO,IAAIM,8BAAc,CAACN,oBAAoB,IAAI,CAACO,MAAM;IAC7D;IAEAC,YAA0B;QACtB,MAAM,IAAIxB,MAAM;IACpB;IAEAyB,cAA4B;QACxB,MAAM,IAAIzB,MAAM;IACpB;IAEA0B,aAA+B;QAC3B,MAAM,IAAI1B,MAAM;IACpB;IAEA;;;;;KAKC,GACD,AAAQY,oBAAoBC,OAAsB,EAAE;QAChD,MAAMc,sBAAsB,IAAI,CAAClB,MAAM,GAAG,IAAI,CAACA,MAAM,CAACI,OAAO,GAAGC;QAChE,IAAIc,IAAAA,cAAK,EAACD,sBAAsB;YAC5B,MAAM,IAAI3B,MAAM;QACpB,OAAO;YACH,IAAI4B,IAAAA,cAAK,EAACf,aAAa,SAASE,IAAAA,iBAAQ,EAACF,UAAU;gBAC/C,OAAOI,aAAI,CAACC,IAAI,CAACS,qBAA+Bd;YACpD;YAEA,OAAOc;QACX;IACJ;IAjFAE,YAAYpB,MAAc,EAAEc,MAAc,CAAE;QAH5Cd,uBAAAA,UAAAA,KAAAA;QACAc,uBAAAA,UAAAA,KAAAA;QAGI,IAAI,CAACd,MAAM,GAAGA;QACd,IAAI,CAACc,MAAM,GAAGA;IAClB;AA+EJ"}
@@ -1,19 +1,41 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PackageStorage = void 0;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const debug_1 = __importDefault(require("debug"));
10
- const isNil_1 = __importDefault(require("lodash/isNil"));
11
- const commons_api_1 = require("@verdaccio/commons-api");
12
- const streams_1 = require("@verdaccio/streams");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "PackageStorage", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return PackageStorage;
9
+ }
10
+ });
11
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
13
+ const _debug = /*#__PURE__*/ _interop_require_default(require("debug"));
14
+ const _isNil = /*#__PURE__*/ _interop_require_default(require("lodash/isNil"));
15
+ const _commonsapi = require("@verdaccio/commons-api");
16
+ const _streams = require("@verdaccio/streams");
17
+ function _define_property(obj, key, value) {
18
+ if (key in obj) {
19
+ Object.defineProperty(obj, key, {
20
+ value: value,
21
+ enumerable: true,
22
+ configurable: true,
23
+ writable: true
24
+ });
25
+ } else {
26
+ obj[key] = value;
27
+ }
28
+ return obj;
29
+ }
30
+ function _interop_require_default(obj) {
31
+ return obj && obj.__esModule ? obj : {
32
+ default: obj
33
+ };
34
+ }
13
35
  const fileExist = 'EEXISTS';
14
- const debug = (0, debug_1.default)('verdaccio:plugin:local-storage:fs');
36
+ const debug = (0, _debug.default)('verdaccio:plugin:local-storage:fs');
15
37
  function fSError(message, code = 409) {
16
- const err = (0, commons_api_1.getCode)(code, message);
38
+ const err = (0, _commonsapi.getCode)(code, message);
17
39
  // FIXME: we should return http-status codes here instead, future improvement
18
40
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
19
41
  // @ts-ignore
@@ -24,54 +46,37 @@ function tempFile(str) {
24
46
  return `${str}.tmp${String(Math.random()).substr(2)}`;
25
47
  }
26
48
  function renameTmp(src, dst, _cb) {
27
- const cb = err => {
49
+ const cb = (err)=>{
28
50
  if (err) {
29
- fs_1.default.unlink(src, () => { });
51
+ _fs.default.unlink(src, ()=>{});
30
52
  }
31
53
  _cb(err);
32
54
  };
33
55
  if (process.platform !== 'win32') {
34
- return fs_1.default.rename(src, dst, cb);
56
+ return _fs.default.rename(src, dst, cb);
35
57
  }
36
58
  /*
37
59
  * windows can't remove opened file,
38
60
  * but it seem to be able to rename it
39
- */
40
- const tmp = tempFile(dst);
41
- fs_1.default.rename(dst, tmp, err => {
42
- fs_1.default.rename(src, dst, cb);
61
+ */ const tmp = tempFile(dst);
62
+ _fs.default.rename(dst, tmp, (err)=>{
63
+ _fs.default.rename(src, dst, cb);
43
64
  if (!err) {
44
- fs_1.default.unlink(tmp, () => { });
65
+ _fs.default.unlink(tmp, ()=>{});
45
66
  }
46
67
  });
47
68
  }
48
69
  class PackageStorage {
49
- constructor(path, logger) {
50
- Object.defineProperty(this, "path", {
51
- enumerable: true,
52
- configurable: true,
53
- writable: true,
54
- value: void 0
55
- });
56
- Object.defineProperty(this, "logger", {
57
- enumerable: true,
58
- configurable: true,
59
- writable: true,
60
- value: void 0
61
- });
62
- this.path = path;
63
- this.logger = logger;
64
- }
65
70
  updatePackage() {
66
71
  throw new Error('Method not implemented.');
67
72
  }
68
73
  deletePackage(packageName, callback) {
69
74
  debug('delete a package %o', packageName);
70
- return fs_1.default.unlink(this.getStorage(packageName), callback);
75
+ return _fs.default.unlink(this.getStorage(packageName), callback);
71
76
  }
72
77
  removePackage(callback) {
73
78
  debug('remove a package %o', this.path);
74
- fs_1.default.rmdir(this.getStorage('.'), callback);
79
+ _fs.default.rmdir(this.getStorage('.'), callback);
75
80
  }
76
81
  createPackage() {
77
82
  throw new Error('Method not implemented.');
@@ -83,37 +88,37 @@ class PackageStorage {
83
88
  throw new Error('Method not implemented.');
84
89
  }
85
90
  writeTarball(name) {
86
- const uploadStream = new streams_1.UploadTarball({});
91
+ const uploadStream = new _streams.UploadTarball({});
87
92
  debug('write a tarball for a package %o', name);
88
93
  let ended = 0;
89
- uploadStream.on('end', () => {
94
+ uploadStream.on('end', ()=>{
90
95
  ended = 1;
91
96
  });
92
97
  const pathName = this.getStorage(name);
93
- fs_1.default.access(pathName, fileNotFound => {
98
+ _fs.default.access(pathName, (fileNotFound)=>{
94
99
  const exists = !fileNotFound;
95
100
  if (exists) {
96
101
  uploadStream.emit('error', fSError(fileExist));
97
- }
98
- else {
102
+ } else {
99
103
  // this condition is missing in the original plugin
100
- if (!fs_1.default.existsSync(this.path)) {
101
- fs_1.default.mkdirSync(this.path, { recursive: true });
104
+ if (!_fs.default.existsSync(this.path)) {
105
+ _fs.default.mkdirSync(this.path, {
106
+ recursive: true
107
+ });
102
108
  }
103
- const temporalName = path_1.default.join(this.path, `${name}.tmp-${String(Math.random()).replace(/^0\./, '')}`);
109
+ const temporalName = _path.default.join(this.path, `${name}.tmp-${String(Math.random()).replace(/^0\./, '')}`);
104
110
  debug('write a temporal name %o', temporalName);
105
- const file = fs_1.default.createWriteStream(temporalName);
106
- const removeTempFile = () => fs_1.default.unlink(temporalName, () => { });
111
+ const file = _fs.default.createWriteStream(temporalName);
112
+ const removeTempFile = ()=>_fs.default.unlink(temporalName, ()=>{});
107
113
  let opened = false;
108
114
  uploadStream.pipe(file);
109
- uploadStream.done = () => {
110
- const onend = () => {
111
- file.on('close', () => {
112
- renameTmp(temporalName, pathName, function (err) {
115
+ uploadStream.done = ()=>{
116
+ const onend = ()=>{
117
+ file.on('close', ()=>{
118
+ renameTmp(temporalName, pathName, function(err) {
113
119
  if (err) {
114
120
  uploadStream.emit('error', err);
115
- }
116
- else {
121
+ } else {
117
122
  uploadStream.emit('success');
118
123
  }
119
124
  });
@@ -122,30 +127,28 @@ class PackageStorage {
122
127
  };
123
128
  if (ended) {
124
129
  onend();
125
- }
126
- else {
130
+ } else {
127
131
  uploadStream.on('end', onend);
128
132
  }
129
133
  };
130
- uploadStream.abort = () => {
134
+ uploadStream.abort = ()=>{
131
135
  if (opened) {
132
136
  opened = false;
133
- file.on('close', () => {
137
+ file.on('close', ()=>{
134
138
  removeTempFile();
135
139
  });
136
- }
137
- else {
140
+ } else {
138
141
  // if the file does not recieve any byte never is opened and has to be removed anyway.
139
142
  removeTempFile();
140
143
  }
141
144
  file.end();
142
145
  };
143
- file.on('open', () => {
146
+ file.on('open', ()=>{
144
147
  opened = true;
145
148
  // re-emitting open because it's handled in storage.js
146
149
  uploadStream.emit('open');
147
150
  });
148
- file.on('error', err => {
151
+ file.on('error', (err)=>{
149
152
  uploadStream.emit('error', err);
150
153
  });
151
154
  }
@@ -155,15 +158,15 @@ class PackageStorage {
155
158
  readTarball(name) {
156
159
  const pathName = this.getStorage(name);
157
160
  debug('read a a tarball %o on path %o', name, pathName);
158
- const readTarballStream = new streams_1.ReadTarball({});
159
- const readStream = fs_1.default.createReadStream(pathName);
160
- readStream.on('error', err => {
161
+ const readTarballStream = new _streams.ReadTarball({});
162
+ const readStream = _fs.default.createReadStream(pathName);
163
+ readStream.on('error', (err)=>{
161
164
  debug('error on read a tarball %o with error %o', name, err);
162
165
  readTarballStream.emit('error', err);
163
166
  });
164
- readStream.on('open', fd => {
165
- fs_1.default.fstat(fd, (err, stats) => {
166
- if ((0, isNil_1.default)(err) === false) {
167
+ readStream.on('open', (fd)=>{
168
+ _fs.default.fstat(fd, (err, stats)=>{
169
+ if ((0, _isNil.default)(err) === false) {
167
170
  debug('error on read a tarball %o with error %o', name, err);
168
171
  return readTarballStream.emit('error', err);
169
172
  }
@@ -173,15 +176,21 @@ class PackageStorage {
173
176
  readStream.pipe(readTarballStream);
174
177
  });
175
178
  });
176
- readTarballStream.abort = () => {
179
+ readTarballStream.abort = ()=>{
177
180
  debug('abort on read a tarball %o', name);
178
181
  readStream.close();
179
182
  };
180
183
  return readTarballStream;
181
184
  }
182
185
  getStorage(fileName = '') {
183
- return path_1.default.join(this.path, fileName);
186
+ return _path.default.join(this.path, fileName);
187
+ }
188
+ constructor(path, logger){
189
+ _define_property(this, "path", void 0);
190
+ _define_property(this, "logger", void 0);
191
+ this.path = path;
192
+ this.logger = logger;
184
193
  }
185
194
  }
186
- exports.PackageStorage = PackageStorage;
195
+
187
196
  //# sourceMappingURL=package-storage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"package-storage.js","sourceRoot":"","sources":["../src/package-storage.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,kDAA+B;AAC/B,yDAAiC;AACjC,wDAAiE;AACjE,gDAAgE;AAGhE,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B,MAAM,KAAK,GAAG,IAAA,eAAU,EAAC,mCAAmC,CAAC,CAAC;AAE9D,SAAS,O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I,EAAE,QAAQ,CAAC,CAAC;IAC1C,CAAC;CACJ;AA3JD,wCA2JC"}
1
+ {"version":3,"sources":["../src/package-storage.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport buildDebug from 'debug';\nimport isNil from 'lodash/isNil';\nimport { getCode, VerdaccioError } from '@verdaccio/commons-api';\nimport { UploadTarball, ReadTarball } from '@verdaccio/streams';\nimport { Logger, ILocalPackageManager, IUploadTarball, IReadTarball } from '@verdaccio/types';\n\nconst fileExist = 'EEXISTS';\n\nconst debug = buildDebug('verdaccio:plugin:local-storage:fs');\n\nfunction fSError(message: string, code = 409) {\n const err: VerdaccioError = getCode(code, message);\n // FIXME: we should return http-status codes here instead, future improvement\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n err.code = message;\n\n return err;\n}\n\nfunction tempFile(str: string) {\n return `${str}.tmp${String(Math.random()).substr(2)}`;\n}\n\nfunction renameTmp(src: string, dst: string, _cb: fs.NoParamCallback) {\n const cb: fs.NoParamCallback = err => {\n if (err) {\n fs.unlink(src, () => {});\n }\n _cb(err);\n };\n\n if (process.platform !== 'win32') {\n return fs.rename(src, dst, cb);\n }\n\n /*\n * windows can't remove opened file,\n * but it seem to be able to rename it\n */\n const tmp = tempFile(dst);\n fs.rename(dst, tmp, err => {\n fs.rename(src, dst, cb);\n if (!err) {\n fs.unlink(tmp, () => {});\n }\n });\n}\n\nexport class PackageStorage implements ILocalPackageManager {\n path: string;\n logger: Logger;\n\n constructor(path: string, logger: Logger) {\n this.path = path;\n this.logger = logger;\n }\n\n updatePackage(): void {\n throw new Error('Method not implemented.');\n }\n\n deletePackage(\n packageName: string,\n callback: (err: NodeJS.ErrnoException | null) => void\n ): void {\n debug('delete a package %o', packageName);\n\n return fs.unlink(this.getStorage(packageName), callback);\n }\n\n removePackage(callback: (err: NodeJS.ErrnoException | null) => void): void {\n debug('remove a package %o', this.path);\n\n fs.rmdir(this.getStorage('.'), callback);\n }\n\n createPackage(): void {\n throw new Error('Method not implemented.');\n }\n\n savePackage(): void {\n throw new Error('Method not implemented.');\n }\n\n readPackage(): void {\n throw new Error('Method not implemented.');\n }\n\n writeTarball(name: string): IUploadTarball {\n const uploadStream = new UploadTarball({});\n debug('write a tarball for a package %o', name);\n\n let ended = 0;\n uploadStream.on('end', () => {\n ended = 1;\n });\n\n const pathName = this.getStorage(name);\n\n fs.access(pathName, fileNotFound => {\n const exists = !fileNotFound;\n if (exists) {\n uploadStream.emit('error', fSError(fileExist));\n } else {\n // this condition is missing in the original plugin\n if (!fs.existsSync(this.path)) {\n fs.mkdirSync(this.path, { recursive: true });\n }\n const temporalName = path.join(\n this.path,\n `${name}.tmp-${String(Math.random()).replace(/^0\\./, '')}`\n );\n debug('write a temporal name %o', temporalName);\n const file = fs.createWriteStream(temporalName);\n const removeTempFile = () => fs.unlink(temporalName, () => {});\n let opened = false;\n uploadStream.pipe(file);\n\n uploadStream.done = () => {\n const onend = () => {\n file.on('close', () => {\n renameTmp(temporalName, pathName, function (err) {\n if (err) {\n uploadStream.emit('error', err);\n } else {\n uploadStream.emit('success');\n }\n });\n });\n file.end();\n };\n if (ended) {\n onend();\n } else {\n uploadStream.on('end', onend);\n }\n };\n\n uploadStream.abort = () => {\n if (opened) {\n opened = false;\n file.on('close', () => {\n removeTempFile();\n });\n } else {\n // if the file does not recieve any byte never is opened and has to be removed anyway.\n removeTempFile();\n }\n file.end();\n };\n\n file.on('open', () => {\n opened = true;\n // re-emitting open because it's handled in storage.js\n uploadStream.emit('open');\n });\n\n file.on('error', err => {\n uploadStream.emit('error', err);\n });\n }\n });\n\n return uploadStream;\n }\n\n readTarball(name: string): IReadTarball {\n const pathName = this.getStorage(name);\n debug('read a a tarball %o on path %o', name, pathName);\n\n const readTarballStream = new ReadTarball({});\n\n const readStream = fs.createReadStream(pathName);\n\n readStream.on('error', err => {\n debug('error on read a tarball %o with error %o', name, err);\n readTarballStream.emit('error', err);\n });\n\n readStream.on('open', fd => {\n fs.fstat(fd, (err, stats) => {\n if (isNil(err) === false) {\n debug('error on read a tarball %o with error %o', name, err);\n return readTarballStream.emit('error', err);\n }\n readTarballStream.emit('content-length', stats.size);\n readTarballStream.emit('open');\n debug('open on read a tarball %o', name);\n readStream.pipe(readTarballStream);\n });\n });\n\n readTarballStream.abort = () => {\n debug('abort on read a tarball %o', name);\n readStream.close();\n };\n\n return readTarballStream;\n }\n\n private getStorage(fileName = '') {\n return path.join(this.path, fileName);\n }\n}\n"],"names":["PackageStorage","fileExist","debug","buildDebug","fSError","message","code","err","getCode","tempFile","str","String","Math","random","substr","renameTmp","src","dst","_cb","cb","fs","unlink","process","platform","rename","tmp","updatePackage","Error","deletePackage","packageName","callback","getStorage","removePackage","path","rmdir","createPackage","savePackage","readPackage","writeTarball","name","uploadStream","UploadTarball","ended","on","pathName","access","fileNotFound","exists","emit","existsSync","mkdirSync","recursive","temporalName","join","replace","file","createWriteStream","removeTempFile","opened","pipe","done","onend","end","abort","readTarball","readTarballStream","ReadTarball","readStream","createReadStream","fd","fstat","stats","isNil","size","close","fileName","constructor","logger"],"mappings":";;;;+BAmDaA;;;eAAAA;;;2DAnDE;6DACE;8DACM;8DACL;4BACsB;yBACG;;;;;;;;;;;;;;;;;;;AAG3C,MAAMC,YAAY;AAElB,MAAMC,QAAQC,IAAAA,cAAU,EAAC;AAEzB,SAASC,QAAQC,OAAe,EAAEC,OAAO,GAAG;IACxC,MAAMC,MAAsBC,IAAAA,mBAAO,EAACF,MAAMD;IAC1C,6EAA6E;IAC7E,6DAA6D;IAC7D,aAAa;IACbE,IAAID,IAAI,GAAGD;IAEX,OAAOE;AACX;AAEA,SAASE,SAASC,GAAW;IACzB,OAAO,GAAGA,IAAI,IAAI,EAAEC,OAAOC,KAAKC,MAAM,IAAIC,MAAM,CAAC,IAAI;AACzD;AAEA,SAASC,UAAUC,GAAW,EAAEC,GAAW,EAAEC,GAAuB;IAChE,MAAMC,KAAyBZ,CAAAA;QAC3B,IAAIA,KAAK;YACLa,WAAE,C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  {
2
2
  "name": "verdaccio-tarball-local-storage",
3
- "version": "30.3.0",
3
+ "version": "31.0.0",
4
4
  "description": "Cropped and fixed version of the @verdaccio/local-storage plugin (https://github.com/verdaccio/monorepo/tree/9.x/plugins/local-storage)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,5 +31,5 @@
31
31
  "cli": {
32
32
  "webpack": false
33
33
  },
34
- "gitHead": "7521e8d9534299652c39fb5e71348c68120aee70"
34
+ "gitHead": "c52e188a1217df74052774a2eea6a5126089e3d5"
35
35
  }