From a44b12657048e5a1da6cbffdea19e620775e18f9 Mon Sep 17 00:00:00 2001 From: LiranCohen Date: Wed, 22 Nov 2023 12:47:52 -0500 Subject: [PATCH] Update `DateSort` export and `UnionMessageReply` (#623) * DateSort is an enum, cannot be exported as a type if enum values need to be used * add an optional cursor to the UnionMessageReply for RecordsQueryReply --- src/core/message-reply.ts | 8 +++++++- src/index.ts | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/message-reply.ts b/src/core/message-reply.ts index 95781c39a..7a6693392 100644 --- a/src/core/message-reply.ts +++ b/src/core/message-reply.ts @@ -30,7 +30,13 @@ export type UnionMessageReply = GenericMessageReply & { /** * Data corresponding to the message received if applicable (e.g. RecordsRead). - * Mutually exclusive with `entries`. + * Mutually exclusive with `entries` and `cursor`. */ data?: Readable; + + /** + * A cursor for pagination if applicable (e.g. RecordsQuery). + * Mutually exclusive with `data`. + */ + cursor?: string; }; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index e7282c85b..d7756a7ec 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,13 +8,14 @@ export type { MessagesGetMessage, MessagesGetReply } from './types/messages-type export type { PermissionConditions, PermissionScope, PermissionsGrantDescriptor } from './types/permissions-grant-descriptor.js'; export type { PermissionsGrantMessage, PermissionsRequestDescriptor, PermissionsRequestMessage, PermissionsRevokeDescriptor, PermissionsRevokeMessage } from './types/permissions-types.js'; export type { ProtocolsConfigureDescriptor, ProtocolDefinition, ProtocolTypes, ProtocolRuleSet, ProtocolsQueryFilter, ProtocolsConfigureMessage, ProtocolsQueryMessage, ProtocolsQueryReply } from './types/protocols-types.js'; -export type { DateSort, EncryptionProperty, RecordsDeleteMessage, RecordsQueryMessage, RecordsQueryReply, RecordsQueryReplyEntry, RecordsReadReply, RecordsWriteDescriptor, RecordsWriteMessage } from './types/records-types.js'; +export type { EncryptionProperty, RecordsDeleteMessage, RecordsQueryMessage, RecordsQueryReply, RecordsQueryReplyEntry, RecordsReadReply, RecordsWriteDescriptor, RecordsWriteMessage } from './types/records-types.js'; export { authenticate } from './core/auth.js'; export { AllowAllTenantGate, TenantGate } from './core/tenant-gate.js'; export { Cid } from './utils/cid.js'; export { RecordsQuery, RecordsQueryOptions } from './interfaces/records-query.js'; export { DataStore, PutResult, GetResult, AssociateResult } from './types/data-store.js'; export { DataStream } from './utils/data-stream.js'; +export { DateSort } from './types/records-types.js'; export { DerivedPrivateJwk, HdKey, KeyDerivationScheme } from './utils/hd-key.js'; export { DidKeyResolver } from './did/did-key-resolver.js'; export { DidIonResolver } from './did/did-ion-resolver.js';