From 22b1d730eb2808ff4cbcf181492727d852bd8334 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 5 Dec 2023 19:40:40 -0600 Subject: [PATCH] with --> extra --- src/db/events.ts | 2 +- src/filter.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/db/events.ts b/src/db/events.ts index c78a6bf..0c1604e 100644 --- a/src/db/events.ts +++ b/src/db/events.ts @@ -172,7 +172,7 @@ async function getFilters( if (!filters.length) return Promise.resolve([]); let query = getFiltersQuery(filters); - if (opts.with?.includes('authors')) { + if (opts.extra?.includes('author')) { query = query .leftJoin( (eb) => diff --git a/src/filter.ts b/src/filter.ts index 5c8e70c..a258a66 100644 --- a/src/filter.ts +++ b/src/filter.ts @@ -8,8 +8,8 @@ interface DittoFilter extends Filter { local?: boolean; } -/** Additional properties that may be added to events. */ -type With = 'authors'; +/** Additional properties that may be added by Ditto to events. */ +type Extra = 'author'; /** Additional options to apply to the whole subscription. */ interface GetFiltersOpts { @@ -18,7 +18,7 @@ interface GetFiltersOpts { /** Event limit for the whole subscription. */ limit?: number; /** Whether to include a corresponding kind 0 event in the `authors` key of each event. */ - with?: With[]; + extra?: Extra[]; } function matchDittoFilter(filter: DittoFilter, event: Event, data: EventData): boolean {