Skip to content

Commit

Permalink
public re-exports
Browse files Browse the repository at this point in the history
  • Loading branch information
mfornos committed Jul 3, 2024
1 parent 23b5c07 commit b9beb3b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/client/src/server-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ export type {
QueryResult,
QueryPagination,
AnyQueryArgs,
NetworkURN,
AnyQueryResultItem,
} from '@sodazone/ocelloids-service-node'
2 changes: 1 addition & 1 deletion packages/server/src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
27 changes: 27 additions & 0 deletions packages/server/src/services/agents/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,45 @@ export interface Subscribable {
update(subscriptionId: string, patch: Operation[]): Promise<Subscription> | Subscription
}

/**
* Generic query arguments.
*
* @public
*/
export type AnyQueryArgs = Record<string, any>

/**
* Generic query result item.
*
* @public
*/
export type AnyQueryResultItem = Record<string, any>

/**
* Query pagination options.
*
* @public
*/
export type QueryPagination = {
cursor?: string
limit?: number
}

/**
* The query parameters.
*
* @public
*/
export type QueryParams<T = AnyQueryArgs> = {
args: T
pagination?: QueryPagination
}

/**
* The query result.
*
* @public
*/
export type QueryResult<T = AnyQueryResultItem> = {
items: T[]
pageInfo?: {
Expand Down
5 changes: 5 additions & 0 deletions packages/server/src/services/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<F = Buffer | Uint8Array | string, K = string, V = any> = AbstractLevel<F, K, V>
Expand Down

0 comments on commit b9beb3b

Please sign in to comment.