Loading CHANGES.md +3 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ To be released. option now responds with `Vary: Accept, Signature` header. - Added log messages using the [LogTape] library. Currently the below categories are used: logger categories are used: - `["fedify"]` - `["fedify", "federation"]` Loading @@ -35,6 +35,8 @@ To be released. - Added `RequestContext.getActor()` method. - Activity Vocabulary classes now have `typeId` static property. [public addressing]: https://www.w3.org/TR/activitypub/#public-addressing [authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch [LogTape]: https://github.com/dahlia/logtape Loading codegen/__snapshots__/class.test.ts.snap +318 −17 File changed.Preview size limit exceeded, changes collapsed. Show changes codegen/class.ts +8 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,14 @@ async function* generateClass( } `; } yield ` /** * The type URI of {@link ${type.name}}: \`${typeUri}\`. */ static get typeId(): URL { return new URL(${JSON.stringify(typeUri)}); } `; for await (const code of generateFields(typeUri, types)) yield code; for await (const code of generateConstructor(typeUri, types)) yield code; for await (const code of generateCloner(typeUri, types)) yield code; Loading vocab/vocab.test.ts +4 −0 Original line number Diff line number Diff line Loading @@ -766,4 +766,8 @@ for (const typeUri in types) { await assertSnapshot(t, Deno.inspect(instance3)); }); } Deno.test(`${type.name}.typeId`, () => { assertEquals(cls.typeId, new URL(type.uri)); }); } Loading
CHANGES.md +3 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ To be released. option now responds with `Vary: Accept, Signature` header. - Added log messages using the [LogTape] library. Currently the below categories are used: logger categories are used: - `["fedify"]` - `["fedify", "federation"]` Loading @@ -35,6 +35,8 @@ To be released. - Added `RequestContext.getActor()` method. - Activity Vocabulary classes now have `typeId` static property. [public addressing]: https://www.w3.org/TR/activitypub/#public-addressing [authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch [LogTape]: https://github.com/dahlia/logtape Loading
codegen/__snapshots__/class.test.ts.snap +318 −17 File changed.Preview size limit exceeded, changes collapsed. Show changes
codegen/class.ts +8 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,14 @@ async function* generateClass( } `; } yield ` /** * The type URI of {@link ${type.name}}: \`${typeUri}\`. */ static get typeId(): URL { return new URL(${JSON.stringify(typeUri)}); } `; for await (const code of generateFields(typeUri, types)) yield code; for await (const code of generateConstructor(typeUri, types)) yield code; for await (const code of generateCloner(typeUri, types)) yield code; Loading
vocab/vocab.test.ts +4 −0 Original line number Diff line number Diff line Loading @@ -766,4 +766,8 @@ for (const typeUri in types) { await assertSnapshot(t, Deno.inspect(instance3)); }); } Deno.test(`${type.name}.typeId`, () => { assertEquals(cls.typeId, new URL(type.uri)); }); }