Loading CHANGES.md +11 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,17 @@ To be released. - Added `Offer` class to Activity Vocabulary API. [[#65], [#76] by Lee Dogeon] - The below properties of `Collection` and `CollectionPage` in Activity Vocabulary API now do not accept `Link` objects: - `Collection.current` - `Collection.first` - `Collection.last` - `Collection.items` - `CollectionPage.partOf` - `CollectionPage.next` - `CollectionPage.prev` - The key pair or the key pair for signing outgoing HTTP requests made from the shared inbox now can be configured. This improves the compatibility with other ActivityPub implementations that require authorized fetches Loading codegen/__snapshots__/class.test.ts.snap +92 −232 File changed.Preview size limit exceeded, changes collapsed. Show changes federation/handler.ts +6 −7 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ import type { Recipient } from "../vocab/actor.ts"; import { Activity, type CryptographicKey, Link, Object, OrderedCollection, OrderedCollectionPage, Loading Loading @@ -168,7 +167,7 @@ export interface CollectionHandlerParameters<TItem, TContextData, TFilter> { } export async function handleCollection< TItem extends URL | Object | Link | Recipient, TItem extends URL | Object | Recipient, TContextData, TFilter, >( Loading Loading @@ -278,16 +277,16 @@ export async function handleCollection< }); } function filterCollectionItems<TItem extends Object | Link | Recipient | URL>( function filterCollectionItems<TItem extends Object | Recipient | URL>( items: TItem[], collectionName: string, filterPredicate?: (item: TItem) => boolean, ): (Object | Link | URL)[] { const result: (Object | Link | URL)[] = []; ): (Object | URL)[] { const result: (Object | URL)[] = []; let logged = false; for (const item of items) { let mappedItem: Object | Link | URL; if (item instanceof Object || item instanceof Link || item instanceof URL) { let mappedItem: Object | URL; if (item instanceof Object || item instanceof URL) { mappedItem = item; } else if (item.id == null) continue; else mappedItem = item.id; Loading vocab/__snapshots__/vocab.test.ts.snap +8 −8 Original line number Diff line number Diff line Loading @@ -1298,7 +1298,7 @@ snapshot[`Deno.inspect(Collection) [auto] 1`] = ` current: CollectionPage {}, first: CollectionPage {}, last: CollectionPage {}, items: [ Object {}, Link {} ] items: [ Object {} ] }' `; Loading Loading @@ -1415,8 +1415,8 @@ snapshot[`Deno.inspect(CollectionPage) [auto] 1`] = ` current: CollectionPage {}, first: CollectionPage {}, last: CollectionPage {}, items: [ Object {}, Link {} ], partOf: Link {}, items: [ Object {} ], partOf: Collection {}, next: CollectionPage {}, prev: CollectionPage {} }' Loading Loading @@ -1500,7 +1500,7 @@ snapshot[`Deno.inspect(CollectionPage) [auto] 3`] = ` first: CollectionPage {}, last: CollectionPage {}, items: [ Object {}, Object {} ], partOf: Link {}, partOf: Collection {}, next: CollectionPage {}, prev: CollectionPage {} }' Loading Loading @@ -3401,7 +3401,7 @@ snapshot[`Deno.inspect(OrderedCollection) [auto] 1`] = ` current: CollectionPage {}, first: CollectionPage {}, last: CollectionPage {}, items: [ Object {}, Link {} ] items: [ Object {} ] }' `; Loading Loading @@ -3518,8 +3518,8 @@ snapshot[`Deno.inspect(OrderedCollectionPage) [auto] 1`] = ` current: CollectionPage {}, first: CollectionPage {}, last: CollectionPage {}, items: [ Object {}, Link {} ], partOf: Link {}, items: [ Object {} ], partOf: Collection {}, next: CollectionPage {}, prev: CollectionPage {}, startIndex: 123 Loading Loading @@ -3605,7 +3605,7 @@ snapshot[`Deno.inspect(OrderedCollectionPage) [auto] 3`] = ` first: CollectionPage {}, last: CollectionPage {}, items: [ Object {}, Object {} ], partOf: Link {}, partOf: Collection {}, next: CollectionPage {}, prev: CollectionPage {}, startIndex: 123 Loading vocab/collection.yaml +0 −4 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ properties: the most recently updated member items. range: - "https://www.w3.org/ns/activitystreams#CollectionPage" - "https://www.w3.org/ns/activitystreams#Link" - singularName: first functional: true Loading @@ -40,7 +39,6 @@ properties: items in the collection. range: - "https://www.w3.org/ns/activitystreams#CollectionPage" - "https://www.w3.org/ns/activitystreams#Link" - singularName: last functional: true Loading @@ -50,7 +48,6 @@ properties: the collection. range: - "https://www.w3.org/ns/activitystreams#CollectionPage" - "https://www.w3.org/ns/activitystreams#Link" - pluralName: items singularName: item Loading @@ -60,4 +57,3 @@ properties: or unordered. range: - "https://www.w3.org/ns/activitystreams#Object" - "https://www.w3.org/ns/activitystreams#Link" Loading
CHANGES.md +11 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,17 @@ To be released. - Added `Offer` class to Activity Vocabulary API. [[#65], [#76] by Lee Dogeon] - The below properties of `Collection` and `CollectionPage` in Activity Vocabulary API now do not accept `Link` objects: - `Collection.current` - `Collection.first` - `Collection.last` - `Collection.items` - `CollectionPage.partOf` - `CollectionPage.next` - `CollectionPage.prev` - The key pair or the key pair for signing outgoing HTTP requests made from the shared inbox now can be configured. This improves the compatibility with other ActivityPub implementations that require authorized fetches Loading
codegen/__snapshots__/class.test.ts.snap +92 −232 File changed.Preview size limit exceeded, changes collapsed. Show changes
federation/handler.ts +6 −7 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ import type { Recipient } from "../vocab/actor.ts"; import { Activity, type CryptographicKey, Link, Object, OrderedCollection, OrderedCollectionPage, Loading Loading @@ -168,7 +167,7 @@ export interface CollectionHandlerParameters<TItem, TContextData, TFilter> { } export async function handleCollection< TItem extends URL | Object | Link | Recipient, TItem extends URL | Object | Recipient, TContextData, TFilter, >( Loading Loading @@ -278,16 +277,16 @@ export async function handleCollection< }); } function filterCollectionItems<TItem extends Object | Link | Recipient | URL>( function filterCollectionItems<TItem extends Object | Recipient | URL>( items: TItem[], collectionName: string, filterPredicate?: (item: TItem) => boolean, ): (Object | Link | URL)[] { const result: (Object | Link | URL)[] = []; ): (Object | URL)[] { const result: (Object | URL)[] = []; let logged = false; for (const item of items) { let mappedItem: Object | Link | URL; if (item instanceof Object || item instanceof Link || item instanceof URL) { let mappedItem: Object | URL; if (item instanceof Object || item instanceof URL) { mappedItem = item; } else if (item.id == null) continue; else mappedItem = item.id; Loading
vocab/__snapshots__/vocab.test.ts.snap +8 −8 Original line number Diff line number Diff line Loading @@ -1298,7 +1298,7 @@ snapshot[`Deno.inspect(Collection) [auto] 1`] = ` current: CollectionPage {}, first: CollectionPage {}, last: CollectionPage {}, items: [ Object {}, Link {} ] items: [ Object {} ] }' `; Loading Loading @@ -1415,8 +1415,8 @@ snapshot[`Deno.inspect(CollectionPage) [auto] 1`] = ` current: CollectionPage {}, first: CollectionPage {}, last: CollectionPage {}, items: [ Object {}, Link {} ], partOf: Link {}, items: [ Object {} ], partOf: Collection {}, next: CollectionPage {}, prev: CollectionPage {} }' Loading Loading @@ -1500,7 +1500,7 @@ snapshot[`Deno.inspect(CollectionPage) [auto] 3`] = ` first: CollectionPage {}, last: CollectionPage {}, items: [ Object {}, Object {} ], partOf: Link {}, partOf: Collection {}, next: CollectionPage {}, prev: CollectionPage {} }' Loading Loading @@ -3401,7 +3401,7 @@ snapshot[`Deno.inspect(OrderedCollection) [auto] 1`] = ` current: CollectionPage {}, first: CollectionPage {}, last: CollectionPage {}, items: [ Object {}, Link {} ] items: [ Object {} ] }' `; Loading Loading @@ -3518,8 +3518,8 @@ snapshot[`Deno.inspect(OrderedCollectionPage) [auto] 1`] = ` current: CollectionPage {}, first: CollectionPage {}, last: CollectionPage {}, items: [ Object {}, Link {} ], partOf: Link {}, items: [ Object {} ], partOf: Collection {}, next: CollectionPage {}, prev: CollectionPage {}, startIndex: 123 Loading Loading @@ -3605,7 +3605,7 @@ snapshot[`Deno.inspect(OrderedCollectionPage) [auto] 3`] = ` first: CollectionPage {}, last: CollectionPage {}, items: [ Object {}, Object {} ], partOf: Link {}, partOf: Collection {}, next: CollectionPage {}, prev: CollectionPage {}, startIndex: 123 Loading
vocab/collection.yaml +0 −4 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ properties: the most recently updated member items. range: - "https://www.w3.org/ns/activitystreams#CollectionPage" - "https://www.w3.org/ns/activitystreams#Link" - singularName: first functional: true Loading @@ -40,7 +39,6 @@ properties: items in the collection. range: - "https://www.w3.org/ns/activitystreams#CollectionPage" - "https://www.w3.org/ns/activitystreams#Link" - singularName: last functional: true Loading @@ -50,7 +48,6 @@ properties: the collection. range: - "https://www.w3.org/ns/activitystreams#CollectionPage" - "https://www.w3.org/ns/activitystreams#Link" - pluralName: items singularName: item Loading @@ -60,4 +57,3 @@ properties: or unordered. range: - "https://www.w3.org/ns/activitystreams#Object" - "https://www.w3.org/ns/activitystreams#Link"