diff --git a/package-lock.json b/package-lock.json index 7da27877..6c69c862 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "express": "^4.21.1", "fs-extra": "^10.1.0", "inquirer": "^8.2.7", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.1", "keychain": "^1.4.0", "keytar": "^7.9.0", "lodash": "^4.17.13", @@ -1507,13 +1507,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "license": "Python-2.0" - }, "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", @@ -1535,19 +1528,6 @@ "node": ">= 4" } }, - "node_modules/@eslint/eslintrc/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -2194,6 +2174,16 @@ "node": ">=8" } }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -2208,6 +2198,20 @@ "node": ">=8" } }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/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, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -3037,6 +3041,16 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/@oclif/test/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, "node_modules/@oclif/test/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -3100,6 +3114,20 @@ "dev": true, "license": "MIT" }, + "node_modules/@oclif/test/node_modules/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, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -4756,13 +4784,10 @@ "license": "MIT" }, "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "license": "MIT", - "dependencies": { - "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==", + "license": "Python-2.0" }, "node_modules/array-flatten": { "version": "1.1.1", @@ -6503,26 +6528,6 @@ } } }, - "node_modules/cosmiconfig/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "license": "Python-2.0" - }, - "node_modules/cosmiconfig/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/crc": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", @@ -10214,13 +10219,12 @@ "license": "MIT" }, "node_modules/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==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "license": "MIT", "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" @@ -11529,13 +11533,6 @@ "node": ">= 14.0.0" } }, - "node_modules/mocha/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "license": "Python-2.0" - }, "node_modules/mocha/node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -14783,6 +14780,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, "license": "BSD-3-Clause" }, "node_modules/sshpk": { diff --git a/package.json b/package.json index 76585d2b..1064c3d8 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "express": "^4.21.1", "fs-extra": "^10.1.0", "inquirer": "^8.2.7", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.1", "keychain": "^1.4.0", "keytar": "^7.9.0", "lodash": "^4.17.13", diff --git a/src/box-command.js b/src/box-command.js index 70219366..9c66ae1a 100644 --- a/src/box-command.js +++ b/src/box-command.js @@ -256,7 +256,7 @@ function formatObject(obj) { let outputData = formatObjectKeys(obj); // Other objects are formatted as YAML for human-readable output - let yamlString = yaml.safeDump(outputData, { + let yamlString = yaml.dump(outputData, { indent: 4, noRefs: true, }); diff --git a/test/fixtures/output/files_share_yaml.txt b/test/fixtures/output/files_share_yaml.txt index 765d9ed3..f2177a29 100644 --- a/test/fixtures/output/files_share_yaml.txt +++ b/test/fixtures/output/files_share_yaml.txt @@ -1,10 +1,10 @@ Type: file ID: '1234567890' Shared Link: - URL: 'https://blosserdemoaccount.box.com/s/7mcmdlavtye5o5i0ue8xmtwh2sx5bv8p' + URL: https://blosserdemoaccount.box.com/s/7mcmdlavtye5o5i0ue8xmtwh2sx5bv8p Download URL: >- https://blosserdemoaccount.box.com/shared/static/7mcmdlavtye5o5i0ue8xmtwh2sx5bv8p.png - Vanity URL: 'https://app.box.com/v/my-custom-name-123' + Vanity URL: https://app.box.com/v/my-custom-name-123 Effective Access: open Is Password Enabled: true Unshared At: null diff --git a/test/fixtures/output/files_upload_yaml.txt b/test/fixtures/output/files_upload_yaml.txt index d852285b..c2ad7cae 100644 --- a/test/fixtures/output/files_upload_yaml.txt +++ b/test/fixtures/output/files_upload_yaml.txt @@ -2,7 +2,7 @@ Type: file ID: '1234567890' File Version: Type: file_version - ID: 098765432109 + ID: '098765432109' SHA1: 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33 Sequence ID: '0' ETag: '0' diff --git a/test/fixtures/output/files_versions_upload_yaml.txt b/test/fixtures/output/files_versions_upload_yaml.txt index d852285b..c2ad7cae 100644 --- a/test/fixtures/output/files_versions_upload_yaml.txt +++ b/test/fixtures/output/files_versions_upload_yaml.txt @@ -2,7 +2,7 @@ Type: file ID: '1234567890' File Version: Type: file_version - ID: 098765432109 + ID: '098765432109' SHA1: 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33 Sequence ID: '0' ETag: '0' diff --git a/test/fixtures/output/folders_share_yaml.txt b/test/fixtures/output/folders_share_yaml.txt index f497deb2..dcb0fc33 100644 --- a/test/fixtures/output/folders_share_yaml.txt +++ b/test/fixtures/output/folders_share_yaml.txt @@ -1,10 +1,10 @@ Type: folder ID: '0' Shared Link: - URL: 'https://blosserdemoaccount.box.com/s/7mcmdlavtye5o5i0ue8xmtwh2sx5bv8p' + URL: https://blosserdemoaccount.box.com/s/7mcmdlavtye5o5i0ue8xmtwh2sx5bv8p Download URL: >- https://blosserdemoaccount.box.com/shared/static/7mcmdlavtye5o5i0ue8xmtwh2sx5bv8p.png - Vanity URL: 'https://app.box.com/v/my-custom-name-123' + Vanity URL: https://app.box.com/v/my-custom-name-123 Effective Access: open Is Password Enabled: true Unshared At: null diff --git a/test/fixtures/output/users_create_yaml.txt b/test/fixtures/output/users_create_yaml.txt index fbfccafa..3106a358 100644 --- a/test/fixtures/output/users_create_yaml.txt +++ b/test/fixtures/output/users_create_yaml.txt @@ -13,4 +13,4 @@ Status: active Job Title: '' Phone: '1234567890' Address: '' -Avatar URL: 'https://app.box.com/api/avatar/large/deprecated' +Avatar URL: https://app.box.com/api/avatar/large/deprecated diff --git a/test/fixtures/output/users_get_yaml.txt b/test/fixtures/output/users_get_yaml.txt index eac2586d..82e9e09b 100644 --- a/test/fixtures/output/users_get_yaml.txt +++ b/test/fixtures/output/users_get_yaml.txt @@ -13,4 +13,4 @@ Status: active Job Title: '' Phone: 555-555-5555 Address: '' -Avatar URL: 'https://app.box.com/api/avatar/large/deprecated' +Avatar URL: https://app.box.com/api/avatar/large/deprecated diff --git a/test/fixtures/output/users_invite_user_yaml.txt b/test/fixtures/output/users_invite_user_yaml.txt index eac2586d..82e9e09b 100644 --- a/test/fixtures/output/users_invite_user_yaml.txt +++ b/test/fixtures/output/users_invite_user_yaml.txt @@ -13,4 +13,4 @@ Status: active Job Title: '' Phone: 555-555-5555 Address: '' -Avatar URL: 'https://app.box.com/api/avatar/large/deprecated' +Avatar URL: https://app.box.com/api/avatar/large/deprecated diff --git a/test/fixtures/output/users_update_yaml.txt b/test/fixtures/output/users_update_yaml.txt index e63689a2..82731409 100644 --- a/test/fixtures/output/users_update_yaml.txt +++ b/test/fixtures/output/users_update_yaml.txt @@ -13,4 +13,4 @@ Status: active Job Title: CEO Phone: (555) 555-5555 Address: '' -Avatar URL: 'https://app.box.com/api/avatar/large/deprecated' +Avatar URL: https://app.box.com/api/avatar/large/deprecated diff --git a/test/fixtures/output/web_links_create_yaml.txt b/test/fixtures/output/web_links_create_yaml.txt index c4e5ef1d..fb65cdb4 100644 --- a/test/fixtures/output/web_links_create_yaml.txt +++ b/test/fixtures/output/web_links_create_yaml.txt @@ -3,7 +3,7 @@ ID: '6743065' Sequence ID: '0' ETag: '0' Name: Box Website! -URL: 'https://www.box.com' +URL: https://www.box.com Created By: Type: user ID: '10523870' diff --git a/test/fixtures/output/web_links_get_yaml.txt b/test/fixtures/output/web_links_get_yaml.txt index 19656316..526a8ef8 100644 --- a/test/fixtures/output/web_links_get_yaml.txt +++ b/test/fixtures/output/web_links_get_yaml.txt @@ -3,7 +3,7 @@ ID: '6742981' Sequence ID: '0' ETag: '0' Name: Box Website -URL: 'https://www.box.com' +URL: https://www.box.com Created By: Type: user ID: '10523870' diff --git a/test/fixtures/output/web_links_move_yaml.txt b/test/fixtures/output/web_links_move_yaml.txt index 590d4cb1..77e8fc08 100644 --- a/test/fixtures/output/web_links_move_yaml.txt +++ b/test/fixtures/output/web_links_move_yaml.txt @@ -3,7 +3,7 @@ ID: '6742981' Sequence ID: '2' ETag: '2' Name: Box Marketing Web Page -URL: 'https://www.box.com' +URL: https://www.box.com Created By: Type: user ID: '10523870' diff --git a/test/fixtures/output/web_links_update_yaml.txt b/test/fixtures/output/web_links_update_yaml.txt index 590d4cb1..77e8fc08 100644 --- a/test/fixtures/output/web_links_update_yaml.txt +++ b/test/fixtures/output/web_links_update_yaml.txt @@ -3,7 +3,7 @@ ID: '6742981' Sequence ID: '2' ETag: '2' Name: Box Marketing Web Page -URL: 'https://www.box.com' +URL: https://www.box.com Created By: Type: user ID: '10523870' diff --git a/test/fixtures/output/webhooks_create_yaml.txt b/test/fixtures/output/webhooks_create_yaml.txt index 03b12a8a..79250a7e 100644 --- a/test/fixtures/output/webhooks_create_yaml.txt +++ b/test/fixtures/output/webhooks_create_yaml.txt @@ -9,7 +9,7 @@ Created By: Name: John Q. Developer Login: johnq@dev.name Created At: '2016-05-09T17:41:27-07:00' -Address: 'https://dev.name/actions/file_changed' +Address: https://dev.name/actions/file_changed Triggers: - FILE.DOWNLOADED - FILE.UPLOADED diff --git a/test/fixtures/output/webhooks_get_yaml.txt b/test/fixtures/output/webhooks_get_yaml.txt index b89b7af5..5231338c 100644 --- a/test/fixtures/output/webhooks_get_yaml.txt +++ b/test/fixtures/output/webhooks_get_yaml.txt @@ -9,6 +9,6 @@ Created By: Name: John Q. Developer Login: johnq@example.net Created At: '2016-05-04T18:51:45-07:00' -Address: 'https://example.net/actions/file_changed' +Address: https://example.net/actions/file_changed Triggers: - FILE.PREVIEWED diff --git a/test/fixtures/output/webhooks_update_yaml.txt b/test/fixtures/output/webhooks_update_yaml.txt index 03b12a8a..79250a7e 100644 --- a/test/fixtures/output/webhooks_update_yaml.txt +++ b/test/fixtures/output/webhooks_update_yaml.txt @@ -9,7 +9,7 @@ Created By: Name: John Q. Developer Login: johnq@dev.name Created At: '2016-05-09T17:41:27-07:00' -Address: 'https://dev.name/actions/file_changed' +Address: https://dev.name/actions/file_changed Triggers: - FILE.DOWNLOADED - FILE.UPLOADED