From 149add9a31256cf7c11c56b24357442a94aff5f3 Mon Sep 17 00:00:00 2001 From: Nicolas Froidure Date: Mon, 30 Mar 2020 10:06:55 +0200 Subject: [PATCH] feat(@whook/example): add Google Cloud Functions build --- package-lock.json | 1 + packages/whook-create/package-lock.json | 4 + .../__snapshots__/createWhook.test.ts.snap | 8 +- .../src/services/createWhook.test.ts | 6 + packages/whook-example/README.md | 51 ++ packages/whook-example/package-lock.json | 575 +++++++++++++++--- packages/whook-example/package.json | 2 + .../src/__snapshots__/cli.test.ts.snap | 13 +- .../src/__snapshots__/index.test.ts.snap | 108 +++- packages/whook-example/src/build.test.ts | 35 ++ packages/whook-example/src/build.ts | 14 +- .../src/commands/terraformValues.ts | 224 +++++++ .../whook-example/src/config/common/config.ts | 8 + .../whook-example/src/config/test/config.ts | 4 + packages/whook-example/src/index.ts | 7 +- packages/whook-example/src/whook.d.ts | 22 +- packages/whook-example/terraform/functions.tf | 53 ++ packages/whook-example/terraform/main.tf | 67 ++ packages/whook-gcp-functions/src/index.ts | 2 +- 19 files changed, 1109 insertions(+), 95 deletions(-) create mode 100644 packages/whook-example/src/build.test.ts create mode 100644 packages/whook-example/src/commands/terraformValues.ts create mode 100644 packages/whook-example/terraform/functions.tf create mode 100644 packages/whook-example/terraform/main.tf diff --git a/package-lock.json b/package-lock.json index 5589bb0d..54268222 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,6 +50,7 @@ "inquirer": "^8.2.4", "internal-ip": "^6.2.0", "jest": "^28.1.0", + "js-yaml": "^3.13.1", "jsarch": "^5.0.1", "jsdoc-to-markdown": "^7.1.1", "jwt-service": "^9.0.1", diff --git a/packages/whook-create/package-lock.json b/packages/whook-create/package-lock.json index ff4c97e6..c5d2a14c 100644 --- a/packages/whook-create/package-lock.json +++ b/packages/whook-create/package-lock.json @@ -226,6 +226,7 @@ "@whook/authorization": "^9.0.1", "@whook/cli": "^9.0.1", "@whook/cors": "^9.0.1", + "@whook/gcp-functions": "^9.0.1", "@whook/http-router": "^9.0.1", "@whook/http-server": "^9.0.1", "@whook/http-transaction": "^9.0.1", @@ -233,6 +234,7 @@ "@whook/whook": "^9.0.1", "common-services": "^11.0.1", "http-auth-utils": "^3.0.3", + "js-yaml": "^3.13.1", "jwt-service": "^9.0.1", "knifecycle": "^14.0.0", "openapi-schema-validator": "^11.0.1", @@ -14632,6 +14634,7 @@ "@whook/authorization": "^9.0.1", "@whook/cli": "^9.0.1", "@whook/cors": "^9.0.1", + "@whook/gcp-functions": "^9.0.1", "@whook/http-router": "^9.0.1", "@whook/http-server": "^9.0.1", "@whook/http-transaction": "^9.0.1", @@ -14648,6 +14651,7 @@ "eslint-plugin-prettier": "^4.0.0", "http-auth-utils": "^3.0.3", "jest": "^28.1.0", + "js-yaml": "^3.13.1", "jsarch": "^5.0.1", "jwt-service": "^9.0.1", "knifecycle": "^14.0.0", diff --git a/packages/whook-create/src/services/__snapshots__/createWhook.test.ts.snap b/packages/whook-create/src/services/__snapshots__/createWhook.test.ts.snap index 5efcbda8..721f354b 100644 --- a/packages/whook-create/src/services/__snapshots__/createWhook.test.ts.snap +++ b/packages/whook-create/src/services/__snapshots__/createWhook.test.ts.snap @@ -66,7 +66,7 @@ Wayne Campbell ], Array [ "/home/whoiam/projects/yolo/package.json", - "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=16.15.0\\"},\\"main\\":\\"dist/index.js\\",\\"types\\":\\"dist/index.d.ts\\",\\"type\\":\\"module\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"apitypes\\":\\"npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts\\",\\"architecture\\":\\"jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md\\",\\"build\\":\\"rimraf -f 'dist' && tsc --outDir dist\\",\\"postbuild\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/build.js\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} ts-node --esm --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/dev.js\\",\\"genPackagelock\\":\\"npm i --package-lock-only\\",\\"jest\\":\\"NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"PROJECT_SRC=\\\\\\"$PWD/dist\\\\\\" NODE_ENV=\${NODE_ENV:-development} node bin/start.js\\",\\"test\\":\\"NODE_ENV=test npm run build && npm run jest\\",\\"watch\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/watch.js\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/whook.js\\",\\"whook-repl\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/repl.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-server\\":\\"^9.0.1\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^11.0.1\\",\\"http-auth-utils\\":\\"^3.0.3\\",\\"jwt-service\\":\\"^9.0.1\\",\\"knifecycle\\":\\"^14.0.0\\",\\"openapi-schema-validator\\":\\"^11.0.1\\",\\"openapi-types\\":\\"^11.0.1\\",\\"strict-qs\\":\\"^7.0.0\\",\\"type-fest\\":\\"^2.13.0\\",\\"yerror\\":\\"^6.1.1\\",\\"yhttperror\\":\\"^6.1.1\\"},\\"devDependencies\\":{\\"@types/jest\\":\\"^28.1.1\\",\\"@typescript-eslint/eslint-plugin\\":\\"^5.27.0\\",\\"@typescript-eslint/parser\\":\\"^5.27.0\\",\\"axios\\":\\"^0.27.2\\",\\"chokidar\\":\\"^3.5.1\\",\\"esbuild\\":\\"^0.14.43\\",\\"esbuild-node-externals\\":\\"^1.4.1\\",\\"esbuild-jest\\":\\"^0.5.0\\",\\"eslint\\":\\"^8.17.0\\",\\"eslint-config-prettier\\":\\"^8.5.0\\",\\"eslint-plugin-prettier\\":\\"^4.0.0\\",\\"jest\\":\\"^28.1.0\\",\\"jsarch\\":\\"^5.0.1\\",\\"parse-gitignore\\":\\"^1.0.1\\",\\"prettier\\":\\"^2.6.2\\",\\"rimraf\\":\\"^3.0.2\\",\\"schema2dts\\":\\"^4.1.1\\",\\"typescript\\":\\"^4.7.3\\",\\"ts-node\\":\\"^10.8.1\\"},\\"eslintConfig\\":{\\"extends\\":[\\"eslint:recommended\\",\\"plugin:prettier/recommended\\",\\"plugin:@typescript-eslint/eslint-recommended\\",\\"plugin:@typescript-eslint/recommended\\"],\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"script\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\",\\"transform\\":{\\"^.+\\\\\\\\.tsx?$\\":[\\"esbuild-jest\\",{\\"sourcemap\\":true,\\"format\\":\\"esm\\"}]},\\"moduleNameMapper\\":{\\"(.+)\\\\\\\\.js\\":\\"$1\\"},\\"extensionsToTreatAsEsm\\":[\\".ts\\"]}}", + "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=16.15.0\\"},\\"main\\":\\"dist/index.js\\",\\"types\\":\\"dist/index.d.ts\\",\\"type\\":\\"module\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"apitypes\\":\\"npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts\\",\\"architecture\\":\\"jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md\\",\\"build\\":\\"rimraf -f 'dist' && tsc --outDir dist\\",\\"postbuild\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/build.js\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} ts-node --esm --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/dev.js\\",\\"genPackagelock\\":\\"npm i --package-lock-only\\",\\"jest\\":\\"NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"PROJECT_SRC=\\\\\\"$PWD/dist\\\\\\" NODE_ENV=\${NODE_ENV:-development} node bin/start.js\\",\\"test\\":\\"NODE_ENV=test npm run build && npm run jest\\",\\"watch\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/watch.js\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/whook.js\\",\\"whook-repl\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/repl.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/gcp-functions\\":\\"^9.0.1\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-server\\":\\"^9.0.1\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^11.0.1\\",\\"http-auth-utils\\":\\"^3.0.3\\",\\"jwt-service\\":\\"^9.0.1\\",\\"knifecycle\\":\\"^14.0.0\\",\\"openapi-schema-validator\\":\\"^11.0.1\\",\\"openapi-types\\":\\"^11.0.1\\",\\"js-yaml\\":\\"^3.13.1\\",\\"strict-qs\\":\\"^7.0.0\\",\\"type-fest\\":\\"^2.13.0\\",\\"yerror\\":\\"^6.1.1\\",\\"yhttperror\\":\\"^6.1.1\\"},\\"devDependencies\\":{\\"@types/jest\\":\\"^28.1.1\\",\\"@typescript-eslint/eslint-plugin\\":\\"^5.27.0\\",\\"@typescript-eslint/parser\\":\\"^5.27.0\\",\\"axios\\":\\"^0.27.2\\",\\"chokidar\\":\\"^3.5.1\\",\\"esbuild\\":\\"^0.14.43\\",\\"esbuild-node-externals\\":\\"^1.4.1\\",\\"esbuild-jest\\":\\"^0.5.0\\",\\"eslint\\":\\"^8.17.0\\",\\"eslint-config-prettier\\":\\"^8.5.0\\",\\"eslint-plugin-prettier\\":\\"^4.0.0\\",\\"jest\\":\\"^28.1.0\\",\\"jsarch\\":\\"^5.0.1\\",\\"parse-gitignore\\":\\"^1.0.1\\",\\"prettier\\":\\"^2.6.2\\",\\"rimraf\\":\\"^3.0.2\\",\\"schema2dts\\":\\"^4.1.1\\",\\"typescript\\":\\"^4.7.3\\",\\"ts-node\\":\\"^10.8.1\\"},\\"eslintConfig\\":{\\"extends\\":[\\"eslint:recommended\\",\\"plugin:prettier/recommended\\",\\"plugin:@typescript-eslint/eslint-recommended\\",\\"plugin:@typescript-eslint/recommended\\"],\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"script\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\",\\"transform\\":{\\"^.+\\\\\\\\.tsx?$\\":[\\"esbuild-jest\\",{\\"sourcemap\\":true,\\"format\\":\\"esm\\"}]},\\"moduleNameMapper\\":{\\"(.+)\\\\\\\\.js\\":\\"$1\\"},\\"extensionsToTreatAsEsm\\":[\\".ts\\"]}}", ], Array [ "/home/whoiam/projects/yolo/LICENSE", @@ -191,7 +191,7 @@ Wayne Campbell ], Array [ "/home/whoiam/projects/yolo/package.json", - "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=16.15.0\\"},\\"main\\":\\"dist/index.js\\",\\"types\\":\\"dist/index.d.ts\\",\\"type\\":\\"module\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"apitypes\\":\\"npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts\\",\\"architecture\\":\\"jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md\\",\\"build\\":\\"rimraf -f 'dist' && tsc --outDir dist\\",\\"postbuild\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/build.js\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} ts-node --esm --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/dev.js\\",\\"genPackagelock\\":\\"npm i --package-lock-only\\",\\"jest\\":\\"NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"PROJECT_SRC=\\\\\\"$PWD/dist\\\\\\" NODE_ENV=\${NODE_ENV:-development} node bin/start.js\\",\\"test\\":\\"NODE_ENV=test npm run build && npm run jest\\",\\"watch\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/watch.js\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/whook.js\\",\\"whook-repl\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/repl.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-server\\":\\"^9.0.1\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^11.0.1\\",\\"http-auth-utils\\":\\"^3.0.3\\",\\"jwt-service\\":\\"^9.0.1\\",\\"knifecycle\\":\\"^14.0.0\\",\\"openapi-schema-validator\\":\\"^11.0.1\\",\\"openapi-types\\":\\"^11.0.1\\",\\"strict-qs\\":\\"^7.0.0\\",\\"type-fest\\":\\"^2.13.0\\",\\"yerror\\":\\"^6.1.1\\",\\"yhttperror\\":\\"^6.1.1\\"},\\"devDependencies\\":{\\"@types/jest\\":\\"^28.1.1\\",\\"@typescript-eslint/eslint-plugin\\":\\"^5.27.0\\",\\"@typescript-eslint/parser\\":\\"^5.27.0\\",\\"axios\\":\\"^0.27.2\\",\\"chokidar\\":\\"^3.5.1\\",\\"esbuild\\":\\"^0.14.43\\",\\"esbuild-node-externals\\":\\"^1.4.1\\",\\"esbuild-jest\\":\\"^0.5.0\\",\\"eslint\\":\\"^8.17.0\\",\\"eslint-config-prettier\\":\\"^8.5.0\\",\\"eslint-plugin-prettier\\":\\"^4.0.0\\",\\"jest\\":\\"^28.1.0\\",\\"jsarch\\":\\"^5.0.1\\",\\"parse-gitignore\\":\\"^1.0.1\\",\\"prettier\\":\\"^2.6.2\\",\\"rimraf\\":\\"^3.0.2\\",\\"schema2dts\\":\\"^4.1.1\\",\\"typescript\\":\\"^4.7.3\\",\\"ts-node\\":\\"^10.8.1\\"},\\"eslintConfig\\":{\\"extends\\":[\\"eslint:recommended\\",\\"plugin:prettier/recommended\\",\\"plugin:@typescript-eslint/eslint-recommended\\",\\"plugin:@typescript-eslint/recommended\\"],\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"script\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\",\\"transform\\":{\\"^.+\\\\\\\\.tsx?$\\":[\\"esbuild-jest\\",{\\"sourcemap\\":true,\\"format\\":\\"esm\\"}]},\\"moduleNameMapper\\":{\\"(.+)\\\\\\\\.js\\":\\"$1\\"},\\"extensionsToTreatAsEsm\\":[\\".ts\\"]}}", + "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=16.15.0\\"},\\"main\\":\\"dist/index.js\\",\\"types\\":\\"dist/index.d.ts\\",\\"type\\":\\"module\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"apitypes\\":\\"npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts\\",\\"architecture\\":\\"jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md\\",\\"build\\":\\"rimraf -f 'dist' && tsc --outDir dist\\",\\"postbuild\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/build.js\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} ts-node --esm --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/dev.js\\",\\"genPackagelock\\":\\"npm i --package-lock-only\\",\\"jest\\":\\"NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"PROJECT_SRC=\\\\\\"$PWD/dist\\\\\\" NODE_ENV=\${NODE_ENV:-development} node bin/start.js\\",\\"test\\":\\"NODE_ENV=test npm run build && npm run jest\\",\\"watch\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/watch.js\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/whook.js\\",\\"whook-repl\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/repl.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/gcp-functions\\":\\"^9.0.1\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-server\\":\\"^9.0.1\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^11.0.1\\",\\"http-auth-utils\\":\\"^3.0.3\\",\\"jwt-service\\":\\"^9.0.1\\",\\"knifecycle\\":\\"^14.0.0\\",\\"openapi-schema-validator\\":\\"^11.0.1\\",\\"openapi-types\\":\\"^11.0.1\\",\\"js-yaml\\":\\"^3.13.1\\",\\"strict-qs\\":\\"^7.0.0\\",\\"type-fest\\":\\"^2.13.0\\",\\"yerror\\":\\"^6.1.1\\",\\"yhttperror\\":\\"^6.1.1\\"},\\"devDependencies\\":{\\"@types/jest\\":\\"^28.1.1\\",\\"@typescript-eslint/eslint-plugin\\":\\"^5.27.0\\",\\"@typescript-eslint/parser\\":\\"^5.27.0\\",\\"axios\\":\\"^0.27.2\\",\\"chokidar\\":\\"^3.5.1\\",\\"esbuild\\":\\"^0.14.43\\",\\"esbuild-node-externals\\":\\"^1.4.1\\",\\"esbuild-jest\\":\\"^0.5.0\\",\\"eslint\\":\\"^8.17.0\\",\\"eslint-config-prettier\\":\\"^8.5.0\\",\\"eslint-plugin-prettier\\":\\"^4.0.0\\",\\"jest\\":\\"^28.1.0\\",\\"jsarch\\":\\"^5.0.1\\",\\"parse-gitignore\\":\\"^1.0.1\\",\\"prettier\\":\\"^2.6.2\\",\\"rimraf\\":\\"^3.0.2\\",\\"schema2dts\\":\\"^4.1.1\\",\\"typescript\\":\\"^4.7.3\\",\\"ts-node\\":\\"^10.8.1\\"},\\"eslintConfig\\":{\\"extends\\":[\\"eslint:recommended\\",\\"plugin:prettier/recommended\\",\\"plugin:@typescript-eslint/eslint-recommended\\",\\"plugin:@typescript-eslint/recommended\\"],\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"script\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\",\\"transform\\":{\\"^.+\\\\\\\\.tsx?$\\":[\\"esbuild-jest\\",{\\"sourcemap\\":true,\\"format\\":\\"esm\\"}]},\\"moduleNameMapper\\":{\\"(.+)\\\\\\\\.js\\":\\"$1\\"},\\"extensionsToTreatAsEsm\\":[\\".ts\\"]}}", ], Array [ "/home/whoiam/projects/yolo/LICENSE", @@ -348,7 +348,7 @@ Wayne Campbell ], Array [ "/home/whoiam/projects/yolo/package.json", - "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=16.15.0\\"},\\"main\\":\\"dist/index.js\\",\\"types\\":\\"dist/index.d.ts\\",\\"type\\":\\"module\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"apitypes\\":\\"npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts\\",\\"architecture\\":\\"jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md\\",\\"build\\":\\"rimraf -f 'dist' && tsc --outDir dist\\",\\"postbuild\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/build.js\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} ts-node --esm --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/dev.js\\",\\"genPackagelock\\":\\"npm i --package-lock-only\\",\\"jest\\":\\"NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"PROJECT_SRC=\\\\\\"$PWD/dist\\\\\\" NODE_ENV=\${NODE_ENV:-development} node bin/start.js\\",\\"test\\":\\"NODE_ENV=test npm run build && npm run jest\\",\\"watch\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/watch.js\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/whook.js\\",\\"whook-repl\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/repl.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-server\\":\\"^9.0.1\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^11.0.1\\",\\"http-auth-utils\\":\\"^3.0.3\\",\\"jwt-service\\":\\"^9.0.1\\",\\"knifecycle\\":\\"^14.0.0\\",\\"openapi-schema-validator\\":\\"^11.0.1\\",\\"openapi-types\\":\\"^11.0.1\\",\\"strict-qs\\":\\"^7.0.0\\",\\"type-fest\\":\\"^2.13.0\\",\\"yerror\\":\\"^6.1.1\\",\\"yhttperror\\":\\"^6.1.1\\"},\\"devDependencies\\":{\\"@types/jest\\":\\"^28.1.1\\",\\"@typescript-eslint/eslint-plugin\\":\\"^5.27.0\\",\\"@typescript-eslint/parser\\":\\"^5.27.0\\",\\"axios\\":\\"^0.27.2\\",\\"chokidar\\":\\"^3.5.1\\",\\"esbuild\\":\\"^0.14.43\\",\\"esbuild-node-externals\\":\\"^1.4.1\\",\\"esbuild-jest\\":\\"^0.5.0\\",\\"eslint\\":\\"^8.17.0\\",\\"eslint-config-prettier\\":\\"^8.5.0\\",\\"eslint-plugin-prettier\\":\\"^4.0.0\\",\\"jest\\":\\"^28.1.0\\",\\"jsarch\\":\\"^5.0.1\\",\\"parse-gitignore\\":\\"^1.0.1\\",\\"prettier\\":\\"^2.6.2\\",\\"rimraf\\":\\"^3.0.2\\",\\"schema2dts\\":\\"^4.1.1\\",\\"typescript\\":\\"^4.7.3\\",\\"ts-node\\":\\"^10.8.1\\"},\\"eslintConfig\\":{\\"extends\\":[\\"eslint:recommended\\",\\"plugin:prettier/recommended\\",\\"plugin:@typescript-eslint/eslint-recommended\\",\\"plugin:@typescript-eslint/recommended\\"],\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"script\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\",\\"transform\\":{\\"^.+\\\\\\\\.tsx?$\\":[\\"esbuild-jest\\",{\\"sourcemap\\":true,\\"format\\":\\"esm\\"}]},\\"moduleNameMapper\\":{\\"(.+)\\\\\\\\.js\\":\\"$1\\"},\\"extensionsToTreatAsEsm\\":[\\".ts\\"]}}", + "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=16.15.0\\"},\\"main\\":\\"dist/index.js\\",\\"types\\":\\"dist/index.d.ts\\",\\"type\\":\\"module\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"apitypes\\":\\"npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts\\",\\"architecture\\":\\"jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md\\",\\"build\\":\\"rimraf -f 'dist' && tsc --outDir dist\\",\\"postbuild\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/build.js\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} ts-node --esm --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/dev.js\\",\\"genPackagelock\\":\\"npm i --package-lock-only\\",\\"jest\\":\\"NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"PROJECT_SRC=\\\\\\"$PWD/dist\\\\\\" NODE_ENV=\${NODE_ENV:-development} node bin/start.js\\",\\"test\\":\\"NODE_ENV=test npm run build && npm run jest\\",\\"watch\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/watch.js\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/whook.js\\",\\"whook-repl\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/repl.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/gcp-functions\\":\\"^9.0.1\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-server\\":\\"^9.0.1\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^11.0.1\\",\\"http-auth-utils\\":\\"^3.0.3\\",\\"jwt-service\\":\\"^9.0.1\\",\\"knifecycle\\":\\"^14.0.0\\",\\"openapi-schema-validator\\":\\"^11.0.1\\",\\"openapi-types\\":\\"^11.0.1\\",\\"js-yaml\\":\\"^3.13.1\\",\\"strict-qs\\":\\"^7.0.0\\",\\"type-fest\\":\\"^2.13.0\\",\\"yerror\\":\\"^6.1.1\\",\\"yhttperror\\":\\"^6.1.1\\"},\\"devDependencies\\":{\\"@types/jest\\":\\"^28.1.1\\",\\"@typescript-eslint/eslint-plugin\\":\\"^5.27.0\\",\\"@typescript-eslint/parser\\":\\"^5.27.0\\",\\"axios\\":\\"^0.27.2\\",\\"chokidar\\":\\"^3.5.1\\",\\"esbuild\\":\\"^0.14.43\\",\\"esbuild-node-externals\\":\\"^1.4.1\\",\\"esbuild-jest\\":\\"^0.5.0\\",\\"eslint\\":\\"^8.17.0\\",\\"eslint-config-prettier\\":\\"^8.5.0\\",\\"eslint-plugin-prettier\\":\\"^4.0.0\\",\\"jest\\":\\"^28.1.0\\",\\"jsarch\\":\\"^5.0.1\\",\\"parse-gitignore\\":\\"^1.0.1\\",\\"prettier\\":\\"^2.6.2\\",\\"rimraf\\":\\"^3.0.2\\",\\"schema2dts\\":\\"^4.1.1\\",\\"typescript\\":\\"^4.7.3\\",\\"ts-node\\":\\"^10.8.1\\"},\\"eslintConfig\\":{\\"extends\\":[\\"eslint:recommended\\",\\"plugin:prettier/recommended\\",\\"plugin:@typescript-eslint/eslint-recommended\\",\\"plugin:@typescript-eslint/recommended\\"],\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"script\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\",\\"transform\\":{\\"^.+\\\\\\\\.tsx?$\\":[\\"esbuild-jest\\",{\\"sourcemap\\":true,\\"format\\":\\"esm\\"}]},\\"moduleNameMapper\\":{\\"(.+)\\\\\\\\.js\\":\\"$1\\"},\\"extensionsToTreatAsEsm\\":[\\".ts\\"]}}", ], Array [ "/home/whoiam/projects/yolo/LICENSE", @@ -493,7 +493,7 @@ Wayne Campbell ], Array [ "/home/whoiam/projects/yolo/package.json", - "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=16.15.0\\"},\\"main\\":\\"dist/index.js\\",\\"types\\":\\"dist/index.d.ts\\",\\"type\\":\\"module\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"apitypes\\":\\"npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts\\",\\"architecture\\":\\"jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md\\",\\"build\\":\\"rimraf -f 'dist' && tsc --outDir dist\\",\\"postbuild\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/build.js\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} ts-node --esm --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/dev.js\\",\\"genPackagelock\\":\\"npm i --package-lock-only\\",\\"jest\\":\\"NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"PROJECT_SRC=\\\\\\"$PWD/dist\\\\\\" NODE_ENV=\${NODE_ENV:-development} node bin/start.js\\",\\"test\\":\\"NODE_ENV=test npm run build && npm run jest\\",\\"watch\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/watch.js\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/whook.js\\",\\"whook-repl\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/repl.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-server\\":\\"^9.0.1\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^11.0.1\\",\\"http-auth-utils\\":\\"^3.0.3\\",\\"jwt-service\\":\\"^9.0.1\\",\\"knifecycle\\":\\"^14.0.0\\",\\"openapi-schema-validator\\":\\"^11.0.1\\",\\"openapi-types\\":\\"^11.0.1\\",\\"strict-qs\\":\\"^7.0.0\\",\\"type-fest\\":\\"^2.13.0\\",\\"yerror\\":\\"^6.1.1\\",\\"yhttperror\\":\\"^6.1.1\\"},\\"devDependencies\\":{\\"@types/jest\\":\\"^28.1.1\\",\\"@typescript-eslint/eslint-plugin\\":\\"^5.27.0\\",\\"@typescript-eslint/parser\\":\\"^5.27.0\\",\\"axios\\":\\"^0.27.2\\",\\"chokidar\\":\\"^3.5.1\\",\\"esbuild\\":\\"^0.14.43\\",\\"esbuild-node-externals\\":\\"^1.4.1\\",\\"esbuild-jest\\":\\"^0.5.0\\",\\"eslint\\":\\"^8.17.0\\",\\"eslint-config-prettier\\":\\"^8.5.0\\",\\"eslint-plugin-prettier\\":\\"^4.0.0\\",\\"jest\\":\\"^28.1.0\\",\\"jsarch\\":\\"^5.0.1\\",\\"parse-gitignore\\":\\"^1.0.1\\",\\"prettier\\":\\"^2.6.2\\",\\"rimraf\\":\\"^3.0.2\\",\\"schema2dts\\":\\"^4.1.1\\",\\"typescript\\":\\"^4.7.3\\",\\"ts-node\\":\\"^10.8.1\\"},\\"eslintConfig\\":{\\"extends\\":[\\"eslint:recommended\\",\\"plugin:prettier/recommended\\",\\"plugin:@typescript-eslint/eslint-recommended\\",\\"plugin:@typescript-eslint/recommended\\"],\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"script\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\",\\"transform\\":{\\"^.+\\\\\\\\.tsx?$\\":[\\"esbuild-jest\\",{\\"sourcemap\\":true,\\"format\\":\\"esm\\"}]},\\"moduleNameMapper\\":{\\"(.+)\\\\\\\\.js\\":\\"$1\\"},\\"extensionsToTreatAsEsm\\":[\\".ts\\"]}}", + "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=16.15.0\\"},\\"main\\":\\"dist/index.js\\",\\"types\\":\\"dist/index.d.ts\\",\\"type\\":\\"module\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"apitypes\\":\\"npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts\\",\\"architecture\\":\\"jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md\\",\\"build\\":\\"rimraf -f 'dist' && tsc --outDir dist\\",\\"postbuild\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/build.js\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} ts-node --esm --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/dev.js\\",\\"genPackagelock\\":\\"npm i --package-lock-only\\",\\"jest\\":\\"NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"PROJECT_SRC=\\\\\\"$PWD/dist\\\\\\" NODE_ENV=\${NODE_ENV:-development} node bin/start.js\\",\\"test\\":\\"NODE_ENV=test npm run build && npm run jest\\",\\"watch\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 ts-node --esm --files bin/watch.js\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/whook.js\\",\\"whook-repl\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} ts-node --esm --files -- bin/repl.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/gcp-functions\\":\\"^9.0.1\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-server\\":\\"^9.0.1\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^11.0.1\\",\\"http-auth-utils\\":\\"^3.0.3\\",\\"jwt-service\\":\\"^9.0.1\\",\\"knifecycle\\":\\"^14.0.0\\",\\"openapi-schema-validator\\":\\"^11.0.1\\",\\"openapi-types\\":\\"^11.0.1\\",\\"js-yaml\\":\\"^3.13.1\\",\\"strict-qs\\":\\"^7.0.0\\",\\"type-fest\\":\\"^2.13.0\\",\\"yerror\\":\\"^6.1.1\\",\\"yhttperror\\":\\"^6.1.1\\"},\\"devDependencies\\":{\\"@types/jest\\":\\"^28.1.1\\",\\"@typescript-eslint/eslint-plugin\\":\\"^5.27.0\\",\\"@typescript-eslint/parser\\":\\"^5.27.0\\",\\"axios\\":\\"^0.27.2\\",\\"chokidar\\":\\"^3.5.1\\",\\"esbuild\\":\\"^0.14.43\\",\\"esbuild-node-externals\\":\\"^1.4.1\\",\\"esbuild-jest\\":\\"^0.5.0\\",\\"eslint\\":\\"^8.17.0\\",\\"eslint-config-prettier\\":\\"^8.5.0\\",\\"eslint-plugin-prettier\\":\\"^4.0.0\\",\\"jest\\":\\"^28.1.0\\",\\"jsarch\\":\\"^5.0.1\\",\\"parse-gitignore\\":\\"^1.0.1\\",\\"prettier\\":\\"^2.6.2\\",\\"rimraf\\":\\"^3.0.2\\",\\"schema2dts\\":\\"^4.1.1\\",\\"typescript\\":\\"^4.7.3\\",\\"ts-node\\":\\"^10.8.1\\"},\\"eslintConfig\\":{\\"extends\\":[\\"eslint:recommended\\",\\"plugin:prettier/recommended\\",\\"plugin:@typescript-eslint/eslint-recommended\\",\\"plugin:@typescript-eslint/recommended\\"],\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"script\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\",\\"transform\\":{\\"^.+\\\\\\\\.tsx?$\\":[\\"esbuild-jest\\",{\\"sourcemap\\":true,\\"format\\":\\"esm\\"}]},\\"moduleNameMapper\\":{\\"(.+)\\\\\\\\.js\\":\\"$1\\"},\\"extensionsToTreatAsEsm\\":[\\".ts\\"]}}", ], Array [ "/home/whoiam/projects/yolo/LICENSE", diff --git a/packages/whook-create/src/services/createWhook.test.ts b/packages/whook-create/src/services/createWhook.test.ts index 34cff32c..4e69baee 100644 --- a/packages/whook-create/src/services/createWhook.test.ts +++ b/packages/whook-create/src/services/createWhook.test.ts @@ -144,6 +144,7 @@ Mr Bean "@whook/authorization": "", "@whook/cli": "", "@whook/cors": "", + "@whook/gcp-functions": "^9.0.1", "@whook/http-router": "", "@whook/http-server": "^9.0.1", "@whook/http-transaction": "", @@ -151,6 +152,7 @@ Mr Bean "@whook/whook": "", "common-services": "^11.0.1", "http-auth-utils": "^3.0.3", + "js-yaml": "^3.13.1", "jwt-service": "^9.0.1", "knifecycle": "^14.0.0", "openapi-schema-validator": "^11.0.1", @@ -364,6 +366,7 @@ Mr Bean "@whook/authorization": "", "@whook/cli": "", "@whook/cors": "", + "@whook/gcp-functions": "^9.0.1", "@whook/http-router": "", "@whook/http-server": "^9.0.1", "@whook/http-transaction": "", @@ -371,6 +374,7 @@ Mr Bean "@whook/whook": "", "common-services": "^11.0.1", "http-auth-utils": "^3.0.3", + "js-yaml": "^3.13.1", "jwt-service": "^9.0.1", "knifecycle": "^14.0.0", "openapi-schema-validator": "^11.0.1", @@ -569,6 +573,7 @@ Mr Bean "@whook/authorization": "", "@whook/cli": "", "@whook/cors": "", + "@whook/gcp-functions": "^9.0.1", "@whook/http-router": "", "@whook/http-server": "^9.0.1", "@whook/http-transaction": "", @@ -576,6 +581,7 @@ Mr Bean "@whook/whook": "", "common-services": "^11.0.1", "http-auth-utils": "^3.0.3", + "js-yaml": "^3.13.1", "jwt-service": "^9.0.1", "knifecycle": "^14.0.0", "openapi-schema-validator": "^11.0.1", diff --git a/packages/whook-example/README.md b/packages/whook-example/README.md index d677ac8c..11fd5a1e 100644 --- a/packages/whook-example/README.md +++ b/packages/whook-example/README.md @@ -92,6 +92,57 @@ Debug `knifecycle` internals (dependency injection issues): DEBUG=knifecycle npm run dev ``` +## Deploying with Google Cloud Functions + +Create a project and save its credentials to `.credentials.json`. + +Then install Terraform: +```sh +wget https://releases.hashicorp.com/terraform/0.12.24/terraform_0.12.24_linux_amd64.zip +mkdir .bin +unzip -d .bin terraform_0.12.24_linux_amd64.zip +rm terraform_0.12.24_linux_amd64.zip +``` + +Then initialize the Terraform configuration: +```sh +.bin/terraform init ./terraform; +``` + +Create a new workspace: +```sh +.bin/terraform workspace new staging +``` + +Build the functions: +```sh +NODE_ENV=staging npm run build +``` + +Build the Whook commands Terraform depends on: +```sh +npm run compile +``` + +Plan the deployment: +```sh +.bin/terraform plan -var="project_id=my-project-1664" \ + -out=terraform.plan terraform +``` + +Apply changes: +```sh +# parallelism may be necessary to avoid hitting +# timeouts with a slow connection +.bin/terraform apply -parallelism=1 terraform.plan +``` + +Finally retrieve the API URL and enjoy! +```sh +.bin/terraform -var="project_id=my-project-1664" \ + output api_url +``` + [//]: # (::contents:end) # Authors diff --git a/packages/whook-example/package-lock.json b/packages/whook-example/package-lock.json index 0ce99026..8a6039a7 100644 --- a/packages/whook-example/package-lock.json +++ b/packages/whook-example/package-lock.json @@ -12,6 +12,7 @@ "@whook/authorization": "^9.0.1", "@whook/cli": "^9.0.1", "@whook/cors": "^9.0.1", + "@whook/gcp-functions": "^9.0.1", "@whook/http-router": "^9.0.1", "@whook/http-server": "^9.0.1", "@whook/http-transaction": "^9.0.1", @@ -19,6 +20,7 @@ "@whook/whook": "^9.0.1", "common-services": "^11.0.1", "http-auth-utils": "^3.0.3", + "js-yaml": "^3.13.1", "jwt-service": "^9.0.1", "knifecycle": "^14.0.0", "openapi-schema-validator": "^11.0.1", @@ -2654,7 +2656,6 @@ "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", - "dev": true, "dependencies": { "type-detect": "4.0.8" } @@ -2663,11 +2664,25 @@ "version": "9.1.2", "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz", "integrity": "sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==", - "dev": true, "dependencies": { "@sinonjs/commons": "^1.7.0" } }, + "node_modules/@sinonjs/samsam": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-6.1.1.tgz", + "integrity": "sha512-cZ7rKJTLiE7u7Wi/v9Hc2fs3Ucc3jrWeMgPHbbTCeVAB2S0wOBbYlkJVeNSL04i7fdhT8wIbDq1zhC/PXTD2SA==", + "dependencies": { + "@sinonjs/commons": "^1.6.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } + }, + "node_modules/@sinonjs/text-encoding": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", + "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==" + }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -3023,6 +3038,107 @@ "resolved": "../whook-cors", "link": true }, + "node_modules/@whook/gcp-functions": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@whook/gcp-functions/-/gcp-functions-9.0.1.tgz", + "integrity": "sha512-fs2ubAhYUKKAeF33fpW8PXbhhB6FEkEYnxhuW+RRj6icsyuwSp1kyNsuPZxtoEEu0zH/GodEfwaLV6uL1nRSTg==", + "dependencies": { + "@whook/cli": "^9.0.1", + "@whook/cors": "^9.0.1", + "@whook/http-router": "^9.0.1", + "@whook/whook": "^9.0.1", + "ajv": "^8.11.0", + "ajv-formats": "^2.1.1", + "camelcase": "^6.3.0", + "common-services": "^10.0.2", + "cpr": "3.0.1", + "knifecycle": "^12.0.4", + "mkdirp": "^1.0.4", + "openapi-types": "^11.0.1", + "qs": "^6.10.3", + "strict-qs": "^6.1.5", + "yerror": "^6.0.2" + }, + "engines": { + "node": ">=12.19.0" + } + }, + "node_modules/@whook/gcp-functions/node_modules/@types/node": { + "version": "17.0.45", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", + "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" + }, + "node_modules/@whook/gcp-functions/node_modules/ajv": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@whook/gcp-functions/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@whook/gcp-functions/node_modules/common-services": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/common-services/-/common-services-10.0.3.tgz", + "integrity": "sha512-deOVIXJkpuOt58pUDwfhoU0xoIYPEAHv0hNUBMz3hxQsvJdwQXQ3wBaTyiUD017oTcwbxEW0mk/ASOXJzX9klw==", + "dependencies": { + "@types/node": "^17.0.35", + "knifecycle": "12.0.4", + "sinon": "^14.0.0", + "type-fest": "^2.13.0", + "yerror": "^6.0.2" + }, + "engines": { + "node": ">=12.19.0" + } + }, + "node_modules/@whook/gcp-functions/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/@whook/gcp-functions/node_modules/knifecycle": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/knifecycle/-/knifecycle-12.0.4.tgz", + "integrity": "sha512-DMJ1xQQR1HLHv54+9lGjHvC0IUNO7EUV+ddK79OZV0tNv0j2uy8O4og2KaJTK096XGuvBuGxUIFVjoBtfmNvIw==", + "dependencies": { + "debug": "^4.3.4", + "type-fest": "^2.13.0", + "yerror": "^6.0.2" + }, + "engines": { + "node": ">=12.19.0" + } + }, + "node_modules/@whook/gcp-functions/node_modules/strict-qs": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/strict-qs/-/strict-qs-6.1.5.tgz", + "integrity": "sha512-Pwq24iF+nOB04tiDl7i4qbCMq36eaM/pb06egbD1MgXN3y1j/doupkJYRMNnJAuvm604+ba1s1fSJ6Tf8n0t1g==", + "dependencies": { + "debug": "^4.3.4", + "yerror": "^6.0.2" + }, + "engines": { + "node": ">=12.19.0" + } + }, "node_modules/@whook/http-router": { "resolved": "../whook-http-router", "link": true @@ -3196,7 +3312,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -3469,8 +3584,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base": { "version": "0.11.2", @@ -3521,7 +3635,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3621,7 +3734,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -3952,8 +4064,7 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/convert-source-map": { "version": "1.8.0", @@ -3986,6 +4097,42 @@ "node": ">=0.10.0" } }, + "node_modules/cpr": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/cpr/-/cpr-3.0.1.tgz", + "integrity": "sha512-Xch4PXQ/KC8lJ+KfJ9JI6eG/nmppLrPPWg5Q+vh65Qr9EjuJEubxh/H/Le1TmCZ7+Xv7iJuNRqapyOFZB+wsxA==", + "dependencies": { + "graceful-fs": "^4.1.5", + "minimist": "^1.2.0", + "mkdirp": "~0.5.1", + "rimraf": "^2.5.4" + }, + "bin": { + "cpr": "bin/cpr" + } + }, + "node_modules/cpr/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/cpr/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -4124,7 +4271,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", - "dev": true, "engines": { "node": ">=0.3.1" } @@ -4992,7 +5138,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -5682,8 +5827,7 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fsevents": { "version": "2.3.2", @@ -5702,8 +5846,7 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/functional-red-black-tree": { "version": "1.0.1", @@ -5733,7 +5876,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -5777,7 +5919,6 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -5837,14 +5978,12 @@ "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -5877,7 +6016,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -6040,7 +6178,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -6049,8 +6186,7 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ini": { "version": "1.3.8", @@ -9443,7 +9579,6 @@ "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, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -9675,6 +9810,11 @@ "semver": "bin/semver" } }, + "node_modules/just-extend": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", + "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==" + }, "node_modules/jwa": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", @@ -9798,6 +9938,11 @@ "node": ">=8" } }, + "node_modules/lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==" + }, "node_modules/lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", @@ -10223,7 +10368,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -10234,8 +10378,7 @@ "node_modules/minimist": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "node_modules/mixin-deep": { "version": "1.3.2", @@ -10254,7 +10397,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, "bin": { "mkdirp": "bin/cmd.js" }, @@ -10301,6 +10443,18 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node_modules/nise": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.1.tgz", + "integrity": "sha512-yr5kW2THW1AkxVmCnKEh4nbYkJdB3I7LUkiUgOvEkOp414mc2UMaHMA7pjq1nYowhdoJZGwEKGaQVbxfpWj10A==", + "dependencies": { + "@sinonjs/commons": "^1.8.3", + "@sinonjs/fake-timers": ">=5", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "path-to-regexp": "^1.7.0" + } + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -10419,6 +10573,14 @@ "node": ">=0.10.0" } }, + "node_modules/object-inspect": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -10474,7 +10636,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "dependencies": { "wrappy": "1" } @@ -10683,7 +10844,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -10712,6 +10872,19 @@ "node": ">= 0.8.0" } }, + "node_modules/path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dependencies": { + "isarray": "0.0.1" + } + }, + "node_modules/path-to-regexp/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -10862,6 +11035,20 @@ "node": ">=6" } }, + "node_modules/qs": { + "version": "6.10.5", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.5.tgz", + "integrity": "sha512-O5RlPh0VFtR78y79rgcgKK4wbAI0C5zGVLztOIdpWX6ep368q5Hv6XRxDvXuZ9q3C6v+e3n8UfZZJw7IIG27eQ==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -11518,12 +11705,61 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "node_modules/sinon": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-14.0.0.tgz", + "integrity": "sha512-ugA6BFmE+WrJdh0owRZHToLd32Uw3Lxq6E6LtNRU+xTVBefx632h03Q7apXWRsRdZAJ41LB8aUfn2+O4jsDNMw==", + "dependencies": { + "@sinonjs/commons": "^1.8.3", + "@sinonjs/fake-timers": "^9.1.2", + "@sinonjs/samsam": "^6.1.1", + "diff": "^5.0.0", + "nise": "^5.1.1", + "supports-color": "^7.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" + } + }, + "node_modules/sinon/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/sinon/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -11806,8 +12042,7 @@ "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, "node_modules/stack-utils": { "version": "2.0.5", @@ -12277,7 +12512,6 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, "engines": { "node": ">=4" } @@ -12523,8 +12757,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/write-file-atomic": { "version": "3.0.3", @@ -14354,7 +14587,6 @@ "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", - "dev": true, "requires": { "type-detect": "4.0.8" } @@ -14363,11 +14595,25 @@ "version": "9.1.2", "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz", "integrity": "sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==", - "dev": true, "requires": { "@sinonjs/commons": "^1.7.0" } }, + "@sinonjs/samsam": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-6.1.1.tgz", + "integrity": "sha512-cZ7rKJTLiE7u7Wi/v9Hc2fs3Ucc3jrWeMgPHbbTCeVAB2S0wOBbYlkJVeNSL04i7fdhT8wIbDq1zhC/PXTD2SA==", + "requires": { + "@sinonjs/commons": "^1.6.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } + }, + "@sinonjs/text-encoding": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", + "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==" + }, "@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -15531,6 +15777,87 @@ } } }, + "@whook/gcp-functions": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@whook/gcp-functions/-/gcp-functions-9.0.1.tgz", + "integrity": "sha512-fs2ubAhYUKKAeF33fpW8PXbhhB6FEkEYnxhuW+RRj6icsyuwSp1kyNsuPZxtoEEu0zH/GodEfwaLV6uL1nRSTg==", + "requires": { + "@whook/cli": "^9.0.1", + "@whook/cors": "^9.0.1", + "@whook/http-router": "^9.0.1", + "@whook/whook": "^9.0.1", + "ajv": "^8.11.0", + "ajv-formats": "^2.1.1", + "camelcase": "^6.3.0", + "common-services": "^10.0.2", + "cpr": "3.0.1", + "knifecycle": "^12.0.4", + "mkdirp": "^1.0.4", + "openapi-types": "^11.0.1", + "qs": "^6.10.3", + "strict-qs": "^6.1.5", + "yerror": "^6.0.2" + }, + "dependencies": { + "@types/node": { + "version": "17.0.45", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", + "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" + }, + "ajv": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==" + }, + "common-services": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/common-services/-/common-services-10.0.3.tgz", + "integrity": "sha512-deOVIXJkpuOt58pUDwfhoU0xoIYPEAHv0hNUBMz3hxQsvJdwQXQ3wBaTyiUD017oTcwbxEW0mk/ASOXJzX9klw==", + "requires": { + "@types/node": "^17.0.35", + "knifecycle": "12.0.4", + "sinon": "^14.0.0", + "type-fest": "^2.13.0", + "yerror": "^6.0.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "knifecycle": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/knifecycle/-/knifecycle-12.0.4.tgz", + "integrity": "sha512-DMJ1xQQR1HLHv54+9lGjHvC0IUNO7EUV+ddK79OZV0tNv0j2uy8O4og2KaJTK096XGuvBuGxUIFVjoBtfmNvIw==", + "requires": { + "debug": "^4.3.4", + "type-fest": "^2.13.0", + "yerror": "^6.0.2" + } + }, + "strict-qs": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/strict-qs/-/strict-qs-6.1.5.tgz", + "integrity": "sha512-Pwq24iF+nOB04tiDl7i4qbCMq36eaM/pb06egbD1MgXN3y1j/doupkJYRMNnJAuvm604+ba1s1fSJ6Tf8n0t1g==", + "requires": { + "debug": "^4.3.4", + "yerror": "^6.0.2" + } + } + } + }, "@whook/http-router": { "version": "file:../whook-http-router", "requires": { @@ -16446,7 +16773,6 @@ "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" } @@ -16652,8 +16978,7 @@ "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "base": { "version": "0.11.2", @@ -16697,7 +17022,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -16772,7 +17096,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -17029,8 +17352,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "convert-source-map": { "version": "1.8.0", @@ -17057,6 +17379,35 @@ "is-error": "^2.2.0" } }, + "cpr": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/cpr/-/cpr-3.0.1.tgz", + "integrity": "sha512-Xch4PXQ/KC8lJ+KfJ9JI6eG/nmppLrPPWg5Q+vh65Qr9EjuJEubxh/H/Le1TmCZ7+Xv7iJuNRqapyOFZB+wsxA==", + "requires": { + "graceful-fs": "^4.1.5", + "minimist": "^1.2.0", + "mkdirp": "~0.5.1", + "rimraf": "^2.5.4" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "requires": { + "minimist": "^1.2.6" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "requires": { + "glob": "^7.1.3" + } + } + } + }, "create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -17156,8 +17507,7 @@ "diff": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", - "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", - "dev": true + "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==" }, "diff-sequences": { "version": "27.5.1", @@ -17691,8 +18041,7 @@ "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "esquery": { "version": "1.4.0", @@ -18233,8 +18582,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "fsevents": { "version": "2.3.2", @@ -18246,8 +18594,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "functional-red-black-tree": { "version": "1.0.1", @@ -18271,7 +18618,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -18300,7 +18646,6 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -18342,14 +18687,12 @@ "graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -18372,8 +18715,7 @@ "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" }, "has-value": { "version": "1.0.0", @@ -18491,7 +18833,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -18500,8 +18841,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { "version": "1.3.8", @@ -21130,7 +21470,6 @@ "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" @@ -21299,6 +21638,11 @@ } } }, + "just-extend": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", + "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==" + }, "jwa": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", @@ -21400,6 +21744,11 @@ "p-locate": "^4.1.0" } }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==" + }, "lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", @@ -21720,7 +22069,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -21728,8 +22076,7 @@ "minimist": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "mixin-deep": { "version": "1.3.2", @@ -21744,8 +22091,7 @@ "mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" }, "ms": { "version": "2.1.2", @@ -21783,6 +22129,18 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "nise": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.1.tgz", + "integrity": "sha512-yr5kW2THW1AkxVmCnKEh4nbYkJdB3I7LUkiUgOvEkOp414mc2UMaHMA7pjq1nYowhdoJZGwEKGaQVbxfpWj10A==", + "requires": { + "@sinonjs/commons": "^1.8.3", + "@sinonjs/fake-timers": ">=5", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "path-to-regexp": "^1.7.0" + } + }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -21878,6 +22236,11 @@ } } }, + "object-inspect": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==" + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -21918,7 +22281,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "requires": { "wrappy": "1" } @@ -22080,8 +22442,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, "path-key": { "version": "3.1.1", @@ -22101,6 +22462,21 @@ "integrity": "sha512-Y30dB6rab1A/nfEKsZxmr01nUotHX0c/ZiIAsCTatEe1CmS5Pm5He7fZ195bPT7RdquoaL8lLxFCMQi/bS7IJg==", "dev": true }, + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + } + } + }, "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -22205,6 +22581,14 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, + "qs": { + "version": "6.10.5", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.5.tgz", + "integrity": "sha512-O5RlPh0VFtR78y79rgcgKK4wbAI0C5zGVLztOIdpWX6ep368q5Hv6XRxDvXuZ9q3C6v+e3n8UfZZJw7IIG27eQ==", + "requires": { + "side-channel": "^1.0.4" + } + }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -22688,12 +23072,50 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, "signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "sinon": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-14.0.0.tgz", + "integrity": "sha512-ugA6BFmE+WrJdh0owRZHToLd32Uw3Lxq6E6LtNRU+xTVBefx632h03Q7apXWRsRdZAJ41LB8aUfn2+O4jsDNMw==", + "requires": { + "@sinonjs/commons": "^1.8.3", + "@sinonjs/fake-timers": "^9.1.2", + "@sinonjs/samsam": "^6.1.1", + "diff": "^5.0.0", + "nise": "^5.1.1", + "supports-color": "^7.2.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -22924,8 +23346,7 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, "stack-utils": { "version": "2.0.5", @@ -23277,8 +23698,7 @@ "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" }, "type-fest": { "version": "2.13.1", @@ -23467,8 +23887,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "write-file-atomic": { "version": "3.0.3", diff --git a/packages/whook-example/package.json b/packages/whook-example/package.json index f3ddcba9..735c36ae 100644 --- a/packages/whook-example/package.json +++ b/packages/whook-example/package.json @@ -79,6 +79,7 @@ "@whook/authorization": "^9.0.1", "@whook/cli": "^9.0.1", "@whook/cors": "^9.0.1", + "@whook/gcp-functions": "^9.0.1", "@whook/http-router": "^9.0.1", "@whook/http-server": "^9.0.1", "@whook/http-transaction": "^9.0.1", @@ -90,6 +91,7 @@ "knifecycle": "^14.0.0", "openapi-schema-validator": "^11.0.1", "openapi-types": "^11.0.1", + "js-yaml": "^3.13.1", "strict-qs": "^7.0.0", "type-fest": "^2.13.0", "yerror": "^6.1.1", diff --git a/packages/whook-example/src/__snapshots__/cli.test.ts.snap b/packages/whook-example/src/__snapshots__/cli.test.ts.snap index 4d36f8d9..9007eb53 100644 --- a/packages/whook-example/src/__snapshots__/cli.test.ts.snap +++ b/packages/whook-example/src/__snapshots__/cli.test.ts.snap @@ -28,10 +28,18 @@ Object { ", "stdout": " -# Provided by \\"@whook/example\\": 3 commands +# Provided by \\"@whook/example\\": 4 commands - generateOpenAPISchema: Write openAPI schema to stdout - generateOpenAPITypes: Write openAPI types to stdout - printEnv: A command printing every env values +- terraformValues: A command printing functions informations for Terraform + + +# Provided by \\"@whook/gcp-functions\\": 1 commands +- testHTTPLambda: A command for testing AWS HTTP lambda + + +# Provided by \\"@whook/cors\\": none # Provided by \\"@whook/cli\\": 6 commands @@ -44,9 +52,6 @@ Object { # Provided by \\"@whook/whook\\": none - - -# Provided by \\"@whook/cors\\": none ", } `; diff --git a/packages/whook-example/src/__snapshots__/index.test.ts.snap b/packages/whook-example/src/__snapshots__/index.test.ts.snap index 0ecb9455..3c472f51 100644 --- a/packages/whook-example/src/__snapshots__/index.test.ts.snap +++ b/packages/whook-example/src/__snapshots__/index.test.ts.snap @@ -166,6 +166,9 @@ Object { Array [ "➰ - Plugin \\"@whook/cors\\" resolved to \\"/home/whoiam/projects/whook/packages/whook-cors/dist\\".", ], + Array [ + "➰ - Plugin \\"@whook/gcp-functions\\" resolved to \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist\\".", + ], Array [ "➰ - Plugin \\"@whook/whook\\" resolved to \\"/home/whoiam/projects/whook/dist\\".", ], @@ -325,9 +328,15 @@ Object { Array [ "🚫 - Service \\"BASE_URL\\" not found in \\"/home/whoiam/projects/whook/packages/whook-cli/dist/services/BASE_URL\\".", ], + Array [ + "🚫 - Service \\"BASE_URL\\" not found in \\"/home/whoiam/projects/whook/packages/whook-cors/dist/services/BASE_URL\\".", + ], Array [ "🚫 - Service \\"BASE_URL\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/BASE_URL\\".", ], + Array [ + "🚫 - Service \\"BASE_URL\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/BASE_URL\\".", + ], Array [ "🚫 - Service \\"BUFFER_LIMIT\\" not found in \\"/home/whoiam/projects/whook/dist/services/BUFFER_LIMIT\\".", ], @@ -340,6 +349,9 @@ Object { Array [ "🚫 - Service \\"BUFFER_LIMIT\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/BUFFER_LIMIT\\".", ], + Array [ + "🚫 - Service \\"BUFFER_LIMIT\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/BUFFER_LIMIT\\".", + ], Array [ "🚫 - Service \\"DECODERS\\" not found in \\"/home/whoiam/projects/whook/dist/services/DECODERS\\".", ], @@ -352,6 +364,9 @@ Object { Array [ "🚫 - Service \\"DECODERS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/DECODERS\\".", ], + Array [ + "🚫 - Service \\"DECODERS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/DECODERS\\".", + ], Array [ "🚫 - Service \\"DEFAULT_ERROR_CODE\\" not found in \\"/home/whoiam/projects/whook/dist/services/DEFAULT_ERROR_CODE\\".", ], @@ -364,6 +379,9 @@ Object { Array [ "🚫 - Service \\"DEFAULT_ERROR_CODE\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/DEFAULT_ERROR_CODE\\".", ], + Array [ + "🚫 - Service \\"DEFAULT_ERROR_CODE\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/DEFAULT_ERROR_CODE\\".", + ], Array [ "🚫 - Service \\"DEFAULT_MECHANISM\\" not found in \\"/home/whoiam/projects/whook/dist/services/DEFAULT_MECHANISM\\".", ], @@ -376,6 +394,9 @@ Object { Array [ "🚫 - Service \\"DEFAULT_MECHANISM\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/DEFAULT_MECHANISM\\".", ], + Array [ + "🚫 - Service \\"DEFAULT_MECHANISM\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/DEFAULT_MECHANISM\\".", + ], Array [ "🚫 - Service \\"DEV_ACCESS_TOKEN\\" not found in \\"/home/whoiam/projects/whook/dist/services/DEV_ACCESS_TOKEN\\".", ], @@ -388,6 +409,9 @@ Object { Array [ "🚫 - Service \\"DEV_ACCESS_TOKEN\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/DEV_ACCESS_TOKEN\\".", ], + Array [ + "🚫 - Service \\"DEV_ACCESS_TOKEN\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/DEV_ACCESS_TOKEN\\".", + ], Array [ "🚫 - Service \\"ENCODERS\\" not found in \\"/home/whoiam/projects/whook/dist/services/ENCODERS\\".", ], @@ -400,6 +424,9 @@ Object { Array [ "🚫 - Service \\"ENCODERS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/ENCODERS\\".", ], + Array [ + "🚫 - Service \\"ENCODERS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/ENCODERS\\".", + ], Array [ "🚫 - Service \\"IGNORED_FILES_PREFIXES\\" not found in \\"/home/whoiam/projects/whook/dist/services/IGNORED_FILES_PREFIXES\\".", ], @@ -412,6 +439,9 @@ Object { Array [ "🚫 - Service \\"IGNORED_FILES_PREFIXES\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/IGNORED_FILES_PREFIXES\\".", ], + Array [ + "🚫 - Service \\"IGNORED_FILES_PREFIXES\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/IGNORED_FILES_PREFIXES\\".", + ], Array [ "🚫 - Service \\"IGNORED_FILES_SUFFIXES\\" not found in \\"/home/whoiam/projects/whook/dist/services/IGNORED_FILES_SUFFIXES\\".", ], @@ -424,6 +454,9 @@ Object { Array [ "🚫 - Service \\"IGNORED_FILES_SUFFIXES\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/IGNORED_FILES_SUFFIXES\\".", ], + Array [ + "🚫 - Service \\"IGNORED_FILES_SUFFIXES\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/IGNORED_FILES_SUFFIXES\\".", + ], Array [ "🚫 - Service \\"JWT_SECRET_ENV_NAME\\" not found in \\"/home/whoiam/projects/whook/dist/services/JWT_SECRET_ENV_NAME\\".", ], @@ -436,6 +469,9 @@ Object { Array [ "🚫 - Service \\"JWT_SECRET_ENV_NAME\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/JWT_SECRET_ENV_NAME\\".", ], + Array [ + "🚫 - Service \\"JWT_SECRET_ENV_NAME\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/JWT_SECRET_ENV_NAME\\".", + ], Array [ "🚫 - Service \\"KEEP_ALIVE_TIMEOUT\\" not found in \\"/home/whoiam/projects/whook/dist/services/KEEP_ALIVE_TIMEOUT\\".", ], @@ -448,6 +484,9 @@ Object { Array [ "🚫 - Service \\"KEEP_ALIVE_TIMEOUT\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/KEEP_ALIVE_TIMEOUT\\".", ], + Array [ + "🚫 - Service \\"KEEP_ALIVE_TIMEOUT\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/KEEP_ALIVE_TIMEOUT\\".", + ], Array [ "🚫 - Service \\"MAX_CLEAR_CHARS\\" not found in \\"/home/whoiam/projects/whook/dist/services/MAX_CLEAR_CHARS\\".", ], @@ -460,6 +499,9 @@ Object { Array [ "🚫 - Service \\"MAX_CLEAR_CHARS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/MAX_CLEAR_CHARS\\".", ], + Array [ + "🚫 - Service \\"MAX_CLEAR_CHARS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/MAX_CLEAR_CHARS\\".", + ], Array [ "🚫 - Service \\"MAX_CLEAR_RATIO\\" not found in \\"/home/whoiam/projects/whook/dist/services/MAX_CLEAR_RATIO\\".", ], @@ -472,6 +514,9 @@ Object { Array [ "🚫 - Service \\"MAX_CLEAR_RATIO\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/MAX_CLEAR_RATIO\\".", ], + Array [ + "🚫 - Service \\"MAX_CLEAR_RATIO\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/MAX_CLEAR_RATIO\\".", + ], Array [ "🚫 - Service \\"MAX_CONNECTIONS\\" not found in \\"/home/whoiam/projects/whook/dist/services/MAX_CONNECTIONS\\".", ], @@ -484,6 +529,9 @@ Object { Array [ "🚫 - Service \\"MAX_CONNECTIONS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/MAX_CONNECTIONS\\".", ], + Array [ + "🚫 - Service \\"MAX_CONNECTIONS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/MAX_CONNECTIONS\\".", + ], Array [ "🚫 - Service \\"MAX_HEADERS_COUNT\\" not found in \\"/home/whoiam/projects/whook/dist/services/MAX_HEADERS_COUNT\\".", ], @@ -496,6 +544,9 @@ Object { Array [ "🚫 - Service \\"MAX_HEADERS_COUNT\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/MAX_HEADERS_COUNT\\".", ], + Array [ + "🚫 - Service \\"MAX_HEADERS_COUNT\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/MAX_HEADERS_COUNT\\".", + ], Array [ "🚫 - Service \\"PARSERS\\" not found in \\"/home/whoiam/projects/whook/dist/services/PARSERS\\".", ], @@ -508,6 +559,9 @@ Object { Array [ "🚫 - Service \\"PARSERS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/PARSERS\\".", ], + Array [ + "🚫 - Service \\"PARSERS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/PARSERS\\".", + ], Array [ "🚫 - Service \\"PROCESS_ENV\\" not found in \\"/home/whoiam/projects/whook/dist/services/PROCESS_ENV\\".", ], @@ -520,6 +574,9 @@ Object { Array [ "🚫 - Service \\"PROCESS_ENV\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/PROCESS_ENV\\".", ], + Array [ + "🚫 - Service \\"PROCESS_ENV\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/PROCESS_ENV\\".", + ], Array [ "🚫 - Service \\"PROCESS_NAME\\" not found in \\"/home/whoiam/projects/whook/dist/services/PROCESS_NAME\\".", ], @@ -532,6 +589,9 @@ Object { Array [ "🚫 - Service \\"PROCESS_NAME\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/PROCESS_NAME\\".", ], + Array [ + "🚫 - Service \\"PROCESS_NAME\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/PROCESS_NAME\\".", + ], Array [ "🚫 - Service \\"PROTOCOL\\" not found in \\"/home/whoiam/projects/whook/dist/services/PROTOCOL\\".", ], @@ -544,6 +604,9 @@ Object { Array [ "🚫 - Service \\"PROTOCOL\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/PROTOCOL\\".", ], + Array [ + "🚫 - Service \\"PROTOCOL\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/PROTOCOL\\".", + ], Array [ "🚫 - Service \\"REDUCED_FILES_SUFFIXES\\" not found in \\"/home/whoiam/projects/whook/dist/services/REDUCED_FILES_SUFFIXES\\".", ], @@ -556,6 +619,9 @@ Object { Array [ "🚫 - Service \\"REDUCED_FILES_SUFFIXES\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/REDUCED_FILES_SUFFIXES\\".", ], + Array [ + "🚫 - Service \\"REDUCED_FILES_SUFFIXES\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/REDUCED_FILES_SUFFIXES\\".", + ], Array [ "🚫 - Service \\"SENSIBLE_HEADERS\\" not found in \\"/home/whoiam/projects/whook/dist/services/SENSIBLE_HEADERS\\".", ], @@ -568,6 +634,9 @@ Object { Array [ "🚫 - Service \\"SENSIBLE_HEADERS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/SENSIBLE_HEADERS\\".", ], + Array [ + "🚫 - Service \\"SENSIBLE_HEADERS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/SENSIBLE_HEADERS\\".", + ], Array [ "🚫 - Service \\"SENSIBLE_PROPS\\" not found in \\"/home/whoiam/projects/whook/dist/services/SENSIBLE_PROPS\\".", ], @@ -580,6 +649,9 @@ Object { Array [ "🚫 - Service \\"SENSIBLE_PROPS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/SENSIBLE_PROPS\\".", ], + Array [ + "🚫 - Service \\"SENSIBLE_PROPS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/SENSIBLE_PROPS\\".", + ], Array [ "🚫 - Service \\"SHIELD_CHAR\\" not found in \\"/home/whoiam/projects/whook/dist/services/SHIELD_CHAR\\".", ], @@ -592,6 +664,9 @@ Object { Array [ "🚫 - Service \\"SHIELD_CHAR\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/SHIELD_CHAR\\".", ], + Array [ + "🚫 - Service \\"SHIELD_CHAR\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/SHIELD_CHAR\\".", + ], Array [ "🚫 - Service \\"SIGNALS\\" not found in \\"/home/whoiam/projects/whook/dist/services/SIGNALS\\".", ], @@ -604,6 +679,9 @@ Object { Array [ "🚫 - Service \\"SIGNALS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/SIGNALS\\".", ], + Array [ + "🚫 - Service \\"SIGNALS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/SIGNALS\\".", + ], Array [ "🚫 - Service \\"SOCKET_TIMEOUT\\" not found in \\"/home/whoiam/projects/whook/dist/services/SOCKET_TIMEOUT\\".", ], @@ -616,6 +694,9 @@ Object { Array [ "🚫 - Service \\"SOCKET_TIMEOUT\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/SOCKET_TIMEOUT\\".", ], + Array [ + "🚫 - Service \\"SOCKET_TIMEOUT\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/SOCKET_TIMEOUT\\".", + ], Array [ "🚫 - Service \\"STRINGIFYERS\\" not found in \\"/home/whoiam/projects/whook/dist/services/STRINGIFYERS\\".", ], @@ -628,6 +709,9 @@ Object { Array [ "🚫 - Service \\"STRINGIFYERS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/STRINGIFYERS\\".", ], + Array [ + "🚫 - Service \\"STRINGIFYERS\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/STRINGIFYERS\\".", + ], Array [ "🚫 - Service \\"TIMEOUT\\" not found in \\"/home/whoiam/projects/whook/dist/services/TIMEOUT\\".", ], @@ -640,21 +724,27 @@ Object { Array [ "🚫 - Service \\"TIMEOUT\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/TIMEOUT\\".", ], + Array [ + "🚫 - Service \\"TIMEOUT\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/TIMEOUT\\".", + ], Array [ "🚫 - Service \\"getPingWrapped\\" not found in \\"/home/whoiam/projects/whook/packages/whook-cli/dist/handlers/getPing\\".", ], Array [ - "🚫 - Service \\"getPingWrapped\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/handlers/getPing\\".", + "🚫 - Service \\"getPingWrapped\\" not found in \\"/home/whoiam/projects/whook/packages/whook-cors/dist/handlers/getPing\\".", ], Array [ - "🚫 - Service \\"optionsWithCORSWrapped\\" not found in \\"/home/whoiam/projects/whook/dist/handlers/optionsWithCORS\\".", + "🚫 - Service \\"getPingWrapped\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/handlers/getPing\\".", ], Array [ - "🚫 - Service \\"optionsWithCORSWrapped\\" not found in \\"/home/whoiam/projects/whook/packages/whook-cli/dist/handlers/optionsWithCORS\\".", + "🚫 - Service \\"getPingWrapped\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/handlers/getPing\\".", ], Array [ "🚫 - Service \\"optionsWithCORSWrapped\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/handlers/optionsWithCORS\\".", ], + Array [ + "🚫 - Service \\"optionsWithCORSWrapped\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/handlers/optionsWithCORS\\".", + ], Array [ "🚫 - Service \\"readDir\\" not found in \\"/home/whoiam/projects/whook/dist/services/readDir\\".", ], @@ -667,6 +757,9 @@ Object { Array [ "🚫 - Service \\"readDir\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/readDir\\".", ], + Array [ + "🚫 - Service \\"readDir\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/readDir\\".", + ], Array [ "🚫 - Service \\"readFile\\" not found in \\"/home/whoiam/projects/whook/dist/services/readFile\\".", ], @@ -679,6 +772,9 @@ Object { Array [ "🚫 - Service \\"readFile\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/readFile\\".", ], + Array [ + "🚫 - Service \\"readFile\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/readFile\\".", + ], Array [ "🚫 - Service \\"uniqueId\\" not found in \\"/home/whoiam/projects/whook/dist/services/uniqueId\\".", ], @@ -691,6 +787,9 @@ Object { Array [ "🚫 - Service \\"uniqueId\\" not found in \\"/home/whoiam/projects/whook/packages/whook-example/src/services/uniqueId\\".", ], + Array [ + "🚫 - Service \\"uniqueId\\" not found in \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/services/uniqueId\\".", + ], Array [ "🛂 - Dynamic import of \\"/home/whoiam/projects/whook/dist/handlers/getPing.js\\".", ], @@ -832,6 +931,9 @@ Object { Array [ "🛂 - Resolving \\"@whook/cors\\" to \\"/home/whoiam/projects/whook/packages/whook-cors/dist/index.js\\".", ], + Array [ + "🛂 - Resolving \\"@whook/gcp-functions\\" to \\"/home/whoiam/projects/whook/packages/whook-gcp-functions/dist/index.js\\".", + ], Array [ "🛂 - Resolving \\"@whook/whook\\" to \\"/home/whoiam/projects/whook/dist/index.js\\".", ], diff --git a/packages/whook-example/src/build.test.ts b/packages/whook-example/src/build.test.ts new file mode 100644 index 00000000..0899aff1 --- /dev/null +++ b/packages/whook-example/src/build.test.ts @@ -0,0 +1,35 @@ +import { exec } from 'child_process'; + +describe('build should work', () => { + [ + ['getPing', '{}'], + ['getOpenAPI', '{}'], + [ + 'getParameters', + '{ "aHeader": "true", "pathParam1":"4", "pathParam2":"a,b,c,d" }', + ], + ['getTime', '{}'], + ['getDelay', '{ "duration": 1 }'], + ['putEcho', '{"body": { "echo": "YOLO!" }}'], + ].forEach(([operationId, parameters]) => { + it(`with ${operationId} http lambdas`, async () => { + await execCommand( + `JWT_SECRET=test npx whook testHTTPFunction --name ${operationId} --parameters '${parameters}'`, + ); + }); + }); +}); + +async function execCommand( + command, +): Promise<{ stdout: string; stderr: string }> { + return new Promise((resolve, reject) => { + exec(command, (err, stdout, stderr) => { + if (err) { + reject(err); + return; + } + resolve({ stdout, stderr }); + }); + }); +} diff --git a/packages/whook-example/src/build.ts b/packages/whook-example/src/build.ts index 4df79fd2..05c98836 100644 --- a/packages/whook-example/src/build.ts +++ b/packages/whook-example/src/build.ts @@ -2,12 +2,13 @@ import { Knifecycle, constant, alsoInject } from 'knifecycle'; import { DEFAULT_BUILD_INITIALIZER_PATH_MAP, initBuildConstants, - runBuild as runBaseBuild, - prepareBuildEnvironment as prepareBaseBuildEnvironment, } from '@whook/whook'; import { prepareEnvironment } from './index.js'; import pkgDir from 'pkg-dir'; -import type { WhookCompilerOptions } from '@whook/whook'; +import { + runBuild as runBaseBuild, + prepareBuildEnvironment as prepareBaseBuildEnvironment, +} from '@whook/gcp-functions'; /* Architecture Note #1.2: The build file @@ -47,6 +48,13 @@ export async function prepareBuildEnvironment( constant('INITIALIZER_PATH_MAP', { ...DEFAULT_BUILD_INITIALIZER_PATH_MAP, // MY_SERVICE: '@my/service_module_name', + ENV: '@whook/whook/dist/services/ProxyedENV', + apm: '@whook/http-transaction/dist/services/apm', + obfuscator: '@whook/http-transaction/dist/services/obfuscator', + errorHandler: '@whook/http-router/dist/services/errorHandler', + log: '@whook/gcp-functions/dist/services/log', + time: 'common-services/dist/time', + delay: 'common-services/dist/delay', }), ); diff --git a/packages/whook-example/src/commands/terraformValues.ts b/packages/whook-example/src/commands/terraformValues.ts new file mode 100644 index 00000000..be9e4f71 --- /dev/null +++ b/packages/whook-example/src/commands/terraformValues.ts @@ -0,0 +1,224 @@ +import { extra, autoService } from 'knifecycle'; +import { readArgs } from '@whook/cli'; +import { flattenOpenAPI, getOpenAPIOperations } from '@whook/http-router'; +import { YError } from 'yerror'; +import { exec } from 'child_process'; +import crypto from 'crypto'; +import yaml from 'js-yaml'; +import type { ExecException } from 'child_process'; +import type { LogService } from 'common-services'; +import type { WhookCommandArgs, WhookCommandDefinition } from '@whook/cli'; +import type { WhookAPIHandlerDefinition } from '@whook/whook'; +import type { OpenAPIV3 } from 'openapi-types'; + +export const definition: WhookCommandDefinition = { + description: 'A command printing functions informations for Terraform', + example: `whook terraformValues --type paths`, + arguments: { + type: 'object', + additionalProperties: false, + required: ['type'], + properties: { + type: { + description: 'Type of values to return', + type: 'string', + enum: ['globals', 'paths', 'functions', 'function'], + }, + pretty: { + description: 'Pretty print JSON values', + type: 'boolean', + }, + functionName: { + description: 'Name of the function', + type: 'string', + }, + pathsIndex: { + description: 'Index of the paths to retrieve', + type: 'number', + }, + functionType: { + description: 'Types of the functions to return', + type: 'string', + }, + }, + }, +}; + +export default extra(definition, autoService(initTerraformValuesCommand)); + +async function initTerraformValuesCommand({ + API, + BASE_PATH, + log, + args, + execAsync = _execAsync, +}: { + API: OpenAPIV3.Document; + BASE_PATH: string; + log: LogService; + args: WhookCommandArgs; + execAsync: typeof _execAsync; +}) { + return async () => { + const { + namedArguments: { type, pretty, functionName, functionType }, + } = readArgs<{ + type: string; + pretty: boolean; + functionName: string; + functionType: string; + }>(definition.arguments, args); + const operations = getOpenAPIOperations< + WhookAPIHandlerDefinition['operation']['x-whook'] + >(await flattenOpenAPI(API)); + const configurations = operations.map((operation) => { + const whookConfiguration = (operation['x-whook'] || { + type: 'http', + }) as WhookAPIHandlerDefinition['operation']['x-whook']; + const configuration = { + type: 'http', + timeout: '10', + memory: '128', + description: operation.summary || '', + enabled: 'true', + sourceOperationId: operation.operationId, + suffix: '', + ...Object.keys(whookConfiguration || {}).reduce( + (accConfigurations, key) => ({ + ...accConfigurations, + [key]: ( + ( + whookConfiguration as NonNullable< + WhookAPIHandlerDefinition['operation']['x-whook'] + > + )[key] as string + ).toString(), + }), + {}, + ), + }; + const qualifiedOperationId = + (configuration.sourceOperationId || operation.operationId) + + (configuration.suffix || ''); + + return { + qualifiedOperationId, + method: operation.method.toUpperCase(), + path: operation.path, + ...configuration, + }; + }); + + if (type === 'globals') { + const commitHash = await execAsync(`git rev-parse HEAD`); + const commitMessage = ( + await execAsync(`git rev-list --format=%B --max-count=1 HEAD`) + ).split('\n')[1]; + const openapi2 = yaml.safeDump({ + swagger: '2.0', + info: { + title: API.info.title, + description: API.info.description, + version: API.info.version, + }, + host: '${infos_host}', + basePath: BASE_PATH, + schemes: ['https'], + produces: ['application/json'], + paths: configurations.reduce((accPaths, configuration) => { + const operation = operations.find( + ({ operationId }) => + operationId === configuration.sourceOperationId, + ); + + return { + ...accPaths, + [configuration.path]: { + ...(accPaths[configuration.path] || {}), + [configuration.method.toLowerCase()]: { + summary: configuration.description || '', + operationId: configuration.qualifiedOperationId, + ...((operation?.parameters || []).length + ? { + parameters: ( + operation?.parameters as OpenAPIV3.ParameterObject[] + ).map(({ in: theIn, name, required }) => ({ + in: theIn, + name, + type: 'string', + required: required || false, + })), + } + : undefined), + 'x-google-backend': { + address: `\${function_${configuration.qualifiedOperationId}}`, + }, + responses: { + '200': { description: 'x', schema: { type: 'string' } }, + }, + }, + }, + }; + }, {}), + }); + const openapiHash = crypto + .createHash('md5') + .update(JSON.stringify(API)) + .digest('hex'); + const infos = { + commitHash, + commitMessage, + openapi2, + openapiHash, + }; + log('info', JSON.stringify(infos)); + return; + } + + if (type === 'functions') { + const functions = configurations + .filter((configuration) => + functionType ? configuration.type === functionType : true, + ) + .reduce( + (accLambdas, configuration) => ({ + ...accLambdas, + [configuration.qualifiedOperationId]: + configuration.qualifiedOperationId, + }), + {}, + ); + + log('info', `${JSON.stringify(functions, null, pretty ? 2 : 0)}`); + return; + } + + if (!functionName) { + throw new YError('E_FUNCTION_NAME_REQUIRED'); + } + + const functionConfiguration = configurations.find( + ({ qualifiedOperationId }) => qualifiedOperationId === functionName, + ); + + log( + 'info', + `${JSON.stringify(functionConfiguration, null, pretty ? 2 : 0)}`, + ); + }; +} + +async function _execAsync(command: string): Promise { + return await new Promise((resolve, reject) => { + exec( + command, + (err: ExecException | null, stdout: string, stderr: string) => { + if (err) { + reject(YError.wrap(err, 'E_EXEC_FAILURE', stderr)); + return; + } + resolve(stdout.trim()); + }, + ); + }); +} diff --git a/packages/whook-example/src/config/common/config.ts b/packages/whook-example/src/config/common/config.ts index 425ebc90..deaf1e39 100644 --- a/packages/whook-example/src/config/common/config.ts +++ b/packages/whook-example/src/config/common/config.ts @@ -29,9 +29,17 @@ const CONFIG: Omit = { CONFIG: { name: _packageJSON.name, description: _packageJSON.description || '', + baseURL: 'https://api.example.com', }, NODE_ENVS, DEBUG_NODE_ENVS: process.env.DEBUG ? NODE_ENVS : DEBUG_NODE_ENVS, + COMPILER_OPTIONS: { + externalModules: ['portfinder', 'internal-ip'], + ignoredModules: ['ecstatic', 'swagger-ui-dist'], + excludeNodeModules: true, + }, + BUILD_PARALLELISM: 10, + PROXYED_ENV_VARS: ['NODE_ENV', 'JWT_SECRET'], SERVICE_NAME_MAP: {}, ERRORS_DESCRIPTORS: { ...DEFAULT_ERRORS_DESCRIPTORS, diff --git a/packages/whook-example/src/config/test/config.ts b/packages/whook-example/src/config/test/config.ts index 609179c3..708e3b2b 100644 --- a/packages/whook-example/src/config/test/config.ts +++ b/packages/whook-example/src/config/test/config.ts @@ -2,6 +2,10 @@ import COMMON_CONFIG from '../common/config.js'; import type { WhookConfigs } from '@whook/whook'; const CONFIG: WhookConfigs = { + BASE_ENV: { + ...COMMON_CONFIG.BASE_ENV, + JWT_SECRET: 'yop', + }, ...COMMON_CONFIG, HOST: 'localhost', }; diff --git a/packages/whook-example/src/index.ts b/packages/whook-example/src/index.ts index c4960de6..88ac5aaa 100644 --- a/packages/whook-example/src/index.ts +++ b/packages/whook-example/src/index.ts @@ -177,7 +177,12 @@ export async function prepareEnvironment( You can also avoid Whook defaults by leaving it empty. */ $.register( - constant('WHOOK_PLUGINS', ['@whook/cli', '@whook/whook', '@whook/cors']), + constant('WHOOK_PLUGINS', [ + '@whook/gcp-functions', + '@whook/cors', + '@whook/cli', + '@whook/whook', + ]), ); // Add the CORS wrapped error handler diff --git a/packages/whook-example/src/whook.d.ts b/packages/whook-example/src/whook.d.ts index 3d276b95..67d2dc6d 100644 --- a/packages/whook-example/src/whook.d.ts +++ b/packages/whook-example/src/whook.d.ts @@ -3,6 +3,8 @@ import type { WhookBaseEnv, WhookBaseConfigs, WhookAPIOperation, + ProxyedENVConfig, + WhookCompilerConfig, } from '@whook/whook'; import type { WhookAuthorizationConfig } from '@whook/authorization'; import type { @@ -13,6 +15,10 @@ import type { import type { WhookAPIOperationCORSConfig, WhookCORSConfig } from '@whook/cors'; import type { APIConfig } from './services/API.js'; import type { JWTServiceConfig } from 'jwt-service'; +import type { + WhookAPIOperationGCPFunctionConfig, + WhookGCPBuildConfig, +} from '@whook/gcp-functions'; declare module '@whook/whook' { // Eventually override the process env type here @@ -29,6 +35,9 @@ The configuration is typed so that you are sure you cannot WhookSwaggerUIConfig, WhookCORSConfig, APIConfig, + ProxyedENVConfig, + WhookCompilerConfig, + WhookGCPBuildConfig, JWTServiceConfig {} /* Architecture Note #3.2.3: Typings @@ -46,7 +55,18 @@ Here we export a custom handler definition type in order > extends WhookBaseAPIHandlerDefinition { operation: U & WhookAPIOperation< - T & WhookAPIOperationSwaggerConfig & WhookAPIOperationCORSConfig + T & + WhookAPIOperationGCPFunctionConfig & + WhookAPIOperationSwaggerConfig & + WhookAPIOperationCORSConfig & + // TODO: Add those properties to Whook GCP Functions? + { + private?: boolean; + memory?: number; + timeout?: number; + suffix?: string; + sourceOperationId?: string; + } >; } } diff --git a/packages/whook-example/terraform/functions.tf b/packages/whook-example/terraform/functions.tf new file mode 100644 index 00000000..c19b9f70 --- /dev/null +++ b/packages/whook-example/terraform/functions.tf @@ -0,0 +1,53 @@ +data "external" "functionConfiguration" { + for_each = data.external.functions.result + + program = ["env", "NODE_ENV=${terraform.workspace}", "npx", "whook", "terraformValues", "--type='function'", "--functionName='${each.key}'"] +} + +resource "google_storage_bucket" "storage_bucket" { + name = "whook_functions" +} + +data "archive_file" "functions" { + for_each = data.external.functions.result + + type = "zip" + source_dir = "./builds/${terraform.workspace}/${each.key}" + output_path = "./builds/${terraform.workspace}/${each.key}.zip" +} + +resource "google_storage_bucket_object" "storage_bucket_object" { + for_each = data.external.functions.result + + name = "${terraform.workspace}_${each.key}" + source = "./builds/${terraform.workspace}/${each.key}.zip" + bucket = google_storage_bucket.storage_bucket.name + depends_on = [data.archive_file.functions] +} + +resource "google_cloudfunctions_function" "cloudfunctions_function" { + for_each = data.external.functions.result + + name = "${terraform.workspace}_${each.key}" + description = data.external.functionConfiguration[each.key].result["description"] + runtime = "nodejs10" + + available_memory_mb = data.external.functionConfiguration[each.key].result["memory"] + timeout = data.external.functionConfiguration[each.key].result["timeout"] + source_archive_bucket = google_storage_bucket.storage_bucket.name + source_archive_object = google_storage_bucket_object.storage_bucket_object[each.key].name + trigger_http = true + entry_point = "default" +} + +# Seems to not work (no idea why) +# resource "google_cloudfunctions_function_iam_member" "invoker" { +# for_each = data.external.functions.result + +# project = google_cloudfunctions_function.cloudfunctions_function[each.key].project +# region = google_cloudfunctions_function.cloudfunctions_function[each.key].region +# cloud_function = google_cloudfunctions_function.cloudfunctions_function[each.key].name + +# role = "roles/cloudfunctions.invoker" +# member = "allUsers" +# } diff --git a/packages/whook-example/terraform/main.tf b/packages/whook-example/terraform/main.tf new file mode 100644 index 00000000..ff7c5946 --- /dev/null +++ b/packages/whook-example/terraform/main.tf @@ -0,0 +1,67 @@ +variable "project_id" { + type = string +} + +variable "region" { + type = string + default = "europe-west1" +} + +variable "zone" { + type = string + default = "europe-west1-b" +} + +variable "api_name" { + type = string + default = "api2" +} + +provider "google" { + version = "~> 3.14" + project = var.project_id + region = var.region + zone = var.zone + credentials = file(".credentials.json") +} + +provider "archive" { + version = "~> 1.3" +} + +provider "template" { + version = "~> 2.1.2" +} + +output "api_url" { + value = google_endpoints_service.endpoints_service.dns_address +} + +data "google_project" "project" { + project_id = var.project_id +} + +# imports the functions list +data "external" "functions" { + program = ["env", "NODE_ENV=${terraform.workspace}", "npx", "whook", "terraformValues", "--type='functions'", "--functionType='http'"] +} +data "external" "globals" { + program = ["env", "NODE_ENV=${terraform.workspace}", "npx", "whook", "terraformValues", "--type='globals'"] +} + +data "template_file" "template_file" { + template = data.external.globals.result["openapi2"] + + vars = merge({ + "infos_host" : "${var.api_name}.endpoints.${data.google_project.project.project_id}.cloud.goog" + }, zipmap( + [for key in keys(data.external.functions.result) : "function_${key}"], + [for key in keys(data.external.functions.result) : google_cloudfunctions_function.cloudfunctions_function[key].https_trigger_url] + )) +} + +resource "google_endpoints_service" "endpoints_service" { + service_name = "${var.api_name}.endpoints.${data.google_project.project.project_id}.cloud.goog" + project = data.google_project.project.project_id + openapi_config = data.template_file.template_file.rendered +} diff --git a/packages/whook-gcp-functions/src/index.ts b/packages/whook-gcp-functions/src/index.ts index 25189c87..ce6869fa 100644 --- a/packages/whook-gcp-functions/src/index.ts +++ b/packages/whook-gcp-functions/src/index.ts @@ -78,7 +78,7 @@ const BUILD_DEFINITIONS: Record< wrapper: { name: 'wrapHandlerForGoogleHTTPFunction', path: path.join( - path.dirname(require.resolve('@whook/gcp-function')), + path.dirname(require.resolve('@whook/gcp-functions')), 'wrappers/googleHTTPFunction.js', ), },