Loading CHANGES.md +42 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,12 @@ Version 1.3.24 To be released. - Improved the AT Protocol URI workaround to handle all DID methods and edge cases. The fix now properly percent-encodes any authority component in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods beyond just `did:plc`. Also handles URIs without path components correctly. [[#436]] Version 1.3.23 -------------- Loading Loading @@ -424,6 +430,18 @@ Released on November 30, 2024. [#193]: https://github.com/fedify-dev/fedify/issues/193 Version 1.2.27 -------------- Released on September 17, 2025. - Improved the AT Protocol URI workaround to handle all DID methods and edge cases. The fix now properly percent-encodes any authority component in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods beyond just `did:plc`. Also handles URIs without path components correctly. [[#436]] Version 1.2.26 -------------- Loading Loading @@ -872,6 +890,18 @@ Released on October 31, 2024. [#118]: https://github.com/fedify-dev/fedify/issues/118 Version 1.1.27 -------------- Released on September 17, 2025. - Improved the AT Protocol URI workaround to handle all DID methods and edge cases. The fix now properly percent-encodes any authority component in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods beyond just `did:plc`. Also handles URIs without path components correctly. [[#436]] Version 1.1.26 -------------- Loading Loading @@ -1361,6 +1391,18 @@ Released on October 20, 2024. [#150]: https://github.com/fedify-dev/fedify/issues/150 Version 1.0.30 -------------- Released on September 17, 2025. - Improved the AT Protocol URI workaround to handle all DID methods and edge cases. The fix now properly percent-encodes any authority component in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods beyond just `did:plc`. Also handles URIs without path components correctly. [[#436]] Version 1.0.29 -------------- Loading src/codegen/__snapshots__/class.test.ts.snap +130 −20 Original line number Diff line number Diff line Loading @@ -7070,8 +7070,19 @@ get urls(): ((URL | Link))[] { const decoded = typeof v === \\"object\\" && \\"@id\\" in v && typeof v[\\"@id\\"] === \\"string\\" && v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) && v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"]) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( Loading Loading @@ -12581,8 +12592,19 @@ get endpoints(): (URL)[] { : _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint__array ) { if (v == null) continue; _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; Loading Loading @@ -28348,8 +28370,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl__array ) { if (v == null) continue; _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl = _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl; Loading @@ -28365,8 +28398,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint__array ) { if (v == null) continue; _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint = _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint; Loading @@ -28382,8 +28426,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint__array ) { if (v == null) continue; _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint = _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint; Loading @@ -28399,8 +28454,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey__array ) { if (v == null) continue; _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey = _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey; Loading @@ -28416,8 +28482,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey__array ) { if (v == null) continue; _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey = _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey; Loading @@ -28433,8 +28510,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox__array ) { if (v == null) continue; _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox = _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox; Loading Loading @@ -35930,8 +36018,19 @@ get names(): ((string | LanguageString))[] { : _pVjLsybKQdmkjuU7MHjiVmNnuj7_href__array ) { if (v == null) continue; _pVjLsybKQdmkjuU7MHjiVmNnuj7_href.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _pVjLsybKQdmkjuU7MHjiVmNnuj7_href.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href = _pVjLsybKQdmkjuU7MHjiVmNnuj7_href; Loading Loading @@ -52826,8 +52925,19 @@ proofs?: (DataIntegrityProof | URL)[];accuracy?: number | null;altitude?: number typeof v === \\"object\\" && \\"@value\\" in v && (v[\\"@value\\"] == \\"cm\\" || v[\\"@value\\"] == \\"feet\\" || v[\\"@value\\"] == \\"inches\\" || v[\\"@value\\"] == \\"km\\" || v[\\"@value\\"] == \\"m\\" || v[\\"@value\\"] == \\"miles\\") ? v[\\"@value\\"] : typeof v === \\"object\\" && \\"@id\\" in v && typeof v[\\"@id\\"] === \\"string\\" && v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) && v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"]) : undefined ; if (typeof decoded === \\"undefined\\") continue; src/codegen/type.ts +13 −2 Original line number Diff line number Diff line Loading @@ -144,8 +144,19 @@ const scalarTypes: Record<string, ScalarType> = { && ${v}["@id"] !== "" && ${v}["@id"] !== "/"`; }, decoder(v) { return `${v}["@id"].startsWith("at://did:plc:") ? new URL("at://did%3Aplc%3A" + ${v}["@id"].slice(13)) return `${v}["@id"].startsWith("at://") ? new URL("at://" + encodeURIComponent( ${v}["@id"].includes("/", 5) ? ${v}["@id"].slice(5, ${v}["@id"].indexOf("/", 5)) : ${v}["@id"].slice(5) ) + ( ${v}["@id"].includes("/", 5) ? ${v}["@id"].slice(${v}["@id"].indexOf("/", 5)) : "" ) ) : new URL(${v}["@id"])`; }, }, Loading src/vocab/vocab.test.ts +20 −0 Original line number Diff line number Diff line Loading @@ -820,6 +820,26 @@ test("Link.fromJsonLd()", async () => { "at://did%3Aplc%3Aia76kvnndjutgedggx2ibrem/app.bsky.feed.post/3lyxjjs27jkqg", ), ); const link2 = await Link.fromJsonLd({ "@context": "https://www.w3.org/ns/activitystreams", "type": "Link", "href": "at://bnewbold.bsky.team/app.bsky.feed.post/3jwdwj2ctlk26", }); assertEquals( link2.href, new URL("at://bnewbold.bsky.team/app.bsky.feed.post/3jwdwj2ctlk26"), ); const link3 = await Link.fromJsonLd({ "@context": "https://www.w3.org/ns/activitystreams", "type": "Link", "href": "at://did:plc:ia76kvnndjutgedggx2ibrem", }); assertEquals( link3.href, new URL("at://did%3Aplc%3Aia76kvnndjutgedggx2ibrem"), ); }); function getAllProperties( Loading Loading
CHANGES.md +42 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,12 @@ Version 1.3.24 To be released. - Improved the AT Protocol URI workaround to handle all DID methods and edge cases. The fix now properly percent-encodes any authority component in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods beyond just `did:plc`. Also handles URIs without path components correctly. [[#436]] Version 1.3.23 -------------- Loading Loading @@ -424,6 +430,18 @@ Released on November 30, 2024. [#193]: https://github.com/fedify-dev/fedify/issues/193 Version 1.2.27 -------------- Released on September 17, 2025. - Improved the AT Protocol URI workaround to handle all DID methods and edge cases. The fix now properly percent-encodes any authority component in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods beyond just `did:plc`. Also handles URIs without path components correctly. [[#436]] Version 1.2.26 -------------- Loading Loading @@ -872,6 +890,18 @@ Released on October 31, 2024. [#118]: https://github.com/fedify-dev/fedify/issues/118 Version 1.1.27 -------------- Released on September 17, 2025. - Improved the AT Protocol URI workaround to handle all DID methods and edge cases. The fix now properly percent-encodes any authority component in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods beyond just `did:plc`. Also handles URIs without path components correctly. [[#436]] Version 1.1.26 -------------- Loading Loading @@ -1361,6 +1391,18 @@ Released on October 20, 2024. [#150]: https://github.com/fedify-dev/fedify/issues/150 Version 1.0.30 -------------- Released on September 17, 2025. - Improved the AT Protocol URI workaround to handle all DID methods and edge cases. The fix now properly percent-encodes any authority component in `at://` URIs, supporting `did:web`, `did:key`, and other DID methods beyond just `did:plc`. Also handles URIs without path components correctly. [[#436]] Version 1.0.29 -------------- Loading
src/codegen/__snapshots__/class.test.ts.snap +130 −20 Original line number Diff line number Diff line Loading @@ -7070,8 +7070,19 @@ get urls(): ((URL | Link))[] { const decoded = typeof v === \\"object\\" && \\"@id\\" in v && typeof v[\\"@id\\"] === \\"string\\" && v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) && v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"]) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( Loading Loading @@ -12581,8 +12592,19 @@ get endpoints(): (URL)[] { : _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint__array ) { if (v == null) continue; _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; Loading Loading @@ -28348,8 +28370,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl__array ) { if (v == null) continue; _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl = _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl; Loading @@ -28365,8 +28398,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint__array ) { if (v == null) continue; _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint = _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint; Loading @@ -28382,8 +28426,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint__array ) { if (v == null) continue; _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint = _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint; Loading @@ -28399,8 +28454,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey__array ) { if (v == null) continue; _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey = _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey; Loading @@ -28416,8 +28482,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey__array ) { if (v == null) continue; _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey = _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey; Loading @@ -28433,8 +28510,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox__array ) { if (v == null) continue; _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox = _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox; Loading Loading @@ -35930,8 +36018,19 @@ get names(): ((string | LanguageString))[] { : _pVjLsybKQdmkjuU7MHjiVmNnuj7_href__array ) { if (v == null) continue; _pVjLsybKQdmkjuU7MHjiVmNnuj7_href.push(v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) _pVjLsybKQdmkjuU7MHjiVmNnuj7_href.push(v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"])) } instance.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href = _pVjLsybKQdmkjuU7MHjiVmNnuj7_href; Loading Loading @@ -52826,8 +52925,19 @@ proofs?: (DataIntegrityProof | URL)[];accuracy?: number | null;altitude?: number typeof v === \\"object\\" && \\"@value\\" in v && (v[\\"@value\\"] == \\"cm\\" || v[\\"@value\\"] == \\"feet\\" || v[\\"@value\\"] == \\"inches\\" || v[\\"@value\\"] == \\"km\\" || v[\\"@value\\"] == \\"m\\" || v[\\"@value\\"] == \\"miles\\") ? v[\\"@value\\"] : typeof v === \\"object\\" && \\"@id\\" in v && typeof v[\\"@id\\"] === \\"string\\" && v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? v[\\"@id\\"].startsWith(\\"at://did:plc:\\") ? new URL(\\"at://did%3Aplc%3A\\" + v[\\"@id\\"].slice(13)) && v[\\"@id\\"] !== \\"\\" && v[\\"@id\\"] !== \\"/\\" ? v[\\"@id\\"].startsWith(\\"at://\\") ? new URL(\\"at://\\" + encodeURIComponent( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) : v[\\"@id\\"].slice(5) ) + ( v[\\"@id\\"].includes(\\"/\\", 5) ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) : \\"\\" ) ) : new URL(v[\\"@id\\"]) : undefined ; if (typeof decoded === \\"undefined\\") continue;
src/codegen/type.ts +13 −2 Original line number Diff line number Diff line Loading @@ -144,8 +144,19 @@ const scalarTypes: Record<string, ScalarType> = { && ${v}["@id"] !== "" && ${v}["@id"] !== "/"`; }, decoder(v) { return `${v}["@id"].startsWith("at://did:plc:") ? new URL("at://did%3Aplc%3A" + ${v}["@id"].slice(13)) return `${v}["@id"].startsWith("at://") ? new URL("at://" + encodeURIComponent( ${v}["@id"].includes("/", 5) ? ${v}["@id"].slice(5, ${v}["@id"].indexOf("/", 5)) : ${v}["@id"].slice(5) ) + ( ${v}["@id"].includes("/", 5) ? ${v}["@id"].slice(${v}["@id"].indexOf("/", 5)) : "" ) ) : new URL(${v}["@id"])`; }, }, Loading
src/vocab/vocab.test.ts +20 −0 Original line number Diff line number Diff line Loading @@ -820,6 +820,26 @@ test("Link.fromJsonLd()", async () => { "at://did%3Aplc%3Aia76kvnndjutgedggx2ibrem/app.bsky.feed.post/3lyxjjs27jkqg", ), ); const link2 = await Link.fromJsonLd({ "@context": "https://www.w3.org/ns/activitystreams", "type": "Link", "href": "at://bnewbold.bsky.team/app.bsky.feed.post/3jwdwj2ctlk26", }); assertEquals( link2.href, new URL("at://bnewbold.bsky.team/app.bsky.feed.post/3jwdwj2ctlk26"), ); const link3 = await Link.fromJsonLd({ "@context": "https://www.w3.org/ns/activitystreams", "type": "Link", "href": "at://did:plc:ia76kvnndjutgedggx2ibrem", }); assertEquals( link3.href, new URL("at://did%3Aplc%3Aia76kvnndjutgedggx2ibrem"), ); }); function getAllProperties( Loading