diff --git a/package-lock.json b/package-lock.json index 8f7067a..deeaa22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,12 +7,14 @@ "": { "name": "@runtimeconditions/plugin-runtime-conditions", "version": "0.0.0", + "license": "MIT", "dependencies": { "@backstage/catalog-model": "^1.4.0", "@backstage/core-components": "^0.14.0", "@backstage/core-plugin-api": "^1.9.0", "@backstage/plugin-catalog-react": "^1.9.0", "@backstage/plugin-kubernetes-react": "^0.1.0", + "@types/json-schema": "^7.0.15", "react-use": "^17.5.0" }, "devDependencies": { @@ -59,7 +61,6 @@ "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.11.1.tgz", "integrity": "sha512-2QygG2F76ZpMP2eMztiJvAiFMu71M9rDeU7vO/QKg5Css7MgM4frUOslFjhVjRhbGaCNPtz/S8M6y46/fFKVuQ==", "license": "MIT", - "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", @@ -130,7 +131,6 @@ "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.25.0.tgz", "integrity": "sha512-bMs8ekJLjX8wPV+9IPBges1SLPyuDtE9g5gLDWOpxzKcoOFQnpLGkbcT1tdw3FaAmDS1gnPmMmJ6y/T5B96kIA==", "license": "MIT", - "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", @@ -1143,7 +1143,6 @@ "integrity": "sha512-tr7xekNlM9LjA6pagJmL8QCgZXaubWUwkJnoYcMKd4gw/t4XiyvnTkjdGrUVicyB2BsdaAv1tvow45bPM4sSwQ==", "deprecated": "Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "@material-ui/styles": "^4.11.5", @@ -1361,6 +1360,7 @@ "integrity": "sha512-7plsgi3GUWmxzP3lJmjKaWGGH14jIhk+m/PmICFMr20gf75SCPw7cwomVN/KblyKcb7gcRKYpRiSTvXBhAUZyg==", "license": "Apache-2.0", "optional": true, + "peer": true, "dependencies": { "@backstage/config": "^1.3.9", "@backstage/core-app-api": "^1.20.5", @@ -1391,6 +1391,7 @@ "integrity": "sha512-PHijuqsRWzkSlAMGxidLTubiNoDnTwRTQv5MlpP1nCnECw8/0S+UYm/ZvtVhd/KixOLR2K/YBkT+Xj+kh5siKQ==", "license": "Apache-2.0", "optional": true, + "peer": true, "dependencies": { "@backstage/config": "^1.3.9", "@backstage/core-components": "^0.18.14", @@ -1461,6 +1462,7 @@ "integrity": "sha512-CuQCFnz69hGHMdC3JJswPm4URroGUncYe0FRvqgWhbWvHP6Eu1j3FGlPzyKpHz0+FKqxC/3qklO5RJl2lZC6uQ==", "license": "Apache-2.0", "optional": true, + "peer": true, "dependencies": { "@backstage/core-components": "^0.18.14", "@backstage/core-plugin-api": "^1.12.10", @@ -1503,6 +1505,7 @@ "integrity": "sha512-EE9Mm6GjEMDwr/+iXmJfMq2jIJDCnjPbaua5YCtUN/E1Q/FOBcFmijJeTLn8gF0xeEiYxrZhQf0NBRlxfapR/g==", "license": "Apache-2.0", "optional": true, + "peer": true, "dependencies": { "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", @@ -1568,6 +1571,7 @@ "deprecated": "Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "@emotion/hash": "^0.8.0", @@ -1610,6 +1614,7 @@ "integrity": "sha512-6CSKu2MtmiJgcCGf6nBQpM8fLkuB9F55EKfbdTC80NND5wpTmKzwdhLYLH3zL4cLlK0gVaaltW7/wMuyTnN0Lw==", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "@material-ui/utils": "^4.11.3", @@ -1640,6 +1645,7 @@ "integrity": "sha512-ZuQPV4rBK/V1j2dIkSSEcH5uT6AaHuKWFfotADHsC0wVL1NLd2WkFCm4ZZbX33iO4ydl6V0GPngKm8HZQ2oujg==", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "prop-types": "^15.7.2", @@ -1659,6 +1665,7 @@ "integrity": "sha512-IKHlyx6LDh8n19vzwH5RtHIOHl9Tu90aAAxcbWME6kp4dmvODM3UvOHJeMIDzUbd4muuJKHmlNoBN+mDY4XkBA==", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "@babel/runtime": "^7.4.4" }, @@ -1684,6 +1691,7 @@ "deprecated": "Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "@material-ui/utils": "^4.11.3", @@ -1712,6 +1720,7 @@ "integrity": "sha512-ZuQPV4rBK/V1j2dIkSSEcH5uT6AaHuKWFfotADHsC0wVL1NLd2WkFCm4ZZbX33iO4ydl6V0GPngKm8HZQ2oujg==", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "prop-types": "^15.7.2", @@ -1731,6 +1740,7 @@ "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", "license": "MIT", "optional": true, + "peer": true, "engines": { "node": ">=6" } @@ -1740,14 +1750,16 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.21.tgz", "integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==", "license": "MIT", - "optional": true + "optional": true, + "peer": true }, "node_modules/@backstage/core-compat-api/node_modules/@backstage/plugin-app/node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", "license": "MIT", - "optional": true + "optional": true, + "peer": true }, "node_modules/@backstage/core-compat-api/node_modules/@backstage/plugin-catalog-react": { "version": "3.2.3", @@ -1807,7 +1819,6 @@ "integrity": "sha512-tr7xekNlM9LjA6pagJmL8QCgZXaubWUwkJnoYcMKd4gw/t4XiyvnTkjdGrUVicyB2BsdaAv1tvow45bPM4sSwQ==", "deprecated": "Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "@material-ui/styles": "^4.11.5", @@ -2261,8 +2272,7 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.3.2.tgz", "integrity": "sha512-NT1CJtq3hHIreOianA8aSXn6Cw0JzYOuDQbOrSPe7gqFnCpKP++MQe3ODgO3oh2GJFORkAAdqredOa60z63GbA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@backstage/core-compat-api/node_modules/react-idle-timer": { "version": "5.7.3", @@ -2491,7 +2501,6 @@ "integrity": "sha512-tr7xekNlM9LjA6pagJmL8QCgZXaubWUwkJnoYcMKd4gw/t4XiyvnTkjdGrUVicyB2BsdaAv1tvow45bPM4sSwQ==", "deprecated": "Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "@material-ui/styles": "^4.11.5", @@ -2922,7 +2931,6 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.93.tgz", "integrity": "sha512-KM4Ty/ZTLZupiYxZVAlP+InNJS3De6uBMdq0ePa6/04+eG9Y7ftnWfst1xTLQ5rwAhgHwQ4momt/O4KepdGBTw==", "license": "MIT", - "peer": true, "dependencies": { "@types/prop-types": "*", "@types/scheduler": "^0.16", @@ -3276,7 +3284,6 @@ "integrity": "sha512-tr7xekNlM9LjA6pagJmL8QCgZXaubWUwkJnoYcMKd4gw/t4XiyvnTkjdGrUVicyB2BsdaAv1tvow45bPM4sSwQ==", "deprecated": "Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "@material-ui/styles": "^4.11.5", @@ -3731,8 +3738,7 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.3.2.tgz", "integrity": "sha512-NT1CJtq3hHIreOianA8aSXn6Cw0JzYOuDQbOrSPe7gqFnCpKP++MQe3ODgO3oh2GJFORkAAdqredOa60z63GbA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@backstage/frontend-defaults/node_modules/react-idle-timer": { "version": "5.7.3", @@ -4715,7 +4721,6 @@ "integrity": "sha512-tr7xekNlM9LjA6pagJmL8QCgZXaubWUwkJnoYcMKd4gw/t4XiyvnTkjdGrUVicyB2BsdaAv1tvow45bPM4sSwQ==", "deprecated": "Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "@material-ui/styles": "^4.11.5", @@ -5155,8 +5160,7 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.3.2.tgz", "integrity": "sha512-NT1CJtq3hHIreOianA8aSXn6Cw0JzYOuDQbOrSPe7gqFnCpKP++MQe3ODgO3oh2GJFORkAAdqredOa60z63GbA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@backstage/plugin-app/node_modules/react-idle-timer": { "version": "5.7.3", @@ -5472,7 +5476,6 @@ "integrity": "sha512-tr7xekNlM9LjA6pagJmL8QCgZXaubWUwkJnoYcMKd4gw/t4XiyvnTkjdGrUVicyB2BsdaAv1tvow45bPM4sSwQ==", "deprecated": "Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "@material-ui/styles": "^4.11.5", @@ -5930,8 +5933,7 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.3.2.tgz", "integrity": "sha512-NT1CJtq3hHIreOianA8aSXn6Cw0JzYOuDQbOrSPe7gqFnCpKP++MQe3ODgO3oh2GJFORkAAdqredOa60z63GbA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@backstage/plugin-catalog-react/node_modules/react-idle-timer": { "version": "5.7.3", @@ -6422,7 +6424,6 @@ "integrity": "sha512-tr7xekNlM9LjA6pagJmL8QCgZXaubWUwkJnoYcMKd4gw/t4XiyvnTkjdGrUVicyB2BsdaAv1tvow45bPM4sSwQ==", "deprecated": "Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "@material-ui/styles": "^4.11.5", @@ -6686,7 +6687,6 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.93.tgz", "integrity": "sha512-KM4Ty/ZTLZupiYxZVAlP+InNJS3De6uBMdq0ePa6/04+eG9Y7ftnWfst1xTLQ5rwAhgHwQ4momt/O4KepdGBTw==", "license": "MIT", - "peer": true, "dependencies": { "@types/prop-types": "*", "@types/scheduler": "^0.16", @@ -6738,6 +6738,7 @@ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" @@ -6886,7 +6887,6 @@ "integrity": "sha512-tr7xekNlM9LjA6pagJmL8QCgZXaubWUwkJnoYcMKd4gw/t4XiyvnTkjdGrUVicyB2BsdaAv1tvow45bPM4sSwQ==", "deprecated": "Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.4.4", "@material-ui/styles": "^4.11.5", @@ -7339,8 +7339,7 @@ "version": "1.3.13", "resolved": "https://registry.npmjs.org/@date-io/core/-/core-1.3.13.tgz", "integrity": "sha512-AlEKV7TxjeK+jxWVKcCFrfYAk8spX9aCyiToFIiLPtfQbsjmRGLIhb5VZgptQcJdHtLXo7+m0DuurwFgUToQuA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@date-io/date-fns": { "version": "1.3.13", @@ -7424,7 +7423,6 @@ "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.4.0.tgz", "integrity": "sha512-QgD4fyscGcbbKwJmqNvUMSE02OsHUa+lAWKdEUIJKgqe5IwRSKd7+KhibEWdaKwgjLj0DRSHA9biAIqGBk05lw==", "license": "MIT", - "peer": true, "dependencies": { "@emotion/memoize": "^0.9.0" } @@ -7440,7 +7438,6 @@ "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.14.0.tgz", "integrity": "sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.13.5", @@ -7484,7 +7481,6 @@ "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.14.1.tgz", "integrity": "sha512-qEEJt42DuToa3gurlH4Qqc1kVpNq8wO8cJtDzU46TjlzWjDlsVyevtYCRijVq3SrHsROS+gVQ8Fnea108GnKzw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.13.5", @@ -8068,6 +8064,7 @@ "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-9.4.0.tgz", "integrity": "sha512-d+gIYM1raJP87yrVQcVg+Q3vycVMArMkgu/TjJLi2vTvO9FHKWNRR1xs9nnN4eLpM9nGxxm02UMvc9BrmcUKvQ==", "license": "MIT", + "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/mui-org" @@ -8128,6 +8125,7 @@ "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-9.4.0.tgz", "integrity": "sha512-qQpX/2XPGDz5F2OIWzo4kkorURlDeXGKytRQudXCdLS5TuwKsMKaZyx77LZEVSB73c7o3UrLWwQ/goRuHBdtjw==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.29.7", "@mui/utils": "^9.4.0", @@ -8155,6 +8153,7 @@ "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-9.4.0.tgz", "integrity": "sha512-SlqVEYqnyEgXMFW4JuIDMelyhKzoWBJ85v2mNCQd0XtU0uk7U9E1zaJZ06XqodhA8oJrb+4Q+3E/JlwBe4jWkw==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.29.7", "@emotion/cache": "^11.14.0", @@ -8189,6 +8188,7 @@ "resolved": "https://registry.npmjs.org/@mui/system/-/system-9.4.0.tgz", "integrity": "sha512-AZz9z13oGS1J0BYeAFHTbV7PegCtPiE/uMEIi7TJ1kTx3Vkt+jUpLyXF/2uV8B6Y79iTh98kVeOH9fX3x3zXXg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.29.7", "@mui/private-theming": "^9.4.0", @@ -8229,6 +8229,7 @@ "resolved": "https://registry.npmjs.org/@mui/types/-/types-9.4.0.tgz", "integrity": "sha512-13DH0Oniua4WmGqeYbQAZqmiN7r4nfd0zwIoGJ5QeJwyIHgEmf+LkRw/jV1HZb6AiUoHX8Oxf4xgalq3vYHcIw==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.29.7" }, @@ -8246,6 +8247,7 @@ "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-9.4.0.tgz", "integrity": "sha512-WkzY8uYtqUDyGKPShrRQRBomfMQHddlsyKu/gRRESYO24tDPD2z0xRE8CBoUsWqpBa+YrFs9KixiS7kQRjsPAQ==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.29.7", "@mui/types": "^9.4.0", @@ -8367,7 +8369,6 @@ "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.4.tgz", "integrity": "sha512-rYKilwgzQ7/imScn3M9/pFfUf4I1AZEH3KhyJmtPdE2zfaXAn2mFfUy4FbKewzc2We5y/LlKLj36fWJLKC2SIQ==", "license": "MIT", - "peer": true, "dependencies": { "@octokit/auth-token": "^3.0.0", "@octokit/graphql": "^5.0.0", @@ -8603,6 +8604,7 @@ "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.4.tgz", "integrity": "sha512-q7j5geK7xs3UJSdm9/iytUNclBnLmYx1EnSeCFXHPeutdqgIMeFeHtUZgS3EhlKxdBEAu8OwtJCwmLrEzpSs7Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=14.0.0" } @@ -8696,7 +8698,6 @@ "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.2.tgz", "integrity": "sha512-yzr2S9HyAIdhz2/6qHgbs665Q7PKVcDF05vsOlHPxG1mo36gKVesdYVeDLnXgfjJ03CrKRk08knc6+E/9m8v2Q==", "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -8716,7 +8717,6 @@ "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.3.tgz", "integrity": "sha512-Uo193NgQbPMz6lrrhtRQQFcMC6Re/ELLFbbuVL30WDlZxlpZf9/lMHTAVxPRLw1q1iu9OJmR1c2BLiENRstdBg==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.12.5" }, @@ -8875,7 +8875,6 @@ "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "expect": "^29.0.0", "pretty-format": "^29.0.0" @@ -8928,6 +8927,12 @@ "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", "license": "MIT" }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "license": "MIT" + }, "node_modules/@types/jsonwebtoken": { "version": "9.0.10", "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.10.tgz", @@ -8985,7 +8990,6 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.31.tgz", "integrity": "sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==", "license": "MIT", - "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.2.2" @@ -9136,7 +9140,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -9554,7 +9557,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.11.23", "caniuse-lite": "^1.0.30001810", @@ -10145,7 +10147,6 @@ "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", "license": "ISC", - "peer": true, "engines": { "node": ">=12" } @@ -10239,7 +10240,6 @@ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.21.0" }, @@ -10844,6 +10844,7 @@ "integrity": "sha512-1eaL3RvR/kAlbG7UYcpMptEyzPoENO0c6w7ZnB3/hh2vSAz/6uGAFn6fdoqTBguNstf3MsFhJHsD/0DHiclG+g==", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "motion-dom": "^12.43.0", "motion-utils": "^12.39.0", @@ -11965,7 +11966,6 @@ "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -12885,8 +12885,7 @@ "version": "3.0.8", "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.8.tgz", "integrity": "sha512-yeJd4aNAdYZQjaon2bpD/Gb0B/omw7HQOsynXXcOiWVCacbBcPlgn8S/d1X6blFSaHao7ozqtW7NZW19xpCtIw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/js-tokens": { "version": "4.0.0", @@ -13243,8 +13242,7 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.1.3.tgz", "integrity": "sha512-auMesunaJ8yfkHvK4gfg1K0SaKX/6Wn9g2Aac/NwX+l5VdmFZzo/hdPGxEOETj+ryRa4/fiOPjeeKURSAJx1sg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/locate-path": { "version": "5.0.0", @@ -14403,6 +14401,7 @@ "integrity": "sha512-BQgQbSa9Hn3/mtbib0MK53y6JSANa+YKUKlaYnWzAVDH424RYQ5LVpV3pNiWH00BA2z4ojsSdMzqT7g2FQwjuQ==", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "framer-motion": "^12.43.0", "tslib": "^2.4.0" @@ -14430,6 +14429,7 @@ "integrity": "sha512-azKON4d9S65PEoFUiQTMTgPheEmzf2QngdRc50AKfJp9Q9mmcBVw22c8eMq9k8kxOFHdL7+WZY7N/5F/lwiDag==", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "motion-utils": "^12.39.0" } @@ -14439,7 +14439,8 @@ "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.39.0.tgz", "integrity": "sha512-8nadJAJjTtqRkmRF36FoJTrywK9nnFmnPwnSMyxaOCU7GDjN9RTMJIxx9De8ErM+vpPhMccr/6fo5WciyQLnMQ==", "license": "MIT", - "optional": true + "optional": true, + "peer": true }, "node_modules/mri": { "version": "1.2.0", @@ -15037,7 +15038,6 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -15195,7 +15195,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -15267,7 +15266,6 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -15429,6 +15427,7 @@ "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.6.tgz", "integrity": "sha512-5HfK7k5im7LTOB0EqCQmfvy4C13G92Ssj1VTmouTK3AJvyjKTnFuCV0vcMAD/JS+JC4DvDIBRrlAeJIFjh5VWg==", "license": "MIT", + "peer": true, "dependencies": { "@remix-run/router": "1.23.4" }, @@ -16641,8 +16640,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/tunnel-agent": { "version": "0.6.0", @@ -16691,7 +16689,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -17112,7 +17109,6 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.3.tgz", "integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==", "license": "MIT", - "peer": true, "engines": { "node": ">=10.0.0" }, @@ -17173,8 +17169,7 @@ "resolved": "https://registry.npmjs.org/xterm/-/xterm-5.3.0.tgz", "integrity": "sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg==", "deprecated": "This package is now deprecated. Move to @xterm/xterm instead.", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/xterm-addon-attach": { "version": "0.9.0", @@ -17280,7 +17275,6 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index 8be3ac9..e29152e 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@backstage/core-plugin-api": "^1.9.0", "@backstage/plugin-catalog-react": "^1.9.0", "@backstage/plugin-kubernetes-react": "^0.1.0", + "@types/json-schema": "^7.0.15", "react-use": "^17.5.0" }, "peerDependencies": { diff --git a/src/form/catalog.ts b/src/form/catalog.ts index 4e1f129..038582d 100644 --- a/src/form/catalog.ts +++ b/src/form/catalog.ts @@ -1,3 +1,4 @@ +import type { JSONSchema7, JSONSchema7Definition, JSONSchema7TypeName } from 'json-schema'; import { ConditionalRule, ExtensionSchemaItem, @@ -5,14 +6,22 @@ import { FormEnumOption, FormFieldDescriptor, FormFieldType, - JsonSchemaProperty, RuntimeConditionsExtensionDefinition, } from './types'; interface ExtractionContext { ext: RuntimeConditionsExtensionDefinition; schemaItem: ExtensionSchemaItem; - rootSchema: JsonSchemaProperty; + rootSchema: JSONSchema7; +} + +/** + * Narrows a JSONSchema7Definition (which may be a boolean schema) to an object schema. + */ +function isSchemaObject( + def: JSONSchema7Definition | undefined, +): def is JSONSchema7 { + return Boolean(def && typeof def === 'object'); } /** @@ -65,7 +74,7 @@ export function parseExtensionDefinition( * Excludes conditional (if/then) requirements to prevent false rejections. */ function collectStaticRequiredFields( - schema: JsonSchemaProperty, + schema: JSONSchema7, ): Set { const reqs = new Set(); if (Array.isArray(schema.required)) { @@ -77,30 +86,30 @@ function collectStaticRequiredFields( /** * Extracts conditional rules (if/then blocks) from root schema and allOf blocks. */ -function extractConditionalRules(schema: JsonSchemaProperty): ConditionalRule[] { +function extractConditionalRules(schema: JSONSchema7): ConditionalRule[] { const rules: ConditionalRule[] = []; - if (schema.if && schema.then) { + if (isSchemaObject(schema.if) && isSchemaObject(schema.then)) { rules.push({ if: schema.if, then: schema.then }); } if (Array.isArray(schema.allOf)) { for (const sub of schema.allOf) { - if (sub.if && sub.then) { + if (isSchemaObject(sub) && isSchemaObject(sub.if) && isSchemaObject(sub.then)) { rules.push({ if: sub.if, then: sub.then }); } } } // Also check interface-level if/then if present - const iface = schema.properties?.interface as JsonSchemaProperty | undefined; - if (iface) { - if (iface.if && iface.then) { + const iface = schema.properties?.interface; + if (isSchemaObject(iface)) { + if (isSchemaObject(iface.if) && isSchemaObject(iface.then)) { rules.push({ if: iface.if, then: iface.then }); } if (Array.isArray(iface.allOf)) { for (const sub of iface.allOf) { - if (sub.if && sub.then) { + if (isSchemaObject(sub) && isSchemaObject(sub.if) && isSchemaObject(sub.then)) { rules.push({ if: sub.if, then: sub.then }); } } @@ -115,8 +124,8 @@ function extractConditionalRules(schema: JsonSchemaProperty): ConditionalRule[] */ function lookupLocalRef( ref: string, - rootSchema: JsonSchemaProperty, -): JsonSchemaProperty | undefined { + rootSchema: JSONSchema7, +): JSONSchema7 | undefined { if (!ref.startsWith('#/')) { return undefined; } @@ -135,7 +144,7 @@ function lookupLocalRef( } return current && typeof current === 'object' - ? (current as JsonSchemaProperty) + ? (current as JSONSchema7) : undefined; } @@ -146,10 +155,10 @@ function lookupLocalRef( * over the resolved target (e.g. a field-level `description` alongside `$ref`). */ function resolveSchema( - rawSchema: JsonSchemaProperty, - rootSchema: JsonSchemaProperty, + rawSchema: JSONSchema7, + rootSchema: JSONSchema7, activeRefs: Set, -): { schema: JsonSchemaProperty; refs: Set; isRecursiveRef: boolean; recursiveRef?: string } { +): { schema: JSONSchema7; refs: Set; isRecursiveRef: boolean; recursiveRef?: string } { let current = rawSchema; const refs = new Set(activeRefs); @@ -178,7 +187,7 @@ function resolveSchema( return { schema: current, refs, isRecursiveRef: false }; } -function inferFieldType(schema: JsonSchemaProperty): FormFieldType { +function inferFieldType(schema: JSONSchema7): FormFieldType { if (Array.isArray(schema.enum)) { return 'enum'; } @@ -224,12 +233,15 @@ function inferFieldType(schema: JsonSchemaProperty): FormFieldType { const branchTypes = new Set( unionBranches .map(b => { + if (!isSchemaObject(b)) { + return undefined; + } if (Array.isArray(b.type)) { return b.type.find(t => t !== 'null'); } return b.type ?? (b.properties ? 'object' : undefined); }) - .filter((t): t is string => Boolean(t)), + .filter((t): t is JSONSchema7TypeName => Boolean(t)), ); if (branchTypes.size === 1) { return Array.from(branchTypes)[0] as FormFieldType; @@ -241,7 +253,10 @@ function inferFieldType(schema: JsonSchemaProperty): FormFieldType { // Distinguish selectable input shapes from pure validation constraints (e.g. `{ required: [...] }`) // so constraint-only oneOf/anyOf entries are not rendered as form variants. -function hasValueShape(branch: JsonSchemaProperty): boolean { +function hasValueShape(branch: JSONSchema7Definition): branch is JSONSchema7 { + if (!isSchemaObject(branch)) { + return false; + } return Boolean( branch.$ref || branch.type || @@ -253,7 +268,7 @@ function hasValueShape(branch: JsonSchemaProperty): boolean { } function buildEnumOptions( - schemaProp: JsonSchemaProperty, + schemaProp: JSONSchema7, ctx: ExtractionContext, path: string, name: string, @@ -286,7 +301,7 @@ function extractFieldDescriptor( name: string, path: string, location: 'interface' | 'condition', - rawSchema: JsonSchemaProperty, + rawSchema: JSONSchema7, required: boolean, ctx: ExtractionContext, activeRefs: Set, @@ -342,22 +357,23 @@ function extractFieldDescriptor( if (fieldType === 'object' && pSchema.properties) { const childRequired = new Set(pSchema.required ?? []); - const children = Object.entries(pSchema.properties).map( - ([childName, childProp]) => + const children = Object.entries(pSchema.properties) + .filter((entry): entry is [string, JSONSchema7] => isSchemaObject(entry[1])) + .map(([childName, childProp]) => extractFieldDescriptor( childName, `${pathBase}.${childName}`, location, - (childProp || {}) as JsonSchemaProperty, + childProp, childRequired.has(childName), ctx, refs, ), - ); + ); if (children.length > 0) { descriptor.children = children; } - } else if (fieldType === 'array' && pSchema.items && !Array.isArray(pSchema.items)) { + } else if (fieldType === 'array' && !Array.isArray(pSchema.items) && isSchemaObject(pSchema.items)) { descriptor.itemDescriptor = extractFieldDescriptor( `${name}[]`, `${pathBase}[]`, @@ -369,11 +385,7 @@ function extractFieldDescriptor( ); } - if ( - fieldType === 'object' && - pSchema.additionalProperties && - typeof pSchema.additionalProperties === 'object' - ) { + if (fieldType === 'object' && isSchemaObject(pSchema.additionalProperties)) { descriptor.mapValueDescriptor = extractFieldDescriptor( `${name}{}`, `${pathBase}{}`, @@ -446,8 +458,8 @@ export function extractConditionForms( // 1. Extract Interface fields (resolve `interface` itself in case it uses `$ref`, // which is required to uncover its nested `properties` and `required` list). - const rawIfaceSchema = schemaObj.properties?.interface as JsonSchemaProperty | undefined; - const resolvedIface = rawIfaceSchema + const rawIfaceSchema = schemaObj.properties?.interface; + const resolvedIface = isSchemaObject(rawIfaceSchema) ? resolveSchema(rawIfaceSchema, schemaObj, new Set()) : undefined; const ifaceSchema = resolvedIface?.schema; @@ -455,7 +467,7 @@ export function extractConditionForms( const ifaceRequiredSet = new Set(ifaceSchema?.required ?? []); for (const [propName, propVal] of Object.entries(ifaceProps)) { - if (propVal && typeof propVal === 'object' && 'const' in propVal) { + if (!isSchemaObject(propVal) || 'const' in propVal) { continue; } @@ -471,7 +483,7 @@ export function extractConditionForms( propName, `interface.${propName}`, 'interface', - (propVal || {}) as JsonSchemaProperty, + propVal, ifaceRequiredSet.has(propName), ctx, resolvedIface?.refs ?? new Set(), @@ -485,7 +497,7 @@ export function extractConditionForms( const conditionRequiredSet = collectStaticRequiredFields(schemaObj); for (const [propName, propVal] of Object.entries(rootProps)) { - if (['kind', 'interface', 'name', 'optional'].includes(propName)) { + if (['kind', 'interface', 'name', 'optional'].includes(propName) || !isSchemaObject(propVal)) { continue; } @@ -505,7 +517,7 @@ export function extractConditionForms( propName, propName, 'condition', - (propVal || {}) as JsonSchemaProperty, + propVal, conditionRequiredSet.has(propName), ctx, new Set(), diff --git a/src/form/form.test.ts b/src/form/form.test.ts index 1d26a1c..3e31bce 100644 --- a/src/form/form.test.ts +++ b/src/form/form.test.ts @@ -2,8 +2,8 @@ import { extractConditionForms, formatFieldLabel, } from './catalog'; +import type { JSONSchema7 } from 'json-schema'; import { - JsonSchemaProperty, RuntimeConditionsExtensionDefinition, } from './types'; @@ -473,7 +473,7 @@ describe('Recursive Object, Array, and $ref Extraction', () => { }); const mkExt = ( - schema: JsonSchemaProperty, + schema: JSONSchema7, extra: Partial = {}, ): RuntimeConditionsExtensionDefinition => ({ apiVersion: 'runtimeconditions.io/v1alpha1', diff --git a/src/form/types.ts b/src/form/types.ts index 2db299e..ee3f644 100644 --- a/src/form/types.ts +++ b/src/form/types.ts @@ -3,6 +3,8 @@ * Decoupled from Backstage UI to allow reuse across CLI and runtimeconditions.io web playground. */ +import type { JSONSchema7 } from 'json-schema'; + export interface ExtensionMetadata { id: string; version?: string; @@ -42,38 +44,12 @@ export interface ExtensionFieldValue { valueDescriptions?: Record; } -export interface JsonSchemaProperty { - type?: string | string[]; - enum?: (string | number | boolean)[]; - const?: unknown; - description?: string; - minimum?: number; - maximum?: number; - pattern?: string; - default?: unknown; - required?: string[]; - properties?: Record; - additionalProperties?: boolean | JsonSchemaProperty; - items?: JsonSchemaProperty | JsonSchemaProperty[]; - oneOf?: JsonSchemaProperty[]; - anyOf?: JsonSchemaProperty[]; - allOf?: JsonSchemaProperty[]; - if?: JsonSchemaProperty; - then?: JsonSchemaProperty; - else?: JsonSchemaProperty; - not?: JsonSchemaProperty; - $ref?: string; - $defs?: Record; - definitions?: Record; - [key: string]: unknown; -} - export interface ExtensionSchemaItem { id: string; appliesToKind: string; appliesToInterfaceType: string; description?: string; - schema: JsonSchemaProperty; + schema: JSONSchema7; } export interface RuntimeConditionsExtensionDefinition { @@ -122,8 +98,8 @@ export interface FormFieldDescriptor { } export interface ConditionalRule { - if?: JsonSchemaProperty; - then?: JsonSchemaProperty; + if?: JSONSchema7; + then?: JSONSchema7; } export interface ExtractedConditionForm {