Loading CHANGES.md +46 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,13 @@ Version 1.3.8 To be released. - Fixed a bug with nested object hydration in Activity Vocabulary API where deeply nested properties (like `Object.getAttribution()` on `Activity.getObject()`) were't being properly hydrated during `toJsonLd()` calls. Previously, subsequent calls to `toJsonLd()` on nested objects could result in inconsistent JSON-LD output where nested objects remained as URLs instead of being fully expanded. Version 1.3.7 ------------- Loading Loading @@ -210,6 +217,19 @@ Released on November 30, 2024. [#193]: https://github.com/fedify-dev/fedify/issues/193 Version 1.2.12 -------------- Released on February 10, 2025. - Fixed a bug with nested object hydration in Activity Vocabulary API where deeply nested properties (like `Object.getAttribution()` on `Activity.getObject()`) were't being properly hydrated during `toJsonLd()` calls. Previously, subsequent calls to `toJsonLd()` on nested objects could result in inconsistent JSON-LD output where nested objects remained as URLs instead of being fully expanded. Version 1.2.11 -------------- Loading Loading @@ -457,6 +477,19 @@ Released on October 31, 2024. [#118]: https://github.com/fedify-dev/fedify/issues/118 Version 1.1.12 -------------- Released on February 10, 2025. - Fixed a bug with nested object hydration in Activity Vocabulary API where deeply nested properties (like `Object.getAttribution()` on `Activity.getObject()`) were't being properly hydrated during `toJsonLd()` calls. Previously, subsequent calls to `toJsonLd()` on nested objects could result in inconsistent JSON-LD output where nested objects remained as URLs instead of being fully expanded. Version 1.1.11 -------------- Loading Loading @@ -745,6 +778,19 @@ Released on October 20, 2024. [#150]: https://github.com/fedify-dev/fedify/issues/150 Version 1.0.15 -------------- Released on February 10, 2025. - Fixed a bug with nested object hydration in Activity Vocabulary API where deeply nested properties (like `Object.getAttribution()` on `Activity.getObject()`) were't being properly hydrated during `toJsonLd()` calls. Previously, subsequent calls to `toJsonLd()` on nested objects could result in inconsistent JSON-LD output where nested objects remained as URLs instead of being fully expanded. Version 1.0.14 -------------- Loading src/codegen/__snapshots__/class.test.ts.snap +147 −66 File changed.Preview size limit exceeded, changes collapsed. Show changes src/codegen/class.ts +0 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,6 @@ async function* generateClass( `; } yield ` /** * The type URI of {@link ${type.name}}: \`${typeUri}\`. */ Loading src/codegen/property.ts +2 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ async function* generateProperty( await this.#fetch${toPascalCase(property.singularName)}(v, options); if (fetched == null) return null; this.${await getFieldName(property.uri)}[0] = fetched; this._cachedJsonLd = undefined; return fetched; } `; Loading Loading @@ -236,6 +237,7 @@ async function* generateProperty( v, options); if (fetched == null) continue; vs[i] = fetched; this._cachedJsonLd = undefined; yield fetched; continue; } Loading src/vocab/vocab.test.ts +21 −0 Original line number Diff line number Diff line Loading @@ -378,6 +378,27 @@ test("Activity.getObject()", async () => { assertEquals(object.id, new URL("https://example.com/object")); assertEquals(object.name, "Fetched object"); // Is hydration applied to toJsonLd()? const jsonLd = await activity.toJsonLd(); assertEquals(jsonLd, { "@context": [ "https://w3id.org/identity/v1", "https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1", "https://w3id.org/security/data-integrity/v1", ], type: "Activity", object: { id: "https://example.com/announce", type: "Announce", object: { type: "Object", id: "https://example.com/object", name: "Fetched object", }, }, }); const activity2 = new Activity({ object: new URL("https://example.com/not-found"), }); Loading Loading
CHANGES.md +46 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,13 @@ Version 1.3.8 To be released. - Fixed a bug with nested object hydration in Activity Vocabulary API where deeply nested properties (like `Object.getAttribution()` on `Activity.getObject()`) were't being properly hydrated during `toJsonLd()` calls. Previously, subsequent calls to `toJsonLd()` on nested objects could result in inconsistent JSON-LD output where nested objects remained as URLs instead of being fully expanded. Version 1.3.7 ------------- Loading Loading @@ -210,6 +217,19 @@ Released on November 30, 2024. [#193]: https://github.com/fedify-dev/fedify/issues/193 Version 1.2.12 -------------- Released on February 10, 2025. - Fixed a bug with nested object hydration in Activity Vocabulary API where deeply nested properties (like `Object.getAttribution()` on `Activity.getObject()`) were't being properly hydrated during `toJsonLd()` calls. Previously, subsequent calls to `toJsonLd()` on nested objects could result in inconsistent JSON-LD output where nested objects remained as URLs instead of being fully expanded. Version 1.2.11 -------------- Loading Loading @@ -457,6 +477,19 @@ Released on October 31, 2024. [#118]: https://github.com/fedify-dev/fedify/issues/118 Version 1.1.12 -------------- Released on February 10, 2025. - Fixed a bug with nested object hydration in Activity Vocabulary API where deeply nested properties (like `Object.getAttribution()` on `Activity.getObject()`) were't being properly hydrated during `toJsonLd()` calls. Previously, subsequent calls to `toJsonLd()` on nested objects could result in inconsistent JSON-LD output where nested objects remained as URLs instead of being fully expanded. Version 1.1.11 -------------- Loading Loading @@ -745,6 +778,19 @@ Released on October 20, 2024. [#150]: https://github.com/fedify-dev/fedify/issues/150 Version 1.0.15 -------------- Released on February 10, 2025. - Fixed a bug with nested object hydration in Activity Vocabulary API where deeply nested properties (like `Object.getAttribution()` on `Activity.getObject()`) were't being properly hydrated during `toJsonLd()` calls. Previously, subsequent calls to `toJsonLd()` on nested objects could result in inconsistent JSON-LD output where nested objects remained as URLs instead of being fully expanded. Version 1.0.14 -------------- Loading
src/codegen/__snapshots__/class.test.ts.snap +147 −66 File changed.Preview size limit exceeded, changes collapsed. Show changes
src/codegen/class.ts +0 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,6 @@ async function* generateClass( `; } yield ` /** * The type URI of {@link ${type.name}}: \`${typeUri}\`. */ Loading
src/codegen/property.ts +2 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ async function* generateProperty( await this.#fetch${toPascalCase(property.singularName)}(v, options); if (fetched == null) return null; this.${await getFieldName(property.uri)}[0] = fetched; this._cachedJsonLd = undefined; return fetched; } `; Loading Loading @@ -236,6 +237,7 @@ async function* generateProperty( v, options); if (fetched == null) continue; vs[i] = fetched; this._cachedJsonLd = undefined; yield fetched; continue; } Loading
src/vocab/vocab.test.ts +21 −0 Original line number Diff line number Diff line Loading @@ -378,6 +378,27 @@ test("Activity.getObject()", async () => { assertEquals(object.id, new URL("https://example.com/object")); assertEquals(object.name, "Fetched object"); // Is hydration applied to toJsonLd()? const jsonLd = await activity.toJsonLd(); assertEquals(jsonLd, { "@context": [ "https://w3id.org/identity/v1", "https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1", "https://w3id.org/security/data-integrity/v1", ], type: "Activity", object: { id: "https://example.com/announce", type: "Announce", object: { type: "Object", id: "https://example.com/object", name: "Fetched object", }, }, }); const activity2 = new Activity({ object: new URL("https://example.com/not-found"), }); Loading