Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Notification interface to match correct API #739

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/types/Notification.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { JSONObject } from "./JSONObject";
import { KDocument, KDocumentContentGeneric } from ".";
import { KDocumentContentGeneric } from ".";

/**
* Enum for notification types
Expand Down Expand Up @@ -62,7 +62,21 @@ export interface DocumentNotification<
/**
* Updated document that triggered the notification
*/
result: KDocument<TDocContent>;
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).
*/
ScreamZ marked this conversation as resolved.
Show resolved Hide resolved
_updatedFields?: string[];
};
/**
* State of the document regarding the scope (`in` or `out`)
*/
Expand Down Expand Up @@ -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;

Expand Down