From 516fc03307b8b1e77f4bc68c9cd9a411bad6c91e Mon Sep 17 00:00:00 2001 From: DrMint <29893320+DrMint@users.noreply.github.com> Date: Sun, 28 Jul 2024 13:58:54 +0200 Subject: [PATCH] Removed MeiliDocumentRequest --- meilisearch/types.ts | 120 +++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 79 deletions(-) diff --git a/meilisearch/types.ts b/meilisearch/types.ts index 631f5b2..d1657d7 100644 --- a/meilisearch/types.ts +++ b/meilisearch/types.ts @@ -11,45 +11,7 @@ import type { EndpointChronologyEvent, } from "../payload/endpoint-types"; -export type MeiliDocumentRequest = - | { - slug: string; - type: Collections.Collectibles; - } - | { - slug: string; - type: Collections.Pages; - } - | { - slug: string; - type: Collections.Folders; - } - | { - id: string; - type: Collections.Videos; - } - | { - id: string; - type: Collections.Audios; - } - | { - id: string; - type: Collections.Images; - } - | { - id: string; - type: Collections.Files; - } - | { - id: string; - type: Collections.Recorders; - } - | { - id: string; - type: Collections.ChronologyEvents; - }; - -export type MeiliDocument = MeiliDocumentRequest & { +export type MeiliDocument = { docId: string; distinctId: string; languages: string[]; @@ -58,46 +20,46 @@ export type MeiliDocument = MeiliDocumentRequest & { updatedAt?: number; endpointCalled: string; } & ( - | { - type: Collections.Collectibles; - data: EndpointCollectible; - } - | { - type: Collections.Pages; - data: EndpointPage; - } - | { - type: Collections.Folders; - data: EndpointFolder; - } - | { - type: Collections.Videos; - data: EndpointVideo; - } - | { - type: Collections.Audios; - data: EndpointAudio; - } - | { - type: Collections.Images; - data: EndpointImage; - } - | { - type: Collections.Files; - data: EndpointFile; - } - | { - type: Collections.Recorders; - data: EndpointRecorder; - } - | { - type: Collections.ChronologyEvents; - data: { - date: EndpointChronologyEvent["date"]; - event: EndpointChronologyEvent["events"][number]; - }; - } - ); + | { + type: Collections.Collectibles; + data: EndpointCollectible; + } + | { + type: Collections.Pages; + data: EndpointPage; + } + | { + type: Collections.Folders; + data: EndpointFolder; + } + | { + type: Collections.Videos; + data: EndpointVideo; + } + | { + type: Collections.Audios; + data: EndpointAudio; + } + | { + type: Collections.Images; + data: EndpointImage; + } + | { + type: Collections.Files; + data: EndpointFile; + } + | { + type: Collections.Recorders; + data: EndpointRecorder; + } + | { + type: Collections.ChronologyEvents; + data: { + date: EndpointChronologyEvent["date"]; + event: EndpointChronologyEvent["events"][number]; + }; + } +); export type SearchResponse = { hits: T[];