diff --git a/.gitignore b/.gitignore index b51a24b8..553c6b0b 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,5 @@ lib/ .DS_Store temp __diff_output__ + +dist \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index bacd4369..00000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "command": "npm", - "tasks": [ - { - "label": "build", - "type": "shell", - "args": [ - "run", - "build" - ], - "problemMatcher": [], - "group": { - "_id": "build", - "isDefault": false - } - } - ] -} \ No newline at end of file diff --git a/e2e/tests/__snapshots__/help.test.ts.snap b/e2e/tests/__snapshots__/help.test.ts.snap index 6c2890b3..66035fcd 100644 --- a/e2e/tests/__snapshots__/help.test.ts.snap +++ b/e2e/tests/__snapshots__/help.test.ts.snap @@ -135,6 +135,7 @@ COMMANDS 8base environment list Lists all the environments of current workspace. 8base environment set Allows you to set the environment of your current project 8base environment show Displays currently selected environment + 8base environment sync Imports project files and custom functions from the latest deployed version of current active environment. OPTIONS -d, --debug Turn on debug logs [boolean] @@ -219,7 +220,7 @@ COMMANDS 8base generate resolver Generator for a custom resolver function. 8base generate scaffold Generates CRUD screens for a table in a specific framework (framework availability: react) 8base generate task Generator for a custom task function. - 8base generate trigger Generator for a custom trigger function. + 8base generate trigger Generator for a custom trigger function. 8base generate webhook Generator for a custom webhook function. OPTIONS @@ -371,7 +372,7 @@ exports[`As a user, I can use help flag for see help information about \`[ 'invo DESCRIPTION Invokes a custom function in the production workspace. -Positionals: +POSITIONALS name The name of the function [string] [required] OPTIONS @@ -389,7 +390,7 @@ exports[`As a user, I can use help flag for see help information about \`[ 'invo DESCRIPTION Invokes a custom function in the production workspace. -Positionals: +POSITIONALS name The name of the function [string] [required] OPTIONS @@ -433,13 +434,13 @@ OPTIONS exports[`As a user, I can use help flag for see help information about \`[ 'logs' ]\`. 1`] = ` "COMMAND - 8base logs [name] [OPTIONS] + 8base logs [OPTIONS] DESCRIPTION - Authenticates the command line user by letting them log into an 8base account. + Shows logs for the functions or migrations -Positionals: - name The name of the function [string] [required] +POSITIONALS + name Name parameter is now deprecated [deprecated] [string] OPTIONS -d, --debug Turn on debug logs [boolean] diff --git a/env_example b/env_example new file mode 100644 index 00000000..4249fc99 --- /dev/null +++ b/env_example @@ -0,0 +1,13 @@ +USERPROFILE= +HOME= +HOME_PATH= +SKIP_VERSION_CHECK= +E2E_SCAFFOLD_GENERATE= +ID_TOKEN= +E2E_SCAFFOLD_WORKSPACE_ID= +E2E_SCAFFOLD_SERVER_URL= +DEVELOPMENT=true +SERVER_URL='http://localhost:3000' +CLIENT_APP_URL='http://localhost:3001' +HOST='https://prestaging-api.8basedev.com/' +DEV_MODE=true \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 235544e9..1d3025e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -583,7 +583,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", - "dev": true, + "devOptional": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -682,7 +682,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, + "devOptional": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -807,12 +807,6 @@ } } }, - "node_modules/@babel/traverse/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/@babel/types": { "version": "7.21.5", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.5.tgz", @@ -831,7 +825,7 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true + "devOptional": true }, "node_modules/@colors/colors": { "version": "1.5.0", @@ -1364,10 +1358,10 @@ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "@sinclair/typebox": "^0.27.8" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/schemas": { @@ -1537,7 +1531,9 @@ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" @@ -1786,7 +1782,21 @@ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", "engines": { - "node": ">=6" + "node": ">=12" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "devOptional": true + }, + "node_modules/@sindresorhus/is": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", + "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==", + "engines": { + "node": ">=4" } }, "node_modules/@sinonjs/commons": { @@ -1874,13 +1884,13 @@ "integrity": "sha512-enCvTL8m/EHS/zIvJno9nE+ndYPh1/oNFzRYRmtUqJICG2VnCSBzMLW5VN2KCQU91f23tsNKR8v7VJJQMatl7Q==", "dev": true, "dependencies": { - "@babel/types": "^7.3.0" + "@babel/types": "^7.20.7" } }, "node_modules/@types/decompress": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/@types/decompress/-/decompress-4.2.3.tgz", - "integrity": "sha512-W24e3Ycz1UZPgr1ZEDHlK4XnvOr+CpJH3qNsFeqXwwlW/9END9gxn3oJSsp7gYdiQxrXUHwUUd3xuzVz37MrZQ==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@types/decompress/-/decompress-4.2.5.tgz", + "integrity": "sha512-LdL+kbcKGs9TzvB/K+OBGzPfDoP6gwwTsykYjodlzUJUUYp/43c1p1jE5YTtz3z4Ml90iruvBXbJ6+kDvb3WSQ==", "dev": true, "dependencies": { "@types/node": "*" @@ -1943,6 +1953,17 @@ "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", "dev": true, + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + } + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.7.tgz", + "integrity": "sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw==", + "devOptional": true, "dependencies": { "@types/node": "*" } @@ -1954,10 +1975,10 @@ "dev": true }, "node_modules/@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", - "dev": true, + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-gPQuzaPR5h/djlAv2apEG1HVOyj1IUs7GpfMZixU0/0KXT3pm64ylHuMUI1/Akh+sq/iikxg6Z2j+fcMDXaaTQ==", + "devOptional": true, "dependencies": { "@types/istanbul-lib-coverage": "*" } @@ -2112,9 +2133,9 @@ "dev": true }, "node_modules/@types/tough-cookie": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.2.tgz", - "integrity": "sha512-vOVmaruQG5EatOU/jM6yU2uCp3Lz6mK1P5Ztu4iJjfM4SVHU9XYktPUQtKlIXuahqXHdEyUarMrBEwg5Cwu+bA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.3.tgz", + "integrity": "sha512-THo502dA5PzG/sfQH+42Lw3fvmYkceefOspdCwpHRul8ik2Jv1K8I5OZz1AT3/rs46kwgMCe9bSBmDLYkkOMGg==", "dev": true }, "node_modules/@types/triple-beam": { @@ -2624,7 +2645,7 @@ "node_modules/archive-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/archive-type/-/archive-type-4.0.0.tgz", - "integrity": "sha1-+S5yIzBW38aWlHJ0nCZ72wRrHXA=", + "integrity": "sha512-zV4Ky0v1F8dBrdYElwTvQhweQ0P7Kwc1aluqJsYtOBP01jXcWCyW2IEfI1YiqsG+Iy7ZR+o5LF1N+PGECBxHWA==", "dependencies": { "file-type": "^4.2.0" }, @@ -2635,7 +2656,7 @@ "node_modules/archive-type/node_modules/file-type": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/file-type/-/file-type-4.4.0.tgz", - "integrity": "sha1-G2AOX8ofvcboDApwxxyNul95BsU=", + "integrity": "sha512-f2UbFQEk7LXgWpi5ntcO86OeA/cC80fuDDDaX/fZ2ZGel+AF7leRQqBBW1eJNiiQkrZlAoM6P+VYP5P6bOlDEQ==", "engines": { "node": ">=4" } @@ -2805,7 +2826,7 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/available-typed-arrays": { "version": "1.0.5", @@ -3014,6 +3035,11 @@ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz", "integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==" }, + "node_modules/bluebird": { + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz", + "integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==" + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -3079,18 +3105,32 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", - "dev": true, + "devOptional": true, "dependencies": { "node-int64": "^0.4.0" } }, "node_modules/buffer": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", - "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" } }, "node_modules/buffer-alloc": { @@ -3110,7 +3150,7 @@ "node_modules/buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "engines": { "node": "*" } @@ -3118,7 +3158,7 @@ "node_modules/buffer-fill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" + "integrity": "sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==" }, "node_modules/buffer-from": { "version": "1.1.2", @@ -3164,18 +3204,13 @@ "node": ">=10" } }, - "node_modules/cacheable-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" }, "engines": { "node": ">=8" @@ -3219,7 +3254,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, + "devOptional": true, "engines": { "node": ">=6" } @@ -3227,7 +3262,7 @@ "node_modules/camel-case": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", - "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", + "integrity": "sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==", "dependencies": { "no-case": "^2.2.0", "upper-case": "^1.1.1" @@ -3439,7 +3474,7 @@ "node_modules/clone": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", "engines": { "node": ">=0.8" } @@ -3447,7 +3482,7 @@ "node_modules/clone-response": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "integrity": "sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==", "dependencies": { "mimic-response": "^1.0.0" } @@ -3514,9 +3549,9 @@ } }, "node_modules/combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -3533,9 +3568,9 @@ } }, "node_modules/component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" }, "node_modules/compress-commons": { "version": "4.1.1", @@ -3572,7 +3607,7 @@ "node_modules/constant-case": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-2.0.0.tgz", - "integrity": "sha1-QXV2TTidP6nI7NKRhu1gBSQ7akY=", + "integrity": "sha512-eS0N9WwmjTqrOmR3o83F5vW8Z+9R1HnVz3xmzT2PMFug9ly+Au/fxRWlEBSb6LcZwspSsEn9Xs1uw9YgzAg1EQ==", "dependencies": { "snake-case": "^2.1.0", "upper-case": "^1.1.1" @@ -3801,7 +3836,7 @@ "node_modules/decompress-response": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==", "dependencies": { "mimic-response": "^1.0.0" }, @@ -3822,14 +3857,72 @@ "node": ">=4" } }, + "node_modules/decompress-tar/node_modules/bl": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", + "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", + "dependencies": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, "node_modules/decompress-tar/node_modules/file-type": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", - "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=", + "integrity": "sha512-Iq1nJ6D2+yIO4c8HHg4fyVb8mAJieo1Oloy1mLLaB2PvezNedhBVm+QU7g0qM42aiMbRXTxKKwGD17rjKNJYVQ==", "engines": { "node": ">=4" } }, + "node_modules/decompress-tar/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/decompress-tar/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/decompress-tar/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/decompress-tar/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/decompress-tar/node_modules/tar-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", + "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", + "dependencies": { + "bl": "^1.0.0", + "buffer-alloc": "^1.2.0", + "end-of-stream": "^1.0.0", + "fs-constants": "^1.0.0", + "readable-stream": "^2.3.0", + "to-buffer": "^1.1.1", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/decompress-tarbz2": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", @@ -3869,7 +3962,7 @@ "node_modules/decompress-targz/node_modules/file-type": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", - "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=", + "integrity": "sha512-Iq1nJ6D2+yIO4c8HHg4fyVb8mAJieo1Oloy1mLLaB2PvezNedhBVm+QU7g0qM42aiMbRXTxKKwGD17rjKNJYVQ==", "engines": { "node": ">=4" } @@ -3877,7 +3970,7 @@ "node_modules/decompress-unzip": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", - "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", + "integrity": "sha512-1fqeluvxgnn86MOh66u8FjbtJpAFv5wgCT9Iw8rcBqQcCo5tO8eiJw7NNTrvt9n4CRBVq7CstiS922oPgyGLrw==", "dependencies": { "file-type": "^3.8.0", "get-stream": "^2.2.0", @@ -3891,7 +3984,7 @@ "node_modules/decompress-unzip/node_modules/file-type": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", - "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=", + "integrity": "sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA==", "engines": { "node": ">=0.10.0" } @@ -3899,7 +3992,7 @@ "node_modules/decompress-unzip/node_modules/get-stream": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", - "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", + "integrity": "sha512-AUGhbbemXxrZJRD5cDvKtQxLuYaIbNtDTK8YqupCI393Q2KSTreEsLUN3ZxAWFGiKTzL6nKuzfcIvieflUX9qA==", "dependencies": { "object-assign": "^4.0.1", "pinkie-promise": "^2.0.0" @@ -3911,7 +4004,7 @@ "node_modules/decompress-unzip/node_modules/pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "engines": { "node": ">=0.10.0" } @@ -3919,7 +4012,7 @@ "node_modules/decompress/node_modules/pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "engines": { "node": ">=0.10.0" } @@ -3939,9 +4032,9 @@ } }, "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "node_modules/deepmerge": { @@ -3954,11 +4047,14 @@ } }, "node_modules/defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "dependencies": { "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/defer-to-connect": { @@ -3993,7 +4089,7 @@ "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "engines": { "node": ">=0.4.0" } @@ -4002,7 +4098,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=8" } @@ -4049,7 +4145,7 @@ "node_modules/dot-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-2.1.1.tgz", - "integrity": "sha1-NNzzf1Co6TwrO8qLt/uRVcfaO+4=", + "integrity": "sha512-HnM6ZlFqcajLsyudHq7LeeLDr2rFAVYtDv/hV5qchQEidSck8j9OPUsXY9KwJv/lHMtYlX4DjRQqwFYa+0r8Ug==", "dependencies": { "no-case": "^2.2.0" } @@ -4099,75 +4195,39 @@ "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz", "integrity": "sha512-vag0O2LKZ/najSoUwDbVlnlCFvhBE/7mGTY2B5FgCBDcRD+oVV1HYTOwM6JZfMg/hIcM6IwnTZ1uQQL5/X3xIQ==", "dependencies": { - "clone-response": "1.0.2", - "get-stream": "3.0.0", - "http-cache-semantics": "3.8.1", - "keyv": "3.0.0", - "lowercase-keys": "1.0.0", - "normalize-url": "2.0.1", - "responselike": "1.0.2" - } - }, - "node_modules/download/node_modules/cacheable-request/node_modules/get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "engines": { - "node": ">=4" + "readable-stream": "^2.0.2" } }, - "node_modules/download/node_modules/cacheable-request/node_modules/lowercase-keys": { + "node_modules/duplexer2/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", - "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/download/node_modules/file-type": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-11.1.0.tgz", - "integrity": "sha512-rM0UO7Qm9K7TWTtA6AShI/t7H5BPjDeGVDaNyg9BjHAj3PysKy7+8C8D137R88jnR3rFJZQB/tFgydl5sN5m7g==", - "engines": { - "node": ">=6" - } + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, - "node_modules/download/node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "node_modules/duplexer2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=6" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/download/node_modules/got": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", - "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", + "node_modules/duplexer2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/duplexer2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dependencies": { - "@sindresorhus/is": "^0.7.0", - "cacheable-request": "^2.1.1", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "into-stream": "^3.1.0", - "is-retry-allowed": "^1.1.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "mimic-response": "^1.0.0", - "p-cancelable": "^0.4.0", - "p-timeout": "^2.0.1", - "pify": "^3.0.0", - "safe-buffer": "^5.1.1", - "timed-out": "^4.0.1", - "url-parse-lax": "^3.0.0", - "url-to-options": "^1.0.1" - }, - "engines": { - "node": ">=4" + "safe-buffer": "~5.1.0" } }, "node_modules/download/node_modules/got/node_modules/get-stream": { @@ -4260,9 +4320,9 @@ } }, "node_modules/duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz", + "integrity": "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==" }, "node_modules/ejs": { "version": "3.1.9", @@ -4307,9 +4367,9 @@ "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" }, "node_modules/end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dependencies": { "once": "^1.4.0" } @@ -4318,7 +4378,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, + "devOptional": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -4606,6 +4666,15 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/eslint-plugin-prettier": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", @@ -4774,7 +4843,7 @@ "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint/node_modules/has-flag": { @@ -5000,9 +5069,9 @@ } }, "node_modules/esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "engines": { "node": ">=0.10.0" @@ -5248,9 +5317,9 @@ } }, "node_modules/file-type": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-8.1.0.tgz", - "integrity": "sha512-qyQ0pzAy78gVoJsmYeNgl8uH8yKhr1lVhW7JbzJmnlRi0I4R2eEDEJZVKG8agpDnLpacwNbDhLNG/LMdxHD2YQ==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-11.1.0.tgz", + "integrity": "sha512-rM0UO7Qm9K7TWTtA6AShI/t7H5BPjDeGVDaNyg9BjHAj3PysKy7+8C8D137R88jnR3rFJZQB/tFgydl5sN5m7g==", "engines": { "node": ">=6" } @@ -5285,7 +5354,7 @@ "node_modules/filename-reserved-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz", - "integrity": "sha1-q/c9+rc10EVECr/qLZHzieu/oik=", + "integrity": "sha512-lc1bnsSr4L4Bdif8Xb/qrtokGbq5zlsms/CYH8PP+WtCkGNF65DPiQY8vG3SakEdRn8Dlnm+gW/qWKKjS5sZzQ==", "engines": { "node": ">=4" } @@ -5396,12 +5465,12 @@ } }, "node_modules/form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", "dependencies": { "asynckit": "^0.4.0", - "combined-stream": "1.0.6", + "combined-stream": "^1.0.6", "mime-types": "^2.1.12" }, "engines": { @@ -5417,7 +5486,7 @@ "node_modules/from2": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", "dependencies": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" @@ -5425,8 +5494,8 @@ }, "node_modules/fs-constants": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, "node_modules/fs-extra": { "version": "11.1.1", @@ -5621,10 +5690,16 @@ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" }, "engines": { - "node": ">= 6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/globals": { @@ -5633,7 +5708,7 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8.0.0" } }, "node_modules/globalthis": { @@ -5707,10 +5782,10 @@ "url-parse-lax": "^3.0.0" }, "engines": { - "node": ">=8.6" + "node": ">=0.12.0" } }, - "node_modules/got/node_modules/get-stream": { + "node_modules/get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", @@ -5726,10 +5801,181 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, - "node_modules/graceful-readlink": { + "node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glur": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/glur/-/glur-1.1.2.tgz", + "integrity": "sha512-l+8esYHTKOx2G/Aao4lEQ0bnHWg4fWtJbVoZZT9Knxi01pB8C80BR85nONLFwkkQoFRCmXY+BUcGZN3yZ2QsRA==" + }, + "node_modules/gopd": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/got": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", + "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", + "dependencies": { + "@sindresorhus/is": "^0.7.0", + "cacheable-request": "^2.1.1", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "into-stream": "^3.1.0", + "is-retry-allowed": "^1.1.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "mimic-response": "^1.0.0", + "p-cancelable": "^0.4.0", + "p-timeout": "^2.0.1", + "pify": "^3.0.0", + "safe-buffer": "^5.1.1", + "timed-out": "^4.0.1", + "url-parse-lax": "^3.0.0", + "url-to-options": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/got/node_modules/get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/got/node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "engines": { + "node": ">=4" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true }, "node_modules/grapheme-splitter": { "version": "1.0.4", @@ -5752,17 +5998,17 @@ } }, "node_modules/graphql-prettier": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/graphql-prettier/-/graphql-prettier-1.0.5.tgz", - "integrity": "sha512-clvW9eTYP4jZ/pwQAdWqQLB0GvdHCTMqriDWhGp4vcnw8M7+paizpyW1bFDs9wbND6e3/VpIPjqVTXdddV1+BQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/graphql-prettier/-/graphql-prettier-1.0.6.tgz", + "integrity": "sha512-Rq2eRQgT7obypnYb+tE27Ira7BYW+YFMdgZT6azrYgVCldNrULHuYOhWZlvjxBKTAU+t/aj8zneiRBuYnj/SNA==", "dependencies": { "graphql": "^14.1.1" } }, "node_modules/graphql-prettier/node_modules/graphql": { - "version": "14.4.1", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.4.1.tgz", - "integrity": "sha512-g4HUH26CohlMjaHneXMAtvG3QtO6peJIUTFxrPW4g5LNnXkUuFoBI6Bk1c14Q5kW8+FyjM/tTbePTgpiVB/2hQ==", + "version": "14.7.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.7.0.tgz", + "integrity": "sha512-l0xWZpoPKpppFzMfvVyFmp9vLN7w/ZZJPefUicMCepfJeQ8sMcztloGYY9DfjVPo6tIUDzU5Hw3MUbIjj9AVVA==", "dependencies": { "iterall": "^1.2.2" }, @@ -5827,7 +6073,30 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-property-descriptors": { @@ -5902,7 +6171,7 @@ "node_modules/header-case": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/header-case/-/header-case-1.0.1.tgz", - "integrity": "sha1-lTWXMZfBRLCWE81l0xfvGZY70C0=", + "integrity": "sha512-i0q9mkOeSuhXw6bGgiQCCBgY/jlZuV/7dZXyZ9c6LcBrqwvT8eT719E9uxE5LiZftdl+z81Ugbg/VvXV4OJOeQ==", "dependencies": { "no-case": "^2.2.0", "upper-case": "^1.1.3" @@ -6021,13 +6290,13 @@ "node_modules/ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", "dev": true }, "node_modules/import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "dependencies": { "parent-module": "^1.0.0", @@ -6068,8 +6337,8 @@ "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "devOptional": true, "engines": { "node": ">=0.8.19" } @@ -6077,7 +6346,7 @@ "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -6110,7 +6379,7 @@ "node_modules/into-stream": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", - "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", + "integrity": "sha512-TcdjPibTksa1NQximqep2r17ISRiNE9fwlfbg3F8ANdvP5/yrFTew86VcO//jk4QTaMlbjypPBq76HN2zaKfZQ==", "dependencies": { "from2": "^2.1.1", "p-is-promise": "^1.1.0" @@ -6204,10 +6473,13 @@ } }, "node_modules/is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -6232,7 +6504,7 @@ "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -6250,7 +6522,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", - "dev": true, + "devOptional": true, "engines": { "node": ">=6" } @@ -6278,7 +6550,7 @@ "node_modules/is-lower-case": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/is-lower-case/-/is-lower-case-1.1.3.tgz", - "integrity": "sha1-fhR75HaNxGbbO/shzGCzHmrWk5M=", + "integrity": "sha512-+5A1e/WJpLLXZEDlgz4G//WYSHyQBD32qa4Jd3Lw06qQlv3fJHnp3YIHjTQSGzHMgzmVKz2ZP3rBxTHkPw/lxA==", "dependencies": { "lower-case": "^1.1.0" } @@ -6286,7 +6558,7 @@ "node_modules/is-natural-number": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", - "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=" + "integrity": "sha512-Y4LTamMe0DDQIIAlaer9eKebAlDSV6huy+TWhJVPlzZh2o4tRP5SQWFlLn5N0To4mDD22/qdOq+veo1cSISLgQ==" }, "node_modules/is-negative-zero": { "version": "2.0.2", @@ -6385,7 +6657,7 @@ "node_modules/is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", "engines": { "node": ">=0.10.0" } @@ -6417,12 +6689,12 @@ } }, "node_modules/is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, "dependencies": { - "has-symbols": "^1.0.1" + "has-symbols": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -6577,37 +6849,16 @@ "semver": "^6.3.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", - "dev": true, - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" + "node": ">= 0.4" }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/istanbul-lib-report/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "engines": { "node": ">=8" } @@ -6627,13 +6878,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/istanbul-lib-report/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "node_modules/is-upper-case": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-upper-case/-/is-upper-case-1.1.2.tgz", + "integrity": "sha512-GQYSJMgfeAmVwh9ixyk888l7OIhNAGKtY6QA+IrWlu9MDTCaXmeozOZ2S9Knj7bQwBO/H6J2kb+pbyTUiMNbsw==", + "dependencies": { + "upper-case": "^1.1.0" } }, "node_modules/istanbul-lib-report/node_modules/supports-color": { @@ -6642,7 +6892,18 @@ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dependencies": { + "is-docker": "^2.0.0" }, "engines": { "node": ">=8" @@ -6711,9 +6972,9 @@ } }, "node_modules/isutf8": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/isutf8/-/isutf8-2.0.4.tgz", - "integrity": "sha512-4DvnF8CTx4QYN5UD7VtScvQEJq910d09V2yArkAvc62BUxnuFTnVhkq3iPR802ruiibPG4lQm/I8FNAxPYx5fw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isutf8/-/isutf8-2.1.0.tgz", + "integrity": "sha512-rEMU6f82evtJNtYMrtVODUbf+C654mos4l+9noOueesUMipSWK6x3tpt8DiXhcZh/ZOBWYzJ9h9cNAlcQQnMiQ==", "engines": { "node": ">= 0.12" } @@ -7293,7 +7554,6 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -7766,14 +8026,14 @@ "dependencies": { "has-flag": "^4.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-transform-graphql": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/jest-transform-graphql/-/jest-transform-graphql-2.1.0.tgz", - "integrity": "sha1-kDy2a7J7wncv0+XdT36bVyMPWCk=", + "integrity": "sha512-oLVErzg6bN9eJPB/b8c1+0go3K1F1OZNkvlbUfOgK+96ulfX/fnp+4jI3tjQ1IUVL2XcSjhzwDwNdwsNI5EhRg==", "dev": true, "peerDependencies": { "graphql-tag": "^2.0.0" @@ -8015,7 +8275,7 @@ "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true, + "devOptional": true, "bin": { "jsesc": "bin/jsesc" }, @@ -8024,9 +8284,10 @@ } }, "node_modules/json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", @@ -8042,7 +8303,7 @@ "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, "node_modules/json5": { @@ -8120,7 +8381,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", - "dev": true, + "devOptional": true, "engines": { "node": ">=6" } @@ -8265,12 +8526,12 @@ "node_modules/lower-case": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", - "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=" + "integrity": "sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==" }, "node_modules/lower-case-first": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/lower-case-first/-/lower-case-first-1.0.2.tgz", - "integrity": "sha1-5dp8JvKacHO+AtUrrJmA5ZIq36E=", + "integrity": "sha512-UuxaYakO7XeONbKrZf5FEgkantPf5DUqDayzP5VXZrtRPdH86s4kN47I8B3TW10S4QKiE3ziHNf3kRN//okHjA==", "dependencies": { "lower-case": "^1.1.2" } @@ -8303,14 +8564,23 @@ } }, "node_modules/make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dependencies": { - "pify": "^3.0.0" + "pify": "^4.0.1", + "semver": "^5.6.0" }, "engines": { - "node": ">=4" + "node": ">=6" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "bin": { + "semver": "bin/semver" } }, "node_modules/make-error": { @@ -8331,7 +8601,7 @@ "node_modules/memorystream": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", "engines": { "node": ">= 0.10.0" } @@ -8340,7 +8610,16 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "devOptional": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } }, "node_modules/merge2": { "version": "1.4.1", @@ -8354,7 +8633,7 @@ "node_modules/methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", "engines": { "node": ">= 0.6" } @@ -8458,8 +8737,8 @@ "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "devOptional": true }, "node_modules/natural-compare-lite": { "version": "1.4.0", @@ -8571,7 +8850,7 @@ "node_modules/noms": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", - "integrity": "sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=", + "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==", "dependencies": { "inherits": "^2.0.1", "readable-stream": "~1.0.31" @@ -8580,12 +8859,12 @@ "node_modules/noms/node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" }, "node_modules/noms/node_modules/readable-stream": { "version": "1.0.34", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", @@ -8596,7 +8875,7 @@ "node_modules/noms/node_modules/string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" }, "node_modules/normalize-path": { "version": "3.0.0", @@ -8689,7 +8968,7 @@ "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dependencies": { "wrappy": "1" } @@ -8721,7 +9000,10 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/open": { @@ -8825,9 +9107,9 @@ "integrity": "sha1-IIhF6J4ZOtTZcUdLk5R3NqVtE/M=" }, "node_modules/p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", + "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==", "engines": { "node": ">=6" } @@ -8846,7 +9128,7 @@ "node_modules/p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", "engines": { "node": ">=4" } @@ -8854,7 +9136,7 @@ "node_modules/p-is-promise": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", + "integrity": "sha512-zL7VE4JVS2IFSkR2GQKDSPEVxkoH43/p7oEnwpdCndKYJO0HVeRB7fA8TJwuLOTBREtK0ea8eHaxdwcpob5dmg==", "engines": { "node": ">=4" } @@ -8892,7 +9174,7 @@ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" }, "engines": { "node": ">=6" @@ -8935,10 +9217,112 @@ "node": ">=8" } }, + "node_modules/package-json/node_modules/@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/package-json/node_modules/cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/package-json/node_modules/cacheable-request/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json/node_modules/cacheable-request/node_modules/lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/package-json/node_modules/got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dependencies": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/package-json/node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + }, + "node_modules/package-json/node_modules/json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==" + }, + "node_modules/package-json/node_modules/keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dependencies": { + "json-buffer": "3.0.0" + } + }, + "node_modules/package-json/node_modules/normalize-url": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/package-json/node_modules/p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "engines": { + "node": ">=6" + } + }, "node_modules/package-json/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -8946,7 +9330,7 @@ "node_modules/param-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", - "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=", + "integrity": "sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w==", "dependencies": { "no-case": "^2.2.0" } @@ -8984,7 +9368,7 @@ "node_modules/pascal-case": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-2.0.1.tgz", - "integrity": "sha1-LVeNNFX2YNpl7KGO+VtODekSdh4=", + "integrity": "sha512-qjS4s8rBOJa2Xm0jmxXiyh1+OFf6ekCWOvUaRgAQSktzlTbMotS0nmG9gyYAybCWBcuP4fsBeRCKNwGBnMe2OQ==", "dependencies": { "camel-case": "^3.0.0", "upper-case-first": "^1.1.0" @@ -8993,7 +9377,7 @@ "node_modules/path-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/path-case/-/path-case-2.1.1.tgz", - "integrity": "sha1-lLgDfDctP+KQbkZbtF4l0ibo7qU=", + "integrity": "sha512-Ou0N05MioItesaLr9q8TtHVWmJ6fxWdqKB2RohFmNWVyJ+2zeKIeDNWAN6B/Pe7wpzWChhZX6nONYmOnMeJQ/Q==", "dependencies": { "no-case": "^2.2.0" } @@ -9001,7 +9385,7 @@ "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "engines": { "node": ">=0.10.0" } @@ -9054,17 +9438,17 @@ } }, "node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", "engines": { "node": ">=0.10.0" } @@ -9072,7 +9456,7 @@ "node_modules/pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", "dependencies": { "pinkie": "^2.0.0" }, @@ -9114,7 +9498,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, + "devOptional": true, "dependencies": { "find-up": "^4.0.0" }, @@ -9134,7 +9518,6 @@ "version": "3.4.0", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==", - "dev": true, "engines": { "node": ">=4.0.0" } @@ -9142,7 +9525,7 @@ "node_modules/prepend-http": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==", "engines": { "node": ">=4" } @@ -9218,9 +9601,9 @@ "dev": true }, "node_modules/process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "node_modules/progress": { "version": "2.0.3", @@ -9265,9 +9648,9 @@ } }, "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "engines": { "node": ">=6" } @@ -9423,17 +9806,16 @@ } }, "node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" } }, "node_modules/readdir": { @@ -9531,7 +9913,7 @@ "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "engines": { "node": ">=0.10.0" } @@ -9545,9 +9927,9 @@ } }, "node_modules/reselect": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/reselect/-/reselect-4.0.0.tgz", - "integrity": "sha512-qUgANli03jjAyGlnbYVAV5vvnOmJnODyABz51RdBN7M4WaVu8mecZWgyQNkG8Yqe3KRGRt0l4K4B3XVEULC4CA==" + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/reselect/-/reselect-4.1.8.tgz", + "integrity": "sha512-ab9EmR80F/zQTMNeneUr4cv+jSwPJgIlvEmVwLerwrWVbpLlBuls9XHzIeTFy4cegU2NHBp3va0LKOzU5qFEYQ==" }, "node_modules/resolve": { "version": "1.22.2", @@ -9570,7 +9952,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, + "devOptional": true, "dependencies": { "resolve-from": "^5.0.0" }, @@ -9578,11 +9960,11 @@ "node": ">=8" } }, - "node_modules/resolve-from": { + "node_modules/resolve-cwd/node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, + "devOptional": true, "engines": { "node": ">=8" } @@ -9599,7 +9981,7 @@ "node_modules/responselike": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "integrity": "sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==", "dependencies": { "lowercase-keys": "^1.0.0" } @@ -9613,7 +9995,82 @@ "signal-exit": "^3.0.2" }, "engines": { - "node": ">=8" + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-stable-stringify": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", + "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", + "engines": { + "node": ">=10" } }, "node_modules/reusify": { @@ -9627,15 +10084,17 @@ } }, "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz", + "integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==", "dependencies": { - "glob": "^7.1.3" + "glob": "^10.3.7" }, "bin": { - "rimraf": "bin.js" + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -9664,10 +10123,42 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/safe-array-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/safe-regex-test": { "version": "1.0.0", @@ -9692,28 +10183,17 @@ } }, "node_modules/seek-bzip": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", - "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.6.tgz", + "integrity": "sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==", "dependencies": { - "commander": "~2.8.1" + "commander": "^2.8.1" }, "bin": { "seek-bunzip": "bin/seek-bunzip", "seek-table": "bin/seek-bzip-table" } }, - "node_modules/seek-bzip/node_modules/commander": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", - "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", - "dependencies": { - "graceful-readlink": ">= 1.0.0" - }, - "engines": { - "node": ">= 0.6.x" - } - }, "node_modules/semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -9725,7 +10205,7 @@ "node_modules/sentence-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-2.1.1.tgz", - "integrity": "sha1-H24t2jnBaL+S0T+G1KkYkz9mftQ=", + "integrity": "sha512-ENl7cYHaK/Ktwk5OTD+aDbQ3uC8IByu/6Bkg+HDv8Mm+XnBnppVNalcfJTNsp1ibstKh030/JKQQWglDvtKwEQ==", "dependencies": { "no-case": "^2.2.0", "upper-case-first": "^1.1.2" @@ -9853,7 +10333,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, + "devOptional": true, "engines": { "node": ">=8" } @@ -9885,26 +10365,26 @@ "node_modules/snake-case": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-2.1.0.tgz", - "integrity": "sha1-Qb2xtz8w7GagTU4srRt2OH1NbZ8=", + "integrity": "sha512-FMR5YoPFwOLuh4rRz92dywJjyKYZNLpMn1R5ujVpIYkbA9p01fq8RMg0FkO4M+Yobt4MjHeLTJVm5xFFBHSV2Q==", "dependencies": { "no-case": "^2.2.0" } }, "node_modules/sort-keys": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", - "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==", "dependencies": { "is-plain-obj": "^1.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, "node_modules/sort-keys-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/sort-keys-length/-/sort-keys-length-1.0.1.tgz", - "integrity": "sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg=", + "integrity": "sha512-GRbEOUqCxemTAk/b32F2xa8wDTs+Z1QHOkbhJDQTvv/6G3ZkbJ+frYWsTcc7cBB3Fu4wy4XlLCuNtJuMn7Gsvw==", "dependencies": { "sort-keys": "^1.0.0" }, @@ -9912,11 +10392,22 @@ "node": ">=0.10.0" } }, + "node_modules/sort-keys-length/node_modules/sort-keys": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", + "integrity": "sha512-vzn8aSqKgytVik0iwdBEi+zevbTYZogewTUM6dtpmGwEcdzbub/TX4bCzRhebDCRC3QzXgJsLRKB2V/Oof7HXg==", + "dependencies": { + "is-plain-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -9951,7 +10442,7 @@ "node_modules/stack-trace": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", "engines": { "node": "*" } @@ -9980,17 +10471,17 @@ "node_modules/strict-uri-encode": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", - "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "integrity": "sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==", "engines": { "node": ">=0.10.0" } }, "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dependencies": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" } }, "node_modules/string-length": { @@ -10087,7 +10578,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true, + "devOptional": true, "engines": { "node": ">=8" } @@ -10104,7 +10595,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=6" } @@ -10114,7 +10605,10 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/strip-outer": { @@ -10128,10 +10622,19 @@ "node": ">=0.10.0" } }, + "node_modules/strip-outer/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/superagent": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", + "deprecated": "Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at .", "dependencies": { "component-emitter": "^1.2.0", "cookiejar": "^2.1.0", @@ -10149,18 +10652,44 @@ } }, "node_modules/superagent/node_modules/debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dependencies": { "ms": "^2.1.1" } }, - "node_modules/superagent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "node_modules/superagent/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/superagent/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/superagent/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/superagent/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } }, "node_modules/supports-color": { "version": "5.5.0", @@ -10186,10 +10715,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "devOptional": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/swap-case": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/swap-case/-/swap-case-1.1.2.tgz", - "integrity": "sha1-w5IDpFhzhfrTyFCgvRvK+ggZdOM=", + "integrity": "sha512-BAmWG6/bx8syfc6qXPprof3Mn5vQgf5dwdUNJhsNqU9WdPt5P+ES/wQ5bxfijy8zwZgZZHslC3iAsxsuQMCzJQ==", "dependencies": { "lower-case": "^1.1.1", "upper-case": "^1.1.1" @@ -10280,24 +10821,34 @@ "readable-stream": "^3.1.1" }, "engines": { - "node": ">=6" + "node": ">=8" + } + }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dev": true, + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" } }, "node_modules/tar-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", - "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", "dependencies": { - "bl": "^1.0.0", - "buffer-alloc": "^1.2.0", - "end-of-stream": "^1.0.0", + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", - "readable-stream": "^2.3.0", - "to-buffer": "^1.1.1", - "xtend": "^4.0.0" + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" }, "engines": { - "node": ">= 0.8.0" + "node": ">=6" } }, "node_modules/tcomb": { @@ -10317,7 +10868,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, + "devOptional": true, "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", @@ -10341,7 +10892,7 @@ "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, "node_modules/through2": { "version": "2.0.5", @@ -10352,10 +10903,42 @@ "xtend": "~4.0.1" } }, + "node_modules/through2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "integrity": "sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==", "engines": { "node": ">=0.10.0" } @@ -10363,7 +10946,7 @@ "node_modules/title-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/title-case/-/title-case-2.1.1.tgz", - "integrity": "sha1-PhJyFtpY0rxb7PE3q5Ha46fNj6o=", + "integrity": "sha512-EkJoZ2O3zdCz3zJsYCsxyq2OC5hrxR9mfdd5I+w8h/tmFfeOxJ+vvkxsKxdmN0WtS9zLdHEgfgVOiMVgv+Po4Q==", "dependencies": { "no-case": "^2.2.0", "upper-case": "^1.0.3" @@ -10421,17 +11004,15 @@ "nodetouch": "bin/nodetouch.js" } }, - "node_modules/touch/node_modules/nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", - "dev": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/traverse": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", + "integrity": "sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==", "engines": { "node": "*" } @@ -10458,10 +11039,18 @@ "treee": "bin/tree.js" } }, + "node_modules/tree-node-cli/node_modules/commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "engines": { + "node": ">= 6" + } + }, "node_modules/trim-repeated": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", - "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=", + "integrity": "sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==", "dependencies": { "escape-string-regexp": "^1.0.2" }, @@ -10469,10 +11058,21 @@ "node": ">=0.10.0" } }, + "node_modules/trim-repeated/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/triple-beam": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", - "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", + "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", + "engines": { + "node": ">= 14.0.0" + } }, "node_modules/ts-jest": { "version": "29.1.0", @@ -10595,7 +11195,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, + "devOptional": true, "engines": { "node": ">=4" } @@ -10734,20 +11334,20 @@ "node_modules/upper-case": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", - "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=" + "integrity": "sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA==" }, "node_modules/upper-case-first": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-1.1.2.tgz", - "integrity": "sha1-XXm+3P8UQZUY/S7bCgUHybaFkRU=", + "integrity": "sha512-wINKYvI3Db8dtjikdAqoBbZoP6Q+PZUyfMR7pmwHzjC2quzSkUq5DmPrTtPEqHaz8AGtmsB4TqwapMTM1QAQOQ==", "dependencies": { "upper-case": "^1.1.1" } }, "node_modules/uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dependencies": { "punycode": "^2.1.0" } @@ -10755,7 +11355,7 @@ "node_modules/url-parse-lax": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "integrity": "sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==", "dependencies": { "prepend-http": "^2.0.0" }, @@ -10766,7 +11366,7 @@ "node_modules/url-to-options": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", - "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", + "integrity": "sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A==", "engines": { "node": ">= 4" } @@ -10819,7 +11419,7 @@ "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "dependencies": { "defaults": "^1.0.3" } @@ -10911,7 +11511,7 @@ "triple-beam": "^1.3.0" }, "engines": { - "node": ">= 6.4.0" + "node": ">= 12.0.0" } }, "node_modules/winston-transport/node_modules/readable-stream": { @@ -10951,13 +11551,15 @@ "node": ">= 6" } }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, + "node_modules/winston/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/wrap-ansi": { @@ -11016,9 +11618,9 @@ } }, "node_modules/xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "engines": { "node": ">=0.4" } @@ -11118,7 +11720,7 @@ "util-deprecate": "^1.0.1" }, "engines": { - "node": ">= 6" + "node": ">= 10" } } }, diff --git a/src/common/context.ts b/src/common/context.ts index dc3f4ef0..08ea1617 100644 --- a/src/common/context.ts +++ b/src/common/context.ts @@ -19,8 +19,9 @@ import { Translations } from './translations'; import { Colors } from '../consts/Colors'; import { EnvironmentInfo, IFunctionCheck, RequestOptions, SessionInfo, Workspace } from '../interfaces/Common'; import { GraphqlActions } from '../consts/GraphqlActions'; -import { DEFAULT_ENVIRONMENT_NAME, DEFAULT_REMOTE_ADDRESS } from '../consts/Environment'; +import { DEFAULT_ENVIRONMENT_NAME } from '../consts/Environment'; import { REQUEST_HEADER_IGNORED, REQUEST_HEADER_NOT_SET } from '../consts/request'; +import dotenv from 'dotenv'; const pkg = require('../../package.json'); @@ -58,6 +59,7 @@ export class Context { spinner: any; constructor(params: any, translations: Translations) { + dotenv.config(); this.logger = winston.createLogger({ level: params.d ? 'debug' : 'info', format: winston.format.printf((info: TransformableInfo) => { @@ -190,7 +192,7 @@ export class Context { } resolveMainServerAddress(): string { - return this.storage.getValue(StorageParameters.serverAddress) || DEFAULT_REMOTE_ADDRESS; + return process.env.HOST || StaticConfig.apiAddress; } get storage(): typeof UserDataStorage { @@ -242,6 +244,12 @@ export class Context { return workspaces; } + async getFunctions(): Promise { + const { functionsList } = await this.request(GraphqlActions.functionsList); + + return functionsList.items; + } + async checkWorkspace(workspaceId: string) { if (!_.some(await this.workspaceList(), { id: workspaceId })) { throw new Error(this.i18n.t('inexistent_workspace')); @@ -343,7 +351,6 @@ export class Context { }, ]); } - return result; } diff --git a/src/common/execute.ts b/src/common/execute.ts index 30445a00..cccc30b6 100644 --- a/src/common/execute.ts +++ b/src/common/execute.ts @@ -5,6 +5,9 @@ import { BuildController } from '../engine/controllers/buildController'; import { Context } from './context'; import { RequestOptions } from '../interfaces/Common'; import { REQUEST_HEADER_IGNORED } from '../consts/request'; +import unzipper from 'unzipper'; +import * as fs from 'fs'; +import { StaticConfig } from '../config'; export const executeAsync = async ( context: Context, @@ -71,6 +74,53 @@ export const uploadProject = async (context: Context, options?: RequestOptions): return { buildName: prepareDeploy.buildName }; }; +export const downloadProject = async (context: Context, path: string, options?: RequestOptions): Promise => { + const { prepareDownload } = await context.request(GraphqlActions.prepareDownload, {}, options); + // Decode the base64 contenthow + const decodedContent = Buffer.from(prepareDownload.downloadMetaDataUrl.content, 'base64'); + + const workspaceConfig = context.workspaceConfig; + + context.logger.debug('download succesfully, writing to file and unziping'); + const unzipPath = `${path}/${prepareDownload.downloadMetaDataUrl.key}`; + fs.writeFileSync(unzipPath, decodedContent); + try { + await unzipper.Open.file(unzipPath).then(async d => { + await d.extract({ path: path, concurrency: 5 }); + }); + + fs.unlinkSync(unzipPath); + + if (fs.existsSync(`${path}/__migration_handler`)) { + fs.rmSync(`${path}/__migration_handler`, { recursive: true }); + } + + if (fs.existsSync(`${path}/___source_migrations`)) { + fs.rmSync(`${path}/___source_migrations`, { recursive: true }); + } + + if (fs.existsSync(`${path}/handler.js`)) { + fs.rmSync(`${path}/handler.js`, { recursive: true }); + } + + if (fs.existsSync(`${path}/.workspace.json`)) { + fs.rmSync(`${path}/.workspace.json`, { recursive: true }); + + await context.createWorkspaceConfig( + { + workspaceId: workspaceConfig.workspaceId, + environmentName: workspaceConfig.environmentName, + apiHost: workspaceConfig.apiHost, + }, + context.config.rootExecutionDir, + ); + } + } catch (error) { + // eslint-disable-next-line no-console + console.log('šŸš€ ~ file: execute.ts:90 ~ downloadProject ~ error:', error); + } +}; + export const executeDeploy = async (context: Context, deployOptions: any, options?: RequestOptions) => { context.spinner.start(context.i18n.t('deploy_in_progress', { status: 'prepare to upload', message: '' })); diff --git a/src/common/utils.ts b/src/common/utils.ts index f313d76b..c77d4f35 100644 --- a/src/common/utils.ts +++ b/src/common/utils.ts @@ -8,6 +8,7 @@ import { CommandController } from '../engine/controllers/commandController'; import { translations } from './translations'; import archiver from 'archiver'; import MemoryStream from 'memorystream'; +import axios from 'axios'; import { HttpError } from '../errors'; import * as yaml from 'js-yaml'; @@ -67,6 +68,26 @@ export namespace Utils { context.logger.debug('upload file success'); }; + export const download = async (url: string, context: Context): Promise => { + context.logger.debug('start download file'); + context.logger.debug(`url: ${url}`); + + const response = await axios({ + method: 'GET', + url: url, + responseType: 'stream', + }); + + const writer = fs.createWriteStream('./file.zip'); + + response.data.pipe(writer); + + return new Promise((resolve, reject) => { + writer.on('finish', resolve); + writer.on('error', reject); + }); + }; + export const archiveToMemory = async ( directories: { source: string; dist?: string }[], context: Context, @@ -124,6 +145,29 @@ export namespace Utils { return url[url.length - 1] === '/' ? url.substr(0, url.length - 1) : url; }; + export const commandDirMiddleware = + (commandsDirPath: string) => + (commandObject: { [key: string]: any }, pathName: string): Object => { + const cmd = commandObject.default || commandObject; + const fileDepth = path.relative(commandsDirPath, pathName).split(path.sep).length; + + if (fileDepth <= 2 && !!cmd.command) { + return { + ...cmd, + handler: CommandController.wrapHandler(cmd.handler, translations), + }; + } + }; + + export const checkHttpResponse = async (httpResponse: Promise): Promise => { + const response = await httpResponse; + if (!response.ok) { + throw new HttpError(await response.text(), response.status, response as any); + } + + return response; + }; + export const validNodeVersions = ['14', '18', '20']; export const validateExistNodeVersion = (context: Context, isOld?: boolean) => { @@ -154,27 +198,4 @@ export namespace Utils { const yamlNodeVersion = context.projectConfig?.settings?.nodeVersion; return validateExistNodeVersion ? yamlNodeVersion === '18' || yamlNodeVersion === '20' : false; }; - - export const commandDirMiddleware = - (commandsDirPath: string) => - (commandObject: { [key: string]: any }, pathName: string): Object => { - const cmd = commandObject.default || commandObject; - const fileDepth = path.relative(commandsDirPath, pathName).split(path.sep).length; - - if (fileDepth <= 2 && !!cmd.command) { - return { - ...cmd, - handler: CommandController.wrapHandler(cmd.handler, translations), - }; - } - }; - - export const checkHttpResponse = async (httpResponse: Promise): Promise => { - const response = await httpResponse; - if (!response.ok) { - throw new HttpError(await response.text(), response.status, response); - } - - return response; - }; } diff --git a/src/config/static.ts b/src/config/static.ts index c221baac..104331a0 100644 --- a/src/config/static.ts +++ b/src/config/static.ts @@ -45,6 +45,7 @@ export class StaticConfig { } static get apiAddress(): string { + // return process.env.DEVMODE ? process.env.SERVER_URL : this.staticData.apiAddress; return this.staticData.apiAddress; } diff --git a/src/consts/Environment.ts b/src/consts/Environment.ts index 530a99a9..61fb997e 100644 --- a/src/consts/Environment.ts +++ b/src/consts/Environment.ts @@ -1,2 +1 @@ export const DEFAULT_ENVIRONMENT_NAME = 'Master'; -export const DEFAULT_REMOTE_ADDRESS = 'https://api.8base.com'; diff --git a/src/consts/GraphqlActions.ts b/src/consts/GraphqlActions.ts index 0b735dd6..45ba47ab 100644 --- a/src/consts/GraphqlActions.ts +++ b/src/consts/GraphqlActions.ts @@ -81,6 +81,16 @@ export const GraphqlActions = { uploadBuildUrl uploadMetaDataUrl buildName } }`, + prepareDownload: `mutation PrepareDownload { + prepareDownload { + downloadBuildUrl + downloadMetaDataUrl { + key + content + } + buildName + } + }`, deploy: `mutation Deploy($data: DeployingBuildInput) { deploy(data: $data) }`, @@ -148,4 +158,5 @@ export const GraphqlAsyncActions = { export type GraphqlAsyncActionsType = | typeof GraphqlAsyncActions.commit | typeof GraphqlAsyncActions.environmentBranch - | typeof GraphqlAsyncActions.backupCreate; + | typeof GraphqlAsyncActions.backupCreate + | typeof GraphqlAsyncActions.backupRestore; diff --git a/src/engine/commands/environment/commands/sync.ts b/src/engine/commands/environment/commands/sync.ts new file mode 100644 index 00000000..dd5c8289 --- /dev/null +++ b/src/engine/commands/environment/commands/sync.ts @@ -0,0 +1,89 @@ +/* eslint-disable no-console */ +import yargs from 'yargs'; +import chalk from 'chalk'; +import { rimrafSync } from 'rimraf'; +import { Context } from '../../../../common/context'; +import { translations } from '../../../../common/translations'; +import { ProjectConfigurationState } from '../../../../common/configuraion'; +import { Interactive } from '../../../../common/interactive'; +import { downloadProject } from '../../../../common/execute'; +import tree from 'tree-node-cli'; +import { green, bold } from 'picocolors'; + +import { globSync } from 'glob'; +import { GraphqlActions } from '../../../../consts/GraphqlActions'; + +export default { + command: 'sync', + + handler: async (params: {}, context: Context) => { + await ProjectConfigurationState.expectConfigured(context); + + const { environmentName } = context.workspaceConfig; + + let warningApproval: Boolean; + + const actualProjectFiles = await context.request( + GraphqlActions.functionsList, + {}, + { + customWorkspaceId: context.workspaceId, + }, + ); + + if (actualProjectFiles.functionsList.items.length > 0) { + ({ warningApproval } = await Interactive.ask({ + name: 'warningApproval', + type: 'select', + message: translations.i18n.t('environment_sync_warning', { + environment: chalk.green(environmentName), + }), + choices: [ + { + title: 'Yes', + value: true, + }, + { + title: 'No', + value: false, + }, + ], + })); + if (warningApproval) { + context.spinner.start(`We are checking your current project files... \n`); + const files = globSync('*', { ignore: ['*.json', '*.yml'] }); + + files.map(file => { + rimrafSync(file); + }); + + context.spinner.start(`Downloading project files... \n`); + + await downloadProject(context, process.cwd(), { + customEnvironment: environmentName, + }); + + const fileTree = tree(process.cwd(), { + allFiles: true, + exclude: [/node_modules/, /\.build/], + }); + + /* Print out tree of new project */ + context.logger.info(environmentName); + context.logger.info(fileTree.replace(/[^\n]+\n/, '')); + + /* Print project created message */ + context.logger.info(`\nšŸŽ‰ Environment ${green(environmentName)} was successfully updated šŸŽ‰\n`); + context.logger.info( + `āš ļø Your project files and custom functions have been successfully imported from ${environmentName} environment. To ensure consistency, we recommend redeploying your project using the 8base deploy command.\n`, + ); + } + } else { + context.logger.info(translations.i18n.t('environment_sync_no_functions')); + } + }, + + describe: translations.i18n.t('environment_sync_describe'), + + builder: (args: yargs.Argv): yargs.Argv => args.usage(translations.i18n.t('environment_sync_usage')), +}; diff --git a/src/engine/commands/generate/commands/trigger.ts b/src/engine/commands/generate/commands/trigger.ts index 0134a661..86ac1521 100644 --- a/src/engine/commands/generate/commands/trigger.ts +++ b/src/engine/commands/generate/commands/trigger.ts @@ -1,34 +1,30 @@ -import * as yargs from 'yargs'; +import yargs from 'yargs'; import { Context } from '../../../../common/context'; import { translations } from '../../../../common/translations'; -import { ExtensionType, SyntaxType, TriggerType } from '../../../../interfaces/Extensions'; +import { ExtensionType, SyntaxType, TriggerOperation, TriggerType } from '../../../../interfaces/Extensions'; import { ProjectController } from '../../../controllers/projectController'; -type TiggerParams = { - name: string; - type?: string; - operation?: string; +type TriggerGenerateParams = { + tableName: string; + type: TriggerType; + operation: TriggerOperation; mocks: boolean; syntax: SyntaxType; silent: boolean; }; export default { - command: 'trigger ', + command: 'trigger ', - handler: async (params: TiggerParams, context: Context) => { - let { name, type, operation, mocks, syntax, silent } = params; + handler: async (params: TriggerGenerateParams, context: Context) => { + const { tableName, type, operation, mocks, syntax, silent } = params; - if (operation && !/[\w\d]+\.(create|update|delete)/.test(operation)) { - throw new Error(translations.i18n.t('generate_trigger_invalid_operation')); - } - - ProjectController.generateFunction( + await ProjectController.generateFunction( context, { type: ExtensionType.trigger, - name, + name: tableName, mocks, syntax, silent, @@ -45,16 +41,25 @@ export default { builder: (args: yargs.Argv): yargs.Argv => args .usage(translations.i18n.t('generate_trigger_usage')) + .positional('tableName', { + describe: translations.i18n.t('generate_trigger_table_name'), + type: 'string', + }) .option('type', { alias: 't', describe: translations.i18n.t('generate_trigger_type_describe'), type: 'string', choices: Object.values(TriggerType), + requiresArg: true, + default: TriggerType.before, }) .option('operation', { alias: 'o', describe: translations.i18n.t('generate_trigger_operation_describe'), type: 'string', + choices: Object.values(TriggerOperation), + default: TriggerOperation.create, + requiresArg: true, }) .option('mocks', { alias: 'x', @@ -68,6 +73,7 @@ export default { default: 'ts', type: 'string', choices: Object.values(SyntaxType), + requiresArg: true, }) .option('silent', { describe: translations.i18n.t('silent_describe'), diff --git a/src/engine/commands/init/index.ts b/src/engine/commands/init/index.ts index 49aebb7b..f4498db2 100644 --- a/src/engine/commands/init/index.ts +++ b/src/engine/commands/init/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import * as _ from 'lodash'; import yargs from 'yargs'; import * as path from 'path'; @@ -6,6 +7,7 @@ import chalk from 'chalk'; import tree from 'tree-node-cli'; import validatePackageName from 'validate-npm-package-name'; +import { cyan, green, red, yellow, bold, blue } from 'picocolors'; import { getFileProvider } from './providers'; import { install } from './installer'; import { Context } from '../../../common/context'; @@ -16,8 +18,8 @@ import { ExtensionType, SyntaxType, TriggerOperation, TriggerType } from '../../ import { Interactive } from '../../../common/interactive'; import { DEFAULT_ENVIRONMENT_NAME } from '../../../consts/Environment'; import { StaticConfig } from '../../../config'; - -const pkg = require('../../../../package.json'); +import { GraphqlActions } from '../../../consts/GraphqlActions'; +import { downloadProject } from '../../../common/execute'; type InitParams = { name: string; @@ -96,7 +98,7 @@ export default { if (!empty && Array.isArray(functions)) { functions.forEach(declaration => { - const [type, name] = declaration.split(':'); + const [type, name, triggerOperation, triggerType] = declaration.split(':'); if (!(type in ExtensionType)) { throw new Error(translations.i18n.t('init_invalid_function_type', { type })); @@ -105,9 +107,12 @@ export default { if (!name) { throw new Error(translations.i18n.t('init_undefined_function_name')); } + + if (type === ExtensionType.trigger && !(triggerOperation in TriggerOperation && triggerType in TriggerType)) { + throw new Error(translations.i18n.t('init_incorrect_trigger')); + } }); } - if (!workspaceId) { const workspaces = await context.getWorkspaces(); @@ -124,7 +129,7 @@ export default { if (!workspaceId) { throw new Error(translations.i18n.t('init_prevent_select_workspace')); } - + context.spinner.start('Retrieving workspace information.... \n'); const workspace = _.find(await context.getWorkspaces(), { id: workspaceId }); if (!workspace) { throw new Error(context.i18n.t('workspace_with_id_doesnt_exist', { id: workspaceId })); @@ -133,11 +138,24 @@ export default { host = workspace.apiHost; } - context.spinner.start(`Initializing new project ${chalk.hex(Colors.yellow)(project.name)}`); - - context.logger.debug('start initialize init command'); - - context.logger.debug(`initialize success: initialize repository: ${project.name}`); + context.logger.debug('checking current project files'); + + context.spinner.start(`Checking your project files.... \n`); + + const actualProjectFiles = await context + .request( + GraphqlActions.functionsList, + {}, + { + customWorkspaceId: workspaceId, + }, + ) + .catch(e => { + if (e.response.errors[0].code === 'NotAuthorizedError') { + context.logger.info(translations.i18n.t('no_permission_error')); + process.exit(); + } + }); let files = getFileProvider().provide(context); context.logger.debug(`files provided count = ${files.size}`); @@ -155,35 +173,40 @@ export default { context.logger.debug('try to install files'); install(project.fullPath, files, context); - context.spinner.stop(); - /* Creating new project message */ const chalkedName = chalk.hex(Colors.yellow)(project.name); - if (!silent) { - context.logger.info(`Building a new project called ${chalkedName} šŸš€`); - } - - /* Generate project files before printing tree */ - if (!empty && Array.isArray(functions)) { - await Promise.all( - functions.map(async (declaration: string) => { - const [type, functionName, triggerOperation, triggerType] = declaration.split(':'); - - await ProjectController.generateFunction( - context, - { - type: type, - name: functionName, - mocks, - syntax, - projectPath: name, - silent: true, - }, - { type: triggerType, operation: triggerOperation }, - ); - }), - ); + context.spinner.stop(); + if (actualProjectFiles && actualProjectFiles?.functionsList?.items.length > 0) { + context.logger.debug('downloading project files.'); + context.spinner.start('Downloading project files.... \n'); + await downloadProject(context, project.fullPath, { + customWorkspaceId: workspaceId, + }); + context.logger.debug('creating workspace configuration.'); + context.spinner.start('Creating workspace configuration.... \n'); + } else { + /* Generate project files before printing tree */ + if (!empty && Array.isArray(functions)) { + await Promise.all( + functions.map(async (declaration: string) => { + const [type, functionName, triggerOperation, triggerType] = declaration.split(':'); + + await ProjectController.generateFunction( + context, + { + type: type, + name: functionName, + mocks, + syntax, + projectPath: name, + silent: true, + }, + { type: triggerType, operation: triggerOperation }, + ); + }), + ); + } } await context.createWorkspaceConfig( @@ -191,11 +214,11 @@ export default { workspaceId, environmentName: DEFAULT_ENVIRONMENT_NAME, apiHost: host || StaticConfig.apiAddress, - cli_Version: pkg.version, }, project.fullPath, ); + context.spinner.stop(); if (!silent) { const fileTree = tree(project.fullPath, { allFiles: true, @@ -207,7 +230,7 @@ export default { context.logger.info(fileTree.replace(/[^\n]+\n/, '')); /* Print project created message */ - context.logger.info(`šŸŽ‰ Project ${chalkedName} was successfully created šŸŽ‰`); + context.logger.info(`\nšŸŽ‰ Project ${chalkedName} was successfully created šŸŽ‰\n`); } }, describe: translations.i18n.t('init_describe'), @@ -222,7 +245,7 @@ export default { alias: 'f', describe: translations.i18n.t('init_functions_describe'), type: 'array', - default: ['resolver:resolver', 'task:task', 'webhook:webhook', 'trigger:trigger'], + default: ['resolver:resolver', 'task:task', 'webhook:webhook', 'trigger:Users:create:before'], }) .option('empty', { alias: 'e', diff --git a/src/engine/commands/login/webLogin.ts b/src/engine/commands/login/webLogin.ts index 32c7c5de..8fb465fb 100644 --- a/src/engine/commands/login/webLogin.ts +++ b/src/engine/commands/login/webLogin.ts @@ -4,17 +4,19 @@ import open from 'open'; import 'isomorphic-fetch'; import { SessionInfo } from '../../../interfaces/Common'; import { Utils } from '../../../common/utils'; +import dotenv from 'dotenv'; export const webLogin = async (params: { w: string }, context: Context): Promise => { + dotenv.config(); context.spinner.start(context.i18n.t('login_in_progress')); const session = cuid.createId(); await open(`${Utils.trimLastSlash(params.w)}/cli?guid=${session}`, { wait: false }); const timeoutMs = 2000; - let retryCount = 150; // 150 * 2s = 300s = 5 min + let retryCount = 200; // 150 * 2s = 300s = 5 min - let res = null; + let res: any = null; while (--retryCount > 0) { context.logger.debug(`try to fetch session ${session}`); context.logger.debug(`${Utils.trimLastSlash(context.resolveMainServerAddress())}/loginSessionGet/${session}`); @@ -34,6 +36,7 @@ export const webLogin = async (params: { w: string }, context: Context): Promise retryCount = 0; } + context.logger.debug(`session result: ${JSON.stringify(res)}`); if (!res) { throw new Error(context.i18n.t('login_timeout_error')); } diff --git a/src/engine/commands/logs/index.ts b/src/engine/commands/logs/index.ts index 477b3fc5..ff8f5795 100644 --- a/src/engine/commands/logs/index.ts +++ b/src/engine/commands/logs/index.ts @@ -1,11 +1,13 @@ -import * as yargs from 'yargs'; +import yargs from 'yargs'; import * as _ from 'lodash'; import chalk from 'chalk'; -import { DateTime } from 'luxon'; import { Context } from '../../../common/context'; import { GraphqlActions } from '../../../consts/GraphqlActions'; import { translations } from '../../../common/translations'; +import { Utils } from '../../../common/utils'; + +type LogsParams = { name?: string; num: number; tail?: boolean; resource: string }; export enum LogTagType { ERROR = 'ERROR', @@ -37,27 +39,26 @@ const beautifyLogLine = (line: string) => { if (/^START RequestId: (\w{8}-\w{4}-\w{4}-\w{4}-\w{12})\s*([\s\S]*)/.test(line)) { line = line.replace( /^START RequestId: (\w{8}-\w{4}-\w{4}-\w{4}-\w{12})\s*([\s\S]*)/, - (substr: string, id: string, text: string) => { - return printRequestId(id) + ` ${printTag(LogTagType.START)} ` + chalk.dim(text); - }, + (substr: string, id: string, text: string) => + `${printRequestId(id)} ${printTag(LogTagType.START)} ${chalk.dim(text)}`, ); } if (/^REPORT RequestId: (\w{8}-\w{4}-\w{4}-\w{4}-\w{12})\s*([\s\S]*)/.test(line)) { line = line.replace( /^REPORT RequestId: (\w{8}-\w{4}-\w{4}-\w{4}-\w{12})\s*([\s\S]*)/, - (substr: string, id: string, text: string) => { - return printRequestId(id) + ` ${printTag(LogTagType.REPORT)} ` + chalk.green(text); - }, + (substr: string, id: string, text: string) => + `${printRequestId(id)} ${printTag(LogTagType.REPORT)} ${chalk.green(text)}`, ); line += '\n'; } if (/^END RequestId: (\w{8}-\w{4}-\w{4}-\w{4}-\w{12})\s*/.test(line)) { - line = line.replace(/^END RequestId: (\w{8}-\w{4}-\w{4}-\w{4}-\w{12})\s*/, (substr: string, id: string) => { - return printRequestId(id) + ` ${printTag(LogTagType.END)}`; - }); + line = line.replace( + /^END RequestId: (\w{8}-\w{4}-\w{4}-\w{4}-\w{12})\s*/, + (substr: string, id: string) => `${printRequestId(id)} ${printTag(LogTagType.END)}`, + ); } if ( @@ -72,13 +73,9 @@ const beautifyLogLine = (line: string) => { text = JSON.stringify(JSON.parse(text), null, 2); } catch (e) {} - return ( - printRequestId(id) + - ' ' + - printTag(LogTagType.ERROR) + - chalk.red(` Datetime: ${DateTime.fromISO(dt).toFormat('F')}\n`) + - text - ); + return `${printRequestId(id)} ${printTag(LogTagType.ERROR)}${chalk.red( + ` Datetime: ${new Date(dt).toLocaleString()}\n`, + )}${text}`; }, ); } @@ -91,13 +88,9 @@ const beautifyLogLine = (line: string) => { text = JSON.stringify(JSON.parse(text), null, 2); } catch (e) {} - return ( - printRequestId(id) + - ' ' + - printTag(LogTagType.INFO) + - chalk.cyan(` Datetime: ${DateTime.fromISO(dt).toFormat('F')} \n`) + - text - ); + return `${printRequestId(id)} ${printTag(LogTagType.INFO)}${chalk.cyan( + ` Datetime: ${new Date(dt).toLocaleString()} \n`, + )}${text}`; }, ); } @@ -114,10 +107,6 @@ const printLogs = (logs: string[]) => { }); }; -const sleep = (ms: number): Promise => { - return new Promise(resolve => setTimeout(resolve, ms)); -}; - let lastMessage: string = ''; const filterMessage = (messages: string[]): string[] => { @@ -136,7 +125,7 @@ const filterMessage = (messages: string[]): string[] => { return _.slice(messages, index + 1); }; -const readLogs = async (functionName: string, context: Context) => { +const readLogs = async (resource: string, context: Context) => { let attempt = 0; let error = null; @@ -153,8 +142,8 @@ const readLogs = async (functionName: string, context: Context) => { try { result = await context.request(GraphqlActions.logs, { - functionName, startTime: start.toISOString(), + resource, }); } catch (e) { error = e; @@ -171,7 +160,7 @@ const readLogs = async (functionName: string, context: Context) => { } } - const logs = filterMessage(result.logs); + const logs = filterMessage(result.system.logs.items); if (logs.length > 0) { printLogs(logs); @@ -181,7 +170,7 @@ const readLogs = async (functionName: string, context: Context) => { context.spinner.start(translations.i18n.t('logs_tail_wait')); } - await sleep(1000); + await Utils.sleep(1000); attempt = attempt + 1; } @@ -189,44 +178,59 @@ const readLogs = async (functionName: string, context: Context) => { export default { command: 'logs [name]', - handler: async (params: any, context: Context) => { - if (params.n > 100) { - params.n = 100; + handler: async (params: LogsParams, context: Context) => { + if (params.name) { + context.logger.warn(context.i18n.t('logs_name_deprecation')); + } + + if (params.num > 100) { + params.num = 100; } - if (params['t']) { - return await readLogs(params.name, context); + if (params.tail) { + return readLogs(params.resource, context); } context.spinner.start(context.i18n.t('logs_in_progress')); const result = await context.request(GraphqlActions.logs, { - functionName: params.name, - limit: params.n, + limit: params.num, + resource: params.resource, }); context.spinner.stop(); - printLogs(result.logs); + printLogs(result.system.logs.items); }, describe: translations.i18n.t('logs_describe'), builder: (args: yargs.Argv): yargs.Argv => { return args .usage(translations.i18n.t('logs_usage')) .positional('name', { - describe: translations.i18n.t('logs_name_describe'), + describe: translations.i18n.t('logs_name_deprecation'), type: 'string', }) - .demandOption('name') + .deprecateOption('name') .option('num', { alias: 'n', default: 10, describe: translations.i18n.t('logs_num_describe'), type: 'number', + requiresArg: true, + conflicts: 'tail', }) .option('tail', { alias: 't', describe: translations.i18n.t('logs_tail_describe'), type: 'boolean', + conflicts: 'num', + }) + .option('resource', { + alias: 'r', + describe: translations.i18n.t('logs_resource_describe'), + type: 'string', + choices: ['environment:extensions', 'system:ci:commit'], + default: 'environment:extensions', + requiresArg: true, }); }, }; diff --git a/src/engine/controllers/projectController.ts b/src/engine/controllers/projectController.ts index c6adb516..c78a71b3 100644 --- a/src/engine/controllers/projectController.ts +++ b/src/engine/controllers/projectController.ts @@ -21,23 +21,13 @@ import { ProjectDefinition } from '../../interfaces/Project'; import { Context, Plugin, ProjectConfig } from '../../common/context'; type FunctionDeclarationOptions = { - operation?: string; - method?: string; + operation?: TriggerOperation; + method?: WebhookMethod; path?: string; - type?: string; + type?: TriggerType; schedule?: string; }; -type FunctionGeneratationOptions = { - type: ExtensionType; - name: string; - mocks: boolean; - syntax: SyntaxType; - projectPath?: string; - silent?: boolean; - extendType?: string; -}; - type FunctionGenerationOptions = { type: ExtensionType; name: string; @@ -63,38 +53,54 @@ type PluginGenerationOptions = { }; const generateFunctionDeclaration = ( - { type, name, mocks, syntax }: FunctionGeneratationOptions, + { type, name, syntax }: FunctionGenerationOptions, dirPath: string, options: FunctionDeclarationOptions, ) => { - let declaration = { - type, - handler: { - code: `${dirPath}/handler.${syntax}`, - }, - }; + switch (type) { + case ExtensionType.resolver: + return { + type, + handler: { + code: `${dirPath}/handler.${syntax}`, + }, + schema: `${dirPath}/schema.graphql`, + }; + + case ExtensionType.task: { + const declaration = { + type, + handler: { + code: `${dirPath}/handler.${syntax}`, + }, + }; + if (options.schedule) { + _.assign(declaration, { + schedule: options.schedule, + }); + } + return declaration; + } - if (type === ExtensionType.resolver) { - declaration = _.merge(declaration, { - schema: `${dirPath}/schema.graphql`, - }); - } else if (type === ExtensionType.task && options.schedule) { - declaration = _.merge(declaration, { - schedule: options.schedule, - }); - } else if (type === ExtensionType.trigger) { - declaration = _.merge(declaration, { - type: `trigger.${options.type || 'before'}`, - operation: options.operation || 'Users.create', - }); - } else if (type === ExtensionType.webhook) { - declaration = _.merge(declaration, { - path: options.path || '/webhook', - method: options.method || 'POST', - }); + case ExtensionType.trigger: + return { + handler: { + code: `${dirPath}/${options.type}.${syntax}`, + }, + type: `trigger.${options.type}`, + operation: `${name}.${options.operation}`, + }; + + case ExtensionType.webhook: + return { + type, + handler: { + code: `${dirPath}/handler.${syntax}`, + }, + path: options.path || '/webhook', + method: options.method || 'POST', + }; } - - return declaration; }; export class ProjectController { @@ -250,7 +256,7 @@ export class ProjectController { extensions.functions.push({ name: functionName, // TODO: create class FunctionDefinition - handler: functionName + '.handler', // this handler generate in compile step + handler: `${functionName}.handler`, // this handler generate in compile step pathToFunction: FunctionUtils.resolveHandler(functionName, data.handler), }); @@ -275,16 +281,16 @@ export class ProjectController { if (_.isNil(data.operation)) { throw new InvalidConfiguration( StaticConfig.serviceConfigFileName, - 'operation field not present in trigger ' + functionName, + `operation field not present in trigger ${functionName}`, ); } - const operation = data.operation.split('.'); // TableName.TriggerType + const [tableName, operation] = data.operation.split('.'); extensions.triggers.push({ name: functionName, - operation: TriggerUtils.resolveTriggerOperation(operation[1], functionName), - tableName: operation[0], + operation: TriggerUtils.resolveTriggerOperation(operation, functionName), + tableName, functionName, type: TriggerUtils.resolveTriggerType(data.type, functionName), }); @@ -294,7 +300,7 @@ export class ProjectController { if (!data.method) { throw new InvalidConfiguration( StaticConfig.serviceConfigFileName, - "Parameter 'method' is missing in webhook '" + functionName + "'", + `Parameter "method" is missing in webhook "${functionName}"`, ); } @@ -376,17 +382,18 @@ export class ProjectController { { type, name, mocks, syntax, extendType = 'Query', projectPath = '.', silent }: FunctionGenerationOptions, options: FunctionDeclarationOptions = {}, ) { - const dirPath = `src/${type}s/${name}`; + const dirPath = FunctionUtils.resolveFunctionDir(type, name, options); + const functionName = FunctionUtils.resolveFunctionName(type, name, options); await ProjectController.addFunctionDeclaration( context, - name, + functionName, generateFunctionDeclaration({ type, name, syntax, mocks }, dirPath, options), projectPath, silent, ); - const functionTemplatePath = path.resolve(context.config.functionTemplatesPath, type); + const functionTemplatePath = FunctionUtils.resolveTemplatePath(context, type, options); processTemplate( context, @@ -395,7 +402,7 @@ export class ProjectController { templatePath: functionTemplatePath, }, { syntax, mocks, silent }, - { functionName: name, type, extendType }, + { functionName, type, extendType, mockName: 'request' }, ); if (!silent) { @@ -572,16 +579,16 @@ const processTemplate = ( return; } - const data = fs.readFileSync(path.resolve(templatePath, file)); + const data = fs.readFileSync(path.resolve(templatePath, file), { encoding: 'utf8' }); - const content = ejs.compile(data.toString())({ + const content = ejs.compile(data)({ ...options, _, }); let fileName = file.replace(/\.ejs$/, ''); - fileName = fileName.replace('mockName', _.get(options, 'mockName')); + fileName = fileName.replace('request', _.get(options, 'mockName')); fs.writeFileSync(path.resolve(dirPath, fileName), content); diff --git a/src/index.ts b/src/index.ts index b5fd94f1..bbd19e10 100644 --- a/src/index.ts +++ b/src/index.ts @@ -57,6 +57,7 @@ const start = async (translations: Translations) => { 'Examples:': 'EXAMPLES', 'Commands:': 'COMMANDS', 'Options:': 'OPTIONS', + 'Positionals:': 'POSITIONALS', }) .wrap(yargs.terminalWidth()).argv; diff --git a/src/locales/en.ts b/src/locales/en.ts index fa8f2ae9..eab50597 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -120,10 +120,14 @@ export default { init_workspace_host_describe: 'The workspace host of the project', init_node_version_describe: 'The node version for compile your functions default: (18 LTS)', init_select_workspace: 'What workspace does this project belong to?', + init_cloning_question: + 'Would you like to import project files and custom functions from the backend? Your existing 8base.yml configuration and contents of the project will be overwritten with the new data. Proceed? (Y/N)', init_select_nodeVersion: 'What node version you want use?', init_prevent_select_workspace: 'Workspace selection canceled', init_confirm_not_empty_dir: 'Selected directory is not empty. Are you sure you want to continue?', init_canceled: 'Project init canceled', + no_permission_error: + "nāš ļø You need 'Deploy' permissions for custom functions in both the parent and current project to execute the import", /** * Invoke related messages @@ -189,6 +193,7 @@ export default { /** * Logs related messages */ + logs_usage: 'COMMAND\n 8base logs [OPTIONS]\n\nDESCRIPTION\n Shows logs for the functions or migrations', logs_describe: 'Shows logs for the functions or migrations.', logs_num_describe: 'Number of lines to display', logs_name_deprecation: 'Name parameter is now deprecated', @@ -261,13 +266,11 @@ export default { /** * Generate trigger related messages */ - generate_trigger_usage: '8base generate trigger ', + generate_trigger_usage: '8base generate trigger [OPTIONS]', + generate_trigger_table_name: 'The name of table to make trigger for', generate_trigger_describe: 'Generator for a custom trigger function.', generate_trigger_type_describe: 'The trigger type', generate_trigger_operation_describe: 'Operation that invokes the trigger', - generate_trigger_table_name_describe: 'Trigger table name', - generate_trigger_invalid_type: 'Invalid trigger type, available types: `before` and `after`', - generate_trigger_invalid_operation: 'Invalid trigger operation, valid example: `Users.create`', /** * Generate webhook related messages @@ -413,6 +416,19 @@ export default { environment_show_describe: 'Displays currently selected environment', environment_show_text: 'Environment: {{-environment}}', + /** + * Sync status related messages + */ + + environment_sync_usage: + 'COMMAND\n 8base environment sync\n\nDESCRIPTION\n Imports project files and custom functions from the latest deployed version of current active environment.', + environment_sync_describe: + 'Imports project files and custom functions from the latest deployed version of current active environment.', + environment_sync_text: 'Environment: {{-environment}}', + environment_sync_warning: + 'Do you really want to import project files and custom functions from the {{- environment }} ? Contents of your local project will be completely overwritten with the new data. Proceed? (Y/N)', + environment_sync_no_functions: 'āš ļø There are no custom functions available to sync in the current environment', + /** * Plugin related messages */ diff --git a/templates/functions/trigger/create/after/after.js.ejs b/templates/functions/trigger/create/after/after.js.ejs new file mode 100644 index 00000000..1023ec46 --- /dev/null +++ b/templates/functions/trigger/create/after/after.js.ejs @@ -0,0 +1,37 @@ +/** + * This file was generated using 8base CLI. + * + * To learn more about writing custom trigger functions, visit + * the 8base documentation at: + * + * https://docs.8base.com/projects/backend/custom-functions/triggers + * + * To update this functions invocation settings, update its configuration block + * in the projects 8base.yml file: + * functions: + * <%= functionName %>: + * ... + * + * Data that is sent to the function can be accessed on the event argument at: + * event.data[KEY_NAME] + * + * There are two ways to invoke this function locally: + * + * (1) Explicit file mock file path using '-p' flag: + * 8base invoke-local <%= functionName %> -p src/resolvers/<%= functionName %>/mocks/request.json + * + * (2) Default mock file location using -m flag: + * 8base invoke-local <%= functionName %> -m request + * + * Add new mocks to this function to test different input arguments. Mocks can easily be generated + * the following generator command: + * 8base generate mock <%= functionName %> -m [MOCK_FILE_NAME] + */ + +module.exports = async (event, ctx) => { + const { data, originalData } = event; + console.log(data, originalData); + /** + * Any actions that should be executed after object creation: cache invalidation, notification, etc... + */ +}; diff --git a/templates/functions/trigger/create/after/after.ts.ejs b/templates/functions/trigger/create/after/after.ts.ejs new file mode 100644 index 00000000..e33fcffe --- /dev/null +++ b/templates/functions/trigger/create/after/after.ts.ejs @@ -0,0 +1,49 @@ +/** + * This file was generated using 8base CLI. + * + * To learn more about writing custom trigger functions, visit + * the 8base documentation at: + * + * https://docs.8base.com/projects/backend/custom-functions/triggers + * + * To update this functions invocation settings, update its configuration block + * in the projects 8base.yml file: + * functions: + * <%= functionName %>: + * ... + * + * Data that is sent to the function can be accessed on the event argument at: + * event.data[KEY_NAME] + * + * There are two ways to invoke this function locally: + * + * (1) Explicit file mock file path using '-p' flag: + * 8base invoke-local <%= functionName %> -p src/resolvers/<%= functionName %>/mocks/request.json + * + * (2) Default mock file location using -m flag: + * 8base invoke-local <%= functionName %> -m request + * + * Add new mocks to this function to test different input arguments. Mocks can easily be generated + * the following generator command: + * 8base generate mock <%= functionName %> -m [MOCK_FILE_NAME] + */ + +import { + AfterCreateTriggerFunction, + AfterCreateTriggerFunctionEvent, + AfterCreateTriggerResponse, + FunctionContext +} from '@8base/functions-types'; + +const afterCreateTrigger: AfterCreateTriggerFunction = async ( + event: AfterCreateTriggerFunctionEvent, + ctx: FunctionContext, +): AfterCreateTriggerResponse => { + const { data, originalData } = event; + console.log(data, originalData); + /** + * Any actions that should be executed after object creation: cache invalidation, notification, etc... + */ +}; + +export default afterCreateTrigger; diff --git a/templates/functions/trigger/create/after/mocks/request.json.ejs b/templates/functions/trigger/create/after/mocks/request.json.ejs new file mode 100644 index 00000000..c5cba3f6 --- /dev/null +++ b/templates/functions/trigger/create/after/mocks/request.json.ejs @@ -0,0 +1,17 @@ +{ + "data": { + "email":"test.user@gmail.com", + "status":"active", + "firstName":"FirstName", + "lastName":"LastName" + }, + "originalData": { + "email":"test.user@gmail.com", + "status":"active", + "firstName":"FirstName", + "lastName":"LastName" + }, + "headers": { + "x-header-1": "header value" + } +} diff --git a/templates/functions/trigger/create/before/before.js.ejs b/templates/functions/trigger/create/before/before.js.ejs new file mode 100644 index 00000000..6d5e47d6 --- /dev/null +++ b/templates/functions/trigger/create/before/before.js.ejs @@ -0,0 +1,38 @@ +/** + * This file was generated using 8base CLI. + * + * To learn more about writing custom trigger functions, visit + * the 8base documentation at: + * + * https://docs.8base.com/projects/backend/custom-functions/triggers + * + * To update this functions invocation settings, update its configuration block + * in the projects 8base.yml file: + * functions: + * <%= functionName %>: + * ... + * + * Data that is sent to the function can be accessed on the event argument at: + * event.data[KEY_NAME] + * + * There are two ways to invoke this function locally: + * + * (1) Explicit file mock file path using '-p' flag: + * 8base invoke-local <%= functionName %> -p src/resolvers/<%= functionName %>/mocks/request.json + * + * (2) Default mock file location using -m flag: + * 8base invoke-local <%= functionName %> -m request + * + * Add new mocks to this function to test different input arguments. Mocks can easily be generated + * the following generator command: + * 8base generate mock <%= functionName %> -m [MOCK_FILE_NAME] + */ + +module.exports = async (event, ctx) => { + // validation + if (event.data.email.endsWith('@gmail.com')) { + return { errors: [{ message: 'not allowed' }] }; + } + // override data + return { data: { ...event.data, firstName: 'overridden by trigger' } }; +}; diff --git a/templates/functions/trigger/create/before/before.ts.ejs b/templates/functions/trigger/create/before/before.ts.ejs new file mode 100644 index 00000000..4520a9e7 --- /dev/null +++ b/templates/functions/trigger/create/before/before.ts.ejs @@ -0,0 +1,54 @@ +/** + * This file was generated using 8base CLI. + * + * To learn more about writing custom trigger functions, visit + * the 8base documentation at: + * + * https://docs.8base.com/projects/backend/custom-functions/triggers + * + * To update this functions invocation settings, update its configuration block + * in the projects 8base.yml file: + * functions: + * <%= functionName %>: + * ... + * + * Data that is sent to the function can be accessed on the event argument at: + * event.data[KEY_NAME] + * + * There are two ways to invoke this function locally: + * + * (1) Explicit file mock file path using '-p' flag: + * 8base invoke-local <%= functionName %> -p src/resolvers/<%= functionName %>/mocks/request.json + * + * (2) Default mock file location using -m flag: + * 8base invoke-local <%= functionName %> -m request + * + * Add new mocks to this function to test different input arguments. Mocks can easily be generated + * the following generator command: + * 8base generate mock <%= functionName %> -m [MOCK_FILE_NAME] + */ + +import { + FunctionContext, + BeforeCreateTriggerFunctionEvent, + BeforeCreateTriggerFunction, BeforeCreateTriggerResponse +} from '@8base/functions-types'; + +type User = { + firstName: string; + email: string; +}; + +const beforeCreateTrigger: BeforeCreateTriggerFunction = async ( + event: BeforeCreateTriggerFunctionEvent, + ctx: FunctionContext, +): BeforeCreateTriggerResponse => { + // validation + if (event.data.email.endsWith('@gmail.com')) { + return { errors: [{ message: 'not allowed' }] }; + } + // override data + return { data: { ...event.data, firstName: 'overridden by trigger' } }; +}; + +export default beforeCreateTrigger; diff --git a/templates/functions/trigger/create/before/mocks/request.json.ejs b/templates/functions/trigger/create/before/mocks/request.json.ejs new file mode 100644 index 00000000..e0330934 --- /dev/null +++ b/templates/functions/trigger/create/before/mocks/request.json.ejs @@ -0,0 +1,11 @@ +{ + "data": { + "email":"test.user@gmail.com", + "status":"active", + "firstName":"FirstName", + "lastName":"LastName" + }, + "headers": { + "x-header-1": "header value" + } +} diff --git a/templates/functions/trigger/delete/after/after.js.ejs b/templates/functions/trigger/delete/after/after.js.ejs new file mode 100644 index 00000000..e9bf87af --- /dev/null +++ b/templates/functions/trigger/delete/after/after.js.ejs @@ -0,0 +1,37 @@ +/** + * This file was generated using 8base CLI. + * + * To learn more about writing custom trigger functions, visit + * the 8base documentation at: + * + * https://docs.8base.com/projects/backend/custom-functions/triggers + * + * To update this functions invocation settings, update its configuration block + * in the projects 8base.yml file: + * functions: + * <%= functionName %>: + * ... + * + * Data that is sent to the function can be accessed on the event argument at: + * event.data[KEY_NAME] + * + * There are two ways to invoke this function locally: + * + * (1) Explicit file mock file path using '-p' flag: + * 8base invoke-local <%= functionName %> -p src/resolvers/<%= functionName %>/mocks/request.json + * + * (2) Default mock file location using -m flag: + * 8base invoke-local <%= functionName %> -m request + * + * Add new mocks to this function to test different input arguments. Mocks can easily be generated + * the following generator command: + * 8base generate mock <%= functionName %> -m [MOCK_FILE_NAME] + */ + +module.exports = async (event, ctx) => { + const { data, originalObject } = event; + console.log(data, originalObject); + /** + * Any actions that should be executed after object deletion: cache invalidation, notification, etc... + */ +}; diff --git a/templates/functions/trigger/delete/after/after.ts.ejs b/templates/functions/trigger/delete/after/after.ts.ejs new file mode 100644 index 00000000..36b3451f --- /dev/null +++ b/templates/functions/trigger/delete/after/after.ts.ejs @@ -0,0 +1,49 @@ +/** + * This file was generated using 8base CLI. + * + * To learn more about writing custom trigger functions, visit + * the 8base documentation at: + * + * https://docs.8base.com/projects/backend/custom-functions/triggers + * + * To update this functions invocation settings, update its configuration block + * in the projects 8base.yml file: + * functions: + * <%= functionName %>: + * ... + * + * Data that is sent to the function can be accessed on the event argument at: + * event.data[KEY_NAME] + * + * There are two ways to invoke this function locally: + * + * (1) Explicit file mock file path using '-p' flag: + * 8base invoke-local <%= functionName %> -p src/resolvers/<%= functionName %>/mocks/request.json + * + * (2) Default mock file location using -m flag: + * 8base invoke-local <%= functionName %> -m request + * + * Add new mocks to this function to test different input arguments. Mocks can easily be generated + * the following generator command: + * 8base generate mock <%= functionName %> -m [MOCK_FILE_NAME] + */ + +import { + AfterDeleteTriggerFunction, + AfterDeleteTriggerFunctionEvent, + AfterDeleteTriggerResponse, + FunctionContext +} from '@8base/functions-types'; + +const afterDeleteTrigger: AfterDeleteTriggerFunction = async ( + event: AfterDeleteTriggerFunctionEvent, + ctx: FunctionContext, +): AfterDeleteTriggerResponse => { + const { data, originalObject } = event; + console.log(data, originalObject); + /** + * Any actions that should be executed after object deletion: cache invalidation, notification, etc... + */ +}; + +export default afterDeleteTrigger; diff --git a/templates/functions/trigger/delete/after/mocks/request.json.ejs b/templates/functions/trigger/delete/after/mocks/request.json.ejs new file mode 100644 index 00000000..0efeded7 --- /dev/null +++ b/templates/functions/trigger/delete/after/mocks/request.json.ejs @@ -0,0 +1,27 @@ +{ + "data": { + "email":"test.user@gmail.com", + "status":"active", + "firstName":"FirstName", + "lastName":"LastName", + "origin":"administration", + "isOwner":false, + "is8base":false, + "timezone":null, + "avatarId":null + }, + "originalObject": { + "email":"test.user@gmail.com", + "status":"active", + "firstName":"FirstName", + "lastName":"LastName", + "origin":"administration", + "isOwner":false, + "is8base":false, + "timezone":null, + "avatarId":null + }, + "headers": { + "x-header-1": "header value" + } +} diff --git a/templates/functions/trigger/handler.js.ejs b/templates/functions/trigger/delete/before/before.js.ejs similarity index 69% rename from templates/functions/trigger/handler.js.ejs rename to templates/functions/trigger/delete/before/before.js.ejs index f188531b..cececdb9 100644 --- a/templates/functions/trigger/handler.js.ejs +++ b/templates/functions/trigger/delete/before/before.js.ejs @@ -1,22 +1,22 @@ /** * This file was generated using 8base CLI. - * + * * To learn more about writing custom trigger functions, visit * the 8base documentation at: - * - * https://docs.8base.com/docs/8base-console/custom-functions/triggers/ + * + * https://docs.8base.com/projects/backend/custom-functions/triggers * * To update this functions invocation settings, update its configuration block * in the projects 8base.yml file: * functions: * <%= functionName %>: * ... - * + * * Data that is sent to the function can be accessed on the event argument at: * event.data[KEY_NAME] * * There are two ways to invoke this function locally: - * + * * (1) Explicit file mock file path using '-p' flag: * 8base invoke-local <%= functionName %> -p src/resolvers/<%= functionName %>/mocks/request.json * @@ -29,22 +29,8 @@ */ module.exports = async (event, ctx) => { - return { - data: { - ...event.data, - firstName: 'Override firstName', - }, - /** - * Triggers allow for errors to be specified in the response - * as an array of user defined objects. - * - * Example: - * - * [{ - * message: "Error message", - * code: "error_code" - * }, ...] - */ - errors: [], - }; -}; \ No newline at end of file + // validation + if (event.destroyDeleted) { + return { errors: [{ message: 'Destroying is forbidden' }] }; + } +}; diff --git a/templates/functions/trigger/handler.ts.ejs b/templates/functions/trigger/delete/before/before.ts.ejs similarity index 59% rename from templates/functions/trigger/handler.ts.ejs rename to templates/functions/trigger/delete/before/before.ts.ejs index 9916f1ef..7177673c 100644 --- a/templates/functions/trigger/handler.ts.ejs +++ b/templates/functions/trigger/delete/before/before.ts.ejs @@ -4,7 +4,7 @@ * To learn more about writing custom trigger functions, visit * the 8base documentation at: * - * https://docs.8base.com/docs/8base-console/custom-functions/triggers/ + * https://docs.8base.com/projects/backend/custom-functions/triggers * * To update this functions invocation settings, update its configuration block * in the projects 8base.yml file: @@ -28,37 +28,21 @@ * 8base generate mock <%= functionName %> -m [MOCK_FILE_NAME] */ -import { FunctionContext, FunctionEvent, FunctionResult } from '8base-cli-types'; +import { + BeforeDeleteTriggerFunction, + BeforeDeleteTriggerFunctionEvent, + BeforeDeleteTriggerResponse, + FunctionContext, +} from '@8base/functions-types'; - -type TriggerResult = FunctionResult<{ - firstName: string, - }, - {}, - {}, - Array ->; - -export default async ( - event: FunctionEvent, +const beforeDeleteTrigger: BeforeDeleteTriggerFunction = async ( + event: BeforeDeleteTriggerFunctionEvent, ctx: FunctionContext, -): TriggerResult => { - return { - data: { - ...event.data, - firstName: 'Override firstName', - }, - /** - * Triggers allow for errors to be specified in the response - * as an array of user defined objects. - * - * Example: - * - * [{ - * message: "Error message", - * code: "error_code" - * }, ...] - */ - errors: [], - }; -}; \ No newline at end of file +): BeforeDeleteTriggerResponse => { + // validation + if (event.destroyDeleted) { + return { errors: [{ message: 'Destroying is forbidden' }] }; + } +}; + +export default beforeDeleteTrigger; diff --git a/templates/functions/trigger/delete/before/mocks/request.json.ejs b/templates/functions/trigger/delete/before/mocks/request.json.ejs new file mode 100644 index 00000000..ee69413b --- /dev/null +++ b/templates/functions/trigger/delete/before/mocks/request.json.ejs @@ -0,0 +1,21 @@ +{ + "filter":{ + "email":"test.user@gmail.com" + }, + "force":true, + "destroyDeleted":false, + "originalObject": { + "email":"test.user@gmail.com", + "status":"active", + "firstName":"FirstName", + "lastName":"LastName", + "origin":"administration", + "isOwner":false, + "is8base":false, + "timezone":null, + "avatarId":null + }, + "headers": { + "x-header-1": "header value" + } +} diff --git a/templates/functions/trigger/mocks/request.json.ejs b/templates/functions/trigger/mocks/request.json.ejs deleted file mode 100644 index ba704050..00000000 --- a/templates/functions/trigger/mocks/request.json.ejs +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "foo": "bar" - }, - "headers": { - "x-header-1": "header value" - }, - "body": "{\"foo\":\"bar\"}" -} \ No newline at end of file diff --git a/templates/functions/trigger/update/after/after.js.ejs b/templates/functions/trigger/update/after/after.js.ejs new file mode 100644 index 00000000..5034bf53 --- /dev/null +++ b/templates/functions/trigger/update/after/after.js.ejs @@ -0,0 +1,37 @@ +/** + * This file was generated using 8base CLI. + * + * To learn more about writing custom trigger functions, visit + * the 8base documentation at: + * + * https://docs.8base.com/projects/backend/custom-functions/triggers + * + * To update this functions invocation settings, update its configuration block + * in the projects 8base.yml file: + * functions: + * <%= functionName %>: + * ... + * + * Data that is sent to the function can be accessed on the event argument at: + * event.data[KEY_NAME] + * + * There are two ways to invoke this function locally: + * + * (1) Explicit file mock file path using '-p' flag: + * 8base invoke-local <%= functionName %> -p src/resolvers/<%= functionName %>/mocks/request.json + * + * (2) Default mock file location using -m flag: + * 8base invoke-local <%= functionName %> -m request + * + * Add new mocks to this function to test different input arguments. Mocks can easily be generated + * the following generator command: + * 8base generate mock <%= functionName %> -m [MOCK_FILE_NAME] + */ + +module.exports = async (event, ctx) => { + const { data, originalData, originalObject } = event; + console.log(data, originalData, originalObject); + /** + * Any actions that should be executed after object update: cache invalidation, notification, etc... + */ +}; diff --git a/templates/functions/trigger/update/after/after.ts.ejs b/templates/functions/trigger/update/after/after.ts.ejs new file mode 100644 index 00000000..544836be --- /dev/null +++ b/templates/functions/trigger/update/after/after.ts.ejs @@ -0,0 +1,49 @@ +/** + * This file was generated using 8base CLI. + * + * To learn more about writing custom trigger functions, visit + * the 8base documentation at: + * + * https://docs.8base.com/projects/backend/custom-functions/triggers + * + * To update this functions invocation settings, update its configuration block + * in the projects 8base.yml file: + * functions: + * <%= functionName %>: + * ... + * + * Data that is sent to the function can be accessed on the event argument at: + * event.data[KEY_NAME] + * + * There are two ways to invoke this function locally: + * + * (1) Explicit file mock file path using '-p' flag: + * 8base invoke-local <%= functionName %> -p src/resolvers/<%= functionName %>/mocks/request.json + * + * (2) Default mock file location using -m flag: + * 8base invoke-local <%= functionName %> -m request + * + * Add new mocks to this function to test different input arguments. Mocks can easily be generated + * the following generator command: + * 8base generate mock <%= functionName %> -m [MOCK_FILE_NAME] + */ + +import { + AfterUpdateTriggerFunction, + AfterUpdateTriggerFunctionEvent, + AfterUpdateTriggerResponse, + FunctionContext, +} from '@8base/functions-types'; + +const afterUpdateTrigger: AfterUpdateTriggerFunction = async ( + event: AfterUpdateTriggerFunctionEvent, + ctx: FunctionContext, +): AfterUpdateTriggerResponse => { + const { data, originalData, originalObject } = event; + console.log(data, originalData, originalObject); + /** + * Any actions that should be executed after object update: cache invalidation, notification, etc... + */ +}; + +export default afterUpdateTrigger; diff --git a/templates/functions/trigger/update/after/mocks/request.json.ejs b/templates/functions/trigger/update/after/mocks/request.json.ejs new file mode 100644 index 00000000..e7e2186f --- /dev/null +++ b/templates/functions/trigger/update/after/mocks/request.json.ejs @@ -0,0 +1,32 @@ +{ + "data": { + "email":"test.user@gmail.com", + "status":"inactive", + "firstName":"NewFirstName", + "lastName":"NewLastName", + "origin":"administration", + "isOwner":false, + "is8base":false, + "timezone":null, + "avatarId":null + }, + "originalObject": { + "email":"test.user@gmail.com", + "status":"active", + "firstName":"FirstName", + "lastName":"LastName", + "origin":"administration", + "isOwner":false, + "is8base":false, + "timezone":null, + "avatarId":null + }, + "originalData": { + "status":"inactive", + "firstName":"NewFirstName", + "lastName":"NewLastName" + }, + "headers": { + "x-header-1": "header value" + } +} diff --git a/templates/functions/trigger/update/before/before.js.ejs b/templates/functions/trigger/update/before/before.js.ejs new file mode 100644 index 00000000..d9ed594e --- /dev/null +++ b/templates/functions/trigger/update/before/before.js.ejs @@ -0,0 +1,38 @@ +/** + * This file was generated using 8base CLI. + * + * To learn more about writing custom trigger functions, visit + * the 8base documentation at: + * + * https://docs.8base.com/projects/backend/custom-functions/triggers + * + * To update this functions invocation settings, update its configuration block + * in the projects 8base.yml file: + * functions: + * <%= functionName %>: + * ... + * + * Data that is sent to the function can be accessed on the event argument at: + * event.data[KEY_NAME] + * + * There are two ways to invoke this function locally: + * + * (1) Explicit file mock file path using '-p' flag: + * 8base invoke-local <%= functionName %> -p src/resolvers/<%= functionName %>/mocks/request.json + * + * (2) Default mock file location using -m flag: + * 8base invoke-local <%= functionName %> -m request + * + * Add new mocks to this function to test different input arguments. Mocks can easily be generated + * the following generator command: + * 8base generate mock <%= functionName %> -m [MOCK_FILE_NAME] + */ + +module.exports = async (event, ctx) => { + // validation + if (event.originalObject.email.endsWith('@gmail.com')) { + return { errors: [{ message: 'not allowed' }] }; + } + // override data + return { data: { ...event.data, firstName: 'overridden by trigger' } }; +}; diff --git a/templates/functions/trigger/update/before/before.ts.ejs b/templates/functions/trigger/update/before/before.ts.ejs new file mode 100644 index 00000000..a79d9673 --- /dev/null +++ b/templates/functions/trigger/update/before/before.ts.ejs @@ -0,0 +1,55 @@ +/** + * This file was generated using 8base CLI. + * + * To learn more about writing custom trigger functions, visit + * the 8base documentation at: + * + * https://docs.8base.com/projects/backend/custom-functions/triggers + * + * To update this functions invocation settings, update its configuration block + * in the projects 8base.yml file: + * functions: + * <%= functionName %>: + * ... + * + * Data that is sent to the function can be accessed on the event argument at: + * event.data[KEY_NAME] + * + * There are two ways to invoke this function locally: + * + * (1) Explicit file mock file path using '-p' flag: + * 8base invoke-local <%= functionName %> -p src/resolvers/<%= functionName %>/mocks/request.json + * + * (2) Default mock file location using -m flag: + * 8base invoke-local <%= functionName %> -m request + * + * Add new mocks to this function to test different input arguments. Mocks can easily be generated + * the following generator command: + * 8base generate mock <%= functionName %> -m [MOCK_FILE_NAME] + */ + +import { + BeforeUpdateTriggerFunction, + BeforeUpdateTriggerFunctionEvent, + BeforeUpdateTriggerResponse, + FunctionContext, +} from '@8base/functions-types'; + +type User = { + firstName: string; + email: string; +}; + +const beforeUpdateTrigger: BeforeUpdateTriggerFunction = async ( + event: BeforeUpdateTriggerFunctionEvent, + ctx: FunctionContext, +): BeforeUpdateTriggerResponse => { + // validation + if (event.originalObject.email.endsWith('@gmail.com')) { + return { errors: [{ message: 'not allowed' }] }; + } + // override data + return { data: { ...event.data, firstName: 'overridden by trigger' } }; +}; + +export default beforeUpdateTrigger; diff --git a/templates/functions/trigger/update/before/mocks/request.json.ejs b/templates/functions/trigger/update/before/mocks/request.json.ejs new file mode 100644 index 00000000..c1be96fa --- /dev/null +++ b/templates/functions/trigger/update/before/mocks/request.json.ejs @@ -0,0 +1,27 @@ +{ + "data": { + "email":"test.user@gmail.com", + "status":"inactive", + "firstName":"NewFirstName", + "lastName":"NewLastName" + }, + "filter":{ + "email":"test.user@gmail.com" + }, + "force": true, + "destroyDetached": false, + "originalObject": { + "email":"test.user@gmail.com", + "status":"active", + "firstName":"FirstName", + "lastName":"LastName", + "origin":"administration", + "isOwner":false, + "is8base":false, + "timezone":null, + "avatarId":null + }, + "headers": { + "x-header-1": "header value" + } +} diff --git a/templates/functions/webhook/handler.ts.ejs b/templates/functions/webhook/handler.ts.ejs index afe402cd..2e2305e7 100644 --- a/templates/functions/webhook/handler.ts.ejs +++ b/templates/functions/webhook/handler.ts.ejs @@ -31,9 +31,9 @@ * 8base generate mock <%= functionName %> -m [MOCK_FILE_NAME] */ -import { FunctionContext, WebhookFunctionEvent, WebhookResponse } from '@8base/functions-types'; +import { FunctionContext, WebhookFunction, WebhookFunctionEvent, WebhookResponse } from '@8base/functions-types'; -const webhook = async (event: WebhookFunctionEvent, ctx: FunctionContext): WebhookResponse => { +const webhook: WebhookFunction = async (event: WebhookFunctionEvent, ctx: FunctionContext): WebhookResponse => { const { foo } = JSON.parse(event.body); return { diff --git a/tsconfig.json b/tsconfig.json index 05ce7be9..1580cfbc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,7 @@ "resolveJsonModule": true, "target": "ES2016", "noImplicitAny": true, + "skipLibCheck": true, "lib": [ "es2017", "esnext.asynciterable", @@ -26,5 +27,8 @@ }, "include": [ "src/**/*" + ], + "exclude": [ + "node_modules/@types" ] }