From b9beb3b7cf65d7d40c2503aa7440522b4df68423 Mon Sep 17 00:00:00 2001 From: Marc Fornos Date: Wed, 3 Jul 2024 13:49:50 +0200 Subject: [PATCH] public re-exports --- packages/client/src/server-types.ts | 1 + packages/server/src/lib.ts | 2 +- packages/server/src/services/agents/types.ts | 27 ++++++++++++++++++++ packages/server/src/services/types.ts | 5 ++++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/packages/client/src/server-types.ts b/packages/client/src/server-types.ts index 63004cd7..59980c03 100644 --- a/packages/client/src/server-types.ts +++ b/packages/client/src/server-types.ts @@ -9,5 +9,6 @@ export type { QueryResult, QueryPagination, AnyQueryArgs, + NetworkURN, AnyQueryResultItem, } from '@sodazone/ocelloids-service-node' diff --git a/packages/server/src/lib.ts b/packages/server/src/lib.ts index ac13115d..c93244a9 100644 --- a/packages/server/src/lib.ts +++ b/packages/server/src/lib.ts @@ -7,7 +7,7 @@ export type { SignerData, SubscriptionId, } from './services/subscriptions/types.js' -export type { AnyJson } from './services/types.js' +export type { AnyJson, NetworkURN } from './services/types.js' export type { AgentId, QueryParams, diff --git a/packages/server/src/services/agents/types.ts b/packages/server/src/services/agents/types.ts index 1d262842..c37ddd55 100644 --- a/packages/server/src/services/agents/types.ts +++ b/packages/server/src/services/agents/types.ts @@ -196,18 +196,45 @@ export interface Subscribable { update(subscriptionId: string, patch: Operation[]): Promise | Subscription } +/** + * Generic query arguments. + * + * @public + */ export type AnyQueryArgs = Record + +/** + * Generic query result item. + * + * @public + */ export type AnyQueryResultItem = Record + +/** + * Query pagination options. + * + * @public + */ export type QueryPagination = { cursor?: string limit?: number } +/** + * The query parameters. + * + * @public + */ export type QueryParams = { args: T pagination?: QueryPagination } +/** + * The query result. + * + * @public + */ export type QueryResult = { items: T[] pageInfo?: { diff --git a/packages/server/src/services/types.ts b/packages/server/src/services/types.ts index d22f4a4f..bf156866 100644 --- a/packages/server/src/services/types.ts +++ b/packages/server/src/services/types.ts @@ -11,6 +11,11 @@ import { Scheduler } from './persistence/scheduler.js' import { SubsStore } from './persistence/subs.js' import { BlockNumberRange, HexString } from './subscriptions/types.js' +/** + * The network URN. + * + * @public + */ export type NetworkURN = `urn:ocn:${string}` export type DB = AbstractLevel