From 8ccfac1a2d8e7f03c274e8d2a316c89123ed5eb2 Mon Sep 17 00:00:00 2001 From: Nasir Ahmed Raffick Date: Wed, 17 Jul 2019 13:42:06 -0400 Subject: [PATCH 1/4] Made code fixes after suggestions in DEVPOPS-846 ticket --- src/cli-main.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/cli-main.ts b/src/cli-main.ts index d1bfbedea..8881e5323 100644 --- a/src/cli-main.ts +++ b/src/cli-main.ts @@ -949,7 +949,7 @@ async function pushEdgeWorkerToSandbox(sandboxId, edgeworkerId, edgeworkerTarbal program .command('add-edgeworker ') - .description('add edgeworker to the currently active sandbox') + .description('Add edgeworker to the currently active sandbox. The edgeworker-id must be an unsigned integer.') .action(async function(edgeworkerId, edgeworkerTarballPath, options) { helpExitOnNoArgs(options); addOrUpdateEdgeWorker(edgeworkerId, edgeworkerTarballPath, 'add'); @@ -957,7 +957,7 @@ program program .command('update-edgeworker ') - .description('update edgeworker to the currently active sandbox') + .description('Update edgeworker to the currently active sandbox') .action(async function(edgeworkerId, edgeworkerTarballPath, options) { helpExitOnNoArgs(options); addOrUpdateEdgeWorker(edgeworkerId, edgeworkerTarballPath, 'update'); @@ -970,6 +970,10 @@ async function addOrUpdateEdgeWorker(edgeworkerId, edgeworkerTarballPath, action if (!sandboxId) { logAndExit('Unable to determine sandbox_id'); } + + if(!fs.existsSync(edgeworkerTarballPath)) { + logAndExit(`Provided edgeworker tarball path ${edgeworkerTarballPath} not found.`); + } let buffer = fs.readFileSync(edgeworkerTarballPath); let hex = buffer.toString('hex'); await pushEdgeWorkerToSandbox(sandboxId, edgeworkerId, edgeworkerTarballPath, action); @@ -1002,7 +1006,7 @@ async function makeFileForEdgeworker(edgeworkerId, hexFile) { program .command('download-edgeworker ') - .description('download edgeworker for the currently active sandbox') + .description('Download edgeworker for the currently active sandbox') .action(async function(edgeworkerId, options) { helpExitOnNoArgs(options); try { @@ -1030,14 +1034,14 @@ async function deleteEdgeWorkerFromSandbox(sandboxId, edgeworkerId) { program .command('delete-edgeworker ') - .description('delete edgeworker for the currently active sandbox') + .description('Delete edgeworker for the currently active sandbox') .action(async function(edgeworkerId, options) { helpExitOnNoArgs(options); try { let sandboxId = sandboxClientManager.getCurrentSandboxId(); if (!await cliUtils.confirm( - `are you sure you want to delete the edgeworker with id: ${edgeworkerId} for the currently active sandbox from the server : ${sandboxId}?`)) { + `Are you sure you want to delete the edgeworker with id: ${edgeworkerId} for the currently active sandbox : ${sandboxId} `)) { return; } if (!sandboxId) { From 0ab31f25ce8aa6c0bb4aa98a51b18cd53c9e96ab Mon Sep 17 00:00:00 2001 From: Nasir Ahmed Raffick Date: Mon, 9 Dec 2019 13:10:01 -0500 Subject: [PATCH 2/4] 1. Added new command sync-sandbox and code to fetch and create a sandbox instance locally from the remote 2. Added new library jwt-decode to decode jwtTokens --- package-lock.json | 559 +++++++++++++------------- package.json | 3 +- src/cli-main.ts | 39 ++ src/service/sandbox-client-manager.ts | 5 + src/service/sandbox-svc.ts | 5 +- 5 files changed, 332 insertions(+), 279 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8b1132d87..366186c8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "integrity": "sha1-7is7jqoRwJOCiZU2BrdFtzjFSx4=", "dev": true, "requires": { - "@types/node": "*" + "@types/node": "9.6.48" } }, "@types/lodash": { @@ -42,10 +42,10 @@ "integrity": "sha1-5ALWkapmcPu/8ZV7FfEnAjCrQvo=", "dev": true, "requires": { - "@types/caseless": "*", - "@types/form-data": "*", - "@types/node": "*", - "@types/tough-cookie": "*" + "@types/caseless": "0.12.2", + "@types/form-data": "2.2.1", + "@types/node": "9.6.48", + "@types/tough-cookie": "2.3.5" } }, "@types/tough-cookie": { @@ -59,10 +59,10 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/ajv/-/ajv-6.6.2.tgz", "integrity": "sha1-ys7M9HS/P8POOxR0Q3EaJAY8ww0=", "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "fast-deep-equal": "2.0.1", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.4.1", + "uri-js": "4.2.2" } }, "ansi-escapes": { @@ -80,7 +80,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", "requires": { - "color-convert": "^1.9.0" + "color-convert": "1.9.3" } }, "app-root-path": { @@ -93,7 +93,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/archive-type/-/archive-type-4.0.0.tgz", "integrity": "sha1-+S5yIzBW38aWlHJ0nCZ72wRrHXA=", "requires": { - "file-type": "^4.2.0" + "file-type": "4.4.0" }, "dependencies": { "file-type": { @@ -108,7 +108,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/asn1/-/asn1-0.2.4.tgz", "integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=", "requires": { - "safer-buffer": "~2.1.0" + "safer-buffer": "2.1.2" } }, "assert-plus": { @@ -146,7 +146,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "requires": { - "tweetnacl": "^0.14.3" + "tweetnacl": "0.14.5" } }, "big-integer": { @@ -159,8 +159,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/binary/-/binary-0.3.0.tgz", "integrity": "sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=", "requires": { - "buffers": "~0.1.1", - "chainsaw": "~0.1.0" + "buffers": "0.1.1", + "chainsaw": "0.1.0" } }, "bl": { @@ -168,8 +168,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/bl/-/bl-1.2.2.tgz", "integrity": "sha1-oWCRFxcQPAdBDO9j71Gzl8Alr5w=", "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" + "readable-stream": "2.3.6", + "safe-buffer": "5.1.2" } }, "bluebird": { @@ -182,7 +182,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", "requires": { - "balanced-match": "^1.0.0", + "balanced-match": "1.0.0", "concat-map": "0.0.1" } }, @@ -192,8 +192,8 @@ "integrity": "sha1-pyyTb3e5a/UvX357RnGAYoVR3vs=", "requires": { "base64-js": "0.0.8", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" + "ieee754": "1.1.12", + "isarray": "1.0.0" } }, "buffer-alloc": { @@ -201,8 +201,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/buffer-alloc/-/buffer-alloc-1.2.0.tgz", "integrity": "sha1-iQ3ZDZI6hz4I4Q5f1RpX5bfM4Ow=", "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" + "buffer-alloc-unsafe": "1.1.0", + "buffer-fill": "1.0.0" } }, "buffer-alloc-unsafe": { @@ -261,10 +261,10 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/caw/-/caw-2.0.1.tgz", "integrity": "sha1-bDygcfwZRyCIPC3F2psHS/x+npU=", "requires": { - "get-proxy": "^2.0.0", - "isurl": "^1.0.0-alpha5", - "tunnel-agent": "^0.6.0", - "url-to-options": "^1.0.1" + "get-proxy": "2.1.0", + "isurl": "1.0.0", + "tunnel-agent": "0.6.0", + "url-to-options": "1.0.1" } }, "chainsaw": { @@ -272,7 +272,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/chainsaw/-/chainsaw-0.1.0.tgz", "integrity": "sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=", "requires": { - "traverse": ">=0.3.0 <0.4" + "traverse": "0.3.9" } }, "chalk": { @@ -280,9 +280,9 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/chalk/-/chalk-2.4.1.tgz", "integrity": "sha1-GMSasWoDe26wFSzIPjRxM4IVtm4=", "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.5.0" } }, "chardet": { @@ -295,7 +295,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/cli-cursor/-/cli-cursor-2.1.0.tgz", "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "requires": { - "restore-cursor": "^2.0.0" + "restore-cursor": "2.0.0" } }, "cli-spinner": { @@ -319,7 +319,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/clone-response/-/clone-response-1.0.2.tgz", "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", "requires": { - "mimic-response": "^1.0.0" + "mimic-response": "1.0.1" } }, "color-convert": { @@ -340,7 +340,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/combined-stream/-/combined-stream-1.0.7.tgz", "integrity": "sha1-LR0kMXr7ir6V1tLAsHtXgTU52Cg=", "requires": { - "delayed-stream": "~1.0.0" + "delayed-stream": "1.0.0" } }, "commander": { @@ -358,8 +358,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/config-chain/-/config-chain-1.1.12.tgz", "integrity": "sha1-D96NCRIA616AjK8l/mGMAvSOTvo=", "requires": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" + "ini": "1.3.5", + "proto-list": "1.2.4" } }, "console.table": { @@ -385,7 +385,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { - "assert-plus": "^1.0.0" + "assert-plus": "1.0.0" } }, "decode-uri-component": { @@ -398,14 +398,14 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/decompress/-/decompress-4.2.0.tgz", "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=", "requires": { - "decompress-tar": "^4.0.0", - "decompress-tarbz2": "^4.0.0", - "decompress-targz": "^4.0.0", - "decompress-unzip": "^4.0.1", - "graceful-fs": "^4.1.10", - "make-dir": "^1.0.0", - "pify": "^2.3.0", - "strip-dirs": "^2.0.0" + "decompress-tar": "4.1.1", + "decompress-tarbz2": "4.1.1", + "decompress-targz": "4.1.1", + "decompress-unzip": "4.0.1", + "graceful-fs": "4.1.11", + "make-dir": "1.3.0", + "pify": "2.3.0", + "strip-dirs": "2.1.0" }, "dependencies": { "pify": { @@ -420,7 +420,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/decompress-response/-/decompress-response-3.3.0.tgz", "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", "requires": { - "mimic-response": "^1.0.0" + "mimic-response": "1.0.1" } }, "decompress-tar": { @@ -428,9 +428,9 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/decompress-tar/-/decompress-tar-4.1.1.tgz", "integrity": "sha1-cYy9P8sWIJcW5womuE57pFkuWvE=", "requires": { - "file-type": "^5.2.0", - "is-stream": "^1.1.0", - "tar-stream": "^1.5.2" + "file-type": "5.2.0", + "is-stream": "1.1.0", + "tar-stream": "1.6.2" }, "dependencies": { "file-type": { @@ -445,11 +445,11 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", "integrity": "sha1-MIKluIDqQEOBY0nzeLVsUWvho5s=", "requires": { - "decompress-tar": "^4.1.0", - "file-type": "^6.1.0", - "is-stream": "^1.1.0", - "seek-bzip": "^1.0.5", - "unbzip2-stream": "^1.0.9" + "decompress-tar": "4.1.1", + "file-type": "6.2.0", + "is-stream": "1.1.0", + "seek-bzip": "1.0.5", + "unbzip2-stream": "1.3.1" }, "dependencies": { "file-type": { @@ -464,9 +464,9 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/decompress-targz/-/decompress-targz-4.1.1.tgz", "integrity": "sha1-wJvDXE0R894J8tLaU+neI+fOHu4=", "requires": { - "decompress-tar": "^4.1.1", - "file-type": "^5.2.0", - "is-stream": "^1.1.0" + "decompress-tar": "4.1.1", + "file-type": "5.2.0", + "is-stream": "1.1.0" }, "dependencies": { "file-type": { @@ -481,10 +481,10 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/decompress-unzip/-/decompress-unzip-4.0.1.tgz", "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", "requires": { - "file-type": "^3.8.0", - "get-stream": "^2.2.0", - "pify": "^2.3.0", - "yauzl": "^2.4.2" + "file-type": "3.9.0", + "get-stream": "2.3.1", + "pify": "2.3.0", + "yauzl": "2.10.0" }, "dependencies": { "file-type": { @@ -497,8 +497,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/get-stream/-/get-stream-2.3.1.tgz", "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", "requires": { - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" + "object-assign": "4.1.1", + "pinkie-promise": "2.0.1" } }, "pify": { @@ -514,7 +514,7 @@ "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", "optional": true, "requires": { - "clone": "^1.0.2" + "clone": "1.0.4" } }, "delayed-stream": { @@ -527,18 +527,18 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/download/-/download-7.1.0.tgz", "integrity": "sha1-kFmqnXC1A+52oTKJe+beyOVYcjM=", "requires": { - "archive-type": "^4.0.0", - "caw": "^2.0.1", - "content-disposition": "^0.5.2", - "decompress": "^4.2.0", - "ext-name": "^5.0.0", - "file-type": "^8.1.0", - "filenamify": "^2.0.0", - "get-stream": "^3.0.0", - "got": "^8.3.1", - "make-dir": "^1.2.0", - "p-event": "^2.1.0", - "pify": "^3.0.0" + "archive-type": "4.0.0", + "caw": "2.0.1", + "content-disposition": "0.5.2", + "decompress": "4.2.0", + "ext-name": "5.0.0", + "file-type": "8.1.0", + "filenamify": "2.1.0", + "get-stream": "3.0.0", + "got": "8.3.2", + "make-dir": "1.3.0", + "p-event": "2.1.0", + "pify": "3.0.0" } }, "duplexer2": { @@ -546,7 +546,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/duplexer2/-/duplexer2-0.1.4.tgz", "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", "requires": { - "readable-stream": "^2.0.2" + "readable-stream": "2.3.6" } }, "duplexer3": { @@ -559,7 +559,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/easy-table/-/easy-table-1.1.0.tgz", "integrity": "sha1-hvmrTBAvA3G3KXuSplHVgkvIy3M=", "requires": { - "wcwidth": ">=1.0.1" + "wcwidth": "1.0.1" } }, "ecc-jsbn": { @@ -567,8 +567,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" + "jsbn": "0.1.1", + "safer-buffer": "2.1.2" } }, "edgegrid": { @@ -576,10 +576,10 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/edgegrid/-/edgegrid-3.0.5.tgz", "integrity": "sha1-wh9zS8Pz5SR4PLwvcU/Tix/74Hk=", "requires": { - "log4js": "^0.6.14", - "moment": "^2.22.2", - "request": "^2.88.0", - "uuid": "^3.0.0" + "log4js": "0.6.38", + "moment": "2.23.0", + "request": "2.88.0", + "uuid": "3.3.2" } }, "end-of-stream": { @@ -587,7 +587,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha1-7SljTRm6ukY7bOa4CjchPqtx7EM=", "requires": { - "once": "^1.4.0" + "once": "1.4.0" } }, "escape-string-regexp": { @@ -600,7 +600,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/ext-list/-/ext-list-2.2.2.tgz", "integrity": "sha1-C5jmTtgvWs8PKTG6v2khLvUt3Tc=", "requires": { - "mime-db": "^1.28.0" + "mime-db": "1.36.0" } }, "ext-name": { @@ -608,8 +608,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/ext-name/-/ext-name-5.0.0.tgz", "integrity": "sha1-cHgZgdGD7hXROZPIgiBFxQbI8KY=", "requires": { - "ext-list": "^2.0.0", - "sort-keys-length": "^1.0.0" + "ext-list": "2.2.2", + "sort-keys-length": "1.0.1" } }, "extend": { @@ -622,9 +622,9 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/external-editor/-/external-editor-3.0.3.tgz", "integrity": "sha1-WGbbKal4Jtvkvzr9JAcOrZ6kOic=", "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" + "chardet": "0.7.0", + "iconv-lite": "0.4.24", + "tmp": "0.0.33" } }, "extsprintf": { @@ -647,7 +647,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", "requires": { - "pend": "~1.2.0" + "pend": "1.2.0" } }, "figures": { @@ -655,7 +655,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/figures/-/figures-2.0.0.tgz", "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "requires": { - "escape-string-regexp": "^1.0.5" + "escape-string-regexp": "1.0.5" } }, "file-type": { @@ -673,9 +673,9 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/filenamify/-/filenamify-2.1.0.tgz", "integrity": "sha1-iPr0lfsbR6v9YSMAACoWIoxnfuk=", "requires": { - "filename-reserved-regex": "^2.0.0", - "strip-outer": "^1.0.0", - "trim-repeated": "^1.0.0" + "filename-reserved-regex": "2.0.0", + "strip-outer": "1.0.1", + "trim-repeated": "1.0.0" } }, "find-java-home": { @@ -683,8 +683,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/find-java-home/-/find-java-home-0.2.0.tgz", "integrity": "sha1-XFALutMBiDKruYhvfQ8D9XFGzdw=", "requires": { - "which": "~1.0.5", - "winreg": "~1.2.2" + "which": "1.0.9", + "winreg": "1.2.4" } }, "forever-agent": { @@ -697,9 +697,9 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/form-data/-/form-data-2.3.3.tgz", "integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=", "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" + "asynckit": "0.4.0", + "combined-stream": "1.0.7", + "mime-types": "2.1.21" } }, "from2": { @@ -707,8 +707,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/from2/-/from2-2.3.0.tgz", "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" + "inherits": "2.0.3", + "readable-stream": "2.3.6" } }, "fs-constants": { @@ -721,9 +721,9 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/fs-extra/-/fs-extra-7.0.0.tgz", "integrity": "sha1-jMP0fOB+97NZOhG5+yRffjTAQdY=", "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "graceful-fs": "4.1.11", + "jsonfile": "4.0.0", + "universalify": "0.1.2" } }, "fs.realpath": { @@ -736,10 +736,10 @@ "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.3" } }, "get-proxy": { @@ -747,7 +747,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/get-proxy/-/get-proxy-2.1.0.tgz", "integrity": "sha1-NJ8rTZHUTE1NTpy6KtkBQ/rF75M=", "requires": { - "npm-conf": "^1.1.0" + "npm-conf": "1.1.3" } }, "get-stream": { @@ -760,7 +760,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { - "assert-plus": "^1.0.0" + "assert-plus": "1.0.0" } }, "glob": { @@ -768,12 +768,12 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/glob/-/glob-7.1.3.tgz", "integrity": "sha1-OWCDLT8VdBCDQtr9OmezMsCWnfE=", "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, "got": { @@ -781,23 +781,23 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/got/-/got-8.3.2.tgz", "integrity": "sha1-HSP2Q5Dpf3dsrFLluTbl9RTS6Tc=", "requires": { - "@sindresorhus/is": "^0.7.0", - "cacheable-request": "^2.1.1", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "into-stream": "^3.1.0", - "is-retry-allowed": "^1.1.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "mimic-response": "^1.0.0", - "p-cancelable": "^0.4.0", - "p-timeout": "^2.0.1", - "pify": "^3.0.0", - "safe-buffer": "^5.1.1", - "timed-out": "^4.0.1", - "url-parse-lax": "^3.0.0", - "url-to-options": "^1.0.1" + "@sindresorhus/is": "0.7.0", + "cacheable-request": "2.1.4", + "decompress-response": "3.3.0", + "duplexer3": "0.1.4", + "get-stream": "3.0.0", + "into-stream": "3.1.0", + "is-retry-allowed": "1.1.0", + "isurl": "1.0.0", + "lowercase-keys": "1.0.1", + "mimic-response": "1.0.1", + "p-cancelable": "0.4.1", + "p-timeout": "2.0.1", + "pify": "3.0.0", + "safe-buffer": "5.1.2", + "timed-out": "4.0.1", + "url-parse-lax": "3.0.0", + "url-to-options": "1.0.1" } }, "graceful-fs": { @@ -820,8 +820,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/har-validator/-/har-validator-5.1.3.tgz", "integrity": "sha1-HvievT5JllV2de7ZiTEQ3DUPoIA=", "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" + "ajv": "6.6.2", + "har-schema": "2.0.0" } }, "has-flag": { @@ -839,7 +839,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", "integrity": "sha1-oEWrOD17SyASoAFIqwql8pAETU0=", "requires": { - "has-symbol-support-x": "^1.4.1" + "has-symbol-support-x": "1.4.2" } }, "http-cache-semantics": { @@ -852,9 +852,9 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.16.0" } }, "iconv-lite": { @@ -862,7 +862,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "safer-buffer": "2.1.2" } }, "ieee754": { @@ -875,8 +875,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { - "once": "^1.3.0", - "wrappy": "1" + "once": "1.4.0", + "wrappy": "1.0.2" } }, "inherits": { @@ -894,19 +894,19 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/inquirer/-/inquirer-6.2.0.tgz", "integrity": "sha1-Ua3Nd29mE2ncHolIWcJWCiJKvdg=", "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.0", - "figures": "^2.0.0", - "lodash": "^4.17.10", + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "3.0.3", + "figures": "2.0.0", + "lodash": "4.17.11", "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.1.0", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", - "through": "^2.3.6" + "run-async": "2.3.0", + "rxjs": "6.3.3", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" } }, "interpret": { @@ -919,8 +919,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/into-stream/-/into-stream-3.1.0.tgz", "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", "requires": { - "from2": "^2.1.1", - "p-is-promise": "^1.1.0" + "from2": "2.3.0", + "p-is-promise": "1.1.0" } }, "is-fullwidth-code-point": { @@ -978,8 +978,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/isurl/-/isurl-1.0.0.tgz", "integrity": "sha1-sn9PSfPNqj6kSgpbfzRi5u3DnWc=", "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" + "has-to-string-tag-x": "1.4.1", + "is-object": "1.0.1" } }, "jsbn": { @@ -1012,7 +1012,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "requires": { - "graceful-fs": "^4.1.6" + "graceful-fs": "4.1.11" } }, "jsonschema": { @@ -1031,6 +1031,11 @@ "verror": "1.10.0" } }, + "jwt-decode": { + "version": "2.2.0", + "resolved": "https://npm.repos.akamai.com:443/api/npm/npmjs-repos/jwt-decode/-/jwt-decode-2.2.0.tgz", + "integrity": "sha1-fYa9VmefWM5qhHBKZX3TkruoGnk=" + }, "keyv": { "version": "3.0.0", "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/keyv/-/keyv-3.0.0.tgz", @@ -1054,8 +1059,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/log4js/-/log4js-0.6.38.tgz", "integrity": "sha1-LElBFmldb7JUgJQ9P8hy5mKlIv0=", "requires": { - "readable-stream": "~1.0.2", - "semver": "~4.3.3" + "readable-stream": "1.0.34", + "semver": "4.3.6" }, "dependencies": { "isarray": { @@ -1068,10 +1073,10 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", + "core-util-is": "1.0.2", + "inherits": "2.0.3", "isarray": "0.0.1", - "string_decoder": "~0.10.x" + "string_decoder": "0.10.31" } }, "string_decoder": { @@ -1091,7 +1096,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/make-dir/-/make-dir-1.3.0.tgz", "integrity": "sha1-ecEDO4BRW9bSTsmTPoYMp17ifww=", "requires": { - "pify": "^3.0.0" + "pify": "3.0.0" } }, "mime-db": { @@ -1104,7 +1109,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/mime-types/-/mime-types-2.1.21.tgz", "integrity": "sha1-KJlaoey3cHQv5q5+WPkYHHRLP5Y=", "requires": { - "mime-db": "~1.37.0" + "mime-db": "1.37.0" }, "dependencies": { "mime-db": { @@ -1129,7 +1134,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -1160,9 +1165,9 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/normalize-url/-/normalize-url-2.0.1.tgz", "integrity": "sha1-g1qdoVUfom9w6SMpBpojqmV01+Y=", "requires": { - "prepend-http": "^2.0.0", - "query-string": "^5.0.1", - "sort-keys": "^2.0.0" + "prepend-http": "2.0.0", + "query-string": "5.1.1", + "sort-keys": "2.0.0" }, "dependencies": { "sort-keys": { @@ -1170,7 +1175,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/sort-keys/-/sort-keys-2.0.0.tgz", "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", "requires": { - "is-plain-obj": "^1.0.0" + "is-plain-obj": "1.1.0" } } } @@ -1180,8 +1185,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/npm-conf/-/npm-conf-1.1.3.tgz", "integrity": "sha1-JWzEe9DiGMJZxOlVC/QTvCGSr/k=", "requires": { - "config-chain": "^1.1.11", - "pify": "^3.0.0" + "config-chain": "1.1.12", + "pify": "3.0.0" } }, "oauth-sign": { @@ -1199,7 +1204,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "wrappy": "1" + "wrappy": "1.0.2" } }, "onetime": { @@ -1207,7 +1212,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/onetime/-/onetime-2.0.1.tgz", "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "requires": { - "mimic-fn": "^1.0.0" + "mimic-fn": "1.2.0" } }, "os-tmpdir": { @@ -1225,7 +1230,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/p-event/-/p-event-2.1.0.tgz", "integrity": "sha1-dN5Hek5rOqgmckDHCZ54rFLLTbQ=", "requires": { - "p-timeout": "^2.0.1" + "p-timeout": "2.0.1" } }, "p-finally": { @@ -1243,7 +1248,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/p-timeout/-/p-timeout-2.0.1.tgz", "integrity": "sha1-2N0ZeVldLcATnh/ka4tkbLPN8Dg=", "requires": { - "p-finally": "^1.0.0" + "p-finally": "1.0.0" } }, "path-is-absolute": { @@ -1281,7 +1286,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "requires": { - "pinkie": "^2.0.0" + "pinkie": "2.0.4" } }, "prepend-http": { @@ -1319,9 +1324,9 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/query-string/-/query-string-5.1.1.tgz", "integrity": "sha1-p4wBK3HBfgXy4/ojGd0zBoLvs8s=", "requires": { - "decode-uri-component": "^0.2.0", - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" + "decode-uri-component": "0.2.0", + "object-assign": "4.1.1", + "strict-uri-encode": "1.1.0" } }, "readable-stream": { @@ -1329,13 +1334,13 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha1-sRwn2IuP8fvgcGQ8+UsMea4bCq8=", "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" } }, "rechoir": { @@ -1343,7 +1348,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "requires": { - "resolve": "^1.1.6" + "resolve": "1.8.1" } }, "request": { @@ -1351,26 +1356,26 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/request/-/request-2.88.0.tgz", "integrity": "sha1-nC/KT301tZLv5Xx/ClXoEFIST+8=", "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" + "aws-sign2": "0.7.0", + "aws4": "1.8.0", + "caseless": "0.12.0", + "combined-stream": "1.0.7", + "extend": "3.0.2", + "forever-agent": "0.6.1", + "form-data": "2.3.3", + "har-validator": "5.1.3", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.21", + "oauth-sign": "0.9.0", + "performance-now": "2.1.0", + "qs": "6.5.2", + "safe-buffer": "5.1.2", + "tough-cookie": "2.4.3", + "tunnel-agent": "0.6.0", + "uuid": "3.3.2" } }, "resolve": { @@ -1378,7 +1383,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/resolve/-/resolve-1.8.1.tgz", "integrity": "sha1-gvHsGaQjrB+9CAsLqwa6NuhKeiY=", "requires": { - "path-parse": "^1.0.5" + "path-parse": "1.0.6" } }, "responselike": { @@ -1386,7 +1391,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/responselike/-/responselike-1.0.2.tgz", "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", "requires": { - "lowercase-keys": "^1.0.0" + "lowercase-keys": "1.0.1" } }, "restore-cursor": { @@ -1394,8 +1399,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/restore-cursor/-/restore-cursor-2.0.0.tgz", "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" + "onetime": "2.0.1", + "signal-exit": "3.0.2" } }, "rimraf": { @@ -1403,7 +1408,7 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "requires": { - "glob": "^7.1.3" + "glob": "7.1.3" } }, "run-async": { @@ -1411,7 +1416,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/run-async/-/run-async-2.3.0.tgz", "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", "requires": { - "is-promise": "^2.1.0" + "is-promise": "2.1.0" } }, "rxjs": { @@ -1419,7 +1424,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/rxjs/-/rxjs-6.3.3.tgz", "integrity": "sha1-PGp/pCDoRKgTkPsRWKnsYU9LrVU=", "requires": { - "tslib": "^1.9.0" + "tslib": "1.9.3" } }, "safe-buffer": { @@ -1437,7 +1442,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/seek-bzip/-/seek-bzip-1.0.5.tgz", "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", "requires": { - "commander": "~2.8.1" + "commander": "2.8.1" }, "dependencies": { "commander": { @@ -1445,7 +1450,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/commander/-/commander-2.8.1.tgz", "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", "requires": { - "graceful-readlink": ">= 1.0.0" + "graceful-readlink": "1.0.1" } } } @@ -1465,9 +1470,9 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/shelljs/-/shelljs-0.8.2.tgz", "integrity": "sha1-NFt993Y/TCNA1YSrtTLF91LKnjU=", "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" + "glob": "7.1.3", + "interpret": "1.1.0", + "rechoir": "0.6.2" } }, "signal-exit": { @@ -1480,7 +1485,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/sort-keys/-/sort-keys-1.1.2.tgz", "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", "requires": { - "is-plain-obj": "^1.0.0" + "is-plain-obj": "1.1.0" } }, "sort-keys-length": { @@ -1488,7 +1493,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/sort-keys-length/-/sort-keys-length-1.0.1.tgz", "integrity": "sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg=", "requires": { - "sort-keys": "^1.0.0" + "sort-keys": "1.1.2" } }, "sshpk": { @@ -1496,15 +1501,15 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/sshpk/-/sshpk-1.16.0.tgz", "integrity": "sha1-HUljovv/5YBQqpCEyiC+gXQcB94=", "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" + "asn1": "0.2.4", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.2", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.2", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "safer-buffer": "2.1.2", + "tweetnacl": "0.14.5" } }, "strict-uri-encode": { @@ -1512,21 +1517,21 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" }, - "string-width": { - "version": "2.1.1", - "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, "string_decoder": { "version": "1.1.1", "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha1-nPFhG6YmhdcDCunkujQUnDrwP8g=", "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "5.1.2" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" } }, "strip-ansi": { @@ -1534,7 +1539,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "3.0.0" } }, "strip-dirs": { @@ -1542,7 +1547,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/strip-dirs/-/strip-dirs-2.1.0.tgz", "integrity": "sha1-SYdzYmT8NEzyD2w0rKnRPR1O1sU=", "requires": { - "is-natural-number": "^4.0.1" + "is-natural-number": "4.0.1" } }, "strip-outer": { @@ -1550,7 +1555,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/strip-outer/-/strip-outer-1.0.1.tgz", "integrity": "sha1-sv0qv2YEudHmATBXGV34Nrip1jE=", "requires": { - "escape-string-regexp": "^1.0.2" + "escape-string-regexp": "1.0.5" } }, "supports-color": { @@ -1558,7 +1563,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=", "requires": { - "has-flag": "^3.0.0" + "has-flag": "3.0.0" } }, "tar-stream": { @@ -1566,13 +1571,13 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/tar-stream/-/tar-stream-1.6.2.tgz", "integrity": "sha1-jqVdqzeXIlPZqa+Q/c1VmuQ1xVU=", "requires": { - "bl": "^1.0.0", - "buffer-alloc": "^1.2.0", - "end-of-stream": "^1.0.0", - "fs-constants": "^1.0.0", - "readable-stream": "^2.3.0", - "to-buffer": "^1.1.1", - "xtend": "^4.0.0" + "bl": "1.2.2", + "buffer-alloc": "1.2.0", + "end-of-stream": "1.4.1", + "fs-constants": "1.0.0", + "readable-stream": "2.3.6", + "to-buffer": "1.1.1", + "xtend": "4.0.1" } }, "through": { @@ -1590,7 +1595,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/tmp/-/tmp-0.0.33.tgz", "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=", "requires": { - "os-tmpdir": "~1.0.2" + "os-tmpdir": "1.0.2" } }, "to-buffer": { @@ -1603,8 +1608,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/tough-cookie/-/tough-cookie-2.4.3.tgz", "integrity": "sha1-U/Nto/R3g7CSWvoG/587FlKA94E=", "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" + "psl": "1.1.31", + "punycode": "1.4.1" }, "dependencies": { "punycode": { @@ -1624,7 +1629,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/trim-repeated/-/trim-repeated-1.0.0.tgz", "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=", "requires": { - "escape-string-regexp": "^1.0.2" + "escape-string-regexp": "1.0.5" } }, "tslib": { @@ -1637,7 +1642,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "safe-buffer": "^5.0.1" + "safe-buffer": "5.1.2" } }, "tweetnacl": { @@ -1656,8 +1661,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/unbzip2-stream/-/unbzip2-stream-1.3.1.tgz", "integrity": "sha1-eFTaUWIqfmNiQiEZY1eAO1UpZqE=", "requires": { - "buffer": "^3.0.1", - "through": "^2.3.6" + "buffer": "3.6.0", + "through": "2.3.8" } }, "universalify": { @@ -1675,15 +1680,15 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/unzipper/-/unzipper-0.9.3.tgz", "integrity": "sha1-HdBV/NompgaMBUS9zfbbzLmiMH4=", "requires": { - "big-integer": "^1.6.17", - "binary": "~0.3.0", - "bluebird": "~3.4.1", - "buffer-indexof-polyfill": "~1.0.0", - "duplexer2": "~0.1.4", - "fstream": "~1.0.10", - "listenercount": "~1.0.1", - "readable-stream": "~2.3.6", - "setimmediate": "~1.0.4" + "big-integer": "1.6.36", + "binary": "0.3.0", + "bluebird": "3.4.7", + "buffer-indexof-polyfill": "1.0.1", + "duplexer2": "0.1.4", + "fstream": "1.0.12", + "listenercount": "1.0.1", + "readable-stream": "2.3.6", + "setimmediate": "1.0.5" } }, "uri-js": { @@ -1691,7 +1696,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/uri-js/-/uri-js-4.2.2.tgz", "integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=", "requires": { - "punycode": "^2.1.0" + "punycode": "2.1.1" } }, "url-parse-lax": { @@ -1699,7 +1704,7 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/url-parse-lax/-/url-parse-lax-3.0.0.tgz", "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", "requires": { - "prepend-http": "^2.0.0" + "prepend-http": "2.0.0" } }, "url-to-options": { @@ -1727,9 +1732,9 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "assert-plus": "^1.0.0", + "assert-plus": "1.0.0", "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" + "extsprintf": "1.3.0" } }, "wcwidth": { @@ -1738,7 +1743,7 @@ "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", "optional": true, "requires": { - "defaults": "^1.0.3" + "defaults": "1.0.3" } }, "which": { @@ -1766,8 +1771,8 @@ "resolved": "https://repos.akamai.com:443/api/npm/npmjs-repos/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" + "buffer-crc32": "0.2.13", + "fd-slicer": "1.1.0" } } } diff --git a/package.json b/package.json index ab85d8fe4..4d297a76b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "akamai-sandbox-cli", - "version": "1.2.1", + "version": "1.2.2", "description": "A tool that makes it easier to manage Akamai Sandboxes. Call the Sandbox API from the command line.", "repository": "https://github.com/akamai/cli-sandbox", "scripts": { @@ -23,6 +23,7 @@ "fs-extra": "7.0.0", "inquirer": "6.2.0", "jsonschema": "1.2.4", + "jwt-decode": "^2.2.0", "lodash": "4.17.11", "shelljs": "0.8.2", "untildify": "3.0.3", diff --git a/src/cli-main.ts b/src/cli-main.ts index 8881e5323..f4bb6040d 100644 --- a/src/cli-main.ts +++ b/src/cli-main.ts @@ -3,7 +3,10 @@ import * as fs from 'fs'; import * as path from "path"; import * as os from "os"; + const uuidv1 = require('uuid/v1'); +const jwtDecode = require('jwt-decode'); + const CLI_CACHE_PATH = process.env.AKAMAI_CLI_CACHE_PATH; @@ -941,6 +944,42 @@ program } }); +// sync sandbox from remote using jwt +program + .command('sync-sandbox ') + .description('Sync down a remote sandbox to the local system') + .option('-n, --name ', 'Custom sandbox name for local system') + .action(async function(jwt, options) { + helpExitOnNoArgs(options); + try { + let sandboxName; + const decodedJwt :object= jwtDecode(jwt); + const sandboxId = decodedJwt[`sandboxID`]; + console.log(`Syncing sandbox with sandboxId : ${sandboxId}`); + if(isNonEmptyString(options.name)) { + sandboxName = options.name + } + else { + let sandbox = await sandboxSvc.getSandbox(sandboxId, true); + sandboxName = sandbox['name']; + console.log(`Fetched Sandbox Name : ${sandboxName} from the provided jwtToken`); + } + + const hasSandboxName = await sandboxClientManager.hasSandboxFolder(sandboxName); + if(!hasSandboxName) { + await registerSandbox(sandboxId, jwt, sandboxName); + } + else { + console.error(`Error: Sandbox folder name ${sandboxName} already exists locally. Please provide a different sandbox name for this local sandbox folder using option -n or --name.`) + } + } + catch(e) { + console.error(`Error syncing sandbox : ${e.message}`); + } + + }); + + async function pushEdgeWorkerToSandbox(sandboxId, edgeworkerId, edgeworkerTarballPath, action) { action = (action == 'add') ? 'adding' : 'updating'; const msg = `${action} edgeworker ${edgeworkerId} for: ${sandboxId} from ${edgeworkerTarballPath}`; diff --git a/src/service/sandbox-client-manager.ts b/src/service/sandbox-client-manager.ts index 53cf010cd..26ba2697d 100644 --- a/src/service/sandbox-client-manager.ts +++ b/src/service/sandbox-client-manager.ts @@ -217,6 +217,11 @@ export function hasCurrent() { return !!getCurrentSandboxId(); } +export async function hasSandboxFolder(sandboxName){ + const files = fs.readdirSync(SANDBOXES_DIR); + return files.some(fileItem => fileItem.toLowerCase() === sandboxName.toLowerCase()); +} + export async function executeSandboxClient() { var args = [ `"${await envUtils.getJavaExecutablePath()}"`, diff --git a/src/service/sandbox-svc.ts b/src/service/sandbox-svc.ts index 51cb340d1..aaa028651 100644 --- a/src/service/sandbox-svc.ts +++ b/src/service/sandbox-svc.ts @@ -132,7 +132,10 @@ export function getAllSandboxes() { }); } -export function getSandbox(sandboxId: string) { +export function getSandbox(sandboxId: string, accountWide=false) { + if(accountWide) { + return getJson(`${SANDBOX_API_BASE}/sandboxes/${sandboxId}?access=account`).then(r => r.body); + } return getJson(`${SANDBOX_API_BASE}/sandboxes/${sandboxId}`).then(r => r.body); } From 3479ac170fc51e609f3120ccb69ecb5365b238d4 Mon Sep 17 00:00:00 2001 From: Nasir Ahmed Raffick Date: Tue, 10 Dec 2019 11:43:35 -0500 Subject: [PATCH 3/4] Updated the message for sandbox name option --- cli.json | 2 +- src/cli-main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli.json b/cli.json index 8a7f9663b..6812169b2 100644 --- a/cli.json +++ b/cli.json @@ -5,7 +5,7 @@ "commands": [ { "name": "sandbox", - "version": "1.2.0", + "version": "1.2.2", "description": "Manage Akamai Sandbox environments.", "bin": "https://github.com/akamai/cli-sandbox/releases/download/{{.Version}}/akamai-{{.Name}}-{{.Version}}-{{.OS}}-{{.Arch}}{{.BinSuffix}}" } diff --git a/src/cli-main.ts b/src/cli-main.ts index f4bb6040d..196f2ed7e 100644 --- a/src/cli-main.ts +++ b/src/cli-main.ts @@ -948,7 +948,7 @@ program program .command('sync-sandbox ') .description('Sync down a remote sandbox to the local system') - .option('-n, --name ', 'Custom sandbox name for local system') + .option('-n, --name ', 'Recommended to use the sandbox name provided during creation. If sandbox folder name already exists locally, custom sandbox name can be provided.') .action(async function(jwt, options) { helpExitOnNoArgs(options); try { From f6fd0bc9251ecdcce778c7c57ee20f650de98846 Mon Sep 17 00:00:00 2001 From: Nasir Ahmed Raffick Date: Wed, 11 Dec 2019 15:24:57 -0500 Subject: [PATCH 4/4] Fixed bug that caused failure to fetch account wide sandboxes during register sandbox operation --- src/cli-main.ts | 4 +++- src/service/sandbox-svc.ts | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/cli-main.ts b/src/cli-main.ts index 196f2ed7e..c848fc508 100644 --- a/src/cli-main.ts +++ b/src/cli-main.ts @@ -951,6 +951,7 @@ program .option('-n, --name ', 'Recommended to use the sandbox name provided during creation. If sandbox folder name already exists locally, custom sandbox name can be provided.') .action(async function(jwt, options) { helpExitOnNoArgs(options); + sandboxSvc.setAccountWide(true); try { let sandboxName; const decodedJwt :object= jwtDecode(jwt); @@ -960,7 +961,7 @@ program sandboxName = options.name } else { - let sandbox = await sandboxSvc.getSandbox(sandboxId, true); + let sandbox = await sandboxSvc.getSandbox(sandboxId); sandboxName = sandbox['name']; console.log(`Fetched Sandbox Name : ${sandboxName} from the provided jwtToken`); } @@ -976,6 +977,7 @@ program catch(e) { console.error(`Error syncing sandbox : ${e.message}`); } + sandboxSvc.setAccountWide(false); }); diff --git a/src/service/sandbox-svc.ts b/src/service/sandbox-svc.ts index aaa028651..9b5b3352a 100644 --- a/src/service/sandbox-svc.ts +++ b/src/service/sandbox-svc.ts @@ -3,6 +3,7 @@ import * as cliUtils from '../utils/cli-utils'; import * as fs from 'fs'; var accountKey: string = null; +var accountWide: boolean = false; const SANDBOX_API_BASE = '/sandbox-api/v1'; @@ -11,6 +12,14 @@ export function setAccountKey(account: string) { accountKey = account; } +export function setAccountWide(value: boolean) { + accountWide = value; +} + +export function getAccountWide() { + return accountWide; +} + function isOkStatus(code) { return code >= 200 && code < 300; } @@ -94,6 +103,9 @@ function putTarball(path: string, edgeworkerTarballPath) { } function getJson(path: string) { + if(accountWide) { + path += `?access=account`; + } return sendEdgeRequest(path, 'GET', '', {}); } @@ -132,10 +144,7 @@ export function getAllSandboxes() { }); } -export function getSandbox(sandboxId: string, accountWide=false) { - if(accountWide) { - return getJson(`${SANDBOX_API_BASE}/sandboxes/${sandboxId}?access=account`).then(r => r.body); - } +export function getSandbox(sandboxId: string) { return getJson(`${SANDBOX_API_BASE}/sandboxes/${sandboxId}`).then(r => r.body); }