From bccb95dd30408668ca2cc927fdc09dfef7c7b09b Mon Sep 17 00:00:00 2001 From: Aaron Nwabuoku Date: Wed, 27 Sep 2023 06:41:10 -0400 Subject: [PATCH] fix(core): type page cursors as strings --- packages/core/src/lib/channel.ts | 4 ++-- packages/core/src/lib/message.ts | 1 - packages/core/src/lib/pagination.ts | 5 ++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/core/src/lib/channel.ts b/packages/core/src/lib/channel.ts index c48057a2..bea4e57e 100644 --- a/packages/core/src/lib/channel.ts +++ b/packages/core/src/lib/channel.ts @@ -159,8 +159,8 @@ export type CountUnreadChannelsRequest = ListUnreadChannelsRequest; export declare class RetrieveChannelContextRequest { channel: Channel; - startCursor: number; - endCursor: number; + startCursor: string; + endCursor: string; } export declare class RetrieveChannelUnreadRequest { diff --git a/packages/core/src/lib/message.ts b/packages/core/src/lib/message.ts index 49c27f14..a8abde42 100644 --- a/packages/core/src/lib/message.ts +++ b/packages/core/src/lib/message.ts @@ -23,7 +23,6 @@ export type FileMessage = FileSystemMessage | FileUserMessage; export interface BaseMessage { id: number; - cursor: number; type: string; channelId: number; createdTime: string; diff --git a/packages/core/src/lib/pagination.ts b/packages/core/src/lib/pagination.ts index 84528a43..3bb0dc92 100644 --- a/packages/core/src/lib/pagination.ts +++ b/packages/core/src/lib/pagination.ts @@ -1,4 +1,4 @@ -import StompX, { StompXError, StompXPage } from './stompx'; +import StompX, { StompXError, StompXPage, StompXPageMetadata } from './stompx'; import { ChatKittyError } from './error'; @@ -40,6 +40,7 @@ export class ChatKittyPaginator { return new ChatKittyPaginator( items, + page.page, request.stompX, request.contentName, page._relays.prev, @@ -52,6 +53,7 @@ export class ChatKittyPaginator { private constructor( public items: I[], + public page: StompXPageMetadata, private stompX: StompX, private contentName: string, private prevRelay?: string, @@ -115,6 +117,7 @@ export class ChatKittyPaginator { return new ChatKittyPaginator( items, + page.page, this.stompX, this.contentName, page._relays.prev,