diff --git a/package.json b/package.json index d1b6ccba..29bd756c 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "downloadWSDL": "tsx ./scripts/downloadWSDL.mts", "clean": "rimraf dist", "build": "tsup-node", - "test": "vitest --watch=false", + "test": "vitest", "test:ci": "vitest --watch=false --reporter=basic --reporter=junit --outputFile.junit=junit.xml --coverage.enabled", "typecheck": "tsc --noEmit" }, @@ -92,32 +92,28 @@ "devDependencies": { "@types/debug": "^4.1.12", "@types/invariant": "^2.2.37", - "@types/node": "^18.19.33", + "@types/node": "^18.19.34", "@types/proper-lockfile": "^4.1.4", - "@types/ramda": "^0.28.25", - "@types/tar": "^6.1.13", "@vitest/coverage-v8": "^1.6.0", "dotenv": "^16.4.5", "nock": "^13.5.4", - "prettier": "^3.3.0", + "prettier": "^3.3.1", "rimraf": "^5.0.7", "tsup": "^8.1.0", - "tsx": "^4.11.2", + "tsx": "^4.13.2", "typescript": "^5.4.5", "vitest": "^1.6.0" }, "dependencies": { "@date-fns/utc": "^1.2.0", - "@types/sax": "^1.2.7", "axios": "^1.7.2", "date-fns": "^3.6.0", "debug": "^4.3.5", "invariant": "^2.2.4", - "mkdirp": "^3.0.1", "proper-lockfile": "^4.1.2", - "ramda": "~0.28.0", + "remeda": "^2.0.5", "soap": "^1.0.3", - "tar": "^6.2.1" + "tar": "^7.2.0" }, - "packageManager": "pnpm@9.1.4" + "packageManager": "pnpm@9.2.0+sha256.94fab213df221c55b6956b14a2264c21c6203cca9f0b3b95ff2fe9b84b120390" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 19311c3b..33582bcf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,9 +11,6 @@ importers: '@date-fns/utc': specifier: ^1.2.0 version: 1.2.0 - '@types/sax': - specifier: ^1.2.7 - version: 1.2.7 axios: specifier: ^1.7.2 version: 1.7.2(debug@4.3.5) @@ -26,21 +23,18 @@ importers: invariant: specifier: ^2.2.4 version: 2.2.4 - mkdirp: - specifier: ^3.0.1 - version: 3.0.1 proper-lockfile: specifier: ^4.1.2 version: 4.1.2 - ramda: - specifier: ~0.28.0 - version: 0.28.0 + remeda: + specifier: ^2.0.5 + version: 2.0.5 soap: specifier: ^1.0.3 version: 1.0.3 tar: - specifier: ^6.2.1 - version: 6.2.1 + specifier: ^7.2.0 + version: 7.2.0 devDependencies: '@types/debug': specifier: ^4.1.12 @@ -49,20 +43,14 @@ importers: specifier: ^2.2.37 version: 2.2.37 '@types/node': - specifier: ^18.19.33 - version: 18.19.33 + specifier: ^18.19.34 + version: 18.19.34 '@types/proper-lockfile': specifier: ^4.1.4 version: 4.1.4 - '@types/ramda': - specifier: ^0.28.25 - version: 0.28.25 - '@types/tar': - specifier: ^6.1.13 - version: 6.1.13 '@vitest/coverage-v8': specifier: ^1.6.0 - version: 1.6.0(vitest@1.6.0(@types/node@18.19.33)) + version: 1.6.0(vitest@1.6.0(@types/node@18.19.34)) dotenv: specifier: ^16.4.5 version: 16.4.5 @@ -70,8 +58,8 @@ importers: specifier: ^13.5.4 version: 13.5.4 prettier: - specifier: ^3.3.0 - version: 3.3.0 + specifier: ^3.3.1 + version: 3.3.1 rimraf: specifier: ^5.0.7 version: 5.0.7 @@ -79,14 +67,14 @@ importers: specifier: ^8.1.0 version: 8.1.0(postcss@8.4.38)(typescript@5.4.5) tsx: - specifier: ^4.11.2 - version: 4.11.2 + specifier: ^4.13.2 + version: 4.13.2 typescript: specifier: ^5.4.5 version: 5.4.5 vitest: specifier: ^1.6.0 - version: 1.6.0(@types/node@18.19.33) + version: 1.6.0(@types/node@18.19.34) packages: @@ -397,6 +385,10 @@ packages: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + '@istanbuljs/schema@0.1.3': resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} @@ -534,24 +526,15 @@ packages: '@types/ms@0.7.34': resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} - '@types/node@18.19.33': - resolution: {integrity: sha512-NR9+KrpSajr2qBVp/Yt5TU/rp+b5Mayi3+OlMlcg2cVCfRmcG5PWZ7S4+MG9PZ5gWBoc9Pd0BKSRViuBCRPu0A==} + '@types/node@18.19.34': + resolution: {integrity: sha512-eXF4pfBNV5DAMKGbI02NnDtWrQ40hAN558/2vvS4gMpMIxaf6JmD7YjnZbq0Q9TDSSkKBamime8ewRoomHdt4g==} '@types/proper-lockfile@4.1.4': resolution: {integrity: sha512-uo2ABllncSqg9F1D4nugVl9v93RmjxF6LJzQLMLDdPaXCUIDPeOJ21Gbqi43xNKzBi/WQ0Q0dICqufzQbMjipQ==} - '@types/ramda@0.28.25': - resolution: {integrity: sha512-HrQNqQAGcITpn9HAJFamDxm7iZeeXiP/95pN5OMbNniDjzCCeOHbBKNGmUy8NRi0fhYS+/cXeo91MFC+06gbow==} - '@types/retry@0.12.5': resolution: {integrity: sha512-3xSjTp3v03X/lSQLkczaN9UIEwJMoMCA1+Nb5HfbJEQWogdeQIyVtTvxPXDQjZ5zws8rFQfVfRdz03ARihPJgw==} - '@types/sax@1.2.7': - resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} - - '@types/tar@6.1.13': - resolution: {integrity: sha512-IznnlmU5f4WcGTh2ltRu/Ijpmk8wiWXfF0VA4s+HPjHZgvFggk1YaIkbo5krX/zUCzWF8N/l4+W/LNxnvAJ8nw==} - '@vitest/coverage-v8@1.6.0': resolution: {integrity: sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==} peerDependencies: @@ -669,9 +652,9 @@ packages: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} @@ -800,10 +783,6 @@ packages: formidable@3.5.1: resolution: {integrity: sha512-WJWKelbRHN41m5dumb0/k8TeAx7Id/y3a+Z7QfhxP/htI9Js5zYaEDtG8uMgG0vM0lOlqnmjE99/kfpOYi/0Og==} - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -1025,30 +1004,13 @@ packages: resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} engines: {node: '>=16 || 14 >=14.17'} - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@4.2.8: - resolution: {integrity: sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true + minizlib@3.0.1: + resolution: {integrity: sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==} + engines: {node: '>= 18'} mkdirp@3.0.1: resolution: {integrity: sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==} @@ -1160,8 +1122,8 @@ packages: resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} engines: {node: ^10 || ^12 || >=14} - prettier@3.3.0: - resolution: {integrity: sha512-J9odKxERhCQ10OC2yb93583f6UnYutOeiV5i0zEDS7UGTdUt0u+y8erxl3lBKvwo/JHyyoEdXjwp4dke9oyZ/g==} + prettier@3.3.1: + resolution: {integrity: sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==} engines: {node: '>=14'} hasBin: true @@ -1186,9 +1148,6 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - ramda@0.28.0: - resolution: {integrity: sha512-9QnLuG/kPVgWvMQ4aODhsBUFKOUmnbUnsSXACv+NCQZcHbeb+v8Lodp8OVxtRULN1/xOyYLLaL6npE6dMq5QTA==} - react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} @@ -1196,6 +1155,9 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + remeda@2.0.5: + resolution: {integrity: sha512-2+6w6XBjWk0Lysfss4QFo4LKjQ1SAW0wIEjQfp2MJjBs6BbiGQKzNli1xmUk/bHK7CBCdPS1KqjrWojgdruv0A==} + resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} @@ -1312,9 +1274,9 @@ packages: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} + tar@7.2.0: + resolution: {integrity: sha512-hctwP0Nb4AB60bj8WQgRYaMOuJYRAPMGiQUAotms5igN8ppfQM+IvjQ5HcKu1MaZh2Wy2KWVTe563Yj8dfc14w==} + engines: {node: '>=18'} test-exclude@6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} @@ -1356,9 +1318,6 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - ts-toolbelt@6.15.5: - resolution: {integrity: sha512-FZIXf1ksVyLcfr7M317jbB67XFJhOO1YqdTcuGaq9q5jLUoTikukZ+98TPjKiP2jC5CgmYdWWYs0s2nLSU0/1A==} - tsup@8.1.0: resolution: {integrity: sha512-UFdfCAXukax+U6KzeTNO2kAARHcWxmKsnvSPXUcfA1D+kU05XDccCrkffCQpFaWDsZfV0jMyTsxU39VfCp6EOg==} engines: {node: '>=18'} @@ -1378,8 +1337,8 @@ packages: typescript: optional: true - tsx@4.11.2: - resolution: {integrity: sha512-V5DL5v1BuItjsQ2FN9+4OjR7n5cr8hSgN+VGmm/fd2/0cgQdBIWHcQ3bFYm/5ZTmyxkTDBUIaRuW2divgfPe0A==} + tsx@4.13.2: + resolution: {integrity: sha512-s+WGqChkA77uU8xij1IdO9jQnwJAiWJto0bF5yJLbAZpLtNs82Qa5CwMBxWjJ7QOYU9MzBf4MCNt6lZduwkQ+g==} engines: {node: '>=18.0.0'} hasBin: true @@ -1387,6 +1346,10 @@ packages: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} + type-fest@4.20.0: + resolution: {integrity: sha512-MBh+PHUHHisjXf4tlx0CFWoMdjx8zCMLJHOjnV1prABYZFHqtFOyauCIK2/7w4oIfwkF8iNhLtnJEfVY2vn3iw==} + engines: {node: '>=16'} + typescript@5.4.5: resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} engines: {node: '>=14.17'} @@ -1499,8 +1462,9 @@ packages: resolution: {integrity: sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw==} engines: {node: '>=0.6.0'} - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} yaml@2.4.3: resolution: {integrity: sha512-sntgmxj8o7DE7g/Qi60cqpLBA3HG3STcDA0kO+WfB05jEKhZMbY7umNm2rBpQvsmZ16/lPXCJGW2672dgOUkrg==} @@ -1683,6 +1647,10 @@ snapshots: wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.2 + '@istanbuljs/schema@0.1.3': {} '@jest/schemas@29.6.3': @@ -1781,7 +1749,7 @@ snapshots: '@types/ms@0.7.34': {} - '@types/node@18.19.33': + '@types/node@18.19.34': dependencies: undici-types: 5.26.5 @@ -1789,22 +1757,9 @@ snapshots: dependencies: '@types/retry': 0.12.5 - '@types/ramda@0.28.25': - dependencies: - ts-toolbelt: 6.15.5 - '@types/retry@0.12.5': {} - '@types/sax@1.2.7': - dependencies: - '@types/node': 18.19.33 - - '@types/tar@6.1.13': - dependencies: - '@types/node': 18.19.33 - minipass: 4.2.8 - - '@vitest/coverage-v8@1.6.0(vitest@1.6.0(@types/node@18.19.33))': + '@vitest/coverage-v8@1.6.0(vitest@1.6.0(@types/node@18.19.34))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -1819,7 +1774,7 @@ snapshots: std-env: 3.7.0 strip-literal: 2.1.0 test-exclude: 6.0.0 - vitest: 1.6.0(@types/node@18.19.33) + vitest: 1.6.0(@types/node@18.19.34) transitivePeerDependencies: - supports-color @@ -1952,7 +1907,7 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - chownr@2.0.0: {} + chownr@3.0.0: {} color-convert@2.0.1: dependencies: @@ -2131,10 +2086,6 @@ snapshots: hexoid: 1.0.0 once: 1.4.0 - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - fs.realpath@1.0.0: {} fsevents@2.3.3: @@ -2330,22 +2281,12 @@ snapshots: dependencies: brace-expansion: 2.0.1 - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@4.2.8: {} - - minipass@5.0.0: {} - minipass@7.1.2: {} - minizlib@2.1.2: + minizlib@3.0.1: dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} + minipass: 7.1.2 + rimraf: 5.0.7 mkdirp@3.0.1: {} @@ -2444,7 +2385,7 @@ snapshots: picocolors: 1.0.1 source-map-js: 1.2.0 - prettier@3.3.0: {} + prettier@3.3.1: {} pretty-format@29.7.0: dependencies: @@ -2466,14 +2407,16 @@ snapshots: queue-microtask@1.2.3: {} - ramda@0.28.0: {} - react-is@18.3.1: {} readdirp@3.6.0: dependencies: picomatch: 2.3.1 + remeda@2.0.5: + dependencies: + type-fest: 4.20.0 + resolve-from@5.0.0: {} resolve-pkg-maps@1.0.0: {} @@ -2600,14 +2543,14 @@ snapshots: dependencies: has-flag: 4.0.0 - tar@6.2.1: + tar@7.2.0: dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.2 + minizlib: 3.0.1 + mkdirp: 3.0.1 + yallist: 5.0.0 test-exclude@6.0.0: dependencies: @@ -2643,8 +2586,6 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-toolbelt@6.15.5: {} - tsup@8.1.0(postcss@8.4.38)(typescript@5.4.5): dependencies: bundle-require: 4.2.1(esbuild@0.21.4) @@ -2668,7 +2609,7 @@ snapshots: - supports-color - ts-node - tsx@4.11.2: + tsx@4.13.2: dependencies: esbuild: 0.20.2 get-tsconfig: 4.7.5 @@ -2677,6 +2618,8 @@ snapshots: type-detect@4.0.8: {} + type-fest@4.20.0: {} + typescript@5.4.5: {} ufo@1.5.3: {} @@ -2685,13 +2628,13 @@ snapshots: uuid@8.3.2: {} - vite-node@1.6.0(@types/node@18.19.33): + vite-node@1.6.0(@types/node@18.19.34): dependencies: cac: 6.7.14 debug: 4.3.5 pathe: 1.1.2 picocolors: 1.0.1 - vite: 5.2.12(@types/node@18.19.33) + vite: 5.2.12(@types/node@18.19.34) transitivePeerDependencies: - '@types/node' - less @@ -2702,16 +2645,16 @@ snapshots: - supports-color - terser - vite@5.2.12(@types/node@18.19.33): + vite@5.2.12(@types/node@18.19.34): dependencies: esbuild: 0.20.2 postcss: 8.4.38 rollup: 4.18.0 optionalDependencies: - '@types/node': 18.19.33 + '@types/node': 18.19.34 fsevents: 2.3.3 - vitest@1.6.0(@types/node@18.19.33): + vitest@1.6.0(@types/node@18.19.34): dependencies: '@vitest/expect': 1.6.0 '@vitest/runner': 1.6.0 @@ -2730,11 +2673,11 @@ snapshots: strip-literal: 2.1.0 tinybench: 2.8.0 tinypool: 0.8.4 - vite: 5.2.12(@types/node@18.19.33) - vite-node: 1.6.0(@types/node@18.19.33) + vite: 5.2.12(@types/node@18.19.34) + vite-node: 1.6.0(@types/node@18.19.34) why-is-node-running: 2.2.2 optionalDependencies: - '@types/node': 18.19.33 + '@types/node': 18.19.34 transitivePeerDependencies: - less - lightningcss @@ -2784,7 +2727,7 @@ snapshots: xpath@0.0.32: {} - yallist@4.0.0: {} + yallist@5.0.0: {} yaml@2.4.3: {} diff --git a/src/utils/fs.ts b/src/utils/fs.ts index ad459561..407bfc84 100644 --- a/src/utils/fs.ts +++ b/src/utils/fs.ts @@ -1,10 +1,6 @@ -import fs, { type Stats } from 'fs'; -import { mkdirp } from 'mkdirp'; -import { promisify } from 'util'; +import * as fs from 'fs/promises'; import d from './debug'; const debug = d('dir-exists'); -const stat = promisify(fs.stat); -const access = promisify(fs.access); export async function dirExists( path: string, @@ -14,25 +10,23 @@ export async function dirExists( }, ): Promise { debug( - 'Testing if directory %s is readable %s...', - path, - writable ? 'and writable ' : '', + `Testing if directory ${path} is readable ${writable ? 'and writable ' : ''}...`, ); try { - const stats: Stats = await stat(path); + const stats = await fs.stat(path); if (!stats.isDirectory()) { // Directory does not exists return false; } // Check that the directory is writable and readable - await access( + await fs.access( path, (writable ? fs.constants.W_OK : 0) | (readable ? fs.constants.R_OK : 0), ); - debug('Directory %s is accessible'); + debug(`Directory ${path} is accessible`); return true; } catch (err) { @@ -42,5 +36,5 @@ export async function dirExists( export async function createDir(path: string): Promise { debug('Creating directory %s ...', path); - await mkdirp(path); + await fs.mkdir(path, { recursive: true }); } diff --git a/src/utils/instrumentation/index.ts b/src/utils/instrumentation/index.ts index a8e51e7b..771018ff 100644 --- a/src/utils/instrumentation/index.ts +++ b/src/utils/instrumentation/index.ts @@ -1,7 +1,7 @@ // import withLog from './withLog'; import { SoapOptions } from '../../soap'; import { withLog } from './withLog'; -import { compose } from 'ramda'; +import { pipe } from 'remeda'; type SoapQuery = ( input?: Input, @@ -20,5 +20,5 @@ export function instrument({ query: string; }) { return (fn: SoapQuery) => - compose(withLog(`${service}:${query}`))(fn); + pipe(fn, withLog(`${service}:${query}`)); } diff --git a/src/utils/instrumentation/withLog.ts b/src/utils/instrumentation/withLog.ts index d58794f6..1d69e29e 100644 --- a/src/utils/instrumentation/withLog.ts +++ b/src/utils/instrumentation/withLog.ts @@ -1,4 +1,4 @@ -import { Instrumentor } from './'; +import type { Instrumentor } from './'; import d from '../debug'; export function withLog( @@ -6,7 +6,7 @@ export function withLog( ): Instrumentor { const debug = d(namespace); - return fn => (values, options) => { + return (fn) => (values, options) => { if (values) { debug('Called with input %o', values); } else { @@ -14,11 +14,11 @@ export function withLog( } return fn(values, options).then( - res => { + (res) => { debug('Succeded'); return res; }, - err => { + (err) => { debug('Failed'); return Promise.reject(err); }, diff --git a/src/utils/transformers/serializer.ts b/src/utils/transformers/serializer.ts index 9f593fcb..e8383421 100644 --- a/src/utils/transformers/serializer.ts +++ b/src/utils/transformers/serializer.ts @@ -1,15 +1,15 @@ import { types } from './types'; -import { compose, identity, evolve, map } from 'ramda'; +import { piped, identity, evolve, map } from 'remeda'; export function prepareSerializer(schema: any): (input: T) => T { const transformer = prepareTransformer(schema); - return compose( + return piped( + reorderKeys(schema), + transformer ? evolve(transformer) : identity, // (obj) => { // console.log(JSON.stringify(obj, null, 2)); // return obj; // }, - transformer ? evolve(transformer) : identity, - reorderKeys(schema), ) as any as (input: T) => T; } @@ -51,7 +51,10 @@ function prepareTransformer(schema: Schema): null | Transformer { } else if (typeof schema[curr] === 'object') { const subItem = prepareTransformer(schema[curr] as Schema); if (subItem) { - return { ...prev, [key]: isArray ? map(evolve(subItem)) : subItem }; + return { + ...prev, + [key]: isArray ? map(evolve(subItem)) : subItem, + }; } } diff --git a/src/utils/xsd/downloadFile.ts b/src/utils/xsd/downloadFile.ts index 489ac3ee..0ca2196c 100644 --- a/src/utils/xsd/downloadFile.ts +++ b/src/utils/xsd/downloadFile.ts @@ -2,7 +2,7 @@ import { getFileUrl } from '../../config'; import { B2BFlavour } from '../../constants'; import { Security } from '../../security'; import axios from 'axios'; -import tar from 'tar'; +import { extract } from 'tar'; import d from '../debug'; const debug = d('wsdl-downloader'); import { createAxiosConfig } from './createAxiosConfig'; @@ -36,7 +36,7 @@ export async function downloadFile( }); res.data - .pipe(tar.x({ cwd: outputDir })) + .pipe(extract({ cwd: outputDir })) .on('error', reject) .on('close', () => { debug('Downloaded and extracted WSDL files'); diff --git a/src/utils/xsd/lockfile.test.ts b/src/utils/xsd/lockfile.test.ts index e2c1f550..2749cc97 100644 --- a/src/utils/xsd/lockfile.test.ts +++ b/src/utils/xsd/lockfile.test.ts @@ -31,7 +31,7 @@ test('should prevent concurrent downloads', async () => { const scope = nock(root.origin) .get(/.*/) .once() - .delayBody(2000) + .delayBody(500) .reply(200, fs.readFileSync(TEST_FILE)); const soap = nock(root.origin) @@ -69,13 +69,12 @@ test('should prevent concurrent downloads', async () => { XSD_PATH: OUTPUT_DIR, }), - // We add a delay to prevent exact concurrency - delay(500).then(() => - download({ - security: undefined as any, - flavour, - XSD_PATH: OUTPUT_DIR, - }), - ), + download({ + security: undefined as any, + flavour, + XSD_PATH: OUTPUT_DIR, + }), ]); + + scope.isDone(); }); diff --git a/vitest.config.ts b/vitest.config.ts index 06d9bc6b..36b5c4a0 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -4,5 +4,8 @@ export default defineConfig({ test: { // NM B2B can be slow sometimes, set test timeout to 20s testTimeout: 20000, + coverage: { + include: ['src/**/*'], + }, }, });