From ce851ce4ad00226b824e4c774bbf64ab4cdcc71f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20De=20Freitas?= <6485562+adefreitas@users.noreply.github.com> Date: Mon, 15 Jun 2026 13:56:47 +0100 Subject: [PATCH] fix(ENG-520): drop @stackone/expressions to stop crypto leaking into the browser bundle The integration picker evaluated connector configField value/condition expressions client-side via @stackone/expressions, whose barrel statically imports Node crypto (md5/sha256/hmacSha256). That broke browser bundlers like rsbuild ("Can't resolve 'crypto'"). The API already pre-renders every Falcon configField value expression server-side (GET /hub/connectors/:id), and Falcon configFields carry no conditions, so the client-side evaluation was redundant. useIntegrationPicker now uses the API-resolved field.value directly. With the package gone, the saml stub and crypto externals in rollup.config.mjs are no longer needed. --- dev/rsbuild/package-lock.json | 5 +- package-lock.json | 309 ------------------ package.json | 1 - rollup.config.mjs | 27 -- .../hooks/useIntegrationPicker.ts | 63 +--- 5 files changed, 9 insertions(+), 396 deletions(-) diff --git a/dev/rsbuild/package-lock.json b/dev/rsbuild/package-lock.json index e4a053d..be36710 100644 --- a/dev/rsbuild/package-lock.json +++ b/dev/rsbuild/package-lock.json @@ -25,10 +25,9 @@ }, "../..": { "name": "@stackone/hub", - "version": "1.9.0", + "version": "1.10.1", "license": "MIT", "dependencies": { - "@stackone/expressions": "^0.16.0", "@stackone/malachite": "^0.25.2", "@tanstack/react-query": "^5.77.2", "use-deep-compare-effect": "^1.8.1" @@ -38,7 +37,7 @@ "@rollup/plugin-commonjs": "^28.0.3", "@rollup/plugin-node-resolve": "^16.0.1", "@rollup/plugin-replace": "^6.0.2", - "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-terser": "^1.0.0", "@rollup/plugin-typescript": "^12.1.2", "@types/node": "^22.15.17", "@types/react": "^18.3.23", diff --git a/package-lock.json b/package-lock.json index f4083a2..c4a69ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "1.10.1", "license": "MIT", "dependencies": { - "@stackone/expressions": "^0.16.0", "@stackone/malachite": "^0.25.2", "@tanstack/react-query": "^5.77.2", "use-deep-compare-effect": "^1.8.1" @@ -295,28 +294,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@jsep-plugin/assignment": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jsep-plugin/assignment/-/assignment-1.3.0.tgz", - "integrity": "sha512-VVgV+CXrhbMI3aSusQyclHkenWSAm95WaiKrMxRFam3JSUiIaQjoMIw2sEs/OX4XifnqeQUN4DYbJjlA8EfktQ==", - "engines": { - "node": ">= 10.16.0" - }, - "peerDependencies": { - "jsep": "^0.4.0||^1.0.0" - } - }, - "node_modules/@jsep-plugin/regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@jsep-plugin/regex/-/regex-1.0.4.tgz", - "integrity": "sha512-q7qL4Mgjs1vByCaTnDFcBnV9HS7GVPJX5vyVoCgZHNSC9rjwIlmbXG5sUuorR5ndfHAIlJ8pVStxvjXHbNvtUg==", - "engines": { - "node": ">= 10.16.0" - }, - "peerDependencies": { - "jsep": "^0.4.0||^1.0.0" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -856,16 +833,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@stackone/expressions": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@stackone/expressions/-/expressions-0.16.0.tgz", - "integrity": "sha512-gBZ7s2ooQthbRpCtySqu7XiT4d+YXMmBn+N3JyH7o9ZNb8K0goLaRD8c5tjYs7JD+MlhGm/BhBXu42r9LCaGIA==", - "dependencies": { - "@stackone/utils": "*", - "jexl": "^2.3.0", - "jsonpath-plus": "^10.3.0" - } - }, "node_modules/@stackone/malachite": { "version": "0.25.2", "resolved": "https://registry.npmjs.org/@stackone/malachite/-/malachite-0.25.2.tgz", @@ -880,20 +847,6 @@ "react-hook-form": "7.60.0" } }, - "node_modules/@stackone/utils": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@stackone/utils/-/utils-0.26.0.tgz", - "integrity": "sha512-AeVaP7E1uN+ejAAg2kyMbOpJ/M5jrv1ziZrKvgaTiPgG5JE1vOZPUydxuciSAazZboxJDLaoIPinp5f0DbDFdw==", - "license": "ISC", - "dependencies": { - "date-fns": "4.1.0", - "ipaddr.js": "2.2.0", - "mathjs": "11.12.0", - "saml": "3.0.1", - "spark-md5": "3.0.2", - "uuid": "9.0.1" - } - }, "node_modules/@standard-schema/utils": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz", @@ -985,15 +938,6 @@ "react-dom": ">=18.0.0" } }, - "node_modules/@xmldom/xmldom": { - "version": "0.8.13", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.13.tgz", - "integrity": "sha512-KRYzxepc14G/CEpEGc3Yn+JKaAeT63smlDr+vjB8jRfgTBBI9wRj/nkQEO+ucV8p8I9bfKLWp37uHgFrbntPvw==", - "license": "MIT", - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/acorn": { "version": "8.14.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", @@ -1021,12 +965,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "license": "MIT" - }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -1170,18 +1108,6 @@ "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, - "node_modules/complex.js": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.4.2.tgz", - "integrity": "sha512-qtx7HRhPGSCBtGiST4/WGHuW+zeaND/6Ld+db6PbrulIB1i2Ev/2UPiqcmpQNPSyfBKraC0EOvOKCB5dGZKt3g==", - "engines": { - "node": "*" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/rawify" - } - }, "node_modules/concat-with-sourcemaps": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", @@ -1350,20 +1276,6 @@ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", "dev": true }, - "node_modules/date-fns": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz", - "integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/kossnocorp" - } - }, - "node_modules/decimal.js": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", - "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==" - }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -1480,17 +1392,6 @@ "node": ">=6" } }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" - }, - "node_modules/escape-latex": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz", - "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==" - }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -1554,18 +1455,6 @@ "node": ">=8" } }, - "node_modules/fraction.js": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.4.tgz", - "integrity": "sha512-pwiTgt0Q7t+GHZA4yaLjObx4vXmmdcS0iSJ19o8d/goUGgItX9UZWKWNnLHehxviD8wU2IWRsnR8cD5+yOJP2Q==", - "engines": { - "node": "*" - }, - "funding": { - "type": "patreon", - "url": "https://github.com/sponsors/rawify" - } - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -1702,15 +1591,6 @@ "node": ">=8" } }, - "node_modules/ipaddr.js": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", - "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==", - "license": "MIT", - "engines": { - "node": ">= 10" - } - }, "node_modules/is-core-module": { "version": "2.16.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", @@ -1795,49 +1675,11 @@ "@types/estree": "*" } }, - "node_modules/javascript-natural-sort": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", - "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==" - }, - "node_modules/jexl": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/jexl/-/jexl-2.3.0.tgz", - "integrity": "sha512-ecqln4kTWNkMwbFvTukOMDq1jy1GcPzvshhMp/s4pxU86xdLDq7HbDRa87DfMfbSAOS8V6EwvCdfs0S+w/iycA==", - "dependencies": { - "@babel/runtime": "^7.10.2" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, - "node_modules/jsep": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/jsep/-/jsep-1.4.0.tgz", - "integrity": "sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw==", - "engines": { - "node": ">= 10.16.0" - } - }, - "node_modules/jsonpath-plus": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-10.3.0.tgz", - "integrity": "sha512-8TNmfeTCk2Le33A3vRRwtuworG/L5RrgMvdjhKZxvyShO+mBu2fP50OWUjRLNtvw344DdDarFh9buFAZs5ujeA==", - "dependencies": { - "@jsep-plugin/assignment": "^1.3.0", - "@jsep-plugin/regex": "^1.0.4", - "jsep": "^1.4.0" - }, - "bin": { - "jsonpath": "bin/jsonpath-cli.js", - "jsonpath-plus": "bin/jsonpath-cli.js" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", @@ -1919,28 +1761,6 @@ "react": "^16.8.0 || >=17.0.0" } }, - "node_modules/mathjs": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-11.12.0.tgz", - "integrity": "sha512-UGhVw8rS1AyedyI55DGz9q1qZ0p98kyKPyc9vherBkoueLntPfKtPBh14x+V4cdUWK0NZV2TBwqRFlvadscSuw==", - "dependencies": { - "@babel/runtime": "^7.23.2", - "complex.js": "^2.1.1", - "decimal.js": "^10.4.3", - "escape-latex": "^1.2.0", - "fraction.js": "4.3.4", - "javascript-natural-sort": "^0.7.1", - "seedrandom": "^3.0.5", - "tiny-emitter": "^2.1.0", - "typed-function": "^4.1.1" - }, - "bin": { - "mathjs": "bin/cli.js" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/mdn-data": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", @@ -1982,15 +1802,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/moment": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", - "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/nanoid": { "version": "3.3.12", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", @@ -2997,25 +2808,6 @@ "integrity": "sha512-6pNbSMW6OhAi9j+N8V+U715yBQsaWJ7eyEUaOrawX+isg5ZxhUlV1NipNtgaKHmFGiABwt+ZF04Ii+3Xjkg+8w==", "dev": true }, - "node_modules/saml": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/saml/-/saml-3.0.1.tgz", - "integrity": "sha512-bOjVqZcHY8PkdTBD7Y27KHykC7403BEM46SeCq5r0QPNEPE7M7RmWKy7hPjYsID9VNkCNSHYSVrrRS8Y9hNVWA==", - "license": "MIT", - "dependencies": { - "@xmldom/xmldom": "^0.7.4", - "async": "^3.2.4", - "moment": "^2.29.4", - "valid-url": "~1.0.9", - "xml-crypto": "^2.1.3", - "xml-encryption": "^2.0.0", - "xml-name-validator": "~2.0.1", - "xpath": "0.0.5" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/sax": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.0.tgz", @@ -3035,11 +2827,6 @@ "loose-envify": "^1.1.0" } }, - "node_modules/seedrandom": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", - "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" - }, "node_modules/serialize-javascript": { "version": "7.0.5", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.0.5.tgz", @@ -3097,12 +2884,6 @@ "source-map": "^0.6.0" } }, - "node_modules/spark-md5": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/spark-md5/-/spark-md5-3.0.2.tgz", - "integrity": "sha512-wcFzz9cDfbuqe0FZzfi2or1sgyIrsDwmPwfZC4hiNidPdPINjeUwNfv5kldczoEAcjl9Y1L3SM7Uz2PUEQzxQw==", - "license": "(WTFPL OR MIT)" - }, "node_modules/stable": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", @@ -3208,11 +2989,6 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, - "node_modules/tiny-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", - "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -3231,14 +3007,6 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true }, - "node_modules/typed-function": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.2.1.tgz", - "integrity": "sha512-EGjWssW7Tsk4DGfE+5yluuljS1OGYWiI1J6e8puZz9nTMM51Oug8CD5Zo4gWMsOhq5BI+1bF+rWTm4Vbj3ivRA==", - "engines": { - "node": ">= 18" - } - }, "node_modules/typescript": { "version": "5.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", @@ -3322,83 +3090,6 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, - "node_modules/uuid": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.1.tgz", - "integrity": "sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/esm/bin/uuid" - } - }, - "node_modules/valid-url": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz", - "integrity": "sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA==" - }, - "node_modules/xml-crypto": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/xml-crypto/-/xml-crypto-2.1.6.tgz", - "integrity": "sha512-jjvpO8vHNV8QFhW5bMypP+k4BjBqHe/HrpIwpPcdUnUTIJakSIuN96o3Sdah4tKu2z64kM/JHEH8iEHGCc6Gyw==", - "license": "MIT", - "dependencies": { - "@xmldom/xmldom": "^0.7.9", - "xpath": "0.0.32" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/xml-crypto/node_modules/xpath": { - "version": "0.0.32", - "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.32.tgz", - "integrity": "sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw==", - "license": "MIT", - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/xml-encryption": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/xml-encryption/-/xml-encryption-2.0.0.tgz", - "integrity": "sha512-4Av83DdvAgUQQMfi/w8G01aJshbEZP9ewjmZMpS9t3H+OCZBDvyK4GJPnHGfWiXlArnPbYvR58JB9qF2x9Ds+Q==", - "license": "MIT", - "dependencies": { - "@xmldom/xmldom": "^0.7.0", - "escape-html": "^1.0.3", - "xpath": "0.0.32" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/xml-encryption/node_modules/xpath": { - "version": "0.0.32", - "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.32.tgz", - "integrity": "sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw==", - "license": "MIT", - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/xml-name-validator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-2.0.1.tgz", - "integrity": "sha512-jRKe/iQYMyVJpzPH+3HL97Lgu5HrCfii+qSo+TfjKHtOnvbnvdVfMYrn9Q34YV81M2e5sviJlI6Ko9y+nByzvA==", - "license": "WTFPL" - }, - "node_modules/xpath": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.5.tgz", - "integrity": "sha512-Y1Oyy8lyIDwWpmKIWBF0RZrQOP1fzE12G0ekSB1yzKPtbAdCI5sBCqBU/CAZUkKk81OXuq9tul/5lyNS+22iKg==", - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/yaml": { "version": "1.10.3", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.3.tgz", diff --git a/package.json b/package.json index a21bc4c..13e6e8c 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "author": "StackOne", "license": "MIT", "dependencies": { - "@stackone/expressions": "^0.16.0", "@stackone/malachite": "^0.25.2", "@tanstack/react-query": "^5.77.2", "use-deep-compare-effect": "^1.8.1" diff --git a/rollup.config.mjs b/rollup.config.mjs index eb5580f..7b5e20a 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -8,29 +8,6 @@ import dts from "rollup-plugin-dts"; import external from "rollup-plugin-peer-deps-external"; import postcss from "rollup-plugin-postcss"; -// `@stackone/expressions` pulls in the full `@stackone/utils` barrel, whose node -// AND edge builds top-level `import { Saml20 } from "saml"`. `saml` drags in -// `xml-crypto`/`xml-encryption`, leaking `crypto`/`fs`/`path` into the browser -// bundle. The integration picker only uses `evaluate`, never SAML assertion -// generation, so we resolve `saml` to a stub. The stub throws on use so an -// unexpected SAML code path fails with an actionable error rather than a cryptic -// `Saml20 is not a constructor`. -const SAML_STUB = - "export class Saml20 {\n" + - " constructor() {\n" + - " throw new Error('@stackone/hub: `saml` is stubbed out of the browser bundle — SAML assertion generation is not available client-side.');\n" + - " }\n" + - "}\n"; -const stubSaml = { - name: "stub-saml", - resolveId(source) { - return source === "saml" ? "\0saml-stub" : null; - }, - load(id) { - return id === "\0saml-stub" ? SAML_STUB : null; - }, -}; - export default [ // Main React Component Bundle { @@ -57,7 +34,6 @@ export default [ ], plugins: [ del({ targets: "dist/*" }), - stubSaml, resolve({ preferBuiltins: false, browser: true, @@ -89,11 +65,8 @@ export default [ format: "iife", name: "StackOneHubWebComponent", sourcemap: true, - globals: { crypto: "globalThis.crypto" }, }, - external: ["crypto"], plugins: [ - stubSaml, resolve({ preferBuiltins: false, browser: true, diff --git a/src/modules/integration-picker/hooks/useIntegrationPicker.ts b/src/modules/integration-picker/hooks/useIntegrationPicker.ts index 7c7672e..ba4411d 100644 --- a/src/modules/integration-picker/hooks/useIntegrationPicker.ts +++ b/src/modules/integration-picker/hooks/useIntegrationPicker.ts @@ -1,4 +1,3 @@ -import { evaluate } from '@stackone/expressions'; import { useQuery } from '@tanstack/react-query'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { @@ -239,43 +238,19 @@ export const useIntegrationPicker = ({ }; } - const evaluationContext = { - ...formData, - ...accountData?.setupInformation, - external_trigger_token: hubData?.external_trigger_token, - webhooks_url: hubData?.webhooks_url, - events_encoded_context: hubData?.events_encoded_context, - hub_settings: connectorData.hub_settings, - }; - - if (field.condition) { - const evaluated = evaluate(field.condition, evaluationContext); - - const shouldShow = evaluated != null && evaluated !== 'false'; - - if (!shouldShow) { - return; - } - } + const prefilledValue = setupValue !== undefined ? setupValue : field.value; - const valueToEvaluate = setupValue !== undefined ? setupValue : field.value; - - if (!valueToEvaluate) { + if (!prefilledValue) { return { ...field, key: field.key, }; } - let evaluatedValue = evaluate(valueToEvaluate?.toString(), evaluationContext); - - if (typeof evaluatedValue === 'object' && evaluatedValue !== null) { - evaluatedValue = JSON.stringify(evaluatedValue); - } return { ...field, key: field.key, - value: evaluatedValue as string | number | undefined, + value: prefilledValue, }; }) .filter((value) => value != null); @@ -318,25 +293,6 @@ export const useIntegrationPicker = ({ }; } - const evaluationContext = { - ...formData, - ...accountData?.setupInformation, - external_trigger_token: hubData?.external_trigger_token, - hub_settings: connectorData.hub_settings, - }; - - if (field.condition) { - const evaluated = evaluate(field.condition, evaluationContext); - - const shouldShow = evaluated != null && evaluated !== 'false'; - - return { - ...field, - key: field.key, - display: shouldShow, - }; - } - if (accountData && (field.secret !== false || field.type === 'password')) { const secretValue = accountData.secrets?.[field.key]; if (secretValue) { @@ -353,24 +309,19 @@ export const useIntegrationPicker = ({ }; } - const valueToEvaluate = setupValue !== undefined ? setupValue : field.value; + const prefilledValue = setupValue !== undefined ? setupValue : field.value; - if (!valueToEvaluate) { + if (!prefilledValue) { return { ...field, key: field.key, }; } - let evaluatedValue = evaluate(valueToEvaluate?.toString(), evaluationContext); - - if (typeof evaluatedValue === 'object' && evaluatedValue !== null) { - evaluatedValue = JSON.stringify(evaluatedValue); - } return { ...field, key: field.key, - value: evaluatedValue as string | number | undefined, + value: prefilledValue, }; }) .filter((value) => value != null); @@ -380,7 +331,7 @@ export const useIntegrationPicker = ({ notices: [], guide: authConfigForEnvironment?.guide, }; - }, [connectorData, selectedIntegration, accountData, formData, hubData]); + }, [connectorData, selectedIntegration, accountData, hubData]); const authConfig = useMemo(() => { if (!connectorData || !selectedIntegration) {