diff --git a/package-lock.json b/package-lock.json index 2c35abb8..0881427e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2697,9 +2697,9 @@ "license": "MIT" }, "node_modules/@iconify/utils": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-3.1.5.tgz", - "integrity": "sha512-nT+AWyh5caHY6xa0PdLXpUooIz6l7qsT+adqsCTYBfbdn5Q18VrWs2fvuTa7KEoJnPBfEPqWkmAIht0EHtCi2A==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-3.1.7.tgz", + "integrity": "sha512-JZHlwdID+dy+lTgbYC8NEC4zeugqeYsc6jewvzb4c58kHauJn+X7rNwQjxz5p2qSjqaEeQoLkCIQ9v/H4PK0/w==", "dev": true, "license": "MIT", "dependencies": { @@ -3333,13 +3333,13 @@ } }, "node_modules/@rolldown/plugin-babel": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/plugin-babel/-/plugin-babel-0.2.3.tgz", - "integrity": "sha512-+zEk16yGlz1F9STiRr6uG9hmIXb6nprjLczV/htGptYuLoCuxb+itZ03RKCEeOhBpDDd1NU7qF6x1VLMUp62bw==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@rolldown/plugin-babel/-/plugin-babel-0.2.4.tgz", + "integrity": "sha512-ygmm2j/mN+aCvstHo0x3IOu4uc6LqXT9SJ3q4kpfG/+Yhfz0B+E47FITcC0FljZADwUFARP6E2kiE+Lc26D8wg==", "dev": true, "license": "MIT", "dependencies": { - "picomatch": "^4.0.4" + "picomatch": "^4.0.7" }, "engines": { "node": ">=22.12.0 || ^24.0.0" @@ -4342,9 +4342,9 @@ } }, "node_modules/ast-v8-to-istanbul": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.5.tgz", - "integrity": "sha512-UPAgKJFSEGMWSDr3LX4tqnAb4f7KGT8O40Tyx8wbYmmZ/yn58lNCm8h3svs3eXgiGd5AXxz8NDOvXWvicq+rJA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.6.tgz", + "integrity": "sha512-fvpl29helSO2w/z7utIbrkNXILdrLwDwAMH2I/zPKlGf5244+gf+B4cyS1sANcrPY2h+hWCGSgC8N61s/+AF9A==", "devOptional": true, "license": "MIT", "dependencies": { @@ -4490,9 +4490,9 @@ } }, "node_modules/bidi-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz", - "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.1.0.tgz", + "integrity": "sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg==", "devOptional": true, "license": "MIT", "dependencies": { @@ -5234,9 +5234,9 @@ "license": "MIT" }, "node_modules/dompurify": { - "version": "3.4.14", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.14.tgz", - "integrity": "sha512-dVoH9z+MY+C9IilgGCk3YfFqjLi3fChm2OiKJMzh6axrJ5qwxqWaZamgmHrpv22CN/KdbZJuGEGgfQoL00LTdg==", + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.15.tgz", + "integrity": "sha512-EUBjM+B+lkDE41iE82DDSCfkoPGfXx8IxFxPMjNzm/Uk4xDet77rTN9wqlxlVg71kK7XGuUMv6wUxJUwwv+Xyw==", "license": "(MPL-2.0 OR Apache-2.0)", "optionalDependencies": { "@types/trusted-types": "^2.0.7" @@ -8515,9 +8515,9 @@ "license": "MIT" }, "node_modules/n3": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/n3/-/n3-2.7.4.tgz", - "integrity": "sha512-9AStGlqDyV4h6v0Mj+5PcIO+u2fILBfEfmL/JAUsSSY/EpkskH0lCXOES1yM4kFF4ThUPWnlruMTRlJbzJZX6g==", + "version": "2.7.12", + "resolved": "https://registry.npmjs.org/n3/-/n3-2.7.12.tgz", + "integrity": "sha512-Hy6dfGg9yniLQpSBirvH2E2yO3EG7dSmA3aefRbtO411oqtzG8roD3h1kTc/N065bivCOPfTFIjf0KlwW7KlnQ==", "license": "MIT", "dependencies": { "buffer": "^6.0.3", @@ -9299,13 +9299,13 @@ } }, "node_modules/pkg-types": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.2.tgz", - "integrity": "sha512-v0sVXzj7oPGysr543YYZLYbcJNJsKikSsp/fFzoxQ12ewY3ZZr7oCPC8y7OlmxfYB3QPvriXmuPD8KZggE1vqg==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.3.tgz", + "integrity": "sha512-j/lCFdcppV0JxWpCEITdbDltBxPP6cHT+yNJ6Go2OgoSA9518X847X9z0p6LtA4Nc16+eQzCZjRrWanTGvHJ5w==", "dev": true, "license": "MIT", "dependencies": { - "confbox": "^0.3.0", + "confbox": "^0.3.1", "exsolve": "^1.1.1", "pathe": "^2.0.3" } @@ -10846,22 +10846,22 @@ } }, "node_modules/tldts": { - "version": "7.4.11", - "resolved": "https://registry.npmjs.org/tldts/-/tldts-7.4.11.tgz", - "integrity": "sha512-aBiNayCfTQxuIJBm06M+xR14cYaYlDlSXZbgsnKzKNxDKUVq7KFwTjwBSsb7m9Y5xO8WfPnBc63WaYFMTGlvqw==", + "version": "7.4.12", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-7.4.12.tgz", + "integrity": "sha512-WylhSDKVeYnWXL3a+vKTaOxjnOeEGw938hImY8zoRWJjRRK/Jp1K+IihBzIONpUmW4e3WmXT6q5FW6vlESVZCA==", "devOptional": true, "license": "MIT", "dependencies": { - "tldts-core": "^7.4.11" + "tldts-core": "^7.4.12" }, "bin": { "tldts": "bin/cli.js" } }, "node_modules/tldts-core": { - "version": "7.4.11", - "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.4.11.tgz", - "integrity": "sha512-CW3WN2rIIE/Of21mulhgnGOwoDyEFNygyIBOONSdyAuSATgMMUCpLeUlB+E8sAwA5xRV9hYPl+kyZ9citHCaKg==", + "version": "7.4.12", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.4.12.tgz", + "integrity": "sha512-nYNzS2WRf4QJmjzFFgAxLOBjyBxAGRbCy9PVBPaglcYyYajh40VBn+v5Ngr96ZMc7oM0+aCJdtQnNejvdBnXMQ==", "devOptional": true, "license": "MIT" }, diff --git a/src/utils/webIdUtils.ts b/src/utils/webIdUtils.ts index a961dcb5..9da4645c 100644 --- a/src/utils/webIdUtils.ts +++ b/src/utils/webIdUtils.ts @@ -13,16 +13,6 @@ export async function loadProfileFromURI ( uri: NamedNode ): Promise { try { - const pod = uri.site().uri - // TODO: This is a hack - we cannot assume that the profile is at this document, but we will live with it for now - const webId = sym(`${pod}${DEFAULT_PROFILE_PATH}`) - try { - await store.fetcher.load(webId) - return webId - } catch (err) { - // ignore any failure and continue fallback lookup - } - // we try a prefixed pod structure try { const uriUrl = new URL(uri.uri) @@ -33,6 +23,10 @@ export async function loadProfileFromURI ( await store.fetcher.load(derivedWebId) return derivedWebId } + + const rootWebId = sym(`${uriUrl.origin}/profile/card#me`) + await store.fetcher.load(rootWebId) + return rootWebId } catch (err) { // ignore any failure and continue fallback lookup } @@ -71,17 +65,6 @@ export function isWebIdUri (uri: NamedNode): boolean { export async function getNameOfPodOwner ( pod: NamedNode ): Promise { - // TODO: This is a hack - we cannot assume that the profile is at this document, but we will live with it for now - const webId = sym(`${pod.uri}${DEFAULT_PROFILE_PATH}`) - try { - await store.fetcher.load(webId) - return getName(store, webId) - } catch (err) { - if (!isFetchErrorStatus(err, 403)) { - console.error('getNameOfPodOwner failed on default profile:', err) - } - } - // we try a prefixed pod structure try { const uriUrl = new URL(pod.uri) @@ -92,6 +75,10 @@ export async function getNameOfPodOwner ( await store.fetcher.load(derivedWebId) return getName(store, derivedWebId) } + + const rootWebId = sym(`${uriUrl.origin}/profile/card#me`) + await store.fetcher.load(rootWebId) + return getName(store, rootWebId) } catch (err) { if (!isFetchErrorStatus(err, 403)) { console.error('getNameOfPodOwner failed on derived profile:', err)