with_authors --> with: With[]
This commit is contained in:
parent
e3d5b2ac4a
commit
2478545cd3
|
@ -172,7 +172,7 @@ async function getFilters<K extends number>(
|
||||||
if (!filters.length) return Promise.resolve([]);
|
if (!filters.length) return Promise.resolve([]);
|
||||||
let query = getFiltersQuery(filters);
|
let query = getFiltersQuery(filters);
|
||||||
|
|
||||||
if (opts.with_authors) {
|
if (opts.with?.includes('authors')) {
|
||||||
query = query
|
query = query
|
||||||
.leftJoin(
|
.leftJoin(
|
||||||
(eb) =>
|
(eb) =>
|
||||||
|
|
|
@ -8,6 +8,9 @@ interface DittoFilter<K extends number = number> extends Filter<K> {
|
||||||
local?: boolean;
|
local?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Additional properties that may be added to events. */
|
||||||
|
type With = 'authors';
|
||||||
|
|
||||||
/** Additional options to apply to the whole subscription. */
|
/** Additional options to apply to the whole subscription. */
|
||||||
interface GetFiltersOpts {
|
interface GetFiltersOpts {
|
||||||
/** How long to wait (in milliseconds) until aborting the request. */
|
/** How long to wait (in milliseconds) until aborting the request. */
|
||||||
|
@ -15,7 +18,7 @@ interface GetFiltersOpts {
|
||||||
/** Event limit for the whole subscription. */
|
/** Event limit for the whole subscription. */
|
||||||
limit?: number;
|
limit?: number;
|
||||||
/** Whether to include a corresponding kind 0 event in the `authors` key of each event. */
|
/** Whether to include a corresponding kind 0 event in the `authors` key of each event. */
|
||||||
with_authors?: boolean;
|
with?: With[];
|
||||||
}
|
}
|
||||||
|
|
||||||
function matchDittoFilter(filter: DittoFilter, event: Event, data: EventData): boolean {
|
function matchDittoFilter(filter: DittoFilter, event: Event, data: EventData): boolean {
|
||||||
|
|
Loading…
Reference in New Issue