From ef503257f36a858d84b173d5f7b3b3b1da3dd8c0 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Thu, 7 Feb 2019 22:04:53 +0100 Subject: [PATCH 1/7] feat: ability to restrict unpublish action to certain users #492 This is a PoC, it needs refactor and unit testing --- conf/default.yaml | 3 +++ src/api/endpoint/api/publish.js | 4 ++-- src/lib/auth-utils.js | 1 + src/lib/auth.js | 29 +++++++++++++++++++++++++++++ src/lib/config-utils.js | 2 ++ 5 files changed, 37 insertions(+), 2 deletions(-) diff --git a/conf/default.yaml b/conf/default.yaml index 4b721a700..d2cab443f 100644 --- a/conf/default.yaml +++ b/conf/default.yaml @@ -44,6 +44,7 @@ packages: # scoped packages access: $all publish: $authenticated + unpublish: $authenticated proxy: npmjs '**': @@ -58,6 +59,8 @@ packages: # (anyone can register by default, remember?) publish: $authenticated + unpublish: $authenticated + # if package is not available locally, proxy requests to 'npmjs' registry proxy: npmjs diff --git a/src/api/endpoint/api/publish.js b/src/api/endpoint/api/publish.js index 55cbd5173..a4b18c4c3 100644 --- a/src/api/endpoint/api/publish.js +++ b/src/api/endpoint/api/publish.js @@ -24,10 +24,10 @@ export default function publish(router: Router, auth: IAuth, storage: IStorageHa router.put('/:package/:_rev?/:revision?', can('publish'), media(mime.getType('json')), expectJson, publishPackage(storage, config)); // un-publishing an entire package - router.delete('/:package/-rev/*', can('publish'), unPublishPackage(storage)); + router.delete('/:package/-rev/*', can('unpublish'), can('publish'), unPublishPackage(storage)); // removing a tarball - router.delete('/:package/-/:filename/-rev/:revision', can('publish'), removeTarball(storage)); + router.delete('/:package/-/:filename/-rev/:revision', can('unpublish'), can('publish'), removeTarball(storage)); // uploading package tarball router.put('/:package/-/:filename/*', can('publish'), media(HEADERS.OCTET_STREAM), uploadPackageTarball(storage)); diff --git a/src/lib/auth-utils.js b/src/lib/auth-utils.js index 331d4c0ce..ff973c6aa 100644 --- a/src/lib/auth-utils.js +++ b/src/lib/auth-utils.js @@ -72,6 +72,7 @@ export function getDefaultPlugins() { allow_access: allow_action('access'), allow_publish: allow_action('publish'), + allow_unpublish: allow_action('unpublish'), }; } diff --git a/src/lib/auth.js b/src/lib/auth.js index 7694b0d4e..e6495d5c6 100644 --- a/src/lib/auth.js +++ b/src/lib/auth.js @@ -190,6 +190,35 @@ class Auth implements IAuth { })(); } + allow_unpublish({ packageName, packageVersion }: AuthPluginPackage, user: string, callback: Callback) { + const plugins = this.plugins.slice(0); + const self = this; + // $FlowFixMe + const pkg = Object.assign({ name: packageName, version: packageVersion }, getMatchedPackagesSpec(packageName, this.config.packages)); + this.logger.trace({ packageName }, 'allow unpublish for @{packageName}'); + + (function next() { + const plugin = plugins.shift(); + + if (_.isFunction(plugin.allow_unpublish) === false) { + return next(); + } + + plugin.allow_unpublish(user, pkg, (err, ok: boolean) => { + if (err) { + self.logger.trace({ packageName }, 'forbidden unpublish for @{packageName}'); + return callback(err); + } + + if (ok) { + self.logger.trace({ packageName }, 'allowed unpublish for @{packageName}'); + return callback(null, ok); + } + next(); // cb(null, false) causes next plugin to roll + }); + })(); + } + /** * Allow user to publish a package. */ diff --git a/src/lib/config-utils.js b/src/lib/config-utils.js index d000a638d..e1bccd7fc 100644 --- a/src/lib/config-utils.js +++ b/src/lib/config-utils.js @@ -123,6 +123,8 @@ export function normalisePackageAccess(packages: PackageList): PackageList { delete normalizedPkgs[pkg].allow_publish; normalizedPkgs[pkg].proxy = normalizeUserList(packages[pkg].proxy_access, packages[pkg].proxy); delete normalizedPkgs[pkg].proxy_access; + // $FlowFixMe + normalizedPkgs[pkg].unpublish = normalizeUserList([], packages[pkg].unpublish); } } From 9e17d2bc27d4cbdcd5d9ac02db11fa5fe8f307c0 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Sun, 24 Feb 2019 23:20:25 +0100 Subject: [PATCH 2/7] chore: fix unpublish issues, fix unit test --- .gitignore | 1 + package.json | 8 +- src/api/endpoint/api/publish.js | 2 +- src/api/index.js | 2 +- src/lib/auth-utils.js | 15 +- src/lib/auth.js | 40 +- src/lib/config-utils.js | 3 +- .../__snapshots__/api.publish.spec.js.snap | 4 +- .../__snapshots__/update-banner.spec.js.snap | 8 +- test/unit/api/api.jwt.spec.js | 31 +- test/unit/api/api.pkg.access.spec.js | 29 +- test/unit/api/api.profile.spec.js | 22 +- test/unit/api/api.spec.js | 45 +- test/unit/api/api.web.spec.js | 35 +- test/unit/api/auth-utils.spec.js | 4 +- test/unit/api/auth.spec.js | 23 +- test/unit/api/basic_system.spec.js | 2 +- test/unit/api/cli.spec.js | 4 +- test/unit/api/local-storage.spec.js | 9 +- test/unit/api/search.spec.js | 5 +- test/unit/api/store.spec.js | 24 +- test/unit/api/up-storage.spec.js | 2 +- test/unit/partials/config/index.js | 63 +- test/unit/partials/config/plugin.js | 3 +- test/unit/partials/config/yaml/api.spec.yaml | 31 + .../partials/config/yaml/api.web.spec.yaml | 20 + test/unit/partials/config/yaml/default.yaml | 38 + .../unit/partials/config/yaml/store.spec.yaml | 22 + .../__snapshots__/notfound.spec.js.snap | 162 +--- yarn.lock | 898 +++++++++++------- 30 files changed, 825 insertions(+), 730 deletions(-) create mode 100644 test/unit/partials/config/yaml/api.spec.yaml create mode 100644 test/unit/partials/config/yaml/api.web.spec.yaml create mode 100644 test/unit/partials/config/yaml/default.yaml create mode 100644 test/unit/partials/config/yaml/store.spec.yaml diff --git a/.gitignore b/.gitignore index 7055bd4e8..62c72c80d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ build/ ### Test test/unit/partials/store/test-*-storage/* +test/unit/partials/store/storage_default_storage/* .verdaccio-db.json .sinopia-db.json diff --git a/package.json b/package.json index dd7cae360..a97b8c94a 100644 --- a/package.json +++ b/package.json @@ -86,10 +86,10 @@ "husky": "0.15.0-rc.8", "identity-obj-proxy": "3.0.0", "in-publish": "2.0.0", - "jest": "23.6.0", - "jest-environment-jsdom": "23.4.0", - "jest-environment-jsdom-global": "1.1.0", - "jest-environment-node": "23.4.0", + "jest": "24.1.0", + "jest-environment-jsdom": "24.0.0", + "jest-environment-jsdom-global": "1.1.1", + "jest-environment-node": "24.0.0", "lint-staged": "7.3.0", "localstorage-memory": "1.0.2", "mini-css-extract-plugin": "0.4.3", diff --git a/src/api/endpoint/api/publish.js b/src/api/endpoint/api/publish.js index a4b18c4c3..92a49fb23 100644 --- a/src/api/endpoint/api/publish.js +++ b/src/api/endpoint/api/publish.js @@ -24,7 +24,7 @@ export default function publish(router: Router, auth: IAuth, storage: IStorageHa router.put('/:package/:_rev?/:revision?', can('publish'), media(mime.getType('json')), expectJson, publishPackage(storage, config)); // un-publishing an entire package - router.delete('/:package/-rev/*', can('unpublish'), can('publish'), unPublishPackage(storage)); + router.delete('/:package/-rev/*', can('unpublish'), unPublishPackage(storage)); // removing a tarball router.delete('/:package/-/:filename/-rev/:revision', can('unpublish'), can('publish'), removeTarball(storage)); diff --git a/src/api/index.js b/src/api/index.js index 741eef521..fe18119bb 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -106,7 +106,7 @@ const defineAPI = function(config: IConfig, storage: IStorageHandler) { export default (async function(configHash: any) { setup(configHash.logs); - const config: IConfig = new AppConfig(configHash); + const config: IConfig = new AppConfig(_.cloneDeep(configHash)); const storage: IStorageHandler = new Storage(config); // waits until init calls have been initialized await storage.init(config); diff --git a/src/lib/auth-utils.js b/src/lib/auth-utils.js index ff973c6aa..35052e5ce 100644 --- a/src/lib/auth-utils.js +++ b/src/lib/auth-utils.js @@ -60,6 +60,19 @@ export function allow_action(action: string) { }; } +export function handleSpecialUnpublish() { + return function(user: RemoteUser, pkg: Package, callback: Callback) { + const action: string = 'unpublish'; + const hasSupport: boolean = _.isNil(pkg[action]) === false ? pkg[action] : false; + + if (hasSupport === false) { + return callback(null, undefined); + } + + return allow_action(action)(user, pkg, callback); + }; +} + export function getDefaultPlugins() { return { authenticate(user: string, password: string, cb: Callback) { @@ -72,7 +85,7 @@ export function getDefaultPlugins() { allow_access: allow_action('access'), allow_publish: allow_action('publish'), - allow_unpublish: allow_action('unpublish'), + allow_unpublish: handleSpecialUnpublish(), }; } diff --git a/src/lib/auth.js b/src/lib/auth.js index fc6c43cf2..9bf67c7d5 100644 --- a/src/lib/auth.js +++ b/src/lib/auth.js @@ -191,32 +191,32 @@ class Auth implements IAuth { } allow_unpublish({ packageName, packageVersion }: AuthPluginPackage, user: string, callback: Callback) { - const plugins = this.plugins.slice(0); - const self = this; // $FlowFixMe const pkg = Object.assign({ name: packageName, version: packageVersion }, getMatchedPackagesSpec(packageName, this.config.packages)); this.logger.trace({ packageName }, 'allow unpublish for @{packageName}'); - (function next() { - const plugin = plugins.shift(); - + for (const plugin of this.plugins) { if (_.isFunction(plugin.allow_unpublish) === false) { - return next(); + continue; + } else { + plugin.allow_unpublish(user, pkg, (err, ok: boolean) => { + if (err) { + this.logger.trace({ packageName }, 'forbidden publish for @{packageName}, it will fallback on unpublish permissions'); + return callback(err); + } + + if (_.isNil(ok) === true) { + this.logger.trace({ packageName }, 'we bypass unpublish for @{packageName}, publish will handle the access'); + return this.allow_publish(...arguments); + } + + if (ok) { + this.logger.trace({ packageName }, 'allowed unpublish for @{packageName}'); + return callback(null, ok); + } + }); } - - plugin.allow_unpublish(user, pkg, (err, ok: boolean) => { - if (err) { - self.logger.trace({ packageName }, 'forbidden unpublish for @{packageName}'); - return callback(err); - } - - if (ok) { - self.logger.trace({ packageName }, 'allowed unpublish for @{packageName}'); - return callback(null, ok); - } - next(); // cb(null, false) causes next plugin to roll - }); - })(); + } } /** diff --git a/src/lib/config-utils.js b/src/lib/config-utils.js index e1bccd7fc..838007088 100644 --- a/src/lib/config-utils.js +++ b/src/lib/config-utils.js @@ -123,8 +123,9 @@ export function normalisePackageAccess(packages: PackageList): PackageList { delete normalizedPkgs[pkg].allow_publish; normalizedPkgs[pkg].proxy = normalizeUserList(packages[pkg].proxy_access, packages[pkg].proxy); delete normalizedPkgs[pkg].proxy_access; + // if unpublish is not defined, we set to false to fallback in publish access // $FlowFixMe - normalizedPkgs[pkg].unpublish = normalizeUserList([], packages[pkg].unpublish); + normalizedPkgs[pkg].unpublish = _.isUndefined(packages[pkg].unpublish) ? false : normalizeUserList([], packages[pkg].unpublish); } } diff --git a/test/unit/api/__snapshots__/api.publish.spec.js.snap b/test/unit/api/__snapshots__/api.publish.spec.js.snap index 729414487..0f5c2bbcc 100644 --- a/test/unit/api/__snapshots__/api.publish.spec.js.snap +++ b/test/unit/api/__snapshots__/api.publish.spec.js.snap @@ -16,7 +16,7 @@ exports[`Publish endpoints - publish package should add a new package 1`] = ` ], "results": Array [ Object { - "isThrow": false, + "type": "return", "value": undefined, }, ], @@ -40,7 +40,7 @@ exports[`Publish endpoints - publish package should change the existing package ], "results": Array [ Object { - "isThrow": false, + "type": "return", "value": undefined, }, ], diff --git a/test/unit/api/__snapshots__/update-banner.spec.js.snap b/test/unit/api/__snapshots__/update-banner.spec.js.snap index 86704e953..d7a4f6aef 100644 --- a/test/unit/api/__snapshots__/update-banner.spec.js.snap +++ b/test/unit/api/__snapshots__/update-banner.spec.js.snap @@ -14,7 +14,7 @@ exports[`Verdaccio update banner should print major update banner 1`] = ` ], "results": Array [ Object { - "isThrow": false, + "type": "return", "value": undefined, }, ], @@ -35,7 +35,7 @@ exports[`Verdaccio update banner should print minor update banner 1`] = ` ], "results": Array [ Object { - "isThrow": false, + "type": "return", "value": undefined, }, ], @@ -56,7 +56,7 @@ exports[`Verdaccio update banner should print patch update banner 1`] = ` ], "results": Array [ Object { - "isThrow": false, + "type": "return", "value": undefined, }, ], @@ -75,7 +75,7 @@ exports[`Verdaccio update banner when default registry returns with error 1`] = ], "results": Array [ Object { - "isThrow": false, + "type": "return", "value": undefined, }, ], diff --git a/test/unit/api/api.jwt.spec.js b/test/unit/api/api.jwt.spec.js index 563fb5527..196efc4fe 100644 --- a/test/unit/api/api.jwt.spec.js +++ b/test/unit/api/api.jwt.spec.js @@ -5,7 +5,6 @@ import _ from 'lodash'; import path from 'path'; import rimraf from 'rimraf'; -import Config from '../../../src/lib/config'; import endPointAPI from '../../../src/api/index'; import {HEADERS, HTTP_STATUS, HEADER_TYPE} from '../../../src/lib/constants'; @@ -27,7 +26,6 @@ const parseConfigurationJWTFile = () => { const FORBIDDEN_VUE: string = 'authorization required to access package vue'; describe('endpoint user auth JWT unit test', () => { - let config; let app; let mockRegistry; @@ -36,21 +34,22 @@ describe('endpoint user auth JWT unit test', () => { const mockServerPort = 55546; rimraf(store, async () => { const confS = parseConfigFile(parseConfigurationJWTFile()); - const configForTest = _.clone(confS); - configForTest.storage = store; - configForTest.auth = { - htpasswd: { - file: './test-jwt-storage/.htpasswd' + const configForTest = _.assign({}, _.cloneDeep(confS), { + storage: store, + plinks: { + npmjs: { + url: `http://${DOMAIN_SERVERS}:${mockServerPort}` + } + }, + self_path: store, + auth: { + htpasswd: { + file: './test-jwt-storage/.htpasswd' + } } - }; - configForTest.uplinks = { - npmjs: { - url: `http://${DOMAIN_SERVERS}:${mockServerPort}` - } - }; - configForTest.self_path = store; - config = new Config(configForTest); - app = await endPointAPI(config); + }); + + app = await endPointAPI(configForTest); mockRegistry = await mockServer(mockServerPort).init(); done(); }); diff --git a/test/unit/api/api.pkg.access.spec.js b/test/unit/api/api.pkg.access.spec.js index 669c4d297..a9c048aeb 100644 --- a/test/unit/api/api.pkg.access.spec.js +++ b/test/unit/api/api.pkg.access.spec.js @@ -5,7 +5,6 @@ import rimraf from 'rimraf'; import { HEADERS, HTTP_STATUS } from '../../../src/lib/constants'; import configDefault from '../partials/config/config_access'; -import Config from '../../../src/lib/config'; import endPointAPI from '../../../src/api/index'; import {mockServer} from './mock'; import {DOMAIN_SERVERS} from '../../functional/config.functional'; @@ -13,7 +12,6 @@ import {DOMAIN_SERVERS} from '../../functional/config.functional'; require('../../../src/lib/logger').setup([]); describe('api with no limited access configuration', () => { - let config; let app; let mockRegistry; @@ -21,20 +19,21 @@ describe('api with no limited access configuration', () => { const mockServerPort = 55530; const store = path.join(__dirname, './partials/store/access-storage'); rimraf(store, async () => { - const configForTest = _.clone(configDefault); - configForTest.auth = { - htpasswd: { - file: './access-storage/htpasswd-access-test' + const configForTest = _.assign({}, _.cloneDeep(configDefault), { + auth: { + htpasswd: { + file: './access-storage/htpasswd-access-test' + } + }, + self_path: store, + uplinks: { + npmjs: { + url: `http://${DOMAIN_SERVERS}:${mockServerPort}` + } } - }; - configForTest.self_path = store; - configForTest.uplinks = { - npmjs: { - url: `http://${DOMAIN_SERVERS}:${mockServerPort}` - } - }; - config = new Config(configForTest); - app = await endPointAPI(config); + }); + + app = await endPointAPI(configForTest); mockRegistry = await mockServer(mockServerPort).init(); done(); }); diff --git a/test/unit/api/api.profile.spec.js b/test/unit/api/api.profile.spec.js index 002f771a8..377480c0f 100644 --- a/test/unit/api/api.profile.spec.js +++ b/test/unit/api/api.profile.spec.js @@ -5,7 +5,6 @@ import _ from 'lodash'; import path from 'path'; import rimraf from 'rimraf'; -import Config from '../../../src/lib/config'; import endPointAPI from '../../../src/api/index'; import {mockServer} from './mock'; import {parseConfigFile} from '../../../src/lib/utils'; @@ -22,7 +21,6 @@ const parseConfigurationProfile = () => { describe('endpoint user profile', () => { - let config; let app; let mockRegistry; @@ -31,16 +29,16 @@ describe('endpoint user profile', () => { const mockServerPort = 55544; rimraf(store, async () => { const parsedConfig = parseConfigFile(parseConfigurationProfile()); - const configForTest = _.clone(parsedConfig); - configForTest.storage = store; - configForTest.auth = { - htpasswd: { - file: './test-profile-storage/.htpasswd' - } - }; - configForTest.self_path = store; - config = new Config(configForTest); - app = await endPointAPI(config); + const configForTest = _.assign({}, _.cloneDeep(parsedConfig), { + storage: store, + auth: { + htpasswd: { + file: './test-profile-storage/.htpasswd' + } + }, + self_path: store + }); + app = await endPointAPI(configForTest); mockRegistry = await mockServer(mockServerPort).init(); done(); }); diff --git a/test/unit/api/api.spec.js b/test/unit/api/api.spec.js index 7d2317ab6..d1dcc6cb6 100644 --- a/test/unit/api/api.spec.js +++ b/test/unit/api/api.spec.js @@ -5,39 +5,40 @@ import rimraf from 'rimraf'; import configDefault from '../partials/config/index'; import publishMetadata from '../partials/publish-api'; -import Config from '../../../src/lib/config'; import endPointAPI from '../../../src/api/index'; -import { HEADERS, API_ERROR, HTTP_STATUS, HEADER_TYPE, API_MESSAGE} from '../../../src/lib/constants'; +import {HEADERS, API_ERROR, HTTP_STATUS, HEADER_TYPE, API_MESSAGE, TOKEN_BEARER} from '../../../src/lib/constants'; import {mockServer} from './mock'; import {DOMAIN_SERVERS} from '../../functional/config.functional'; +import {buildToken} from '../../../src/lib/utils'; require('../../../src/lib/logger').setup([]); const credentials = { name: 'jota', password: 'secretPass' }; describe('endpoint unit test', () => { - let config; let app; let mockRegistry; beforeAll(function(done) { - const store = path.join(__dirname, '../partials/store/test-storage'); + const store = path.join(__dirname, '../store/test-storage-api-spec'); const mockServerPort = 55549; rimraf(store, async () => { - const configForTest = _.clone(configDefault); - configForTest.auth = { - htpasswd: { - file: './test-storage/.htpasswd' + const configForTest = configDefault({ + auth: { + htpasswd: { + file: './test-storage-api-spec/.htpasswd' + } + }, + storage: store, + self_path: store, + uplinks: { + npmjs: { + url: `http://${DOMAIN_SERVERS}:${mockServerPort}` + } } - }; - configForTest.uplinks = { - npmjs: { - url: `http://${DOMAIN_SERVERS}:${mockServerPort}` - } - }; - configForTest.self_path = store; - config = new Config(configForTest); - app = await endPointAPI(config); + }, 'api.spec.yaml'); + + app = await endPointAPI(configForTest); mockRegistry = await mockServer(mockServerPort).init(); done(); }); @@ -157,7 +158,7 @@ describe('endpoint unit test', () => { // we need it here, because token is required request(app) .get('/vue') - .set('authorization', `Bearer ${token}`) + .set('authorization', buildToken(TOKEN_BEARER, token)) .expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET) .expect(HTTP_STATUS.OK) .end(function(err, res) { @@ -171,7 +172,7 @@ describe('endpoint unit test', () => { test('should test fails add a new user with missing name', (done) => { - const credentialsShort = _.clone(credentials); + const credentialsShort = _.cloneDeep(credentials); delete credentialsShort.name; request(app) @@ -192,7 +193,7 @@ describe('endpoint unit test', () => { test('should test fails add a new user with missing password', (done) => { - const credentialsShort = _.clone(credentials); + const credentialsShort = _.cloneDeep(credentials); delete credentialsShort.password; request(app) @@ -213,7 +214,7 @@ describe('endpoint unit test', () => { }); test('should test add a new user with login', (done) => { - const newCredentials = _.clone(credentials); + const newCredentials = _.cloneDeep(credentials); newCredentials.name = 'jotaNew'; request(app) @@ -248,7 +249,7 @@ describe('endpoint unit test', () => { test('should test fails add a new user with wrong password', (done) => { - const credentialsShort = _.clone(credentials); + const credentialsShort = _.cloneDeep(credentials); credentialsShort.password = 'failPassword'; request(app) diff --git a/test/unit/api/api.web.spec.js b/test/unit/api/api.web.spec.js index 282641e11..b88479081 100644 --- a/test/unit/api/api.web.spec.js +++ b/test/unit/api/api.web.spec.js @@ -1,12 +1,10 @@ import request from 'supertest'; -import _ from 'lodash'; import path from 'path'; import rimraf from 'rimraf'; import configDefault from '../partials/config/index'; import publishMetadata from '../partials/publish-api'; import forbiddenPlace from '../partials/forbidden-place'; -import Config from '../../../src/lib/config'; import endPointAPI from '../../../src/api/index'; import { HEADERS, API_ERROR, HTTP_STATUS, HEADER_TYPE, DIST_TAGS} from '../../../src/lib/constants'; @@ -18,7 +16,6 @@ require('../../../src/lib/logger').setup([]); const credentials = { name: 'user-web', password: 'secretPass' }; describe('endpoint web unit test', () => { - let config; let app; let mockRegistry; @@ -26,21 +23,21 @@ describe('endpoint web unit test', () => { const store = path.join(__dirname, '../store/test-storage-web'); const mockServerPort = 55544; rimraf(store, async () => { - const configForTest = _.clone(configDefault); - configForTest.auth = { - htpasswd: { - file: './test-storage-web/.htpasswd' - } - }; - configForTest.storage = path.join(__dirname, '../store/test-storage-web'); - configForTest.uplinks = { - npmjs: { - url: `http://${DOMAIN_SERVERS}:${mockServerPort}` - } - }; - configForTest.self_path = store; - config = new Config(configForTest); - app = await endPointAPI(config); + const configForTest = configDefault({ + auth: { + htpasswd: { + file: './test-storage-web/.htpasswd' + } + }, + storage: path.join(__dirname, '../store/test-storage-web'), + uplinks: { + npmjs: { + url: `http://${DOMAIN_SERVERS}:${mockServerPort}` + } + }, + self_path: store + }, 'api.web.spec.yaml'); + app = await endPointAPI(configForTest); mockRegistry = await mockServer(mockServerPort).init(); done(); }); @@ -52,7 +49,7 @@ describe('endpoint web unit test', () => { }); describe('Registry WebUI endpoints', () => { - beforeAll(async function() { + beforeAll(async () => { await request(app) .put('/@scope%2fpk1-test') .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) diff --git a/test/unit/api/auth-utils.spec.js b/test/unit/api/auth-utils.spec.js index e27cec7f3..b630b5b85 100644 --- a/test/unit/api/auth-utils.spec.js +++ b/test/unit/api/auth-utils.spec.js @@ -22,7 +22,7 @@ import {parseConfigurationFile} from '../__helper'; import type {IAuth, } from '../../../types/index'; import type {Config, Security, RemoteUser} from '@verdaccio/types'; -setup(configExample.logs); +setup([]); describe('Auth utilities', () => { const parseConfigurationSecurityFile = (name) => { @@ -31,7 +31,7 @@ describe('Auth utilities', () => { function getConfig(configFileName: string, secret: string) { const conf = parseConfigFile(parseConfigurationSecurityFile(configFileName)); - const secConf= _.merge(configExample, conf); + const secConf= _.merge(configExample(), conf); secConf.secret = secret; const config: Config = new AppConfig(secConf); diff --git a/test/unit/api/auth.spec.js b/test/unit/api/auth.spec.js index 0c88c9de1..4f26ec013 100644 --- a/test/unit/api/auth.spec.js +++ b/test/unit/api/auth.spec.js @@ -1,26 +1,31 @@ +import _ from 'lodash'; // @flow - import Auth from '../../../src/lib/auth'; // $FlowFixMe -import configExample from '../partials/config/index'; +import _configExample from '../partials/config/index'; // $FlowFixMe -import configPlugins from '../partials/config/plugin'; +import _configPlugins from '../partials/config/plugin'; import AppConfig from '../../../src/lib/config'; import {setup} from '../../../src/lib/logger'; import type {IAuth} from '../../../types/index'; import type {Config} from '@verdaccio/types'; -const authConfig = Object.assign({}, configExample); -// avoid noisy log output -authConfig.logs = [{type: 'stdout', format: 'pretty', level: 'error'}]; - -setup(configExample.logs); +setup([]); describe('AuthTest', () => { + let configExample; + let configPlugins; + + beforeEach(() => { + configExample = _configExample({ + logs: [{type: 'stdout', format: 'pretty', level: 'error'}] + }); + configPlugins = _.cloneDeep(_configPlugins); + }); test('should be defined', () => { - const config: Config = new AppConfig(authConfig); + const config: Config = new AppConfig(configExample); const auth: IAuth = new Auth(config); expect(auth).toBeDefined(); diff --git a/test/unit/api/basic_system.spec.js b/test/unit/api/basic_system.spec.js index 91fa8939a..4a84d549a 100644 --- a/test/unit/api/basic_system.spec.js +++ b/test/unit/api/basic_system.spec.js @@ -18,7 +18,7 @@ describe('basic system test', () => { beforeAll(async function(done) { - app.use(await endPointAPI(config)); + app.use(await endPointAPI(config())); server.listen(0, function() { port = server.address().port; diff --git a/test/unit/api/cli.spec.js b/test/unit/api/cli.spec.js index 0432b747a..1c7579f7c 100644 --- a/test/unit/api/cli.spec.js +++ b/test/unit/api/cli.spec.js @@ -27,7 +27,7 @@ describe('startServer via API', () => { const version = '1.0.0'; const port = '6000'; - await startServer(_.clone(config), port, store, version, serverName, + await startServer(config(), port, store, version, serverName, (webServer, addrs, pkgName, pkgVersion) => { expect(webServer).toBeDefined(); expect(addrs).toBeDefined(); @@ -49,7 +49,7 @@ describe('startServer via API', () => { const address = 'https://www.domain.com:443'; const realProcess = process; - const conf = _.clone(config); + const conf = config(); conf.https = {}; // save process to catch exist const exitMock = jest.fn(); diff --git a/test/unit/api/local-storage.spec.js b/test/unit/api/local-storage.spec.js index 914bcab50..c17e4e739 100644 --- a/test/unit/api/local-storage.spec.js +++ b/test/unit/api/local-storage.spec.js @@ -2,6 +2,7 @@ import rimRaf from 'rimraf'; import path from 'path'; + import LocalStorage from '../../../src/lib/local-storage'; import AppConfig from '../../../src/lib/config'; // $FlowFixMe @@ -27,8 +28,10 @@ describe('LocalStorage', () => { const tarballName2: string = `${pkgName}-add-tarball-1.0.5.tgz`; const getStorage = (LocalStorageClass = LocalStorage) => { - const config: Config = new AppConfig(configExample); - config.self_path = path.join('../partials/store'); + const config: Config = new AppConfig(configExample({ + self_path: path.join('../partials/store') + })); + return new LocalStorageClass(config, Logger.logger); } @@ -262,7 +265,7 @@ describe('LocalStorage', () => { // $FlowFixMe MockLocalStorage.prototype._writePackage = jest.fn(LocalStorage.prototype._writePackage) _storage = getStorage(MockLocalStorage); - rimRaf(path.join(configExample.storage, pkgName), async () => { + rimRaf(path.join(configExample().storage, pkgName), async () => { await addPackageToStore(pkgName, generatePackageTemplate(pkgName)); await addNewVersion(pkgName, '1.0.1'); await addNewVersion(pkgName, version); diff --git a/test/unit/api/search.spec.js b/test/unit/api/search.spec.js index 602d565d5..370860ca5 100644 --- a/test/unit/api/search.spec.js +++ b/test/unit/api/search.spec.js @@ -1,8 +1,7 @@ import Search from '../../../src/lib/search'; import Config from '../../../src/lib/config'; import Storage from '../../../src/lib/storage'; - -let config_hash = require('../partials/config/index'); +import buildConfig from '../partials/config/index'; require('../../../src/lib/logger').setup([]); @@ -33,7 +32,7 @@ let packages = [ describe('search', () => { beforeAll(async function() { - let config = new Config(config_hash); + let config = new Config(buildConfig()); this.storage = new Storage(config); await this.storage.init(config); Search.configureStorage(this.storage); diff --git a/test/unit/api/store.spec.js b/test/unit/api/store.spec.js index 9ea50ff48..faea7a324 100644 --- a/test/unit/api/store.spec.js +++ b/test/unit/api/store.spec.js @@ -1,6 +1,5 @@ // @flow -import _ from 'lodash'; import path from 'path'; import fs from 'fs'; import rimraf from 'rimraf'; @@ -16,19 +15,21 @@ import {API_ERROR, HTTP_STATUS} from '../../../src/lib/constants'; import {mockServer} from './mock'; import {DOMAIN_SERVERS} from '../../functional/config.functional'; -setup(configExample.logs); +setup([]); const storagePath = path.join(__dirname, '../partials/store/test-storage-store.spec'); const mockServerPort: number = 55548; -const generateStorage = async function(port = mockServerPort, configDefault = configExample) { - const storageConfig = _.clone(configDefault); - storageConfig.self_path = __dirname; - storageConfig.storage = storagePath; - storageConfig.uplinks = { - npmjs: { - url: `http://${DOMAIN_SERVERS}:${port}` +const generateStorage = async function(port = mockServerPort) { + const storageConfig = configExample({ + self_path: __dirname, + storage: storagePath, + uplinks: { + npmjs: { + url: `http://${DOMAIN_SERVERS}:${port}` + } } - }; + }, 'store.spec.yaml'); + const config: Config = new AppConfig(storageConfig); const store: IStorageHandler = new Storage(config); await store.init(config); @@ -100,11 +101,14 @@ describe('StorageTest', () => { const storage: IStorageHandler = await generateStorage(); const metadataSource = path.join(__dirname, '../partials/metadata'); const metadataPath = path.join(storagePath, 'npm_test/package.json'); + fs.mkdirSync(path.join(storagePath, 'npm_test')); fs.writeFileSync(metadataPath, fs.readFileSync(metadataSource)); const metadata = JSON.parse(fs.readFileSync(metadataPath).toString()); // $FlowFixMe storage.localStorage.updateVersions = jest.fn(storage.localStorage.updateVersions); + expect(metadata).toBeDefined(); + console.log("M-->", metadata); storage._syncUplinksMetadata('npm_test', metadata, {}, (err) => { expect(err).toBeNull(); expect(storage.localStorage.updateVersions).not.toHaveBeenCalled(); diff --git a/test/unit/api/up-storage.spec.js b/test/unit/api/up-storage.spec.js index a4d325233..711292bce 100644 --- a/test/unit/api/up-storage.spec.js +++ b/test/unit/api/up-storage.spec.js @@ -21,7 +21,7 @@ describe('UpStorge', () => { url: `http://0.0.0.0:${mockServerPort}` }; const generateProxy = (config: UpLinkConf = uplinkDefault) => { - const appConfig: Config = new AppConfig(configExample); + const appConfig: Config = new AppConfig(configExample()); return new ProxyStorage(config, appConfig); }; diff --git a/test/unit/partials/config/index.js b/test/unit/partials/config/index.js index ce3e018f1..8863a9f1b 100644 --- a/test/unit/partials/config/index.js +++ b/test/unit/partials/config/index.js @@ -1,59 +1,12 @@ +import _ from 'lodash'; import path from 'path'; +import {parseConfigFile} from '../../../../src/lib/utils'; -const config = { - storage: path.join(__dirname, '../store/test-storage'), - uplinks: { - 'npmjs': { - 'url': 'http://localhost:4873/' - } - }, - packages: { - '@*/*': { - access: '$all', - publish: '$all', - proxy: 'npmjs' - }, - 'forbidden-place': { - access: 'nobody', - publish: '$all' - }, - - 'react': { - access: '$all', - publish: '$all', - proxy: 'npmjs' - }, - - 'corrupted-package': { - access: '$all', - publish: '$all', - proxy: 'npmjs' - }, - - 'jquery': { - access: '$all', - publish: '$all', - proxy: 'npmjs' - }, - 'auth-package': { - access: '$authenticated', - publish: '$authenticated' - }, - 'vue': { - access: '$authenticated', - publish: '$authenticated', - proxy: 'npmjs' - }, - '*': { - access: '$all', - publish: '$all' - }, - }, - logs: [ - {type: 'stdout', format: 'pretty', level: 'warn'}, - ], -}; - -module.exports = config; +export default (options, url = 'default.yaml') => { + const locationFile = path.join(__dirname, `../config/yaml/${url}`); + const config = parseConfigFile(locationFile); + + return _.assign({}, _.cloneDeep(config), options); +} diff --git a/test/unit/partials/config/plugin.js b/test/unit/partials/config/plugin.js index cc81f6c7a..c383294b0 100644 --- a/test/unit/partials/config/plugin.js +++ b/test/unit/partials/config/plugin.js @@ -1,8 +1,9 @@ import path from 'path'; +import config from './index'; module.exports = { - ...require('./index'), + ...config(), auth: { [`${path.join(__dirname, '../plugin/authenticate')}`]: { } } diff --git a/test/unit/partials/config/yaml/api.spec.yaml b/test/unit/partials/config/yaml/api.spec.yaml new file mode 100644 index 000000000..76b324b28 --- /dev/null +++ b/test/unit/partials/config/yaml/api.spec.yaml @@ -0,0 +1,31 @@ +storage: ./storage_default_storage +uplinks: + npmjs: + url: http://localhost:4873/ +packages: + '@*/*': + access: $all + publish: $all + unpublish: $all + proxy: npmjs + 'auth-package': + access: $authenticated + publish: $authenticated + 'forbidden-place': + access: nobody + publish: $all + 'vue': + access: $authenticated + publish: $authenticated + proxy: npmjs + 'jquery': + access: $all + publish: $all + proxy: npmjs + '*': + access: $all + publish: $all + unpublish: xxx + proxy: npmjs +logs: + - { type: stdout, format: pretty, level: error } diff --git a/test/unit/partials/config/yaml/api.web.spec.yaml b/test/unit/partials/config/yaml/api.web.spec.yaml new file mode 100644 index 000000000..8ee87bde1 --- /dev/null +++ b/test/unit/partials/config/yaml/api.web.spec.yaml @@ -0,0 +1,20 @@ +storage: ./storage_default_storage +uplinks: + npmjs: + url: http://localhost:4873/ +packages: + '@*/*': + access: $all + publish: $all + proxy: npmjs + unpublish: npmjs + 'forbidden-place': + access: nobody + publish: $all + '*': + access: $all + publish: $all + unpublish: xxx + proxy: npmjs +logs: + - { type: stdout, format: pretty, level: warn } diff --git a/test/unit/partials/config/yaml/default.yaml b/test/unit/partials/config/yaml/default.yaml new file mode 100644 index 000000000..e5b81f678 --- /dev/null +++ b/test/unit/partials/config/yaml/default.yaml @@ -0,0 +1,38 @@ +storage: ./storage_default_storage + +uplinks: + npmjs: + url: http://localhost:4873/ +packages: + '@*/*': + access: $all + publish: $all + proxy: npmjs + 'forbidden-place': + access: nobody + publish: $all + 'react': + access: $all + publish: $all + proxy: npmjs + 'corrupted-package': + access: $all + publish: $all + proxy: npmjs + 'jquery': + access: $all + publish: $all + proxy: npmjs + 'auth-package': + access: $authenticated + publish: $authenticated + 'vue': + access: $authenticated + publish: $authenticated + proxy: npmjs + '*': + access: $all + publish: $all + proxy: npmjs +logs: + - { type: stdout, format: pretty, level: warn } diff --git a/test/unit/partials/config/yaml/store.spec.yaml b/test/unit/partials/config/yaml/store.spec.yaml new file mode 100644 index 000000000..93e77120c --- /dev/null +++ b/test/unit/partials/config/yaml/store.spec.yaml @@ -0,0 +1,22 @@ +uplinks: + npmjs: + url: http://localhost:4873/ +packages: + '@*/*': + access: $all + publish: $all + proxy: npmjs + 'corrupted-package': + access: $all + publish: $all + proxy: npmjs + 'jquery': + access: $all + publish: $all + proxy: npmjs + '*': + access: $all + publish: $all + proxy: npmjs +logs: + - { type: stdout, format: pretty, level: warn } diff --git a/test/unit/webui/components/__snapshots__/notfound.spec.js.snap b/test/unit/webui/components/__snapshots__/notfound.spec.js.snap index 1adcfb9b7..86cafe997 100644 --- a/test/unit/webui/components/__snapshots__/notfound.spec.js.snap +++ b/test/unit/webui/components/__snapshots__/notfound.spec.js.snap @@ -1,163 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[` component should load the component in default state 1`] = ` -ShallowWrapper { - Symbol(enzyme.__root__): ShallowWrapper { - Symbol(enzyme.__root__): [Circular], - Symbol(enzyme.__unrendered__): - - , - Symbol(enzyme.__renderer__): Object { - "batchedUpdates": [Function], - "getNode": [Function], - "render": [Function], - "simulateError": [Function], - "simulateEvent": [Function], - "unmount": [Function], - }, - Symbol(enzyme.__node__): Object { - "instance": null, - "key": undefined, - "nodeType": "class", - "props": Object { - "children": , - "history": Object { - "action": "POP", - "block": [Function], - "createHref": [Function], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], - }, - }, - "ref": null, - "rendered": Object { - "instance": null, - "key": undefined, - "nodeType": "function", - "props": Object {}, - "ref": null, - "rendered": null, - "type": [Function], - }, - "type": [Function], - }, - Symbol(enzyme.__nodes__): Array [ - Object { - "instance": null, - "key": undefined, - "nodeType": "class", - "props": Object { - "children": , - "history": Object { - "action": "POP", - "block": [Function], - "createHref": [Function], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], - }, - }, - "ref": null, - "rendered": Object { - "instance": null, - "key": undefined, - "nodeType": "function", - "props": Object {}, - "ref": null, - "rendered": null, - "type": [Function], - }, - "type": [Function], - }, - ], - Symbol(enzyme.__options__): Object { - "adapter": ReactSixteenAdapter { - "options": Object { - "enableComponentDidUpdateOnSetState": true, - "lifecycles": Object { - "componentDidUpdate": Object { - "onSetState": true, - }, - "getDerivedStateFromProps": true, - "getSnapshotBeforeUpdate": true, - "setState": Object { - "skipsComponentDidUpdateOnNullish": true, - }, - }, - }, - }, - "attachTo": undefined, - "hydrateIn": undefined, - }, - }, - Symbol(enzyme.__unrendered__): null, - Symbol(enzyme.__renderer__): Object { - "batchedUpdates": [Function], - "getNode": [Function], - "render": [Function], - "simulateError": [Function], - "simulateEvent": [Function], - "unmount": [Function], - }, - Symbol(enzyme.__node__): Object { - "instance": null, - "key": undefined, - "nodeType": "function", - "props": Object {}, - "ref": null, - "rendered": null, - "type": [Function], - }, - Symbol(enzyme.__nodes__): Array [ - Object { - "instance": null, - "key": undefined, - "nodeType": "function", - "props": Object {}, - "ref": null, - "rendered": null, - "type": [Function], - }, - ], - Symbol(enzyme.__options__): Object { - "adapter": ReactSixteenAdapter { - "options": Object { - "enableComponentDidUpdateOnSetState": true, - "lifecycles": Object { - "componentDidUpdate": Object { - "onSetState": true, - }, - "getDerivedStateFromProps": true, - "getSnapshotBeforeUpdate": true, - "setState": Object { - "skipsComponentDidUpdateOnNullish": true, - }, - }, - }, - }, - "attachTo": undefined, - "hydrateIn": undefined, - }, -} -`; +exports[` component should load the component in default state 1`] = `ShallowWrapper {}`; diff --git a/yarn.lock b/yarn.lock index 35ab17b09..9cd109768 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,7 +19,7 @@ optionalDependencies: chokidar "^2.0.3" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.0.0-beta.35": +"@babel/code-frame@^7.0.0": version "7.0.0" resolved "https://registry.verdaccio.org/@babel%2fcode-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== @@ -46,6 +46,26 @@ semver "^5.4.1" source-map "^0.5.0" +"@babel/core@^7.1.0": + version "7.3.3" + resolved "https://registry.verdaccio.org/@babel%2fcore/-/core-7.3.3.tgz#d090d157b7c5060d05a05acaebc048bd2b037947" + integrity sha512-w445QGI2qd0E0GlSnq6huRZWPMmQGCp5gd5ZWS4hagn0EiwzxD5QMFkpchyusAyVC1n27OKXzQ0/88aVU9n4xQ== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.3.3" + "@babel/helpers" "^7.2.0" + "@babel/parser" "^7.3.3" + "@babel/template" "^7.2.2" + "@babel/traverse" "^7.2.2" + "@babel/types" "^7.3.3" + convert-source-map "^1.1.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.11" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + "@babel/generator@^7.0.0", "@babel/generator@^7.2.2": version "7.3.0" resolved "https://registry.verdaccio.org/@babel%2fgenerator/-/generator-7.3.0.tgz#f663838cd7b542366de3aa608a657b8ccb2a99eb" @@ -57,6 +77,17 @@ source-map "^0.5.0" trim-right "^1.0.1" +"@babel/generator@^7.3.3": + version "7.3.3" + resolved "https://registry.verdaccio.org/@babel%2fgenerator/-/generator-7.3.3.tgz#185962ade59a52e00ca2bdfcfd1d58e528d4e39e" + integrity sha512-aEADYwRRZjJyMnKN7llGIlircxTCofm3dtV5pmY6ob18MSIuipHpA2yZWkPlycwu5HJcx/pADS3zssd8eY7/6A== + dependencies: + "@babel/types" "^7.3.3" + jsesc "^2.5.1" + lodash "^4.17.11" + source-map "^0.5.0" + trim-right "^1.0.1" + "@babel/helper-annotate-as-pure@^7.0.0": version "7.0.0" resolved "https://registry.verdaccio.org/@babel%2fhelper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" @@ -265,6 +296,11 @@ resolved "https://registry.verdaccio.org/@babel%2fparser/-/parser-7.3.1.tgz#8f4ffd45f779e6132780835ffa7a215fa0b2d181" integrity sha512-ATz6yX/L8LEnC3dtLQnIx4ydcPxhLcoy9Vl6re00zb2w5lG6itY6Vhnr1KFRPq/FHNsgl/gh2mjNN20f9iJTTA== +"@babel/parser@^7.3.3": + version "7.3.3" + resolved "https://registry.verdaccio.org/@babel%2fparser/-/parser-7.3.3.tgz#092d450db02bdb6ccb1ca8ffd47d8774a91aef87" + integrity sha512-xsH1CJoln2r74hR+y7cg2B5JCPaTh+Hd+EbBRk9nWGSNspuo6krjhX0Om6RnRQuIvFq8wVXCLKH3kwKDYhanSg== + "@babel/plugin-proposal-async-generator-functions@^7.2.0": version "7.2.0" resolved "https://registry.verdaccio.org/@babel%2fplugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" @@ -427,7 +463,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-object-rest-spread@^7.2.0": +"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.2.0": version "7.2.0" resolved "https://registry.verdaccio.org/@babel%2fplugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== @@ -839,7 +875,7 @@ dependencies: regenerator-runtime "^0.12.0" -"@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": +"@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": version "7.2.2" resolved "https://registry.verdaccio.org/@babel%2ftemplate/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" integrity sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g== @@ -872,6 +908,15 @@ lodash "^4.17.10" to-fast-properties "^2.0.0" +"@babel/types@^7.3.3": + version "7.3.3" + resolved "https://registry.verdaccio.org/@babel%2ftypes/-/types-7.3.3.tgz#6c44d1cdac2a7625b624216657d5bc6c107ab436" + integrity sha512-2tACZ80Wg09UnPg5uGAOUvvInaqLk3l/IAhQzlxLQOIXacr6bMsra5SH6AWw/hIDRCSbCdHP2KzSOD+cT7TzMQ== + dependencies: + esutils "^2.0.2" + lodash "^4.17.11" + to-fast-properties "^2.0.0" + "@commitlint/cli@7.2.1": version "7.2.1" resolved "https://registry.verdaccio.org/@commitlint%2fcli/-/cli-7.2.1.tgz#dbb9eeb1f5015a129bb0801fbc1115eb1dcd513b" @@ -1585,12 +1630,12 @@ apache-md5@1.1.2: resolved "https://registry.verdaccio.org/apache-md5/-/apache-md5-1.1.2.tgz#ee49736b639b4f108b6e9e626c6da99306b41692" integrity sha1-7klza2ObTxCLbp5ibG2pkwa0FpI= -append-transform@^0.4.0: - version "0.4.0" - resolved "https://registry.verdaccio.org/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" - integrity sha1-126/jKlNJ24keja61EpLdKthGZE= +append-transform@^1.0.0: + version "1.0.0" + resolved "https://registry.verdaccio.org/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" + integrity sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw== dependencies: - default-require-extensions "^1.0.0" + default-require-extensions "^2.0.0" aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" @@ -1794,13 +1839,20 @@ async@^1.5.2: resolved "https://registry.verdaccio.org/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= -async@^2.1.4, async@^2.5.0: +async@^2.5.0: version "2.6.1" resolved "https://registry.verdaccio.org/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== dependencies: lodash "^4.17.10" +async@^2.6.1: + version "2.6.2" + resolved "https://registry.verdaccio.org/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" + integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== + dependencies: + lodash "^4.17.11" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.verdaccio.org/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1888,7 +1940,7 @@ babel-core@7.0.0-bridge.0: resolved "https://registry.verdaccio.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" integrity sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg== -babel-core@^6.0.0, babel-core@^6.26.0, babel-core@^6.26.3: +babel-core@^6.26.0, babel-core@^6.26.3: version "6.26.3" resolved "https://registry.verdaccio.org/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== @@ -1947,7 +1999,7 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-jest@23.6.0, babel-jest@^23.6.0: +babel-jest@23.6.0: version "23.6.0" resolved "https://registry.verdaccio.org/babel-jest/-/babel-jest-23.6.0.tgz#a644232366557a2240a0c083da6b25786185a2f1" integrity sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew== @@ -1955,6 +2007,16 @@ babel-jest@23.6.0, babel-jest@^23.6.0: babel-plugin-istanbul "^4.1.6" babel-preset-jest "^23.2.0" +babel-jest@^24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/babel-jest/-/babel-jest-24.1.0.tgz#441e23ef75ded3bd547e300ac3194cef87b55190" + integrity sha512-MLcagnVrO9ybQGLEfZUqnOzv36iQzU7Bj4elm39vCukumLVSfoX+tRy3/jW7lUKc7XdpRmB/jech6L/UCsSZjw== + dependencies: + babel-plugin-istanbul "^5.1.0" + babel-preset-jest "^24.1.0" + chalk "^2.4.2" + slash "^2.0.0" + babel-loader@8.0.5: version "8.0.5" resolved "https://registry.verdaccio.org/babel-loader/-/babel-loader-8.0.5.tgz#225322d7509c2157655840bba52e46b6c2f2fe33" @@ -2038,11 +2100,25 @@ babel-plugin-istanbul@^4.1.6: istanbul-lib-instrument "^1.10.1" test-exclude "^4.2.1" +babel-plugin-istanbul@^5.1.0: + version "5.1.1" + resolved "https://registry.verdaccio.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.1.tgz#7981590f1956d75d67630ba46f0c22493588c893" + integrity sha512-RNNVv2lsHAXJQsEJ5jonQwrJVWK8AcZpG1oxhnjCUaAjL7xahYLANhPUZbzEQHjKy1NMYUwn+0NPKQc8iSY4xQ== + dependencies: + find-up "^3.0.0" + istanbul-lib-instrument "^3.0.0" + test-exclude "^5.0.0" + babel-plugin-jest-hoist@^23.2.0: version "23.2.0" resolved "https://registry.verdaccio.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" integrity sha1-5h+uBaHKiAGq3uV6bWa4zvr0QWc= +babel-plugin-jest-hoist@^24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.1.0.tgz#dfecc491fb15e2668abbd690a697a8fd1411a7f8" + integrity sha512-gljYrZz8w1b6fJzKcsfKsipSru2DU2DmQ39aB6nV3xQ0DDv3zpIzKGortA5gknrhNnPN8DweaEgrnZdmbGmhnw== + babel-plugin-macros@^2.0.0: version "2.4.5" resolved "https://registry.verdaccio.org/babel-plugin-macros/-/babel-plugin-macros-2.4.5.tgz#7000a9b1f72d19ceee19a5804f1d23d6daf38c13" @@ -2078,6 +2154,14 @@ babel-preset-jest@^23.2.0: babel-plugin-jest-hoist "^23.2.0" babel-plugin-syntax-object-rest-spread "^6.13.0" +babel-preset-jest@^24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/babel-preset-jest/-/babel-preset-jest-24.1.0.tgz#83bc564fdcd4903641af65ec63f2f5de6b04132e" + integrity sha512-FfNLDxFWsNX9lUmtwY7NheGlANnagvxq8LZdl5PKnVG3umP+S/g0XbVBfwtA4Ai3Ri/IMkWabBz3Tyk9wdspcw== + dependencies: + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + babel-plugin-jest-hoist "^24.1.0" + babel-register@^6.26.0: version "6.26.0" resolved "https://registry.verdaccio.org/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" @@ -2110,7 +2194,7 @@ babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: babylon "^6.18.0" lodash "^4.17.4" -babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: +babel-traverse@^6.18.0, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.verdaccio.org/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= @@ -2125,7 +2209,7 @@ babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: invariant "^2.2.2" lodash "^4.17.4" -babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.26.0: +babel-types@^6.18.0, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.verdaccio.org/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= @@ -2811,6 +2895,11 @@ ci-info@^1.5.0: resolved "https://registry.verdaccio.org/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.verdaccio.org/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.verdaccio.org/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -3082,6 +3171,11 @@ compare-func@^1.3.1: array-ify "^1.0.0" dot-prop "^3.0.0" +compare-versions@^3.2.1: + version "3.4.0" + resolved "https://registry.verdaccio.org/compare-versions/-/compare-versions-3.4.0.tgz#e0747df5c9cb7f054d6d3dc3e1dbc444f9e92b26" + integrity sha512-tK69D7oNXXqUW3ZNo/z7NXTEz22TCF0pTE+YF9cxvaAM9XnkLo1fV621xCLrRR6aevJlKxExkss0vWqUCUpqdg== + component-emitter@^1.2.0, component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.verdaccio.org/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" @@ -3882,7 +3976,7 @@ debug@^3.1.0, debug@^3.2.5: dependencies: ms "^2.1.1" -debug@^4.0.0, debug@^4.0.1, debug@^4.1.0: +debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.verdaccio.org/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -3954,12 +4048,12 @@ default-gateway@^2.6.0: execa "^0.10.0" ip-regex "^2.1.0" -default-require-extensions@^1.0.0: - version "1.0.0" - resolved "https://registry.verdaccio.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" - integrity sha1-836hXT4T/9m0N9M+GnW1+5eHTLg= +default-require-extensions@^2.0.0: + version "2.0.0" + resolved "https://registry.verdaccio.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" + integrity sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc= dependencies: - strip-bom "^2.0.0" + strip-bom "^3.0.0" define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" @@ -4067,10 +4161,10 @@ diacritic@0.0.2: resolved "https://registry.verdaccio.org/diacritic/-/diacritic-0.0.2.tgz#fc2a887b5a5bc0a0a854fb614c7c2f209061ee04" integrity sha1-/CqIe1pbwKCoVPthTHwvIJBh7gQ= -diff@^3.2.0: - version "3.5.0" - resolved "https://registry.verdaccio.org/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== +diff-sequences@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/diff-sequences/-/diff-sequences-24.0.0.tgz#cdf8e27ed20d8b8d3caccb4e0c0d8fe31a173013" + integrity sha512-46OkIuVGBBnrC0soO/4LHu5LHGHx0uhP65OVz8XOrAJpqiCB2aVIuESvjI1F9oqebuvY8lekS1pt6TN7vt7qsw== diffie-hellman@^5.0.0: version "5.0.3" @@ -4884,17 +4978,16 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" -expect@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/expect/-/expect-23.6.0.tgz#1e0c8d3ba9a581c87bd71fb9bc8862d443425f98" - integrity sha512-dgSoOHgmtn/aDGRVFWclQyPDKl2CQRq0hmIEoUAuQs/2rn2NcvCWcSCovm6BLeuB/7EZuLGu2QfnR+qRt5OM4w== +expect@^24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/expect/-/expect-24.1.0.tgz#88e73301c4c785cde5f16da130ab407bdaf8c0f2" + integrity sha512-lVcAPhaYkQcIyMS+F8RVwzbm1jro20IG8OkvxQ6f1JfqhVZyyudCwYogQ7wnktlf14iF3ii7ArIUO/mqvrW9Gw== dependencies: ansi-styles "^3.2.0" - jest-diff "^23.6.0" - jest-get-type "^22.1.0" - jest-matcher-utils "^23.6.0" - jest-message-util "^23.4.0" - jest-regex-util "^23.3.0" + jest-get-type "^24.0.0" + jest-matcher-utils "^24.0.0" + jest-message-util "^24.0.0" + jest-regex-util "^24.0.0" express@4.16.4, express@^4.16.2, express@^4.16.3: version "4.16.4" @@ -5121,7 +5214,7 @@ filename-regex@^2.0.0: resolved "https://registry.verdaccio.org/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= -fileset@^2.0.2: +fileset@^2.0.3: version "2.0.3" resolved "https://registry.verdaccio.org/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" integrity sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA= @@ -5710,7 +5803,7 @@ gonzales-pe@^4.2.3: dependencies: minimist "1.1.x" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3: version "4.1.15" resolved "https://registry.verdaccio.org/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== @@ -5752,7 +5845,7 @@ handlebars@4.0.13: optionalDependencies: uglify-js "^3.1.4" -handlebars@^4.0.2, handlebars@^4.0.3: +handlebars@^4.0.2: version "4.0.12" resolved "https://registry.verdaccio.org/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5" integrity sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA== @@ -5763,6 +5856,17 @@ handlebars@^4.0.2, handlebars@^4.0.3: optionalDependencies: uglify-js "^3.1.4" +handlebars@^4.1.0: + version "4.1.0" + resolved "https://registry.verdaccio.org/handlebars/-/handlebars-4.1.0.tgz#0d6a6f34ff1f63cecec8423aa4169827bf787c3a" + integrity sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w== + dependencies: + async "^2.5.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.verdaccio.org/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -6224,14 +6328,6 @@ import-lazy@^3.1.0: resolved "https://registry.verdaccio.org/import-lazy/-/import-lazy-3.1.0.tgz#891279202c8a2280fdbd6674dbd8da1a1dfc67cc" integrity sha512-8/gvXvX2JMn0F+CDlSC4l6kOmVaLOO3XLkksI7CI3Ud95KDYJuYur2b9P/PUt/i/pDAMd/DulQsNbbbmRRsDIQ== -import-local@^1.0.0: - version "1.0.0" - resolved "https://registry.verdaccio.org/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" - integrity sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ== - dependencies: - pkg-dir "^2.0.0" - resolve-cwd "^2.0.0" - import-local@^2.0.0: version "2.0.0" resolved "https://registry.verdaccio.org/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" @@ -6452,13 +6548,20 @@ is-callable@^1.1.3, is-callable@^1.1.4: resolved "https://registry.verdaccio.org/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== -is-ci@^1.0.10, is-ci@^1.1.0: +is-ci@^1.1.0: version "1.2.1" resolved "https://registry.verdaccio.org/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== dependencies: ci-info "^1.5.0" +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.verdaccio.org/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + is-color-stop@^1.0.0: version "1.1.0" resolved "https://registry.verdaccio.org/is-color-stop/-/is-color-stop-1.1.0.tgz#cfff471aee4dd5c9e158598fbe12967b5cdad345" @@ -6571,10 +6674,10 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.verdaccio.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= -is-generator-fn@^1.0.0: - version "1.0.0" - resolved "https://registry.verdaccio.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" - integrity sha1-lp1J4bszKfa7fwkIm+JleLLd1Go= +is-generator-fn@^2.0.0: + version "2.0.0" + resolved "https://registry.verdaccio.org/is-generator-fn/-/is-generator-fn-2.0.0.tgz#038c31b774709641bda678b1f06a4e3227c10b3e" + integrity sha512-elzyIdM7iKoFHzcrndIqjYomImhxrFRnGP3galODoII4TB9gI7mZ+FnlLQmmjf27SxHS2gKEeyhX5/+YRS6H9g== is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" @@ -6824,36 +6927,43 @@ isstream@~0.1.2: resolved "https://registry.verdaccio.org/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-api@^1.3.1: - version "1.3.7" - resolved "https://registry.verdaccio.org/istanbul-api/-/istanbul-api-1.3.7.tgz#a86c770d2b03e11e3f778cd7aedd82d2722092aa" - integrity sha512-4/ApBnMVeEPG3EkSzcw25wDe4N66wxwn+KKn6b47vyek8Xb3NBAcg4xfuQbS7BqcZuTX4wxfD5lVagdggR3gyA== +istanbul-api@^2.0.8: + version "2.1.1" + resolved "https://registry.verdaccio.org/istanbul-api/-/istanbul-api-2.1.1.tgz#194b773f6d9cbc99a9258446848b0f988951c4d0" + integrity sha512-kVmYrehiwyeBAk/wE71tW6emzLiHGjYIiDrc8sfyty4F8M02/lrgXSm+R1kXysmF20zArvmZXjlE/mg24TVPJw== dependencies: - async "^2.1.4" - fileset "^2.0.2" - istanbul-lib-coverage "^1.2.1" - istanbul-lib-hook "^1.2.2" - istanbul-lib-instrument "^1.10.2" - istanbul-lib-report "^1.1.5" - istanbul-lib-source-maps "^1.2.6" - istanbul-reports "^1.5.1" - js-yaml "^3.7.0" - mkdirp "^0.5.1" + async "^2.6.1" + compare-versions "^3.2.1" + fileset "^2.0.3" + istanbul-lib-coverage "^2.0.3" + istanbul-lib-hook "^2.0.3" + istanbul-lib-instrument "^3.1.0" + istanbul-lib-report "^2.0.4" + istanbul-lib-source-maps "^3.0.2" + istanbul-reports "^2.1.1" + js-yaml "^3.12.0" + make-dir "^1.3.0" + minimatch "^3.0.4" once "^1.4.0" -istanbul-lib-coverage@^1.2.0, istanbul-lib-coverage@^1.2.1: +istanbul-lib-coverage@^1.2.1: version "1.2.1" resolved "https://registry.verdaccio.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== -istanbul-lib-hook@^1.2.2: - version "1.2.2" - resolved "https://registry.verdaccio.org/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz#bc6bf07f12a641fbf1c85391d0daa8f0aea6bf86" - integrity sha512-/Jmq7Y1VeHnZEQ3TL10VHyb564mn6VrQXHchON9Jf/AEcmQ3ZIiyD1BVzNOKTZf/G3gE+kiGK6SmpF9y3qGPLw== - dependencies: - append-transform "^0.4.0" +istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.3: + version "2.0.3" + resolved "https://registry.verdaccio.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#0b891e5ad42312c2b9488554f603795f9a2211ba" + integrity sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw== -istanbul-lib-instrument@^1.10.1, istanbul-lib-instrument@^1.10.2: +istanbul-lib-hook@^2.0.3: + version "2.0.3" + resolved "https://registry.verdaccio.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.3.tgz#e0e581e461c611be5d0e5ef31c5f0109759916fb" + integrity sha512-CLmEqwEhuCYtGcpNVJjLV1DQyVnIqavMLFHV/DP+np/g3qvdxu3gsPqYoJMXm15sN84xOlckFB3VNvRbf5yEgA== + dependencies: + append-transform "^1.0.0" + +istanbul-lib-instrument@^1.10.1: version "1.10.2" resolved "https://registry.verdaccio.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz#1f55ed10ac3c47f2bdddd5307935126754d0a9ca" integrity sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A== @@ -6866,323 +6976,349 @@ istanbul-lib-instrument@^1.10.1, istanbul-lib-instrument@^1.10.2: istanbul-lib-coverage "^1.2.1" semver "^5.3.0" -istanbul-lib-report@^1.1.5: - version "1.1.5" - resolved "https://registry.verdaccio.org/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz#f2a657fc6282f96170aaf281eb30a458f7f4170c" - integrity sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw== +istanbul-lib-instrument@^3.0.0, istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.1.0: + version "3.1.0" + resolved "https://registry.verdaccio.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz#a2b5484a7d445f1f311e93190813fa56dfb62971" + integrity sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA== dependencies: - istanbul-lib-coverage "^1.2.1" - mkdirp "^0.5.1" - path-parse "^1.0.5" - supports-color "^3.1.2" + "@babel/generator" "^7.0.0" + "@babel/parser" "^7.0.0" + "@babel/template" "^7.0.0" + "@babel/traverse" "^7.0.0" + "@babel/types" "^7.0.0" + istanbul-lib-coverage "^2.0.3" + semver "^5.5.0" -istanbul-lib-source-maps@^1.2.4, istanbul-lib-source-maps@^1.2.6: - version "1.2.6" - resolved "https://registry.verdaccio.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.6.tgz#37b9ff661580f8fca11232752ee42e08c6675d8f" - integrity sha512-TtbsY5GIHgbMsMiRw35YBHGpZ1DVFEO19vxxeiDMYaeOFOCzfnYVxvl6pOUIZR4dtPhAGpSMup8OyF8ubsaqEg== +istanbul-lib-report@^2.0.4: + version "2.0.4" + resolved "https://registry.verdaccio.org/istanbul-lib-report/-/istanbul-lib-report-2.0.4.tgz#bfd324ee0c04f59119cb4f07dab157d09f24d7e4" + integrity sha512-sOiLZLAWpA0+3b5w5/dq0cjm2rrNdAfHWaGhmn7XEFW6X++IV9Ohn+pnELAl9K3rfpaeBfbmH9JU5sejacdLeA== dependencies: - debug "^3.1.0" - istanbul-lib-coverage "^1.2.1" - mkdirp "^0.5.1" - rimraf "^2.6.1" - source-map "^0.5.3" + istanbul-lib-coverage "^2.0.3" + make-dir "^1.3.0" + supports-color "^6.0.0" -istanbul-reports@^1.5.1: - version "1.5.1" - resolved "https://registry.verdaccio.org/istanbul-reports/-/istanbul-reports-1.5.1.tgz#97e4dbf3b515e8c484caea15d6524eebd3ff4e1a" - integrity sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw== +istanbul-lib-source-maps@^3.0.1, istanbul-lib-source-maps@^3.0.2: + version "3.0.2" + resolved "https://registry.verdaccio.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz#f1e817229a9146e8424a28e5d69ba220fda34156" + integrity sha512-JX4v0CiKTGp9fZPmoxpu9YEkPbEqCqBbO3403VabKjH+NRXo72HafD5UgnjTEqHL2SAjaZK1XDuDOkn6I5QVfQ== dependencies: - handlebars "^4.0.3" + debug "^4.1.1" + istanbul-lib-coverage "^2.0.3" + make-dir "^1.3.0" + rimraf "^2.6.2" + source-map "^0.6.1" -jest-changed-files@^23.4.2: - version "23.4.2" - resolved "https://registry.verdaccio.org/jest-changed-files/-/jest-changed-files-23.4.2.tgz#1eed688370cd5eebafe4ae93d34bb3b64968fe83" - integrity sha512-EyNhTAUWEfwnK0Is/09LxoqNDOn7mU7S3EHskG52djOFS/z+IT0jT3h3Ql61+dklcG7bJJitIWEMB4Sp1piHmA== +istanbul-reports@^2.1.1: + version "2.1.1" + resolved "https://registry.verdaccio.org/istanbul-reports/-/istanbul-reports-2.1.1.tgz#72ef16b4ecb9a4a7bd0e2001e00f95d1eec8afa9" + integrity sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw== dependencies: + handlebars "^4.1.0" + +jest-changed-files@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-changed-files/-/jest-changed-files-24.0.0.tgz#c02c09a8cc9ca93f513166bc773741bd39898ff7" + integrity sha512-nnuU510R9U+UX0WNb5XFEcsrMqriSiRLeO9KWDFgPrpToaQm60prfQYpxsXigdClpvNot5bekDY440x9dNGnsQ== + dependencies: + execa "^1.0.0" throat "^4.0.0" -jest-cli@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-cli/-/jest-cli-23.6.0.tgz#61ab917744338f443ef2baa282ddffdd658a5da4" - integrity sha512-hgeD1zRUp1E1zsiyOXjEn4LzRLWdJBV//ukAHGlx6s5mfCNJTbhbHjgxnDUXA8fsKWN/HqFFF6X5XcCwC/IvYQ== +jest-cli@^24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/jest-cli/-/jest-cli-24.1.0.tgz#f7cc98995f36e7210cce3cbb12974cbf60940843" + integrity sha512-U/iyWPwOI0T1CIxVLtk/2uviOTJ/OiSWJSe8qt6X1VkbbgP+nrtLJlmT9lPBe4lK78VNFJtrJ7pttcNv/s7yCw== dependencies: ansi-escapes "^3.0.0" chalk "^2.0.1" exit "^0.1.2" glob "^7.1.2" - graceful-fs "^4.1.11" - import-local "^1.0.0" - is-ci "^1.0.10" - istanbul-api "^1.3.1" - istanbul-lib-coverage "^1.2.0" - istanbul-lib-instrument "^1.10.1" - istanbul-lib-source-maps "^1.2.4" - jest-changed-files "^23.4.2" - jest-config "^23.6.0" - jest-environment-jsdom "^23.4.0" - jest-get-type "^22.1.0" - jest-haste-map "^23.6.0" - jest-message-util "^23.4.0" - jest-regex-util "^23.3.0" - jest-resolve-dependencies "^23.6.0" - jest-runner "^23.6.0" - jest-runtime "^23.6.0" - jest-snapshot "^23.6.0" - jest-util "^23.4.0" - jest-validate "^23.6.0" - jest-watcher "^23.4.0" - jest-worker "^23.2.0" - micromatch "^2.3.11" + graceful-fs "^4.1.15" + import-local "^2.0.0" + is-ci "^2.0.0" + istanbul-api "^2.0.8" + istanbul-lib-coverage "^2.0.2" + istanbul-lib-instrument "^3.0.1" + istanbul-lib-source-maps "^3.0.1" + jest-changed-files "^24.0.0" + jest-config "^24.1.0" + jest-environment-jsdom "^24.0.0" + jest-get-type "^24.0.0" + jest-haste-map "^24.0.0" + jest-message-util "^24.0.0" + jest-regex-util "^24.0.0" + jest-resolve-dependencies "^24.1.0" + jest-runner "^24.1.0" + jest-runtime "^24.1.0" + jest-snapshot "^24.1.0" + jest-util "^24.0.0" + jest-validate "^24.0.0" + jest-watcher "^24.0.0" + jest-worker "^24.0.0" + micromatch "^3.1.10" node-notifier "^5.2.1" - prompts "^0.1.9" + p-each-series "^1.0.0" + pirates "^4.0.0" + prompts "^2.0.1" realpath-native "^1.0.0" rimraf "^2.5.4" - slash "^1.0.0" + slash "^2.0.0" string-length "^2.0.0" - strip-ansi "^4.0.0" + strip-ansi "^5.0.0" which "^1.2.12" - yargs "^11.0.0" + yargs "^12.0.2" -jest-config@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-config/-/jest-config-23.6.0.tgz#f82546a90ade2d8c7026fbf6ac5207fc22f8eb1d" - integrity sha512-i8V7z9BeDXab1+VNo78WM0AtWpBRXJLnkT+lyT+Slx/cbP5sZJ0+NDuLcmBE5hXAoK0aUp7vI+MOxR+R4d8SRQ== +jest-config@^24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/jest-config/-/jest-config-24.1.0.tgz#6ea6881cfdd299bc86cc144ee36d937c97c3850c" + integrity sha512-FbbRzRqtFC6eGjG5VwsbW4E5dW3zqJKLWYiZWhB0/4E5fgsMw8GODLbGSrY5t17kKOtCWb/Z7nsIThRoDpuVyg== dependencies: - babel-core "^6.0.0" - babel-jest "^23.6.0" + "@babel/core" "^7.1.0" + babel-jest "^24.1.0" chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^23.4.0" - jest-environment-node "^23.4.0" - jest-get-type "^22.1.0" - jest-jasmine2 "^23.6.0" - jest-regex-util "^23.3.0" - jest-resolve "^23.6.0" - jest-util "^23.4.0" - jest-validate "^23.6.0" - micromatch "^2.3.11" - pretty-format "^23.6.0" + jest-environment-jsdom "^24.0.0" + jest-environment-node "^24.0.0" + jest-get-type "^24.0.0" + jest-jasmine2 "^24.1.0" + jest-regex-util "^24.0.0" + jest-resolve "^24.1.0" + jest-util "^24.0.0" + jest-validate "^24.0.0" + micromatch "^3.1.10" + pretty-format "^24.0.0" + realpath-native "^1.0.2" -jest-diff@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-diff/-/jest-diff-23.6.0.tgz#1500f3f16e850bb3d71233408089be099f610c7d" - integrity sha512-Gz9l5Ov+X3aL5L37IT+8hoCUsof1CVYBb2QEkOupK64XyRR3h+uRpYIm97K7sY8diFxowR8pIGEdyfMKTixo3g== +jest-diff@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-diff/-/jest-diff-24.0.0.tgz#a3e5f573dbac482f7d9513ac9cfa21644d3d6b34" + integrity sha512-XY5wMpRaTsuMoU+1/B2zQSKQ9RdE9gsLkGydx3nvApeyPijLA8GtEvIcPwISRCer+VDf9W1mStTYYq6fPt8ryA== dependencies: chalk "^2.0.1" - diff "^3.2.0" - jest-get-type "^22.1.0" - pretty-format "^23.6.0" + diff-sequences "^24.0.0" + jest-get-type "^24.0.0" + pretty-format "^24.0.0" -jest-docblock@^23.2.0: - version "23.2.0" - resolved "https://registry.verdaccio.org/jest-docblock/-/jest-docblock-23.2.0.tgz#f085e1f18548d99fdd69b20207e6fd55d91383a7" - integrity sha1-8IXh8YVI2Z/dabICB+b9VdkTg6c= +jest-docblock@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-docblock/-/jest-docblock-24.0.0.tgz#54d77a188743e37f62181a91a01eb9222289f94e" + integrity sha512-KfAKZ4SN7CFOZpWg4i7g7MSlY0M+mq7K0aMqENaG2vHuhC9fc3vkpU/iNN9sOus7v3h3Y48uEjqz3+Gdn2iptA== dependencies: detect-newline "^2.1.0" -jest-each@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-each/-/jest-each-23.6.0.tgz#ba0c3a82a8054387016139c733a05242d3d71575" - integrity sha512-x7V6M/WGJo6/kLoissORuvLIeAoyo2YqLOoCDkohgJ4XOXSqOtyvr8FbInlAWS77ojBsZrafbozWoKVRdtxFCg== +jest-each@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-each/-/jest-each-24.0.0.tgz#10987a06b21c7ffbfb7706c89d24c52ed864be55" + integrity sha512-gFcbY4Cu55yxExXMkjrnLXov3bWO3dbPAW7HXb31h/DNWdNc/6X8MtxGff8nh3/MjkF9DpVqnj0KsPKuPK0cpA== dependencies: chalk "^2.0.1" - pretty-format "^23.6.0" + jest-get-type "^24.0.0" + jest-util "^24.0.0" + pretty-format "^24.0.0" -jest-environment-jsdom-global@1.1.0: - version "1.1.0" - resolved "https://registry.verdaccio.org/jest-environment-jsdom-global/-/jest-environment-jsdom-global-1.1.0.tgz#dea8a3991aa9a6e638dce8933957fdbc42c97bf6" - integrity sha512-K6nm2Lm0ZFTCSQR7P9B5f6pD6Jid/VvhWrSiymODEfjA5Jd9PkX/3hfSaEHZ8NLzu6Uy7HimlZjjwrK7+YQHQA== +jest-environment-jsdom-global@1.1.1: + version "1.1.1" + resolved "https://registry.verdaccio.org/jest-environment-jsdom-global/-/jest-environment-jsdom-global-1.1.1.tgz#c0b5fd969ace23137fd9c4a3b8e3367a54b4ed15" + integrity sha512-7+M6yMM6vpHfaR9ymrjobx1kG3TQyMpSu9yH7bz9bVHsBMUEdiBOmf6qVvyi8z09delLmHuPQpUFYm5SIGSzhQ== -jest-environment-jsdom@23.4.0, jest-environment-jsdom@^23.4.0: - version "23.4.0" - resolved "https://registry.verdaccio.org/jest-environment-jsdom/-/jest-environment-jsdom-23.4.0.tgz#056a7952b3fea513ac62a140a2c368c79d9e6023" - integrity sha1-BWp5UrP+pROsYqFAosNox52eYCM= +jest-environment-jsdom@24.0.0, jest-environment-jsdom@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-environment-jsdom/-/jest-environment-jsdom-24.0.0.tgz#5affa0654d6e44cd798003daa1a8701dbd6e4d11" + integrity sha512-1YNp7xtxajTRaxbylDc2pWvFnfDTH5BJJGyVzyGAKNt/lEULohwEV9zFqTgG4bXRcq7xzdd+sGFws+LxThXXOw== dependencies: - jest-mock "^23.2.0" - jest-util "^23.4.0" + jest-mock "^24.0.0" + jest-util "^24.0.0" jsdom "^11.5.1" -jest-environment-node@23.4.0, jest-environment-node@^23.4.0: - version "23.4.0" - resolved "https://registry.verdaccio.org/jest-environment-node/-/jest-environment-node-23.4.0.tgz#57e80ed0841dea303167cce8cd79521debafde10" - integrity sha1-V+gO0IQd6jAxZ8zozXlSHeuv3hA= +jest-environment-node@24.0.0, jest-environment-node@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-environment-node/-/jest-environment-node-24.0.0.tgz#330948980656ed8773ce2e04eb597ed91e3c7190" + integrity sha512-62fOFcaEdU0VLaq8JL90TqwI7hLn0cOKOl8vY2n477vRkCJRojiRRtJVRzzCcgFvs6gqU97DNqX5R0BrBP6Rxg== dependencies: - jest-mock "^23.2.0" - jest-util "^23.4.0" + jest-mock "^24.0.0" + jest-util "^24.0.0" jest-get-type@^22.1.0: version "22.4.3" resolved "https://registry.verdaccio.org/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" integrity sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w== -jest-haste-map@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-haste-map/-/jest-haste-map-23.6.0.tgz#2e3eb997814ca696d62afdb3f2529f5bbc935e16" - integrity sha512-uyNhMyl6dr6HaXGHp8VF7cK6KpC6G9z9LiMNsst+rJIZ8l7wY0tk8qwjPmEghczojZ2/ZhtEdIabZ0OQRJSGGg== +jest-get-type@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-get-type/-/jest-get-type-24.0.0.tgz#36e72930b78e33da59a4f63d44d332188278940b" + integrity sha512-z6/Eyf6s9ZDGz7eOvl+fzpuJmN9i0KyTt1no37/dHu8galssxz5ZEgnc1KaV8R31q1khxyhB4ui/X5ZjjPk77w== + +jest-haste-map@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-haste-map/-/jest-haste-map-24.0.0.tgz#e9ef51b2c9257384b4d6beb83bd48c65b37b5e6e" + integrity sha512-CcViJyUo41IQqttLxXVdI41YErkzBKbE6cS6dRAploCeutePYfUimWd3C9rQEWhX0YBOQzvNsC0O9nYxK2nnxQ== dependencies: fb-watchman "^2.0.0" - graceful-fs "^4.1.11" + graceful-fs "^4.1.15" invariant "^2.2.4" - jest-docblock "^23.2.0" - jest-serializer "^23.0.1" - jest-worker "^23.2.0" - micromatch "^2.3.11" - sane "^2.0.0" + jest-serializer "^24.0.0" + jest-util "^24.0.0" + jest-worker "^24.0.0" + micromatch "^3.1.10" + sane "^3.0.0" -jest-jasmine2@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-jasmine2/-/jest-jasmine2-23.6.0.tgz#840e937f848a6c8638df24360ab869cc718592e0" - integrity sha512-pe2Ytgs1nyCs8IvsEJRiRTPC0eVYd8L/dXJGU08GFuBwZ4sYH/lmFDdOL3ZmvJR8QKqV9MFuwlsAi/EWkFUbsQ== +jest-jasmine2@^24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/jest-jasmine2/-/jest-jasmine2-24.1.0.tgz#8377324b967037c440f0a549ee0bbd9912055db6" + integrity sha512-H+o76SdSNyCh9fM5K8upK45YTo/DiFx5w2YAzblQebSQmukDcoVBVeXynyr7DDnxh+0NTHYRCLwJVf3tC518wg== dependencies: - babel-traverse "^6.0.0" + "@babel/traverse" "^7.1.0" chalk "^2.0.1" co "^4.6.0" - expect "^23.6.0" - is-generator-fn "^1.0.0" - jest-diff "^23.6.0" - jest-each "^23.6.0" - jest-matcher-utils "^23.6.0" - jest-message-util "^23.4.0" - jest-snapshot "^23.6.0" - jest-util "^23.4.0" - pretty-format "^23.6.0" + expect "^24.1.0" + is-generator-fn "^2.0.0" + jest-each "^24.0.0" + jest-matcher-utils "^24.0.0" + jest-message-util "^24.0.0" + jest-snapshot "^24.1.0" + jest-util "^24.0.0" + pretty-format "^24.0.0" + throat "^4.0.0" -jest-leak-detector@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-leak-detector/-/jest-leak-detector-23.6.0.tgz#e4230fd42cf381a1a1971237ad56897de7e171de" - integrity sha512-f/8zA04rsl1Nzj10HIyEsXvYlMpMPcy0QkQilVZDFOaPbv2ur71X5u2+C4ZQJGyV/xvVXtCCZ3wQ99IgQxftCg== +jest-leak-detector@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-leak-detector/-/jest-leak-detector-24.0.0.tgz#78280119fd05ee98317daee62cddb3aa537a31c6" + integrity sha512-ZYHJYFeibxfsDSKowjDP332pStuiFT2xfc5R67Rjm/l+HFJWJgNIOCOlQGeXLCtyUn3A23+VVDdiCcnB6dTTrg== dependencies: - pretty-format "^23.6.0" + pretty-format "^24.0.0" -jest-matcher-utils@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-matcher-utils/-/jest-matcher-utils-23.6.0.tgz#726bcea0c5294261a7417afb6da3186b4b8cac80" - integrity sha512-rosyCHQfBcol4NsckTn01cdelzWLU9Cq7aaigDf8VwwpIRvWE/9zLgX2bON+FkEW69/0UuYslUe22SOdEf2nog== +jest-matcher-utils@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-matcher-utils/-/jest-matcher-utils-24.0.0.tgz#fc9c41cfc49b2c3ec14e576f53d519c37729d579" + integrity sha512-LQTDmO+aWRz1Tf9HJg+HlPHhDh1E1c65kVwRFo5mwCVp5aQDzlkz4+vCvXhOKFjitV2f0kMdHxnODrXVoi+rlA== dependencies: chalk "^2.0.1" - jest-get-type "^22.1.0" - pretty-format "^23.6.0" + jest-diff "^24.0.0" + jest-get-type "^24.0.0" + pretty-format "^24.0.0" -jest-message-util@^23.4.0: - version "23.4.0" - resolved "https://registry.verdaccio.org/jest-message-util/-/jest-message-util-23.4.0.tgz#17610c50942349508d01a3d1e0bda2c079086a9f" - integrity sha1-F2EMUJQjSVCNAaPR4L2iwHkIap8= +jest-message-util@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-message-util/-/jest-message-util-24.0.0.tgz#a07a141433b2c992dbaec68d4cbfe470ba289619" + integrity sha512-J9ROJIwz/IeC+eV1XSwnRK4oAwPuhmxEyYx1+K5UI+pIYwFZDSrfZaiWTdq0d2xYFw4Xiu+0KQWsdsQpgJMf3Q== dependencies: - "@babel/code-frame" "^7.0.0-beta.35" + "@babel/code-frame" "^7.0.0" chalk "^2.0.1" - micromatch "^2.3.11" - slash "^1.0.0" + micromatch "^3.1.10" + slash "^2.0.0" stack-utils "^1.0.1" -jest-mock@^23.2.0: - version "23.2.0" - resolved "https://registry.verdaccio.org/jest-mock/-/jest-mock-23.2.0.tgz#ad1c60f29e8719d47c26e1138098b6d18b261134" - integrity sha1-rRxg8p6HGdR8JuETgJi20YsmETQ= +jest-mock@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-mock/-/jest-mock-24.0.0.tgz#9a4b53e01d66a0e780f7d857462d063e024c617d" + integrity sha512-sQp0Hu5fcf5NZEh1U9eIW2qD0BwJZjb63Yqd98PQJFvf/zzUTBoUAwv/Dc/HFeNHIw1f3hl/48vNn+j3STaI7A== -jest-regex-util@^23.3.0: - version "23.3.0" - resolved "https://registry.verdaccio.org/jest-regex-util/-/jest-regex-util-23.3.0.tgz#5f86729547c2785c4002ceaa8f849fe8ca471bc5" - integrity sha1-X4ZylUfCeFxAAs6qj4Sf6MpHG8U= +jest-regex-util@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-regex-util/-/jest-regex-util-24.0.0.tgz#4feee8ec4a358f5bee0a654e94eb26163cb9089a" + integrity sha512-Jv/uOTCuC+PY7WpJl2mpoI+WbY2ut73qwwO9ByJJNwOCwr1qWhEW2Lyi2S9ZewUdJqeVpEBisdEVZSI+Zxo58Q== -jest-resolve-dependencies@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-resolve-dependencies/-/jest-resolve-dependencies-23.6.0.tgz#b4526af24c8540d9a3fab102c15081cf509b723d" - integrity sha512-EkQWkFWjGKwRtRyIwRwI6rtPAEyPWlUC2MpzHissYnzJeHcyCn1Hc8j7Nn1xUVrS5C6W5+ZL37XTem4D4pLZdA== +jest-resolve-dependencies@^24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.1.0.tgz#78f738a2ec59ff4d00751d9da56f176e3f589f6c" + integrity sha512-2VwPsjd3kRPu7qe2cpytAgowCObk5AKeizfXuuiwgm1a9sijJDZe8Kh1sFj6FKvSaNEfCPlBVkZEJa2482m/Uw== dependencies: - jest-regex-util "^23.3.0" - jest-snapshot "^23.6.0" + jest-regex-util "^24.0.0" + jest-snapshot "^24.1.0" -jest-resolve@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-resolve/-/jest-resolve-23.6.0.tgz#cf1d1a24ce7ee7b23d661c33ba2150f3aebfa0ae" - integrity sha512-XyoRxNtO7YGpQDmtQCmZjum1MljDqUCob7XlZ6jy9gsMugHdN2hY4+Acz9Qvjz2mSsOnPSH7skBmDYCHXVZqkA== +jest-resolve@^24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/jest-resolve/-/jest-resolve-24.1.0.tgz#42ff0169b0ea47bfdbd0c52a0067ca7d022c7688" + integrity sha512-TPiAIVp3TG6zAxH28u/6eogbwrvZjBMWroSLBDkwkHKrqxB/RIdwkWDye4uqPlZIXWIaHtifY3L0/eO5Z0f2wg== dependencies: browser-resolve "^1.11.3" chalk "^2.0.1" realpath-native "^1.0.0" -jest-runner@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-runner/-/jest-runner-23.6.0.tgz#3894bd219ffc3f3cb94dc48a4170a2e6f23a5a38" - integrity sha512-kw0+uj710dzSJKU6ygri851CObtCD9cN8aNkg8jWJf4ewFyEa6kwmiH/r/M1Ec5IL/6VFa0wnAk6w+gzUtjJzA== +jest-runner@^24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/jest-runner/-/jest-runner-24.1.0.tgz#3686a2bb89ce62800da23d7fdc3da2c32792943b" + integrity sha512-CDGOkT3AIFl16BLL/OdbtYgYvbAprwJ+ExKuLZmGSCSldwsuU2dEGauqkpvd9nphVdAnJUcP12e/EIlnTX0QXg== dependencies: + chalk "^2.4.2" exit "^0.1.2" - graceful-fs "^4.1.11" - jest-config "^23.6.0" - jest-docblock "^23.2.0" - jest-haste-map "^23.6.0" - jest-jasmine2 "^23.6.0" - jest-leak-detector "^23.6.0" - jest-message-util "^23.4.0" - jest-runtime "^23.6.0" - jest-util "^23.4.0" - jest-worker "^23.2.0" + graceful-fs "^4.1.15" + jest-config "^24.1.0" + jest-docblock "^24.0.0" + jest-haste-map "^24.0.0" + jest-jasmine2 "^24.1.0" + jest-leak-detector "^24.0.0" + jest-message-util "^24.0.0" + jest-runtime "^24.1.0" + jest-util "^24.0.0" + jest-worker "^24.0.0" source-map-support "^0.5.6" throat "^4.0.0" -jest-runtime@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-runtime/-/jest-runtime-23.6.0.tgz#059e58c8ab445917cd0e0d84ac2ba68de8f23082" - integrity sha512-ycnLTNPT2Gv+TRhnAYAQ0B3SryEXhhRj1kA6hBPSeZaNQkJ7GbZsxOLUkwg6YmvWGdX3BB3PYKFLDQCAE1zNOw== +jest-runtime@^24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/jest-runtime/-/jest-runtime-24.1.0.tgz#7c157a2e776609e8cf552f956a5a19ec9c985214" + integrity sha512-59/BY6OCuTXxGeDhEMU7+N33dpMQyXq7MLK07cNSIY/QYt2QZgJ7Tjx+rykBI0skAoigFl0A5tmT8UdwX92YuQ== dependencies: - babel-core "^6.0.0" - babel-plugin-istanbul "^4.1.6" + "@babel/core" "^7.1.0" + babel-plugin-istanbul "^5.1.0" chalk "^2.0.1" convert-source-map "^1.4.0" exit "^0.1.2" fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.1.11" - jest-config "^23.6.0" - jest-haste-map "^23.6.0" - jest-message-util "^23.4.0" - jest-regex-util "^23.3.0" - jest-resolve "^23.6.0" - jest-snapshot "^23.6.0" - jest-util "^23.4.0" - jest-validate "^23.6.0" - micromatch "^2.3.11" + glob "^7.1.3" + graceful-fs "^4.1.15" + jest-config "^24.1.0" + jest-haste-map "^24.0.0" + jest-message-util "^24.0.0" + jest-regex-util "^24.0.0" + jest-resolve "^24.1.0" + jest-snapshot "^24.1.0" + jest-util "^24.0.0" + jest-validate "^24.0.0" + micromatch "^3.1.10" realpath-native "^1.0.0" - slash "^1.0.0" - strip-bom "3.0.0" - write-file-atomic "^2.1.0" - yargs "^11.0.0" + slash "^2.0.0" + strip-bom "^3.0.0" + write-file-atomic "2.4.1" + yargs "^12.0.2" -jest-serializer@^23.0.1: - version "23.0.1" - resolved "https://registry.verdaccio.org/jest-serializer/-/jest-serializer-23.0.1.tgz#a3776aeb311e90fe83fab9e533e85102bd164165" - integrity sha1-o3dq6zEekP6D+rnlM+hRAr0WQWU= +jest-serializer@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-serializer/-/jest-serializer-24.0.0.tgz#522c44a332cdd194d8c0531eb06a1ee5afb4256b" + integrity sha512-9FKxQyrFgHtx3ozU+1a8v938ILBE7S8Ko3uiAVjT8Yfi2o91j/fj81jacCQZ/Ihjiff/VsUCXVgQ+iF1XdImOw== -jest-snapshot@^23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest-snapshot/-/jest-snapshot-23.6.0.tgz#f9c2625d1b18acda01ec2d2b826c0ce58a5aa17a" - integrity sha512-tM7/Bprftun6Cvj2Awh/ikS7zV3pVwjRYU2qNYS51VZHgaAMBs5l4o/69AiDHhQrj5+LA2Lq4VIvK7zYk/bswg== +jest-snapshot@^24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/jest-snapshot/-/jest-snapshot-24.1.0.tgz#85e22f810357aa5994ab61f236617dc2205f2f5b" + integrity sha512-th6TDfFqEmXvuViacU1ikD7xFb7lQsPn2rJl7OEmnfIVpnrx3QNY2t3PE88meeg0u/mQ0nkyvmC05PBqO4USFA== dependencies: - babel-types "^6.0.0" + "@babel/types" "^7.0.0" chalk "^2.0.1" - jest-diff "^23.6.0" - jest-matcher-utils "^23.6.0" - jest-message-util "^23.4.0" - jest-resolve "^23.6.0" + jest-diff "^24.0.0" + jest-matcher-utils "^24.0.0" + jest-message-util "^24.0.0" + jest-resolve "^24.1.0" mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^23.6.0" + pretty-format "^24.0.0" semver "^5.5.0" -jest-util@^23.4.0: - version "23.4.0" - resolved "https://registry.verdaccio.org/jest-util/-/jest-util-23.4.0.tgz#4d063cb927baf0a23831ff61bec2cbbf49793561" - integrity sha1-TQY8uSe68KI4Mf9hvsLLv0l5NWE= +jest-util@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-util/-/jest-util-24.0.0.tgz#fd38fcafd6dedbd0af2944d7a227c0d91b68f7d6" + integrity sha512-QxsALc4wguYS7cfjdQSOr5HTkmjzkHgmZvIDkcmPfl1ib8PNV8QUWLwbKefCudWS0PRKioV+VbQ0oCUPC691fQ== dependencies: - callsites "^2.0.0" + callsites "^3.0.0" chalk "^2.0.1" - graceful-fs "^4.1.11" - is-ci "^1.0.10" - jest-message-util "^23.4.0" + graceful-fs "^4.1.15" + is-ci "^2.0.0" + jest-message-util "^24.0.0" mkdirp "^0.5.1" - slash "^1.0.0" + slash "^2.0.0" source-map "^0.6.0" -jest-validate@^23.5.0, jest-validate@^23.6.0: +jest-validate@^23.5.0: version "23.6.0" resolved "https://registry.verdaccio.org/jest-validate/-/jest-validate-23.6.0.tgz#36761f99d1ed33fcd425b4e4c5595d62b6597474" integrity sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A== @@ -7192,29 +7328,42 @@ jest-validate@^23.5.0, jest-validate@^23.6.0: leven "^2.1.0" pretty-format "^23.6.0" -jest-watcher@^23.4.0: - version "23.4.0" - resolved "https://registry.verdaccio.org/jest-watcher/-/jest-watcher-23.4.0.tgz#d2e28ce74f8dad6c6afc922b92cabef6ed05c91c" - integrity sha1-0uKM50+NrWxq/JIrksq+9u0FyRw= +jest-validate@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-validate/-/jest-validate-24.0.0.tgz#aa8571a46983a6538328fef20406b4a496b6c020" + integrity sha512-vMrKrTOP4BBFIeOWsjpsDgVXATxCspC9S1gqvbJ3Tnn/b9ACsJmteYeVx9830UMV28Cob1RX55x96Qq3Tfad4g== + dependencies: + camelcase "^5.0.0" + chalk "^2.0.1" + jest-get-type "^24.0.0" + leven "^2.1.0" + pretty-format "^24.0.0" + +jest-watcher@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-watcher/-/jest-watcher-24.0.0.tgz#20d44244d10b0b7312410aefd256c1c1eef68890" + integrity sha512-GxkW2QrZ4YxmW1GUWER05McjVDunBlKMFfExu+VsGmXJmpej1saTEKvONdx5RJBlVdpPI5x6E3+EDQSIGgl53g== dependencies: ansi-escapes "^3.0.0" chalk "^2.0.1" + jest-util "^24.0.0" string-length "^2.0.0" -jest-worker@^23.2.0: - version "23.2.0" - resolved "https://registry.verdaccio.org/jest-worker/-/jest-worker-23.2.0.tgz#faf706a8da36fae60eb26957257fa7b5d8ea02b9" - integrity sha1-+vcGqNo2+uYOsmlXJX+ntdjqArk= +jest-worker@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/jest-worker/-/jest-worker-24.0.0.tgz#3d3483b077bf04f412f47654a27bba7e947f8b6d" + integrity sha512-s64/OThpfQvoCeHG963MiEZOAAxu8kHsaL/rCMF7lpdzo7vgF0CtPml9hfguOMgykgH/eOm4jFP4ibfHLruytg== dependencies: merge-stream "^1.0.1" + supports-color "^6.1.0" -jest@23.6.0: - version "23.6.0" - resolved "https://registry.verdaccio.org/jest/-/jest-23.6.0.tgz#ad5835e923ebf6e19e7a1d7529a432edfee7813d" - integrity sha512-lWzcd+HSiqeuxyhG+EnZds6iO3Y3ZEnMrfZq/OTGvF/C+Z4fPMCdhWTGSAiO2Oym9rbEXfwddHhh6jqrTF3+Lw== +jest@24.1.0: + version "24.1.0" + resolved "https://registry.verdaccio.org/jest/-/jest-24.1.0.tgz#b1e1135caefcf2397950ecf7f90e395fde866fd2" + integrity sha512-+q91L65kypqklvlRFfXfdzUKyngQLOcwGhXQaLmVHv+d09LkNXuBuGxlofTFW42XMzu3giIcChchTsCNUjQ78A== dependencies: - import-local "^1.0.0" - jest-cli "^23.6.0" + import-local "^2.0.0" + jest-cli "^24.1.0" js-base64@2.5.1, js-base64@^2.1.8, js-base64@^2.1.9: version "2.5.1" @@ -7241,7 +7390,7 @@ js-tokens@^3.0.2: resolved "https://registry.verdaccio.org/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= -js-yaml@3.12.1, js-yaml@^3.12.0, js-yaml@^3.7.0, js-yaml@^3.9.0: +js-yaml@3.12.1, js-yaml@^3.12.0, js-yaml@^3.9.0: version "3.12.1" resolved "https://registry.verdaccio.org/js-yaml/-/js-yaml-3.12.1.tgz#295c8632a18a23e054cf5c9d3cecafe678167600" integrity sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA== @@ -7501,10 +7650,10 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.verdaccio.org/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== -kleur@^2.0.1: - version "2.0.2" - resolved "https://registry.verdaccio.org/kleur/-/kleur-2.0.2.tgz#b704f4944d95e255d038f0cb05fb8a602c55a300" - integrity sha512-77XF9iTllATmG9lSlIv0qdQ2BQ/h9t0bJllHlbvsQ0zUWfU7Yi0S8L5JXzPZgkefIiajLmBJJ4BsMJmqcf7oxQ== +kleur@^3.0.2: + version "3.0.2" + resolved "https://registry.verdaccio.org/kleur/-/kleur-3.0.2.tgz#83c7ec858a41098b613d5998a7b653962b504f68" + integrity sha512-3h7B2WRT5LNXOtQiAaWonilegHcPSf9nLVXlSTci8lu1dZUuui61+EsPEZqSVxY7rXYmB2DVKMQILxaO5WL61Q== known-css-properties@^0.10.0: version "0.10.0" @@ -8000,7 +8149,7 @@ lunr-mutable-indexes@2.3.2: resolved "https://registry.verdaccio.org/lunr/-/lunr-2.3.5.tgz#7b510bad57e948dfb99a71fdff00c1bf9171bdda" integrity sha512-EtnfmHsHJTr3u24sito9JctSxej5Ds0SgUD2Lm+qRHyLgM7BGesFlW14eNh1mil0fV5Muh8gf3dBBXzADlUlzQ== -make-dir@^1.0.0: +make-dir@^1.0.0, make-dir@^1.3.0: version "1.3.0" resolved "https://registry.verdaccio.org/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== @@ -9119,6 +9268,13 @@ p-defer@^1.0.0: resolved "https://registry.verdaccio.org/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= +p-each-series@^1.0.0: + version "1.0.0" + resolved "https://registry.verdaccio.org/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" + integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E= + dependencies: + p-reduce "^1.0.0" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.verdaccio.org/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -9167,6 +9323,11 @@ p-map@^2.0.0: resolved "https://registry.verdaccio.org/p-map/-/p-map-2.0.0.tgz#be18c5a5adeb8e156460651421aceca56c213a50" integrity sha512-GO107XdrSUmtHxVoi60qc9tUl/KkNKm+X2CF4P9amalpGxv5YqVPJNfSb0wcA+syCopkZvYYIzW8OVTQW59x/w== +p-reduce@^1.0.0: + version "1.0.0" + resolved "https://registry.verdaccio.org/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= + p-try@^1.0.0: version "1.0.0" resolved "https://registry.verdaccio.org/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" @@ -9323,7 +9484,7 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.verdaccio.org/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -path-parse@^1.0.5, path-parse@^1.0.6: +path-parse@^1.0.6: version "1.0.6" resolved "https://registry.verdaccio.org/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== @@ -10190,6 +10351,14 @@ pretty-format@^23.6.0: ansi-regex "^3.0.0" ansi-styles "^3.2.0" +pretty-format@^24.0.0: + version "24.0.0" + resolved "https://registry.verdaccio.org/pretty-format/-/pretty-format-24.0.0.tgz#cb6599fd73ac088e37ed682f61291e4678f48591" + integrity sha512-LszZaKG665djUcqg5ZQq+XzezHLKrxsA86ZABTozp+oNhkdqa+tG2dX4qa6ERl5c/sRDrAa3lHmwnvKoP+OG/g== + dependencies: + ansi-regex "^4.0.0" + ansi-styles "^3.2.0" + prettycli@^1.4.3: version "1.4.3" resolved "https://registry.verdaccio.org/prettycli/-/prettycli-1.4.3.tgz#b28ec2aad9de07ae1fd75ef294fb54cbdee07ed5" @@ -10234,13 +10403,13 @@ promise@^7.1.1: dependencies: asap "~2.0.3" -prompts@^0.1.9: - version "0.1.14" - resolved "https://registry.verdaccio.org/prompts/-/prompts-0.1.14.tgz#a8e15c612c5c9ec8f8111847df3337c9cbd443b2" - integrity sha512-rxkyiE9YH6zAz/rZpywySLKkpaj0NMVyNw1qhsubdbjjSgcayjTShDreZGlFMcGSu5sab3bAKPfFk78PB90+8w== +prompts@^2.0.1: + version "2.0.3" + resolved "https://registry.verdaccio.org/prompts/-/prompts-2.0.3.tgz#c5ccb324010b2e8f74752aadceeb57134c1d2522" + integrity sha512-H8oWEoRZpybm6NV4to9/1limhttEo13xK62pNvn2JzY0MA03p7s0OjtmhXyon3uJmxiJJVSuUwEJFFssI3eBiQ== dependencies: - kleur "^2.0.1" - sisteransi "^0.1.1" + kleur "^3.0.2" + sisteransi "^1.0.0" prop-types@15.6.2, prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2: version "15.6.2" @@ -10627,6 +10796,14 @@ read-pkg-up@^3.0.0: find-up "^2.0.0" read-pkg "^3.0.0" +read-pkg-up@^4.0.0: + version "4.0.0" + resolved "https://registry.verdaccio.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" + integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== + dependencies: + find-up "^3.0.0" + read-pkg "^3.0.0" + read-pkg@^1.0.0, read-pkg@^1.1.0: version "1.1.0" resolved "https://registry.verdaccio.org/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" @@ -10702,6 +10879,13 @@ realpath-native@^1.0.0: dependencies: util.promisify "^1.0.0" +realpath-native@^1.0.2: + version "1.1.0" + resolved "https://registry.verdaccio.org/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" + integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== + dependencies: + util.promisify "^1.0.0" + "recompose@0.28.0 - 0.30.0": version "0.30.0" resolved "https://registry.verdaccio.org/recompose/-/recompose-0.30.0.tgz#82773641b3927e8c7d24a0d87d65aeeba18aabd0" @@ -11250,14 +11434,15 @@ safe-regex@^1.1.0: resolved "https://registry.verdaccio.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sane@^2.0.0: - version "2.5.2" - resolved "https://registry.verdaccio.org/sane/-/sane-2.5.2.tgz#b4dc1861c21b427e929507a3e751e2a2cb8ab3fa" - integrity sha1-tNwYYcIbQn6SlQej51HiosuKs/o= +sane@^3.0.0: + version "3.1.0" + resolved "https://registry.verdaccio.org/sane/-/sane-3.1.0.tgz#995193b7dc1445ef1fe41ddfca2faf9f111854c6" + integrity sha512-G5GClRRxT1cELXfdAq7UKtUsv8q/ZC5k8lQGmjEm4HcAl3HzBy68iglyNCmw4+0tiXPCBZntslHlRhbnsSws+Q== dependencies: anymatch "^2.0.0" capture-exit "^1.2.0" exec-sh "^0.2.0" + execa "^1.0.0" fb-watchman "^2.0.0" micromatch "^3.1.4" minimist "^1.1.1" @@ -11510,10 +11695,10 @@ simple-swizzle@^0.2.2: dependencies: is-arrayish "^0.3.1" -sisteransi@^0.1.1: - version "0.1.1" - resolved "https://registry.verdaccio.org/sisteransi/-/sisteransi-0.1.1.tgz#5431447d5f7d1675aac667ccd0b865a4994cb3ce" - integrity sha512-PmGOd02bM9YO5ifxpw36nrNMBTptEtfRl4qUYl9SndkolplkrZZOW7PGHjrZL53QvMVj9nQ+TKqUnRsw4tJa4g== +sisteransi@^1.0.0: + version "1.0.0" + resolved "https://registry.verdaccio.org/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c" + integrity sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ== slash@^1.0.0: version "1.0.0" @@ -11968,11 +12153,6 @@ strip-ansi@^5.0.0: dependencies: ansi-regex "^4.0.0" -strip-bom@3.0.0, strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.verdaccio.org/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.verdaccio.org/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -11980,6 +12160,11 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.verdaccio.org/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.verdaccio.org/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -12171,7 +12356,7 @@ supports-color@^2.0.0: resolved "https://registry.verdaccio.org/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= -supports-color@^3.1.2, supports-color@^3.2.3: +supports-color@^3.2.3: version "3.2.3" resolved "https://registry.verdaccio.org/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= @@ -12192,7 +12377,7 @@ supports-color@^5.1.0, supports-color@^5.2.0, supports-color@^5.3.0, supports-co dependencies: has-flag "^3.0.0" -supports-color@^6.1.0: +supports-color@^6.0.0, supports-color@^6.1.0: version "6.1.0" resolved "https://registry.verdaccio.org/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== @@ -12318,6 +12503,16 @@ test-exclude@^4.2.1: read-pkg-up "^1.0.1" require-main-filename "^1.0.1" +test-exclude@^5.0.0: + version "5.1.0" + resolved "https://registry.verdaccio.org/test-exclude/-/test-exclude-5.1.0.tgz#6ba6b25179d2d38724824661323b73e03c0c1de1" + integrity sha512-gwf0S2fFsANC55fSeSqpb8BYk6w3FDvwZxfNjeF6FRgvFa43r+7wRiA/Q0IxoRU37wB/LE8IQ4221BsNucTaCA== + dependencies: + arrify "^1.0.1" + minimatch "^3.0.4" + read-pkg-up "^4.0.0" + require-main-filename "^1.0.1" + text-extensions@^1.0.0: version "1.9.0" resolved "https://registry.verdaccio.org/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" @@ -13258,10 +13453,10 @@ wrappy@1: resolved "https://registry.verdaccio.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write-file-atomic@^2.1.0: - version "2.4.2" - resolved "https://registry.verdaccio.org/write-file-atomic/-/write-file-atomic-2.4.2.tgz#a7181706dfba17855d221140a9c06e15fcdd87b9" - integrity sha512-s0b6vB3xIVRLWywa6X9TOMA7k9zio0TMOsl9ZnDkliA/cfJlpHXAscj0gbHVJiTdIuAYpIyqS5GW91fqm6gG5g== +write-file-atomic@2.4.1: + version "2.4.1" + resolved "https://registry.verdaccio.org/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" + integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== dependencies: graceful-fs "^4.1.11" imurmurhash "^0.1.4" @@ -13365,13 +13560,6 @@ yargs-parser@^7.0.0: dependencies: camelcase "^4.1.0" -yargs-parser@^9.0.2: - version "9.0.2" - resolved "https://registry.verdaccio.org/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" - integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= - dependencies: - camelcase "^4.1.0" - yargs@12.0.2: version "12.0.2" resolved "https://registry.verdaccio.org/yargs/-/yargs-12.0.2.tgz#fe58234369392af33ecbef53819171eff0f5aadc" @@ -13390,24 +13578,6 @@ yargs@12.0.2: y18n "^3.2.1 || ^4.0.0" yargs-parser "^10.1.0" -yargs@^11.0.0: - version "11.1.0" - resolved "https://registry.verdaccio.org/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" - integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== - dependencies: - cliui "^4.0.0" - decamelize "^1.1.1" - find-up "^2.1.0" - get-caller-file "^1.0.1" - os-locale "^2.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^9.0.2" - yargs@^12.0.2, yargs@^12.0.5: version "12.0.5" resolved "https://registry.verdaccio.org/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" From d682e4f32882397d228833d8e20bb39c6cf4d5a8 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Sun, 24 Feb 2019 23:51:36 +0100 Subject: [PATCH 3/7] chore: fix unit test --- test/unit/api/store.spec.js | 1 - test/unit/partials/config/yaml/store.spec.yaml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/unit/api/store.spec.js b/test/unit/api/store.spec.js index faea7a324..3925ef8a6 100644 --- a/test/unit/api/store.spec.js +++ b/test/unit/api/store.spec.js @@ -108,7 +108,6 @@ describe('StorageTest', () => { // $FlowFixMe storage.localStorage.updateVersions = jest.fn(storage.localStorage.updateVersions); expect(metadata).toBeDefined(); - console.log("M-->", metadata); storage._syncUplinksMetadata('npm_test', metadata, {}, (err) => { expect(err).toBeNull(); expect(storage.localStorage.updateVersions).not.toHaveBeenCalled(); diff --git a/test/unit/partials/config/yaml/store.spec.yaml b/test/unit/partials/config/yaml/store.spec.yaml index 93e77120c..6223019ab 100644 --- a/test/unit/partials/config/yaml/store.spec.yaml +++ b/test/unit/partials/config/yaml/store.spec.yaml @@ -14,9 +14,9 @@ packages: access: $all publish: $all proxy: npmjs - '*': + 'npm_test': access: $all publish: $all - proxy: npmjs + ? proxy logs: - { type: stdout, format: pretty, level: warn } From 9e4e8be6a6698737e51652bdbdf469926db37ce1 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Sun, 24 Feb 2019 23:56:02 +0100 Subject: [PATCH 4/7] feat: disable node9 on circleci --- .circleci/config.yml | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bc5223fe5..86963639f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,12 +6,9 @@ aliases: - &node8_executor docker: - image: circleci/node:8 - - &node9_executor + - &node10_browser_executor docker: - - image: circleci/node:9 - - &node9_browser_executor - docker: - - image: circleci/node:9-browsers + - image: circleci/node:10-browsers - &node10_executor docker: - image: circleci/node:10 @@ -19,7 +16,7 @@ aliases: docker: - image: circleci/node:11 - &default_executor - <<: *node9_executor + <<: *node10_executor - &repo_key repo-{{ .Branch }}-{{ .Revision }} - &coverage_key @@ -100,23 +97,7 @@ jobs: name: Test with Node 8 command: | yarn test - yarn test:functional - - test_node9: - <<: *defaults - <<: *default_executor - steps: - - *restore_repo - - run: - name: Test with Node 9 - command: | - yarn test - yarn test:functional - - save_cache: - key: *coverage_key - paths: - - coverage - + yarn test:functional test_node10: <<: *defaults <<: *node10_executor @@ -141,7 +122,7 @@ jobs: test_e2e: <<: *defaults - <<: *node9_browser_executor + <<: *node10_browser_executor steps: - *restore_repo - run: @@ -199,10 +180,6 @@ workflows: requires: - prepare <<: *ignore_non_dev_branches - - test_node9: - requires: - - prepare - <<: *ignore_non_dev_branches - test_node10: requires: - prepare @@ -222,7 +199,6 @@ workflows: - coverage: requires: - test_node8 - - test_node9 - test_node10 - test_node11 - test_e2e From 43f8bc3db1f7d99a3e99167061996298bdcfa587 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Mon, 25 Feb 2019 07:16:49 +0100 Subject: [PATCH 5/7] chore: update toStrictEqual to toEqual --- test/functional/tags/tags.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/functional/tags/tags.js b/test/functional/tags/tags.js index 60a67b799..ba43ee038 100644 --- a/test/functional/tags/tags.js +++ b/test/functional/tags/tags.js @@ -71,7 +71,7 @@ export default function(server, express) { latest: "1.1.0" }; - expect(body).toStrictEqual(expected); + expect(body).toEqual(expected); }); }); @@ -94,7 +94,7 @@ export default function(server, express) { "quux": "0.1.0" }; - expect(body).toStrictEqual(expected); + expect(body).toEqual(expected); }); }); }); @@ -115,7 +115,7 @@ export default function(server, express) { latest: '1.1.0' }; - expect(body).toStrictEqual(expected); + expect(body).toEqual(expected); }); }); }); @@ -135,7 +135,7 @@ export default function(server, express) { foo: "0.1.3alpha" }; - expect(body).toStrictEqual(expected); + expect(body).toEqual(expected); }); }); }); @@ -154,7 +154,7 @@ export default function(server, express) { "quux": "0.1.0" }; - expect(body).toStrictEqual(expected); + expect(body).toEqual(expected); }); }); }); From 1d13979a58f2d3d900094a4dc3261534a23bfe60 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Mon, 25 Feb 2019 07:31:35 +0100 Subject: [PATCH 6/7] doc: add improve unpublish docs --- conf/default.yaml | 8 ++++---- conf/docker.yaml | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/conf/default.yaml b/conf/default.yaml index e917e1545..27f802d4c 100644 --- a/conf/default.yaml +++ b/conf/default.yaml @@ -13,7 +13,8 @@ plugins: ./plugins web: title: Verdaccio - # gravatar: true + # comment out to disable gravatar support + # gravatar: false # by default packages are ordercer ascendant (asc|desc) # sort_packages: asc @@ -22,7 +23,7 @@ auth: file: ./htpasswd # Maximum amount of users allowed to register, defaults to "+inf". # You can set this to -1 to disable registration. - #max_users: 1000 + # max_users: 1000 security: api: @@ -56,10 +57,9 @@ packages: # and three keywords: "$all", "$anonymous", "$authenticated" access: $all - # allow all known users to publish packages + # allow all known users to publish/publish packages # (anyone can register by default, remember?) publish: $authenticated - unpublish: $authenticated # if package is not available locally, proxy requests to 'npmjs' registry diff --git a/conf/docker.yaml b/conf/docker.yaml index 51dedc1d8..605d28d63 100644 --- a/conf/docker.yaml +++ b/conf/docker.yaml @@ -19,13 +19,17 @@ web: # WebUI is enabled as default, if you want disable it, just uncomment this line #enable: false title: Verdaccio + # comment out to disable gravatar support + # gravatar: false + # by default packages are ordercer ascendant (asc|desc) + # sort_packages: asc auth: htpasswd: file: /verdaccio/storage/htpasswd # Maximum amount of users allowed to register, defaults to "+infinity". # You can set this to -1 to disable registration. - #max_users: 1000 + # max_users: 1000 security: api: @@ -48,6 +52,7 @@ packages: # scoped packages access: $all publish: $authenticated + unpublish: $authenticated proxy: npmjs '**': @@ -58,9 +63,10 @@ packages: # and three keywords: "$all", "$anonymous", "$authenticated" access: $all - # allow all known users to publish packages + # allow all known users to publish/publish packages # (anyone can register by default, remember?) publish: $authenticated + unpublish: $authenticated # if package is not available locally, proxy requests to 'npmjs' registry proxy: npmjs From 6553c6bce13443064e475d8992eddf08bd82cfc3 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Mon, 25 Feb 2019 08:33:01 +0100 Subject: [PATCH 7/7] test: add unit test for unpublish --- test/unit/api/api.spec.js | 118 +++++++++++++++++-- test/unit/partials/config/yaml/api.spec.yaml | 17 ++- 2 files changed, 121 insertions(+), 14 deletions(-) diff --git a/test/unit/api/api.spec.js b/test/unit/api/api.spec.js index d1dcc6cb6..a047a5aa3 100644 --- a/test/unit/api/api.spec.js +++ b/test/unit/api/api.spec.js @@ -11,10 +11,22 @@ import {HEADERS, API_ERROR, HTTP_STATUS, HEADER_TYPE, API_MESSAGE, TOKEN_BEARER} import {mockServer} from './mock'; import {DOMAIN_SERVERS} from '../../functional/config.functional'; import {buildToken} from '../../../src/lib/utils'; +import {getNewToken} from './__api-helper'; require('../../../src/lib/logger').setup([]); const credentials = { name: 'jota', password: 'secretPass' }; +const putPackage = (app, name, publishMetadata) => { + return request(app) + .put(name) + .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) + .send(JSON.stringify(publishMetadata)) + .expect(HTTP_STATUS.CREATED) + .set('accept', 'gzip') + .set('accept-encoding', HEADERS.JSON) + .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON); +} + describe('endpoint unit test', () => { let app; let mockRegistry; @@ -113,7 +125,7 @@ describe('endpoint unit test', () => { test('should fails on protected endpoint /-/auth-package bad JWT Bearer format', (done) => { request(app) .get('/auth-package') - .set('authorization', 'Bearer') + .set('authorization', TOKEN_BEARER) .expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) .expect(HTTP_STATUS.FORBIDDEN) .end(function(err, res) { @@ -126,7 +138,7 @@ describe('endpoint unit test', () => { test('should fails on protected endpoint /-/auth-package well JWT Bearer', (done) => { request(app) .get('/auth-package') - .set('authorization', 'Bearer 12345') + .set('authorization', buildToken(TOKEN_BEARER, '12345')) .expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) .expect(HTTP_STATUS.FORBIDDEN) .end(function(err, res) { @@ -413,13 +425,7 @@ describe('endpoint unit test', () => { }; test('should set a new tag on jquery', (done) => { - - request(app) - .put('/jquery/verdaccio-tag') - .send(JSON.stringify(jqueryVersion)) - .set('accept', 'gzip') - .set('accept-encoding', HEADERS.JSON) - .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) + putPackage(app, '/jquery/verdaccio-tag', jqueryVersion) .expect(HTTP_STATUS.CREATED) .end(function(err, res) { if (err) { @@ -535,8 +541,8 @@ describe('endpoint unit test', () => { }); - describe('should test publish api', () => { - test('should publish a new package', (done) => { + describe('should test publish/unpublish api', () => { + test('should publish a new package with no credentials', (done) => { request(app) .put('/@scope%2fpk1-test') .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) @@ -555,11 +561,15 @@ describe('endpoint unit test', () => { }); }); - test('should unpublish a new package', (done) => { + test('should unpublish a new package with credentials', async (done) => { + + const credentials = { name: 'jota_unpublish', password: 'secretPass' }; + const token = await getNewToken(request(app), credentials); //FUTURE: for some reason it does not remove the scope folder request(app) .del('/@scope%2fpk1-test/-rev/4-6abcdb4efd41a576') .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) + .set('authorization', buildToken(TOKEN_BEARER, token)) .expect(HTTP_STATUS.CREATED) .end(function(err, res) { if (err) { @@ -571,6 +581,90 @@ describe('endpoint unit test', () => { done(); }); }); + + test('should fail due non-unpublish nobody can unpublish', async (done) => { + const credentials = { name: 'jota_unpublish_fail', password: 'secretPass' }; + const token = await getNewToken(request(app), credentials); + request(app) + .del('/non-unpublish/-rev/4-6abcdb4efd41a576') + .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) + .set('authorization', buildToken(TOKEN_BEARER, token)) + .expect(HTTP_STATUS.FORBIDDEN) + .end(function(err, res) { + expect(err).toBeNull(); + expect(res.body.error).toBeDefined(); + expect(res.body.error).toMatch(/user jota_unpublish_fail is not allowed to unpublish package non-unpublish/); + done(); + }); + }); + + test('should be able to publish/unpublish by only super_admin user', async (done) => { + const credentials = { name: 'super_admin', password: 'secretPass' }; + const token = await getNewToken(request(app), credentials); + request(app) + .put('/super-admin-can-unpublish') + .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) + .set('authorization', buildToken(TOKEN_BEARER, token)) + .send(JSON.stringify(_.assign({}, publishMetadata, { + name: 'super-admin-can-unpublish' + }))) + .expect(HTTP_STATUS.CREATED) + .end(function(err, res) { + if (err) { + expect.toBeNull(); + return done(err); + } + expect(res.body.ok).toBeDefined(); + expect(res.body.success).toBeDefined(); + expect(res.body.success).toBeTruthy(); + expect(res.body.ok).toMatch(API_MESSAGE.PKG_CREATED); + request(app) + .del('/super-admin-can-unpublish/-rev/4-6abcdb4efd41a576') + .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) + .set('authorization', buildToken(TOKEN_BEARER, token)) + .expect(HTTP_STATUS.CREATED) + .end(function(err, res) { + expect(err).toBeNull(); + expect(res.body.ok).toBeDefined(); + expect(res.body.ok).toMatch(API_MESSAGE.PKG_REMOVED); + done(); + }); + }); + }); + + test('should be able to publish/unpublish by any user', async (done) => { + const credentials = { name: 'any_user', password: 'secretPass' }; + const token = await getNewToken(request(app), credentials); + request(app) + .put('/all-can-unpublish') + .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) + .set('authorization', buildToken(TOKEN_BEARER, token)) + .send(JSON.stringify(_.assign({}, publishMetadata, { + name: 'all-can-unpublish' + }))) + .expect(HTTP_STATUS.CREATED) + .end(function(err, res) { + if (err) { + expect.toBeNull(); + return done(err); + } + expect(res.body.ok).toBeDefined(); + expect(res.body.success).toBeDefined(); + expect(res.body.success).toBeTruthy(); + expect(res.body.ok).toMatch(API_MESSAGE.PKG_CREATED); + request(app) + .del('/all-can-unpublish/-rev/4-6abcdb4efd41a576') + .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) + .set('authorization', buildToken(TOKEN_BEARER, token)) + .expect(HTTP_STATUS.CREATED) + .end(function(err, res) { + expect(err).toBeNull(); + expect(res.body.ok).toBeDefined(); + expect(res.body.ok).toMatch(API_MESSAGE.PKG_REMOVED); + done(); + }); + }); + }); }); }); }); diff --git a/test/unit/partials/config/yaml/api.spec.yaml b/test/unit/partials/config/yaml/api.spec.yaml index 76b324b28..ce73ca717 100644 --- a/test/unit/partials/config/yaml/api.spec.yaml +++ b/test/unit/partials/config/yaml/api.spec.yaml @@ -6,11 +6,24 @@ packages: '@*/*': access: $all publish: $all - unpublish: $all + unpublish: $authenticated proxy: npmjs 'auth-package': access: $authenticated publish: $authenticated + 'non-unpublish': + access: $authenticated + publish: $authenticated + # this is intended, empty block + ? unpublish + 'super-admin-can-unpublish': + access: $authenticated + publish: super_admin + unpublish: super_admin + 'all-can-unpublish': + access: $authenticated + publish: $all + unpublish: $all 'forbidden-place': access: nobody publish: $all @@ -28,4 +41,4 @@ packages: unpublish: xxx proxy: npmjs logs: - - { type: stdout, format: pretty, level: error } + - { type: stdout, format: pretty, level: warn }