From fbb6d698cbf15bbadcc5d634cfd01b6b816fe149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20HANSS?= Date: Fri, 19 Jan 2024 16:42:07 +0100 Subject: [PATCH] Update Notification interface to match correct API https://docs.kuzzle.io/core/2/api/payloads/notifications/#document-notification --- src/types/Notification.ts | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/types/Notification.ts b/src/types/Notification.ts index 7b942f9aa..e926a926d 100644 --- a/src/types/Notification.ts +++ b/src/types/Notification.ts @@ -1,5 +1,5 @@ import { JSONObject } from "./JSONObject"; -import { KDocument, KDocumentContentGeneric } from "."; +import { KDocumentContentGeneric } from "."; /** * Enum for notification types @@ -62,7 +62,21 @@ export interface DocumentNotification< /** * Updated document that triggered the notification */ - result: KDocument; + result: { + /** + * The message or full document content. + */ + _source: TDocContent; + /** + * Document unique ID. + * `null` if the notification is from a real-time message. + */ + _id: string | null; + /** + * List of fields that have been updated (only available on document partial updates). + */ + _updatedFields?: string[]; + }; /** * State of the document regarding the scope (`in` or `out`) */ @@ -95,7 +109,7 @@ export interface UserNotification extends BaseNotification { export interface ServerNotification extends BaseNotification { /** - * Server message explaining why this notifications has been triggered + * Server message explaining why this notifications has been triggered. */ message: string;