diff --git a/package-lock.json b/package-lock.json index 8c7c19a..2219b64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,93 @@ { "name": "cloud-commands", - "version": "0.6.4", - "lockfileVersion": 1, + "version": "0.7.1", + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "version": "0.7.1", + "dependencies": { + "data-structures": "github:sekwiatkowski/data-structures#v0.2.1", + "fs-extra": "9.0.1", + "standard-functions": "github:sekwiatkowski/standard-functions#v0.26.4" + }, + "bin": { + "c-build-function": "src/bin/functions/c-build-function.js", + "c-configure-function": "src/bin/functions/c-configure-function.js", + "c-create-function": "src/bin/functions/c-create-function.js", + "c-create-user-pool": "src/bin/user-pools/c-create-user-pool.js", + "c-create-user-pool-client": "src/bin/user-pools/c-create-user-pool-client.js", + "c-delete-api": "src/bin/apis/c-delete-api.js", + "c-delete-api-route": "src/bin/apis/c-delete-api-route.js", + "c-delete-distribution": "src/bin/functions/c-delete-distribution.js", + "c-delete-function": "src/bin/functions/c-delete-function.js", + "c-delete-user-pool": "src/bin/user-pools/c-delete-user-pool.js", + "c-integrate-function": "src/bin/apis/c-integrate-function.js", + "c-set-up-api": "src/bin/apis/c-set-up-api.js", + "c-set-up-api-route": "src/bin/apis/c-set-up-api-route.js", + "c-update-cors": "src/bin/apis/c-update-cors.js", + "c-update-function": "src/bin/functions/c-update-function.js", + "c-update-variables": "src/bin/apis/c-update-variables.js", + "c-zip-function": "src/bin/functions/c-zip-function.js" + } + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/data-structures": { + "version": "0.2.1", + "resolved": "git+ssh://git@github.com/sekwiatkowski/data-structures.git#b703fb94ac27fffb94cd83ccf087ff7be11f12b7", + "integrity": "sha512-Jzcp2VpBhqii/0rVqiZqSOUs0PgOv/DtTTVGZc7hthuA97hF2SMv6oN1rEGjBo37VMn5hAzBbi/TtSc4Gy38hQ==" + }, + "node_modules/fs-extra": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", + "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" + }, + "node_modules/jsonfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", + "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", + "dependencies": { + "universalify": "^1.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/standard-functions": { + "version": "0.26.4", + "resolved": "git+ssh://git@github.com/sekwiatkowski/standard-functions.git#5317bb8db8f12f73e69c4a294b586d0375cdac00", + "integrity": "sha512-+l0DvZBVizUUuJfu+/bCCA0HGofoxKWufJJl1Xdkl9QBZ8RWNy9H0GLzG29X3wOs8Pg7zjQ9Vm7NiXELa1Yapw==" + }, + "node_modules/universalify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", + "engines": { + "node": ">= 10.0.0" + } + } + }, "dependencies": { "at-least-node": { "version": "1.0.0", @@ -10,8 +95,8 @@ "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" }, "data-structures": { - "version": "github:sekwiatkowski/data-structures#b703fb94ac27fffb94cd83ccf087ff7be11f12b7", - "from": "github:sekwiatkowski/data-structures#v0.2.1" + "version": "git+ssh://git@github.com/sekwiatkowski/data-structures.git#b703fb94ac27fffb94cd83ccf087ff7be11f12b7", + "from": "data-structures@github:sekwiatkowski/data-structures#v0.2.1" }, "fs-extra": { "version": "9.0.1", @@ -39,8 +124,8 @@ } }, "standard-functions": { - "version": "github:sekwiatkowski/standard-functions#5317bb8db8f12f73e69c4a294b586d0375cdac00", - "from": "github:sekwiatkowski/standard-functions#v0.26.4" + "version": "git+ssh://git@github.com/sekwiatkowski/standard-functions.git#5317bb8db8f12f73e69c4a294b586d0375cdac00", + "from": "standard-functions@github:sekwiatkowski/standard-functions#v0.26.4" }, "universalify": { "version": "1.0.0", diff --git a/package.json b/package.json index bf901a4..8d3b9df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloud-commands", - "version": "0.7.1", + "version": "0.7.2", "bin": { "c-create-function": "src/bin/functions/c-create-function.js", "c-delete-distribution": "src/bin/functions/c-delete-distribution.js", diff --git a/src/arns.js b/src/arns.js index 68eed2b..989d8ff 100644 --- a/src/arns.js +++ b/src/arns.js @@ -23,7 +23,7 @@ export function computeExecuteApiArn(computeAccountArn) { return (apiId, stage, verb, path) => computeAccountArn('execute-api') (apiId + '/' + stage + '/' + verb + path) } -// arn:aws:cognito-idp:[region]:[account ID]:userpool/[pool id] export function computeUserPoolArn(computeAccountArn) { +// arn:aws:cognito-idp:[region]:[account ID]:userpool/[pool id] return poolId => computeAccountArn('cognito-idp') ('userpool' + '/' + poolId) } \ No newline at end of file diff --git a/src/execution.js b/src/execution.js index b17c9f0..95dc7cf 100644 --- a/src/execution.js +++ b/src/execution.js @@ -3,8 +3,9 @@ import child_process from "child_process" const exec = promisify(child_process.exec) -function handleOutput({stdout, stderr}) { - if (stderr) { +function handleOutput(output) { + const { err, stderr, stdout } = output + if (err) { throw stderr } else {