From 604d7eca2e31342eb09b41802bd6ec3b9a247255 Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Fri, 14 Feb 2025 12:56:15 +0000 Subject: [PATCH 01/30] [Chore] Bump `@deskpro/app-sdk` to version 6.0.3 --- package.json | 2 +- pnpm-lock.yaml | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index e0c4601..ce11e94 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "bumpManifestVer": "node ./bin/bumpManifestVer.js" }, "dependencies": { - "@deskpro/app-sdk": "^5.1.1", + "@deskpro/app-sdk": "^6.0.3", "@deskpro/deskpro-ui": "^8.2.0", "@fortawesome/free-solid-svg-icons": "^6.7.2", "@fortawesome/react-fontawesome": "^0.2.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e4ec418..25ebe38 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@deskpro/app-sdk': - specifier: ^5.1.1 - version: 5.1.1(@deskpro/deskpro-ui@8.2.0(@types/web@0.0.139)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(styled-components@6.1.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)))(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2) + specifier: ^6.0.3 + version: 6.0.3(@deskpro/deskpro-ui@8.2.0(@types/web@0.0.139)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(styled-components@6.1.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)))(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2) '@deskpro/deskpro-ui': specifier: ^8.2.0 version: 8.2.0(@types/web@0.0.139)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(styled-components@6.1.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) @@ -146,7 +146,7 @@ importers: version: 5.7.2 vite: specifier: ^6.0.11 - version: 6.0.11(@types/node@22.10.5)(sass@1.83.1) + version: 6.0.11(@types/node@22.10.5)(sass@1.85.0) packages: @@ -350,8 +350,8 @@ packages: '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - '@deskpro/app-sdk@5.1.1': - resolution: {integrity: sha512-GVwjVb/8EX4aBHtDu7YqWKpVPxslyFy0nAEjbo59hycy73KPqV0UdOCQNM5LasZnrC1U6epV/BYVQrUDplTzuw==} + '@deskpro/app-sdk@6.0.3': + resolution: {integrity: sha512-7IYRxJ6SRCKrsSFO5bZwGYhRoEvX08LPv0pDGIxhNejrqp+eaDb8hjobKnPKwK22pRNJ/riExGPsbGXeSuuCZQ==} engines: {node: '>=20.0.0'} peerDependencies: '@deskpro/deskpro-ui': ^8.0.0 @@ -2182,8 +2182,8 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} - libphonenumber-js@1.11.17: - resolution: {integrity: sha512-Jr6v8thd5qRlOlc6CslSTzGzzQW03uiscab7KHQZX1Dfo4R6n6FDhZ0Hri6/X7edLIDv9gl4VMZXhxTjLnl0VQ==} + libphonenumber-js@1.11.19: + resolution: {integrity: sha512-bW/Yp/9dod6fmyR+XqSUL1N5JE7QRxQ3KrBIbYS1FTv32e5i3SEtQVX+71CYNv8maWNSOgnlCoNp9X78f/cKiA==} lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} @@ -2640,8 +2640,8 @@ packages: resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} engines: {node: '>= 0.4'} - sass@1.83.1: - resolution: {integrity: sha512-EVJbDaEs4Rr3F0glJzFSOvtg2/oy2V/YrGFPqPY24UqcLDWcI9ZY5sN+qyO3c/QCZwzgfirvhXvINiJCE/OLcA==} + sass@1.85.0: + resolution: {integrity: sha512-3ToiC1xZ1Y8aU7+CkgCI/tqyuPXEmYGJXO7H4uqp0xkLXUqp88rQQ4j1HmP37xSJLbCJPaIiv+cT1y+grssrww==} engines: {node: '>=14.0.0'} hasBin: true @@ -3292,7 +3292,7 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} - '@deskpro/app-sdk@5.1.1(@deskpro/deskpro-ui@8.2.0(@types/web@0.0.139)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(styled-components@6.1.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)))(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)': + '@deskpro/app-sdk@6.0.3(@deskpro/deskpro-ui@8.2.0(@types/web@0.0.139)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(styled-components@6.1.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)))(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)': dependencies: '@deskpro/deskpro-ui': 8.2.0(@types/web@0.0.139)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(styled-components@6.1.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) '@fortawesome/fontawesome-svg-core': 6.7.2 @@ -3308,7 +3308,7 @@ snapshots: fuse.js: 7.0.0 handlebars: 4.7.7 i18n-iso-countries: 7.13.0 - libphonenumber-js: 1.11.17 + libphonenumber-js: 1.11.19 modern-normalize: 1.1.0 penpal: 6.2.1 react: 18.3.1 @@ -3317,7 +3317,7 @@ snapshots: react-flatpickr: 3.10.7(react@18.3.1) react-intl: 5.25.1(react@18.3.1)(typescript@5.7.2) regenerator-runtime: 0.14.1 - sass: 1.83.1 + sass: 1.85.0 shortcut-buttons-flatpickr: 0.4.0 styled-components: 6.1.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1) ts-pattern: 4.3.0 @@ -5567,7 +5567,7 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - libphonenumber-js@1.11.17: {} + libphonenumber-js@1.11.19: {} lines-and-columns@1.2.4: {} @@ -6005,7 +6005,7 @@ snapshots: es-errors: 1.3.0 is-regex: 1.2.1 - sass@1.83.1: + sass@1.85.0: dependencies: chokidar: 4.0.3 immutable: 5.0.3 @@ -6303,7 +6303,7 @@ snapshots: '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 - vite@6.0.11(@types/node@22.10.5)(sass@1.83.1): + vite@6.0.11(@types/node@22.10.5)(sass@1.85.0): dependencies: esbuild: 0.24.2 postcss: 8.4.49 @@ -6311,7 +6311,7 @@ snapshots: optionalDependencies: '@types/node': 22.10.5 fsevents: 2.3.3 - sass: 1.83.1 + sass: 1.85.0 walker@1.0.8: dependencies: From fd75f4ed83cdc3dfb1c2043b4debff69690c2a63 Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Fri, 14 Feb 2025 12:59:11 +0000 Subject: [PATCH 02/30] [Chore] Bump `esbuild` to version 0.25.0 (SC-180980) --- package.json | 5 ++ pnpm-lock.yaml | 211 +++++++++++++++++++++++++------------------------ 2 files changed, 112 insertions(+), 104 deletions(-) diff --git a/package.json b/package.json index ce11e94..3e60fd9 100644 --- a/package.json +++ b/package.json @@ -62,5 +62,10 @@ "ts-jest": "^27.1.5", "typescript": "^5.7.2", "vite": "^6.0.11" + }, + "pnpm": { + "overrides": { + "esbuild": "^0.25.0" + } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 25ebe38..668b5d0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,9 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +overrides: + esbuild: ^0.25.0 + importers: .: @@ -384,152 +387,152 @@ packages: '@emotion/unitless@0.8.1': resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - '@esbuild/aix-ppc64@0.24.2': - resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} + '@esbuild/aix-ppc64@0.25.0': + resolution: {integrity: sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.24.2': - resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==} + '@esbuild/android-arm64@0.25.0': + resolution: {integrity: sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==} engines: {node: '>=18'} cpu: [arm64] os: [android] - '@esbuild/android-arm@0.24.2': - resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==} + '@esbuild/android-arm@0.25.0': + resolution: {integrity: sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==} engines: {node: '>=18'} cpu: [arm] os: [android] - '@esbuild/android-x64@0.24.2': - resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==} + '@esbuild/android-x64@0.25.0': + resolution: {integrity: sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==} engines: {node: '>=18'} cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.24.2': - resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==} + '@esbuild/darwin-arm64@0.25.0': + resolution: {integrity: sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.24.2': - resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==} + '@esbuild/darwin-x64@0.25.0': + resolution: {integrity: sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==} engines: {node: '>=18'} cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.24.2': - resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==} + '@esbuild/freebsd-arm64@0.25.0': + resolution: {integrity: sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.24.2': - resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==} + '@esbuild/freebsd-x64@0.25.0': + resolution: {integrity: sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.24.2': - resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==} + '@esbuild/linux-arm64@0.25.0': + resolution: {integrity: sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==} engines: {node: '>=18'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.24.2': - resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==} + '@esbuild/linux-arm@0.25.0': + resolution: {integrity: sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==} engines: {node: '>=18'} cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.24.2': - resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==} + '@esbuild/linux-ia32@0.25.0': + resolution: {integrity: sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==} engines: {node: '>=18'} cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.24.2': - resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==} + '@esbuild/linux-loong64@0.25.0': + resolution: {integrity: sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==} engines: {node: '>=18'} cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.24.2': - resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==} + '@esbuild/linux-mips64el@0.25.0': + resolution: {integrity: sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.24.2': - resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==} + '@esbuild/linux-ppc64@0.25.0': + resolution: {integrity: sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.24.2': - resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==} + '@esbuild/linux-riscv64@0.25.0': + resolution: {integrity: sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.24.2': - resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==} + '@esbuild/linux-s390x@0.25.0': + resolution: {integrity: sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==} engines: {node: '>=18'} cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.24.2': - resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==} + '@esbuild/linux-x64@0.25.0': + resolution: {integrity: sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-arm64@0.24.2': - resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==} + '@esbuild/netbsd-arm64@0.25.0': + resolution: {integrity: sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-x64@0.24.2': - resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==} + '@esbuild/netbsd-x64@0.25.0': + resolution: {integrity: sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.24.2': - resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==} + '@esbuild/openbsd-arm64@0.25.0': + resolution: {integrity: sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.24.2': - resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==} + '@esbuild/openbsd-x64@0.25.0': + resolution: {integrity: sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/sunos-x64@0.24.2': - resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==} + '@esbuild/sunos-x64@0.25.0': + resolution: {integrity: sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==} engines: {node: '>=18'} cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.24.2': - resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==} + '@esbuild/win32-arm64@0.25.0': + resolution: {integrity: sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==} engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.24.2': - resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==} + '@esbuild/win32-ia32@0.25.0': + resolution: {integrity: sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==} engines: {node: '>=18'} cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.24.2': - resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==} + '@esbuild/win32-x64@0.25.0': + resolution: {integrity: sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==} engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -1500,8 +1503,8 @@ packages: resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} engines: {node: '>= 0.4'} - esbuild@0.24.2: - resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==} + esbuild@0.25.0: + resolution: {integrity: sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==} engines: {node: '>=18'} hasBin: true @@ -3372,79 +3375,79 @@ snapshots: '@emotion/unitless@0.8.1': {} - '@esbuild/aix-ppc64@0.24.2': + '@esbuild/aix-ppc64@0.25.0': optional: true - '@esbuild/android-arm64@0.24.2': + '@esbuild/android-arm64@0.25.0': optional: true - '@esbuild/android-arm@0.24.2': + '@esbuild/android-arm@0.25.0': optional: true - '@esbuild/android-x64@0.24.2': + '@esbuild/android-x64@0.25.0': optional: true - '@esbuild/darwin-arm64@0.24.2': + '@esbuild/darwin-arm64@0.25.0': optional: true - '@esbuild/darwin-x64@0.24.2': + '@esbuild/darwin-x64@0.25.0': optional: true - '@esbuild/freebsd-arm64@0.24.2': + '@esbuild/freebsd-arm64@0.25.0': optional: true - '@esbuild/freebsd-x64@0.24.2': + '@esbuild/freebsd-x64@0.25.0': optional: true - '@esbuild/linux-arm64@0.24.2': + '@esbuild/linux-arm64@0.25.0': optional: true - '@esbuild/linux-arm@0.24.2': + '@esbuild/linux-arm@0.25.0': optional: true - '@esbuild/linux-ia32@0.24.2': + '@esbuild/linux-ia32@0.25.0': optional: true - '@esbuild/linux-loong64@0.24.2': + '@esbuild/linux-loong64@0.25.0': optional: true - '@esbuild/linux-mips64el@0.24.2': + '@esbuild/linux-mips64el@0.25.0': optional: true - '@esbuild/linux-ppc64@0.24.2': + '@esbuild/linux-ppc64@0.25.0': optional: true - '@esbuild/linux-riscv64@0.24.2': + '@esbuild/linux-riscv64@0.25.0': optional: true - '@esbuild/linux-s390x@0.24.2': + '@esbuild/linux-s390x@0.25.0': optional: true - '@esbuild/linux-x64@0.24.2': + '@esbuild/linux-x64@0.25.0': optional: true - '@esbuild/netbsd-arm64@0.24.2': + '@esbuild/netbsd-arm64@0.25.0': optional: true - '@esbuild/netbsd-x64@0.24.2': + '@esbuild/netbsd-x64@0.25.0': optional: true - '@esbuild/openbsd-arm64@0.24.2': + '@esbuild/openbsd-arm64@0.25.0': optional: true - '@esbuild/openbsd-x64@0.24.2': + '@esbuild/openbsd-x64@0.25.0': optional: true - '@esbuild/sunos-x64@0.24.2': + '@esbuild/sunos-x64@0.25.0': optional: true - '@esbuild/win32-arm64@0.24.2': + '@esbuild/win32-arm64@0.25.0': optional: true - '@esbuild/win32-ia32@0.24.2': + '@esbuild/win32-ia32@0.25.0': optional: true - '@esbuild/win32-x64@0.24.2': + '@esbuild/win32-x64@0.25.0': optional: true '@eslint/eslintrc@1.4.1': @@ -4608,33 +4611,33 @@ snapshots: dependencies: es-errors: 1.3.0 - esbuild@0.24.2: + esbuild@0.25.0: optionalDependencies: - '@esbuild/aix-ppc64': 0.24.2 - '@esbuild/android-arm': 0.24.2 - '@esbuild/android-arm64': 0.24.2 - '@esbuild/android-x64': 0.24.2 - '@esbuild/darwin-arm64': 0.24.2 - '@esbuild/darwin-x64': 0.24.2 - '@esbuild/freebsd-arm64': 0.24.2 - '@esbuild/freebsd-x64': 0.24.2 - '@esbuild/linux-arm': 0.24.2 - '@esbuild/linux-arm64': 0.24.2 - '@esbuild/linux-ia32': 0.24.2 - '@esbuild/linux-loong64': 0.24.2 - '@esbuild/linux-mips64el': 0.24.2 - '@esbuild/linux-ppc64': 0.24.2 - '@esbuild/linux-riscv64': 0.24.2 - '@esbuild/linux-s390x': 0.24.2 - '@esbuild/linux-x64': 0.24.2 - '@esbuild/netbsd-arm64': 0.24.2 - '@esbuild/netbsd-x64': 0.24.2 - '@esbuild/openbsd-arm64': 0.24.2 - '@esbuild/openbsd-x64': 0.24.2 - '@esbuild/sunos-x64': 0.24.2 - '@esbuild/win32-arm64': 0.24.2 - '@esbuild/win32-ia32': 0.24.2 - '@esbuild/win32-x64': 0.24.2 + '@esbuild/aix-ppc64': 0.25.0 + '@esbuild/android-arm': 0.25.0 + '@esbuild/android-arm64': 0.25.0 + '@esbuild/android-x64': 0.25.0 + '@esbuild/darwin-arm64': 0.25.0 + '@esbuild/darwin-x64': 0.25.0 + '@esbuild/freebsd-arm64': 0.25.0 + '@esbuild/freebsd-x64': 0.25.0 + '@esbuild/linux-arm': 0.25.0 + '@esbuild/linux-arm64': 0.25.0 + '@esbuild/linux-ia32': 0.25.0 + '@esbuild/linux-loong64': 0.25.0 + '@esbuild/linux-mips64el': 0.25.0 + '@esbuild/linux-ppc64': 0.25.0 + '@esbuild/linux-riscv64': 0.25.0 + '@esbuild/linux-s390x': 0.25.0 + '@esbuild/linux-x64': 0.25.0 + '@esbuild/netbsd-arm64': 0.25.0 + '@esbuild/netbsd-x64': 0.25.0 + '@esbuild/openbsd-arm64': 0.25.0 + '@esbuild/openbsd-x64': 0.25.0 + '@esbuild/sunos-x64': 0.25.0 + '@esbuild/win32-arm64': 0.25.0 + '@esbuild/win32-ia32': 0.25.0 + '@esbuild/win32-x64': 0.25.0 escalade@3.2.0: {} @@ -6305,7 +6308,7 @@ snapshots: vite@6.0.11(@types/node@22.10.5)(sass@1.85.0): dependencies: - esbuild: 0.24.2 + esbuild: 0.25.0 postcss: 8.4.49 rollup: 4.31.0 optionalDependencies: From 216b87700ce7de5fc02e404cadf2f1ad209dbad7 Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Wed, 19 Feb 2025 13:14:24 +0000 Subject: [PATCH 03/30] [Chore] Remove `esbuild` override --- package.json | 5 -- pnpm-lock.yaml | 211 ++++++++++++++++++++++++------------------------- 2 files changed, 104 insertions(+), 112 deletions(-) diff --git a/package.json b/package.json index 3e60fd9..ce11e94 100644 --- a/package.json +++ b/package.json @@ -62,10 +62,5 @@ "ts-jest": "^27.1.5", "typescript": "^5.7.2", "vite": "^6.0.11" - }, - "pnpm": { - "overrides": { - "esbuild": "^0.25.0" - } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 668b5d0..25ebe38 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,9 +4,6 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -overrides: - esbuild: ^0.25.0 - importers: .: @@ -387,152 +384,152 @@ packages: '@emotion/unitless@0.8.1': resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - '@esbuild/aix-ppc64@0.25.0': - resolution: {integrity: sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==} + '@esbuild/aix-ppc64@0.24.2': + resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.25.0': - resolution: {integrity: sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==} + '@esbuild/android-arm64@0.24.2': + resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==} engines: {node: '>=18'} cpu: [arm64] os: [android] - '@esbuild/android-arm@0.25.0': - resolution: {integrity: sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==} + '@esbuild/android-arm@0.24.2': + resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==} engines: {node: '>=18'} cpu: [arm] os: [android] - '@esbuild/android-x64@0.25.0': - resolution: {integrity: sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==} + '@esbuild/android-x64@0.24.2': + resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==} engines: {node: '>=18'} cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.25.0': - resolution: {integrity: sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==} + '@esbuild/darwin-arm64@0.24.2': + resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.25.0': - resolution: {integrity: sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==} + '@esbuild/darwin-x64@0.24.2': + resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==} engines: {node: '>=18'} cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.25.0': - resolution: {integrity: sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==} + '@esbuild/freebsd-arm64@0.24.2': + resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.25.0': - resolution: {integrity: sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==} + '@esbuild/freebsd-x64@0.24.2': + resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.25.0': - resolution: {integrity: sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==} + '@esbuild/linux-arm64@0.24.2': + resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==} engines: {node: '>=18'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.25.0': - resolution: {integrity: sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==} + '@esbuild/linux-arm@0.24.2': + resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==} engines: {node: '>=18'} cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.25.0': - resolution: {integrity: sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==} + '@esbuild/linux-ia32@0.24.2': + resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==} engines: {node: '>=18'} cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.25.0': - resolution: {integrity: sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==} + '@esbuild/linux-loong64@0.24.2': + resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==} engines: {node: '>=18'} cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.25.0': - resolution: {integrity: sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==} + '@esbuild/linux-mips64el@0.24.2': + resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.25.0': - resolution: {integrity: sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==} + '@esbuild/linux-ppc64@0.24.2': + resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.25.0': - resolution: {integrity: sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==} + '@esbuild/linux-riscv64@0.24.2': + resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.25.0': - resolution: {integrity: sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==} + '@esbuild/linux-s390x@0.24.2': + resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==} engines: {node: '>=18'} cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.25.0': - resolution: {integrity: sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==} + '@esbuild/linux-x64@0.24.2': + resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-arm64@0.25.0': - resolution: {integrity: sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==} + '@esbuild/netbsd-arm64@0.24.2': + resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-x64@0.25.0': - resolution: {integrity: sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==} + '@esbuild/netbsd-x64@0.24.2': + resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.25.0': - resolution: {integrity: sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==} + '@esbuild/openbsd-arm64@0.24.2': + resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.25.0': - resolution: {integrity: sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==} + '@esbuild/openbsd-x64@0.24.2': + resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/sunos-x64@0.25.0': - resolution: {integrity: sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==} + '@esbuild/sunos-x64@0.24.2': + resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==} engines: {node: '>=18'} cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.25.0': - resolution: {integrity: sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==} + '@esbuild/win32-arm64@0.24.2': + resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==} engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.25.0': - resolution: {integrity: sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==} + '@esbuild/win32-ia32@0.24.2': + resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==} engines: {node: '>=18'} cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.25.0': - resolution: {integrity: sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==} + '@esbuild/win32-x64@0.24.2': + resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==} engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -1503,8 +1500,8 @@ packages: resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} engines: {node: '>= 0.4'} - esbuild@0.25.0: - resolution: {integrity: sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==} + esbuild@0.24.2: + resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==} engines: {node: '>=18'} hasBin: true @@ -3375,79 +3372,79 @@ snapshots: '@emotion/unitless@0.8.1': {} - '@esbuild/aix-ppc64@0.25.0': + '@esbuild/aix-ppc64@0.24.2': optional: true - '@esbuild/android-arm64@0.25.0': + '@esbuild/android-arm64@0.24.2': optional: true - '@esbuild/android-arm@0.25.0': + '@esbuild/android-arm@0.24.2': optional: true - '@esbuild/android-x64@0.25.0': + '@esbuild/android-x64@0.24.2': optional: true - '@esbuild/darwin-arm64@0.25.0': + '@esbuild/darwin-arm64@0.24.2': optional: true - '@esbuild/darwin-x64@0.25.0': + '@esbuild/darwin-x64@0.24.2': optional: true - '@esbuild/freebsd-arm64@0.25.0': + '@esbuild/freebsd-arm64@0.24.2': optional: true - '@esbuild/freebsd-x64@0.25.0': + '@esbuild/freebsd-x64@0.24.2': optional: true - '@esbuild/linux-arm64@0.25.0': + '@esbuild/linux-arm64@0.24.2': optional: true - '@esbuild/linux-arm@0.25.0': + '@esbuild/linux-arm@0.24.2': optional: true - '@esbuild/linux-ia32@0.25.0': + '@esbuild/linux-ia32@0.24.2': optional: true - '@esbuild/linux-loong64@0.25.0': + '@esbuild/linux-loong64@0.24.2': optional: true - '@esbuild/linux-mips64el@0.25.0': + '@esbuild/linux-mips64el@0.24.2': optional: true - '@esbuild/linux-ppc64@0.25.0': + '@esbuild/linux-ppc64@0.24.2': optional: true - '@esbuild/linux-riscv64@0.25.0': + '@esbuild/linux-riscv64@0.24.2': optional: true - '@esbuild/linux-s390x@0.25.0': + '@esbuild/linux-s390x@0.24.2': optional: true - '@esbuild/linux-x64@0.25.0': + '@esbuild/linux-x64@0.24.2': optional: true - '@esbuild/netbsd-arm64@0.25.0': + '@esbuild/netbsd-arm64@0.24.2': optional: true - '@esbuild/netbsd-x64@0.25.0': + '@esbuild/netbsd-x64@0.24.2': optional: true - '@esbuild/openbsd-arm64@0.25.0': + '@esbuild/openbsd-arm64@0.24.2': optional: true - '@esbuild/openbsd-x64@0.25.0': + '@esbuild/openbsd-x64@0.24.2': optional: true - '@esbuild/sunos-x64@0.25.0': + '@esbuild/sunos-x64@0.24.2': optional: true - '@esbuild/win32-arm64@0.25.0': + '@esbuild/win32-arm64@0.24.2': optional: true - '@esbuild/win32-ia32@0.25.0': + '@esbuild/win32-ia32@0.24.2': optional: true - '@esbuild/win32-x64@0.25.0': + '@esbuild/win32-x64@0.24.2': optional: true '@eslint/eslintrc@1.4.1': @@ -4611,33 +4608,33 @@ snapshots: dependencies: es-errors: 1.3.0 - esbuild@0.25.0: + esbuild@0.24.2: optionalDependencies: - '@esbuild/aix-ppc64': 0.25.0 - '@esbuild/android-arm': 0.25.0 - '@esbuild/android-arm64': 0.25.0 - '@esbuild/android-x64': 0.25.0 - '@esbuild/darwin-arm64': 0.25.0 - '@esbuild/darwin-x64': 0.25.0 - '@esbuild/freebsd-arm64': 0.25.0 - '@esbuild/freebsd-x64': 0.25.0 - '@esbuild/linux-arm': 0.25.0 - '@esbuild/linux-arm64': 0.25.0 - '@esbuild/linux-ia32': 0.25.0 - '@esbuild/linux-loong64': 0.25.0 - '@esbuild/linux-mips64el': 0.25.0 - '@esbuild/linux-ppc64': 0.25.0 - '@esbuild/linux-riscv64': 0.25.0 - '@esbuild/linux-s390x': 0.25.0 - '@esbuild/linux-x64': 0.25.0 - '@esbuild/netbsd-arm64': 0.25.0 - '@esbuild/netbsd-x64': 0.25.0 - '@esbuild/openbsd-arm64': 0.25.0 - '@esbuild/openbsd-x64': 0.25.0 - '@esbuild/sunos-x64': 0.25.0 - '@esbuild/win32-arm64': 0.25.0 - '@esbuild/win32-ia32': 0.25.0 - '@esbuild/win32-x64': 0.25.0 + '@esbuild/aix-ppc64': 0.24.2 + '@esbuild/android-arm': 0.24.2 + '@esbuild/android-arm64': 0.24.2 + '@esbuild/android-x64': 0.24.2 + '@esbuild/darwin-arm64': 0.24.2 + '@esbuild/darwin-x64': 0.24.2 + '@esbuild/freebsd-arm64': 0.24.2 + '@esbuild/freebsd-x64': 0.24.2 + '@esbuild/linux-arm': 0.24.2 + '@esbuild/linux-arm64': 0.24.2 + '@esbuild/linux-ia32': 0.24.2 + '@esbuild/linux-loong64': 0.24.2 + '@esbuild/linux-mips64el': 0.24.2 + '@esbuild/linux-ppc64': 0.24.2 + '@esbuild/linux-riscv64': 0.24.2 + '@esbuild/linux-s390x': 0.24.2 + '@esbuild/linux-x64': 0.24.2 + '@esbuild/netbsd-arm64': 0.24.2 + '@esbuild/netbsd-x64': 0.24.2 + '@esbuild/openbsd-arm64': 0.24.2 + '@esbuild/openbsd-x64': 0.24.2 + '@esbuild/sunos-x64': 0.24.2 + '@esbuild/win32-arm64': 0.24.2 + '@esbuild/win32-ia32': 0.24.2 + '@esbuild/win32-x64': 0.24.2 escalade@3.2.0: {} @@ -6308,7 +6305,7 @@ snapshots: vite@6.0.11(@types/node@22.10.5)(sass@1.85.0): dependencies: - esbuild: 0.25.0 + esbuild: 0.24.2 postcss: 8.4.49 rollup: 4.31.0 optionalDependencies: From 5985fe7a43998c5bb1153b287e295473175f63c5 Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Thu, 27 Feb 2025 12:01:51 +0000 Subject: [PATCH 04/30] [Fix] Fix broken `getCurrentUser` url --- src/api/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/api.ts b/src/api/api.ts index d4ad410..e41a4bc 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -115,7 +115,7 @@ const getCurrentUser = async ( ): Promise<{ data: IPipedriveUser }> => { return (settings?.api_key && settings?.instance_domain) ? await preInstalledRequest(client, `users/me`, settings) - : await pipedriveGet(client, orgName as string, `users/me`); + : await pipedriveGet(client, orgName as string, `users/me?api_token=__api_key__`); }; const getUserById = async ( From ff8ff86b72fcc2d9b50d9f2092a0d1ef956e3036 Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Thu, 27 Feb 2025 12:30:13 +0000 Subject: [PATCH 05/30] [Feat] Introduce absolute imports --- tsconfig.json | 6 +++++- vite.config.ts | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index b98eda8..0e486a8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,11 @@ "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", - "types": ["vite/client", "jest", "testing-library__jest-dom"] + "types": ["vite/client", "jest", "testing-library__jest-dom"], + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + } }, "include": ["./src"] } diff --git a/vite.config.ts b/vite.config.ts index e4a9378..8f4802c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,8 @@ import { defineConfig } from "vite"; -import react from "@vitejs/plugin-react"; import copy from "rollup-plugin-copy"; +import path from "path"; +import react from "@vitejs/plugin-react"; + // https://vitejs.dev/config/ export default defineConfig({ @@ -9,6 +11,11 @@ export default defineConfig({ server: { allowedHosts: true, }, + resolve:{ + alias: { + "@": path.resolve(__dirname, "src"), + }, + }, build: { rollupOptions: { onwarn(warning, warn) { From 7f3e0b7584c8ae183540e94c399849f957f7f107 Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Thu, 27 Feb 2025 13:47:11 +0000 Subject: [PATCH 06/30] [Feat] Add OAuth2/Global proxy settings --- manifest.json | 89 ++++++++++++++++++++++++++++++++----- src/pages/AdminCallback.tsx | 51 +++++++++++++++++++++ src/types/settings.ts | 11 +++++ 3 files changed, 140 insertions(+), 11 deletions(-) create mode 100644 src/pages/AdminCallback.tsx diff --git a/manifest.json b/manifest.json index b6feaaf..66080c2 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,13 @@ "isSingleInstall": false, "hasDevMode": true, "serveUrl": "https://apps-cdn.deskpro-service.com/__name__/__version__", - "targets": [{ "target": "user_sidebar", "entrypoint": "index.html" }], + "secrets": "9ToG2tPo8Y8J64kyYTziqVAkz9fcPybLBmC/+6s6MeUDzUvN4FtlfQpCJfLHzsRlLXPs83ZULh9BQ6XWffnGqGjO3fgeit2RBPH0v25RVaMabjCDW0CmdCOk3mUPHfwQvCHvGz5JstCXGsDSp3rwbCEWZoF5+Yply659FB5YdvGwc9fwtIabP2tlafzUbx0DSs0Q2NfX6FjstfDP6Q1xHZWUA0iteuLWULxZUOw0yYz0RSQOamGVH6FHvTdS5V54tAOyvn9vjSZD/t3Z9JBM8FlHLrS9cu/ISzn1n/0Azhlt0sIz2cwG/ESEK5a7O1/GsenaH0mNBbg1g3fTIys8+Rqc2KcSiwul6OUpliiyknqtOlyglH6/nlvjbeyO5lhbCvf+WJa0o+QdbUab5Dm7nwRHQN4zZ0q+iE/WBUiQbBiMVArzyrCE60f1O1EiZtwmufXzBTL/S4XBkZKkXjmCY2SsrkzRDYVm9tO5tIGiFxyFy+GDaEioeIddY8QN7yvP/mjXdT7wmPSFUwaRoCcDjZq9tFSG31H+tXiJcvK5PjNZSLNchxRJsm/XkyMZxXdlWJ9gN4KfRg2QJZK3xSBnn0YoEGqLR2nGNQjVw5jZoobepkAEPfRUtx5sUFOHML/71EAl9attE2lyyqHekuXJoGt98M208pVJOL5IvGNdkTQQAnll0oGF0OklOdWObJg16CQuoFp7qis9nJB81s7EXAnfpHwTxDawiioKk11UOklwu2c6Fm+RrH2WzUXtqazP3yQCLF8Z8fAkglS2ttWrRg9UU0QBzLm4mKf1PRb85fCI9a5BIOSl15zmvWzHl1DW10/jVfHX7HJs56VG6W8rora4ycjFKcBARDU8JpMlXIVJzaPl5cqi0Vi41ePsGPbauQzZ+8lLZrIMyOvXpmXoHEHgfIgEfhrxGXysQLF0H/X1ZyVR2e9nT0/WHigG5YC7XlUe9XXVcQpG/b1OO4T+26PMZqkhfqDfMVOASQP6PgRfcBR3gh4gICVgi/LGV055GhwC4jpWOZWzG1j5mp2we13DV9JgDxlVgajFPzj/7wJ4sZSEHh0qHITYBuDoU08D", + "targets": [ + { + "target": "user_sidebar", + "entrypoint": "index.html" + } + ], "entityAssociations": { "linkedPipedriveContacts": { "entity": "person", @@ -17,12 +23,21 @@ } }, "settings": { - "api_key": { - "title": "Pipedrive API Key", - "description": "The API key to use to access Pipedrive", - "type": "string", - "isRequired": true, - "isBackendOnly": true, + "use_deskpro_saas": { + "title": "One-Click Installation", + "type": "boolean", + "default": true, + "isRequired": false, + "isBackendOnly": false, + "order": 5 + }, + "use_access_token": { + "title": "Use API Key", + "type": "boolean", + "isRequired": false, + "isBackendOnly": false, + "default": false, + "condition": "settings.use_deskpro_saas != true", "order": 10 }, "instance_domain": { @@ -33,22 +48,74 @@ "isBackendOnly": false, "order": 20 }, + "api_key": { + "title": "API Key", + "description": "The API key to use to access Pipedrive", + "type": "string", + "isRequired": false, + "isBackendOnly": true, + "condition": "settings.use_deskpro_saas != true && settings.use_access_token == true", + "order": 30 + }, "verify_settings": { "title": "", "type": "app_embedded", - "options": { "entrypoint": "#/admin/verify_settings", "height": "30px" }, + "options": { + "entrypoint": "#/admin/verify_settings", + "height": "30px" + }, "isRequired": false, "isBackendOnly": true, - "order": 30 + "condition": "settings.use_deskpro_saas != true && settings.use_access_token == true", + "order": 40 + }, + "client_id": { + "title": "Client ID", + "type": "string", + "isRequired": false, + "isBackendOnly": false, + "condition": "settings.use_deskpro_saas != true && settings.use_access_token != true", + "order": 50 + }, + "client_secret": { + "title": "Client Secret", + "type": "string", + "isRequired": false, + "isBackendOnly": true, + "condition": "settings.use_deskpro_saas != true && settings.use_access_token != true", + "order": 60 + }, + "callback_url": { + "title": "Callback URL", + "type": "app_embedded", + "options": { + "entrypoint": "#/admin/callback" + }, + "isRequired": false, + "isBackendOnly": true, + "condition": "settings.use_deskpro_saas != true && settings.use_access_token != true", + "order": 70 } }, "proxy": { "whitelist": [ { "url": "https://.*.pipedrive.com/v1/.*", - "methods": ["GET", "POST", "PUT", "DELETE"], + "methods": [ + "GET", + "POST", + "PUT", + "DELETE" + ], + "timeout": 10 + }, + { + "url": "https://oauth.pipedrive.com/oauth/.*", + "methods": [ + "POST" + ], "timeout": 10 } ] } -} +} \ No newline at end of file diff --git a/src/pages/AdminCallback.tsx b/src/pages/AdminCallback.tsx new file mode 100644 index 0000000..551228e --- /dev/null +++ b/src/pages/AdminCallback.tsx @@ -0,0 +1,51 @@ +import { CopyToClipboardInput, LoadingSpinner, OAuth2Result, useInitialisedDeskproAppClient, } from "@deskpro/app-sdk"; +import { createSearchParams } from "react-router-dom"; +import { P1 } from "@deskpro/deskpro-ui"; +import { useState } from "react"; +import styled from "styled-components"; +import type { FC } from "react"; + +const Description = styled(P1)` + margin-top: 8px; + margin-bottom: 16px; + color: ${({ theme }) => theme.colors.grey80}; +`; + +const AdminCallback: FC = () => { + const [callbackUrl, setCallbackUrl] = useState(null) + + useInitialisedDeskproAppClient(async (client) => { + const oauth2 = await client.startOauth2Local( + ({ callbackUrl, state }) => { + return `https://oauth.pipedrive.com/oauth/authorize?${createSearchParams([ + ["response_type", "code"], + ["client_id", "xxx"], + ["state", state], + ["redirect_uri", callbackUrl], + ])}` + }, + /code=(?[0-9a-f]+)/, + async (): Promise => ({ data: { access_token: "", refresh_token: "" } }) + ) + + const url = new URL(oauth2.authorizationUrl); + const redirectUri = url.searchParams.get("redirect_uri") + + if (redirectUri) { + setCallbackUrl(redirectUri) + } + }) + + if (!callbackUrl) { + return () + } + + return ( + <> + + The callback URL will be required during the Pipedrive app setup + + ); +}; + +export { AdminCallback }; diff --git a/src/types/settings.ts b/src/types/settings.ts index e90e650..275e65e 100644 --- a/src/types/settings.ts +++ b/src/types/settings.ts @@ -1,4 +1,15 @@ export interface Settings { api_key?: string; instance_domain?: string; + client_id?: string, + use_deskpro_saas?: boolean, + use_access_token?: boolean, } + +export type TicketData = { + ticket: { + id: string, + subject: string, + permalinkUrl: string, + }, +} \ No newline at end of file From 6f15d1a2f35930ad70d0a45f3a39e57e69cc3a44 Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Thu, 27 Feb 2025 13:48:53 +0000 Subject: [PATCH 07/30] [Feat] Create `getAccessToken` function --- src/api/pipedrive/getAccessToken.ts | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/api/pipedrive/getAccessToken.ts diff --git a/src/api/pipedrive/getAccessToken.ts b/src/api/pipedrive/getAccessToken.ts new file mode 100644 index 0000000..4be5b23 --- /dev/null +++ b/src/api/pipedrive/getAccessToken.ts @@ -0,0 +1,33 @@ +import { IDeskproClient, proxyFetch } from "@deskpro/app-sdk"; + +export default async function getAccessToken( + client: IDeskproClient, + code: string, + callbackUrl: string +) { + try { + const fetch = await proxyFetch(client) + + const body = new URLSearchParams() + body.append('grant_type', 'authorization_code') + body.append('code', code) + body.append('redirect_uri', callbackUrl) + body.append('client_id', "__client_id__") + body.append('client_secret', "__client_secret__") + + const response = await fetch("https://oauth.pipedrive.com/oauth/token", { + method: "POST", + headers: { "Content-Type": "application/x-www-form-urlencoded" }, + body: body.toString() + }); + + if (!response.ok) { + throw new Error("Failed to fetch access token"); + } + + const data = await response.json(); + return data; + } catch (error) { + throw new Error("Error fetching access token"); + } +} From 6775985012395368f3ad971b1c46364be1ac757b Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Thu, 27 Feb 2025 13:53:28 +0000 Subject: [PATCH 08/30] [Feat] Create OAuth2 login page --- src/pages/Login/LoginPage.tsx | 32 ++++++++++ src/pages/Login/index.ts | 1 + src/pages/Login/useLogin.ts | 116 ++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 src/pages/Login/LoginPage.tsx create mode 100644 src/pages/Login/index.ts create mode 100644 src/pages/Login/useLogin.ts diff --git a/src/pages/Login/LoginPage.tsx b/src/pages/Login/LoginPage.tsx new file mode 100644 index 0000000..19815c9 --- /dev/null +++ b/src/pages/Login/LoginPage.tsx @@ -0,0 +1,32 @@ +import { AnchorButton, H3, Stack } from "@deskpro/deskpro-ui" +import { ErrorBlock } from "@/components/ErrorBlock" +import { FC } from "react" +import { useDeskproElements } from "@deskpro/app-sdk" +import useLogin from "./useLogin" + +const LoginPage: FC = () => { + useDeskproElements(({ registerElement, clearElements }) => { + clearElements() + registerElement("refresh", { type: "refresh_button" }) + }) + + const { onSignIn, authUrl, isLoading, error } = useLogin(); + + return ( + +

Log into your Pipedrive account.

+ + + {error && } +
+ ) +} + +export default LoginPage \ No newline at end of file diff --git a/src/pages/Login/index.ts b/src/pages/Login/index.ts new file mode 100644 index 0000000..f815230 --- /dev/null +++ b/src/pages/Login/index.ts @@ -0,0 +1 @@ +export { default } from "./LoginPage"; diff --git a/src/pages/Login/useLogin.ts b/src/pages/Login/useLogin.ts new file mode 100644 index 0000000..203006f --- /dev/null +++ b/src/pages/Login/useLogin.ts @@ -0,0 +1,116 @@ +import { createSearchParams, useNavigate } from "react-router-dom"; +import { getCurrentUser } from "@/api/api"; +import { OAuth2Result, useDeskproLatestAppContext, useInitialisedDeskproAppClient } from "@deskpro/app-sdk"; +import { Settings, TicketData } from "@/types/settings"; +import { useCallback, useState } from "react"; +import { useUser } from "@/context/userContext"; +import getAccessToken from "@/api/pipedrive/getAccessToken"; + +interface UseLogin { + onSignIn: () => void, + authUrl: string | null, + error: null | string, + isLoading: boolean, +}; + +export default function useLogin(): UseLogin { + const [authUrl, setAuthUrl] = useState(null) + const [error, setError] = useState(null) + const [isLoading, setIsLoading] = useState(false) + + const navigate = useNavigate() + const deskproUser = useUser(); + + const { context } = useDeskproLatestAppContext() + + useInitialisedDeskproAppClient(async (client) => { + if (context?.settings.use_deskpro_saas === undefined || !deskproUser) { + // Make sure settings have loaded. + return + } + + // Ensure they aren't using access tokens + if (context.settings.use_access_token === true) { + setError("Enable OAuth to access this page"); + return + } + + const mode = context?.settings.use_deskpro_saas ? 'global' : 'local'; + + const clientId = context?.settings.client_id; + if (mode === 'local' && typeof clientId !== 'string') { + // Local mode requires a clientId. + setError("A client ID is required"); + return + } + const oauth2 = mode === "local" ? + await client.startOauth2Local( + ({ state, callbackUrl }) => { + return `https://oauth.pipedrive.com/oauth/authorize?${createSearchParams([ + ["response_type", "code"], + ["client_id", clientId ?? ""], + ["state", state], + ["redirect_uri", callbackUrl] + ])}` + }, + /\bcode=(?[^&#]+)/, + async (code: string): Promise => { + // Extract the callback URL from the authorization URL + const url = new URL(oauth2.authorizationUrl); + const redirectUri = url.searchParams.get("redirect_uri"); + + if (!redirectUri) { + throw new Error("Failed to get callback URL"); + } + + const data = await getAccessToken(client, code, redirectUri); + + return { data } + } + ) + // Global Proxy Service + : await client.startOauth2Global("04d3430deaf75a01"); + + setAuthUrl(oauth2.authorizationUrl) + setIsLoading(false) + + try { + const result = await oauth2.poll() + + await client.setUserState("oauth2/access_token", result.data.access_token, { backend: true }) + + if (result.data.refresh_token) { + await client.setUserState("oauth2/refresh_token", result.data.refresh_token, { backend: true }) + } + + // Ensure a friendly error message is always sent to the user in case authentication fails + try { + const activeUser = await getCurrentUser(client, deskproUser?.orgName) + if (!activeUser) { + throw new Error() + } + } catch (e) { + throw new Error("Error authenticating user") + } + + const linkedContactIds = await client.getEntityAssociation("linkedPipedriveContacts", deskproUser.id).list() + + if (linkedContactIds.length < 1) { + navigate("/contacts") + } else { + navigate("/home") + } + } catch (error) { + setError(error instanceof Error ? error.message : 'Unknown error'); + setIsLoading(false); + } + }, [setAuthUrl, context?.settings.use_deskpro_saas]) + + const onSignIn = useCallback(() => { + setIsLoading(true); + window.open(authUrl ?? "", '_blank'); + }, [setIsLoading, authUrl]); + + return { authUrl, onSignIn, error, isLoading } + +} \ No newline at end of file From 7a9187f769cf7f96f8f47220e4a7d7d7f2f2da31 Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Thu, 27 Feb 2025 13:54:28 +0000 Subject: [PATCH 09/30] [Refactor] Update `pipedriveGet` to include OAuth2 auth header --- src/api/api.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/api/api.ts b/src/api/api.ts index e41a4bc..08b085a 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -36,9 +36,16 @@ const pipedriveGet = async ( pathQuery: string ) => { const pFetch = await proxyFetch(client); + const isUsingOAuth2 = (await client.getUserState("isUsingOAuth"))[0].data + const response = await pFetch( - `https://${orgName}.pipedrive.com/v1/${pathQuery}` + `https://${orgName}.pipedrive.com/v1/${pathQuery}`, + { + headers: isUsingOAuth2 ? { + Authorization: `Bearer [user[oauth2/access_token]]` + } : undefined + } ); let result; @@ -69,7 +76,7 @@ const preInstalledRequest = async ( } const res = await dpFetch( - `https://${instance_domain}.pipedrive.com/v1/${pathQuery}?api_token=${api_key}` + `https://${instance_domain}.pipedrive.com/v1/${pathQuery}?api_token=${api_key}` ); if (res.status < 200 || res.status > 399) { From b540fc81f142b7e513be4f1cb12c8172326d4164 Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Thu, 27 Feb 2025 13:54:58 +0000 Subject: [PATCH 10/30] [Feat] Create "Loading" page --- src/pages/LoadingPage.tsx | 82 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 src/pages/LoadingPage.tsx diff --git a/src/pages/LoadingPage.tsx b/src/pages/LoadingPage.tsx new file mode 100644 index 0000000..5a389fa --- /dev/null +++ b/src/pages/LoadingPage.tsx @@ -0,0 +1,82 @@ +import { FC, useState } from "react" +import { LoadingSpinner, useDeskproAppClient, useDeskproElements, useDeskproLatestAppContext, useInitialisedDeskproAppClient } from "@deskpro/app-sdk"; +import { useNavigate } from "react-router-dom"; +import { ErrorBlock } from "../components/ErrorBlock"; +import { getCurrentUser } from "../api/api"; +import { Settings, TicketData } from "../types/settings"; +import { useUser } from "../context/userContext"; + +const LoadingPage: FC = () => { + const { client } = useDeskproAppClient() + const { context } = useDeskproLatestAppContext() + + const [isAuthenticated, setIsAuthenticated] = useState(false) + const [isFetchingAuth, setIsFetchingAuth] = useState(true) + + const navigate = useNavigate() + const deskproUser = useUser(); + + // Determine authentication method from settings + const isUsingOAuth = context?.settings.use_access_token !== true + + useDeskproElements(({ registerElement, clearElements }) => { + clearElements() + registerElement("pipedriveRefreshButton", { type: "refresh_button" }) + }); + + useInitialisedDeskproAppClient((client) => { + client.setTitle("Pipedrive") + + if (!context?.settings || !deskproUser) { + return + } + + // Store the authentication method in the user state + client.setUserState("isUsingOAuth", isUsingOAuth) + + // Verify authentication status + // If OAuth2 mode and the user is logged in the request would be make with their stored access token + // If access token mode the request would be made with the access token provided in the app setup + getCurrentUser(client, deskproUser.orgName) + .then((data) => { + if (data) { + setIsAuthenticated(true) + } + }) + .catch(() => { }) + .finally(() => { + setIsFetchingAuth(false) + }) + }, [context, context?.settings]) + + if (!client || isFetchingAuth || !deskproUser) { + return () + } + + if (isAuthenticated) { + // Check for linked contacts and navigate based + // on the number of linked contacts + client.getEntityAssociation("linkedPipedriveContacts", deskproUser.id).list() + .then((linkedContactIds) => { + linkedContactIds.length < 1 ? navigate("/contacts") : + navigate("/home") + }) + .catch(() => { navigate("/contacts") }) + } else { + + if (isUsingOAuth) { + navigate("/login") + } else { + // Show error for invalid access tokens (expired or not present) + return ( +
+ +
+ ) + } + } + + return (); +} + +export default LoadingPage \ No newline at end of file From 2bd602d54ed30d647e7555d4b85ead0de744ff25 Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Thu, 27 Feb 2025 13:55:26 +0000 Subject: [PATCH 11/30] [Refactor] Update `App` routing --- src/App.tsx | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 0bd1cf5..2c71644 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,15 +1,18 @@ +import { AdminCallback } from "@/pages/AdminCallback"; +import { AppContainer } from "@/components/common"; +import { Contacts } from "@/pages/Contact"; +import { CreateActivity } from "@/pages/CreateActivity"; +import { CreateDeal } from "@/pages/CreateDeal"; +import { CreateNote } from "@/pages/CreateNote"; +import { DealDetails } from "@/pages/DealDetails"; +import { EditContact } from "@/pages/EditContact"; +import { EditDeal } from "@/pages/EditDeal"; +import { Main } from "@/pages/Main"; +import { Redirect } from "@/pages/Redirect"; import { Routes, Route, useLocation } from "react-router-dom"; -import { Contacts } from "./pages/Contact"; -import { Main } from "./pages/Main"; -import { DealDetails } from "./pages/DealDetails"; -import { CreateDeal } from "./pages/CreateDeal"; -import { CreateActivity } from "./pages/CreateActivity"; -import { CreateNote } from "./pages/CreateNote"; -import { EditDeal } from "./pages/EditDeal"; -import { EditContact } from "./pages/EditContact"; -import { Redirect } from "./pages/Redirect"; -import { VerifySettings } from "./pages/VerifySettings"; -import { AppContainer } from "./components/common"; +import { VerifySettings } from "@/pages/VerifySettings"; +import LoadingPage from "@/pages/LoadingPage"; +import LoginPage from "@/pages/Login"; const App = () => { const { pathname } = useLocation(); @@ -18,7 +21,10 @@ const App = () => { return ( - }/> + }/> + }/> + }/> + }/> }/> }/> }/> @@ -28,6 +34,7 @@ const App = () => { }/> }/> }/> + }/> ); From 7fa9ec34308c9df10319db2e6e6b27ed01b20784 Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Thu, 27 Feb 2025 14:01:42 +0000 Subject: [PATCH 12/30] [Chore] Update `/` links to `/home' --- src/api/deskpro/index.ts | 1 + src/api/deskpro/useLogout.ts | 24 ++++++++++++++++++++++++ src/components/CreateContact.tsx | 4 ++-- src/components/FindContact.tsx | 2 +- src/pages/CreateActivity.tsx | 4 ++-- src/pages/CreateDeal.tsx | 4 ++-- src/pages/CreateNote.tsx | 4 ++-- src/pages/DealDetails.tsx | 2 +- src/pages/EditContact.tsx | 4 ++-- src/pages/EditDeal.tsx | 4 ++-- src/pages/Main.tsx | 2 +- src/pages/Redirect.tsx | 2 +- 12 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 src/api/deskpro/index.ts create mode 100644 src/api/deskpro/useLogout.ts diff --git a/src/api/deskpro/index.ts b/src/api/deskpro/index.ts new file mode 100644 index 0000000..6d8c1d9 --- /dev/null +++ b/src/api/deskpro/index.ts @@ -0,0 +1 @@ +export { useLogout } from "./useLogout" \ No newline at end of file diff --git a/src/api/deskpro/useLogout.ts b/src/api/deskpro/useLogout.ts new file mode 100644 index 0000000..425880f --- /dev/null +++ b/src/api/deskpro/useLogout.ts @@ -0,0 +1,24 @@ +import { useCallback } from "react"; +import { useDeskproAppClient } from "@deskpro/app-sdk"; +import { useNavigate } from "react-router-dom"; + +export function useLogout() { + const navigate = useNavigate(); + const { client } = useDeskproAppClient(); + + const logoutActiveUser = useCallback(() => { + if (!client) { + return; + } + + client.setBadgeCount(0) + + client.deleteUserState("oauth2/access_token") + .catch(() => { }) + .finally(() => { + navigate("/login"); + }); + }, [client, navigate]); + + return { logoutActiveUser }; +} \ No newline at end of file diff --git a/src/components/CreateContact.tsx b/src/components/CreateContact.tsx index 7e717c2..d6828da 100644 --- a/src/components/CreateContact.tsx +++ b/src/components/CreateContact.tsx @@ -68,7 +68,7 @@ export const CreateContact = () => { ?.getEntityAssociation("linkedPipedriveContacts", dpUser.id) .set(response.data.id.toString()) ) - .then(() => navigate("/")) + .then(() => navigate("/home")) .catch((err) => setError(err?.data?.error || "Error creating contact")); }; @@ -140,7 +140,7 @@ export const CreateContact = () => { type="button" text="Cancel" intent="secondary" - onClick={() => navigate("/")} + onClick={() => navigate("/home")} /> diff --git a/src/components/FindContact.tsx b/src/components/FindContact.tsx index 7a118fc..5fa8b21 100644 --- a/src/components/FindContact.tsx +++ b/src/components/FindContact.tsx @@ -76,7 +76,7 @@ export const FindContact = () => { await client ?.getEntityAssociation("linkedPipedriveContacts", deskproUser.id) .set(selectedContact); - navigate("/"); + navigate("/home"); }; return ( diff --git a/src/pages/CreateActivity.tsx b/src/pages/CreateActivity.tsx index d367ec1..f470016 100644 --- a/src/pages/CreateActivity.tsx +++ b/src/pages/CreateActivity.tsx @@ -92,7 +92,7 @@ export const CreateActivity = () => { return; } - navigate("/"); + navigate("/home"); }; useInitialisedDeskproAppClient((client) => { @@ -118,7 +118,7 @@ export const CreateActivity = () => { onElementEvent(id) { switch (id) { case "pipedriveHomeButton": { - navigate("/redirect"); + navigate("/home"); break; } } diff --git a/src/pages/CreateDeal.tsx b/src/pages/CreateDeal.tsx index c76d81f..17de87f 100644 --- a/src/pages/CreateDeal.tsx +++ b/src/pages/CreateDeal.tsx @@ -132,7 +132,7 @@ export const CreateDeal = () => { onElementEvent(id) { switch (id) { case "pipedriveHomeButton": { - navigate("/redirect"); + navigate("/home"); break; } } @@ -169,7 +169,7 @@ export const CreateDeal = () => { return; } - navigate("/"); + navigate("/home"); }; return ( diff --git a/src/pages/CreateNote.tsx b/src/pages/CreateNote.tsx index d84cd00..570af11 100644 --- a/src/pages/CreateNote.tsx +++ b/src/pages/CreateNote.tsx @@ -62,7 +62,7 @@ export const CreateNote = () => { onElementEvent(id) { switch (id) { case "pipedriveHomeButton": { - navigate("/redirect"); + navigate("/home"); break; } } @@ -78,7 +78,7 @@ export const CreateNote = () => { await createNote(client, deskproUser.orgName, image, note, contactId); - navigate("/"); + navigate("/home"); }; return ( diff --git a/src/pages/DealDetails.tsx b/src/pages/DealDetails.tsx index dd2f77b..6b3ceb4 100644 --- a/src/pages/DealDetails.tsx +++ b/src/pages/DealDetails.tsx @@ -79,7 +79,7 @@ export const DealDetails = () => { onElementEvent(id) { switch (id) { case "pipedriveHomeButton": { - navigate("/redirect"); + navigate("/home"); break; } case "pipedriveEditButton": { diff --git a/src/pages/EditContact.tsx b/src/pages/EditContact.tsx index e85a5bb..dfe53a9 100644 --- a/src/pages/EditContact.tsx +++ b/src/pages/EditContact.tsx @@ -99,7 +99,7 @@ export const EditContact = () => { onElementEvent(id) { switch (id) { case "pipedriveHomeButton": { - navigate("/redirect"); + navigate("/home"); break; } } @@ -129,7 +129,7 @@ export const EditContact = () => { setError(null); return editContact(client, deskproUser?.orgName, pipedriveContact, contactId) - .then(() => navigate("/")) + .then(() => navigate("/home")) .catch((err) => setError(err?.data?.error || "Error creating contact")); }; diff --git a/src/pages/EditDeal.tsx b/src/pages/EditDeal.tsx index 3eaef15..f0cdee1 100644 --- a/src/pages/EditDeal.tsx +++ b/src/pages/EditDeal.tsx @@ -112,7 +112,7 @@ export const EditDeal = () => { onElementEvent(id) { switch (id) { case "pipedriveHomeButton": { - navigate("/redirect"); + navigate("/home"); break; } } @@ -164,7 +164,7 @@ export const EditDeal = () => { return; } - navigate("/"); + navigate("/home"); }; return ( diff --git a/src/pages/Main.tsx b/src/pages/Main.tsx index 79f26bf..cb6ed3a 100644 --- a/src/pages/Main.tsx +++ b/src/pages/Main.tsx @@ -132,7 +132,7 @@ export const Main = () => { onElementEvent(id) { switch (id) { case "pipedriveHomeButton": { - navigate("/redirect"); + navigate("/home"); break; } case "pipedriveEditButton": { diff --git a/src/pages/Redirect.tsx b/src/pages/Redirect.tsx index 6e03e61..aa7dde8 100644 --- a/src/pages/Redirect.tsx +++ b/src/pages/Redirect.tsx @@ -4,7 +4,7 @@ import { useNavigate } from "react-router-dom"; export const Redirect = () => { const navigate = useNavigate(); useEffect(() => { - navigate("/"); + navigate("/home"); }); return
; From 819df2c6c85a42235dec4f584743aa30c68f13e9 Mon Sep 17 00:00:00 2001 From: OJ Abba Date: Thu, 27 Feb 2025 14:09:11 +0000 Subject: [PATCH 13/30] [Chore] Kill the `Redirect` component --- src/App.tsx | 2 -- src/pages/CreateActivity.tsx | 2 +- src/pages/CreateDeal.tsx | 2 +- src/pages/CreateNote.tsx | 2 +- src/pages/EditContact.tsx | 2 +- src/pages/Redirect.tsx | 11 ----------- 6 files changed, 4 insertions(+), 17 deletions(-) delete mode 100644 src/pages/Redirect.tsx diff --git a/src/App.tsx b/src/App.tsx index 2c71644..3660c46 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,7 +8,6 @@ import { DealDetails } from "@/pages/DealDetails"; import { EditContact } from "@/pages/EditContact"; import { EditDeal } from "@/pages/EditDeal"; import { Main } from "@/pages/Main"; -import { Redirect } from "@/pages/Redirect"; import { Routes, Route, useLocation } from "react-router-dom"; import { VerifySettings } from "@/pages/VerifySettings"; import LoadingPage from "@/pages/LoadingPage"; @@ -27,7 +26,6 @@ const App = () => { }/> }/> }/> - }/> }/> }/> }/> diff --git a/src/pages/CreateActivity.tsx b/src/pages/CreateActivity.tsx index f470016..527d687 100644 --- a/src/pages/CreateActivity.tsx +++ b/src/pages/CreateActivity.tsx @@ -267,7 +267,7 @@ export const CreateActivity = () => {