From e97f1e9722b8d7002a70964e0cb17a583cad1be2 Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Fri, 6 Jan 2023 18:32:49 +0000 Subject: [PATCH 1/9] feat: object transformers on server client --- package-lock.json | 2329 ++++++----------- .../__tests__/__dataSets__/camelCase.ts | 110 + .../__tests__/__dataSets__/index.ts | 13 + .../__tests__/__dataSets__/snakeCase.ts | 110 + .../server-client/__tests__/client.test.ts | 42 +- packages/server-client/lib/client.ts | 357 ++- packages/server-client/lib/transformers.ts | 41 + packages/server-client/package.json | 5 +- tsconfig.json | 4 +- 9 files changed, 1324 insertions(+), 1687 deletions(-) create mode 100644 packages/server-client/__tests__/__dataSets__/camelCase.ts create mode 100644 packages/server-client/__tests__/__dataSets__/index.ts create mode 100644 packages/server-client/__tests__/__dataSets__/snakeCase.ts create mode 100644 packages/server-client/lib/transformers.ts diff --git a/package-lock.json b/package-lock.json index ca1f07b8..0f5fc532 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,7 +67,7 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.20.10", + "version": "7.20.5", "dev": true, "license": "MIT", "engines": { @@ -104,11 +104,11 @@ } }, "node_modules/@babel/generator": { - "version": "7.20.7", + "version": "7.20.5", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.20.7", + "@babel/types": "^7.20.5", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -153,14 +153,13 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.20.7", + "version": "7.20.0", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.20.5", + "@babel/compat-data": "^7.20.0", "@babel/helper-validator-option": "^7.18.6", "browserslist": "^4.21.3", - "lru-cache": "^5.1.1", "semver": "^6.3.0" }, "engines": { @@ -171,17 +170,16 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.20.12", + "version": "7.20.5", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", - "@babel/helper-member-expression-to-functions": "^7.20.7", + "@babel/helper-member-expression-to-functions": "^7.18.9", "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-replace-supers": "^7.20.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", + "@babel/helper-replace-supers": "^7.19.1", "@babel/helper-split-export-declaration": "^7.18.6" }, "engines": { @@ -265,11 +263,11 @@ } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.20.7", + "version": "7.18.9", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.20.7" + "@babel/types": "^7.18.9" }, "engines": { "node": ">=6.9.0" @@ -287,7 +285,7 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.20.11", + "version": "7.20.2", "dev": true, "license": "MIT", "dependencies": { @@ -296,9 +294,9 @@ "@babel/helper-simple-access": "^7.20.2", "@babel/helper-split-export-declaration": "^7.18.6", "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.10", - "@babel/types": "^7.20.7" + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.20.1", + "@babel/types": "^7.20.2" }, "engines": { "node": ">=6.9.0" @@ -341,16 +339,15 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.20.7", + "version": "7.19.1", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-member-expression-to-functions": "^7.20.7", + "@babel/helper-member-expression-to-functions": "^7.18.9", "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/traverse": "^7.19.1", + "@babel/types": "^7.19.0" }, "engines": { "node": ">=6.9.0" @@ -428,13 +425,13 @@ } }, "node_modules/@babel/helpers": { - "version": "7.20.7", + "version": "7.20.6", "dev": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5" }, "engines": { "node": ">=6.9.0" @@ -454,7 +451,7 @@ } }, "node_modules/@babel/parser": { - "version": "7.20.7", + "version": "7.20.5", "dev": true, "license": "MIT", "bin": { @@ -479,13 +476,13 @@ } }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.20.7", + "version": "7.18.9", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/plugin-proposal-optional-chaining": "^7.20.7" + "@babel/helper-plugin-utils": "^7.18.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9", + "@babel/plugin-proposal-optional-chaining": "^7.18.9" }, "engines": { "node": ">=6.9.0" @@ -495,12 +492,12 @@ } }, "node_modules/@babel/plugin-proposal-async-generator-functions": { - "version": "7.20.7", + "version": "7.20.1", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-plugin-utils": "^7.19.0", "@babel/helper-remap-async-to-generator": "^7.18.9", "@babel/plugin-syntax-async-generators": "^7.8.4" }, @@ -527,12 +524,12 @@ } }, "node_modules/@babel/plugin-proposal-class-static-block": { - "version": "7.20.7", + "version": "7.18.6", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.20.7", - "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-create-class-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6", "@babel/plugin-syntax-class-static-block": "^7.14.5" }, "engines": { @@ -588,11 +585,11 @@ } }, "node_modules/@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.20.7", + "version": "7.18.9", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-plugin-utils": "^7.18.9", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" }, "engines": { @@ -633,15 +630,15 @@ } }, "node_modules/@babel/plugin-proposal-object-rest-spread": { - "version": "7.20.7", + "version": "7.20.2", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.20.5", - "@babel/helper-compilation-targets": "^7.20.7", + "@babel/compat-data": "^7.20.1", + "@babel/helper-compilation-targets": "^7.20.0", "@babel/helper-plugin-utils": "^7.20.2", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.20.7" + "@babel/plugin-transform-parameters": "^7.20.1" }, "engines": { "node": ">=6.9.0" @@ -666,12 +663,12 @@ } }, "node_modules/@babel/plugin-proposal-optional-chaining": { - "version": "7.20.7", + "version": "7.18.9", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", + "@babel/helper-plugin-utils": "^7.18.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9", "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, "engines": { @@ -956,11 +953,11 @@ } }, "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.20.7", + "version": "7.18.6", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.18.6" }, "engines": { "node": ">=6.9.0" @@ -970,13 +967,13 @@ } }, "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.20.7", + "version": "7.18.6", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-remap-async-to-generator": "^7.18.9" + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/helper-remap-async-to-generator": "^7.18.6" }, "engines": { "node": ">=6.9.0" @@ -1000,7 +997,7 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.20.11", + "version": "7.20.5", "dev": true, "license": "MIT", "dependencies": { @@ -1014,17 +1011,17 @@ } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.20.7", + "version": "7.20.2", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-compilation-targets": "^7.20.0", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-optimise-call-expression": "^7.18.6", "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-replace-supers": "^7.20.7", + "@babel/helper-replace-supers": "^7.19.1", "@babel/helper-split-export-declaration": "^7.18.6", "globals": "^11.1.0" }, @@ -1036,12 +1033,11 @@ } }, "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.20.7", + "version": "7.18.9", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/template": "^7.20.7" + "@babel/helper-plugin-utils": "^7.18.9" }, "engines": { "node": ">=6.9.0" @@ -1051,7 +1047,7 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.20.7", + "version": "7.20.2", "dev": true, "license": "MIT", "dependencies": { @@ -1167,12 +1163,12 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.20.11", + "version": "7.19.6", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-module-transforms": "^7.19.6", + "@babel/helper-plugin-utils": "^7.19.0" }, "engines": { "node": ">=6.9.0" @@ -1182,13 +1178,13 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.20.11", + "version": "7.19.6", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-simple-access": "^7.20.2" + "@babel/helper-module-transforms": "^7.19.6", + "@babel/helper-plugin-utils": "^7.19.0", + "@babel/helper-simple-access": "^7.19.4" }, "engines": { "node": ">=6.9.0" @@ -1198,13 +1194,13 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.20.11", + "version": "7.19.6", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-module-transforms": "^7.19.6", + "@babel/helper-plugin-utils": "^7.19.0", "@babel/helper-validator-identifier": "^7.19.1" }, "engines": { @@ -1274,7 +1270,7 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.20.7", + "version": "7.20.5", "dev": true, "license": "MIT", "dependencies": { @@ -1345,12 +1341,12 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.20.7", + "version": "7.19.0", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0" + "@babel/helper-plugin-utils": "^7.19.0", + "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9" }, "engines": { "node": ">=6.9.0" @@ -1566,7 +1562,7 @@ } }, "node_modules/@babel/runtime": { - "version": "7.20.7", + "version": "7.20.6", "dev": true, "license": "MIT", "dependencies": { @@ -1577,31 +1573,31 @@ } }, "node_modules/@babel/template": { - "version": "7.20.7", + "version": "7.18.10", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/parser": "^7.18.10", + "@babel/types": "^7.18.10" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.20.12", + "version": "7.20.5", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.7", + "@babel/generator": "^7.20.5", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", + "@babel/parser": "^7.20.5", + "@babel/types": "^7.20.5", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1610,7 +1606,7 @@ } }, "node_modules/@babel/types": { - "version": "7.20.7", + "version": "7.20.5", "dev": true, "license": "MIT", "dependencies": { @@ -1648,14 +1644,14 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.4.1", + "version": "1.3.3", "dev": true, "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.4.0", - "globals": "^13.19.0", + "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -1675,7 +1671,7 @@ "license": "Python-2.0" }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.19.0", + "version": "13.18.0", "dev": true, "license": "MIT", "dependencies": { @@ -1716,7 +1712,7 @@ "license": "MIT" }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", + "version": "0.11.7", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -2413,15 +2409,15 @@ } }, "node_modules/@lerna/add": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/bootstrap": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/npm-conf": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/bootstrap": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/filter-options": "6.0.3", + "@lerna/npm-conf": "6.0.3", + "@lerna/validation-error": "6.0.3", "dedent": "^0.7.0", "npm-package-arg": "8.1.1", "p-map": "^4.0.0", @@ -2457,28 +2453,23 @@ "node": ">=10" } }, - "node_modules/@lerna/add/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@lerna/bootstrap": { - "version": "6.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@lerna/command": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/has-npm-version": "6.4.0", - "@lerna/npm-install": "6.4.0", - "@lerna/package-graph": "6.4.0", - "@lerna/pulse-till-done": "6.4.0", - "@lerna/rimraf-dir": "6.4.0", - "@lerna/run-lifecycle": "6.4.0", - "@lerna/run-topologically": "6.4.0", - "@lerna/symlink-binary": "6.4.0", - "@lerna/symlink-dependencies": "6.4.0", - "@lerna/validation-error": "6.4.0", + "version": "6.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@lerna/command": "6.0.3", + "@lerna/filter-options": "6.0.3", + "@lerna/has-npm-version": "6.0.3", + "@lerna/npm-install": "6.0.3", + "@lerna/package-graph": "6.0.3", + "@lerna/pulse-till-done": "6.0.3", + "@lerna/rimraf-dir": "6.0.3", + "@lerna/run-lifecycle": "6.0.3", + "@lerna/run-topologically": "6.0.3", + "@lerna/symlink-binary": "6.0.3", + "@lerna/symlink-dependencies": "6.0.3", + "@lerna/validation-error": "6.0.3", "@npmcli/arborist": "5.3.0", "dedent": "^0.7.0", "get-port": "^5.1.1", @@ -2519,40 +2510,35 @@ "node": ">=10" } }, - "node_modules/@lerna/bootstrap/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@lerna/changed": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/collect-updates": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/listable": "6.4.0", - "@lerna/output": "6.4.0" + "@lerna/collect-updates": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/listable": "6.0.3", + "@lerna/output": "6.0.3" }, "engines": { "node": "^14.15.0 || >=16.0.0" } }, "node_modules/@lerna/check-working-tree": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/collect-uncommitted": "6.4.0", - "@lerna/describe-ref": "6.4.0", - "@lerna/validation-error": "6.4.0" + "@lerna/collect-uncommitted": "6.0.3", + "@lerna/describe-ref": "6.0.3", + "@lerna/validation-error": "6.0.3" }, "engines": { "node": "^14.15.0 || >=16.0.0" } }, "node_modules/@lerna/child-process": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -2629,15 +2615,15 @@ } }, "node_modules/@lerna/clean": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/command": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/prompt": "6.4.0", - "@lerna/pulse-till-done": "6.4.0", - "@lerna/rimraf-dir": "6.4.0", + "@lerna/command": "6.0.3", + "@lerna/filter-options": "6.0.3", + "@lerna/prompt": "6.0.3", + "@lerna/pulse-till-done": "6.0.3", + "@lerna/rimraf-dir": "6.0.3", "p-map": "^4.0.0", "p-map-series": "^2.1.0", "p-waterfall": "^2.1.1" @@ -2647,11 +2633,11 @@ } }, "node_modules/@lerna/cli": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/global-options": "6.4.0", + "@lerna/global-options": "6.0.3", "dedent": "^0.7.0", "npmlog": "^6.0.2", "yargs": "^16.2.0" @@ -2678,11 +2664,11 @@ } }, "node_modules/@lerna/collect-uncommitted": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", + "@lerna/child-process": "6.0.3", "chalk": "^4.1.0", "npmlog": "^6.0.2" }, @@ -2755,12 +2741,12 @@ } }, "node_modules/@lerna/collect-updates": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", - "@lerna/describe-ref": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/describe-ref": "6.0.3", "minimatch": "^3.0.4", "npmlog": "^6.0.2", "slash": "^3.0.0" @@ -2770,15 +2756,15 @@ } }, "node_modules/@lerna/command": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", - "@lerna/package-graph": "6.4.0", - "@lerna/project": "6.4.0", - "@lerna/validation-error": "6.4.0", - "@lerna/write-log-file": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/package-graph": "6.0.3", + "@lerna/project": "6.0.3", + "@lerna/validation-error": "6.0.3", + "@lerna/write-log-file": "6.0.3", "clone-deep": "^4.0.1", "dedent": "^0.7.0", "execa": "^5.0.0", @@ -2806,11 +2792,11 @@ } }, "node_modules/@lerna/conventional-commits": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/validation-error": "6.4.0", + "@lerna/validation-error": "6.0.3", "conventional-changelog-angular": "^5.0.12", "conventional-changelog-core": "^4.2.4", "conventional-recommended-bump": "^6.1.0", @@ -2850,20 +2836,15 @@ "node": ">=10" } }, - "node_modules/@lerna/conventional-commits/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@lerna/create": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/npm-conf": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/npm-conf": "6.0.3", + "@lerna/validation-error": "6.0.3", "dedent": "^0.7.0", "fs-extra": "^9.1.0", "init-package-json": "^3.0.2", @@ -2882,7 +2863,7 @@ } }, "node_modules/@lerna/create-symlink": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -2919,17 +2900,12 @@ "node": ">=10" } }, - "node_modules/@lerna/create/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@lerna/describe-ref": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", + "@lerna/child-process": "6.0.3", "npmlog": "^6.0.2" }, "engines": { @@ -2937,13 +2913,13 @@ } }, "node_modules/@lerna/diff": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/validation-error": "6.0.3", "npmlog": "^6.0.2" }, "engines": { @@ -2951,16 +2927,16 @@ } }, "node_modules/@lerna/exec": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/profiler": "6.4.0", - "@lerna/run-topologically": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/filter-options": "6.0.3", + "@lerna/profiler": "6.0.3", + "@lerna/run-topologically": "6.0.3", + "@lerna/validation-error": "6.0.3", "p-map": "^4.0.0" }, "engines": { @@ -2968,12 +2944,12 @@ } }, "node_modules/@lerna/filter-options": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/collect-updates": "6.4.0", - "@lerna/filter-packages": "6.4.0", + "@lerna/collect-updates": "6.0.3", + "@lerna/filter-packages": "6.0.3", "dedent": "^0.7.0", "npmlog": "^6.0.2" }, @@ -2982,11 +2958,11 @@ } }, "node_modules/@lerna/filter-packages": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/validation-error": "6.4.0", + "@lerna/validation-error": "6.0.3", "multimatch": "^5.0.0", "npmlog": "^6.0.2" }, @@ -2995,7 +2971,7 @@ } }, "node_modules/@lerna/get-npm-exec-opts": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3006,7 +2982,7 @@ } }, "node_modules/@lerna/get-packed": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3019,11 +2995,11 @@ } }, "node_modules/@lerna/github-client": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", + "@lerna/child-process": "6.0.3", "@octokit/plugin-enterprise-rest": "^6.0.1", "@octokit/rest": "^19.0.3", "git-url-parse": "^13.1.0", @@ -3034,7 +3010,7 @@ } }, "node_modules/@lerna/gitlab-client": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3046,7 +3022,7 @@ } }, "node_modules/@lerna/global-options": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "engines": { @@ -3054,11 +3030,11 @@ } }, "node_modules/@lerna/has-npm-version": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", + "@lerna/child-process": "6.0.3", "semver": "^7.3.4" }, "engines": { @@ -3090,21 +3066,16 @@ "node": ">=10" } }, - "node_modules/@lerna/has-npm-version/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@lerna/import": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/prompt": "6.4.0", - "@lerna/pulse-till-done": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/prompt": "6.0.3", + "@lerna/pulse-till-done": "6.0.3", + "@lerna/validation-error": "6.0.3", "dedent": "^0.7.0", "fs-extra": "^9.1.0", "p-map-series": "^2.1.0" @@ -3114,12 +3085,12 @@ } }, "node_modules/@lerna/info": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/command": "6.4.0", - "@lerna/output": "6.4.0", + "@lerna/command": "6.0.3", + "@lerna/output": "6.0.3", "envinfo": "^7.7.4" }, "engines": { @@ -3127,13 +3098,13 @@ } }, "node_modules/@lerna/init": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/project": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/project": "6.0.3", "fs-extra": "^9.1.0", "p-map": "^4.0.0", "write-json-file": "^4.3.0" @@ -3143,14 +3114,14 @@ } }, "node_modules/@lerna/link": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/command": "6.4.0", - "@lerna/package-graph": "6.4.0", - "@lerna/symlink-dependencies": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/command": "6.0.3", + "@lerna/package-graph": "6.0.3", + "@lerna/symlink-dependencies": "6.0.3", + "@lerna/validation-error": "6.0.3", "p-map": "^4.0.0", "slash": "^3.0.0" }, @@ -3159,25 +3130,25 @@ } }, "node_modules/@lerna/list": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/command": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/listable": "6.4.0", - "@lerna/output": "6.4.0" + "@lerna/command": "6.0.3", + "@lerna/filter-options": "6.0.3", + "@lerna/listable": "6.0.3", + "@lerna/output": "6.0.3" }, "engines": { "node": "^14.15.0 || >=16.0.0" } }, "node_modules/@lerna/listable": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/query-graph": "6.4.0", + "@lerna/query-graph": "6.0.3", "chalk": "^4.1.0", "columnify": "^1.6.0" }, @@ -3250,7 +3221,7 @@ } }, "node_modules/@lerna/log-packed": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3264,7 +3235,7 @@ } }, "node_modules/@lerna/npm-conf": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3276,11 +3247,11 @@ } }, "node_modules/@lerna/npm-dist-tag": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/otplease": "6.4.0", + "@lerna/otplease": "6.0.3", "npm-package-arg": "8.1.1", "npm-registry-fetch": "^13.3.0", "npmlog": "^6.0.2" @@ -3290,12 +3261,12 @@ } }, "node_modules/@lerna/npm-install": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", - "@lerna/get-npm-exec-opts": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/get-npm-exec-opts": "6.0.3", "fs-extra": "^9.1.0", "npm-package-arg": "8.1.1", "npmlog": "^6.0.2", @@ -3307,12 +3278,12 @@ } }, "node_modules/@lerna/npm-publish": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/otplease": "6.4.0", - "@lerna/run-lifecycle": "6.4.0", + "@lerna/otplease": "6.0.3", + "@lerna/run-lifecycle": "6.0.3", "fs-extra": "^9.1.0", "libnpmpublish": "^6.0.4", "npm-package-arg": "8.1.1", @@ -3325,12 +3296,12 @@ } }, "node_modules/@lerna/npm-run-script": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", - "@lerna/get-npm-exec-opts": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/get-npm-exec-opts": "6.0.3", "npmlog": "^6.0.2" }, "engines": { @@ -3338,18 +3309,18 @@ } }, "node_modules/@lerna/otplease": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/prompt": "6.4.0" + "@lerna/prompt": "6.0.3" }, "engines": { "node": "^14.15.0 || >=16.0.0" } }, "node_modules/@lerna/output": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3360,14 +3331,14 @@ } }, "node_modules/@lerna/pack-directory": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/get-packed": "6.4.0", - "@lerna/package": "6.4.0", - "@lerna/run-lifecycle": "6.4.0", - "@lerna/temp-write": "6.4.0", + "@lerna/get-packed": "6.0.3", + "@lerna/package": "6.0.3", + "@lerna/run-lifecycle": "6.0.3", + "@lerna/temp-write": "6.0.3", "npm-packlist": "^5.1.1", "npmlog": "^6.0.2", "tar": "^6.1.0" @@ -3377,7 +3348,7 @@ } }, "node_modules/@lerna/package": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3390,12 +3361,12 @@ } }, "node_modules/@lerna/package-graph": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/prerelease-id-from-version": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/prerelease-id-from-version": "6.0.3", + "@lerna/validation-error": "6.0.3", "npm-package-arg": "8.1.1", "npmlog": "^6.0.2", "semver": "^7.3.4" @@ -3429,13 +3400,8 @@ "node": ">=10" } }, - "node_modules/@lerna/package-graph/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@lerna/prerelease-id-from-version": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3470,13 +3436,8 @@ "node": ">=10" } }, - "node_modules/@lerna/prerelease-id-from-version/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@lerna/profiler": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3489,12 +3450,12 @@ } }, "node_modules/@lerna/project": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/package": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/package": "6.0.3", + "@lerna/validation-error": "6.0.3", "cosmiconfig": "^7.0.0", "dedent": "^0.7.0", "dot-prop": "^6.0.1", @@ -3539,7 +3500,7 @@ } }, "node_modules/@lerna/prompt": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3551,29 +3512,29 @@ } }, "node_modules/@lerna/publish": { - "version": "6.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@lerna/check-working-tree": "6.4.0", - "@lerna/child-process": "6.4.0", - "@lerna/collect-updates": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/describe-ref": "6.4.0", - "@lerna/log-packed": "6.4.0", - "@lerna/npm-conf": "6.4.0", - "@lerna/npm-dist-tag": "6.4.0", - "@lerna/npm-publish": "6.4.0", - "@lerna/otplease": "6.4.0", - "@lerna/output": "6.4.0", - "@lerna/pack-directory": "6.4.0", - "@lerna/prerelease-id-from-version": "6.4.0", - "@lerna/prompt": "6.4.0", - "@lerna/pulse-till-done": "6.4.0", - "@lerna/run-lifecycle": "6.4.0", - "@lerna/run-topologically": "6.4.0", - "@lerna/validation-error": "6.4.0", - "@lerna/version": "6.4.0", + "version": "6.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@lerna/check-working-tree": "6.0.3", + "@lerna/child-process": "6.0.3", + "@lerna/collect-updates": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/describe-ref": "6.0.3", + "@lerna/log-packed": "6.0.3", + "@lerna/npm-conf": "6.0.3", + "@lerna/npm-dist-tag": "6.0.3", + "@lerna/npm-publish": "6.0.3", + "@lerna/otplease": "6.0.3", + "@lerna/output": "6.0.3", + "@lerna/pack-directory": "6.0.3", + "@lerna/prerelease-id-from-version": "6.0.3", + "@lerna/prompt": "6.0.3", + "@lerna/pulse-till-done": "6.0.3", + "@lerna/run-lifecycle": "6.0.3", + "@lerna/run-topologically": "6.0.3", + "@lerna/validation-error": "6.0.3", + "@lerna/version": "6.0.3", "fs-extra": "^9.1.0", "libnpmaccess": "^6.0.3", "npm-package-arg": "8.1.1", @@ -3613,13 +3574,8 @@ "node": ">=10" } }, - "node_modules/@lerna/publish/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@lerna/pulse-till-done": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3630,18 +3586,18 @@ } }, "node_modules/@lerna/query-graph": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/package-graph": "6.4.0" + "@lerna/package-graph": "6.0.3" }, "engines": { "node": "^14.15.0 || >=16.0.0" } }, "node_modules/@lerna/resolve-symlink": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3654,11 +3610,11 @@ } }, "node_modules/@lerna/rimraf-dir": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/child-process": "6.4.0", + "@lerna/child-process": "6.0.3", "npmlog": "^6.0.2", "path-exists": "^4.0.0", "rimraf": "^3.0.2" @@ -3676,20 +3632,19 @@ } }, "node_modules/@lerna/run": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/command": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/npm-run-script": "6.4.0", - "@lerna/output": "6.4.0", - "@lerna/profiler": "6.4.0", - "@lerna/run-topologically": "6.4.0", - "@lerna/timer": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/command": "6.0.3", + "@lerna/filter-options": "6.0.3", + "@lerna/npm-run-script": "6.0.3", + "@lerna/output": "6.0.3", + "@lerna/profiler": "6.0.3", + "@lerna/run-topologically": "6.0.3", + "@lerna/timer": "6.0.3", + "@lerna/validation-error": "6.0.3", "fs-extra": "^9.1.0", - "nx": ">=14.8.6 < 16", "p-map": "^4.0.0" }, "engines": { @@ -3697,11 +3652,11 @@ } }, "node_modules/@lerna/run-lifecycle": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/npm-conf": "6.4.0", + "@lerna/npm-conf": "6.0.3", "@npmcli/run-script": "^4.1.7", "npmlog": "^6.0.2", "p-queue": "^6.6.2" @@ -3711,11 +3666,11 @@ } }, "node_modules/@lerna/run-topologically": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/query-graph": "6.4.0", + "@lerna/query-graph": "6.0.3", "p-queue": "^6.6.2" }, "engines": { @@ -3723,12 +3678,12 @@ } }, "node_modules/@lerna/symlink-binary": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/create-symlink": "6.4.0", - "@lerna/package": "6.4.0", + "@lerna/create-symlink": "6.0.3", + "@lerna/package": "6.0.3", "fs-extra": "^9.1.0", "p-map": "^4.0.0" }, @@ -3737,13 +3692,13 @@ } }, "node_modules/@lerna/symlink-dependencies": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { - "@lerna/create-symlink": "6.4.0", - "@lerna/resolve-symlink": "6.4.0", - "@lerna/symlink-binary": "6.4.0", + "@lerna/create-symlink": "6.0.3", + "@lerna/resolve-symlink": "6.0.3", + "@lerna/symlink-binary": "6.0.3", "fs-extra": "^9.1.0", "p-map": "^4.0.0", "p-map-series": "^2.1.0" @@ -3753,7 +3708,7 @@ } }, "node_modules/@lerna/temp-write": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3765,7 +3720,7 @@ } }, "node_modules/@lerna/timer": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "engines": { @@ -3773,7 +3728,7 @@ } }, "node_modules/@lerna/validation-error": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -3784,25 +3739,25 @@ } }, "node_modules/@lerna/version": { - "version": "6.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@lerna/check-working-tree": "6.4.0", - "@lerna/child-process": "6.4.0", - "@lerna/collect-updates": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/conventional-commits": "6.4.0", - "@lerna/github-client": "6.4.0", - "@lerna/gitlab-client": "6.4.0", - "@lerna/output": "6.4.0", - "@lerna/prerelease-id-from-version": "6.4.0", - "@lerna/prompt": "6.4.0", - "@lerna/run-lifecycle": "6.4.0", - "@lerna/run-topologically": "6.4.0", - "@lerna/temp-write": "6.4.0", - "@lerna/validation-error": "6.4.0", - "@nrwl/devkit": ">=15.4.2 < 16", + "version": "6.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@lerna/check-working-tree": "6.0.3", + "@lerna/child-process": "6.0.3", + "@lerna/collect-updates": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/conventional-commits": "6.0.3", + "@lerna/github-client": "6.0.3", + "@lerna/gitlab-client": "6.0.3", + "@lerna/output": "6.0.3", + "@lerna/prerelease-id-from-version": "6.0.3", + "@lerna/prompt": "6.0.3", + "@lerna/run-lifecycle": "6.0.3", + "@lerna/run-topologically": "6.0.3", + "@lerna/temp-write": "6.0.3", + "@lerna/validation-error": "6.0.3", + "@nrwl/devkit": ">=14.8.6 < 16", "chalk": "^4.1.0", "dedent": "^0.7.0", "load-json-file": "^6.2.0", @@ -3909,13 +3864,8 @@ "node": ">=8" } }, - "node_modules/@lerna/version/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@lerna/write-log-file": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "license": "MIT", "dependencies": { @@ -4016,14 +3966,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@npmcli/arborist/node_modules/lru-cache": { - "version": "7.14.1", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/@npmcli/arborist/node_modules/npm-package-arg": { "version": "9.1.2", "dev": true, @@ -4063,11 +4005,6 @@ "node": ">=10" } }, - "node_modules/@npmcli/arborist/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@npmcli/fs": { "version": "2.1.2", "dev": true, @@ -4105,11 +4042,6 @@ "node": ">=10" } }, - "node_modules/@npmcli/fs/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@npmcli/git": { "version": "3.0.2", "dev": true, @@ -4129,14 +4061,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@npmcli/git/node_modules/lru-cache": { - "version": "7.14.1", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/@npmcli/git/node_modules/semver": { "version": "7.3.8", "dev": true, @@ -4162,11 +4086,6 @@ "node": ">=10" } }, - "node_modules/@npmcli/git/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@npmcli/installed-package-contents": { "version": "1.0.7", "dev": true, @@ -4223,7 +4142,7 @@ } }, "node_modules/@npmcli/map-workspaces/node_modules/minimatch": { - "version": "5.1.2", + "version": "5.1.0", "dev": true, "license": "ISC", "dependencies": { @@ -4272,11 +4191,6 @@ "node": ">=10" } }, - "node_modules/@npmcli/metavuln-calculator/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@npmcli/move-file": { "version": "2.0.1", "dev": true, @@ -4340,15 +4254,15 @@ } }, "node_modules/@nrwl/cli": { - "version": "15.4.5", + "version": "15.2.1", "dev": true, "license": "MIT", "dependencies": { - "nx": "15.4.5" + "nx": "15.2.1" } }, "node_modules/@nrwl/devkit": { - "version": "15.4.5", + "version": "15.2.1", "dev": true, "license": "MIT", "dependencies": { @@ -4387,17 +4301,12 @@ "node": ">=10" } }, - "node_modules/@nrwl/devkit/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@nrwl/tao": { - "version": "15.4.5", + "version": "15.2.1", "dev": true, "license": "MIT", "dependencies": { - "nx": "15.4.5" + "nx": "15.2.1" }, "bin": { "tao": "index.js" @@ -4684,7 +4593,7 @@ "license": "MIT" }, "node_modules/@types/graceful-fs": { - "version": "4.1.6", + "version": "4.1.5", "dev": true, "license": "MIT", "dependencies": { @@ -4713,7 +4622,7 @@ } }, "node_modules/@types/jest": { - "version": "29.2.5", + "version": "29.2.3", "dev": true, "license": "MIT", "dependencies": { @@ -4726,6 +4635,11 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/json5": { + "version": "0.0.29", + "dev": true, + "license": "MIT" + }, "node_modules/@types/minimatch": { "version": "3.0.5", "dev": true, @@ -4738,8 +4652,9 @@ }, "node_modules/@types/node": { "version": "18.11.18", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", + "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==", + "dev": true }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -4752,7 +4667,7 @@ "license": "MIT" }, "node_modules/@types/prettier": { - "version": "2.7.2", + "version": "2.7.1", "dev": true, "license": "MIT" }, @@ -4778,11 +4693,12 @@ }, "node_modules/@types/uuid": { "version": "9.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-kr90f+ERiQtKWMz5rP32ltJ/BtULDI5RVO0uavn1HQUOwjx0R1h0rnDYNL0CepF1zL5bSY6FISAfd9tOdDhU5Q==", + "dev": true }, "node_modules/@types/yargs": { - "version": "17.0.19", + "version": "17.0.15", "dev": true, "license": "MIT", "dependencies": { @@ -4851,96 +4767,12 @@ "node": ">=10" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@typescript-eslint/experimental-utils": { - "version": "5.48.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/utils": "5.48.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "5.48.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "5.48.1", - "@typescript-eslint/visitor-keys": "5.48.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/types": { - "version": "5.48.1", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.48.1", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/types": "5.48.1", - "@typescript-eslint/visitor-keys": "5.48.1", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/utils": { - "version": "5.48.1", + "version": "5.45.0", "dev": true, "license": "MIT", "dependencies": { - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.48.1", - "@typescript-eslint/types": "5.48.1", - "@typescript-eslint/typescript-estree": "5.48.1", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0", - "semver": "^7.3.7" + "@typescript-eslint/utils": "5.45.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -4953,52 +4785,6 @@ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.48.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "5.48.1", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/lru-cache": { - "version": "6.0.0", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/semver": { - "version": "7.3.8", - "dev": true, - "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@typescript-eslint/parser": { "version": "5.45.0", "dev": true, @@ -5130,11 +4916,6 @@ "node": ">=10" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@typescript-eslint/utils": { "version": "5.45.0", "dev": true, @@ -5185,11 +4966,6 @@ "node": ">=10" } }, - "node_modules/@typescript-eslint/utils/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/@typescript-eslint/visitor-keys": { "version": "5.45.0", "dev": true, @@ -5272,7 +5048,7 @@ "license": "BSD-2-Clause" }, "node_modules/@yarnpkg/parsers": { - "version": "3.0.0-rc.35", + "version": "3.0.0-rc.31", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -5536,7 +5312,7 @@ } }, "node_modules/axios": { - "version": "1.2.2", + "version": "1.2.0", "dev": true, "license": "MIT", "dependencies": { @@ -5937,11 +5713,6 @@ "node": ">=10" } }, - "node_modules/builtins/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/byte-size": { "version": "7.0.1", "dev": true, @@ -6004,16 +5775,8 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/cacache/node_modules/lru-cache": { - "version": "7.14.1", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/cacache/node_modules/minimatch": { - "version": "5.1.2", + "version": "5.1.0", "dev": true, "license": "ISC", "dependencies": { @@ -6056,7 +5819,7 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001442", + "version": "1.0.30001434", "dev": true, "funding": [ { @@ -6142,14 +5905,8 @@ } }, "node_modules/ci-info": { - "version": "3.7.1", + "version": "3.7.0", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], "license": "MIT", "engines": { "node": ">=8" @@ -6477,7 +6234,7 @@ } }, "node_modules/commander": { - "version": "9.5.0", + "version": "9.4.1", "dev": true, "license": "MIT", "engines": { @@ -6674,7 +6431,7 @@ "license": "MIT" }, "node_modules/core-js-compat": { - "version": "3.27.1", + "version": "3.26.1", "dev": true, "license": "MIT", "dependencies": { @@ -7394,7 +7151,7 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.19.0", + "version": "13.18.0", "dev": true, "license": "MIT", "dependencies": { @@ -7675,7 +7432,7 @@ "license": "MIT" }, "node_modules/fastq": { - "version": "1.15.0", + "version": "1.13.0", "dev": true, "license": "ISC", "dependencies": { @@ -7732,7 +7489,7 @@ } }, "node_modules/filelist/node_modules/minimatch": { - "version": "5.1.2", + "version": "5.1.0", "dev": true, "license": "ISC", "dependencies": { @@ -8282,11 +8039,6 @@ "node": ">=10" } }, - "node_modules/hosted-git-info/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/html-escaper": { "version": "2.0.2", "dev": true, @@ -8339,7 +8091,7 @@ } }, "node_modules/husky": { - "version": "8.0.3", + "version": "8.0.2", "dev": true, "license": "MIT", "bin": { @@ -8383,7 +8135,7 @@ "license": "BSD-3-Clause" }, "node_modules/ignore": { - "version": "5.2.4", + "version": "5.2.1", "dev": true, "license": "MIT", "engines": { @@ -8410,7 +8162,7 @@ } }, "node_modules/ignore-walk/node_modules/minimatch": { - "version": "5.1.2", + "version": "5.1.0", "dev": true, "license": "ISC", "dependencies": { @@ -8529,14 +8281,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/init-package-json/node_modules/lru-cache": { - "version": "7.14.1", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/init-package-json/node_modules/npm-package-arg": { "version": "9.1.2", "dev": true, @@ -8576,11 +8320,6 @@ "node": ">=10" } }, - "node_modules/init-package-json/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/inquirer": { "version": "8.2.5", "dev": true, @@ -8736,14 +8475,11 @@ } }, "node_modules/is-fullwidth-code-point": { - "version": "4.0.0", + "version": "3.0.0", "dev": true, "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/is-generator-fn": { @@ -10224,11 +9960,6 @@ "node": ">=8" } }, - "node_modules/jest-snapshot/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/jest-util": { "version": "29.3.1", "dev": true, @@ -10589,7 +10320,7 @@ "license": "ISC" }, "node_modules/json5": { - "version": "2.2.3", + "version": "2.2.1", "dev": true, "license": "MIT", "bin": { @@ -10640,7 +10371,8 @@ }, "node_modules/jsonwebtoken": { "version": "9.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", + "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==", "dependencies": { "jws": "^3.2.2", "lodash": "^4.17.21", @@ -10654,7 +10386,8 @@ }, "node_modules/jsonwebtoken/node_modules/lru-cache": { "version": "6.0.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dependencies": { "yallist": "^4.0.0" }, @@ -10664,7 +10397,8 @@ }, "node_modules/jsonwebtoken/node_modules/semver": { "version": "7.3.8", - "license": "ISC", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -10675,17 +10409,13 @@ "node": ">=10" } }, - "node_modules/jsonwebtoken/node_modules/yallist": { - "version": "4.0.0", - "license": "ISC" - }, "node_modules/just-diff": { - "version": "5.2.0", + "version": "5.1.1", "dev": true, "license": "MIT" }, "node_modules/just-diff-apply": { - "version": "5.5.0", + "version": "5.4.1", "dev": true, "license": "MIT" }, @@ -10723,34 +10453,32 @@ } }, "node_modules/lerna": { - "version": "6.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@lerna/add": "6.4.0", - "@lerna/bootstrap": "6.4.0", - "@lerna/changed": "6.4.0", - "@lerna/clean": "6.4.0", - "@lerna/cli": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/create": "6.4.0", - "@lerna/diff": "6.4.0", - "@lerna/exec": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/import": "6.4.0", - "@lerna/info": "6.4.0", - "@lerna/init": "6.4.0", - "@lerna/link": "6.4.0", - "@lerna/list": "6.4.0", - "@lerna/publish": "6.4.0", - "@lerna/run": "6.4.0", - "@lerna/validation-error": "6.4.0", - "@lerna/version": "6.4.0", - "@nrwl/devkit": ">=15.4.2 < 16", + "version": "6.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@lerna/add": "6.0.3", + "@lerna/bootstrap": "6.0.3", + "@lerna/changed": "6.0.3", + "@lerna/clean": "6.0.3", + "@lerna/cli": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/create": "6.0.3", + "@lerna/diff": "6.0.3", + "@lerna/exec": "6.0.3", + "@lerna/import": "6.0.3", + "@lerna/info": "6.0.3", + "@lerna/init": "6.0.3", + "@lerna/link": "6.0.3", + "@lerna/list": "6.0.3", + "@lerna/publish": "6.0.3", + "@lerna/run": "6.0.3", + "@lerna/version": "6.0.3", + "@nrwl/devkit": ">=14.8.6 < 16", "import-local": "^3.0.2", "inquirer": "^8.2.4", "npmlog": "^6.0.2", - "nx": ">=15.4.2 < 16", + "nx": ">=14.8.6 < 16", "typescript": "^3 || ^4" }, "bin": { @@ -10901,14 +10629,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/libnpmaccess/node_modules/lru-cache": { - "version": "7.14.1", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/libnpmaccess/node_modules/npm-package-arg": { "version": "9.1.2", "dev": true, @@ -10948,11 +10668,6 @@ "node": ">=10" } }, - "node_modules/libnpmaccess/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/libnpmpublish": { "version": "6.0.5", "dev": true, @@ -10979,14 +10694,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/libnpmpublish/node_modules/lru-cache": { - "version": "7.14.1", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/libnpmpublish/node_modules/normalize-package-data": { "version": "4.0.1", "dev": true, @@ -11040,11 +10747,6 @@ "node": ">=10" } }, - "node_modules/libnpmpublish/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/lilconfig": { "version": "2.0.6", "dev": true, @@ -11190,7 +10892,7 @@ } }, "node_modules/lint-staged/node_modules/yaml": { - "version": "2.2.1", + "version": "2.1.3", "dev": true, "license": "ISC", "engines": { @@ -11268,14 +10970,6 @@ "dev": true, "license": "MIT" }, - "node_modules/listr2/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/listr2/node_modules/slice-ansi": { "version": "3.0.0", "dev": true, @@ -11326,6 +11020,10 @@ "version": "4.17.21", "license": "MIT" }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "license": "MIT" + }, "node_modules/lodash.debounce": { "version": "4.0.8", "dev": true, @@ -11344,6 +11042,14 @@ "version": "4.5.0", "license": "MIT" }, + "node_modules/lodash.partial": { + "version": "4.2.1", + "license": "MIT" + }, + "node_modules/lodash.snakecase": { + "version": "4.1.1", + "license": "MIT" + }, "node_modules/log-symbols": { "version": "4.1.0", "dev": true, @@ -11470,14 +11176,6 @@ "dev": true, "license": "MIT" }, - "node_modules/log-update/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/log-update/node_modules/slice-ansi": { "version": "4.0.0", "dev": true, @@ -11579,11 +11277,11 @@ } }, "node_modules/lru-cache": { - "version": "5.1.1", + "version": "7.14.1", "dev": true, "license": "ISC", - "dependencies": { - "yallist": "^3.0.2" + "engines": { + "node": ">=12" } }, "node_modules/make-dir": { @@ -11732,11 +11430,6 @@ "imurmurhash": "^0.1.4" } }, - "node_modules/make-fetch-happen/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/makeerror": { "version": "1.0.12", "dev": true, @@ -12033,11 +11726,6 @@ "node": ">=8" } }, - "node_modules/minipass/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/minizlib": { "version": "2.1.2", "dev": true, @@ -12050,11 +11738,6 @@ "node": ">= 8" } }, - "node_modules/minizlib/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/mkdirp": { "version": "1.0.4", "dev": true, @@ -12193,7 +11876,7 @@ } }, "node_modules/node-gyp": { - "version": "9.3.1", + "version": "9.3.0", "dev": true, "license": "MIT", "dependencies": { @@ -12212,11 +11895,11 @@ "node-gyp": "bin/node-gyp.js" }, "engines": { - "node": "^12.13 || ^14.13 || >=16" + "node": "^12.22 || ^14.13 || >=16" } }, "node_modules/node-gyp-build": { - "version": "4.6.0", + "version": "4.5.0", "dev": true, "license": "MIT", "bin": { @@ -12246,14 +11929,6 @@ "node": ">= 6" } }, - "node_modules/node-gyp/node_modules/lru-cache": { - "version": "7.14.1", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/node-gyp/node_modules/make-fetch-happen": { "version": "10.2.1", "dev": true, @@ -12348,18 +12023,13 @@ "node": ">= 10" } }, - "node_modules/node-gyp/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/node-int64": { "version": "0.4.0", "dev": true, "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.8", + "version": "2.0.6", "dev": true, "license": "MIT" }, @@ -12416,11 +12086,6 @@ "node": ">=10" } }, - "node_modules/normalize-package-data/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/normalize-path": { "version": "3.0.0", "dev": true, @@ -12473,11 +12138,6 @@ "node": ">=10" } }, - "node_modules/npm-install-checks/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/npm-normalize-package-bin": { "version": "1.0.1", "dev": true, @@ -12543,12 +12203,7 @@ "license": "ISC", "dependencies": { "builtins": "^1.0.3" - } - }, - "node_modules/npm-package-arg/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" + } }, "node_modules/npm-packlist": { "version": "5.1.3", @@ -12594,7 +12249,7 @@ } }, "node_modules/npm-packlist/node_modules/minimatch": { - "version": "5.1.2", + "version": "5.1.0", "dev": true, "license": "ISC", "dependencies": { @@ -12648,14 +12303,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/npm-pick-manifest/node_modules/lru-cache": { - "version": "7.14.1", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin": { "version": "2.0.0", "dev": true, @@ -12703,11 +12350,6 @@ "node": ">=10" } }, - "node_modules/npm-pick-manifest/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/npm-registry-fetch": { "version": "13.3.1", "dev": true, @@ -12757,14 +12399,6 @@ "node": ">= 6" } }, - "node_modules/npm-registry-fetch/node_modules/lru-cache": { - "version": "7.14.1", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/npm-registry-fetch/node_modules/make-fetch-happen": { "version": "10.2.1", "dev": true, @@ -12859,11 +12493,6 @@ "node": ">= 10" } }, - "node_modules/npm-registry-fetch/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/npm-run-path": { "version": "4.0.1", "dev": true, @@ -12890,13 +12519,13 @@ } }, "node_modules/nx": { - "version": "15.4.5", + "version": "15.2.1", "dev": true, "hasInstallScript": true, "license": "MIT", "dependencies": { - "@nrwl/cli": "15.4.5", - "@nrwl/tao": "15.4.5", + "@nrwl/cli": "15.2.1", + "@nrwl/tao": "15.2.1", "@parcel/watcher": "2.0.4", "@yarnpkg/lockfile": "^1.1.0", "@yarnpkg/parsers": "^3.0.0-rc.18", @@ -12925,7 +12554,7 @@ "strong-log-transformer": "^2.1.0", "tar-stream": "~2.2.0", "tmp": "~0.2.1", - "tsconfig-paths": "^4.1.2", + "tsconfig-paths": "^3.9.0", "tslib": "^2.3.0", "v8-compile-cache": "2.3.0", "yargs": "^17.6.2", @@ -13129,11 +12758,6 @@ "node": ">=8.17.0" } }, - "node_modules/nx/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/nx/node_modules/yargs-parser": { "version": "21.1.1", "dev": true, @@ -13487,14 +13111,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/pacote/node_modules/lru-cache": { - "version": "7.14.1", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/pacote/node_modules/npm-package-arg": { "version": "9.1.2", "dev": true, @@ -13534,11 +13150,6 @@ "node": ">=10" } }, - "node_modules/pacote/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/parent-module": { "version": "1.0.1", "dev": true, @@ -13963,7 +13574,7 @@ "license": "MIT" }, "node_modules/punycode": { - "version": "2.2.0", + "version": "2.1.1", "dev": true, "license": "MIT", "engines": { @@ -14093,16 +13704,8 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/read-package-json/node_modules/lru-cache": { - "version": "7.14.1", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/read-package-json/node_modules/minimatch": { - "version": "5.1.2", + "version": "5.1.0", "dev": true, "license": "ISC", "dependencies": { @@ -14159,11 +13762,6 @@ "node": ">=10" } }, - "node_modules/read-package-json/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/read-pkg": { "version": "3.0.0", "dev": true, @@ -14585,7 +14183,7 @@ } }, "node_modules/rxjs": { - "version": "7.8.0", + "version": "7.5.7", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -14702,6 +14300,17 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/smart-buffer": { "version": "4.2.0", "dev": true, @@ -14899,14 +14508,6 @@ "node": ">=8" } }, - "node_modules/string-width/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/strip-ansi": { "version": "6.0.1", "dev": true, @@ -14995,13 +14596,13 @@ } }, "node_modules/tar": { - "version": "6.1.13", + "version": "6.1.12", "dev": true, "license": "ISC", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", - "minipass": "^4.0.0", + "minipass": "^3.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" @@ -15025,22 +14626,6 @@ "node": ">=6" } }, - "node_modules/tar/node_modules/minipass": { - "version": "4.0.0", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/tar/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/temp-dir": { "version": "1.0.0", "dev": true, @@ -15268,16 +14853,25 @@ } }, "node_modules/tsconfig-paths": { - "version": "4.1.2", + "version": "3.14.1", "dev": true, "license": "MIT", "dependencies": { - "json5": "^2.2.2", + "@types/json5": "^0.0.29", + "json5": "^1.0.1", "minimist": "^1.2.6", "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" }, - "engines": { - "node": ">=6" + "bin": { + "json5": "lib/cli.js" } }, "node_modules/tsconfig-paths/node_modules/strip-bom": { @@ -15372,7 +14966,7 @@ } }, "node_modules/typescript": { - "version": "4.9.4", + "version": "4.9.3", "dev": true, "license": "Apache-2.0", "bin": { @@ -15632,11 +15226,6 @@ "node": ">=10" } }, - "node_modules/vue-eslint-parser/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/walk-up-path": { "version": "1.0.0", "dev": true, @@ -15917,8 +15506,7 @@ } }, "node_modules/yallist": { - "version": "3.1.1", - "dev": true, + "version": "4.0.0", "license": "ISC" }, "node_modules/yaml": { @@ -16019,6 +15607,9 @@ "nock": "^13.2.9" } }, + "packages/audit": { + "extraneous": true + }, "packages/auth": { "name": "@vonage/auth", "version": "1.0.9", @@ -16044,7 +15635,8 @@ }, "packages/jwt/node_modules/uuid": { "version": "9.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", "bin": { "uuid": "dist/bin/uuid" } @@ -16108,7 +15700,10 @@ "license": "Apache-2.0", "dependencies": { "@vonage/auth": "^1.0.9", - "@vonage/vetch": "^1.0.10" + "@vonage/vetch": "^1.0.10", + "lodash.camelcase": "^4.3.0", + "lodash.partial": "^4.2.1", + "lodash.snakecase": "^4.1.1" } }, "packages/server-sdk": { @@ -16213,7 +15808,7 @@ } }, "@babel/compat-data": { - "version": "7.20.10", + "version": "7.20.5", "dev": true }, "@babel/core": { @@ -16238,10 +15833,10 @@ } }, "@babel/generator": { - "version": "7.20.7", + "version": "7.20.5", "dev": true, "requires": { - "@babel/types": "^7.20.7", + "@babel/types": "^7.20.5", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -16273,27 +15868,25 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.20.7", + "version": "7.20.0", "dev": true, "requires": { - "@babel/compat-data": "^7.20.5", + "@babel/compat-data": "^7.20.0", "@babel/helper-validator-option": "^7.18.6", "browserslist": "^4.21.3", - "lru-cache": "^5.1.1", "semver": "^6.3.0" } }, "@babel/helper-create-class-features-plugin": { - "version": "7.20.12", + "version": "7.20.5", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.18.6", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", - "@babel/helper-member-expression-to-functions": "^7.20.7", + "@babel/helper-member-expression-to-functions": "^7.18.9", "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-replace-supers": "^7.20.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", + "@babel/helper-replace-supers": "^7.19.1", "@babel/helper-split-export-declaration": "^7.18.6" } }, @@ -16344,10 +15937,10 @@ } }, "@babel/helper-member-expression-to-functions": { - "version": "7.20.7", + "version": "7.18.9", "dev": true, "requires": { - "@babel/types": "^7.20.7" + "@babel/types": "^7.18.9" } }, "@babel/helper-module-imports": { @@ -16358,7 +15951,7 @@ } }, "@babel/helper-module-transforms": { - "version": "7.20.11", + "version": "7.20.2", "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.18.9", @@ -16366,9 +15959,9 @@ "@babel/helper-simple-access": "^7.20.2", "@babel/helper-split-export-declaration": "^7.18.6", "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.10", - "@babel/types": "^7.20.7" + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.20.1", + "@babel/types": "^7.20.2" } }, "@babel/helper-optimise-call-expression": { @@ -16393,15 +15986,14 @@ } }, "@babel/helper-replace-supers": { - "version": "7.20.7", + "version": "7.19.1", "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-member-expression-to-functions": "^7.20.7", + "@babel/helper-member-expression-to-functions": "^7.18.9", "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/traverse": "^7.19.1", + "@babel/types": "^7.19.0" } }, "@babel/helper-simple-access": { @@ -16448,12 +16040,12 @@ } }, "@babel/helpers": { - "version": "7.20.7", + "version": "7.20.6", "dev": true, "requires": { - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5" } }, "@babel/highlight": { @@ -16466,7 +16058,7 @@ } }, "@babel/parser": { - "version": "7.20.7", + "version": "7.20.5", "dev": true }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { @@ -16477,20 +16069,20 @@ } }, "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.20.7", + "version": "7.18.9", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/plugin-proposal-optional-chaining": "^7.20.7" + "@babel/helper-plugin-utils": "^7.18.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9", + "@babel/plugin-proposal-optional-chaining": "^7.18.9" } }, "@babel/plugin-proposal-async-generator-functions": { - "version": "7.20.7", + "version": "7.20.1", "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-plugin-utils": "^7.19.0", "@babel/helper-remap-async-to-generator": "^7.18.9", "@babel/plugin-syntax-async-generators": "^7.8.4" } @@ -16504,11 +16096,11 @@ } }, "@babel/plugin-proposal-class-static-block": { - "version": "7.20.7", + "version": "7.18.6", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.20.7", - "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-create-class-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6", "@babel/plugin-syntax-class-static-block": "^7.14.5" } }, @@ -16537,10 +16129,10 @@ } }, "@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.20.7", + "version": "7.18.9", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-plugin-utils": "^7.18.9", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" } }, @@ -16561,14 +16153,14 @@ } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.20.7", + "version": "7.20.2", "dev": true, "requires": { - "@babel/compat-data": "^7.20.5", - "@babel/helper-compilation-targets": "^7.20.7", + "@babel/compat-data": "^7.20.1", + "@babel/helper-compilation-targets": "^7.20.0", "@babel/helper-plugin-utils": "^7.20.2", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.20.7" + "@babel/plugin-transform-parameters": "^7.20.1" } }, "@babel/plugin-proposal-optional-catch-binding": { @@ -16580,11 +16172,11 @@ } }, "@babel/plugin-proposal-optional-chaining": { - "version": "7.20.7", + "version": "7.18.9", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", + "@babel/helper-plugin-utils": "^7.18.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9", "@babel/plugin-syntax-optional-chaining": "^7.8.3" } }, @@ -16748,19 +16340,19 @@ } }, "@babel/plugin-transform-arrow-functions": { - "version": "7.20.7", + "version": "7.18.6", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.18.6" } }, "@babel/plugin-transform-async-to-generator": { - "version": "7.20.7", + "version": "7.18.6", "dev": true, "requires": { "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-remap-async-to-generator": "^7.18.9" + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/helper-remap-async-to-generator": "^7.18.6" } }, "@babel/plugin-transform-block-scoped-functions": { @@ -16771,37 +16363,36 @@ } }, "@babel/plugin-transform-block-scoping": { - "version": "7.20.11", + "version": "7.20.5", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.20.2" } }, "@babel/plugin-transform-classes": { - "version": "7.20.7", + "version": "7.20.2", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-compilation-targets": "^7.20.0", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-optimise-call-expression": "^7.18.6", "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-replace-supers": "^7.20.7", + "@babel/helper-replace-supers": "^7.19.1", "@babel/helper-split-export-declaration": "^7.18.6", "globals": "^11.1.0" } }, "@babel/plugin-transform-computed-properties": { - "version": "7.20.7", + "version": "7.18.9", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/template": "^7.20.7" + "@babel/helper-plugin-utils": "^7.18.9" } }, "@babel/plugin-transform-destructuring": { - "version": "7.20.7", + "version": "7.20.2", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.20.2" @@ -16861,29 +16452,29 @@ } }, "@babel/plugin-transform-modules-amd": { - "version": "7.20.11", + "version": "7.19.6", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-module-transforms": "^7.19.6", + "@babel/helper-plugin-utils": "^7.19.0" } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.20.11", + "version": "7.19.6", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-simple-access": "^7.20.2" + "@babel/helper-module-transforms": "^7.19.6", + "@babel/helper-plugin-utils": "^7.19.0", + "@babel/helper-simple-access": "^7.19.4" } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.20.11", + "version": "7.19.6", "dev": true, "requires": { "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-module-transforms": "^7.19.6", + "@babel/helper-plugin-utils": "^7.19.0", "@babel/helper-validator-identifier": "^7.19.1" } }, @@ -16919,7 +16510,7 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.20.7", + "version": "7.20.5", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.20.2" @@ -16955,11 +16546,11 @@ } }, "@babel/plugin-transform-spread": { - "version": "7.20.7", + "version": "7.19.0", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0" + "@babel/helper-plugin-utils": "^7.19.0", + "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9" } }, "@babel/plugin-transform-sticky-regex": { @@ -17109,39 +16700,39 @@ } }, "@babel/runtime": { - "version": "7.20.7", + "version": "7.20.6", "dev": true, "requires": { "regenerator-runtime": "^0.13.11" } }, "@babel/template": { - "version": "7.20.7", + "version": "7.18.10", "dev": true, "requires": { "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/parser": "^7.18.10", + "@babel/types": "^7.18.10" } }, "@babel/traverse": { - "version": "7.20.12", + "version": "7.20.5", "dev": true, "requires": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.7", + "@babel/generator": "^7.20.5", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", + "@babel/parser": "^7.20.5", + "@babel/types": "^7.20.5", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.20.7", + "version": "7.20.5", "dev": true, "requires": { "@babel/helper-string-parser": "^7.19.4", @@ -17171,13 +16762,13 @@ } }, "@eslint/eslintrc": { - "version": "1.4.1", + "version": "1.3.3", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.4.0", - "globals": "^13.19.0", + "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -17190,7 +16781,7 @@ "dev": true }, "globals": { - "version": "13.19.0", + "version": "13.18.0", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -17214,7 +16805,7 @@ "dev": true }, "@humanwhocodes/config-array": { - "version": "0.11.8", + "version": "0.11.7", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", @@ -17673,14 +17264,14 @@ } }, "@lerna/add": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/bootstrap": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/npm-conf": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/bootstrap": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/filter-options": "6.0.3", + "@lerna/npm-conf": "6.0.3", + "@lerna/validation-error": "6.0.3", "dedent": "^0.7.0", "npm-package-arg": "8.1.1", "p-map": "^4.0.0", @@ -17701,29 +17292,25 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, "@lerna/bootstrap": { - "version": "6.4.0", - "dev": true, - "requires": { - "@lerna/command": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/has-npm-version": "6.4.0", - "@lerna/npm-install": "6.4.0", - "@lerna/package-graph": "6.4.0", - "@lerna/pulse-till-done": "6.4.0", - "@lerna/rimraf-dir": "6.4.0", - "@lerna/run-lifecycle": "6.4.0", - "@lerna/run-topologically": "6.4.0", - "@lerna/symlink-binary": "6.4.0", - "@lerna/symlink-dependencies": "6.4.0", - "@lerna/validation-error": "6.4.0", + "version": "6.0.3", + "dev": true, + "requires": { + "@lerna/command": "6.0.3", + "@lerna/filter-options": "6.0.3", + "@lerna/has-npm-version": "6.0.3", + "@lerna/npm-install": "6.0.3", + "@lerna/package-graph": "6.0.3", + "@lerna/pulse-till-done": "6.0.3", + "@lerna/rimraf-dir": "6.0.3", + "@lerna/run-lifecycle": "6.0.3", + "@lerna/run-topologically": "6.0.3", + "@lerna/symlink-binary": "6.0.3", + "@lerna/symlink-dependencies": "6.0.3", + "@lerna/validation-error": "6.0.3", "@npmcli/arborist": "5.3.0", "dedent": "^0.7.0", "get-port": "^5.1.1", @@ -17749,34 +17336,30 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, "@lerna/changed": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/collect-updates": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/listable": "6.4.0", - "@lerna/output": "6.4.0" + "@lerna/collect-updates": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/listable": "6.0.3", + "@lerna/output": "6.0.3" } }, "@lerna/check-working-tree": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/collect-uncommitted": "6.4.0", - "@lerna/describe-ref": "6.4.0", - "@lerna/validation-error": "6.4.0" + "@lerna/collect-uncommitted": "6.0.3", + "@lerna/describe-ref": "6.0.3", + "@lerna/validation-error": "6.0.3" } }, "@lerna/child-process": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "chalk": "^4.1.0", @@ -17824,24 +17407,24 @@ } }, "@lerna/clean": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/command": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/prompt": "6.4.0", - "@lerna/pulse-till-done": "6.4.0", - "@lerna/rimraf-dir": "6.4.0", + "@lerna/command": "6.0.3", + "@lerna/filter-options": "6.0.3", + "@lerna/prompt": "6.0.3", + "@lerna/pulse-till-done": "6.0.3", + "@lerna/rimraf-dir": "6.0.3", "p-map": "^4.0.0", "p-map-series": "^2.1.0", "p-waterfall": "^2.1.1" } }, "@lerna/cli": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/global-options": "6.4.0", + "@lerna/global-options": "6.0.3", "dedent": "^0.7.0", "npmlog": "^6.0.2", "yargs": "^16.2.0" @@ -17863,10 +17446,10 @@ } }, "@lerna/collect-uncommitted": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", + "@lerna/child-process": "6.0.3", "chalk": "^4.1.0", "npmlog": "^6.0.2" }, @@ -17911,25 +17494,25 @@ } }, "@lerna/collect-updates": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", - "@lerna/describe-ref": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/describe-ref": "6.0.3", "minimatch": "^3.0.4", "npmlog": "^6.0.2", "slash": "^3.0.0" } }, "@lerna/command": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", - "@lerna/package-graph": "6.4.0", - "@lerna/project": "6.4.0", - "@lerna/validation-error": "6.4.0", - "@lerna/write-log-file": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/package-graph": "6.0.3", + "@lerna/project": "6.0.3", + "@lerna/validation-error": "6.0.3", + "@lerna/write-log-file": "6.0.3", "clone-deep": "^4.0.1", "dedent": "^0.7.0", "execa": "^5.0.0", @@ -17951,10 +17534,10 @@ } }, "@lerna/conventional-commits": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/validation-error": "6.4.0", + "@lerna/validation-error": "6.0.3", "conventional-changelog-angular": "^5.0.12", "conventional-changelog-core": "^4.2.4", "conventional-recommended-bump": "^6.1.0", @@ -17979,21 +17562,17 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, "@lerna/create": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/npm-conf": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/npm-conf": "6.0.3", + "@lerna/validation-error": "6.0.3", "dedent": "^0.7.0", "fs-extra": "^9.1.0", "init-package-json": "^3.0.2", @@ -18021,15 +17600,11 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, "@lerna/create-symlink": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "cmd-shim": "^5.0.0", @@ -18038,64 +17613,64 @@ } }, "@lerna/describe-ref": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", + "@lerna/child-process": "6.0.3", "npmlog": "^6.0.2" } }, "@lerna/diff": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/validation-error": "6.0.3", "npmlog": "^6.0.2" } }, "@lerna/exec": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/profiler": "6.4.0", - "@lerna/run-topologically": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/filter-options": "6.0.3", + "@lerna/profiler": "6.0.3", + "@lerna/run-topologically": "6.0.3", + "@lerna/validation-error": "6.0.3", "p-map": "^4.0.0" } }, "@lerna/filter-options": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/collect-updates": "6.4.0", - "@lerna/filter-packages": "6.4.0", + "@lerna/collect-updates": "6.0.3", + "@lerna/filter-packages": "6.0.3", "dedent": "^0.7.0", "npmlog": "^6.0.2" } }, "@lerna/filter-packages": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/validation-error": "6.4.0", + "@lerna/validation-error": "6.0.3", "multimatch": "^5.0.0", "npmlog": "^6.0.2" } }, "@lerna/get-npm-exec-opts": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "npmlog": "^6.0.2" } }, "@lerna/get-packed": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "fs-extra": "^9.1.0", @@ -18104,10 +17679,10 @@ } }, "@lerna/github-client": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", + "@lerna/child-process": "6.0.3", "@octokit/plugin-enterprise-rest": "^6.0.1", "@octokit/rest": "^19.0.3", "git-url-parse": "^13.1.0", @@ -18115,7 +17690,7 @@ } }, "@lerna/gitlab-client": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "node-fetch": "^2.6.1", @@ -18123,14 +17698,14 @@ } }, "@lerna/global-options": { - "version": "6.4.0", + "version": "6.0.3", "dev": true }, "@lerna/has-npm-version": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", + "@lerna/child-process": "6.0.3", "semver": "^7.3.4" }, "dependencies": { @@ -18147,75 +17722,71 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, "@lerna/import": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/prompt": "6.4.0", - "@lerna/pulse-till-done": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/prompt": "6.0.3", + "@lerna/pulse-till-done": "6.0.3", + "@lerna/validation-error": "6.0.3", "dedent": "^0.7.0", "fs-extra": "^9.1.0", "p-map-series": "^2.1.0" } }, "@lerna/info": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/command": "6.4.0", - "@lerna/output": "6.4.0", + "@lerna/command": "6.0.3", + "@lerna/output": "6.0.3", "envinfo": "^7.7.4" } }, "@lerna/init": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/project": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/project": "6.0.3", "fs-extra": "^9.1.0", "p-map": "^4.0.0", "write-json-file": "^4.3.0" } }, "@lerna/link": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/command": "6.4.0", - "@lerna/package-graph": "6.4.0", - "@lerna/symlink-dependencies": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/command": "6.0.3", + "@lerna/package-graph": "6.0.3", + "@lerna/symlink-dependencies": "6.0.3", + "@lerna/validation-error": "6.0.3", "p-map": "^4.0.0", "slash": "^3.0.0" } }, "@lerna/list": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/command": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/listable": "6.4.0", - "@lerna/output": "6.4.0" + "@lerna/command": "6.0.3", + "@lerna/filter-options": "6.0.3", + "@lerna/listable": "6.0.3", + "@lerna/output": "6.0.3" } }, "@lerna/listable": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/query-graph": "6.4.0", + "@lerna/query-graph": "6.0.3", "chalk": "^4.1.0", "columnify": "^1.6.0" }, @@ -18260,7 +17831,7 @@ } }, "@lerna/log-packed": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "byte-size": "^7.0.0", @@ -18270,7 +17841,7 @@ } }, "@lerna/npm-conf": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "config-chain": "^1.1.12", @@ -18278,21 +17849,21 @@ } }, "@lerna/npm-dist-tag": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/otplease": "6.4.0", + "@lerna/otplease": "6.0.3", "npm-package-arg": "8.1.1", "npm-registry-fetch": "^13.3.0", "npmlog": "^6.0.2" } }, "@lerna/npm-install": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", - "@lerna/get-npm-exec-opts": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/get-npm-exec-opts": "6.0.3", "fs-extra": "^9.1.0", "npm-package-arg": "8.1.1", "npmlog": "^6.0.2", @@ -18301,11 +17872,11 @@ } }, "@lerna/npm-publish": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/otplease": "6.4.0", - "@lerna/run-lifecycle": "6.4.0", + "@lerna/otplease": "6.0.3", + "@lerna/run-lifecycle": "6.0.3", "fs-extra": "^9.1.0", "libnpmpublish": "^6.0.4", "npm-package-arg": "8.1.1", @@ -18315,43 +17886,43 @@ } }, "@lerna/npm-run-script": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", - "@lerna/get-npm-exec-opts": "6.4.0", + "@lerna/child-process": "6.0.3", + "@lerna/get-npm-exec-opts": "6.0.3", "npmlog": "^6.0.2" } }, "@lerna/otplease": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/prompt": "6.4.0" + "@lerna/prompt": "6.0.3" } }, "@lerna/output": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "npmlog": "^6.0.2" } }, "@lerna/pack-directory": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/get-packed": "6.4.0", - "@lerna/package": "6.4.0", - "@lerna/run-lifecycle": "6.4.0", - "@lerna/temp-write": "6.4.0", + "@lerna/get-packed": "6.0.3", + "@lerna/package": "6.0.3", + "@lerna/run-lifecycle": "6.0.3", + "@lerna/temp-write": "6.0.3", "npm-packlist": "^5.1.1", "npmlog": "^6.0.2", "tar": "^6.1.0" } }, "@lerna/package": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "load-json-file": "^6.2.0", @@ -18360,11 +17931,11 @@ } }, "@lerna/package-graph": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/prerelease-id-from-version": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/prerelease-id-from-version": "6.0.3", + "@lerna/validation-error": "6.0.3", "npm-package-arg": "8.1.1", "npmlog": "^6.0.2", "semver": "^7.3.4" @@ -18383,15 +17954,11 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, "@lerna/prerelease-id-from-version": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "semver": "^7.3.4" @@ -18410,15 +17977,11 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, "@lerna/profiler": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "fs-extra": "^9.1.0", @@ -18427,11 +17990,11 @@ } }, "@lerna/project": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/package": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/package": "6.0.3", + "@lerna/validation-error": "6.0.3", "cosmiconfig": "^7.0.0", "dedent": "^0.7.0", "dot-prop": "^6.0.1", @@ -18466,7 +18029,7 @@ } }, "@lerna/prompt": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "inquirer": "^8.2.4", @@ -18474,28 +18037,28 @@ } }, "@lerna/publish": { - "version": "6.4.0", - "dev": true, - "requires": { - "@lerna/check-working-tree": "6.4.0", - "@lerna/child-process": "6.4.0", - "@lerna/collect-updates": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/describe-ref": "6.4.0", - "@lerna/log-packed": "6.4.0", - "@lerna/npm-conf": "6.4.0", - "@lerna/npm-dist-tag": "6.4.0", - "@lerna/npm-publish": "6.4.0", - "@lerna/otplease": "6.4.0", - "@lerna/output": "6.4.0", - "@lerna/pack-directory": "6.4.0", - "@lerna/prerelease-id-from-version": "6.4.0", - "@lerna/prompt": "6.4.0", - "@lerna/pulse-till-done": "6.4.0", - "@lerna/run-lifecycle": "6.4.0", - "@lerna/run-topologically": "6.4.0", - "@lerna/validation-error": "6.4.0", - "@lerna/version": "6.4.0", + "version": "6.0.3", + "dev": true, + "requires": { + "@lerna/check-working-tree": "6.0.3", + "@lerna/child-process": "6.0.3", + "@lerna/collect-updates": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/describe-ref": "6.0.3", + "@lerna/log-packed": "6.0.3", + "@lerna/npm-conf": "6.0.3", + "@lerna/npm-dist-tag": "6.0.3", + "@lerna/npm-publish": "6.0.3", + "@lerna/otplease": "6.0.3", + "@lerna/output": "6.0.3", + "@lerna/pack-directory": "6.0.3", + "@lerna/prerelease-id-from-version": "6.0.3", + "@lerna/prompt": "6.0.3", + "@lerna/pulse-till-done": "6.0.3", + "@lerna/run-lifecycle": "6.0.3", + "@lerna/run-topologically": "6.0.3", + "@lerna/validation-error": "6.0.3", + "@lerna/version": "6.0.3", "fs-extra": "^9.1.0", "libnpmaccess": "^6.0.3", "npm-package-arg": "8.1.1", @@ -18520,29 +18083,25 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, "@lerna/pulse-till-done": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "npmlog": "^6.0.2" } }, "@lerna/query-graph": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/package-graph": "6.4.0" + "@lerna/package-graph": "6.0.3" } }, "@lerna/resolve-symlink": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "fs-extra": "^9.1.0", @@ -18551,10 +18110,10 @@ } }, "@lerna/rimraf-dir": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/child-process": "6.4.0", + "@lerna/child-process": "6.0.3", "npmlog": "^6.0.2", "path-exists": "^4.0.0", "rimraf": "^3.0.2" @@ -18567,64 +18126,63 @@ } }, "@lerna/run": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/command": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/npm-run-script": "6.4.0", - "@lerna/output": "6.4.0", - "@lerna/profiler": "6.4.0", - "@lerna/run-topologically": "6.4.0", - "@lerna/timer": "6.4.0", - "@lerna/validation-error": "6.4.0", + "@lerna/command": "6.0.3", + "@lerna/filter-options": "6.0.3", + "@lerna/npm-run-script": "6.0.3", + "@lerna/output": "6.0.3", + "@lerna/profiler": "6.0.3", + "@lerna/run-topologically": "6.0.3", + "@lerna/timer": "6.0.3", + "@lerna/validation-error": "6.0.3", "fs-extra": "^9.1.0", - "nx": ">=14.8.6 < 16", "p-map": "^4.0.0" } }, "@lerna/run-lifecycle": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/npm-conf": "6.4.0", + "@lerna/npm-conf": "6.0.3", "@npmcli/run-script": "^4.1.7", "npmlog": "^6.0.2", "p-queue": "^6.6.2" } }, "@lerna/run-topologically": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/query-graph": "6.4.0", + "@lerna/query-graph": "6.0.3", "p-queue": "^6.6.2" } }, "@lerna/symlink-binary": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/create-symlink": "6.4.0", - "@lerna/package": "6.4.0", + "@lerna/create-symlink": "6.0.3", + "@lerna/package": "6.0.3", "fs-extra": "^9.1.0", "p-map": "^4.0.0" } }, "@lerna/symlink-dependencies": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { - "@lerna/create-symlink": "6.4.0", - "@lerna/resolve-symlink": "6.4.0", - "@lerna/symlink-binary": "6.4.0", + "@lerna/create-symlink": "6.0.3", + "@lerna/resolve-symlink": "6.0.3", + "@lerna/symlink-binary": "6.0.3", "fs-extra": "^9.1.0", "p-map": "^4.0.0", "p-map-series": "^2.1.0" } }, "@lerna/temp-write": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "graceful-fs": "^4.1.15", @@ -18635,35 +18193,35 @@ } }, "@lerna/timer": { - "version": "6.4.0", + "version": "6.0.3", "dev": true }, "@lerna/validation-error": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "npmlog": "^6.0.2" } }, "@lerna/version": { - "version": "6.4.0", - "dev": true, - "requires": { - "@lerna/check-working-tree": "6.4.0", - "@lerna/child-process": "6.4.0", - "@lerna/collect-updates": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/conventional-commits": "6.4.0", - "@lerna/github-client": "6.4.0", - "@lerna/gitlab-client": "6.4.0", - "@lerna/output": "6.4.0", - "@lerna/prerelease-id-from-version": "6.4.0", - "@lerna/prompt": "6.4.0", - "@lerna/run-lifecycle": "6.4.0", - "@lerna/run-topologically": "6.4.0", - "@lerna/temp-write": "6.4.0", - "@lerna/validation-error": "6.4.0", - "@nrwl/devkit": ">=15.4.2 < 16", + "version": "6.0.3", + "dev": true, + "requires": { + "@lerna/check-working-tree": "6.0.3", + "@lerna/child-process": "6.0.3", + "@lerna/collect-updates": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/conventional-commits": "6.0.3", + "@lerna/github-client": "6.0.3", + "@lerna/gitlab-client": "6.0.3", + "@lerna/output": "6.0.3", + "@lerna/prerelease-id-from-version": "6.0.3", + "@lerna/prompt": "6.0.3", + "@lerna/run-lifecycle": "6.0.3", + "@lerna/run-topologically": "6.0.3", + "@lerna/temp-write": "6.0.3", + "@lerna/validation-error": "6.0.3", + "@nrwl/devkit": ">=14.8.6 < 16", "chalk": "^4.1.0", "dedent": "^0.7.0", "load-json-file": "^6.2.0", @@ -18728,15 +18286,11 @@ "requires": { "has-flag": "^4.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, "@lerna/write-log-file": { - "version": "6.4.0", + "version": "6.0.3", "dev": true, "requires": { "npmlog": "^6.0.2", @@ -18810,10 +18364,6 @@ "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.14.1", - "dev": true - }, "npm-package-arg": { "version": "9.1.2", "dev": true, @@ -18839,10 +18389,6 @@ } } } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -18867,10 +18413,6 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -18889,10 +18431,6 @@ "which": "^2.0.2" }, "dependencies": { - "lru-cache": { - "version": "7.14.1", - "dev": true - }, "semver": { "version": "7.3.8", "dev": true, @@ -18908,10 +18446,6 @@ } } } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -18952,7 +18486,7 @@ } }, "minimatch": { - "version": "5.1.2", + "version": "5.1.0", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -18983,10 +18517,6 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -19032,14 +18562,14 @@ } }, "@nrwl/cli": { - "version": "15.4.5", + "version": "15.2.1", "dev": true, "requires": { - "nx": "15.4.5" + "nx": "15.2.1" } }, "@nrwl/devkit": { - "version": "15.4.5", + "version": "15.2.1", "dev": true, "requires": { "@phenomnomnominal/tsquery": "4.1.1", @@ -19062,18 +18592,14 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, "@nrwl/tao": { - "version": "15.4.5", + "version": "15.2.1", "dev": true, "requires": { - "nx": "15.4.5" + "nx": "15.2.1" } }, "@octokit/auth-token": { @@ -19279,7 +18805,7 @@ "dev": true }, "@types/graceful-fs": { - "version": "4.1.6", + "version": "4.1.5", "dev": true, "requires": { "@types/node": "*" @@ -19304,7 +18830,7 @@ } }, "@types/jest": { - "version": "29.2.5", + "version": "29.2.3", "dev": true, "requires": { "expect": "^29.0.0", @@ -19315,6 +18841,10 @@ "version": "7.0.11", "dev": true }, + "@types/json5": { + "version": "0.0.29", + "dev": true + }, "@types/minimatch": { "version": "3.0.5", "dev": true @@ -19325,6 +18855,8 @@ }, "@types/node": { "version": "18.11.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", + "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==", "dev": true }, "@types/normalize-package-data": { @@ -19336,7 +18868,7 @@ "dev": true }, "@types/prettier": { - "version": "2.7.2", + "version": "2.7.1", "dev": true }, "@types/semver": { @@ -19357,10 +18889,12 @@ }, "@types/uuid": { "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-kr90f+ERiQtKWMz5rP32ltJ/BtULDI5RVO0uavn1HQUOwjx0R1h0rnDYNL0CepF1zL5bSY6FISAfd9tOdDhU5Q==", "dev": true }, "@types/yargs": { - "version": "17.0.19", + "version": "17.0.15", "dev": true, "requires": { "@types/yargs-parser": "*" @@ -19398,85 +18932,14 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, "@typescript-eslint/experimental-utils": { - "version": "5.48.1", + "version": "5.45.0", "dev": true, "requires": { - "@typescript-eslint/utils": "5.48.1" - }, - "dependencies": { - "@typescript-eslint/scope-manager": { - "version": "5.48.1", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.48.1", - "@typescript-eslint/visitor-keys": "5.48.1" - } - }, - "@typescript-eslint/types": { - "version": "5.48.1", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.48.1", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.48.1", - "@typescript-eslint/visitor-keys": "5.48.1", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/utils": { - "version": "5.48.1", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.48.1", - "@typescript-eslint/types": "5.48.1", - "@typescript-eslint/typescript-estree": "5.48.1", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0", - "semver": "^7.3.7" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.48.1", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.48.1", - "eslint-visitor-keys": "^3.3.0" - } - }, - "lru-cache": { - "version": "6.0.0", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "semver": { - "version": "7.3.8", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "dev": true - } + "@typescript-eslint/utils": "5.45.0" } }, "@typescript-eslint/parser": { @@ -19537,10 +19000,6 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -19571,10 +19030,6 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -19619,7 +19074,9 @@ }, "dependencies": { "uuid": { - "version": "9.0.0" + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" } } }, @@ -19664,7 +19121,10 @@ "version": "file:packages/server-client", "requires": { "@vonage/auth": "^1.0.9", - "@vonage/vetch": "^1.0.10" + "@vonage/vetch": "^1.0.10", + "lodash.camelcase": "^4.3.0", + "lodash.partial": "^4.2.1", + "lodash.snakecase": "^4.1.1" } }, "@vonage/server-sdk": { @@ -19734,7 +19194,7 @@ "dev": true }, "@yarnpkg/parsers": { - "version": "3.0.0-rc.35", + "version": "3.0.0-rc.31", "dev": true, "requires": { "js-yaml": "^3.10.0", @@ -19903,7 +19363,7 @@ "dev": true }, "axios": { - "version": "1.2.2", + "version": "1.2.0", "dev": true, "requires": { "follow-redirects": "^1.15.0", @@ -20155,10 +19615,6 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -20208,12 +19664,8 @@ "once": "^1.3.0" } }, - "lru-cache": { - "version": "7.14.1", - "dev": true - }, "minimatch": { - "version": "5.1.2", + "version": "5.1.0", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -20239,7 +19691,7 @@ } }, "caniuse-lite": { - "version": "1.0.30001442", + "version": "1.0.30001434", "dev": true }, "chalk": { @@ -20287,7 +19739,7 @@ "dev": true }, "ci-info": { - "version": "3.7.1", + "version": "3.7.0", "dev": true }, "cjs-module-lexer": { @@ -20492,7 +19944,7 @@ } }, "commander": { - "version": "9.5.0", + "version": "9.4.1", "dev": true }, "common-ancestor-path": { @@ -20632,7 +20084,7 @@ "dev": true }, "core-js-compat": { - "version": "3.27.1", + "version": "3.26.1", "dev": true, "requires": { "browserslist": "^4.21.4" @@ -20992,7 +20444,7 @@ } }, "globals": { - "version": "13.19.0", + "version": "13.18.0", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -21237,7 +20689,7 @@ "dev": true }, "fastq": { - "version": "1.15.0", + "version": "1.13.0", "dev": true, "requires": { "reusify": "^1.0.4" @@ -21279,7 +20731,7 @@ } }, "minimatch": { - "version": "5.1.2", + "version": "5.1.0", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -21634,10 +21086,6 @@ "requires": { "yallist": "^4.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -21678,7 +21126,7 @@ } }, "husky": { - "version": "8.0.3", + "version": "8.0.2", "dev": true }, "iconv-lite": { @@ -21693,7 +21141,7 @@ "dev": true }, "ignore": { - "version": "5.2.4", + "version": "5.2.1", "dev": true }, "ignore-walk": { @@ -21711,7 +21159,7 @@ } }, "minimatch": { - "version": "5.1.2", + "version": "5.1.0", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -21789,10 +21237,6 @@ "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.14.1", - "dev": true - }, "npm-package-arg": { "version": "9.1.2", "dev": true, @@ -21818,10 +21262,6 @@ } } } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -21923,7 +21363,7 @@ "dev": true }, "is-fullwidth-code-point": { - "version": "4.0.0", + "version": "3.0.0", "dev": true }, "is-generator-fn": { @@ -22863,10 +22303,6 @@ "requires": { "has-flag": "^4.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -23097,7 +22533,7 @@ "dev": true }, "json5": { - "version": "2.2.3", + "version": "2.2.1", "dev": true }, "jsonc-parser": { @@ -23126,6 +22562,8 @@ }, "jsonwebtoken": { "version": "9.0.0", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", + "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==", "requires": { "jws": "^3.2.2", "lodash": "^4.17.21", @@ -23135,27 +22573,28 @@ "dependencies": { "lru-cache": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "requires": { "yallist": "^4.0.0" } }, "semver": { "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0" } } }, "just-diff": { - "version": "5.2.0", + "version": "5.1.1", "dev": true }, "just-diff-apply": { - "version": "5.5.0", + "version": "5.4.1", "dev": true }, "jwa": { @@ -23182,33 +22621,31 @@ "dev": true }, "lerna": { - "version": "6.4.0", - "dev": true, - "requires": { - "@lerna/add": "6.4.0", - "@lerna/bootstrap": "6.4.0", - "@lerna/changed": "6.4.0", - "@lerna/clean": "6.4.0", - "@lerna/cli": "6.4.0", - "@lerna/command": "6.4.0", - "@lerna/create": "6.4.0", - "@lerna/diff": "6.4.0", - "@lerna/exec": "6.4.0", - "@lerna/filter-options": "6.4.0", - "@lerna/import": "6.4.0", - "@lerna/info": "6.4.0", - "@lerna/init": "6.4.0", - "@lerna/link": "6.4.0", - "@lerna/list": "6.4.0", - "@lerna/publish": "6.4.0", - "@lerna/run": "6.4.0", - "@lerna/validation-error": "6.4.0", - "@lerna/version": "6.4.0", - "@nrwl/devkit": ">=15.4.2 < 16", + "version": "6.0.3", + "dev": true, + "requires": { + "@lerna/add": "6.0.3", + "@lerna/bootstrap": "6.0.3", + "@lerna/changed": "6.0.3", + "@lerna/clean": "6.0.3", + "@lerna/cli": "6.0.3", + "@lerna/command": "6.0.3", + "@lerna/create": "6.0.3", + "@lerna/diff": "6.0.3", + "@lerna/exec": "6.0.3", + "@lerna/import": "6.0.3", + "@lerna/info": "6.0.3", + "@lerna/init": "6.0.3", + "@lerna/link": "6.0.3", + "@lerna/list": "6.0.3", + "@lerna/publish": "6.0.3", + "@lerna/run": "6.0.3", + "@lerna/version": "6.0.3", + "@nrwl/devkit": ">=14.8.6 < 16", "import-local": "^3.0.2", "inquirer": "^8.2.4", "npmlog": "^6.0.2", - "nx": ">=15.4.2 < 16", + "nx": ">=14.8.6 < 16", "typescript": "^3 || ^4" } }, @@ -23301,10 +22738,6 @@ "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.14.1", - "dev": true - }, "npm-package-arg": { "version": "9.1.2", "dev": true, @@ -23330,10 +22763,6 @@ } } } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -23355,10 +22784,6 @@ "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.14.1", - "dev": true - }, "normalize-package-data": { "version": "4.0.1", "dev": true, @@ -23394,10 +22819,6 @@ } } } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -23478,7 +22899,7 @@ "dev": true }, "yaml": { - "version": "2.2.1", + "version": "2.1.3", "dev": true } } @@ -23523,10 +22944,6 @@ "version": "1.1.4", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true - }, "slice-ansi": { "version": "3.0.0", "dev": true, @@ -23564,6 +22981,9 @@ "lodash": { "version": "4.17.21" }, + "lodash.camelcase": { + "version": "4.3.0" + }, "lodash.debounce": { "version": "4.0.8", "dev": true @@ -23578,6 +22998,12 @@ "lodash.omit": { "version": "4.5.0" }, + "lodash.partial": { + "version": "4.2.1" + }, + "lodash.snakecase": { + "version": "4.1.1" + }, "log-symbols": { "version": "4.1.0", "dev": true, @@ -23653,10 +23079,6 @@ "version": "1.1.4", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true - }, "slice-ansi": { "version": "4.0.0", "dev": true, @@ -23722,11 +23144,8 @@ } }, "lru-cache": { - "version": "5.1.1", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } + "version": "7.14.1", + "dev": true }, "make-dir": { "version": "3.1.0", @@ -23835,10 +23254,6 @@ "requires": { "imurmurhash": "^0.1.4" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -23985,12 +23400,6 @@ "dev": true, "requires": { "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "dev": true - } } }, "minipass-collect": { @@ -24045,12 +23454,6 @@ "requires": { "minipass": "^3.0.0", "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "dev": true - } } }, "mkdirp": { @@ -24140,7 +23543,7 @@ } }, "node-gyp": { - "version": "9.3.1", + "version": "9.3.0", "dev": true, "requires": { "env-paths": "^2.2.0", @@ -24168,10 +23571,6 @@ "debug": "4" } }, - "lru-cache": { - "version": "7.14.1", - "dev": true - }, "make-fetch-happen": { "version": "10.2.1", "dev": true, @@ -24235,15 +23634,11 @@ "debug": "^4.3.3", "socks": "^2.6.2" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, "node-gyp-build": { - "version": "4.6.0", + "version": "4.5.0", "dev": true }, "node-int64": { @@ -24251,7 +23646,7 @@ "dev": true }, "node-releases": { - "version": "2.0.8", + "version": "2.0.6", "dev": true }, "nopt": { @@ -24284,10 +23679,6 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -24322,10 +23713,6 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -24373,10 +23760,6 @@ "requires": { "builtins": "^1.0.3" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -24409,7 +23792,7 @@ } }, "minimatch": { - "version": "5.1.2", + "version": "5.1.0", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -24445,10 +23828,6 @@ "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.14.1", - "dev": true - }, "npm-normalize-package-bin": { "version": "2.0.0", "dev": true @@ -24478,10 +23857,6 @@ } } } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -24518,10 +23893,6 @@ "debug": "4" } }, - "lru-cache": { - "version": "7.14.1", - "dev": true - }, "make-fetch-happen": { "version": "10.2.1", "dev": true, @@ -24588,10 +23959,6 @@ "debug": "^4.3.3", "socks": "^2.6.2" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -24613,11 +23980,11 @@ } }, "nx": { - "version": "15.4.5", + "version": "15.2.1", "dev": true, "requires": { - "@nrwl/cli": "15.4.5", - "@nrwl/tao": "15.4.5", + "@nrwl/cli": "15.2.1", + "@nrwl/tao": "15.2.1", "@parcel/watcher": "2.0.4", "@yarnpkg/lockfile": "^1.1.0", "@yarnpkg/parsers": "^3.0.0-rc.18", @@ -24646,7 +24013,7 @@ "strong-log-transformer": "^2.1.0", "tar-stream": "~2.2.0", "tmp": "~0.2.1", - "tsconfig-paths": "^4.1.2", + "tsconfig-paths": "^3.9.0", "tslib": "^2.3.0", "v8-compile-cache": "2.3.0", "yargs": "^17.6.2", @@ -24768,10 +24135,6 @@ "rimraf": "^3.0.0" } }, - "yallist": { - "version": "4.0.0", - "dev": true - }, "yargs-parser": { "version": "21.1.1", "dev": true @@ -24985,10 +24348,6 @@ "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.14.1", - "dev": true - }, "npm-package-arg": { "version": "9.1.2", "dev": true, @@ -25014,10 +24373,6 @@ } } } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -25291,7 +24646,7 @@ "dev": true }, "punycode": { - "version": "2.2.0", + "version": "2.1.1", "dev": true }, "q": { @@ -25356,12 +24711,8 @@ "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.14.1", - "dev": true - }, "minimatch": { - "version": "5.1.2", + "version": "5.1.0", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -25396,10 +24747,6 @@ } } } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -25680,7 +25027,7 @@ } }, "rxjs": { - "version": "7.8.0", + "version": "7.5.7", "dev": true, "requires": { "tslib": "^2.1.0" @@ -25742,6 +25089,10 @@ "ansi-styles": { "version": "6.2.1", "dev": true + }, + "is-fullwidth-code-point": { + "version": "4.0.0", + "dev": true } } }, @@ -25879,12 +25230,6 @@ "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true - } } }, "strip-ansi": { @@ -25934,28 +25279,15 @@ "dev": true }, "tar": { - "version": "6.1.13", + "version": "6.1.12", "dev": true, "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", - "minipass": "^4.0.0", + "minipass": "^3.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" - }, - "dependencies": { - "minipass": { - "version": "4.0.0", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "dev": true - } } }, "tar-stream": { @@ -26117,14 +25449,22 @@ } }, "tsconfig-paths": { - "version": "4.1.2", + "version": "3.14.1", "dev": true, "requires": { - "json5": "^2.2.2", + "@types/json5": "^0.0.29", + "json5": "^1.0.1", "minimist": "^1.2.6", "strip-bom": "^3.0.0" }, "dependencies": { + "json5": { + "version": "1.0.1", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, "strip-bom": { "version": "3.0.0", "dev": true @@ -26175,7 +25515,7 @@ } }, "typescript": { - "version": "4.9.4", + "version": "4.9.3", "dev": true }, "uglify-js": { @@ -26322,10 +25662,6 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "yallist": { - "version": "4.0.0", - "dev": true } } }, @@ -26520,8 +25856,7 @@ "dev": true }, "yallist": { - "version": "3.1.1", - "dev": true + "version": "4.0.0" }, "yaml": { "version": "1.10.2", diff --git a/packages/server-client/__tests__/__dataSets__/camelCase.ts b/packages/server-client/__tests__/__dataSets__/camelCase.ts new file mode 100644 index 00000000..75a942cc --- /dev/null +++ b/packages/server-client/__tests__/__dataSets__/camelCase.ts @@ -0,0 +1,110 @@ +export default [ + { + label: 'Transform to camel case', + transformFn: 'camelCaseObjectKeys', + original: { + foo_bar: 'fizz_buzz', + }, + parameters: [ + false, // deep + false, // preserve + ], + expected: { + fooBar: 'fizz_buzz', + }, + }, + { + label: 'Transform to camel has no effect', + transformFn: 'camelCaseObjectKeys', + original: { + fooBar: 'fizz_buzz', + }, + parameters: [ + false, // deep + false, // preserve + ], + expected: { + fooBar: 'fizz_buzz', + }, + }, + { + label: 'Transform to camel will preserves key', + transformFn: 'camelCaseObjectKeys', + original: { + foo_bar: 'fizz_buzz', + }, + parameters: [ + false, // deep + true, // preserve + ], + expected: { + foo_bar: 'fizz_buzz', + fooBar: 'fizz_buzz', + }, + }, + { + label: 'Transform to camel uses transformed key', + transformFn: 'camelCaseObjectKeys', + original: { + foo_bar: 'fizz_buzz', + fooBar: 'baz_bat', + }, + parameters: [ + false, // deep + false, // preserve + ], + expected: { + fooBar: 'baz_bat', + }, + }, + { + label: 'Transform to camel deep', + transformFn: 'camelCaseObjectKeys', + original: { + foo_bar: { + fizz_buzz: { + baz_bat: 'qux', + }, + }, + }, + parameters: [ + true, // deep + false, // preserve + ], + expected: { + fooBar: { + fizzBuzz: { + bazBat: 'qux', + }, + }, + }, + }, + { + label: 'Transform to camel deep with array (prevents object confusion)', + transformFn: 'camelCaseObjectKeys', + original: { + foo_bar: ['fizz_buzz', 'baz_bat'], + }, + parameters: [ + true, // deep + false, // preserve + ], + expected: { + fooBar: ['fizz_buzz', 'baz_bat'], + }, + }, + { + label: 'Transform to camel deep with null (prevents object confusion)', + transformFn: 'camelCaseObjectKeys', + original: { + foo_bar: null, + }, + parameters: [ + true, // deep + false, // preserve + ], + expected: { + fooBar: null, + }, + }, +]; diff --git a/packages/server-client/__tests__/__dataSets__/index.ts b/packages/server-client/__tests__/__dataSets__/index.ts new file mode 100644 index 00000000..ab864990 --- /dev/null +++ b/packages/server-client/__tests__/__dataSets__/index.ts @@ -0,0 +1,13 @@ +import camelCase from './camelCase'; +import snakeCase from './snakeCase'; + +export default [ + { + label: 'Transform Camel Case', + tests: camelCase, + }, + { + label: 'Transform Snake Case', + tests: snakeCase, + }, +]; diff --git a/packages/server-client/__tests__/__dataSets__/snakeCase.ts b/packages/server-client/__tests__/__dataSets__/snakeCase.ts new file mode 100644 index 00000000..9dc240ec --- /dev/null +++ b/packages/server-client/__tests__/__dataSets__/snakeCase.ts @@ -0,0 +1,110 @@ +export default [ + { + label: 'Transform to snake case', + transformFn: 'snakeCaseObjectKeys', + original: { + fooBar: 'fizz_buzz', + }, + parameters: [ + false, // deep + false, // preserve + ], + expected: { + foo_bar: 'fizz_buzz', + }, + }, + { + label: 'Transform to snake has no effect', + transformFn: 'snakeCaseObjectKeys', + original: { + foo_bar: 'fizz_buzz', + }, + parameters: [ + false, // deep + false, // preserve + ], + expected: { + foo_bar: 'fizz_buzz', + }, + }, + { + label: 'Transform to snake will preserves key', + transformFn: 'snakeCaseObjectKeys', + original: { + fooBar: 'fizz_buzz', + }, + parameters: [ + false, // deep + true, // preserve + ], + expected: { + foo_bar: 'fizz_buzz', + fooBar: 'fizz_buzz', + }, + }, + { + label: 'Transform to snake uses transformed key', + transformFn: 'snakeCaseObjectKeys', + original: { + foo_bar: 'fizz_buzz', + fooBar: 'baz_bat', + }, + parameters: [ + false, // deep + false, // preserve + ], + expected: { + foo_bar: 'baz_bat', + }, + }, + { + label: 'Transform to snake deep', + transformFn: 'snakeCaseObjectKeys', + original: { + foo_bar: { + fizz_buzz: { + baz_bat: 'qux', + }, + }, + }, + parameters: [ + true, // deep + false, // preserve + ], + expected: { + foo_bar: { + fizz_buzz: { + baz_bat: 'qux', + }, + }, + }, + }, + { + label: 'Transform to snake deep with array (prevents object confusion)', + transformFn: 'snakeCaseObjectKeys', + original: { + fooBar: ['fizz_buzz', 'baz_bat'], + }, + parameters: [ + true, // deep + false, // preserve + ], + expected: { + foo_bar: ['fizz_buzz', 'baz_bat'], + }, + }, + { + label: 'Transform to snake deep with null (prevents object confusion)', + transformFn: 'snakeCaseObjectKeys', + original: { + fooBar: null, + }, + parameters: [ + true, // deep + false, // preserve + ], + expected: { + foo_bar: null, + }, + }, +]; diff --git a/packages/server-client/__tests__/client.test.ts b/packages/server-client/__tests__/client.test.ts index d88e1470..8f55b78c 100644 --- a/packages/server-client/__tests__/client.test.ts +++ b/packages/server-client/__tests__/client.test.ts @@ -1,21 +1,47 @@ import { Auth } from '@vonage/auth'; -import { Client } from '../lib/index' +import { Client } from '../lib/index'; +import dataSet from './__dataSets__/index'; class MockClient extends Client {} -describe('client', () => { - test("get request merges auth to query properly", async () => { - const client = new MockClient(new Auth({apiKey: 'abcd', apiSecret: '1234'})); - const request = client.addAuthenticationToRequest({method: 'GET', params: {foo: 'bar'}}); +describe.each(dataSet)('$label', ({ tests }) => { + test.each(tests)( + 'Can $label [using $transformFn]', + async ({ transformFn, original, parameters, expected }) => { + expect(Client.transformers[transformFn]).toBeDefined(); + const results = Client.transformers[transformFn]( + original, + ...parameters, + ); + + expect(results).toEqual(expected); + }, + ); +}); + +describe('server client', () => { + test('get request merges auth to query properly', async () => { + const client = new MockClient( + new Auth({ apiKey: 'abcd', apiSecret: '1234' }), + ); + const request = client.addAuthenticationToRequest({ + method: 'GET', + params: { foo: 'bar' }, + }); expect(request.params.foo).toEqual('bar'); expect(request.params.api_key).toEqual('abcd'); expect(request.params.api_secret).toEqual('1234'); }); - test("post request merges auth to body properly", async () => { - const client = new MockClient(new Auth({apiKey: 'abcd', apiSecret: '1234'})); - const request = client.addAuthenticationToRequest({method: 'POST', data: {foo: 'bar'}}); + test('post request merges auth to body properly', async () => { + const client = new MockClient( + new Auth({ apiKey: 'abcd', apiSecret: '1234' }), + ); + const request = client.addAuthenticationToRequest({ + method: 'POST', + data: { foo: 'bar' }, + }); expect(request.data.foo).toEqual('bar'); expect(request.data.api_key).toEqual('abcd'); diff --git a/packages/server-client/lib/client.ts b/packages/server-client/lib/client.ts index 61e3b41c..8a9be958 100644 --- a/packages/server-client/lib/client.ts +++ b/packages/server-client/lib/client.ts @@ -1,210 +1,209 @@ -import { Auth, AuthInterface } from '@vonage/auth' +import { Auth, AuthInterface } from '@vonage/auth'; import { - request as vetchRequest, - ResponseTypes, - VetchResponse, -} from '@vonage/vetch' -import { AuthenticationType } from './enums/AuthenticationType' + request as vetchRequest, + ResponseTypes, + VetchResponse, +} from '@vonage/vetch'; +import { AuthenticationType } from './enums/AuthenticationType'; +import * as transfomers from './transformers'; export abstract class Client { - protected authType?: AuthenticationType + protected authType?: AuthenticationType; - protected auth: AuthInterface - protected config: { + protected auth: AuthInterface; + protected config: { restHost: string apiHost: string videoHost: string responseType: string timeout: number - } + }; - constructor( - credentials: AuthInterface, - options?: { + constructor( + credentials: AuthInterface, + options?: { restHost: string apiHost: string videoHost: string responseType: ResponseTypes timeout: number - } - ) { - if (typeof credentials.getQueryParams === 'undefined') { - credentials = new Auth(credentials) - } - - this.auth = credentials - this.config = { - restHost: null, - apiHost: null, - videoHost: null, - responseType: null, - timeout: null, - } - - this.config.restHost = options?.restHost || 'https://rest.nexmo.com' - this.config.apiHost = options?.apiHost || 'https://api.nexmo.com' - this.config.videoHost = - options?.videoHost || 'https://video.api.vonage.com' - this.config.responseType = options?.responseType || ResponseTypes.json + }, + ) { + if (typeof credentials.getQueryParams === 'undefined') { + credentials = new Auth(credentials); } - /** - * Adds authentication to a request - * By default we add key/secret. Individual clients may override this with whatever they want. - */ - public addAuthenticationToRequest(request: any): any { - switch (this.authType) { - case AuthenticationType.BASIC: - request.headers = Object.assign({}, request.headers, { - Authorization: this.auth.createBasicHeader(), - }) - break - case AuthenticationType.JWT: - request.headers = Object.assign({}, request.headers, { - Authorization: this.auth.createBearerHeader(), - }) - break - case AuthenticationType.QUERY_KEY_SECRET: - request.params = request.params || {} - request.params = Object.assign( - {}, - request.params, - this.auth.getQueryParams(request.params) - ) - break - case AuthenticationType.KEY_SECRET: - default: - if (request.method === 'GET') { - request.params = request.params || {} - request.params = Object.assign( - {}, - request.params, - this.auth.getQueryParams(request.params) - ) - } else { - request.data = request.data || {} - request.data = Object.assign( - {}, - request.data, - this.auth.getQueryParams(request.data) - ) - } - break - } - - return request + this.auth = credentials; + this.config = { + restHost: null, + apiHost: null, + videoHost: null, + responseType: null, + timeout: null, + }; + + this.config.restHost = options?.restHost || 'https://rest.nexmo.com'; + this.config.apiHost = options?.apiHost || 'https://api.nexmo.com'; + this.config.videoHost + = options?.videoHost || 'https://video.api.vonage.com'; + this.config.responseType = options?.responseType || ResponseTypes.json; + } + + public static transformers = transfomers; + + public addAuthenticationToRequest(request: any): any { + switch (this.authType) { + case AuthenticationType.BASIC: + request.headers = Object.assign({}, request.headers, { + Authorization: this.auth.createBasicHeader(), + }); + break; + case AuthenticationType.JWT: + request.headers = Object.assign({}, request.headers, { + Authorization: this.auth.createBearerHeader(), + }); + break; + case AuthenticationType.QUERY_KEY_SECRET: + request.params = request.params || {}; + request.params = Object.assign( + {}, + request.params, + this.auth.getQueryParams(request.params), + ); + break; + case AuthenticationType.KEY_SECRET: + default: + if (request.method === 'GET') { + request.params = request.params || {}; + request.params = Object.assign( + {}, + request.params, + this.auth.getQueryParams(request.params), + ); + } else { + request.data = request.data || {}; + request.data = Object.assign( + {}, + request.data, + this.auth.getQueryParams(request.data), + ); + } + break; } - public async sendDeleteRequest(url: string): Promise> { - const request = { - url, - method: 'DELETE', - } - - return await this.sendRequest(request) + return request; + } + + public async sendDeleteRequest(url: string): Promise> { + const request = { + url, + method: 'DELETE', + }; + + return await this.sendRequest(request); + } + + public async sendFormSubmitRequest( + url: string, + payload?: { [key: string]: any }, + ): Promise> { + const request = { + url, + body: new URLSearchParams(payload), + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + }; + + if (!payload) { + delete request.body; } - public async sendFormSubmitRequest( - url: string, - payload?: { [key: string]: any } - ): Promise> { - const request = { - url, - body: new URLSearchParams(payload), - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - }, - } - - if (!payload) { - delete request.body - } - - return await this.sendRequest(request) + return await this.sendRequest(request); + } + + public async sendGetRequest( + url: string, + queryParams?: { [key: string]: any }, + ): Promise> { + const request = { + url, + params: queryParams, + method: 'GET', + }; + + if (!queryParams) { + delete request.params; } - public async sendGetRequest( - url: string, - queryParams?: { [key: string]: any } - ): Promise> { - const request = { - url, - params: queryParams, - method: 'GET', - } - - if (!queryParams) { - delete request.params - } - - return await this.sendRequest(request) + return await this.sendRequest(request); + } + + public async sendPatchRequest( + url: string, + payload?: { [key: string]: any }, + ): Promise> { + const request = { + url, + data: payload, + method: 'PATCH', + headers: { + 'Content-Type': 'application/json', + }, + }; + + if (!payload) { + delete request.data; } - public async sendPatchRequest( - url: string, - payload?: { [key: string]: any } - ): Promise> { - const request = { - url, - data: payload, - method: 'PATCH', - headers: { - 'Content-Type': 'application/json', - }, - } - - if (!payload) { - delete request.data - } - - return await this.sendRequest(request) + return await this.sendRequest(request); + } + + public async sendPostRequest( + url: string, + payload?: { [key: string]: any }, + ): Promise> { + const request = { + url, + data: payload, + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }; + + if (!payload) { + delete request.data; } - public async sendPostRequest( - url: string, - payload?: { [key: string]: any } - ): Promise> { - const request = { - url, - data: payload, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - } - - if (!payload) { - delete request.data - } - - return await this.sendRequest(request) + return await this.sendRequest(request); + } + + public async sendPutRequest( + url: string, + payload?: { [key: string]: any }, + ): Promise> { + const request = { + url, + data: payload, + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + }; + + if (!payload) { + delete request.data; } - public async sendPutRequest( - url: string, - payload?: { [key: string]: any } - ): Promise> { - const request = { - url, - data: payload, - method: 'PUT', - headers: { - 'Content-Type': 'application/json', - }, - } - - if (!payload) { - delete request.data - } - - return await this.sendRequest(request) - } + return await this.sendRequest(request); + } - public async sendRequest(request: any): Promise> { - request = this.addAuthenticationToRequest(request) - request.timeout = this.config.timeout - const result = await vetchRequest(request) - return result - } + public async sendRequest(request: any): Promise> { + request = this.addAuthenticationToRequest(request); + request.timeout = this.config.timeout; + const result = await vetchRequest(request); + return result; + } } diff --git a/packages/server-client/lib/transformers.ts b/packages/server-client/lib/transformers.ts new file mode 100644 index 00000000..f3e39701 --- /dev/null +++ b/packages/server-client/lib/transformers.ts @@ -0,0 +1,41 @@ +import camelCase from 'lodash.camelcase'; +import snakeCase from 'lodash.snakecase'; +import partial from 'lodash.partial'; + +export const transformObjectKeys = ( + transformFn: (key: string | number) => string, + objectToTransform: Record, + deep = false, + preserve = false, +): Record => { + const transformedObject = {}; + + for (const prop in objectToTransform) { + if (!Object.hasOwn(objectToTransform, prop)) { + continue; + } + + const value = objectToTransform[prop]; + transformedObject[transformFn(prop)] + = deep + && typeof value === 'object' + && value !== null + && !Array.isArray(value) + ? transformObjectKeys( + transformFn, + value as Record, + deep, + preserve, + ) + : value; + } + + return { + ...transformedObject, + ...(preserve ? objectToTransform : {}), + }; +}; + +export const camelCaseObjectKeys = partial(transformObjectKeys, camelCase); + +export const snakeCaseObjectKeys = partial(transformObjectKeys, snakeCase); diff --git a/packages/server-client/package.json b/packages/server-client/package.json index 25733a1d..bd1093a4 100644 --- a/packages/server-client/package.json +++ b/packages/server-client/package.json @@ -28,7 +28,10 @@ }, "dependencies": { "@vonage/auth": "^1.0.9", - "@vonage/vetch": "^1.0.10" + "@vonage/vetch": "^1.0.10", + "lodash.camelcase": "^4.3.0", + "lodash.partial": "^4.2.1", + "lodash.snakecase": "^4.1.1" }, "publishConfig": { "directory": "dist" diff --git a/tsconfig.json b/tsconfig.json index 0d5af9f6..1f150610 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,11 +3,11 @@ "sourceMap": true, "removeComments": true, "lib": [ - "ES6" + "ES2022" ], "strict": false, - "target": "ES6", + "target": "ES2022", "module": "CommonJS", "moduleResolution": "node", "esModuleInterop": true, From 42c15a22dbca43ae0d3158e04326bfa9b417eec3 Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Thu, 5 Jan 2023 18:01:24 +0000 Subject: [PATCH 2/9] feat: audit package --- jest.config.ts | 144 +++++++------ package-lock.json | 25 ++- packages/audit/README.md | 114 ++++++++++ .../audit/__tests__/__dataSets__/getEvent.ts | 26 +++ .../audit/__tests__/__dataSets__/getEvents.ts | 196 ++++++++++++++++++ .../audit/__tests__/__dataSets__/index.ts | 8 + packages/audit/__tests__/audit.test.ts | 63 ++++++ packages/audit/lib/audit.ts | 40 ++++ packages/audit/lib/enums.ts | 29 +++ packages/audit/lib/index.ts | 5 + packages/audit/lib/types.ts | 42 ++++ packages/audit/package.json | 41 ++++ packages/audit/tsconfig.json | 24 +++ packages/server-client/lib/index.ts | 5 +- packages/server-client/lib/types.ts | 12 ++ 15 files changed, 706 insertions(+), 68 deletions(-) create mode 100644 packages/audit/README.md create mode 100644 packages/audit/__tests__/__dataSets__/getEvent.ts create mode 100644 packages/audit/__tests__/__dataSets__/getEvents.ts create mode 100644 packages/audit/__tests__/__dataSets__/index.ts create mode 100644 packages/audit/__tests__/audit.test.ts create mode 100644 packages/audit/lib/audit.ts create mode 100644 packages/audit/lib/enums.ts create mode 100644 packages/audit/lib/index.ts create mode 100644 packages/audit/lib/types.ts create mode 100644 packages/audit/package.json create mode 100644 packages/audit/tsconfig.json create mode 100644 packages/server-client/lib/types.ts diff --git a/jest.config.ts b/jest.config.ts index c386f8a7..d9e46d99 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -1,72 +1,86 @@ import type { Config } from '@jest/types'; const config: Config.InitialOptions = { - coverageDirectory: '/coverage/', - projects: [ - { - displayName: "ACCOUNTS", - testMatch: ['/packages/accounts/__tests__/**/*.test.ts'], - }, - { - displayName: "APPLICATIONS", - testMatch: ['/packages/applications/__tests__/**/*.test.ts'], - }, - { - displayName: "AUTH", - testMatch: ['/packages/auth/__tests__/**/*.test.ts'], - }, - { - displayName: "JWT", - testMatch: ['/packages/jwt/__tests__/**/*.test.ts'], - }, - { - displayName: "MESSAGES", - testMatch: ['/packages/messages/__tests__/**/*.test.ts'], - }, - { - displayName: "NUMBER INSIGHTS", - testMatch: ['/packages/number-insights/__tests__/**/*.test.ts'], - }, - { - displayName: "NUMBERS", - testMatch: ['/packages/numbers/__tests__/**/*.test.ts'], - }, - { - displayName: "PRICING", - testMatch: ['/packages/pricing/__tests__/**/*.test.ts'], - }, - { - displayName: "SERVER CLIENT", - testMatch: ['/packages/server-client/__tests__/**/*.test.ts'], - }, - { - displayName: "SERVER SDK", - testMatch: ['/packages/server-sdk/__tests__/**/*.test.ts'], - }, - { - displayName: "SMS", - testMatch: ['/packages/sms/__tests__/**/*.test.ts'], - }, - { - displayName: "VERIFY", - testMatch: ['/packages/verify/__tests__/**/*.test.ts'], - }, - { - displayName: "VETCH", - testMatch: ['/packages/vetch/__tests__/**/*.test.ts'], - }, - { - displayName: "VIDEO", - testMatch: ['/packages/video/__tests__/**/*.test.ts'], - }, - { - displayName: "VOICE", - testMatch: ['/packages/voice/__tests__/**/*.test.ts'], - }, - ], - moduleNameMapper: { - '@vonage/(.+)': '/packages/$1/lib', + coverageDirectory: '/coverage/', + projects: [ + { + displayName: 'ACCOUNTS', + testMatch: ['/packages/accounts/__tests__/**/*.test.ts'], }, + { + displayName: 'APPLICATIONS', + testMatch: [ + '/packages/applications/__tests__/**/*.test.ts', + ], + }, + { + displayName: 'AUDIT', + testMatch: ['/packages/audit/__tests__/**/*.test.ts'], + }, + { + displayName: 'AUDIT', + testMatch: ['/packages/audit/tests__/**/*.test.ts'], + }, + { + displayName: 'AUTH', + testMatch: ['/packages/auth/__tests__/**/*.test.ts'], + }, + { + displayName: 'JWT', + testMatch: ['/packages/jwt/__tests__/**/*.test.ts'], + }, + { + displayName: 'MESSAGES', + testMatch: ['/packages/messages/__tests__/**/*.test.ts'], + }, + { + displayName: 'NUMBER INSIGHTS', + testMatch: [ + '/packages/number-insights/__tests__/**/*.test.ts', + ], + }, + { + displayName: 'NUMBERS', + testMatch: ['/packages/numbers/__tests__/**/*.test.ts'], + }, + { + displayName: 'PRICING', + testMatch: ['/packages/pricing/__tests__/**/*.test.ts'], + }, + { + displayName: 'SERVER CLIENT', + testMatch: [ + '/packages/server-client/__tests__/**/*.test.ts', + ], + }, + { + displayName: 'SERVER SDK', + testMatch: ['/packages/server-sdk/__tests__/**/*.test.ts'], + }, + { + displayName: 'SMS', + testMatch: ['/packages/sms/__tests__/**/*.test.ts'], + }, + { + displayName: 'VERIFY', + testMatch: ['/packages/verify/__tests__/**/*.test.ts'], + }, + { + displayName: 'VETCH', + testMatch: ['/packages/vetch/__tests__/**/*.test.ts'], + }, + { + displayName: 'VIDEO', + testMatch: ['/packages/video/__tests__/**/*.test.ts'], + }, + { + displayName: 'VOICE', + testMatch: ['/packages/voice/__tests__/**/*.test.ts'], + }, + ], + moduleNameMapper: { + '@vonage/(.+)': '/packages/$1/lib', + }, }; export default config; diff --git a/package-lock.json b/package-lock.json index 0f5fc532..854756ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4990,6 +4990,10 @@ "resolved": "packages/applications", "link": true }, + "node_modules/@vonage/audit": { + "resolved": "packages/audit", + "link": true + }, "node_modules/@vonage/auth": { "resolved": "packages/auth", "link": true @@ -15608,7 +15612,17 @@ } }, "packages/audit": { - "extraneous": true + "name": "@vonage/audit", + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "@vonage/auth": "^1.0.5", + "@vonage/server-client": "^1.0.8", + "@vonage/vetch": "^1.0.6" + }, + "devDependencies": { + "nock": "^13.2.9" + } }, "packages/auth": { "name": "@vonage/auth", @@ -19058,6 +19072,15 @@ "nock": "^13.2.9" } }, + "@vonage/audit": { + "version": "file:packages/audit", + "requires": { + "@vonage/auth": "^1.0.5", + "@vonage/server-client": "^1.0.8", + "@vonage/vetch": "^1.0.6", + "nock": "^13.2.9" + } + }, "@vonage/auth": { "version": "file:packages/auth", "requires": { diff --git a/packages/audit/README.md b/packages/audit/README.md new file mode 100644 index 00000000..da6dcc00 --- /dev/null +++ b/packages/audit/README.md @@ -0,0 +1,114 @@ +# Vonage Number SDK for Node.js + +![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/vonage/vonage-node-sdk/Vonage/3.x?logo=github&style=flat-square&label=Workflow%20Build) +[![Codecov](https://img.shields.io/codecov/c/github/vonage/vonage-node-sdk?label=Codecov&logo=codecov&style=flat-square)](https://codecov.io/gh/Vonage/vonage-server-sdk) +![Latest Release](https://img.shields.io/npm/v/@vonage/numbers) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?style=flat-square)](../../CODE_OF_CONDUCT.md) +[![License](https://img.shields.io/npm/l/@vonage/numbers?label=License&style=flat-square)][license] + +Vonage + +This is the Vonage Number SDK for Node.js for use with +[Vonage APIs](https://www.vonage.com/). To use it you will need a Vonage +account. Sign up [for free at vonage.com][signup]. + +We recommend using this package as part of the overall [ +`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk). + +For full API documentation refer to [developer.nexmo.com](https://developer.nexmo.com/). + +* [Installation](#installation) +* [Usage](#using-the-vonage-numbers-sdk) +* [Promises](#promises) +* [Testing](#testing) + +## Installation + +We recommend using this SDK as part of the overall [ +`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk). +Please see the main package for installation. + +You can also use this SDK standalone if you only need access to just the +Numbers API. + +### With NPM + +```bash +npm install @vonage/numbers +``` + +### With Yarn + +```bash +yarn add @vonage/numbers +``` + +## Using the Vonage Numbers SDK + +### As part of the Vonage Server SDK + +If you are using this SDK as part of the Vonage Server SDK, you can access it +as the `numbers` property off of the client that you instantiate. + +```js +const { Vonage, Auth } = require('@vonage/server-sdk'); + +const credentials = new Auth({ + apiKey: API_KEY, + apiSecret: API_SECRET +}); +const options = {}; +const vonage = new Vonage(credentials, options); + +vonage.numbers.getAvailableNumbers() + .then(resp => console.log(resp)) + .catch(err => console.error(err)); +``` + +### Standalone + +The SDK can be used standalone from the main +[Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) if +you only need to use the Numbers API. All you need to do is +`require('@vonage/numbers')`, and use the returned object to create your own +client. + +```js +const { Auth } = require('@vonage/auth'); +const { Numbers } = require('@vonage/numbers'); + +const credentials = new Auth({ + apiKey: API_KEY, + apiSecret: API_SECRET +}); +const options = {}; + +const numbersClient = new Numbers(credentials, options); +``` + +Where `credentials` is any option from [`@vonage/auth`](https://github.com/Vonage/vonage-node-sdk/tree/3.x/readme/packages/auth#options), +and `options` is any option from [`@vonage/server-client`](https://github.com/Vonage/vonage-node-sdk/tree/3.x/readme/packages/server-client#options) + +## Promises + +Most methods that interact with the Vonage API uses Promises. You can either +resolve these yourself, or use `await` to wait for a response. + +```js +const resp = await vonage.numbers.basicLookup(PHONE_NUMBER) + +vonage.numbers.getAvailableNumbers() + .then(resp => console.log(resp)) + .catch(err => console.error(err)); +``` + +## Testing + +Run: + +```bash +npm run test +``` + +[signup]: https://dashboard.nexmo.com/sign-up?utm_source=DEV_REL&utm_medium=github&utm_campaign=node-server-sdk +[license]: ../../LICENSE.txt diff --git a/packages/audit/__tests__/__dataSets__/getEvent.ts b/packages/audit/__tests__/__dataSets__/getEvent.ts new file mode 100644 index 00000000..af56af9c --- /dev/null +++ b/packages/audit/__tests__/__dataSets__/getEvent.ts @@ -0,0 +1,26 @@ +const BASE_URL = 'https://api.nexmo.com/'; +const CLIENT_METHOD = 'getEvent'; + +export default [ + { + label: 'get event', + clientMethod: CLIENT_METHOD, + exception: false, + request: { + url: BASE_URL, + intercept: [`/beta/audit/events/asdf`, 'GET'], + reply: [ + 200, + { + id: 'asdf', + created_at: '2022-11-15T17:30:33', + }, + ], + }, + parameters: ['asdf'], + expected: { + id: 'asdf', + createdAt: '2022-11-15T17:30:33', + }, + }, +]; diff --git a/packages/audit/__tests__/__dataSets__/getEvents.ts b/packages/audit/__tests__/__dataSets__/getEvents.ts new file mode 100644 index 00000000..f1627b6a --- /dev/null +++ b/packages/audit/__tests__/__dataSets__/getEvents.ts @@ -0,0 +1,196 @@ +import { AuditEvent } from '../../lib/types.ts'; +import { AuditEventTypes } from '../../lib/enums'; +import { Client } from '@vonage/server-client'; + +const BASE_URL = 'https://api.nexmo.com/'; +const CLIENT_METHOD = 'getEvents'; + +const createEvent = (event: AuditEvent): AuditEvent => ({ + id: event.id, + eventType: event.eventType, + createdAt: '2022-11-15T17:30:33', + userEmail: event.userEmail, + userId: event.userId, + accountId: event.accountId, + source: event.source, + sourceDescription: event.sourceDescription, + sourceCountry: event.sourceCountry, + context: event.context, +}); + +const onePageEvent = [createEvent({ id: '1' })]; + +const twoPageEvent = [createEvent({ id: '2' }), createEvent({ id: '3' })]; + +const eventParameters = new URLSearchParams([ + ['event_type', AuditEventTypes.ACCOUNT_SECRET_CREATE], + ['date_from', createEvent({}).createdAt], + ['date_to', createEvent({}).createdAt], + ['search_text', 'fizz-buzz'], + ['page', 42], + ['size', 21], +]); + +export default [ + { + label: 'get events on one page', + clientMethod: CLIENT_METHOD, + exception: false, + request: { + url: BASE_URL, + requests: [ + { + request: [`/beta/audit/events?`, 'GET'], + reply: [ + 200, + { + _embedded: { + events: onePageEvent.map( + Client.transformers.snakeCaseObjectKeys, + ), + }, + page: { + size: 20, + totalElements: 1, + totalPages: 1, + page: 1, + }, + }, + ], + }, + ], + }, + parameters: [], + expected: onePageEvent, + }, + { + label: 'get events on multiple pages', + clientMethod: CLIENT_METHOD, + exception: false, + request: { + url: BASE_URL, + requests: [ + { + request: [`/beta/audit/events?`, 'GET'], + reply: [ + 200, + { + _embedded: { + events: twoPageEvent.map( + Client.transformers.snakeCaseObjectKeys, + ), + }, + page: { + size: 20, + totalElements: 3, + totalPages: 2, + page: 1, + }, + }, + ], + }, + { + request: [`/beta/audit/events?`, 'GET'], + reply: [ + 200, + { + _embedded: { + events: onePageEvent.map( + Client.transformers.snakeCaseObjectKeys, + ), + }, + page: { + size: 20, + totalElements: 3, + totalPages: 2, + page: 2, + }, + }, + ], + }, + ], + }, + parameters: [], + expected: [...twoPageEvent, ...onePageEvent], + }, + { + label: 'get events and handle non 200 on subsequent pages', + clientMethod: CLIENT_METHOD, + exception: false, + request: { + url: BASE_URL, + requests: [ + { + request: [`/beta/audit/events?`, 'GET'], + reply: [ + 200, + { + _embedded: { + events: twoPageEvent.map( + Client.transformers.snakeCaseObjectKeys, + ), + }, + page: { + size: 20, + totalElements: 3, + totalPages: 2, + page: 1, + }, + }, + ], + }, + { + request: [`/beta/audit/events?`, 'GET'], + reply: [ + 401, + { + status: 401, + error: 'Unauthorized', + message: 'Failed', + }, + ], + }, + ], + }, + parameters: [], + expected: [...twoPageEvent], + }, + { + label: 'get events with parameters', + clientMethod: CLIENT_METHOD, + exception: false, + request: { + url: BASE_URL, + requests: [ + { + request: [ + `/beta/audit/events?${eventParameters.toString()}`, + 'GET', + ], + reply: [ + 200, + { + _embedded: { + events: onePageEvent.map( + Client.transformers.snakeCaseObjectKeys, + ), + }, + page: { + size: 20, + totalElements: 1, + totalPages: 1, + page: 1, + }, + }, + ], + }, + ], + }, + parameters: [ + Client.transformers.camelCaseObjectKeys( + Object.fromEntries(eventParameters), + ), + ], + expected: onePageEvent, + }, +]; diff --git a/packages/audit/__tests__/__dataSets__/index.ts b/packages/audit/__tests__/__dataSets__/index.ts new file mode 100644 index 00000000..103173a1 --- /dev/null +++ b/packages/audit/__tests__/__dataSets__/index.ts @@ -0,0 +1,8 @@ +import getEvents from './getEvents'; + +export default [ + { + label: 'Get Events', + tests: getEvents, + }, +]; diff --git a/packages/audit/__tests__/audit.test.ts b/packages/audit/__tests__/audit.test.ts new file mode 100644 index 00000000..903c5abb --- /dev/null +++ b/packages/audit/__tests__/audit.test.ts @@ -0,0 +1,63 @@ +import nock from 'nock'; +import { Auth } from '@vonage/auth'; +import { Audit } from '../lib/index'; +import getEvents from './__dataSets__/getEvents'; +import getEvent from './__dataSets__/getEvent'; + +describe('Audit Events', () => { + let client: Audit; + + beforeEach(function () { + client = new Audit(new Auth({ apiKey: '12345', apiSecret: 'ABCDE' })); + }); + + afterEach(function () { + client = null; + nock.cleanAll(); + }); + + test.each(getEvents)( + 'Can $label', + async ({ request, parameters, expected }) => { + const { url, requests } = request; + + const scope = nock(url, { + reqheaders: { + authorization: 'Basic MTIzNDU6QUJDREU=', + }, + }); + requests.forEach(({ request, reply }) => { + scope.intercept(...request).reply(...reply); + }); + + const results = []; + for await (const event of client.getEvents(...parameters)) { + results.push(event); + } + + expect(results).toEqual(expected); + expect(scope.isDone()).toBeTruthy(); + }, + ); + + test('Can get event', async () => { + const scope = nock('https://api.nexmo.com/', { + reqheaders: { + authorization: 'Basic MTIzNDU6QUJDREU=', + }, + }) + .intercept(`/beta/audit/events/asdf`, 'GET') + .reply(200, { + id: 'asdf', + created_at: '2022-11-15T17:30:33', + }); + + const result = await client.getEvent('asdf'); + + expect(result).toEqual({ + id: 'asdf', + createdAt: '2022-11-15T17:30:33', + }); + expect(scope.isDone()).toBeTruthy(); + }); +}); diff --git a/packages/audit/lib/audit.ts b/packages/audit/lib/audit.ts new file mode 100644 index 00000000..6acacfc0 --- /dev/null +++ b/packages/audit/lib/audit.ts @@ -0,0 +1,40 @@ +import { AuthenticationType, Client } from '@vonage/server-client'; +import { AuditParams, AuditEvent, AuditEventListResponse } from './types'; + +export class Audit extends Client { + protected BASE_PATH = 'beta'; + protected authType = AuthenticationType.BASIC; + + async *getEvents(params: AuditParams): AsyncGenerator { + let totalPages = 0; + let page = params?.page || 1; + do { + try { + const resp = await this.sendGetRequest( + `${this.config.apiHost}/${this.BASE_PATH}/audit/events`, + Client.transformers.snakeCaseObjectKeys(params), + ); + + const events = (resp.data?._embedded.events || []).map( + (event) => + Client.transformers.camelCaseObjectKeys(event, true), + ); + + totalPages = resp.data?.page?.totalPages || 0; + + yield* events; + page++; + } catch (error) { + // TODO Logging + return; + } + } while (page <= totalPages); + } + + public async getEvent(eventId: string): Promise { + const resp = await this.sendGetRequest( + `${this.config.apiHost}/${this.BASE_PATH}/audit/events/${eventId}`, + ); + return Client.transformers.camelCaseObjectKeys(resp.data, true); + } +} diff --git a/packages/audit/lib/enums.ts b/packages/audit/lib/enums.ts new file mode 100644 index 00000000..862c1e92 --- /dev/null +++ b/packages/audit/lib/enums.ts @@ -0,0 +1,29 @@ +export enum AuditEventTypes { + 'USER_STATUS' = 'USER_STATUS', + 'USER_UPDATE' = 'USER_UPDATE', + 'USER_BILLING_UPDATE' = 'USER_BILLING_UPDATE', + 'USER_CREATE' = 'USER_CREATE', + 'USER_LOGIN' = 'USER_LOGIN', + 'USER_LOGOUT' = 'USER_LOGOUT', + 'USER_PRODUCT_SEARCH' = 'USER_PRODUCT_SEARCH', + 'USER_API_KEYS_UPDATE' = 'USER_API_KEYS_UPDATE', + 'ACCOUNT_SECRET_DELETE' = 'ACCOUNT_SECRET_DELETE', + 'ACCOUNT_SECRET_CREATE' = 'ACCOUNT_SECRET_CREATE', + 'ACCOUNT_UPDATE_SPAMMER' = 'ACCOUNT_UPDATE_SPAMMER', + 'ACCOUNT_UPDATE_SETTINGS_API' = 'ACCOUNT_UPDATE_SETTINGS_API', + 'NUMBER_ASSIGN' = 'NUMBER_ASSIGN', + 'NUMBER_UPDATED' = 'NUMBER_UPDATED', + 'NUMBER_RELEASE' = 'NUMBER_RELEASE', + 'NUMBER_LINKED' = 'NUMBER_LINKED', + 'NUMBER_UNLINKED' = 'NUMBER_UNLINKED', + 'APP_CREATE' = 'APP_CREATE', + 'APP_UPDATE' = 'APP_UPDATE', + 'APP_DELETE' = 'APP_DELETE', + 'APP_DISABLE' = 'APP_DISABLE', + 'APP_ENABLE' = 'APP_ENABLE', + 'IP_WHITELIST_CREATE' = 'IP_WHITELIST_CREATE', + 'IP_WHITELIST_DELETE' = 'IP_WHITELIST_DELETE', + 'AUTORELOAD_ENABLE' = 'AUTORELOAD_ENABLE', + 'AUTORELOAD_UPDATE' = 'AUTORELOAD_UPDATE', + 'AUTORELOAD_DISABLE' = 'AUTORELOAD_DISABLE', +} diff --git a/packages/audit/lib/index.ts b/packages/audit/lib/index.ts new file mode 100644 index 00000000..4a4d5d03 --- /dev/null +++ b/packages/audit/lib/index.ts @@ -0,0 +1,5 @@ +export { Audit } from './audit'; + +export * from './enums'; + +export * from './types'; diff --git a/packages/audit/lib/types.ts b/packages/audit/lib/types.ts new file mode 100644 index 00000000..b769cc56 --- /dev/null +++ b/packages/audit/lib/types.ts @@ -0,0 +1,42 @@ +import { VetchResponse, VetchOptions } from '@vonage/vetch'; +import { AuditEventTypes } from './enums'; +import { APILinks } from '@vonage/server-client'; + +export type AuditResponse = VetchResponse + +export type AuditParams = { + eventType?: AuditEventTypes + dateFrom?: string + dateTo?: string + searchText?: string + page?: number + size?: number +} + +export type AuditEvent = { + id: string + eventType: AuditEventTypes + createdAt: string + userEmail?: string + userId?: string + accountId: string + source: string + sourceDescription: string + sourceCountry: string + context?: object +} + +export interface AuditEventPage { + size: number + totalElements: number + totalPages: number + number: number +} + +export interface AuditEventListResponse { + _embedded?: { + events: AuditEvent[] + } + _links: APILinks + page: AuditEventPage +} diff --git a/packages/audit/package.json b/packages/audit/package.json new file mode 100644 index 00000000..3e0625b8 --- /dev/null +++ b/packages/audit/package.json @@ -0,0 +1,41 @@ +{ + "name": "@vonage/audit", + "version": "1.0.0", + "description": "Vonage Audit SDK Package", + "homepage": "https://github.com/vonage/vonage-node-sdk/tree/master/packages/numbers#readme", + "bugs": { + "url": "https://github.com/Vonage/vonage-node-sdk/issues" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Vonage/vonage-node-sdk.git" + }, + "license": "Apache-2.0", + "author": "Kelly J Andrews ", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "directories": { + "lib": "dist", + "test": "__tests__" + }, + "files": [ + "/dist" + ], + "scripts": { + "build": "npm run clean && npm run compile", + "clean": "npx shx rm -rf dist tsconfig.tsbuildinfo", + "compile": "npx tsc --build --verbose" + }, + "dependencies": { + "@vonage/auth": "^1.0.5", + "@vonage/server-client": "^1.0.8", + "@vonage/vetch": "^1.0.6" + }, + "devDependencies": { + "nock": "^13.2.9" + }, + "publishConfig": { + "directory": "dist" + }, + "gitHead": "328f18e5c8a458cb4d06d7955ec2399a6ce6f5d8" +} diff --git a/packages/audit/tsconfig.json b/packages/audit/tsconfig.json new file mode 100644 index 00000000..e9b438f7 --- /dev/null +++ b/packages/audit/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../tsconfig.json", + + "compilerOptions": { + "rootDir": "lib", + "outDir": "dist" + }, + + "exclude": [ + "__tests__", + "jest.config.js", + "dist" + ], + + "references": [ + { "path": "../auth" }, + { "path": "../server-client" }, + { "path": "../vetch" } + ], + + "ts-node": { + "esm": true + } +} diff --git a/packages/server-client/lib/index.ts b/packages/server-client/lib/index.ts index f8b61b58..f15d4993 100644 --- a/packages/server-client/lib/index.ts +++ b/packages/server-client/lib/index.ts @@ -1,2 +1,3 @@ -export { Client } from './client' -export { AuthenticationType } from './enums/AuthenticationType' +export { Client } from './client'; +export { AuthenticationType } from './enums/AuthenticationType'; +export { APILink, APILinks } from './types'; diff --git a/packages/server-client/lib/types.ts b/packages/server-client/lib/types.ts new file mode 100644 index 00000000..b37b88da --- /dev/null +++ b/packages/server-client/lib/types.ts @@ -0,0 +1,12 @@ +export type APILink = { + href: string + // TODO Add more from RFC 5988? +} + +export type APILinks = { + _links: { + self: APILink + next?: APILink + prev?: APILink + } +} From fb7a526c8eaf5df7051ae1dbf5d8a56ed55cc92f Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Thu, 12 Jan 2023 22:05:26 +0000 Subject: [PATCH 3/9] style: linter fixes Updated documentation as well --- README.md | 3 +- packages/audit/README.md | 42 ++++++++++-------- .../audit/__tests__/__dataSets__/getEvent.ts | 26 ----------- .../audit/__tests__/__dataSets__/index.ts | 8 ---- packages/audit/package.json | 7 ++- packages/server-sdk/README.md | 43 ++++++++++--------- 6 files changed, 50 insertions(+), 79 deletions(-) delete mode 100644 packages/audit/__tests__/__dataSets__/getEvent.ts delete mode 100644 packages/audit/__tests__/__dataSets__/index.ts diff --git a/README.md b/README.md index 2425cac0..20fb4d48 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ information for each package below: * [Accounts](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/accounts/README.md) * [Applications](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/applications/README.md) +* [Audit](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/audit/README.md) * [Auth](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/README.md) * [JWT](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/jwt/README.md) * [Messages](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/messages/README.md) @@ -43,7 +44,7 @@ The following is a list of Vonage APIs and whether the Node Server SDK provides | Account API | General Availability |✅| | Alerts API | General Availability |✅| | Application API | General Availability |✅| -| Audit API | Beta |❌| +| Audit API | Beta |✅| | Conversation API | Beta |❌| | Dispatch API | Beta |❌| | External Accounts API | Beta |❌| diff --git a/packages/audit/README.md b/packages/audit/README.md index da6dcc00..41cd6855 100644 --- a/packages/audit/README.md +++ b/packages/audit/README.md @@ -1,14 +1,14 @@ -# Vonage Number SDK for Node.js +# Vonage Audit SDK for Node.js ![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/vonage/vonage-node-sdk/Vonage/3.x?logo=github&style=flat-square&label=Workflow%20Build) [![Codecov](https://img.shields.io/codecov/c/github/vonage/vonage-node-sdk?label=Codecov&logo=codecov&style=flat-square)](https://codecov.io/gh/Vonage/vonage-server-sdk) -![Latest Release](https://img.shields.io/npm/v/@vonage/numbers) +![Latest Release](https://img.shields.io/npm/v/@vonage/number) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?style=flat-square)](../../CODE_OF_CONDUCT.md) -[![License](https://img.shields.io/npm/l/@vonage/numbers?label=License&style=flat-square)][license] +[![License](https://img.shields.io/npm/l/@vonage/number?label=License&style=flat-square)][license] Vonage -This is the Vonage Number SDK for Node.js for use with +This is the Vonage Audit SDK for Node.js for use with [Vonage APIs](https://www.vonage.com/). To use it you will need a Vonage account. Sign up [for free at vonage.com][signup]. @@ -18,7 +18,7 @@ We recommend using this package as part of the overall [ For full API documentation refer to [developer.nexmo.com](https://developer.nexmo.com/). * [Installation](#installation) -* [Usage](#using-the-vonage-numbers-sdk) +* [Usage](#using-the-vonage-number-sdk) * [Promises](#promises) * [Testing](#testing) @@ -29,26 +29,26 @@ We recommend using this SDK as part of the overall [ Please see the main package for installation. You can also use this SDK standalone if you only need access to just the -Numbers API. +Audit API. ### With NPM ```bash -npm install @vonage/numbers +npm install @vonage/audit ``` ### With Yarn ```bash -yarn add @vonage/numbers +yarn add @vonage/audit ``` -## Using the Vonage Numbers SDK +## Using the Vonage Audit SDK ### As part of the Vonage Server SDK If you are using this SDK as part of the Vonage Server SDK, you can access it -as the `numbers` property off of the client that you instantiate. +as the `audit` property off of the client that you instantiate. ```js const { Vonage, Auth } = require('@vonage/server-sdk'); @@ -60,22 +60,26 @@ const credentials = new Auth({ const options = {}; const vonage = new Vonage(credentials, options); -vonage.numbers.getAvailableNumbers() - .then(resp => console.log(resp)) - .catch(err => console.error(err)); +(async () =>{ + for await (const event of vonage.audit.getEvents()) { + console.log(event); + } +})(); + + ``` ### Standalone The SDK can be used standalone from the main [Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) if -you only need to use the Numbers API. All you need to do is -`require('@vonage/numbers')`, and use the returned object to create your own +you only need to use the Audit API. All you need to do is +`require('@vonage/audit')`, and use the returned object to create your own client. ```js const { Auth } = require('@vonage/auth'); -const { Numbers } = require('@vonage/numbers'); +const { Audit } = require('@vonage/number'); const credentials = new Auth({ apiKey: API_KEY, @@ -83,7 +87,7 @@ const credentials = new Auth({ }); const options = {}; -const numbersClient = new Numbers(credentials, options); +const auditClient = new Audit(credentials, options); ``` Where `credentials` is any option from [`@vonage/auth`](https://github.com/Vonage/vonage-node-sdk/tree/3.x/readme/packages/auth#options), @@ -95,9 +99,9 @@ Most methods that interact with the Vonage API uses Promises. You can either resolve these yourself, or use `await` to wait for a response. ```js -const resp = await vonage.numbers.basicLookup(PHONE_NUMBER) +const resp = await vonage.audit.getEvent(eventId); -vonage.numbers.getAvailableNumbers() +vonage.audit.getEvent(eventId) .then(resp => console.log(resp)) .catch(err => console.error(err)); ``` diff --git a/packages/audit/__tests__/__dataSets__/getEvent.ts b/packages/audit/__tests__/__dataSets__/getEvent.ts deleted file mode 100644 index af56af9c..00000000 --- a/packages/audit/__tests__/__dataSets__/getEvent.ts +++ /dev/null @@ -1,26 +0,0 @@ -const BASE_URL = 'https://api.nexmo.com/'; -const CLIENT_METHOD = 'getEvent'; - -export default [ - { - label: 'get event', - clientMethod: CLIENT_METHOD, - exception: false, - request: { - url: BASE_URL, - intercept: [`/beta/audit/events/asdf`, 'GET'], - reply: [ - 200, - { - id: 'asdf', - created_at: '2022-11-15T17:30:33', - }, - ], - }, - parameters: ['asdf'], - expected: { - id: 'asdf', - createdAt: '2022-11-15T17:30:33', - }, - }, -]; diff --git a/packages/audit/__tests__/__dataSets__/index.ts b/packages/audit/__tests__/__dataSets__/index.ts deleted file mode 100644 index 103173a1..00000000 --- a/packages/audit/__tests__/__dataSets__/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import getEvents from './getEvents'; - -export default [ - { - label: 'Get Events', - tests: getEvents, - }, -]; diff --git a/packages/audit/package.json b/packages/audit/package.json index 3e0625b8..b67fa76f 100644 --- a/packages/audit/package.json +++ b/packages/audit/package.json @@ -2,7 +2,7 @@ "name": "@vonage/audit", "version": "1.0.0", "description": "Vonage Audit SDK Package", - "homepage": "https://github.com/vonage/vonage-node-sdk/tree/master/packages/numbers#readme", + "homepage": "https://github.com/vonage/vonage-node-sdk/tree/master/packages/audit#readme", "bugs": { "url": "https://github.com/Vonage/vonage-node-sdk/issues" }, @@ -11,7 +11,7 @@ "url": "git+https://github.com/Vonage/vonage-node-sdk.git" }, "license": "Apache-2.0", - "author": "Kelly J Andrews ", + "author": "Chuck \"MANCHUCK\" Reeves", "main": "dist/index.js", "types": "dist/index.d.ts", "directories": { @@ -36,6 +36,5 @@ }, "publishConfig": { "directory": "dist" - }, - "gitHead": "328f18e5c8a458cb4d06d7955ec2399a6ce6f5d8" + } } diff --git a/packages/server-sdk/README.md b/packages/server-sdk/README.md index 70d43935..bdc6c313 100644 --- a/packages/server-sdk/README.md +++ b/packages/server-sdk/README.md @@ -78,6 +78,27 @@ npm run test-watch See the [Vonage Node Quickstarts repo](https://github.com/Vonage/vonage-node-code-snippets). +## References + +You can find more information for each product below: + +* [Accounts](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/accounts/README.md) +* [Applications](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/applications/README.md) +* [Audit](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/audit/README.md) +* [Auth](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/README.md) +* [JWT](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/jwt/README.md) +* [Messages](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/messages/README.md) +* [Number Insights](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/number-insights/README.md) +* [Numbers](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/numbers/README.md) +* [Pricing](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/pricing/README.md) +* [Server Client](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md) +* [Server SDK](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/server-sdk/README.md) +* [SMS](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/sms/README.md) +* [Verify](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/verify/README.md) +* [Vetch](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/vetch/README.md) +* [Video](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/video/README.md) +* [Voice](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/voice/README.md) + ## Supported APIs The following is a list of Vonage APIs and whether the Node Server SDK provides support for them: @@ -87,7 +108,7 @@ The following is a list of Vonage APIs and whether the Node Server SDK provides | Account API | General Availability |✅| | Alerts API | General Availability |✅| | Application API | General Availability |✅| -| Audit API | Beta |❌| +| Audit API | Beta |✅| | Conversation API | Beta |❌| | Dispatch API | Beta |❌| | External Accounts API | Beta |❌| @@ -101,25 +122,5 @@ The following is a list of Vonage APIs and whether the Node Server SDK provides | SMS API | General Availability |✅| | Verify API | General Availability |✅| | Voice API | General Availability |✅| - -## References - -You can find more information for each product below: - -* [Accounts](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/accounts/README.md) -* [Applications](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/applications/README.md) -* [Auth](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/README.md) -* [JWT](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/jwt/README.md) -* [Messages](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/messages/README.md) -* [Number Insights](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/number-insights/README.md) -* [Numbers](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/numbers/README.md) -* [Pricing](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/pricing/README.md) -* [Server Client](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md) -* [SMS](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/sms/README.md) -* [Verify](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/verify/README.md) -* [Vetch](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/vetch/README.md) -* [Video](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/video/README.md) -* [Voice](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/voice/README.md) - [signup]: https://dashboard.nexmo.com/sign-up?utm_source=DEV_REL&utm_medium=github&utm_campaign=node-server-sdk [license]: LICENSE.txt From c26b54f2a775bea79deab032dab2fdf9227659a8 Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Thu, 12 Jan 2023 22:14:20 +0000 Subject: [PATCH 4/9] refactor: adding audit to server-sdk --- package-lock.json | 2 + packages/server-sdk/lib/vonage.ts | 100 +++++++++++++++--------------- packages/server-sdk/package.json | 1 + 3 files changed, 54 insertions(+), 49 deletions(-) diff --git a/package-lock.json b/package-lock.json index 854756ab..cd6cfd39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15727,6 +15727,7 @@ "dependencies": { "@vonage/accounts": "^1.0.13", "@vonage/applications": "^1.0.12", + "@vonage/audit": "^1.0.0", "@vonage/auth": "^1.0.9", "@vonage/messages": "^1.0.13", "@vonage/number-insights": "^1.0.12", @@ -19155,6 +19156,7 @@ "requires": { "@vonage/accounts": "^1.0.13", "@vonage/applications": "^1.0.12", + "@vonage/audit": "^1.0.0", "@vonage/auth": "^1.0.9", "@vonage/messages": "^1.0.13", "@vonage/number-insights": "^1.0.12", diff --git a/packages/server-sdk/lib/vonage.ts b/packages/server-sdk/lib/vonage.ts index f63c0ee7..4c0810b6 100644 --- a/packages/server-sdk/lib/vonage.ts +++ b/packages/server-sdk/lib/vonage.ts @@ -1,56 +1,58 @@ -import { Accounts, Secrets } from '@vonage/accounts' -import { Applications } from '@vonage/applications' -import { Auth, AuthInterface } from '@vonage/auth' -import { Messages } from '@vonage/messages' -import { NumberInsights } from '@vonage/number-insights' -import { Numbers } from '@vonage/numbers' -import { Pricing } from '@vonage/pricing' -import { SMS } from '@vonage/sms' -import { Verify } from '@vonage/verify' -import { ResponseTypes } from '@vonage/vetch' -import { Voice } from '@vonage/voice' +import { Accounts, Secrets } from '@vonage/accounts'; +import { Applications } from '@vonage/applications'; +import { Audit } from '@vonage/audit'; +import { Auth, AuthInterface } from '@vonage/auth'; +import { Messages } from '@vonage/messages'; +import { NumberInsights } from '@vonage/number-insights'; +import { Numbers } from '@vonage/numbers'; +import { Pricing } from '@vonage/pricing'; +import { SMS } from '@vonage/sms'; +import { Verify } from '@vonage/verify'; +import { ResponseTypes } from '@vonage/vetch'; +import { Voice } from '@vonage/voice'; + +type VonageOptions = { + timeout: number + restHost: string + apiHost: string + videoHost: string + responseType: ResponseTypes +} export class Vonage { - protected credentials: AuthInterface - protected options: any + protected credentials: AuthInterface; + protected options: VonageOptions; - public accounts: Accounts - public applications: Applications - public messages: Messages - public numberInsights: NumberInsights - public numbers: Numbers - public pricing: Pricing - public secrets: Secrets - public sms: SMS - public verify: Verify - public voice: Voice + public accounts: Accounts; + public applications: Applications; + public audit: Audit; + public messages: Messages; + public numberInsights: NumberInsights; + public numbers: Numbers; + public pricing: Pricing; + public secrets: Secrets; + public sms: SMS; + public verify: Verify; + public voice: Voice; - constructor( - credentials: AuthInterface, - options?: { - timeout: number - restHost: string - apiHost: string - videoHost: string - responseType: ResponseTypes - } - ) { - if (typeof credentials.getQueryParams === 'undefined') { - credentials = new Auth(credentials) - } + constructor(credentials: AuthInterface, options?: VonageOptions) { + if (typeof credentials.getQueryParams === 'undefined') { + credentials = new Auth(credentials); + } - this.credentials = credentials - this.options = options + this.credentials = credentials; + this.options = options; - this.accounts = new Accounts(this.credentials, this.options) - this.applications = new Applications(this.credentials, this.options) - this.messages = new Messages(this.credentials, this.options) - this.numberInsights = new NumberInsights(this.credentials, this.options) - this.numbers = new Numbers(this.credentials, this.options) - this.pricing = new Pricing(this.credentials, this.options) - this.secrets = new Secrets(this.credentials, this.options) - this.sms = new SMS(this.credentials, this.options) - this.verify = new Verify(this.credentials, this.options) - this.voice = new Voice(this.credentials, this.options) - } + this.accounts = new Accounts(this.credentials, this.options); + this.audit = new Audit(this.credentials, this.options); + this.applications = new Applications(this.credentials, this.options); + this.messages = new Messages(this.credentials, this.options); + this.numberInsights = new NumberInsights(this.credentials, this.options); + this.numbers = new Numbers(this.credentials, this.options); + this.pricing = new Pricing(this.credentials, this.options); + this.secrets = new Secrets(this.credentials, this.options); + this.sms = new SMS(this.credentials, this.options); + this.verify = new Verify(this.credentials, this.options); + this.voice = new Voice(this.credentials, this.options); + } } diff --git a/packages/server-sdk/package.json b/packages/server-sdk/package.json index 191f410f..0a60fa71 100644 --- a/packages/server-sdk/package.json +++ b/packages/server-sdk/package.json @@ -29,6 +29,7 @@ "dependencies": { "@vonage/accounts": "^1.0.13", "@vonage/applications": "^1.0.12", + "@vonage/audit": "^1.0.0", "@vonage/auth": "^1.0.9", "@vonage/messages": "^1.0.13", "@vonage/number-insights": "^1.0.12", From 425940a96d3b536a76a9bea02220b88a785e473f Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Thu, 12 Jan 2023 22:24:59 +0000 Subject: [PATCH 5/9] fix(build): incorrect type for generator in lower node --- packages/audit/lib/audit.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/audit/lib/audit.ts b/packages/audit/lib/audit.ts index 6acacfc0..f5dc8b93 100644 --- a/packages/audit/lib/audit.ts +++ b/packages/audit/lib/audit.ts @@ -5,7 +5,9 @@ export class Audit extends Client { protected BASE_PATH = 'beta'; protected authType = AuthenticationType.BASIC; - async *getEvents(params: AuditParams): AsyncGenerator { + async *getEvents( + params: AuditParams, + ): AsyncGenerator { let totalPages = 0; let page = params?.page || 1; do { @@ -25,7 +27,7 @@ export class Audit extends Client { yield* events; page++; } catch (error) { - // TODO Logging + // TODO Logging or re throw? return; } } while (page <= totalPages); From 06ae68488eb54c0388073856d6558c0c85ecc88b Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Fri, 13 Jan 2023 17:01:09 +0000 Subject: [PATCH 6/9] refactor: getEvents no longer catches exception --- .../audit/__tests__/__dataSets__/getEvents.ts | 196 ------------------ packages/audit/__tests__/audit.test.ts | 169 +++++++++++++-- packages/audit/lib/audit.ts | 27 +-- 3 files changed, 161 insertions(+), 231 deletions(-) delete mode 100644 packages/audit/__tests__/__dataSets__/getEvents.ts diff --git a/packages/audit/__tests__/__dataSets__/getEvents.ts b/packages/audit/__tests__/__dataSets__/getEvents.ts deleted file mode 100644 index f1627b6a..00000000 --- a/packages/audit/__tests__/__dataSets__/getEvents.ts +++ /dev/null @@ -1,196 +0,0 @@ -import { AuditEvent } from '../../lib/types.ts'; -import { AuditEventTypes } from '../../lib/enums'; -import { Client } from '@vonage/server-client'; - -const BASE_URL = 'https://api.nexmo.com/'; -const CLIENT_METHOD = 'getEvents'; - -const createEvent = (event: AuditEvent): AuditEvent => ({ - id: event.id, - eventType: event.eventType, - createdAt: '2022-11-15T17:30:33', - userEmail: event.userEmail, - userId: event.userId, - accountId: event.accountId, - source: event.source, - sourceDescription: event.sourceDescription, - sourceCountry: event.sourceCountry, - context: event.context, -}); - -const onePageEvent = [createEvent({ id: '1' })]; - -const twoPageEvent = [createEvent({ id: '2' }), createEvent({ id: '3' })]; - -const eventParameters = new URLSearchParams([ - ['event_type', AuditEventTypes.ACCOUNT_SECRET_CREATE], - ['date_from', createEvent({}).createdAt], - ['date_to', createEvent({}).createdAt], - ['search_text', 'fizz-buzz'], - ['page', 42], - ['size', 21], -]); - -export default [ - { - label: 'get events on one page', - clientMethod: CLIENT_METHOD, - exception: false, - request: { - url: BASE_URL, - requests: [ - { - request: [`/beta/audit/events?`, 'GET'], - reply: [ - 200, - { - _embedded: { - events: onePageEvent.map( - Client.transformers.snakeCaseObjectKeys, - ), - }, - page: { - size: 20, - totalElements: 1, - totalPages: 1, - page: 1, - }, - }, - ], - }, - ], - }, - parameters: [], - expected: onePageEvent, - }, - { - label: 'get events on multiple pages', - clientMethod: CLIENT_METHOD, - exception: false, - request: { - url: BASE_URL, - requests: [ - { - request: [`/beta/audit/events?`, 'GET'], - reply: [ - 200, - { - _embedded: { - events: twoPageEvent.map( - Client.transformers.snakeCaseObjectKeys, - ), - }, - page: { - size: 20, - totalElements: 3, - totalPages: 2, - page: 1, - }, - }, - ], - }, - { - request: [`/beta/audit/events?`, 'GET'], - reply: [ - 200, - { - _embedded: { - events: onePageEvent.map( - Client.transformers.snakeCaseObjectKeys, - ), - }, - page: { - size: 20, - totalElements: 3, - totalPages: 2, - page: 2, - }, - }, - ], - }, - ], - }, - parameters: [], - expected: [...twoPageEvent, ...onePageEvent], - }, - { - label: 'get events and handle non 200 on subsequent pages', - clientMethod: CLIENT_METHOD, - exception: false, - request: { - url: BASE_URL, - requests: [ - { - request: [`/beta/audit/events?`, 'GET'], - reply: [ - 200, - { - _embedded: { - events: twoPageEvent.map( - Client.transformers.snakeCaseObjectKeys, - ), - }, - page: { - size: 20, - totalElements: 3, - totalPages: 2, - page: 1, - }, - }, - ], - }, - { - request: [`/beta/audit/events?`, 'GET'], - reply: [ - 401, - { - status: 401, - error: 'Unauthorized', - message: 'Failed', - }, - ], - }, - ], - }, - parameters: [], - expected: [...twoPageEvent], - }, - { - label: 'get events with parameters', - clientMethod: CLIENT_METHOD, - exception: false, - request: { - url: BASE_URL, - requests: [ - { - request: [ - `/beta/audit/events?${eventParameters.toString()}`, - 'GET', - ], - reply: [ - 200, - { - _embedded: { - events: onePageEvent.map( - Client.transformers.snakeCaseObjectKeys, - ), - }, - page: { - size: 20, - totalElements: 1, - totalPages: 1, - page: 1, - }, - }, - ], - }, - ], - }, - parameters: [ - Client.transformers.camelCaseObjectKeys( - Object.fromEntries(eventParameters), - ), - ], - expected: onePageEvent, - }, -]; diff --git a/packages/audit/__tests__/audit.test.ts b/packages/audit/__tests__/audit.test.ts index 903c5abb..0a5adf3a 100644 --- a/packages/audit/__tests__/audit.test.ts +++ b/packages/audit/__tests__/audit.test.ts @@ -1,8 +1,24 @@ import nock from 'nock'; +import { Client } from '@vonage/server-client'; import { Auth } from '@vonage/auth'; import { Audit } from '../lib/index'; -import getEvents from './__dataSets__/getEvents'; -import getEvent from './__dataSets__/getEvent'; +import { AuditEvent } from '../lib/types'; +import { AuditEventTypes } from '../lib/enums'; + +const BASE_URL = 'https://api.nexmo.com/'; + +const createEvent = (event: Partial): Partial => ({ + id: event.id, + eventType: event.eventType, + createdAt: '2022-11-15T17:30:33', + userEmail: event.userEmail, + userId: event.userId, + accountId: event.accountId, + source: event.source, + sourceDescription: event.sourceDescription, + sourceCountry: event.sourceCountry, + context: event.context, +}); describe('Audit Events', () => { let client: Audit; @@ -16,29 +32,144 @@ describe('Audit Events', () => { nock.cleanAll(); }); - test.each(getEvents)( - 'Can $label', - async ({ request, parameters, expected }) => { - const { url, requests } = request; + test('Can get events on one page', async () => { + const scope = nock(BASE_URL, { + reqheaders: { + authorization: 'Basic MTIzNDU6QUJDREU=', + }, + }) + .intercept(`/beta/audit/events?page=1`, 'GET') + .reply(200, { + _embedded: { + events: [createEvent({ id: '1' })].map( + Client.transformers.snakeCaseObjectKeys, + ), + }, + page: { + size: 20, + totalElements: 1, + totalPages: 1, + page: 1, + }, + }); + + const results = client.getEvents({}); + const eventIter = await results.next(); + expect(eventIter.value.id).toBe('1'); + expect(eventIter.value.createdAt).toBe('2022-11-15T17:30:33'); + expect(await results.next().value).toBeUndefined(); + expect(scope.isDone()).toBeTruthy(); + }); + + test('Can get events on multiple pages', async () => { + // We're also checking AuditParams converts to snake_case + const eventParameters = new URLSearchParams([ + ['event_type', AuditEventTypes.ACCOUNT_SECRET_CREATE], + ['date_from', createEvent({}).createdAt], + ['date_to', createEvent({}).createdAt], + ['search_text', 'fizz-buzz'], + ['page', 2], + ['size', 21], + ]); + + const events = []; + const clientParams = Client.transformers.camelCaseObjectKeys( + Object.fromEntries(eventParameters), + ); - const scope = nock(url, { - reqheaders: { - authorization: 'Basic MTIzNDU6QUJDREU=', + const scope = nock(BASE_URL, { + reqheaders: { + authorization: 'Basic MTIzNDU6QUJDREU=', + }, + }) + .intercept( + `/beta/audit/events?${eventParameters.toString()}`, + 'GET', + ) + .reply(200, { + _embedded: { + events: [ + createEvent({ id: '1' }), + createEvent({ id: '2' }), + ].map(Client.transformers.snakeCaseObjectKeys), + }, + page: { + size: 20, + totalElements: 3, + totalPages: 3, + page: 2, }, }); - requests.forEach(({ request, reply }) => { - scope.intercept(...request).reply(...reply); + + eventParameters.set('page', '3'); + scope + .intercept( + `/beta/audit/events?${eventParameters.toString()}`, + 'GET', + ) + .reply(200, { + _embedded: { + events: [createEvent({ id: '3' })].map( + Client.transformers.snakeCaseObjectKeys, + ), + }, + page: { + size: 20, + totalElements: 3, + totalPages: 2, + page: 3, + }, }); - const results = []; - for await (const event of client.getEvents(...parameters)) { - results.push(event); - } + for await (const event of client.getEvents(clientParams)) { + events.push(event); + } - expect(results).toEqual(expected); - expect(scope.isDone()).toBeTruthy(); - }, - ); + expect(events[0].id).toBe('1'); + expect(events[1].id).toBe('2'); + expect(events[2].id).toBe('3'); + expect(scope.isDone()).toBeTruthy(); + }); + + test('Throws exception when request fails', async () => { + const events = []; + const scope = nock(BASE_URL, { + reqheaders: { + authorization: 'Basic MTIzNDU6QUJDREU=', + }, + }) + .intercept(`/beta/audit/events?page=1`, 'GET') + .reply(200, { + _embedded: { + events: [createEvent({ id: '1' })].map( + Client.transformers.snakeCaseObjectKeys, + ), + }, + page: { + size: 20, + totalElements: 2, + totalPages: 2, + page: 1, + }, + }) + .intercept(`/beta/audit/events?page=2`, 'GET') + .reply(401, { + status: 401, + error: 'Unauthorized', + message: 'Failed', + }); + + const results = client.getEvents({}); + + const eventIter = await results.next(); + expect(eventIter.value.id).toBe('1'); + + await expect(results.next()).rejects.toThrow( + 'Request failed with status code 401', + ); + + expect(scope.isDone()).toBeTruthy(); + }); test('Can get event', async () => { const scope = nock('https://api.nexmo.com/', { diff --git a/packages/audit/lib/audit.ts b/packages/audit/lib/audit.ts index f5dc8b93..98e70d31 100644 --- a/packages/audit/lib/audit.ts +++ b/packages/audit/lib/audit.ts @@ -11,25 +11,20 @@ export class Audit extends Client { let totalPages = 0; let page = params?.page || 1; do { - try { - const resp = await this.sendGetRequest( - `${this.config.apiHost}/${this.BASE_PATH}/audit/events`, - Client.transformers.snakeCaseObjectKeys(params), - ); + params.page = page; + const resp = await this.sendGetRequest( + `${this.config.apiHost}/${this.BASE_PATH}/audit/events`, + Client.transformers.snakeCaseObjectKeys(params), + ); - const events = (resp.data?._embedded.events || []).map( - (event) => - Client.transformers.camelCaseObjectKeys(event, true), - ); + const events = (resp.data?._embedded.events || []).map((event) => + Client.transformers.camelCaseObjectKeys(event, true), + ); - totalPages = resp.data?.page?.totalPages || 0; + totalPages = resp.data?.page?.totalPages || 0; - yield* events; - page++; - } catch (error) { - // TODO Logging or re throw? - return; - } + yield* events; + page++; } while (page <= totalPages); } From 65f107627ae422a2eba16d6380051e7af54d392e Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Fri, 13 Jan 2023 18:31:04 +0000 Subject: [PATCH 7/9] fix: transform test for node 14 --- packages/server-client/lib/transformers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server-client/lib/transformers.ts b/packages/server-client/lib/transformers.ts index f3e39701..a0ec41ee 100644 --- a/packages/server-client/lib/transformers.ts +++ b/packages/server-client/lib/transformers.ts @@ -11,7 +11,7 @@ export const transformObjectKeys = ( const transformedObject = {}; for (const prop in objectToTransform) { - if (!Object.hasOwn(objectToTransform, prop)) { + if (!Object.prototype.hasOwnProperty.call(objectToTransform, prop)) { continue; } From 0b0ecd71c8574d891b7a6ffe4679c6665e68fed6 Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Tue, 17 Jan 2023 16:55:16 +0000 Subject: [PATCH 8/9] refactor: breakup enums --- packages/vetch/__tests__/index.test.ts | 18 +- packages/vetch/__tests__/vetch.test.ts | 357 +++++++++--------- packages/vetch/lib/enums/HTTPMethods.ts | 11 + packages/vetch/lib/enums/responseTypes.ts | 3 + packages/vetch/lib/index.ts | 23 +- packages/vetch/lib/interfaces/headers.ts | 3 + .../vetch/lib/interfaces/vetchHttpRequest.ts | 3 + packages/vetch/lib/interfaces/vetchOptions.ts | 31 ++ .../vetch/lib/interfaces/vetchResponse.ts | 13 + packages/vetch/lib/types.ts | 76 ---- packages/vetch/lib/types/vetchError.ts | 13 + packages/vetch/lib/types/vetchPromise.ts | 3 + packages/vetch/lib/vetch.ts | 299 +++++++-------- 13 files changed, 405 insertions(+), 448 deletions(-) create mode 100644 packages/vetch/lib/enums/HTTPMethods.ts create mode 100644 packages/vetch/lib/enums/responseTypes.ts create mode 100644 packages/vetch/lib/interfaces/headers.ts create mode 100644 packages/vetch/lib/interfaces/vetchHttpRequest.ts create mode 100644 packages/vetch/lib/interfaces/vetchOptions.ts create mode 100644 packages/vetch/lib/interfaces/vetchResponse.ts delete mode 100644 packages/vetch/lib/types.ts create mode 100644 packages/vetch/lib/types/vetchError.ts create mode 100644 packages/vetch/lib/types/vetchPromise.ts diff --git a/packages/vetch/__tests__/index.test.ts b/packages/vetch/__tests__/index.test.ts index 5562e1f2..62bc97af 100644 --- a/packages/vetch/__tests__/index.test.ts +++ b/packages/vetch/__tests__/index.test.ts @@ -1,17 +1,5 @@ -// Copyright 2020 Vonage -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -import * as main from '../lib' +import * as main from '../lib'; test('main exports', () => { - expect(main.Vetch) -}) + expect(main.Vetch).toBeDefined(); +}); diff --git a/packages/vetch/__tests__/vetch.test.ts b/packages/vetch/__tests__/vetch.test.ts index 12a314a2..259a7673 100644 --- a/packages/vetch/__tests__/vetch.test.ts +++ b/packages/vetch/__tests__/vetch.test.ts @@ -1,196 +1,187 @@ -// Copyright 2020 Vonage -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import { Vetch, request } from '../lib' -import { stringify } from 'querystring' -import nock from 'nock' -import { HTTPMethods } from '../lib/types' - -nock.disableNetConnect() +import { Vetch, request } from '../lib'; +import { stringify } from 'querystring'; +import nock from 'nock'; +import { HTTPMethods } from '../lib/enums/HTTPMethods'; + +nock.disableNetConnect(); afterEach(() => { - nock.cleanAll() -}) + nock.cleanAll(); +}); -const url = 'https://just-testing.com' +const url = 'https://just-testing.com'; describe('option validation', () => { - test('should throw error if no url provided', async () => { - expect.assertions(1) - await expect(request({})).rejects.toEqual(new Error('URL is required.')) - }) -}) + test('should throw error if no url provided', async () => { + expect.assertions(1); + await expect(request({})).rejects.toEqual(new Error('URL is required.')); + }); +}); describe('error handling', () => { - test('should throw on non-2xx responses by default', async () => { - expect.assertions(1) - nock(url).get('/').reply(500) - await expect(request({ url })).rejects.toEqual( - expect.objectContaining({ code: '500' }) - ) - }) -}) + test('should throw on non-2xx responses by default', async () => { + expect.assertions(1); + nock(url).get('/').reply(500); + await expect(request({ url })).rejects.toEqual( + expect.objectContaining({ code: '500' }), + ); + }); +}); describe('option configuration', () => { - test('should use options passed in constructor', async () => { - expect.assertions(1) - nock(url).head('/').reply(200) - const inst = new Vetch({ method: HTTPMethods.HEAD }) - const res = await inst.request({ url }) - expect(res.config.method).toEqual('HEAD') - }) - - test('should allow nested options passed in constructor', async () => { - expect.assertions(2) - nock(url).get('/').reply(200) - let inst = new Vetch({ headers: { spiderman: 'Norman Osbourne' } }) - let res = await inst.request({ url, headers: { ironMan: 'Mandarin' } }) - expect(res.config.headers?.spiderman).toEqual('Norman Osbourne') - expect(res.config.headers?.ironMan).toEqual('Mandarin') - }) - - test('should allow setting a base url', async () => { - expect.assertions(1) - nock(url).get('/v1/thor').reply(200, {}) - let inst = new Vetch({ baseURL: `${url}/v1` }) - let res = await inst.request({ url: '/thor' }) - expect(res.data).toEqual({}) - }) - - test('should allow URL params', async () => { - expect.assertions(2) - let qs = '?black=panther&captain=america' - let opts = { url: `${url}/${qs}` } - nock(url).get(`/${qs}`).reply(200, {}) - let res = await request(opts) - expect(res.status).toEqual(200) - expect(res.config.url).toEqual(`${url}/${qs}`) - }) - - test('should encode params from object', async () => { - let opts = { - url, - params: { - black: 'panther', - captain: 'america', - }, - } - let qs = '?black=panther&captain=america' - nock(url).get(`/${qs}`).reply(200, {}) - let res = await request(opts) - expect(res.status).toEqual(200) - expect(res.config.url).toEqual(`${url}${qs}`) - }) - - test('should merge URL with params from options', async () => { - let opts = { - url: `${url}?black=panther`, - params: { - captain: 'america', - }, - } - let qs = '?black=panther&captain=america' - nock(url).get(`/${qs}`).reply(200, {}) - let res = await request(opts) - expect(res.status).toEqual(200) - expect(res.config.url).toEqual(`${url}${qs}`) - }) - - test('should return json by default', async () => { - let body = { avengers: 'assemble' } - nock(url).get('/').reply(200, body) - let res = await request({ url }) - expect(res.data).toEqual(body) - }) - - test('should default to application/json', async () => { - nock(url) - .matchHeader('accept', 'application/json') - .get('/') - .reply(200, {}) - let res = await request({ url }) - expect(res.data).toEqual({}) - }) - - test('should include the request data in the response config', async () => { - let body = { avengers: 'assemble' } - nock(url).post('/', body).reply(200) - const res = await request({ url, method: HTTPMethods.POST, data: body }) - expect(res.config.data).toEqual(body) - }) - - test('should allow for our custom user agent', async () => { - const options = { - reqheaders: { - 'user-agent': (val) => { - return /^\@vonage\/server-sdk\/[\d].[\d].[\d].* node\/.*$/.test( - val - ) - }, - }, - } - - nock(url, options).get('/').reply(200) - let inst = new Vetch() - let res = await inst.request({ url }) - }) -}) + test('should use options passed in constructor', async () => { + expect.assertions(1); + nock(url).head('/').reply(200); + const inst = new Vetch({ method: HTTPMethods.HEAD }); + const res = await inst.request({ url }); + expect(res.config.method).toEqual('HEAD'); + }); + + test('should allow nested options passed in constructor', async () => { + expect.assertions(2); + nock(url).get('/').reply(200); + const inst = new Vetch({ headers: { spiderman: 'Norman Osbourne' } }); + const res = await inst.request({ + url, + headers: { ironMan: 'Mandarin' }, + }); + expect(res.config.headers?.spiderman).toEqual('Norman Osbourne'); + expect(res.config.headers?.ironMan).toEqual('Mandarin'); + }); + + test('should allow setting a base url', async () => { + expect.assertions(1); + nock(url).get('/v1/thor').reply(200, {}); + const inst = new Vetch({ baseURL: `${url}/v1` }); + const res = await inst.request({ url: '/thor' }); + expect(res.data).toEqual({}); + }); + + test('should allow URL params', async () => { + expect.assertions(2); + const qs = '?black=panther&captain=america'; + const opts = { url: `${url}/${qs}` }; + nock(url).get(`/${qs}`).reply(200, {}); + const res = await request(opts); + expect(res.status).toEqual(200); + expect(res.config.url).toEqual(`${url}/${qs}`); + }); + + test('should encode params from object', async () => { + const opts = { + url, + params: { + black: 'panther', + captain: 'america', + }, + }; + const qs = '?black=panther&captain=america'; + nock(url).get(`/${qs}`).reply(200, {}); + const res = await request(opts); + expect(res.status).toEqual(200); + expect(res.config.url).toEqual(`${url}${qs}`); + }); + + test('should merge URL with params from options', async () => { + const opts = { + url: `${url}?black=panther`, + params: { + captain: 'america', + }, + }; + const qs = '?black=panther&captain=america'; + nock(url).get(`/${qs}`).reply(200, {}); + const res = await request(opts); + expect(res.status).toEqual(200); + expect(res.config.url).toEqual(`${url}${qs}`); + }); + + test('should return json by default', async () => { + const body = { avengers: 'assemble' }; + nock(url).get('/').reply(200, body); + const res = await request({ url }); + expect(res.data).toEqual(body); + }); + + test('should default to application/json', async () => { + nock(url) + .matchHeader('accept', 'application/json') + .get('/') + .reply(200, {}); + const res = await request({ url }); + expect(res.data).toEqual({}); + }); + + test('should include the request data in the response config', async () => { + const body = { avengers: 'assemble' }; + nock(url).post('/', body).reply(200); + const res = await request({ url, method: HTTPMethods.POST, data: body }); + expect(res.config.data).toEqual(body); + }); + + test('should allow for our custom user agent', async () => { + const options = { + reqheaders: { + 'user-agent': (val) => { + return /^@vonage\/server-sdk\/[\d].[\d].[\d].* node\/.*$/.test( + val, + ); + }, + }, + }; + + nock(url, options).get('/').reply(200); + const inst = new Vetch(); + const res = await inst.request({ url }); + expect(nock.isDone()).toBeTruthy(); + }); +}); describe('data handling', () => { - test('should accept a string in the request data', async () => { - let body = { avengers: 'assemble' } - let encoded = stringify(body) - nock(url) - .matchHeader('content-type', 'application/x-www-form-urlencoded') - .post('/', encoded) - .reply(200, {}) - const res = await request({ - url, - method: HTTPMethods.POST, - data: encoded, - headers: { 'content-type': 'application/x-www-form-urlencoded' }, - }) - expect(res.data).toEqual({}) - }) - - test('should default to application/json content-type with object request', async () => { - let body = { avengers: 'assemble' } - nock(url) - .matchHeader('Content-Type', 'application/json') - .post('/', JSON.stringify(body)) - .reply(200, {}) - const res = await request({ - url, - method: HTTPMethods.POST, - data: body, - }) - - expect(res.data).toEqual({}) - }) -}) + test('should accept a string in the request data', async () => { + const body = { avengers: 'assemble' }; + const encoded = stringify(body); + nock(url) + .matchHeader('content-type', 'application/x-www-form-urlencoded') + .post('/', encoded) + .reply(200, {}); + const res = await request({ + url, + method: HTTPMethods.POST, + data: encoded, + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + }); + expect(res.data).toEqual({}); + }); + + test('should default to application/json content-type with object request', async () => { + const body = { avengers: 'assemble' }; + nock(url) + .matchHeader('Content-Type', 'application/json') + .post('/', JSON.stringify(body)) + .reply(200, {}); + const res = await request({ + url, + method: HTTPMethods.POST, + data: body, + }); + + expect(res.data).toEqual({}); + }); +}); describe('defaults and instances', () => { - test('should allow creating a new instance', () => { - let vetch = new Vetch() - expect(typeof vetch.request).toEqual('function') - }) - - it('should allow passing empty options', async () => { - let body = { avengers: 'assemble' } - nock(url).get('/').reply(200, body) - let vetch = new Vetch({ url }) - let res = await vetch.request() - - expect(res.data).toEqual(body) - }) -}) + test('should allow creating a new instance', () => { + const vetch = new Vetch(); + expect(typeof vetch.request).toEqual('function'); + }); + + it('should allow passing empty options', async () => { + const body = { avengers: 'assemble' }; + nock(url).get('/').reply(200, body); + const vetch = new Vetch({ url }); + const res = await vetch.request(); + + expect(res.data).toEqual(body); + }); +}); diff --git a/packages/vetch/lib/enums/HTTPMethods.ts b/packages/vetch/lib/enums/HTTPMethods.ts new file mode 100644 index 00000000..9439eebd --- /dev/null +++ b/packages/vetch/lib/enums/HTTPMethods.ts @@ -0,0 +1,11 @@ +export enum HTTPMethods { + GET = 'GET', + HEAD = 'HEAD', + POST = 'POST', + DELETE = 'DELETE', + PUT = 'PUT', + CONNECT = 'CONNECT', + OPTIONS = 'OPTIONS', + TRACE = 'TRACE', + PATCH = 'PATCH', +} diff --git a/packages/vetch/lib/enums/responseTypes.ts b/packages/vetch/lib/enums/responseTypes.ts new file mode 100644 index 00000000..007a4466 --- /dev/null +++ b/packages/vetch/lib/enums/responseTypes.ts @@ -0,0 +1,3 @@ +export enum ResponseTypes { + json = 'json', +} diff --git a/packages/vetch/lib/index.ts b/packages/vetch/lib/index.ts index b3544df7..ec11935f 100644 --- a/packages/vetch/lib/index.ts +++ b/packages/vetch/lib/index.ts @@ -11,21 +11,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { VetchOptions } from './types' -import { Vetch } from './vetch' +import { Vetch } from './vetch'; +import { VetchOptions } from './interfaces/vetchOptions'; -export { - VetchError, - VetchPromise, - VetchResponse, - Headers, - ResponseTypes, -} from './types' +export { Vetch, VetchOptions }; -export { Vetch, VetchOptions } - -export const instance = new Vetch() +export const instance = new Vetch(); export async function request(opts: VetchOptions) { - return instance.request(opts) + return instance.request(opts); } +export { VetchError } from './types/vetchError'; +export { Headers } from './interfaces/headers'; +export { VetchPromise } from './types/vetchPromise'; +export { VetchResponse } from './interfaces/vetchResponse'; +export { ResponseTypes } from './enums/responseTypes'; diff --git a/packages/vetch/lib/interfaces/headers.ts b/packages/vetch/lib/interfaces/headers.ts new file mode 100644 index 00000000..b90f8111 --- /dev/null +++ b/packages/vetch/lib/interfaces/headers.ts @@ -0,0 +1,3 @@ +export interface Headers { + [index: string]: any +} diff --git a/packages/vetch/lib/interfaces/vetchHttpRequest.ts b/packages/vetch/lib/interfaces/vetchHttpRequest.ts new file mode 100644 index 00000000..54e14902 --- /dev/null +++ b/packages/vetch/lib/interfaces/vetchHttpRequest.ts @@ -0,0 +1,3 @@ +export interface VetchHttpRequest { + responseUrl: string +} diff --git a/packages/vetch/lib/interfaces/vetchOptions.ts b/packages/vetch/lib/interfaces/vetchOptions.ts new file mode 100644 index 00000000..ebff3cda --- /dev/null +++ b/packages/vetch/lib/interfaces/vetchOptions.ts @@ -0,0 +1,31 @@ +import { HTTPMethods } from '../enums/HTTPMethods'; +import { Headers } from './headers'; +import { ResponseTypes } from '../enums/responseTypes'; +import http from 'http'; +import https from 'https'; +import URL from 'url'; +import { VetchPromise } from '../types/vetchPromise'; + +export interface VetchOptions { + adapter?: ( + options: VetchOptions, + defaultAdapter: (options: VetchOptions) => VetchPromise + ) => VetchPromise + url?: string + baseUrl?: string + baseURL?: string + method?: HTTPMethods + headers?: Headers + data?: any + body?: any + params?: any + responseType?: ResponseTypes + checkStatus?: (status: number) => boolean + size?: number + timeout?: number + agent?: + | boolean + | http.Agent + | https.Agent + | ((parsedUrl: URL) => boolean | https.Agent | http.Agent) +} diff --git a/packages/vetch/lib/interfaces/vetchResponse.ts b/packages/vetch/lib/interfaces/vetchResponse.ts new file mode 100644 index 00000000..0b1af586 --- /dev/null +++ b/packages/vetch/lib/interfaces/vetchResponse.ts @@ -0,0 +1,13 @@ +import { Headers } from './headers'; +import { VetchHttpRequest } from './vetchHttpRequest'; +import { VetchOptions } from './vetchOptions'; + +export interface VetchResponse { + config: VetchOptions + data: T + error?: true + status: number + statusText: string + headers: Headers + request: VetchHttpRequest +} diff --git a/packages/vetch/lib/types.ts b/packages/vetch/lib/types.ts deleted file mode 100644 index b2e3c4eb..00000000 --- a/packages/vetch/lib/types.ts +++ /dev/null @@ -1,76 +0,0 @@ -import http from 'http' -import https from 'https' -import URL from 'url' - -export class VetchError extends Error { - code?: string - config: VetchOptions - response: VetchResponse - constructor(message: string, options: VetchOptions) { - super(message) - this.config = options - } -} - -export interface Headers { - [index: string]: any -} - -export interface VetchHttpRequest { - responseUrl: string -} - -export type VetchPromise = Promise> -export const VetchPromise = Promise - -export type NumbersResponse = VetchResponse - -export interface VetchResponse { - config: VetchOptions - data: T - error?: true - status: number - statusText: string - headers: Headers - request: VetchHttpRequest -} - -export enum HTTPMethods { - GET = 'GET', - HEAD = 'HEAD', - POST = 'POST', - DELETE = 'DELETE', - PUT = 'PUT', - CONNECT = 'CONNECT', - OPTIONS = 'OPTIONS', - TRACE = 'TRACE', - PATCH = 'PATCH', -} - -export enum ResponseTypes { - json = 'json', -} - -export interface VetchOptions { - adapter?: ( - options: VetchOptions, - defaultAdapter: (options: VetchOptions) => VetchPromise - ) => VetchPromise - url?: string - baseUrl?: string - baseURL?: string - method?: HTTPMethods - headers?: Headers - data?: any - body?: any - params?: any - responseType?: ResponseTypes - checkStatus?: (status: number) => boolean - size?: number - timeout?: number - agent?: - | boolean - | http.Agent - | https.Agent - | ((parsedUrl: URL) => boolean | https.Agent | http.Agent) -} diff --git a/packages/vetch/lib/types/vetchError.ts b/packages/vetch/lib/types/vetchError.ts new file mode 100644 index 00000000..629c2ec4 --- /dev/null +++ b/packages/vetch/lib/types/vetchError.ts @@ -0,0 +1,13 @@ +import { VetchResponse } from '../interfaces/vetchResponse'; +import { VetchOptions } from '../interfaces/vetchOptions'; + +export class VetchError extends Error { + code?: string; + config: VetchOptions; + response: VetchResponse; + + constructor(message: string, options: VetchOptions) { + super(message); + this.config = options; + } +} diff --git a/packages/vetch/lib/types/vetchPromise.ts b/packages/vetch/lib/types/vetchPromise.ts new file mode 100644 index 00000000..f71a2f32 --- /dev/null +++ b/packages/vetch/lib/types/vetchPromise.ts @@ -0,0 +1,3 @@ +import { VetchResponse } from '../interfaces/vetchResponse'; + +export type VetchPromise = Promise> diff --git a/packages/vetch/lib/vetch.ts b/packages/vetch/lib/vetch.ts index 03e4cb46..e2cd7a32 100644 --- a/packages/vetch/lib/vetch.ts +++ b/packages/vetch/lib/vetch.ts @@ -1,178 +1,155 @@ -// Copyright 2020 Vonage -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import fetch, { Response as fetchResponse } from 'node-fetch' -import { stringify } from 'querystring' -import merge from 'lodash.merge' -import http from 'http' -import https from 'https' -import URL from 'url' - -import { - VetchError, - VetchOptions, - VetchResponse, - ResponseTypes, - Headers, -} from './types' -import { Url } from 'url' +import fetch, { Response as fetchResponse } from 'node-fetch'; +import { stringify } from 'querystring'; +import merge from 'lodash.merge'; +import http from 'http'; +import https from 'https'; +import URL from 'url'; +import { VetchError } from './types/vetchError'; +import { Headers } from './interfaces/headers'; +import { VetchResponse } from './interfaces/vetchResponse'; +import { ResponseTypes } from './enums/responseTypes'; +import { VetchOptions } from './interfaces/vetchOptions'; export class Vetch { - defaults: VetchOptions + defaults: VetchOptions; - constructor(defaults?: VetchOptions) { - this.defaults = defaults || { responseType: ResponseTypes.json } - if (!this.defaults.responseType) { - this.defaults.responseType = ResponseTypes.json - } + constructor(defaults?: VetchOptions) { + this.defaults = defaults || { responseType: ResponseTypes.json }; + if (!this.defaults.responseType) { + this.defaults.responseType = ResponseTypes.json; + } + } + + private async _defaultAdapter( + opts: VetchOptions, + ): Promise> { + const res = await fetch(opts.url, opts); + const data = await this.getResponseData(opts, res); + return this.createResponse(opts, res, data); + } + + async request(opts: VetchOptions = {}): Promise> { + opts = this.validateOpts(opts); + + const formattedResponse = await this._defaultAdapter(opts); + + if (!opts.checkStatus(formattedResponse.status)) { + const err = new VetchError( + `Request failed with status code ${formattedResponse.status}`, + opts, + ); + err.code = String(formattedResponse.status); + err.response = formattedResponse; + throw err; } - private async _defaultAdapter( - opts: VetchOptions - ): Promise> { - const res = await fetch(opts.url!, opts) - const data = await this.getResponseData(opts, res) - return this.createResponse(opts, res, data) + return formattedResponse; + } + + private async getResponseData( + opts: VetchOptions, + res: fetchResponse, + ): Promise { + switch (opts.responseType) { + case 'json': { + let data = await res.text(); + try { + data = JSON.parse(data); + } catch { + // continue + } + return data; + } + default: + return res.text(); } + } + + private validateOpts(options: VetchOptions): VetchOptions { + const opts = merge({}, this.defaults, options); - async request(opts: VetchOptions = {}): Promise> { - opts = this.validateOpts(opts) - - try { - let formattedResponse: VetchResponse - formattedResponse = await this._defaultAdapter(opts) - - if (!opts.checkStatus!(formattedResponse.status)) { - const err = new VetchError( - `Request failed with status code ${formattedResponse.status}`, - opts - ) - err.code = String(formattedResponse.status) - err.response = formattedResponse - throw err - } - - return formattedResponse - } catch (e) { - throw e - } + opts.headers = opts.headers || {}; + opts.checkStatus = this.checkStatus; + + if (!opts.url) { + throw new Error('URL is required.'); } - private async getResponseData( - opts: VetchOptions, - res: fetchResponse - ): Promise { - switch (opts.responseType) { - case 'json': { - let data = await res.text() - try { - data = JSON.parse(data) - } catch { - // continue - } - return data as {} - } - default: - return res.text() - } + const baseUrl = opts.baseUrl || opts.baseURL; + if (baseUrl) { + opts.url = baseUrl + opts.url; } - private validateOpts(options: VetchOptions): VetchOptions { - const opts = merge({}, this.defaults, options) - - opts.headers = opts.headers || {} - opts.checkStatus = this.checkStatus - opts.responseType = opts.responseType - - if (!opts.url) { - throw new Error('URL is required.') - } - - const baseUrl = opts.baseUrl || opts.baseURL - if (baseUrl) { - opts.url = baseUrl + opts.url - } - - if (opts.params) { - let queryParams = stringify(opts.params) - if (queryParams.startsWith('?')) { - queryParams = queryParams.slice(1) - } - - const prefix = opts.url.includes('?') ? '&' : '?' - opts.url = `${opts.url}${prefix}${queryParams}` - } - - if (opts.data) { - if (typeof opts.data === 'object') { - opts.body = JSON.stringify(opts.data) - opts.headers['Content-Type'] = 'application/json' - } else { - opts.body = opts.data - } - } - - if (!opts.headers.Accept && opts.responseType === 'json') { - opts.headers.Accept = 'application/json' - } - - // Set our user agent - opts.headers[ - 'user-agent' - ] = `@vonage/server-sdk/3.0.0 node/${process.version.replace('v', '')}` - - // Allow a custom timeout to be used - const httpAgent = new http.Agent({ - timeout: this.defaults.timeout, - }) - const httpsAgent = new https.Agent({ - timeout: this.defaults.timeout, - }) - opts.agent = (parsedUrl: URL): https.Agent | http.Agent => { - if (parsedUrl.protocol === 'http:') { - return httpAgent - } else { - return httpsAgent - } - } - - return opts + if (opts.params) { + let queryParams = stringify(opts.params); + if (queryParams.startsWith('?')) { + queryParams = queryParams.slice(1); + } + + const prefix = opts.url.includes('?') ? '&' : '?'; + opts.url = `${opts.url}${prefix}${queryParams}`; } - private checkStatus(status: number) { - return status >= 200 && status < 300 + if (opts.data) { + if (typeof opts.data === 'object') { + opts.body = JSON.stringify(opts.data); + opts.headers['Content-Type'] = 'application/json'; + } else { + opts.body = opts.data; + } } - private createResponse( - opts: VetchOptions, - res: fetchResponse, - data?: T - ): VetchResponse { - const headers = {} as Headers - - res.headers.forEach((value, key) => { - headers[key] = value - }) - - return { - config: opts, - data: data as T, - headers, - status: res.status, - statusText: res.statusText, - request: { - responseUrl: res.url, - }, - } + if (!opts.headers.Accept && opts.responseType === 'json') { + opts.headers.Accept = 'application/json'; } + + // Set our user agent + opts.headers[ + 'user-agent' + ] = `@vonage/server-sdk/3.0.0 node/${process.version.replace('v', '')}`; + + // Allow a custom timeout to be used + const httpAgent = new http.Agent({ + timeout: this.defaults.timeout, + }); + const httpsAgent = new https.Agent({ + timeout: this.defaults.timeout, + }); + opts.agent = (parsedUrl: URL): https.Agent | http.Agent => { + if (parsedUrl.protocol === 'http:') { + return httpAgent; + } else { + return httpsAgent; + } + }; + + return opts; + } + + private checkStatus(status: number) { + return status >= 200 && status < 300; + } + + private createResponse( + opts: VetchOptions, + res: fetchResponse, + data?: T, + ): VetchResponse { + const headers = {} as Headers; + + res.headers.forEach((value, key) => { + headers[key] = value; + }); + + return { + config: opts, + data: data as T, + headers, + status: res.status, + statusText: res.statusText, + request: { + responseUrl: res.url, + }, + }; + } } From 3a459f887492e3f52fae31cacfcf346c85b1ab71 Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Tue, 17 Jan 2023 18:59:14 +0000 Subject: [PATCH 9/9] refactor: breakup audit --- packages/audit/__tests__/audit.test.ts | 2 +- packages/audit/lib/audit.ts | 4 +- packages/audit/lib/index.ts | 6 ++- .../lib/interfaces/auditEventListResponse.ts | 11 +++++ .../audit/lib/interfaces/auditEventPage.ts | 6 +++ .../audit/lib/interfaces/auditResponse.ts | 3 ++ packages/audit/lib/types.ts | 42 ------------------- packages/audit/lib/types/auditEvent.ts | 14 +++++++ packages/audit/lib/types/auditParams.ts | 10 +++++ packages/vetch/lib/index.ts | 13 ------ 10 files changed, 53 insertions(+), 58 deletions(-) create mode 100644 packages/audit/lib/interfaces/auditEventListResponse.ts create mode 100644 packages/audit/lib/interfaces/auditEventPage.ts create mode 100644 packages/audit/lib/interfaces/auditResponse.ts delete mode 100644 packages/audit/lib/types.ts create mode 100644 packages/audit/lib/types/auditEvent.ts create mode 100644 packages/audit/lib/types/auditParams.ts diff --git a/packages/audit/__tests__/audit.test.ts b/packages/audit/__tests__/audit.test.ts index 0a5adf3a..97368b90 100644 --- a/packages/audit/__tests__/audit.test.ts +++ b/packages/audit/__tests__/audit.test.ts @@ -2,8 +2,8 @@ import nock from 'nock'; import { Client } from '@vonage/server-client'; import { Auth } from '@vonage/auth'; import { Audit } from '../lib/index'; -import { AuditEvent } from '../lib/types'; import { AuditEventTypes } from '../lib/enums'; +import { AuditEvent } from '../lib/types/auditEvent'; const BASE_URL = 'https://api.nexmo.com/'; diff --git a/packages/audit/lib/audit.ts b/packages/audit/lib/audit.ts index 98e70d31..50af5f4d 100644 --- a/packages/audit/lib/audit.ts +++ b/packages/audit/lib/audit.ts @@ -1,5 +1,7 @@ import { AuthenticationType, Client } from '@vonage/server-client'; -import { AuditParams, AuditEvent, AuditEventListResponse } from './types'; +import { AuditParams } from './types/auditParams'; +import { AuditEvent } from './types/auditEvent'; +import { AuditEventListResponse } from './interfaces/auditEventListResponse'; export class Audit extends Client { protected BASE_PATH = 'beta'; diff --git a/packages/audit/lib/index.ts b/packages/audit/lib/index.ts index 4a4d5d03..3715b861 100644 --- a/packages/audit/lib/index.ts +++ b/packages/audit/lib/index.ts @@ -2,4 +2,8 @@ export { Audit } from './audit'; export * from './enums'; -export * from './types'; +export * from './interfaces/auditResponse'; +export { AuditParams } from './types/auditParams'; +export { AuditEvent } from './types/auditEvent'; +export { AuditEventPage } from './interfaces/auditEventPage'; +export { AuditEventListResponse } from './interfaces/auditEventListResponse'; diff --git a/packages/audit/lib/interfaces/auditEventListResponse.ts b/packages/audit/lib/interfaces/auditEventListResponse.ts new file mode 100644 index 00000000..f7978f84 --- /dev/null +++ b/packages/audit/lib/interfaces/auditEventListResponse.ts @@ -0,0 +1,11 @@ +import { APILinks } from '@vonage/server-client'; +import { AuditEvent } from '../types/auditEvent'; +import { AuditEventPage } from './auditEventPage'; + +export interface AuditEventListResponse { + _embedded?: { + events: AuditEvent[] + } + _links: APILinks + page: AuditEventPage +} diff --git a/packages/audit/lib/interfaces/auditEventPage.ts b/packages/audit/lib/interfaces/auditEventPage.ts new file mode 100644 index 00000000..56caf26f --- /dev/null +++ b/packages/audit/lib/interfaces/auditEventPage.ts @@ -0,0 +1,6 @@ +export interface AuditEventPage { + size: number + totalElements: number + totalPages: number + number: number +} diff --git a/packages/audit/lib/interfaces/auditResponse.ts b/packages/audit/lib/interfaces/auditResponse.ts new file mode 100644 index 00000000..332681b9 --- /dev/null +++ b/packages/audit/lib/interfaces/auditResponse.ts @@ -0,0 +1,3 @@ +import { VetchResponse } from '@vonage/vetch'; + +export type AuditResponse = VetchResponse diff --git a/packages/audit/lib/types.ts b/packages/audit/lib/types.ts deleted file mode 100644 index b769cc56..00000000 --- a/packages/audit/lib/types.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { VetchResponse, VetchOptions } from '@vonage/vetch'; -import { AuditEventTypes } from './enums'; -import { APILinks } from '@vonage/server-client'; - -export type AuditResponse = VetchResponse - -export type AuditParams = { - eventType?: AuditEventTypes - dateFrom?: string - dateTo?: string - searchText?: string - page?: number - size?: number -} - -export type AuditEvent = { - id: string - eventType: AuditEventTypes - createdAt: string - userEmail?: string - userId?: string - accountId: string - source: string - sourceDescription: string - sourceCountry: string - context?: object -} - -export interface AuditEventPage { - size: number - totalElements: number - totalPages: number - number: number -} - -export interface AuditEventListResponse { - _embedded?: { - events: AuditEvent[] - } - _links: APILinks - page: AuditEventPage -} diff --git a/packages/audit/lib/types/auditEvent.ts b/packages/audit/lib/types/auditEvent.ts new file mode 100644 index 00000000..bea3af87 --- /dev/null +++ b/packages/audit/lib/types/auditEvent.ts @@ -0,0 +1,14 @@ +import { AuditEventTypes } from '../enums'; + +export type AuditEvent = { + id: string + eventType: AuditEventTypes + createdAt: string + userEmail?: string + userId?: string + accountId: string + source: string + sourceDescription: string + sourceCountry: string + context?: object +} diff --git a/packages/audit/lib/types/auditParams.ts b/packages/audit/lib/types/auditParams.ts new file mode 100644 index 00000000..92736d16 --- /dev/null +++ b/packages/audit/lib/types/auditParams.ts @@ -0,0 +1,10 @@ +import { AuditEventTypes } from '../enums'; + +export type AuditParams = { + eventType?: AuditEventTypes + dateFrom?: string + dateTo?: string + searchText?: string + page?: number + size?: number +} diff --git a/packages/vetch/lib/index.ts b/packages/vetch/lib/index.ts index ec11935f..1e070b63 100644 --- a/packages/vetch/lib/index.ts +++ b/packages/vetch/lib/index.ts @@ -1,16 +1,3 @@ -// Copyright 2020 Vonage -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - import { Vetch } from './vetch'; import { VetchOptions } from './interfaces/vetchOptions';