diff --git a/bin/cli/base.js b/bin/cli/base.js index f44e9a6..574782d 100644 --- a/bin/cli/base.js +++ b/bin/cli/base.js @@ -18,7 +18,7 @@ class Base extends Command { } let config - yaml.safeLoadAll(fs.readFileSync(configFile, 'utf-8'), (doc) => { + yaml.loadAll(fs.readFileSync(configFile, 'utf-8'), (doc) => { const valid = validate(doc) if (!valid) { diff --git a/package-lock.json b/package-lock.json index a3c7078..56794ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -442,6 +442,27 @@ "get-package-type": "^0.1.0", "js-yaml": "^3.13.1", "resolve-from": "^5.0.0" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + } } }, "@istanbuljs/schema": { @@ -1776,12 +1797,9 @@ } }, "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "arr-diff": { "version": "4.0.0", @@ -3187,7 +3205,8 @@ "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true }, "estraverse": { "version": "4.3.0", @@ -3801,7 +3820,8 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", - "dev": true + "dev": true, + "optional": true }, "har-schema": { "version": "2.0.0", @@ -6316,12 +6336,11 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", + "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, "jsbn": { @@ -7259,6 +7278,7 @@ "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.1.tgz", "integrity": "sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA==", "dev": true, + "optional": true, "requires": { "growly": "^1.3.0", "is-wsl": "^2.2.0", @@ -7273,6 +7293,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", "dev": true, + "optional": true, "requires": { "lru-cache": "^6.0.0" } @@ -7281,13 +7302,15 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true + "dev": true, + "optional": true }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "optional": true, "requires": { "isexe": "^2.0.0" } @@ -8728,7 +8751,8 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true + "dev": true, + "optional": true }, "signal-exit": { "version": "3.0.2", @@ -8968,7 +8992,8 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true }, "sshpk": { "version": "1.16.1", diff --git a/package.json b/package.json index 677a17a..89b66cb 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "dotenv": "8.2.0", "globby": "11.0.2", "is-plain-object": "5.0.0", - "js-yaml": "3.14.0", + "js-yaml": "4.0.0", "prompts": "2.4.0", "request": "2.88.2", "request-promise-native": "1.0.9", diff --git a/src/__tests__/beau.spec.js b/src/__tests__/beau.spec.js index 1bd2791..b0c4df5 100644 --- a/src/__tests__/beau.spec.js +++ b/src/__tests__/beau.spec.js @@ -11,7 +11,7 @@ describe(`Beau's config Loader.`, () => { it('should load the config', () => { moduleVersion.mockReturnValue(1) - const doc = yaml.safeLoad(` + const doc = yaml.load(` version: 1 endpoint: 'http://example.com' @@ -27,7 +27,7 @@ describe(`Beau's config Loader.`, () => { it(`should load the request list using the configuration`, () => { moduleVersion.mockReturnValue(1) - const doc = yaml.safeLoad(` + const doc = yaml.load(` version: 1 endpoint: 'http://example.com' diff --git a/src/__tests__/config.spec.js b/src/__tests__/config.spec.js index 463cf2d..68c4833 100644 --- a/src/__tests__/config.spec.js +++ b/src/__tests__/config.spec.js @@ -6,7 +6,7 @@ requireg.resolving = false describe('Config', () => { it('should load valid config keys', () => { - const doc = yaml.safeLoad(` + const doc = yaml.load(` version: 1 endpoint: http://martianwabbit.com shouldntBeAdded: true @@ -19,7 +19,7 @@ describe('Config', () => { }) it('should load requests', () => { - const doc = yaml.safeLoad(` + const doc = yaml.load(` endpoint: http://example.com GET /profile: get-profile @@ -36,7 +36,7 @@ describe('Config', () => { }) it('should set up defaults for all requests', () => { - const doc = yaml.safeLoad(` + const doc = yaml.load(` version: 1 endpoint: 'http://example.com' @@ -60,7 +60,7 @@ describe('Config', () => { }) it('should load multiple hosts', () => { - const doc = yaml.safeLoad(` + const doc = yaml.load(` version: 1 endpoint: http://example.org @@ -105,7 +105,7 @@ describe('Config', () => { }) it('should namespace all aliases within an host', () => { - const doc = yaml.safeLoad(` + const doc = yaml.load(` hosts: - host: test1 endpoint: http://example.com @@ -122,7 +122,7 @@ describe('Config', () => { }) it(`should throw if host doesn't have a host key`, () => { - const doc = yaml.safeLoad(` + const doc = yaml.load(` hosts: - endpoint: http://example.com GET /posts: posts @@ -136,7 +136,7 @@ describe('Config', () => { }) it(`should merge host settings with global settings`, () => { - const doc = yaml.safeLoad(` + const doc = yaml.load(` defaults: headers: hello: 1 @@ -159,7 +159,7 @@ describe('Config', () => { }) it(`should allow different settings for the same request`, () => { - const doc = yaml.safeLoad(` + const doc = yaml.load(` host: https://example.com GET /1: - alias: req1